query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
d0ac10a86953594f63e7d66724477b6e
`reflect.define`, `t.define`, `reflect.wrap`, and `reflect.add`, are all removed.
[ { "docid": "648a6ebd707678ceb5c0f590f6ce9fca", "score": "0.0", "text": "function isLocked(method) {\n return method === \"_\" ||\n method === \"reflect\" ||\n method === \"only\" ||\n method === \"use\" ||\n method === \"reporter\" ||\n method === \"define\" ||\n method === \"timeout\" ||\n method === \"slow\" ||\n method === \"run\" ||\n method === \"test\" ||\n method === \"testSkip\" ||\n method === \"async\" ||\n method === \"asyncSkip\"\n}", "title": "" } ]
[ { "docid": "cbde3c7d7fdc0a34d67c61bc7412379f", "score": "0.6253218", "text": "function cleanContextForImports() {\n __define = global.define\n try {\n global.define = undefined\n } catch (_) {\n log.warn('MetaMask - global.define could not be deleted.')\n }\n }", "title": "" }, { "docid": "9ac0aa1a9d5c563434d0886e4eeb286d", "score": "0.5919153", "text": "function cleanContextForImports () {\n __define = global.define\n try {\n global.define = undefined\n } catch (_) {\n console.warn('Badger - global.define could not be deleted.')\n }\n}", "title": "" }, { "docid": "27c12ca08a4baa35ebcce600cd6c3702", "score": "0.56755584", "text": "function uninstall() {\n window.setTimeout = realSetTimeout;\n window.clearTimeout = realClearTimeout;\n window.setInterval = realSetInterval;\n window.clearInterval = realClearInterval;\n}", "title": "" }, { "docid": "7e27d8cd1d01942a443d88fe689f7872", "score": "0.56469405", "text": "function r(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach((function(i){var o=n?Reflect.getOwnMetadata(i,t,n):Reflect.getOwnMetadata(i,t);n?Reflect.defineMetadata(i,o,e,n):Reflect.defineMetadata(i,o,e)}))}", "title": "" }, { "docid": "f5f4a0396974ff5090f95f56f24fd8f7", "score": "0.5643224", "text": "removeGlobal() {\n GLOBAL_FUNCS.forEach((funcName) => {\n delete global[funcName];\n });\n }", "title": "" }, { "docid": "d2f98a6f89c57364b71ec03410501454", "score": "0.56027704", "text": "function uninstall() {}", "title": "" }, { "docid": "2f5a241bdf50ed66bd2c150c84de716e", "score": "0.5571677", "text": "function Un(t,e){return t(e={exports:{}},e.exports),e.exports}", "title": "" }, { "docid": "061fdf53e6551010d263bbebca06fe94", "score": "0.5555914", "text": "__uninstall () {\n events.forEach(event => {\n window.removeEventListener(event, this.$handlers[event])\n })\n }", "title": "" }, { "docid": "c94add467272da92318aa4d9b1641562", "score": "0.5547209", "text": "function remove() {\n delete module.__proto__.superModule; // eslint-disable-line\n}", "title": "" }, { "docid": "67bd7b504af70135fd22da5b4872d446", "score": "0.5501191", "text": "function makeReflectTraps(names){return names.reduce(function(traps,name){traps[name]=function(state){var args=[],len=arguments.length-1;while(len-->0)args[len]=arguments[len+1];return Reflect[name].apply(Reflect,[latest$2(state)].concat(args));};return traps;},{});}", "title": "" }, { "docid": "22d828e76584637f60fb97027f81e43c", "score": "0.54604906", "text": "function restoreContextAfterImports() {\n try {\n global.define = __define\n } catch (_) {\n log.warn('MetaMask - global.define could not be overwritten.')\n }\n }", "title": "" }, { "docid": "cb06fb3d0ec3b893cbb9a94dd6fb5d67", "score": "0.54322803", "text": "function Gr(t){delete Wr[t]}", "title": "" }, { "docid": "e4b66995e0681c7118f10c5aa9125021", "score": "0.54170763", "text": "clearFrozen() {\n this._freeze = false;\n this._freezeExceptions = {};\n this._freezer = [];\n }", "title": "" }, { "docid": "c79907c0d004d8b7af5128a30cb752b2", "score": "0.5412674", "text": "cleanup() {\n this._forEachProp(prop => delete this._target[prop]);\n this._target = null;\n }", "title": "" }, { "docid": "e6b6e4baed35ed43752010c4c1e96f59", "score": "0.53535587", "text": "function unBoxMethods(object, prototype) {\n if (!object || typeof object['traits'] === 'undefined') {\n return object;\n }\n var names = Object.getOwnPropertyNames(prototype);\n var mangle = '$Bg';\n for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {\n var name_1 = names_1[_i];\n if (!object[name_1] && object[mangle + name_1]) {\n object[name_1] = object[mangle + name_1];\n }\n }\n return object;\n}", "title": "" }, { "docid": "30591d72ae9633b5d5d90a10a3d9b9cb", "score": "0.53516513", "text": "function u(n,r,o){(o?Reflect.getOwnMetadataKeys(r,o):Reflect.getOwnMetadataKeys(r)).forEach(function(t){var e=o?Reflect.getOwnMetadata(t,r,o):Reflect.getOwnMetadata(t,r);o?Reflect.defineMetadata(t,e,n,o):Reflect.defineMetadata(t,e,n)})}", "title": "" }, { "docid": "594aee74ae9078019cd49f230a2593f4", "score": "0.53199184", "text": "function assign() {\n global.__magic = __magic;\n delete __magic;\n delete global.__magic.stack; // I told you\n}", "title": "" }, { "docid": "cb86b44a91f4e4e00ba478953602ab90", "score": "0.5312361", "text": "forgetInstance(abstract) {\n delete this.instances[abstract];\n delete this.bindings[abstract];\n delete this.aliases[abstract];\n }", "title": "" }, { "docid": "47c73188d42ae42db43a746470be38b1", "score": "0.5259697", "text": "destroy(obj) {\n if (typeof obj === 'function') {\n this[__WEBPACK_IMPORTED_MODULE_7__const__[\"f\" /* OBJECTS */]][0].filter(o => !(o instanceof obj));\n } else {\n const i = this[__WEBPACK_IMPORTED_MODULE_7__const__[\"f\" /* OBJECTS */]][0].indexOf(obj);\n if (i >= 0) {\n this[__WEBPACK_IMPORTED_MODULE_7__const__[\"f\" /* OBJECTS */]][0].splice(i, 1);\n }\n }\n }", "title": "" }, { "docid": "41dc492b0038ca036d938b4f61d96681", "score": "0.52107316", "text": "unmock() {\n this.mockImpl = null;\n }", "title": "" }, { "docid": "e8cb6b27e471ffd228e7c269d2a3cdf6", "score": "0.5203342", "text": "function t$18(e,t){e.delete(t);}", "title": "" }, { "docid": "f996414aa0f1b49659b488088198527d", "score": "0.51847154", "text": "function A(t){\"new\"in t&&(t.returnOriginal=!t.new,delete t.new)}", "title": "" }, { "docid": "fab4c8b003ff44c516ba6ef1798ca3bc", "score": "0.5170449", "text": "function removeAllHandlers(tex) {\n tex.destroy = function _emptyDestroy() {};\n tex.on = function _emptyOn() {};\n tex.once = function _emptyOnce() {};\n tex.emit = function _emptyEmit() {};\n}", "title": "" }, { "docid": "8c9be4a73e46010c80ac88f56e2dc88d", "score": "0.5165623", "text": "function removeAttributeHooks() {\n browser_default().removeAllHooks();\n}", "title": "" }, { "docid": "b1e72a8a26318f3329efaea65ae751ee", "score": "0.51628435", "text": "function clean() {\n wrappers.splice(0, wrappers.length);\n plugins.splice(0, plugins.length);\n}", "title": "" }, { "docid": "0309621feb7f83b020385f1dd3f7baf2", "score": "0.51625305", "text": "function p$1(t,e){let n;if(e)for(n in t)t.hasOwnProperty(n)&&(void 0===t[n]?delete t[n]:t[n]instanceof Object&&p$1(t[n],!0));else for(n in t)t.hasOwnProperty(n)&&void 0===t[n]&&delete t[n];return t}", "title": "" }, { "docid": "8ee927d2808a070b7d5da6b331c0b257", "score": "0.51582205", "text": "removed() {}", "title": "" }, { "docid": "79df5608faa66c68ae514c27ce21ea14", "score": "0.5143189", "text": "unuse() {}", "title": "" }, { "docid": "6574e81269c72d49e9f5912bd9a72fe9", "score": "0.5131531", "text": "function restoreContextAfterImports () {\n try {\n global.define = __define\n } catch (_) {\n console.warn('Badger - global.define could not be overwritten.')\n }\n}", "title": "" }, { "docid": "cbaa9c11b49242d2564af5bc8ef333e2", "score": "0.51285", "text": "function caml_js_delete(o,f) { delete o[f]; return 0}", "title": "" }, { "docid": "7f3d350cdaaefa3ee6ffe77ad669f74f", "score": "0.5123844", "text": "function Ir(t){delete Ar[t]}", "title": "" }, { "docid": "c44bbf3cc6435b75b046314ee0200aa4", "score": "0.5118596", "text": "function clean() {\n\tthis.__registeredClasses = {};\n}", "title": "" }, { "docid": "0542f87e60c9e2287fe9b74c70ed020c", "score": "0.5105118", "text": "removeTestHelpers() {\n if (!this.helperContainer) {\n return;\n }\n\n for (let name in _helpers.helpers) {\n this.helperContainer[name] = this.originalMethods[name];\n delete _promise.default.prototype[name];\n delete this.testHelpers[name];\n delete this.originalMethods[name];\n }\n }", "title": "" }, { "docid": "9cbaa8ec60c2e2839bdcd10d8f08680b", "score": "0.50753486", "text": "function deleteUnknownAutoBindMethods(component) {\n\t var names = Object.getOwnPropertyNames(component);\n\t\n\t names.forEach(function (name) {\n\t if (shouldDeleteInstanceMethod(component, name)) {\n\t delete component[name];\n\t }\n\t });\n\t}", "title": "" }, { "docid": "9cbaa8ec60c2e2839bdcd10d8f08680b", "score": "0.50753486", "text": "function deleteUnknownAutoBindMethods(component) {\n\t var names = Object.getOwnPropertyNames(component);\n\t\n\t names.forEach(function (name) {\n\t if (shouldDeleteInstanceMethod(component, name)) {\n\t delete component[name];\n\t }\n\t });\n\t}", "title": "" }, { "docid": "213c7baa177588d0ab0c1df28d756f72", "score": "0.50714874", "text": "function unhoistMethods(source, methodNames) {\n methodNames.forEach(function (methodName) { return delete source[methodName]; });\n}", "title": "" }, { "docid": "213c7baa177588d0ab0c1df28d756f72", "score": "0.50714874", "text": "function unhoistMethods(source, methodNames) {\n methodNames.forEach(function (methodName) { return delete source[methodName]; });\n}", "title": "" }, { "docid": "f7ab015d55baffbedb237156134dff99", "score": "0.5065831", "text": "function d(n,r,i){(i?Reflect.getOwnMetadataKeys(r,i):Reflect.getOwnMetadataKeys(r)).forEach(function(t){var e=i?Reflect.getOwnMetadata(t,r,i):Reflect.getOwnMetadata(t,r);i?Reflect.defineMetadata(t,e,n,i):Reflect.defineMetadata(t,e,n)})}", "title": "" }, { "docid": "26bbf8fd1b5e9a326b3c2f494a7b241d", "score": "0.5063935", "text": "function resetDefs(instr)\n {\n // For each target\n for (var targetIdx = 0; targetIdx < instr.outVals.length; ++targetIdx)\n {\n var defs = instr.outVals[targetIdx];\n\n // For each definition\n for (var defIdx = 0; defIdx < defs.length; ++defIdx)\n {\n var def = defs[defIdx];\n\n // If this is a property initialization, skip it\n if (def.value instanceof TGProperty &&\n def.value.parent.origin === instr)\n continue;\n\n // Reset the definition type\n def.type = TypeSet.empty;\n\n // Add all destinations to the work list\n for (var i = 0; i < def.dests.length; ++i)\n workList.addLast(def.dests[i]);\n }\n }\n }", "title": "" }, { "docid": "c62d34ad168d75e64b781f3509f8733a", "score": "0.50546545", "text": "static DestroyImmediate() {}", "title": "" }, { "docid": "c62d34ad168d75e64b781f3509f8733a", "score": "0.50546545", "text": "static DestroyImmediate() {}", "title": "" }, { "docid": "c62d34ad168d75e64b781f3509f8733a", "score": "0.50546545", "text": "static DestroyImmediate() {}", "title": "" }, { "docid": "c62d34ad168d75e64b781f3509f8733a", "score": "0.50546545", "text": "static DestroyImmediate() {}", "title": "" }, { "docid": "c62d34ad168d75e64b781f3509f8733a", "score": "0.50546545", "text": "static DestroyImmediate() {}", "title": "" }, { "docid": "c62d34ad168d75e64b781f3509f8733a", "score": "0.50546545", "text": "static DestroyImmediate() {}", "title": "" }, { "docid": "c62d34ad168d75e64b781f3509f8733a", "score": "0.50546545", "text": "static DestroyImmediate() {}", "title": "" }, { "docid": "c62d34ad168d75e64b781f3509f8733a", "score": "0.50546545", "text": "static DestroyImmediate() {}", "title": "" }, { "docid": "2b01e2320753745709692e1f42be8cde", "score": "0.50416625", "text": "function _remove(fn, name) {\r\n\t\tvar \r\n\t\t\tapplyTo = _applyTo(fn),\r\n\t\t\tstaticOrInstance = _staticOrInstance(fn),\r\n\t\t\tindex = $.inArray(name, _plugins[staticOrInstance]);\r\n\t\t\r\n\t\tif (index > -1) {\r\n\t\t\t_plugins[staticOrInstance].splice(index, 1);\r\n\t\t\t\r\n\t\t\tapplyTo[name] = undefined;\r\n\t\t}\r\n\t\t\r\n\t\treturn applyTo;\r\n\t}", "title": "" }, { "docid": "939ea4f3e30e45e39822ce7d50a7e80a", "score": "0.50396836", "text": "invalidateSymbols(symbols) {\n for (const symbol of symbols) {\n this.annotationCache.delete(symbol);\n this.shallowAnnotationCache.delete(symbol);\n this.propertyCache.delete(symbol);\n this.parameterCache.delete(symbol);\n this.methodCache.delete(symbol);\n this.staticCache.delete(symbol);\n this.conversionMap.delete(symbol);\n }\n }", "title": "" }, { "docid": "db186206ae8448347bebc428c3bbe5fa", "score": "0.50347286", "text": "removeEventListeners(){this.document&&Je.forEach(function(e){this.document.removeEventListener(e,this.triggerEvent,!1)},this)}", "title": "" }, { "docid": "eab6f5f56baf4c5e1abf97112585b5d8", "score": "0.50318724", "text": "function deleteUnknownAutoBindMethods(component) {\n\t var names = Object.getOwnPropertyNames(component);\n\n\t names.forEach(function (name) {\n\t if (shouldDeleteInstanceMethod(component, name)) {\n\t delete component[name];\n\t }\n\t });\n\t}", "title": "" }, { "docid": "eab6f5f56baf4c5e1abf97112585b5d8", "score": "0.50318724", "text": "function deleteUnknownAutoBindMethods(component) {\n\t var names = Object.getOwnPropertyNames(component);\n\n\t names.forEach(function (name) {\n\t if (shouldDeleteInstanceMethod(component, name)) {\n\t delete component[name];\n\t }\n\t });\n\t}", "title": "" }, { "docid": "eab6f5f56baf4c5e1abf97112585b5d8", "score": "0.50318724", "text": "function deleteUnknownAutoBindMethods(component) {\n\t var names = Object.getOwnPropertyNames(component);\n\n\t names.forEach(function (name) {\n\t if (shouldDeleteInstanceMethod(component, name)) {\n\t delete component[name];\n\t }\n\t });\n\t}", "title": "" }, { "docid": "eab6f5f56baf4c5e1abf97112585b5d8", "score": "0.50318724", "text": "function deleteUnknownAutoBindMethods(component) {\n\t var names = Object.getOwnPropertyNames(component);\n\n\t names.forEach(function (name) {\n\t if (shouldDeleteInstanceMethod(component, name)) {\n\t delete component[name];\n\t }\n\t });\n\t}", "title": "" }, { "docid": "d11e90b9f809bde612bccd7da39ef807", "score": "0.5030984", "text": "clear() {\n for (const spot of this._spots) {\n this._game.dragAndDropManager.unconfigureSpot(spot);\n }\n this._spots = {};\n this._generateFunctions = {};\n }", "title": "" }, { "docid": "a02ee365b3e8e095d979c60592c50f88", "score": "0.50275743", "text": "static _clear() {\n objects.clear()\n }", "title": "" }, { "docid": "6f777012804536eff18a9e574f1d19b8", "score": "0.50177306", "text": "function _i(t){delete xi[t]}", "title": "" }, { "docid": "1169e4249307d5a4d5ad08f9f77a499e", "score": "0.5015695", "text": "clearBindings() {\n\t\tthis._modelToViewMapping = new WeakMap();\n\t\tthis._viewToModelMapping = new WeakMap();\n\t\tthis._markerNameToElements = new Map();\n\t\tthis._elementToMarkerNames = new Map();\n\t\tthis._unboundMarkerNames = new Set();\n\t\tthis._deferredBindingRemovals = new Map();\n\t}", "title": "" }, { "docid": "8b41ab6d15b1f2bf8bce7d9e6291386b", "score": "0.5014681", "text": "function unhoistMethods(source, methodNames) {\n\t methodNames\n\t .forEach(function (methodName) { return delete source[methodName]; });\n\t}", "title": "" }, { "docid": "af905c2b806b0680a2b1f6199f18e2d5", "score": "0.5005449", "text": "clear() {\n this[definitions] = [];\n this[services] = {};\n }", "title": "" }, { "docid": "5a07451013425a6626c2626945a9d609", "score": "0.5005013", "text": "Clear() {\n this.functions = Array();\n }", "title": "" }, { "docid": "e746c8cf36ed7c5dd80dd7e270a15c1c", "score": "0.4998231", "text": "static clearRegistry() {\n dependencyRegistry.clear();\n }", "title": "" }, { "docid": "68b2b3910501f9353f6c82828f8c5027", "score": "0.4997328", "text": "static actualize() {\n for (let i = 0; i < refs.length; ++i) {\n const ref = refs[i];\n if (ref.isOutdated()) {\n ref.remove();\n refs.splice(i--, 1);\n }\n }\n }", "title": "" }, { "docid": "a85ac6f26e0c7a4df0e250acff3c10f2", "score": "0.4995572", "text": "function r$8(r){return o$b(()=>r.forEach(r=>u$4(r)&&r.remove()))}", "title": "" }, { "docid": "96acc7d9d7e55e87c7a9b45ff73d886e", "score": "0.49941263", "text": "function deleteBehavior(fnCallStr)\n{\n\tinitGlobals();\n\teffectsUtils.removeLibraryIncludeIfUnused();\n}", "title": "" }, { "docid": "c55e98ee7cc0c06fb41d1ee32fecb3c2", "score": "0.49919638", "text": "_removeEventListeners() {\n\n this.controlsEl.removeEventListener('touchstart', this._onTouchStartBound);\n this.controlsEl.removeEventListener('mousedown', this._onMouseDownBound);\n\n this.inputEl.removeEventListener('change', this._onChangeBound);\n\n this.handleEl.removeEventListener('focus', this._onFocusBound);\n this.handleEl.removeEventListener('click', this._onClickBound);\n\n window.removeEventListener('resize', this._onResizeBound);\n window.removeEventListener('orientationchange', this._onResizeBound);\n\n document.removeEventListener('spark.visible-children', this._onVisibleChildrenBound);\n }", "title": "" }, { "docid": "4c1956052feddede84dd144b89fdf8ce", "score": "0.49795875", "text": "delete(e){validateName(e=`${e}`);const t=find(this[MAP],e);void 0!==t&&delete this[MAP][t]}", "title": "" }, { "docid": "6a94176bac9fe3a270255af85e64db6d", "score": "0.4978538", "text": "function unhoistMethods(source, methodNames) {\n methodNames.forEach(function (methodName) {\n return delete source[methodName];\n });\n}", "title": "" }, { "docid": "11ac0a53062e791ec7aac26bcc2badcc", "score": "0.4976124", "text": "remove() {}", "title": "" }, { "docid": "de55fdad45955b9b8ac38c832827e237", "score": "0.49752158", "text": "unwireEvents() {\n let resize = 'onorientationchange' in window ? 'orientationchange' : 'resize';\n EventHandler.remove(window, resize, this.onScheduleResize);\n EventHandler.remove(document, Browser.touchStartEvent, this.onDocumentClick);\n EventHandler.remove(this.element, 'mouseover', this.workCellAction.onHover);\n if (this.keyboardInteractionModule) {\n this.keyboardInteractionModule.destroy();\n }\n }", "title": "" }, { "docid": "16057d74ba8569e0640ab84f13fa47a7", "score": "0.4974696", "text": "function Gr(e){delete qr[e]}", "title": "" }, { "docid": "c59f586aa960f64281f5570ddab23b16", "score": "0.49717933", "text": "function Vi(e){delete Fi[e]}", "title": "" }, { "docid": "39d5fc3ed4379ff641d1c00c1925bbf4", "score": "0.4969461", "text": "function rm(){return em.apply(null,arguments)}", "title": "" }, { "docid": "0de946c6488139eb92a084f692b0cadf", "score": "0.49674082", "text": "function invalidateGlobals() {\n //printErr('invalidate globals');\n temp.length = 0;\n for (var name in tracked) {\n var info = tracked[name];\n if (info.usesGlobals) {\n temp.push(name);\n }\n }\n for (var i = 0; i < temp.length; i++) {\n delete tracked[temp[i]];\n }\n }", "title": "" }, { "docid": "3b03f3d022a2f6471c57ad4b4619bd22", "score": "0.49668974", "text": "unregister() {\n if (this._lookupMap) {\n this.commands.forEach(command => {\n command.trigger.forEach(trig => {\n this._lookupMap.delete(trig);\n });\n });\n }\n\n this.commands.clear();\n }", "title": "" }, { "docid": "622231760f1856574d177d67eb5d24ca", "score": "0.49541983", "text": "function $r(t){delete Kr[t]}", "title": "" }, { "docid": "d13031fb2b4d8b0fdf875fc0a8a36c7a", "score": "0.49432072", "text": "deleteClassCallCheck() {\r\n const blocks = this._constructor.body.body;\r\n const constractorName = this._constructor.id.name;\r\n for (let i = 0; i < blocks.length; i++) {\r\n let block = blocks[i];\r\n if (block.type == \"ExpressionStatement\") {\r\n let expressions;\r\n let hasMultipleExps = false;\r\n\r\n if (block.expression.expressions) {\r\n expressions = block.expression.expressions;\r\n hasMultipleExps = true;\r\n } else {\r\n expressions = [block.expression];\r\n }\r\n\r\n for (let j = 0; j < expressions.length; j++) {\r\n if (\r\n expressions[j].type == \"CallExpression\" &&\r\n expressions[j].arguments &&\r\n expressions[j].arguments[0].type == \"ThisExpression\" &&\r\n expressions[j].arguments[1].name == constractorName\r\n ) {\r\n if (hasMultipleExps) expressions.splice(j, 1);\r\n else blocks.splice(i, 1);\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "c21ddaae95604fdf117a35b9fdd741e3", "score": "0.49325612", "text": "function makeReflectTraps(names) {\n return names.reduce(function (traps, name) {\n traps[name] = function (state) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n return Reflect[name].apply(Reflect, [ latest$2(state) ].concat( args ));\n };\n\n return traps;\n }, {});\n }", "title": "" }, { "docid": "c21ddaae95604fdf117a35b9fdd741e3", "score": "0.49325612", "text": "function makeReflectTraps(names) {\n return names.reduce(function (traps, name) {\n traps[name] = function (state) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n return Reflect[name].apply(Reflect, [ latest$2(state) ].concat( args ));\n };\n\n return traps;\n }, {});\n }", "title": "" }, { "docid": "b5d9fcd3281466bc8af371d90e00ad4f", "score": "0.49294907", "text": "function unhoistMethods(source, methodNames) {\n methodNames\n .forEach(function (methodName) { return delete source[methodName]; });\n}", "title": "" }, { "docid": "b5d9fcd3281466bc8af371d90e00ad4f", "score": "0.49294907", "text": "function unhoistMethods(source, methodNames) {\n methodNames\n .forEach(function (methodName) { return delete source[methodName]; });\n}", "title": "" }, { "docid": "57a0d4c4c8a41b9a7fa2c567ffc205f3", "score": "0.49289632", "text": "function clearCache() {\n util._.each(util._.keys(exports.instances), function (x) {\n exports.instances[x] = null;\n delete exports.instances[x];\n });\n util._.each(util._.keys(exports.loadingInstances), function (x) {\n exports.loadingInstances[x] = null;\n delete exports.loadingInstances[x];\n });\n util._.each(util._.keys(capsule.Module.thrustCache), function (x) {\n capsule.Module.thrustCache[x] = null;\n delete capsule.Module.thrustCache[x];\n });\n }", "title": "" }, { "docid": "18bd2be00c953794eb5814c5991e0833", "score": "0.49216235", "text": "remove() {\n this.el.removeEventListener('object3dset', this);\n }", "title": "" }, { "docid": "6fb78040f4143cdc1e572d9c2b973882", "score": "0.49187005", "text": "function zenProxy_clear()\r\n{\r\n\tfor (var prop in this) {\r\n\t\tif ('_' != prop.charAt(0)) {\r\n\t\t\tdelete this[prop];\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "646f6dce1d2fbde0cd85a3d7349c9a41", "score": "0.49102712", "text": "function remove() {\n\t\tif (!loaded) { return; }\n\n\t\tdelete keyboardProps.charCode;\n\t\tdelete keyboardProps.keyCode;\n\t\tdelete keyboardProps.which;\n\t\tdelete keyboardProps._postTransform;\n\n\t\tdelete types.keypress;\n\t\tdelete keyboardCat.keypress;\n\n\t\tloaded = false;\n\t}", "title": "" }, { "docid": "15283958be12bcf049bbb6c455de406f", "score": "0.4901283", "text": "function Zr(e){delete qr[e]}", "title": "" }, { "docid": "9fd00e72f2391ec6bf20050c0b70a89f", "score": "0.48953265", "text": "remove () {\n // unmask all targets\n this.targets().each('unfilter')\n\n // remove mask from parent\n return super.remove()\n }", "title": "" }, { "docid": "3a517d8882232f17d9211ccf064c572a", "score": "0.48941153", "text": "Unbind() {\n this._constantBuffer = null;\n }", "title": "" }, { "docid": "3a517d8882232f17d9211ccf064c572a", "score": "0.48941153", "text": "Unbind() {\n this._constantBuffer = null;\n }", "title": "" }, { "docid": "c8851034f7892f663b329702dffde318", "score": "0.48933905", "text": "removeEventListeners() {\n if (!this.document) {\n return;\n }\n\n _utils_constants__WEBPACK_IMPORTED_MODULE_5__[/* DOM_EVENTS */ \"a\"].forEach(function (eventName) {\n this.document.removeEventListener(eventName, this._triggerEvent, {\n passive: true\n });\n }, this);\n this._triggerEvent = undefined;\n }", "title": "" }, { "docid": "1c612b105c4200001a36a5e5b0cf5703", "score": "0.4892445", "text": "function universalModule() {\n\t var $Object = Object;\n\t\n\tfunction createClass(ctor, methods, staticMethods, superClass) {\n\t var proto;\n\t if (superClass) {\n\t var superProto = superClass.prototype;\n\t proto = $Object.create(superProto);\n\t } else {\n\t proto = ctor.prototype;\n\t }\n\t $Object.keys(methods).forEach(function (key) {\n\t proto[key] = methods[key];\n\t });\n\t $Object.keys(staticMethods).forEach(function (key) {\n\t ctor[key] = staticMethods[key];\n\t });\n\t proto.constructor = ctor;\n\t ctor.prototype = proto;\n\t return ctor;\n\t}\n\t\n\tfunction superCall(self, proto, name, args) {\n\t return $Object.getPrototypeOf(proto)[name].apply(self, args);\n\t}\n\t\n\tfunction defaultSuperCall(self, proto, args) {\n\t superCall(self, proto, 'constructor', args);\n\t}\n\t\n\tvar $traceurRuntime = {};\n\t$traceurRuntime.createClass = createClass;\n\t$traceurRuntime.superCall = superCall;\n\t$traceurRuntime.defaultSuperCall = defaultSuperCall;\n\t\"use strict\";\n\tfunction is(first, second) {\n\t if (first === second) {\n\t return first !== 0 || second !== 0 || 1 / first === 1 / second;\n\t }\n\t if (first !== first) {\n\t return second !== second;\n\t }\n\t if (first && typeof first.equals === 'function') {\n\t return first.equals(second);\n\t }\n\t return false;\n\t}\n\tfunction invariant(condition, error) {\n\t if (!condition)\n\t throw new Error(error);\n\t}\n\tvar DELETE = 'delete';\n\tvar SHIFT = 5;\n\tvar SIZE = 1 << SHIFT;\n\tvar MASK = SIZE - 1;\n\tvar NOT_SET = {};\n\tvar CHANGE_LENGTH = {value: false};\n\tvar DID_ALTER = {value: false};\n\tfunction MakeRef(ref) {\n\t ref.value = false;\n\t return ref;\n\t}\n\tfunction SetRef(ref) {\n\t ref && (ref.value = true);\n\t}\n\tfunction OwnerID() {}\n\tfunction arrCopy(arr, offset) {\n\t offset = offset || 0;\n\t var len = Math.max(0, arr.length - offset);\n\t var newArr = new Array(len);\n\t for (var ii = 0; ii < len; ii++) {\n\t newArr[ii] = arr[ii + offset];\n\t }\n\t return newArr;\n\t}\n\tfunction assertNotInfinite(size) {\n\t invariant(size !== Infinity, 'Cannot perform this action with an infinite size.');\n\t}\n\tfunction ensureSize(iter) {\n\t if (iter.size === undefined) {\n\t iter.size = iter.__iterate(returnTrue);\n\t }\n\t return iter.size;\n\t}\n\tfunction wrapIndex(iter, index) {\n\t return index >= 0 ? index : ensureSize(iter) + index;\n\t}\n\tfunction returnTrue() {\n\t return true;\n\t}\n\tfunction wholeSlice(begin, end, size) {\n\t return (begin === 0 || (size !== undefined && begin <= -size)) && (end === undefined || (size !== undefined && end >= size));\n\t}\n\tfunction resolveBegin(begin, size) {\n\t return resolveIndex(begin, size, 0);\n\t}\n\tfunction resolveEnd(end, size) {\n\t return resolveIndex(end, size, size);\n\t}\n\tfunction resolveIndex(index, size, defaultIndex) {\n\t return index === undefined ? defaultIndex : index < 0 ? Math.max(0, size + index) : size === undefined ? index : Math.min(size, index);\n\t}\n\tfunction hash(o) {\n\t if (!o) {\n\t return 0;\n\t }\n\t if (o === true) {\n\t return 1;\n\t }\n\t var type = typeof o;\n\t if (type === 'number') {\n\t if ((o | 0) === o) {\n\t return o & HASH_MAX_VAL;\n\t }\n\t o = '' + o;\n\t type = 'string';\n\t }\n\t if (type === 'string') {\n\t return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);\n\t }\n\t if (o.hashCode) {\n\t return hash(typeof o.hashCode === 'function' ? o.hashCode() : o.hashCode);\n\t }\n\t return hashJSObj(o);\n\t}\n\tfunction cachedHashString(string) {\n\t var hash = stringHashCache[string];\n\t if (hash === undefined) {\n\t hash = hashString(string);\n\t if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {\n\t STRING_HASH_CACHE_SIZE = 0;\n\t stringHashCache = {};\n\t }\n\t STRING_HASH_CACHE_SIZE++;\n\t stringHashCache[string] = hash;\n\t }\n\t return hash;\n\t}\n\tfunction hashString(string) {\n\t var hash = 0;\n\t for (var ii = 0; ii < string.length; ii++) {\n\t hash = (31 * hash + string.charCodeAt(ii)) & HASH_MAX_VAL;\n\t }\n\t return hash;\n\t}\n\tfunction hashJSObj(obj) {\n\t var hash = weakMap && weakMap.get(obj);\n\t if (hash)\n\t return hash;\n\t hash = obj[UID_HASH_KEY];\n\t if (hash)\n\t return hash;\n\t if (!canDefineProperty) {\n\t hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];\n\t if (hash)\n\t return hash;\n\t hash = getIENodeHash(obj);\n\t if (hash)\n\t return hash;\n\t }\n\t if (Object.isExtensible && !Object.isExtensible(obj)) {\n\t throw new Error('Non-extensible objects are not allowed as keys.');\n\t }\n\t hash = ++objHashUID & HASH_MAX_VAL;\n\t if (weakMap) {\n\t weakMap.set(obj, hash);\n\t } else if (canDefineProperty) {\n\t Object.defineProperty(obj, UID_HASH_KEY, {\n\t 'enumerable': false,\n\t 'configurable': false,\n\t 'writable': false,\n\t 'value': hash\n\t });\n\t } else if (obj.propertyIsEnumerable && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {\n\t obj.propertyIsEnumerable = function() {\n\t return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);\n\t };\n\t obj.propertyIsEnumerable[UID_HASH_KEY] = hash;\n\t } else if (obj.nodeType) {\n\t obj[UID_HASH_KEY] = hash;\n\t } else {\n\t throw new Error('Unable to set a non-enumerable property on object.');\n\t }\n\t return hash;\n\t}\n\tvar canDefineProperty = (function() {\n\t try {\n\t Object.defineProperty({}, 'x', {});\n\t return true;\n\t } catch (e) {\n\t return false;\n\t }\n\t}());\n\tfunction getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1:\n\t return node.uniqueID;\n\t case 9:\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t}\n\tvar weakMap = typeof WeakMap === 'function' && new WeakMap();\n\tvar HASH_MAX_VAL = 0x7FFFFFFF;\n\tvar objHashUID = 0;\n\tvar UID_HASH_KEY = '__immutablehash__';\n\tif (typeof Symbol === 'function') {\n\t UID_HASH_KEY = Symbol(UID_HASH_KEY);\n\t}\n\tvar STRING_HASH_CACHE_MIN_STRLEN = 16;\n\tvar STRING_HASH_CACHE_MAX_SIZE = 255;\n\tvar STRING_HASH_CACHE_SIZE = 0;\n\tvar stringHashCache = {};\n\tvar ITERATE_KEYS = 0;\n\tvar ITERATE_VALUES = 1;\n\tvar ITERATE_ENTRIES = 2;\n\tvar FAUX_ITERATOR_SYMBOL = '@@iterator';\n\tvar REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n\tvar ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;\n\tvar Iterator = function Iterator(next) {\n\t this.next = next;\n\t};\n\t($traceurRuntime.createClass)(Iterator, {toString: function() {\n\t return '[Iterator]';\n\t }}, {});\n\tIterator.KEYS = ITERATE_KEYS;\n\tIterator.VALUES = ITERATE_VALUES;\n\tIterator.ENTRIES = ITERATE_ENTRIES;\n\tvar IteratorPrototype = Iterator.prototype;\n\tIteratorPrototype.inspect = IteratorPrototype.toSource = function() {\n\t return this.toString();\n\t};\n\tIteratorPrototype[ITERATOR_SYMBOL] = function() {\n\t return this;\n\t};\n\tfunction iteratorValue(type, k, v, iteratorResult) {\n\t var value = type === 0 ? k : type === 1 ? v : [k, v];\n\t iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {\n\t value: value,\n\t done: false\n\t });\n\t return iteratorResult;\n\t}\n\tfunction iteratorDone() {\n\t return {\n\t value: undefined,\n\t done: true\n\t };\n\t}\n\tfunction hasIterator(maybeIterable) {\n\t return !!_iteratorFn(maybeIterable);\n\t}\n\tfunction isIterator(maybeIterator) {\n\t return maybeIterator && typeof maybeIterator.next === 'function';\n\t}\n\tfunction getIterator(iterable) {\n\t var iteratorFn = _iteratorFn(iterable);\n\t return iteratorFn && iteratorFn.call(iterable);\n\t}\n\tfunction _iteratorFn(iterable) {\n\t var iteratorFn = iterable && ((REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || iterable[FAUX_ITERATOR_SYMBOL]);\n\t if (typeof iteratorFn === 'function') {\n\t return iteratorFn;\n\t }\n\t}\n\tvar Iterable = function Iterable(value) {\n\t return isIterable(value) ? value : Seq(value);\n\t};\n\tvar $Iterable = Iterable;\n\t($traceurRuntime.createClass)(Iterable, {\n\t toArray: function() {\n\t assertNotInfinite(this.size);\n\t var array = new Array(this.size || 0);\n\t this.valueSeq().__iterate((function(v, i) {\n\t array[i] = v;\n\t }));\n\t return array;\n\t },\n\t toIndexedSeq: function() {\n\t return new ToIndexedSequence(this);\n\t },\n\t toJS: function() {\n\t return this.toSeq().map((function(value) {\n\t return value && typeof value.toJS === 'function' ? value.toJS() : value;\n\t })).__toJS();\n\t },\n\t toKeyedSeq: function() {\n\t return new ToKeyedSequence(this, true);\n\t },\n\t toMap: function() {\n\t assertNotInfinite(this.size);\n\t return Map(this.toKeyedSeq());\n\t },\n\t toObject: function() {\n\t assertNotInfinite(this.size);\n\t var object = {};\n\t this.__iterate((function(v, k) {\n\t object[k] = v;\n\t }));\n\t return object;\n\t },\n\t toOrderedMap: function() {\n\t assertNotInfinite(this.size);\n\t return OrderedMap(this.toKeyedSeq());\n\t },\n\t toSet: function() {\n\t assertNotInfinite(this.size);\n\t return Set(isKeyed(this) ? this.valueSeq() : this);\n\t },\n\t toSetSeq: function() {\n\t return new ToSetSequence(this);\n\t },\n\t toSeq: function() {\n\t return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq();\n\t },\n\t toStack: function() {\n\t assertNotInfinite(this.size);\n\t return Stack(isKeyed(this) ? this.valueSeq() : this);\n\t },\n\t toList: function() {\n\t assertNotInfinite(this.size);\n\t return List(isKeyed(this) ? this.valueSeq() : this);\n\t },\n\t toString: function() {\n\t return '[Iterable]';\n\t },\n\t __toString: function(head, tail) {\n\t if (this.size === 0) {\n\t return head + tail;\n\t }\n\t return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;\n\t },\n\t concat: function() {\n\t for (var values = [],\n\t $__2 = 0; $__2 < arguments.length; $__2++)\n\t values[$__2] = arguments[$__2];\n\t return reify(this, concatFactory(this, values));\n\t },\n\t contains: function(searchValue) {\n\t return this.some((function(value) {\n\t return is(value, searchValue);\n\t }));\n\t },\n\t entries: function() {\n\t return this.__iterator(ITERATE_ENTRIES);\n\t },\n\t every: function(predicate, context) {\n\t var returnValue = true;\n\t this.__iterate((function(v, k, c) {\n\t if (!predicate.call(context, v, k, c)) {\n\t returnValue = false;\n\t return false;\n\t }\n\t }));\n\t return returnValue;\n\t },\n\t filter: function(predicate, context) {\n\t return reify(this, filterFactory(this, predicate, context, true));\n\t },\n\t find: function(predicate, context, notSetValue) {\n\t var foundValue = notSetValue;\n\t this.__iterate((function(v, k, c) {\n\t if (predicate.call(context, v, k, c)) {\n\t foundValue = v;\n\t return false;\n\t }\n\t }));\n\t return foundValue;\n\t },\n\t forEach: function(sideEffect, context) {\n\t return this.__iterate(context ? sideEffect.bind(context) : sideEffect);\n\t },\n\t join: function(separator) {\n\t separator = separator !== undefined ? '' + separator : ',';\n\t var joined = '';\n\t var isFirst = true;\n\t this.__iterate((function(v) {\n\t isFirst ? (isFirst = false) : (joined += separator);\n\t joined += v !== null && v !== undefined ? v : '';\n\t }));\n\t return joined;\n\t },\n\t keys: function() {\n\t return this.__iterator(ITERATE_KEYS);\n\t },\n\t map: function(mapper, context) {\n\t return reify(this, mapFactory(this, mapper, context));\n\t },\n\t reduce: function(reducer, initialReduction, context) {\n\t var reduction;\n\t var useFirst;\n\t if (arguments.length < 2) {\n\t useFirst = true;\n\t } else {\n\t reduction = initialReduction;\n\t }\n\t this.__iterate((function(v, k, c) {\n\t if (useFirst) {\n\t useFirst = false;\n\t reduction = v;\n\t } else {\n\t reduction = reducer.call(context, reduction, v, k, c);\n\t }\n\t }));\n\t return reduction;\n\t },\n\t reduceRight: function(reducer, initialReduction, context) {\n\t var reversed = this.toKeyedSeq().reverse();\n\t return reversed.reduce.apply(reversed, arguments);\n\t },\n\t reverse: function() {\n\t return reify(this, reverseFactory(this, true));\n\t },\n\t slice: function(begin, end) {\n\t if (wholeSlice(begin, end, this.size)) {\n\t return this;\n\t }\n\t var resolvedBegin = resolveBegin(begin, this.size);\n\t var resolvedEnd = resolveEnd(end, this.size);\n\t if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {\n\t return this.toSeq().cacheResult().slice(begin, end);\n\t }\n\t var skipped = resolvedBegin === 0 ? this : this.skip(resolvedBegin);\n\t return reify(this, resolvedEnd === undefined || resolvedEnd === this.size ? skipped : skipped.take(resolvedEnd - resolvedBegin));\n\t },\n\t some: function(predicate, context) {\n\t return !this.every(not(predicate), context);\n\t },\n\t sort: function(comparator) {\n\t return this.sortBy(valueMapper, comparator);\n\t },\n\t values: function() {\n\t return this.__iterator(ITERATE_VALUES);\n\t },\n\t butLast: function() {\n\t return this.slice(0, -1);\n\t },\n\t count: function(predicate, context) {\n\t return ensureSize(predicate ? this.toSeq().filter(predicate, context) : this);\n\t },\n\t countBy: function(grouper, context) {\n\t return countByFactory(this, grouper, context);\n\t },\n\t equals: function(other) {\n\t if (this === other) {\n\t return true;\n\t }\n\t if (!other || typeof other.equals !== 'function') {\n\t return false;\n\t }\n\t if (this.size !== undefined && other.size !== undefined) {\n\t if (this.size !== other.size) {\n\t return false;\n\t }\n\t if (this.size === 0 && other.size === 0) {\n\t return true;\n\t }\n\t }\n\t if (this.__hash !== undefined && other.__hash !== undefined && this.__hash !== other.__hash) {\n\t return false;\n\t }\n\t return this.__deepEquals(other);\n\t },\n\t __deepEquals: function(other) {\n\t var entries = this.entries();\n\t return typeof other.every === 'function' && other.every((function(v, k) {\n\t var entry = entries.next().value;\n\t return entry && is(entry[0], k) && is(entry[1], v);\n\t })) && entries.next().done;\n\t },\n\t entrySeq: function() {\n\t var iterable = this;\n\t if (iterable._cache) {\n\t return new ArraySeq(iterable._cache);\n\t }\n\t var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();\n\t entriesSequence.fromEntrySeq = (function() {\n\t return iterable.toSeq();\n\t });\n\t return entriesSequence;\n\t },\n\t filterNot: function(predicate, context) {\n\t return this.filter(not(predicate), context);\n\t },\n\t findLast: function(predicate, context, notSetValue) {\n\t return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);\n\t },\n\t first: function() {\n\t return this.find(returnTrue);\n\t },\n\t flatMap: function(mapper, context) {\n\t return reify(this, flatMapFactory(this, mapper, context));\n\t },\n\t flatten: function(depth) {\n\t return reify(this, flattenFactory(this, depth, true));\n\t },\n\t fromEntrySeq: function() {\n\t return new FromEntriesSequence(this);\n\t },\n\t get: function(searchKey, notSetValue) {\n\t return this.find((function(_, key) {\n\t return is(key, searchKey);\n\t }), undefined, notSetValue);\n\t },\n\t getIn: function(searchKeyPath, notSetValue) {\n\t var nested = this;\n\t if (searchKeyPath) {\n\t for (var ii = 0; ii < searchKeyPath.length; ii++) {\n\t nested = nested && nested.get ? nested.get(searchKeyPath[ii], NOT_SET) : NOT_SET;\n\t if (nested === NOT_SET) {\n\t return notSetValue;\n\t }\n\t }\n\t }\n\t return nested;\n\t },\n\t groupBy: function(grouper, context) {\n\t return groupByFactory(this, grouper, context);\n\t },\n\t has: function(searchKey) {\n\t return this.get(searchKey, NOT_SET) !== NOT_SET;\n\t },\n\t isSubset: function(iter) {\n\t iter = typeof iter.contains === 'function' ? iter : $Iterable(iter);\n\t return this.every((function(value) {\n\t return iter.contains(value);\n\t }));\n\t },\n\t isSuperset: function(iter) {\n\t return iter.isSubset(this);\n\t },\n\t keySeq: function() {\n\t return this.toSeq().map(keyMapper).toIndexedSeq();\n\t },\n\t last: function() {\n\t return this.toSeq().reverse().first();\n\t },\n\t max: function(comparator) {\n\t return this.maxBy(valueMapper, comparator);\n\t },\n\t maxBy: function(mapper, comparator) {\n\t var $__0 = this;\n\t comparator = comparator || defaultComparator;\n\t var maxEntry = this.entrySeq().reduce((function(max, next) {\n\t return comparator(mapper(next[1], next[0], $__0), mapper(max[1], max[0], $__0)) > 0 ? next : max;\n\t }));\n\t return maxEntry && maxEntry[1];\n\t },\n\t min: function(comparator) {\n\t return this.minBy(valueMapper, comparator);\n\t },\n\t minBy: function(mapper, comparator) {\n\t var $__0 = this;\n\t comparator = comparator || defaultComparator;\n\t var minEntry = this.entrySeq().reduce((function(min, next) {\n\t return comparator(mapper(next[1], next[0], $__0), mapper(min[1], min[0], $__0)) < 0 ? next : min;\n\t }));\n\t return minEntry && minEntry[1];\n\t },\n\t rest: function() {\n\t return this.slice(1);\n\t },\n\t skip: function(amount) {\n\t return reify(this, skipFactory(this, amount, true));\n\t },\n\t skipLast: function(amount) {\n\t return reify(this, this.toSeq().reverse().skip(amount).reverse());\n\t },\n\t skipWhile: function(predicate, context) {\n\t return reify(this, skipWhileFactory(this, predicate, context, true));\n\t },\n\t skipUntil: function(predicate, context) {\n\t return this.skipWhile(not(predicate), context);\n\t },\n\t sortBy: function(mapper, comparator) {\n\t var $__0 = this;\n\t comparator = comparator || defaultComparator;\n\t return reify(this, new ArraySeq(this.entrySeq().entrySeq().toArray().sort((function(a, b) {\n\t return comparator(mapper(a[1][1], a[1][0], $__0), mapper(b[1][1], b[1][0], $__0)) || a[0] - b[0];\n\t }))).fromEntrySeq().valueSeq().fromEntrySeq());\n\t },\n\t take: function(amount) {\n\t return reify(this, takeFactory(this, amount));\n\t },\n\t takeLast: function(amount) {\n\t return reify(this, this.toSeq().reverse().take(amount).reverse());\n\t },\n\t takeWhile: function(predicate, context) {\n\t return reify(this, takeWhileFactory(this, predicate, context));\n\t },\n\t takeUntil: function(predicate, context) {\n\t return this.takeWhile(not(predicate), context);\n\t },\n\t valueSeq: function() {\n\t return this.toIndexedSeq();\n\t },\n\t hashCode: function() {\n\t return this.__hash || (this.__hash = this.size === Infinity ? 0 : this.reduce((function(h, v, k) {\n\t return (h + (hash(v) ^ (v === k ? 0 : hash(k)))) & HASH_MAX_VAL;\n\t }), 0));\n\t }\n\t}, {});\n\tvar IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\n\tvar IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\n\tvar IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';\n\tvar IterablePrototype = Iterable.prototype;\n\tIterablePrototype[IS_ITERABLE_SENTINEL] = true;\n\tIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;\n\tIterablePrototype.toJSON = IterablePrototype.toJS;\n\tIterablePrototype.__toJS = IterablePrototype.toArray;\n\tIterablePrototype.__toStringMapper = quoteString;\n\tIterablePrototype.inspect = IterablePrototype.toSource = function() {\n\t return this.toString();\n\t};\n\tIterablePrototype.chain = IterablePrototype.flatMap;\n\t(function() {\n\t try {\n\t Object.defineProperty(IterablePrototype, 'length', {get: function() {\n\t if (!Iterable.noLengthWarning) {\n\t var stack;\n\t try {\n\t throw new Error();\n\t } catch (error) {\n\t stack = error.stack;\n\t }\n\t if (stack.indexOf('_wrapObject') === -1) {\n\t console && console.warn && console.warn('iterable.length has been deprecated, ' + 'use iterable.size or iterable.count(). ' + 'This warning will become a silent error in a future version. ' + stack);\n\t return this.size;\n\t }\n\t }\n\t }});\n\t } catch (e) {}\n\t})();\n\tvar KeyedIterable = function KeyedIterable(value) {\n\t return isKeyed(value) ? value : KeyedSeq(value);\n\t};\n\t($traceurRuntime.createClass)(KeyedIterable, {\n\t flip: function() {\n\t return reify(this, flipFactory(this));\n\t },\n\t findKey: function(predicate, context) {\n\t var foundKey;\n\t this.__iterate((function(v, k, c) {\n\t if (predicate.call(context, v, k, c)) {\n\t foundKey = k;\n\t return false;\n\t }\n\t }));\n\t return foundKey;\n\t },\n\t findLastKey: function(predicate, context) {\n\t return this.toSeq().reverse().findKey(predicate, context);\n\t },\n\t keyOf: function(searchValue) {\n\t return this.findKey((function(value) {\n\t return is(value, searchValue);\n\t }));\n\t },\n\t lastKeyOf: function(searchValue) {\n\t return this.toSeq().reverse().keyOf(searchValue);\n\t },\n\t mapEntries: function(mapper, context) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t return reify(this, this.toSeq().map((function(v, k) {\n\t return mapper.call(context, [k, v], iterations++, $__0);\n\t })).fromEntrySeq());\n\t },\n\t mapKeys: function(mapper, context) {\n\t var $__0 = this;\n\t return reify(this, this.toSeq().flip().map((function(k, v) {\n\t return mapper.call(context, k, v, $__0);\n\t })).flip());\n\t }\n\t}, {}, Iterable);\n\tvar KeyedIterablePrototype = KeyedIterable.prototype;\n\tKeyedIterablePrototype[IS_KEYED_SENTINEL] = true;\n\tKeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;\n\tKeyedIterablePrototype.__toJS = IterablePrototype.toObject;\n\tKeyedIterablePrototype.__toStringMapper = (function(v, k) {\n\t return k + ': ' + quoteString(v);\n\t});\n\tvar IndexedIterable = function IndexedIterable(value) {\n\t return isIndexed(value) ? value : IndexedSeq(value);\n\t};\n\t($traceurRuntime.createClass)(IndexedIterable, {\n\t toKeyedSeq: function() {\n\t return new ToKeyedSequence(this, false);\n\t },\n\t filter: function(predicate, context) {\n\t return reify(this, filterFactory(this, predicate, context, false));\n\t },\n\t findIndex: function(predicate, context) {\n\t var key = this.toKeyedSeq().findKey(predicate, context);\n\t return key === undefined ? -1 : key;\n\t },\n\t indexOf: function(searchValue) {\n\t var key = this.toKeyedSeq().keyOf(searchValue);\n\t return key === undefined ? -1 : key;\n\t },\n\t lastIndexOf: function(searchValue) {\n\t var key = this.toKeyedSeq().lastKeyOf(searchValue);\n\t return key === undefined ? -1 : key;\n\t },\n\t reverse: function() {\n\t return reify(this, reverseFactory(this, false));\n\t },\n\t splice: function(index, removeNum) {\n\t var numArgs = arguments.length;\n\t removeNum = Math.max(removeNum | 0, 0);\n\t if (numArgs === 0 || (numArgs === 2 && !removeNum)) {\n\t return this;\n\t }\n\t index = resolveBegin(index, this.size);\n\t var spliced = this.slice(0, index);\n\t return reify(this, numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)));\n\t },\n\t findLastIndex: function(predicate, context) {\n\t var key = this.toKeyedSeq().findLastKey(predicate, context);\n\t return key === undefined ? -1 : key;\n\t },\n\t first: function() {\n\t return this.get(0);\n\t },\n\t flatten: function(depth) {\n\t return reify(this, flattenFactory(this, depth, false));\n\t },\n\t get: function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t return (index < 0 || (this.size === Infinity || (this.size !== undefined && index > this.size))) ? notSetValue : this.find((function(_, key) {\n\t return key === index;\n\t }), undefined, notSetValue);\n\t },\n\t has: function(index) {\n\t index = wrapIndex(this, index);\n\t return index >= 0 && (this.size !== undefined ? this.size === Infinity || index < this.size : this.indexOf(index) !== -1);\n\t },\n\t interpose: function(separator) {\n\t return reify(this, interposeFactory(this, separator));\n\t },\n\t last: function() {\n\t return this.get(-1);\n\t },\n\t skip: function(amount) {\n\t var iter = this;\n\t var skipSeq = skipFactory(iter, amount, false);\n\t if (isSeq(iter) && skipSeq !== iter) {\n\t skipSeq.get = function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t return index >= 0 ? iter.get(index + amount, notSetValue) : notSetValue;\n\t };\n\t }\n\t return reify(this, skipSeq);\n\t },\n\t skipWhile: function(predicate, context) {\n\t return reify(this, skipWhileFactory(this, predicate, context, false));\n\t },\n\t sortBy: function(mapper, comparator) {\n\t var $__0 = this;\n\t comparator = comparator || defaultComparator;\n\t return reify(this, new ArraySeq(this.entrySeq().toArray().sort((function(a, b) {\n\t return comparator(mapper(a[1], a[0], $__0), mapper(b[1], b[0], $__0)) || a[0] - b[0];\n\t }))).fromEntrySeq().valueSeq());\n\t },\n\t take: function(amount) {\n\t var iter = this;\n\t var takeSeq = takeFactory(iter, amount);\n\t if (isSeq(iter) && takeSeq !== iter) {\n\t takeSeq.get = function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t return index >= 0 && index < amount ? iter.get(index, notSetValue) : notSetValue;\n\t };\n\t }\n\t return reify(this, takeSeq);\n\t }\n\t}, {}, Iterable);\n\tIndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;\n\tvar SetIterable = function SetIterable(value) {\n\t return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);\n\t};\n\t($traceurRuntime.createClass)(SetIterable, {\n\t get: function(value, notSetValue) {\n\t return this.has(value) ? value : notSetValue;\n\t },\n\t contains: function(value) {\n\t return this.has(value);\n\t },\n\t keySeq: function() {\n\t return this.valueSeq();\n\t }\n\t}, {}, Iterable);\n\tSetIterable.prototype.has = IterablePrototype.contains;\n\tfunction isIterable(maybeIterable) {\n\t return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);\n\t}\n\tfunction isKeyed(maybeKeyed) {\n\t return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);\n\t}\n\tfunction isIndexed(maybeIndexed) {\n\t return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);\n\t}\n\tfunction isAssociative(maybeAssociative) {\n\t return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);\n\t}\n\tIterable.isIterable = isIterable;\n\tIterable.isKeyed = isKeyed;\n\tIterable.isIndexed = isIndexed;\n\tIterable.isAssociative = isAssociative;\n\tIterable.Keyed = KeyedIterable;\n\tIterable.Indexed = IndexedIterable;\n\tIterable.Set = SetIterable;\n\tIterable.Iterator = Iterator;\n\tfunction valueMapper(v) {\n\t return v;\n\t}\n\tfunction keyMapper(v, k) {\n\t return k;\n\t}\n\tfunction entryMapper(v, k) {\n\t return [k, v];\n\t}\n\tfunction not(predicate) {\n\t return function() {\n\t return !predicate.apply(this, arguments);\n\t };\n\t}\n\tfunction quoteString(value) {\n\t return typeof value === 'string' ? JSON.stringify(value) : value;\n\t}\n\tfunction defaultComparator(a, b) {\n\t return a > b ? 1 : a < b ? -1 : 0;\n\t}\n\tfunction mixin(ctor, methods) {\n\t var proto = ctor.prototype;\n\t var keyCopier = (function(key) {\n\t proto[key] = methods[key];\n\t });\n\t Object.keys(methods).forEach(keyCopier);\n\t Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier);\n\t return ctor;\n\t}\n\tvar Seq = function Seq(value) {\n\t return value === null || value === undefined ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value);\n\t};\n\tvar $Seq = Seq;\n\t($traceurRuntime.createClass)(Seq, {\n\t toSeq: function() {\n\t return this;\n\t },\n\t toString: function() {\n\t return this.__toString('Seq {', '}');\n\t },\n\t cacheResult: function() {\n\t if (!this._cache && this.__iterateUncached) {\n\t this._cache = this.entrySeq().toArray();\n\t this.size = this._cache.length;\n\t }\n\t return this;\n\t },\n\t __iterate: function(fn, reverse) {\n\t return seqIterate(this, fn, reverse, true);\n\t },\n\t __iterator: function(type, reverse) {\n\t return seqIterator(this, type, reverse, true);\n\t }\n\t}, {of: function() {\n\t return $Seq(arguments);\n\t }}, Iterable);\n\tvar KeyedSeq = function KeyedSeq(value) {\n\t return value === null || value === undefined ? emptySequence().toKeyedSeq() : isIterable(value) ? (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : keyedSeqFromValue(value);\n\t};\n\tvar $KeyedSeq = KeyedSeq;\n\t($traceurRuntime.createClass)(KeyedSeq, {\n\t toKeyedSeq: function() {\n\t return this;\n\t },\n\t toSeq: function() {\n\t return this;\n\t }\n\t}, {of: function() {\n\t return $KeyedSeq(arguments);\n\t }}, Seq);\n\tmixin(KeyedSeq, KeyedIterable.prototype);\n\tvar IndexedSeq = function IndexedSeq(value) {\n\t return value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();\n\t};\n\tvar $IndexedSeq = IndexedSeq;\n\t($traceurRuntime.createClass)(IndexedSeq, {\n\t toIndexedSeq: function() {\n\t return this;\n\t },\n\t toString: function() {\n\t return this.__toString('Seq [', ']');\n\t },\n\t __iterate: function(fn, reverse) {\n\t return seqIterate(this, fn, reverse, false);\n\t },\n\t __iterator: function(type, reverse) {\n\t return seqIterator(this, type, reverse, false);\n\t }\n\t}, {of: function() {\n\t return $IndexedSeq(arguments);\n\t }}, Seq);\n\tmixin(IndexedSeq, IndexedIterable.prototype);\n\tvar SetSeq = function SetSeq(value) {\n\t return (value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value).toSetSeq();\n\t};\n\tvar $SetSeq = SetSeq;\n\t($traceurRuntime.createClass)(SetSeq, {toSetSeq: function() {\n\t return this;\n\t }}, {of: function() {\n\t return $SetSeq(arguments);\n\t }}, Seq);\n\tmixin(SetSeq, SetIterable.prototype);\n\tSeq.isSeq = isSeq;\n\tSeq.Keyed = KeyedSeq;\n\tSeq.Set = SetSeq;\n\tSeq.Indexed = IndexedSeq;\n\tvar IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';\n\tSeq.prototype[IS_SEQ_SENTINEL] = true;\n\tvar ArraySeq = function ArraySeq(array) {\n\t this._array = array;\n\t this.size = array.length;\n\t};\n\t($traceurRuntime.createClass)(ArraySeq, {\n\t get: function(index, notSetValue) {\n\t return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;\n\t },\n\t __iterate: function(fn, reverse) {\n\t var array = this._array;\n\t var maxIndex = array.length - 1;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var array = this._array;\n\t var maxIndex = array.length - 1;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]);\n\t }));\n\t }\n\t}, {}, IndexedSeq);\n\tvar ObjectSeq = function ObjectSeq(object) {\n\t var keys = Object.keys(object);\n\t this._object = object;\n\t this._keys = keys;\n\t this.size = keys.length;\n\t};\n\t($traceurRuntime.createClass)(ObjectSeq, {\n\t get: function(key, notSetValue) {\n\t if (notSetValue !== undefined && !this.has(key)) {\n\t return notSetValue;\n\t }\n\t return this._object[key];\n\t },\n\t has: function(key) {\n\t return this._object.hasOwnProperty(key);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var object = this._object;\n\t var keys = this._keys;\n\t var maxIndex = keys.length - 1;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t var key = keys[reverse ? maxIndex - ii : ii];\n\t if (fn(object[key], key, this) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var object = this._object;\n\t var keys = this._keys;\n\t var maxIndex = keys.length - 1;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t var key = keys[reverse ? maxIndex - ii : ii];\n\t return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]);\n\t }));\n\t }\n\t}, {}, KeyedSeq);\n\tvar IterableSeq = function IterableSeq(iterable) {\n\t this._iterable = iterable;\n\t this.size = iterable.length || iterable.size;\n\t};\n\t($traceurRuntime.createClass)(IterableSeq, {\n\t __iterateUncached: function(fn, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterable = this._iterable;\n\t var iterator = getIterator(iterable);\n\t var iterations = 0;\n\t if (isIterator(iterator)) {\n\t var step;\n\t while (!(step = iterator.next()).done) {\n\t if (fn(step.value, iterations++, this) === false) {\n\t break;\n\t }\n\t }\n\t }\n\t return iterations;\n\t },\n\t __iteratorUncached: function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterable = this._iterable;\n\t var iterator = getIterator(iterable);\n\t if (!isIterator(iterator)) {\n\t return new Iterator(iteratorDone);\n\t }\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, iterations++, step.value);\n\t }));\n\t }\n\t}, {}, IndexedSeq);\n\tvar IteratorSeq = function IteratorSeq(iterator) {\n\t this._iterator = iterator;\n\t this._iteratorCache = [];\n\t};\n\t($traceurRuntime.createClass)(IteratorSeq, {\n\t __iterateUncached: function(fn, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterator = this._iterator;\n\t var cache = this._iteratorCache;\n\t var iterations = 0;\n\t while (iterations < cache.length) {\n\t if (fn(cache[iterations], iterations++, this) === false) {\n\t return iterations;\n\t }\n\t }\n\t var step;\n\t while (!(step = iterator.next()).done) {\n\t var val = step.value;\n\t cache[iterations] = val;\n\t if (fn(val, iterations++, this) === false) {\n\t break;\n\t }\n\t }\n\t return iterations;\n\t },\n\t __iteratorUncached: function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = this._iterator;\n\t var cache = this._iteratorCache;\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t if (iterations >= cache.length) {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t cache[iterations] = step.value;\n\t }\n\t return iteratorValue(type, iterations, cache[iterations++]);\n\t }));\n\t }\n\t}, {}, IndexedSeq);\n\tfunction isSeq(maybeSeq) {\n\t return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);\n\t}\n\tvar EMPTY_SEQ;\n\tfunction emptySequence() {\n\t return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));\n\t}\n\tfunction keyedSeqFromValue(value) {\n\t var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : typeof value === 'object' ? new ObjectSeq(value) : undefined;\n\t if (!seq) {\n\t throw new TypeError('Expected Array or iterable object of [k, v] entries, ' + 'or keyed object: ' + value);\n\t }\n\t return seq;\n\t}\n\tfunction indexedSeqFromValue(value) {\n\t var seq = maybeIndexedSeqFromValue(value);\n\t if (!seq) {\n\t throw new TypeError('Expected Array or iterable object of values: ' + value);\n\t }\n\t return seq;\n\t}\n\tfunction seqFromValue(value) {\n\t var seq = maybeIndexedSeqFromValue(value) || (typeof value === 'object' && new ObjectSeq(value));\n\t if (!seq) {\n\t throw new TypeError('Expected Array or iterable object of values, or keyed object: ' + value);\n\t }\n\t return seq;\n\t}\n\tfunction maybeIndexedSeqFromValue(value) {\n\t return (isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : undefined);\n\t}\n\tfunction isArrayLike(value) {\n\t return value && typeof value.length === 'number';\n\t}\n\tfunction seqIterate(seq, fn, reverse, useKeys) {\n\t assertNotInfinite(seq.size);\n\t var cache = seq._cache;\n\t if (cache) {\n\t var maxIndex = cache.length - 1;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t var entry = cache[reverse ? maxIndex - ii : ii];\n\t if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t }\n\t return seq.__iterateUncached(fn, reverse);\n\t}\n\tfunction seqIterator(seq, type, reverse, useKeys) {\n\t var cache = seq._cache;\n\t if (cache) {\n\t var maxIndex = cache.length - 1;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t var entry = cache[reverse ? maxIndex - ii : ii];\n\t return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);\n\t }));\n\t }\n\t return seq.__iteratorUncached(type, reverse);\n\t}\n\tfunction fromJS(json, converter) {\n\t return converter ? _fromJSWith(converter, json, '', {'': json}) : _fromJSDefault(json);\n\t}\n\tfunction _fromJSWith(converter, json, key, parentJSON) {\n\t if (Array.isArray(json)) {\n\t return converter.call(parentJSON, key, IndexedSeq(json).map((function(v, k) {\n\t return _fromJSWith(converter, v, k, json);\n\t })));\n\t }\n\t if (isPlainObj(json)) {\n\t return converter.call(parentJSON, key, KeyedSeq(json).map((function(v, k) {\n\t return _fromJSWith(converter, v, k, json);\n\t })));\n\t }\n\t return json;\n\t}\n\tfunction _fromJSDefault(json) {\n\t if (Array.isArray(json)) {\n\t return IndexedSeq(json).map(_fromJSDefault).toList();\n\t }\n\t if (isPlainObj(json)) {\n\t return KeyedSeq(json).map(_fromJSDefault).toMap();\n\t }\n\t return json;\n\t}\n\tfunction isPlainObj(value) {\n\t return value && value.constructor === Object;\n\t}\n\tvar Collection = function Collection() {\n\t throw TypeError('Abstract');\n\t};\n\t($traceurRuntime.createClass)(Collection, {}, {}, Iterable);\n\tvar KeyedCollection = function KeyedCollection() {\n\t $traceurRuntime.defaultSuperCall(this, $KeyedCollection.prototype, arguments);\n\t};\n\tvar $KeyedCollection = KeyedCollection;\n\t($traceurRuntime.createClass)(KeyedCollection, {}, {}, Collection);\n\tmixin(KeyedCollection, KeyedIterable.prototype);\n\tvar IndexedCollection = function IndexedCollection() {\n\t $traceurRuntime.defaultSuperCall(this, $IndexedCollection.prototype, arguments);\n\t};\n\tvar $IndexedCollection = IndexedCollection;\n\t($traceurRuntime.createClass)(IndexedCollection, {}, {}, Collection);\n\tmixin(IndexedCollection, IndexedIterable.prototype);\n\tvar SetCollection = function SetCollection() {\n\t $traceurRuntime.defaultSuperCall(this, $SetCollection.prototype, arguments);\n\t};\n\tvar $SetCollection = SetCollection;\n\t($traceurRuntime.createClass)(SetCollection, {}, {}, Collection);\n\tmixin(SetCollection, SetIterable.prototype);\n\tCollection.Keyed = KeyedCollection;\n\tCollection.Indexed = IndexedCollection;\n\tCollection.Set = SetCollection;\n\tvar Map = function Map(value) {\n\t return value === null || value === undefined ? emptyMap() : isMap(value) ? value : emptyMap().merge(KeyedIterable(value));\n\t};\n\t($traceurRuntime.createClass)(Map, {\n\t toString: function() {\n\t return this.__toString('Map {', '}');\n\t },\n\t get: function(k, notSetValue) {\n\t return this._root ? this._root.get(0, hash(k), k, notSetValue) : notSetValue;\n\t },\n\t set: function(k, v) {\n\t return updateMap(this, k, v);\n\t },\n\t setIn: function(keyPath, v) {\n\t invariant(keyPath.length > 0, 'Requires non-empty key path.');\n\t return this.updateIn(keyPath, (function() {\n\t return v;\n\t }));\n\t },\n\t remove: function(k) {\n\t return updateMap(this, k, NOT_SET);\n\t },\n\t removeIn: function(keyPath) {\n\t invariant(keyPath.length > 0, 'Requires non-empty key path.');\n\t return this.updateIn(keyPath, (function() {\n\t return NOT_SET;\n\t }));\n\t },\n\t update: function(k, notSetValue, updater) {\n\t return arguments.length === 1 ? k(this) : this.updateIn([k], notSetValue, updater);\n\t },\n\t updateIn: function(keyPath, notSetValue, updater) {\n\t if (!updater) {\n\t updater = notSetValue;\n\t notSetValue = undefined;\n\t }\n\t return keyPath.length === 0 ? updater(this) : updateInDeepMap(this, keyPath, notSetValue, updater, 0);\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = 0;\n\t this._root = null;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return emptyMap();\n\t },\n\t merge: function() {\n\t return mergeIntoMapWith(this, undefined, arguments);\n\t },\n\t mergeWith: function(merger) {\n\t for (var iters = [],\n\t $__3 = 1; $__3 < arguments.length; $__3++)\n\t iters[$__3 - 1] = arguments[$__3];\n\t return mergeIntoMapWith(this, merger, iters);\n\t },\n\t mergeDeep: function() {\n\t return mergeIntoMapWith(this, deepMerger(undefined), arguments);\n\t },\n\t mergeDeepWith: function(merger) {\n\t for (var iters = [],\n\t $__4 = 1; $__4 < arguments.length; $__4++)\n\t iters[$__4 - 1] = arguments[$__4];\n\t return mergeIntoMapWith(this, deepMerger(merger), iters);\n\t },\n\t withMutations: function(fn) {\n\t var mutable = this.asMutable();\n\t fn(mutable);\n\t return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;\n\t },\n\t asMutable: function() {\n\t return this.__ownerID ? this : this.__ensureOwner(new OwnerID());\n\t },\n\t asImmutable: function() {\n\t return this.__ensureOwner();\n\t },\n\t wasAltered: function() {\n\t return this.__altered;\n\t },\n\t __iterator: function(type, reverse) {\n\t return new MapIterator(this, type, reverse);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t this._root && this._root.iterate((function(entry) {\n\t iterations++;\n\t return fn(entry[1], entry[0], $__0);\n\t }), reverse);\n\t return iterations;\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this.__altered = false;\n\t return this;\n\t }\n\t return makeMap(this.size, this._root, ownerID, this.__hash);\n\t }\n\t}, {}, KeyedCollection);\n\tfunction isMap(maybeMap) {\n\t return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);\n\t}\n\tMap.isMap = isMap;\n\tvar IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';\n\tvar MapPrototype = Map.prototype;\n\tMapPrototype[IS_MAP_SENTINEL] = true;\n\tMapPrototype[DELETE] = MapPrototype.remove;\n\tvar BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, nodes) {\n\t this.ownerID = ownerID;\n\t this.bitmap = bitmap;\n\t this.nodes = nodes;\n\t};\n\tvar $BitmapIndexedNode = BitmapIndexedNode;\n\t($traceurRuntime.createClass)(BitmapIndexedNode, {\n\t get: function(shift, hash, key, notSetValue) {\n\t var bit = (1 << ((shift === 0 ? hash : hash >>> shift) & MASK));\n\t var bitmap = this.bitmap;\n\t return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, hash, key, notSetValue);\n\t },\n\t update: function(ownerID, shift, hash, key, value, didChangeSize, didAlter) {\n\t var hashFrag = (shift === 0 ? hash : hash >>> shift) & MASK;\n\t var bit = 1 << hashFrag;\n\t var bitmap = this.bitmap;\n\t var exists = (bitmap & bit) !== 0;\n\t if (!exists && value === NOT_SET) {\n\t return this;\n\t }\n\t var idx = popCount(bitmap & (bit - 1));\n\t var nodes = this.nodes;\n\t var node = exists ? nodes[idx] : undefined;\n\t var newNode = updateNode(node, ownerID, shift + SHIFT, hash, key, value, didChangeSize, didAlter);\n\t if (newNode === node) {\n\t return this;\n\t }\n\t if (!exists && newNode && nodes.length >= MAX_BITMAP_SIZE) {\n\t return expandNodes(ownerID, nodes, bitmap, hashFrag, newNode);\n\t }\n\t if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {\n\t return nodes[idx ^ 1];\n\t }\n\t if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {\n\t return newNode;\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;\n\t var newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable);\n\t if (isEditable) {\n\t this.bitmap = newBitmap;\n\t this.nodes = newNodes;\n\t return this;\n\t }\n\t return new $BitmapIndexedNode(ownerID, newBitmap, newNodes);\n\t },\n\t iterate: function(fn, reverse) {\n\t var nodes = this.nodes;\n\t for (var ii = 0,\n\t maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n\t if (nodes[reverse ? maxIndex - ii : ii].iterate(fn, reverse) === false) {\n\t return false;\n\t }\n\t }\n\t }\n\t}, {});\n\tvar ArrayNode = function ArrayNode(ownerID, count, nodes) {\n\t this.ownerID = ownerID;\n\t this.count = count;\n\t this.nodes = nodes;\n\t};\n\tvar $ArrayNode = ArrayNode;\n\t($traceurRuntime.createClass)(ArrayNode, {\n\t get: function(shift, hash, key, notSetValue) {\n\t var idx = (shift === 0 ? hash : hash >>> shift) & MASK;\n\t var node = this.nodes[idx];\n\t return node ? node.get(shift + SHIFT, hash, key, notSetValue) : notSetValue;\n\t },\n\t update: function(ownerID, shift, hash, key, value, didChangeSize, didAlter) {\n\t var idx = (shift === 0 ? hash : hash >>> shift) & MASK;\n\t var removed = value === NOT_SET;\n\t var nodes = this.nodes;\n\t var node = nodes[idx];\n\t if (removed && !node) {\n\t return this;\n\t }\n\t var newNode = updateNode(node, ownerID, shift + SHIFT, hash, key, value, didChangeSize, didAlter);\n\t if (newNode === node) {\n\t return this;\n\t }\n\t var newCount = this.count;\n\t if (!node) {\n\t newCount++;\n\t } else if (!newNode) {\n\t newCount--;\n\t if (newCount < MIN_ARRAY_SIZE) {\n\t return packNodes(ownerID, nodes, newCount, idx);\n\t }\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newNodes = setIn(nodes, idx, newNode, isEditable);\n\t if (isEditable) {\n\t this.count = newCount;\n\t this.nodes = newNodes;\n\t return this;\n\t }\n\t return new $ArrayNode(ownerID, newCount, newNodes);\n\t },\n\t iterate: function(fn, reverse) {\n\t var nodes = this.nodes;\n\t for (var ii = 0,\n\t maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n\t var node = nodes[reverse ? maxIndex - ii : ii];\n\t if (node && node.iterate(fn, reverse) === false) {\n\t return false;\n\t }\n\t }\n\t }\n\t}, {});\n\tvar HashCollisionNode = function HashCollisionNode(ownerID, hash, entries) {\n\t this.ownerID = ownerID;\n\t this.hash = hash;\n\t this.entries = entries;\n\t};\n\tvar $HashCollisionNode = HashCollisionNode;\n\t($traceurRuntime.createClass)(HashCollisionNode, {\n\t get: function(shift, hash, key, notSetValue) {\n\t var entries = this.entries;\n\t for (var ii = 0,\n\t len = entries.length; ii < len; ii++) {\n\t if (is(key, entries[ii][0])) {\n\t return entries[ii][1];\n\t }\n\t }\n\t return notSetValue;\n\t },\n\t update: function(ownerID, shift, hash, key, value, didChangeSize, didAlter) {\n\t var removed = value === NOT_SET;\n\t if (hash !== this.hash) {\n\t if (removed) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t SetRef(didChangeSize);\n\t return mergeIntoNode(this, ownerID, shift, hash, [key, value]);\n\t }\n\t var entries = this.entries;\n\t var idx = 0;\n\t for (var len = entries.length; idx < len; idx++) {\n\t if (is(key, entries[idx][0])) {\n\t break;\n\t }\n\t }\n\t var exists = idx < len;\n\t if (removed && !exists) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t (removed || !exists) && SetRef(didChangeSize);\n\t if (removed && len === 2) {\n\t return new ValueNode(ownerID, this.hash, entries[idx ^ 1]);\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newEntries = isEditable ? entries : arrCopy(entries);\n\t if (exists) {\n\t if (removed) {\n\t idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n\t } else {\n\t newEntries[idx] = [key, value];\n\t }\n\t } else {\n\t newEntries.push([key, value]);\n\t }\n\t if (isEditable) {\n\t this.entries = newEntries;\n\t return this;\n\t }\n\t return new $HashCollisionNode(ownerID, this.hash, newEntries);\n\t },\n\t iterate: function(fn, reverse) {\n\t var entries = this.entries;\n\t for (var ii = 0,\n\t maxIndex = entries.length - 1; ii <= maxIndex; ii++) {\n\t if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {\n\t return false;\n\t }\n\t }\n\t }\n\t}, {});\n\tvar ValueNode = function ValueNode(ownerID, hash, entry) {\n\t this.ownerID = ownerID;\n\t this.hash = hash;\n\t this.entry = entry;\n\t};\n\tvar $ValueNode = ValueNode;\n\t($traceurRuntime.createClass)(ValueNode, {\n\t get: function(shift, hash, key, notSetValue) {\n\t return is(key, this.entry[0]) ? this.entry[1] : notSetValue;\n\t },\n\t update: function(ownerID, shift, hash, key, value, didChangeSize, didAlter) {\n\t var removed = value === NOT_SET;\n\t var keyMatch = is(key, this.entry[0]);\n\t if (keyMatch ? value === this.entry[1] : removed) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t if (removed) {\n\t SetRef(didChangeSize);\n\t return;\n\t }\n\t if (keyMatch) {\n\t if (ownerID && ownerID === this.ownerID) {\n\t this.entry[1] = value;\n\t return this;\n\t }\n\t return new $ValueNode(ownerID, hash, [key, value]);\n\t }\n\t SetRef(didChangeSize);\n\t return mergeIntoNode(this, ownerID, shift, hash, [key, value]);\n\t },\n\t iterate: function(fn) {\n\t return fn(this.entry);\n\t }\n\t}, {});\n\tvar MapIterator = function MapIterator(map, type, reverse) {\n\t this._type = type;\n\t this._reverse = reverse;\n\t this._stack = map._root && mapIteratorFrame(map._root);\n\t};\n\t($traceurRuntime.createClass)(MapIterator, {next: function() {\n\t var type = this._type;\n\t var stack = this._stack;\n\t while (stack) {\n\t var node = stack.node;\n\t var index = stack.index++;\n\t var maxIndex;\n\t if (node.entry) {\n\t if (index === 0) {\n\t return mapIteratorValue(type, node.entry);\n\t }\n\t } else if (node.entries) {\n\t maxIndex = node.entries.length - 1;\n\t if (index <= maxIndex) {\n\t return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);\n\t }\n\t } else {\n\t maxIndex = node.nodes.length - 1;\n\t if (index <= maxIndex) {\n\t var subNode = node.nodes[this._reverse ? maxIndex - index : index];\n\t if (subNode) {\n\t if (subNode.entry) {\n\t return mapIteratorValue(type, subNode.entry);\n\t }\n\t stack = this._stack = mapIteratorFrame(subNode, stack);\n\t }\n\t continue;\n\t }\n\t }\n\t stack = this._stack = this._stack.__prev;\n\t }\n\t return iteratorDone();\n\t }}, {}, Iterator);\n\tfunction mapIteratorValue(type, entry) {\n\t return iteratorValue(type, entry[0], entry[1]);\n\t}\n\tfunction mapIteratorFrame(node, prev) {\n\t return {\n\t node: node,\n\t index: 0,\n\t __prev: prev\n\t };\n\t}\n\tfunction makeMap(size, root, ownerID, hash) {\n\t var map = Object.create(MapPrototype);\n\t map.size = size;\n\t map._root = root;\n\t map.__ownerID = ownerID;\n\t map.__hash = hash;\n\t map.__altered = false;\n\t return map;\n\t}\n\tvar EMPTY_MAP;\n\tfunction emptyMap() {\n\t return EMPTY_MAP || (EMPTY_MAP = makeMap(0));\n\t}\n\tfunction updateMap(map, k, v) {\n\t var didChangeSize = MakeRef(CHANGE_LENGTH);\n\t var didAlter = MakeRef(DID_ALTER);\n\t var newRoot = updateNode(map._root, map.__ownerID, 0, hash(k), k, v, didChangeSize, didAlter);\n\t if (!didAlter.value) {\n\t return map;\n\t }\n\t var newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);\n\t if (map.__ownerID) {\n\t map.size = newSize;\n\t map._root = newRoot;\n\t map.__hash = undefined;\n\t map.__altered = true;\n\t return map;\n\t }\n\t return newRoot ? makeMap(newSize, newRoot) : emptyMap();\n\t}\n\tfunction updateNode(node, ownerID, shift, hash, key, value, didChangeSize, didAlter) {\n\t if (!node) {\n\t if (value === NOT_SET) {\n\t return node;\n\t }\n\t SetRef(didAlter);\n\t SetRef(didChangeSize);\n\t return new ValueNode(ownerID, hash, [key, value]);\n\t }\n\t return node.update(ownerID, shift, hash, key, value, didChangeSize, didAlter);\n\t}\n\tfunction isLeafNode(node) {\n\t return node.constructor === ValueNode || node.constructor === HashCollisionNode;\n\t}\n\tfunction mergeIntoNode(node, ownerID, shift, hash, entry) {\n\t if (node.hash === hash) {\n\t return new HashCollisionNode(ownerID, hash, [node.entry, entry]);\n\t }\n\t var idx1 = (shift === 0 ? node.hash : node.hash >>> shift) & MASK;\n\t var idx2 = (shift === 0 ? hash : hash >>> shift) & MASK;\n\t var newNode;\n\t var nodes = idx1 === idx2 ? [mergeIntoNode(node, ownerID, shift + SHIFT, hash, entry)] : ((newNode = new ValueNode(ownerID, hash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);\n\t return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);\n\t}\n\tfunction packNodes(ownerID, nodes, count, excluding) {\n\t var bitmap = 0;\n\t var packedII = 0;\n\t var packedNodes = new Array(count);\n\t for (var ii = 0,\n\t bit = 1,\n\t len = nodes.length; ii < len; ii++, bit <<= 1) {\n\t var node = nodes[ii];\n\t if (node !== undefined && ii !== excluding) {\n\t bitmap |= bit;\n\t packedNodes[packedII++] = node;\n\t }\n\t }\n\t return new BitmapIndexedNode(ownerID, bitmap, packedNodes);\n\t}\n\tfunction expandNodes(ownerID, nodes, bitmap, including, node) {\n\t var count = 0;\n\t var expandedNodes = new Array(SIZE);\n\t for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {\n\t expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;\n\t }\n\t expandedNodes[including] = node;\n\t return new ArrayNode(ownerID, count + 1, expandedNodes);\n\t}\n\tfunction mergeIntoMapWith(map, merger, iterables) {\n\t var iters = [];\n\t for (var ii = 0; ii < iterables.length; ii++) {\n\t var value = iterables[ii];\n\t var iter = KeyedIterable(value);\n\t if (!isIterable(value)) {\n\t iter = iter.map((function(v) {\n\t return fromJS(v);\n\t }));\n\t }\n\t iters.push(iter);\n\t }\n\t return mergeIntoCollectionWith(map, merger, iters);\n\t}\n\tfunction deepMerger(merger) {\n\t return (function(existing, value) {\n\t return existing && existing.mergeDeepWith && isIterable(value) ? existing.mergeDeepWith(merger, value) : merger ? merger(existing, value) : value;\n\t });\n\t}\n\tfunction mergeIntoCollectionWith(collection, merger, iters) {\n\t if (iters.length === 0) {\n\t return collection;\n\t }\n\t return collection.withMutations((function(collection) {\n\t var mergeIntoMap = merger ? (function(value, key) {\n\t collection.update(key, NOT_SET, (function(existing) {\n\t return existing === NOT_SET ? value : merger(existing, value);\n\t }));\n\t }) : (function(value, key) {\n\t collection.set(key, value);\n\t });\n\t for (var ii = 0; ii < iters.length; ii++) {\n\t iters[ii].forEach(mergeIntoMap);\n\t }\n\t }));\n\t}\n\tfunction updateInDeepMap(collection, keyPath, notSetValue, updater, offset) {\n\t invariant(!collection || collection.set, 'updateIn with invalid keyPath');\n\t var key = keyPath[offset];\n\t var existing = collection ? collection.get(key, NOT_SET) : NOT_SET;\n\t var existingValue = existing === NOT_SET ? undefined : existing;\n\t var value = offset === keyPath.length - 1 ? updater(existing === NOT_SET ? notSetValue : existing) : updateInDeepMap(existingValue, keyPath, notSetValue, updater, offset + 1);\n\t return value === existingValue ? collection : value === NOT_SET ? collection && collection.remove(key) : (collection || emptyMap()).set(key, value);\n\t}\n\tfunction popCount(x) {\n\t x = x - ((x >> 1) & 0x55555555);\n\t x = (x & 0x33333333) + ((x >> 2) & 0x33333333);\n\t x = (x + (x >> 4)) & 0x0f0f0f0f;\n\t x = x + (x >> 8);\n\t x = x + (x >> 16);\n\t return x & 0x7f;\n\t}\n\tfunction setIn(array, idx, val, canEdit) {\n\t var newArray = canEdit ? array : arrCopy(array);\n\t newArray[idx] = val;\n\t return newArray;\n\t}\n\tfunction spliceIn(array, idx, val, canEdit) {\n\t var newLen = array.length + 1;\n\t if (canEdit && idx + 1 === newLen) {\n\t array[idx] = val;\n\t return array;\n\t }\n\t var newArray = new Array(newLen);\n\t var after = 0;\n\t for (var ii = 0; ii < newLen; ii++) {\n\t if (ii === idx) {\n\t newArray[ii] = val;\n\t after = -1;\n\t } else {\n\t newArray[ii] = array[ii + after];\n\t }\n\t }\n\t return newArray;\n\t}\n\tfunction spliceOut(array, idx, canEdit) {\n\t var newLen = array.length - 1;\n\t if (canEdit && idx === newLen) {\n\t array.pop();\n\t return array;\n\t }\n\t var newArray = new Array(newLen);\n\t var after = 0;\n\t for (var ii = 0; ii < newLen; ii++) {\n\t if (ii === idx) {\n\t after = 1;\n\t }\n\t newArray[ii] = array[ii + after];\n\t }\n\t return newArray;\n\t}\n\tvar MAX_BITMAP_SIZE = SIZE / 2;\n\tvar MIN_ARRAY_SIZE = SIZE / 4;\n\tvar ToKeyedSequence = function ToKeyedSequence(indexed, useKeys) {\n\t this._iter = indexed;\n\t this._useKeys = useKeys;\n\t this.size = indexed.size;\n\t};\n\t($traceurRuntime.createClass)(ToKeyedSequence, {\n\t get: function(key, notSetValue) {\n\t return this._iter.get(key, notSetValue);\n\t },\n\t has: function(key) {\n\t return this._iter.has(key);\n\t },\n\t valueSeq: function() {\n\t return this._iter.valueSeq();\n\t },\n\t reverse: function() {\n\t var $__0 = this;\n\t var reversedSequence = reverseFactory(this, true);\n\t if (!this._useKeys) {\n\t reversedSequence.valueSeq = (function() {\n\t return $__0._iter.toSeq().reverse();\n\t });\n\t }\n\t return reversedSequence;\n\t },\n\t map: function(mapper, context) {\n\t var $__0 = this;\n\t var mappedSequence = mapFactory(this, mapper, context);\n\t if (!this._useKeys) {\n\t mappedSequence.valueSeq = (function() {\n\t return $__0._iter.toSeq().map(mapper, context);\n\t });\n\t }\n\t return mappedSequence;\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var ii;\n\t return this._iter.__iterate(this._useKeys ? (function(v, k) {\n\t return fn(v, k, $__0);\n\t }) : ((ii = reverse ? resolveSize(this) : 0), (function(v) {\n\t return fn(v, reverse ? --ii : ii++, $__0);\n\t })), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t if (this._useKeys) {\n\t return this._iter.__iterator(type, reverse);\n\t }\n\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t var ii = reverse ? resolveSize(this) : 0;\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step);\n\t }));\n\t }\n\t}, {}, KeyedSeq);\n\tvar ToIndexedSequence = function ToIndexedSequence(iter) {\n\t this._iter = iter;\n\t this.size = iter.size;\n\t};\n\t($traceurRuntime.createClass)(ToIndexedSequence, {\n\t contains: function(value) {\n\t return this._iter.contains(value);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t return this._iter.__iterate((function(v) {\n\t return fn(v, iterations++, $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, iterations++, step.value, step);\n\t }));\n\t }\n\t}, {}, IndexedSeq);\n\tvar ToSetSequence = function ToSetSequence(iter) {\n\t this._iter = iter;\n\t this.size = iter.size;\n\t};\n\t($traceurRuntime.createClass)(ToSetSequence, {\n\t has: function(key) {\n\t return this._iter.contains(key);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._iter.__iterate((function(v) {\n\t return fn(v, v, $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, step.value, step.value, step);\n\t }));\n\t }\n\t}, {}, SetSeq);\n\tvar FromEntriesSequence = function FromEntriesSequence(entries) {\n\t this._iter = entries;\n\t this.size = entries.size;\n\t};\n\t($traceurRuntime.createClass)(FromEntriesSequence, {\n\t entrySeq: function() {\n\t return this._iter.toSeq();\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._iter.__iterate((function(entry) {\n\t if (entry) {\n\t validateEntry(entry);\n\t return fn(entry[1], entry[0], $__0);\n\t }\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t return new Iterator((function() {\n\t while (true) {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t if (entry) {\n\t validateEntry(entry);\n\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, entry[0], entry[1], step);\n\t }\n\t }\n\t }));\n\t }\n\t}, {}, KeyedSeq);\n\tToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough;\n\tfunction flipFactory(iterable) {\n\t var flipSequence = makeSequence(iterable);\n\t flipSequence._iter = iterable;\n\t flipSequence.size = iterable.size;\n\t flipSequence.flip = (function() {\n\t return iterable;\n\t });\n\t flipSequence.reverse = function() {\n\t var reversedSequence = iterable.reverse.apply(this);\n\t reversedSequence.flip = (function() {\n\t return iterable.reverse();\n\t });\n\t return reversedSequence;\n\t };\n\t flipSequence.has = (function(key) {\n\t return iterable.contains(key);\n\t });\n\t flipSequence.contains = (function(key) {\n\t return iterable.has(key);\n\t });\n\t flipSequence.cacheResult = cacheResultThrough;\n\t flipSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t return iterable.__iterate((function(v, k) {\n\t return fn(k, v, $__0) !== false;\n\t }), reverse);\n\t };\n\t flipSequence.__iteratorUncached = function(type, reverse) {\n\t if (type === ITERATE_ENTRIES) {\n\t var iterator = iterable.__iterator(type, reverse);\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t if (!step.done) {\n\t var k = step.value[0];\n\t step.value[0] = step.value[1];\n\t step.value[1] = k;\n\t }\n\t return step;\n\t }));\n\t }\n\t return iterable.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse);\n\t };\n\t return flipSequence;\n\t}\n\tfunction mapFactory(iterable, mapper, context) {\n\t var mappedSequence = makeSequence(iterable);\n\t mappedSequence.size = iterable.size;\n\t mappedSequence.has = (function(key) {\n\t return iterable.has(key);\n\t });\n\t mappedSequence.get = (function(key, notSetValue) {\n\t var v = iterable.get(key, NOT_SET);\n\t return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable);\n\t });\n\t mappedSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t return iterable.__iterate((function(v, k, c) {\n\t return fn(mapper.call(context, v, k, c), k, $__0) !== false;\n\t }), reverse);\n\t };\n\t mappedSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var key = entry[0];\n\t return iteratorValue(type, key, mapper.call(context, entry[1], key, iterable), step);\n\t }));\n\t };\n\t return mappedSequence;\n\t}\n\tfunction reverseFactory(iterable, useKeys) {\n\t var reversedSequence = makeSequence(iterable);\n\t reversedSequence._iter = iterable;\n\t reversedSequence.size = iterable.size;\n\t reversedSequence.reverse = (function() {\n\t return iterable;\n\t });\n\t if (iterable.flip) {\n\t reversedSequence.flip = function() {\n\t var flipSequence = flipFactory(iterable);\n\t flipSequence.reverse = (function() {\n\t return iterable.flip();\n\t });\n\t return flipSequence;\n\t };\n\t }\n\t reversedSequence.get = (function(key, notSetValue) {\n\t return iterable.get(useKeys ? key : -1 - key, notSetValue);\n\t });\n\t reversedSequence.has = (function(key) {\n\t return iterable.has(useKeys ? key : -1 - key);\n\t });\n\t reversedSequence.contains = (function(value) {\n\t return iterable.contains(value);\n\t });\n\t reversedSequence.cacheResult = cacheResultThrough;\n\t reversedSequence.__iterate = function(fn, reverse) {\n\t var $__0 = this;\n\t return iterable.__iterate((function(v, k) {\n\t return fn(v, k, $__0);\n\t }), !reverse);\n\t };\n\t reversedSequence.__iterator = (function(type, reverse) {\n\t return iterable.__iterator(type, !reverse);\n\t });\n\t return reversedSequence;\n\t}\n\tfunction filterFactory(iterable, predicate, context, useKeys) {\n\t var filterSequence = makeSequence(iterable);\n\t if (useKeys) {\n\t filterSequence.has = (function(key) {\n\t var v = iterable.get(key, NOT_SET);\n\t return v !== NOT_SET && !!predicate.call(context, v, key, iterable);\n\t });\n\t filterSequence.get = (function(key, notSetValue) {\n\t var v = iterable.get(key, NOT_SET);\n\t return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue;\n\t });\n\t }\n\t filterSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k, c) {\n\t if (predicate.call(context, v, k, c)) {\n\t iterations++;\n\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t }\n\t }), reverse);\n\t return iterations;\n\t };\n\t filterSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t while (true) {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var key = entry[0];\n\t var value = entry[1];\n\t if (predicate.call(context, value, key, iterable)) {\n\t return iteratorValue(type, useKeys ? key : iterations++, value, step);\n\t }\n\t }\n\t }));\n\t };\n\t return filterSequence;\n\t}\n\tfunction countByFactory(iterable, grouper, context) {\n\t var groups = Map().asMutable();\n\t iterable.__iterate((function(v, k) {\n\t groups.update(grouper.call(context, v, k, iterable), 0, (function(a) {\n\t return a + 1;\n\t }));\n\t }));\n\t return groups.asImmutable();\n\t}\n\tfunction groupByFactory(iterable, grouper, context) {\n\t var isKeyedIter = isKeyed(iterable);\n\t var groups = Map().asMutable();\n\t iterable.__iterate((function(v, k) {\n\t groups.update(grouper.call(context, v, k, iterable), [], (function(a) {\n\t return (a.push(isKeyedIter ? [k, v] : v), a);\n\t }));\n\t }));\n\t var coerce = iterableClass(iterable);\n\t return groups.map((function(arr) {\n\t return reify(iterable, coerce(arr));\n\t }));\n\t}\n\tfunction takeFactory(iterable, amount) {\n\t if (amount > iterable.size) {\n\t return iterable;\n\t }\n\t if (amount < 0) {\n\t amount = 0;\n\t }\n\t var takeSequence = makeSequence(iterable);\n\t takeSequence.size = iterable.size && Math.min(iterable.size, amount);\n\t takeSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (amount === 0) {\n\t return 0;\n\t }\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k) {\n\t return ++iterations && fn(v, k, $__0) !== false && iterations < amount;\n\t }));\n\t return iterations;\n\t };\n\t takeSequence.__iteratorUncached = function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = amount && iterable.__iterator(type, reverse);\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t if (iterations++ > amount) {\n\t return iteratorDone();\n\t }\n\t return iterator.next();\n\t }));\n\t };\n\t return takeSequence;\n\t}\n\tfunction takeWhileFactory(iterable, predicate, context) {\n\t var takeSequence = makeSequence(iterable);\n\t takeSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k, c) {\n\t return predicate.call(context, v, k, c) && ++iterations && fn(v, k, $__0);\n\t }));\n\t return iterations;\n\t };\n\t takeSequence.__iteratorUncached = function(type, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t var iterating = true;\n\t return new Iterator((function() {\n\t if (!iterating) {\n\t return iteratorDone();\n\t }\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var k = entry[0];\n\t var v = entry[1];\n\t if (!predicate.call(context, v, k, $__0)) {\n\t iterating = false;\n\t return iteratorDone();\n\t }\n\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n\t }));\n\t };\n\t return takeSequence;\n\t}\n\tfunction skipFactory(iterable, amount, useKeys) {\n\t if (amount <= 0) {\n\t return iterable;\n\t }\n\t var skipSequence = makeSequence(iterable);\n\t skipSequence.size = iterable.size && Math.max(0, iterable.size - amount);\n\t skipSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var skipped = 0;\n\t var isSkipping = true;\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k) {\n\t if (!(isSkipping && (isSkipping = skipped++ < amount))) {\n\t iterations++;\n\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t }\n\t }));\n\t return iterations;\n\t };\n\t skipSequence.__iteratorUncached = function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = amount && iterable.__iterator(type, reverse);\n\t var skipped = 0;\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t while (skipped < amount) {\n\t skipped++;\n\t iterator.next();\n\t }\n\t var step = iterator.next();\n\t if (useKeys || type === ITERATE_VALUES) {\n\t return step;\n\t } else if (type === ITERATE_KEYS) {\n\t return iteratorValue(type, iterations++, undefined, step);\n\t } else {\n\t return iteratorValue(type, iterations++, step.value[1], step);\n\t }\n\t }));\n\t };\n\t return skipSequence;\n\t}\n\tfunction skipWhileFactory(iterable, predicate, context, useKeys) {\n\t var skipSequence = makeSequence(iterable);\n\t skipSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var isSkipping = true;\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k, c) {\n\t if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {\n\t iterations++;\n\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t }\n\t }));\n\t return iterations;\n\t };\n\t skipSequence.__iteratorUncached = function(type, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t var skipping = true;\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t var step,\n\t k,\n\t v;\n\t do {\n\t step = iterator.next();\n\t if (step.done) {\n\t if (useKeys || type === ITERATE_VALUES) {\n\t return step;\n\t } else if (type === ITERATE_KEYS) {\n\t return iteratorValue(type, iterations++, undefined, step);\n\t } else {\n\t return iteratorValue(type, iterations++, step.value[1], step);\n\t }\n\t }\n\t var entry = step.value;\n\t k = entry[0];\n\t v = entry[1];\n\t skipping && (skipping = predicate.call(context, v, k, $__0));\n\t } while (skipping);\n\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n\t }));\n\t };\n\t return skipSequence;\n\t}\n\tfunction concatFactory(iterable, values) {\n\t var isKeyedIterable = isKeyed(iterable);\n\t var iters = new ArraySeq([iterable].concat(values)).map((function(v) {\n\t if (!isIterable(v)) {\n\t v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [v]);\n\t } else if (isKeyedIterable) {\n\t v = KeyedIterable(v);\n\t }\n\t return v;\n\t }));\n\t if (isKeyedIterable) {\n\t iters = iters.toKeyedSeq();\n\t } else if (!isIndexed(iterable)) {\n\t iters = iters.toSetSeq();\n\t }\n\t var flat = iters.flatten(true);\n\t flat.size = iters.reduce((function(sum, seq) {\n\t if (sum !== undefined) {\n\t var size = seq.size;\n\t if (size !== undefined) {\n\t return sum + size;\n\t }\n\t }\n\t }), 0);\n\t return flat;\n\t}\n\tfunction flattenFactory(iterable, depth, useKeys) {\n\t var flatSequence = makeSequence(iterable);\n\t flatSequence.__iterateUncached = function(fn, reverse) {\n\t var iterations = 0;\n\t var stopped = false;\n\t function flatDeep(iter, currentDepth) {\n\t var $__0 = this;\n\t iter.__iterate((function(v, k) {\n\t if ((!depth || currentDepth < depth) && isIterable(v)) {\n\t flatDeep(v, currentDepth + 1);\n\t } else if (fn(v, useKeys ? k : iterations++, $__0) === false) {\n\t stopped = true;\n\t }\n\t return !stopped;\n\t }), reverse);\n\t }\n\t flatDeep(iterable, 0);\n\t return iterations;\n\t };\n\t flatSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = iterable.__iterator(type, reverse);\n\t var stack = [];\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t while (iterator) {\n\t var step = iterator.next();\n\t if (step.done !== false) {\n\t iterator = stack.pop();\n\t continue;\n\t }\n\t var v = step.value;\n\t if (type === ITERATE_ENTRIES) {\n\t v = v[1];\n\t }\n\t if ((!depth || stack.length < depth) && isIterable(v)) {\n\t stack.push(iterator);\n\t iterator = v.__iterator(type, reverse);\n\t } else {\n\t return useKeys ? step : iteratorValue(type, iterations++, v, step);\n\t }\n\t }\n\t return iteratorDone();\n\t }));\n\t };\n\t return flatSequence;\n\t}\n\tfunction flatMapFactory(iterable, mapper, context) {\n\t var coerce = iterableClass(iterable);\n\t return iterable.toSeq().map((function(v, k) {\n\t return coerce(mapper.call(context, v, k, iterable));\n\t })).flatten(true);\n\t}\n\tfunction interposeFactory(iterable, separator) {\n\t var interposedSequence = makeSequence(iterable);\n\t interposedSequence.size = iterable.size && iterable.size * 2 - 1;\n\t interposedSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k) {\n\t return (!iterations || fn(separator, iterations++, $__0) !== false) && fn(v, iterations++, $__0) !== false;\n\t }), reverse);\n\t return iterations;\n\t };\n\t interposedSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = iterable.__iterator(ITERATE_VALUES, reverse);\n\t var iterations = 0;\n\t var step;\n\t return new Iterator((function() {\n\t if (!step || iterations % 2) {\n\t step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t }\n\t return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step);\n\t }));\n\t };\n\t return interposedSequence;\n\t}\n\tfunction reify(iter, seq) {\n\t return isSeq(iter) ? seq : iter.constructor(seq);\n\t}\n\tfunction validateEntry(entry) {\n\t if (entry !== Object(entry)) {\n\t throw new TypeError('Expected [K, V] tuple: ' + entry);\n\t }\n\t}\n\tfunction resolveSize(iter) {\n\t assertNotInfinite(iter.size);\n\t return ensureSize(iter);\n\t}\n\tfunction iterableClass(iterable) {\n\t return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable;\n\t}\n\tfunction makeSequence(iterable) {\n\t return Object.create((isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq).prototype);\n\t}\n\tfunction cacheResultThrough() {\n\t if (this._iter.cacheResult) {\n\t this._iter.cacheResult();\n\t this.size = this._iter.size;\n\t return this;\n\t } else {\n\t return Seq.prototype.cacheResult.call(this);\n\t }\n\t}\n\tvar List = function List(value) {\n\t var empty = emptyList();\n\t if (value === null || value === undefined) {\n\t return empty;\n\t }\n\t if (isList(value)) {\n\t return value;\n\t }\n\t value = IndexedIterable(value);\n\t var size = value.size;\n\t if (size === 0) {\n\t return empty;\n\t }\n\t if (size > 0 && size < SIZE) {\n\t return makeList(0, size, SHIFT, null, new VNode(value.toArray()));\n\t }\n\t return empty.merge(value);\n\t};\n\t($traceurRuntime.createClass)(List, {\n\t toString: function() {\n\t return this.__toString('List [', ']');\n\t },\n\t get: function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t if (index < 0 || index >= this.size) {\n\t return notSetValue;\n\t }\n\t index += this._origin;\n\t var node = listNodeFor(this, index);\n\t return node && node.array[index & MASK];\n\t },\n\t set: function(index, value) {\n\t return updateList(this, index, value);\n\t },\n\t remove: function(index) {\n\t return !this.has(index) ? this : index === 0 ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1);\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = this._origin = this._capacity = 0;\n\t this._level = SHIFT;\n\t this._root = this._tail = null;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return emptyList();\n\t },\n\t push: function() {\n\t var values = arguments;\n\t var oldSize = this.size;\n\t return this.withMutations((function(list) {\n\t setListBounds(list, 0, oldSize + values.length);\n\t for (var ii = 0; ii < values.length; ii++) {\n\t list.set(oldSize + ii, values[ii]);\n\t }\n\t }));\n\t },\n\t pop: function() {\n\t return setListBounds(this, 0, -1);\n\t },\n\t unshift: function() {\n\t var values = arguments;\n\t return this.withMutations((function(list) {\n\t setListBounds(list, -values.length);\n\t for (var ii = 0; ii < values.length; ii++) {\n\t list.set(ii, values[ii]);\n\t }\n\t }));\n\t },\n\t shift: function() {\n\t return setListBounds(this, 1);\n\t },\n\t merge: function() {\n\t return mergeIntoListWith(this, undefined, arguments);\n\t },\n\t mergeWith: function(merger) {\n\t for (var iters = [],\n\t $__5 = 1; $__5 < arguments.length; $__5++)\n\t iters[$__5 - 1] = arguments[$__5];\n\t return mergeIntoListWith(this, merger, iters);\n\t },\n\t mergeDeep: function() {\n\t return mergeIntoListWith(this, deepMerger(undefined), arguments);\n\t },\n\t mergeDeepWith: function(merger) {\n\t for (var iters = [],\n\t $__6 = 1; $__6 < arguments.length; $__6++)\n\t iters[$__6 - 1] = arguments[$__6];\n\t return mergeIntoListWith(this, deepMerger(merger), iters);\n\t },\n\t setSize: function(size) {\n\t return setListBounds(this, 0, size);\n\t },\n\t slice: function(begin, end) {\n\t var size = this.size;\n\t if (wholeSlice(begin, end, size)) {\n\t return this;\n\t }\n\t return setListBounds(this, resolveBegin(begin, size), resolveEnd(end, size));\n\t },\n\t __iterator: function(type, reverse) {\n\t return new ListIterator(this, type, reverse);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t var eachFn = (function(v) {\n\t return fn(v, iterations++, $__0);\n\t });\n\t var tailOffset = getTailOffset(this._capacity);\n\t if (reverse) {\n\t iterateVNode(this._tail, 0, tailOffset - this._origin, this._capacity - this._origin, eachFn, reverse) && iterateVNode(this._root, this._level, -this._origin, tailOffset - this._origin, eachFn, reverse);\n\t } else {\n\t iterateVNode(this._root, this._level, -this._origin, tailOffset - this._origin, eachFn, reverse) && iterateVNode(this._tail, 0, tailOffset - this._origin, this._capacity - this._origin, eachFn, reverse);\n\t }\n\t return iterations;\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t return this;\n\t }\n\t return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);\n\t }\n\t}, {of: function() {\n\t return this(arguments);\n\t }}, IndexedCollection);\n\tfunction isList(maybeList) {\n\t return !!(maybeList && maybeList[IS_LIST_SENTINEL]);\n\t}\n\tList.isList = isList;\n\tvar IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';\n\tvar ListPrototype = List.prototype;\n\tListPrototype[IS_LIST_SENTINEL] = true;\n\tListPrototype[DELETE] = ListPrototype.remove;\n\tListPrototype.setIn = MapPrototype.setIn;\n\tListPrototype.removeIn = MapPrototype.removeIn;\n\tListPrototype.update = MapPrototype.update;\n\tListPrototype.updateIn = MapPrototype.updateIn;\n\tListPrototype.withMutations = MapPrototype.withMutations;\n\tListPrototype.asMutable = MapPrototype.asMutable;\n\tListPrototype.asImmutable = MapPrototype.asImmutable;\n\tListPrototype.wasAltered = MapPrototype.wasAltered;\n\tvar VNode = function VNode(array, ownerID) {\n\t this.array = array;\n\t this.ownerID = ownerID;\n\t};\n\tvar $VNode = VNode;\n\t($traceurRuntime.createClass)(VNode, {\n\t removeBefore: function(ownerID, level, index) {\n\t if (index === level ? 1 << level : 0 || this.array.length === 0) {\n\t return this;\n\t }\n\t var originIndex = (index >>> level) & MASK;\n\t if (originIndex >= this.array.length) {\n\t return new $VNode([], ownerID);\n\t }\n\t var removingFirst = originIndex === 0;\n\t var newChild;\n\t if (level > 0) {\n\t var oldChild = this.array[originIndex];\n\t newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);\n\t if (newChild === oldChild && removingFirst) {\n\t return this;\n\t }\n\t }\n\t if (removingFirst && !newChild) {\n\t return this;\n\t }\n\t var editable = editableVNode(this, ownerID);\n\t if (!removingFirst) {\n\t for (var ii = 0; ii < originIndex; ii++) {\n\t editable.array[ii] = undefined;\n\t }\n\t }\n\t if (newChild) {\n\t editable.array[originIndex] = newChild;\n\t }\n\t return editable;\n\t },\n\t removeAfter: function(ownerID, level, index) {\n\t if (index === level ? 1 << level : 0 || this.array.length === 0) {\n\t return this;\n\t }\n\t var sizeIndex = ((index - 1) >>> level) & MASK;\n\t if (sizeIndex >= this.array.length) {\n\t return this;\n\t }\n\t var removingLast = sizeIndex === this.array.length - 1;\n\t var newChild;\n\t if (level > 0) {\n\t var oldChild = this.array[sizeIndex];\n\t newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);\n\t if (newChild === oldChild && removingLast) {\n\t return this;\n\t }\n\t }\n\t if (removingLast && !newChild) {\n\t return this;\n\t }\n\t var editable = editableVNode(this, ownerID);\n\t if (!removingLast) {\n\t editable.array.pop();\n\t }\n\t if (newChild) {\n\t editable.array[sizeIndex] = newChild;\n\t }\n\t return editable;\n\t }\n\t}, {});\n\tfunction iterateVNode(node, level, offset, max, fn, reverse) {\n\t var ii;\n\t var array = node && node.array;\n\t if (level === 0) {\n\t var from = offset < 0 ? -offset : 0;\n\t var to = max - offset;\n\t if (to > SIZE) {\n\t to = SIZE;\n\t }\n\t for (ii = from; ii < to; ii++) {\n\t if (fn(array && array[reverse ? from + to - 1 - ii : ii]) === false) {\n\t return false;\n\t }\n\t }\n\t } else {\n\t var step = 1 << level;\n\t var newLevel = level - SHIFT;\n\t for (ii = 0; ii <= MASK; ii++) {\n\t var levelIndex = reverse ? MASK - ii : ii;\n\t var newOffset = offset + (levelIndex << level);\n\t if (newOffset < max && newOffset + step > 0) {\n\t var nextNode = array && array[levelIndex];\n\t if (!iterateVNode(nextNode, newLevel, newOffset, max, fn, reverse)) {\n\t return false;\n\t }\n\t }\n\t }\n\t }\n\t return true;\n\t}\n\tvar ListIterator = function ListIterator(list, type, reverse) {\n\t this._type = type;\n\t this._reverse = !!reverse;\n\t this._maxIndex = list.size - 1;\n\t var tailOffset = getTailOffset(list._capacity);\n\t var rootStack = listIteratorFrame(list._root && list._root.array, list._level, -list._origin, tailOffset - list._origin - 1);\n\t var tailStack = listIteratorFrame(list._tail && list._tail.array, 0, tailOffset - list._origin, list._capacity - list._origin - 1);\n\t this._stack = reverse ? tailStack : rootStack;\n\t this._stack.__prev = reverse ? rootStack : tailStack;\n\t};\n\t($traceurRuntime.createClass)(ListIterator, {next: function() {\n\t var stack = this._stack;\n\t while (stack) {\n\t var array = stack.array;\n\t var rawIndex = stack.index++;\n\t if (this._reverse) {\n\t rawIndex = MASK - rawIndex;\n\t if (rawIndex > stack.rawMax) {\n\t rawIndex = stack.rawMax;\n\t stack.index = SIZE - rawIndex;\n\t }\n\t }\n\t if (rawIndex >= 0 && rawIndex < SIZE && rawIndex <= stack.rawMax) {\n\t var value = array && array[rawIndex];\n\t if (stack.level === 0) {\n\t var type = this._type;\n\t var index;\n\t if (type !== 1) {\n\t index = stack.offset + (rawIndex << stack.level);\n\t if (this._reverse) {\n\t index = this._maxIndex - index;\n\t }\n\t }\n\t return iteratorValue(type, index, value);\n\t } else {\n\t this._stack = stack = listIteratorFrame(value && value.array, stack.level - SHIFT, stack.offset + (rawIndex << stack.level), stack.max, stack);\n\t }\n\t continue;\n\t }\n\t stack = this._stack = this._stack.__prev;\n\t }\n\t return iteratorDone();\n\t }}, {}, Iterator);\n\tfunction listIteratorFrame(array, level, offset, max, prevFrame) {\n\t return {\n\t array: array,\n\t level: level,\n\t offset: offset,\n\t max: max,\n\t rawMax: ((max - offset) >> level),\n\t index: 0,\n\t __prev: prevFrame\n\t };\n\t}\n\tfunction makeList(origin, capacity, level, root, tail, ownerID, hash) {\n\t var list = Object.create(ListPrototype);\n\t list.size = capacity - origin;\n\t list._origin = origin;\n\t list._capacity = capacity;\n\t list._level = level;\n\t list._root = root;\n\t list._tail = tail;\n\t list.__ownerID = ownerID;\n\t list.__hash = hash;\n\t list.__altered = false;\n\t return list;\n\t}\n\tvar EMPTY_LIST;\n\tfunction emptyList() {\n\t return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));\n\t}\n\tfunction updateList(list, index, value) {\n\t index = wrapIndex(list, index);\n\t if (index >= list.size || index < 0) {\n\t return list.withMutations((function(list) {\n\t index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value);\n\t }));\n\t }\n\t index += list._origin;\n\t var newTail = list._tail;\n\t var newRoot = list._root;\n\t var didAlter = MakeRef(DID_ALTER);\n\t if (index >= getTailOffset(list._capacity)) {\n\t newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);\n\t } else {\n\t newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);\n\t }\n\t if (!didAlter.value) {\n\t return list;\n\t }\n\t if (list.__ownerID) {\n\t list._root = newRoot;\n\t list._tail = newTail;\n\t list.__hash = undefined;\n\t list.__altered = true;\n\t return list;\n\t }\n\t return makeList(list._origin, list._capacity, list._level, newRoot, newTail);\n\t}\n\tfunction updateVNode(node, ownerID, level, index, value, didAlter) {\n\t var idx = (index >>> level) & MASK;\n\t var nodeHas = node && idx < node.array.length;\n\t if (!nodeHas && value === undefined) {\n\t return node;\n\t }\n\t var newNode;\n\t if (level > 0) {\n\t var lowerNode = node && node.array[idx];\n\t var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);\n\t if (newLowerNode === lowerNode) {\n\t return node;\n\t }\n\t newNode = editableVNode(node, ownerID);\n\t newNode.array[idx] = newLowerNode;\n\t return newNode;\n\t }\n\t if (nodeHas && node.array[idx] === value) {\n\t return node;\n\t }\n\t SetRef(didAlter);\n\t newNode = editableVNode(node, ownerID);\n\t if (value === undefined && idx === newNode.array.length - 1) {\n\t newNode.array.pop();\n\t } else {\n\t newNode.array[idx] = value;\n\t }\n\t return newNode;\n\t}\n\tfunction editableVNode(node, ownerID) {\n\t if (ownerID && node && ownerID === node.ownerID) {\n\t return node;\n\t }\n\t return new VNode(node ? node.array.slice() : [], ownerID);\n\t}\n\tfunction listNodeFor(list, rawIndex) {\n\t if (rawIndex >= getTailOffset(list._capacity)) {\n\t return list._tail;\n\t }\n\t if (rawIndex < 1 << (list._level + SHIFT)) {\n\t var node = list._root;\n\t var level = list._level;\n\t while (node && level > 0) {\n\t node = node.array[(rawIndex >>> level) & MASK];\n\t level -= SHIFT;\n\t }\n\t return node;\n\t }\n\t}\n\tfunction setListBounds(list, begin, end) {\n\t var owner = list.__ownerID || new OwnerID();\n\t var oldOrigin = list._origin;\n\t var oldCapacity = list._capacity;\n\t var newOrigin = oldOrigin + begin;\n\t var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;\n\t if (newOrigin === oldOrigin && newCapacity === oldCapacity) {\n\t return list;\n\t }\n\t if (newOrigin >= newCapacity) {\n\t return list.clear();\n\t }\n\t var newLevel = list._level;\n\t var newRoot = list._root;\n\t var offsetShift = 0;\n\t while (newOrigin + offsetShift < 0) {\n\t newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);\n\t newLevel += SHIFT;\n\t offsetShift += 1 << newLevel;\n\t }\n\t if (offsetShift) {\n\t newOrigin += offsetShift;\n\t oldOrigin += offsetShift;\n\t newCapacity += offsetShift;\n\t oldCapacity += offsetShift;\n\t }\n\t var oldTailOffset = getTailOffset(oldCapacity);\n\t var newTailOffset = getTailOffset(newCapacity);\n\t while (newTailOffset >= 1 << (newLevel + SHIFT)) {\n\t newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);\n\t newLevel += SHIFT;\n\t }\n\t var oldTail = list._tail;\n\t var newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;\n\t if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {\n\t newRoot = editableVNode(newRoot, owner);\n\t var node = newRoot;\n\t for (var level = newLevel; level > SHIFT; level -= SHIFT) {\n\t var idx = (oldTailOffset >>> level) & MASK;\n\t node = node.array[idx] = editableVNode(node.array[idx], owner);\n\t }\n\t node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;\n\t }\n\t if (newCapacity < oldCapacity) {\n\t newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);\n\t }\n\t if (newOrigin >= newTailOffset) {\n\t newOrigin -= newTailOffset;\n\t newCapacity -= newTailOffset;\n\t newLevel = SHIFT;\n\t newRoot = null;\n\t newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);\n\t } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {\n\t offsetShift = 0;\n\t while (newRoot) {\n\t var beginIndex = (newOrigin >>> newLevel) & MASK;\n\t if (beginIndex !== (newTailOffset >>> newLevel) & MASK) {\n\t break;\n\t }\n\t if (beginIndex) {\n\t offsetShift += (1 << newLevel) * beginIndex;\n\t }\n\t newLevel -= SHIFT;\n\t newRoot = newRoot.array[beginIndex];\n\t }\n\t if (newRoot && newOrigin > oldOrigin) {\n\t newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);\n\t }\n\t if (newRoot && newTailOffset < oldTailOffset) {\n\t newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);\n\t }\n\t if (offsetShift) {\n\t newOrigin -= offsetShift;\n\t newCapacity -= offsetShift;\n\t }\n\t }\n\t if (list.__ownerID) {\n\t list.size = newCapacity - newOrigin;\n\t list._origin = newOrigin;\n\t list._capacity = newCapacity;\n\t list._level = newLevel;\n\t list._root = newRoot;\n\t list._tail = newTail;\n\t list.__hash = undefined;\n\t list.__altered = true;\n\t return list;\n\t }\n\t return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);\n\t}\n\tfunction mergeIntoListWith(list, merger, iterables) {\n\t var iters = [];\n\t var maxSize = 0;\n\t for (var ii = 0; ii < iterables.length; ii++) {\n\t var value = iterables[ii];\n\t var iter = IndexedIterable(value);\n\t if (iter.size > maxSize) {\n\t maxSize = iter.size;\n\t }\n\t if (!isIterable(value)) {\n\t iter = iter.map((function(v) {\n\t return fromJS(v);\n\t }));\n\t }\n\t iters.push(iter);\n\t }\n\t if (maxSize > list.size) {\n\t list = list.setSize(maxSize);\n\t }\n\t return mergeIntoCollectionWith(list, merger, iters);\n\t}\n\tfunction getTailOffset(size) {\n\t return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);\n\t}\n\tvar Stack = function Stack(value) {\n\t return value === null || value === undefined ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value);\n\t};\n\tvar $Stack = Stack;\n\t($traceurRuntime.createClass)(Stack, {\n\t toString: function() {\n\t return this.__toString('Stack [', ']');\n\t },\n\t get: function(index, notSetValue) {\n\t var head = this._head;\n\t while (head && index--) {\n\t head = head.next;\n\t }\n\t return head ? head.value : notSetValue;\n\t },\n\t peek: function() {\n\t return this._head && this._head.value;\n\t },\n\t push: function() {\n\t if (arguments.length === 0) {\n\t return this;\n\t }\n\t var newSize = this.size + arguments.length;\n\t var head = this._head;\n\t for (var ii = arguments.length - 1; ii >= 0; ii--) {\n\t head = {\n\t value: arguments[ii],\n\t next: head\n\t };\n\t }\n\t if (this.__ownerID) {\n\t this.size = newSize;\n\t this._head = head;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return makeStack(newSize, head);\n\t },\n\t pushAll: function(iter) {\n\t iter = IndexedIterable(iter);\n\t if (iter.size === 0) {\n\t return this;\n\t }\n\t var newSize = this.size;\n\t var head = this._head;\n\t iter.reverse().forEach((function(value) {\n\t newSize++;\n\t head = {\n\t value: value,\n\t next: head\n\t };\n\t }));\n\t if (this.__ownerID) {\n\t this.size = newSize;\n\t this._head = head;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return makeStack(newSize, head);\n\t },\n\t pop: function() {\n\t return this.slice(1);\n\t },\n\t unshift: function() {\n\t return this.push.apply(this, arguments);\n\t },\n\t unshiftAll: function(iter) {\n\t return this.pushAll(iter);\n\t },\n\t shift: function() {\n\t return this.pop.apply(this, arguments);\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = 0;\n\t this._head = undefined;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return emptyStack();\n\t },\n\t slice: function(begin, end) {\n\t if (wholeSlice(begin, end, this.size)) {\n\t return this;\n\t }\n\t var resolvedBegin = resolveBegin(begin, this.size);\n\t var resolvedEnd = resolveEnd(end, this.size);\n\t if (resolvedEnd !== this.size) {\n\t return $traceurRuntime.superCall(this, $Stack.prototype, \"slice\", [begin, end]);\n\t }\n\t var newSize = this.size - resolvedBegin;\n\t var head = this._head;\n\t while (resolvedBegin--) {\n\t head = head.next;\n\t }\n\t if (this.__ownerID) {\n\t this.size = newSize;\n\t this._head = head;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return makeStack(newSize, head);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this.__altered = false;\n\t return this;\n\t }\n\t return makeStack(this.size, this._head, ownerID, this.__hash);\n\t },\n\t __iterate: function(fn, reverse) {\n\t if (reverse) {\n\t return this.toSeq().cacheResult.__iterate(fn, reverse);\n\t }\n\t var iterations = 0;\n\t var node = this._head;\n\t while (node) {\n\t if (fn(node.value, iterations++, this) === false) {\n\t break;\n\t }\n\t node = node.next;\n\t }\n\t return iterations;\n\t },\n\t __iterator: function(type, reverse) {\n\t if (reverse) {\n\t return this.toSeq().cacheResult().__iterator(type, reverse);\n\t }\n\t var iterations = 0;\n\t var node = this._head;\n\t return new Iterator((function() {\n\t if (node) {\n\t var value = node.value;\n\t node = node.next;\n\t return iteratorValue(type, iterations++, value);\n\t }\n\t return iteratorDone();\n\t }));\n\t }\n\t}, {of: function() {\n\t return this(arguments);\n\t }}, IndexedCollection);\n\tfunction isStack(maybeStack) {\n\t return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);\n\t}\n\tStack.isStack = isStack;\n\tvar IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';\n\tvar StackPrototype = Stack.prototype;\n\tStackPrototype[IS_STACK_SENTINEL] = true;\n\tStackPrototype.withMutations = MapPrototype.withMutations;\n\tStackPrototype.asMutable = MapPrototype.asMutable;\n\tStackPrototype.asImmutable = MapPrototype.asImmutable;\n\tStackPrototype.wasAltered = MapPrototype.wasAltered;\n\tfunction makeStack(size, head, ownerID, hash) {\n\t var map = Object.create(StackPrototype);\n\t map.size = size;\n\t map._head = head;\n\t map.__ownerID = ownerID;\n\t map.__hash = hash;\n\t map.__altered = false;\n\t return map;\n\t}\n\tvar EMPTY_STACK;\n\tfunction emptyStack() {\n\t return EMPTY_STACK || (EMPTY_STACK = makeStack(0));\n\t}\n\tvar Set = function Set(value) {\n\t return value === null || value === undefined ? emptySet() : isSet(value) ? value : emptySet().union(value);\n\t};\n\t($traceurRuntime.createClass)(Set, {\n\t toString: function() {\n\t return this.__toString('Set {', '}');\n\t },\n\t has: function(value) {\n\t return this._map.has(value);\n\t },\n\t add: function(value) {\n\t var newMap = this._map.set(value, true);\n\t if (this.__ownerID) {\n\t this.size = newMap.size;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return newMap === this._map ? this : makeSet(newMap);\n\t },\n\t remove: function(value) {\n\t var newMap = this._map.remove(value);\n\t if (this.__ownerID) {\n\t this.size = newMap.size;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return newMap === this._map ? this : newMap.size === 0 ? emptySet() : makeSet(newMap);\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = 0;\n\t this._map.clear();\n\t return this;\n\t }\n\t return emptySet();\n\t },\n\t union: function() {\n\t var iters = arguments;\n\t if (iters.length === 0) {\n\t return this;\n\t }\n\t return this.withMutations((function(set) {\n\t for (var ii = 0; ii < iters.length; ii++) {\n\t SetIterable(iters[ii]).forEach((function(value) {\n\t return set.add(value);\n\t }));\n\t }\n\t }));\n\t },\n\t intersect: function() {\n\t for (var iters = [],\n\t $__7 = 0; $__7 < arguments.length; $__7++)\n\t iters[$__7] = arguments[$__7];\n\t if (iters.length === 0) {\n\t return this;\n\t }\n\t iters = iters.map((function(iter) {\n\t return SetIterable(iter);\n\t }));\n\t var originalSet = this;\n\t return this.withMutations((function(set) {\n\t originalSet.forEach((function(value) {\n\t if (!iters.every((function(iter) {\n\t return iter.contains(value);\n\t }))) {\n\t set.remove(value);\n\t }\n\t }));\n\t }));\n\t },\n\t subtract: function() {\n\t for (var iters = [],\n\t $__8 = 0; $__8 < arguments.length; $__8++)\n\t iters[$__8] = arguments[$__8];\n\t if (iters.length === 0) {\n\t return this;\n\t }\n\t iters = iters.map((function(iter) {\n\t return SetIterable(iter);\n\t }));\n\t var originalSet = this;\n\t return this.withMutations((function(set) {\n\t originalSet.forEach((function(value) {\n\t if (iters.some((function(iter) {\n\t return iter.contains(value);\n\t }))) {\n\t set.remove(value);\n\t }\n\t }));\n\t }));\n\t },\n\t merge: function() {\n\t return this.union.apply(this, arguments);\n\t },\n\t mergeWith: function(merger) {\n\t for (var iters = [],\n\t $__9 = 1; $__9 < arguments.length; $__9++)\n\t iters[$__9 - 1] = arguments[$__9];\n\t return this.union.apply(this, iters);\n\t },\n\t wasAltered: function() {\n\t return this._map.wasAltered();\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._map.__iterate((function(_, k) {\n\t return fn(k, k, $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t return this._map.map((function(_, k) {\n\t return k;\n\t })).__iterator(type, reverse);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t var newMap = this._map.__ensureOwner(ownerID);\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return makeSet(newMap, ownerID);\n\t }\n\t}, {\n\t of: function() {\n\t return this(arguments);\n\t },\n\t fromKeys: function(value) {\n\t return this(KeyedSeq(value).flip().valueSeq());\n\t }\n\t}, SetCollection);\n\tfunction isSet(maybeSet) {\n\t return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);\n\t}\n\tSet.isSet = isSet;\n\tvar IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';\n\tvar SetPrototype = Set.prototype;\n\tSetPrototype[IS_SET_SENTINEL] = true;\n\tSetPrototype[DELETE] = SetPrototype.remove;\n\tSetPrototype.mergeDeep = SetPrototype.merge;\n\tSetPrototype.mergeDeepWith = SetPrototype.mergeWith;\n\tSetPrototype.withMutations = MapPrototype.withMutations;\n\tSetPrototype.asMutable = MapPrototype.asMutable;\n\tSetPrototype.asImmutable = MapPrototype.asImmutable;\n\tfunction makeSet(map, ownerID) {\n\t var set = Object.create(SetPrototype);\n\t set.size = map ? map.size : 0;\n\t set._map = map;\n\t set.__ownerID = ownerID;\n\t return set;\n\t}\n\tvar EMPTY_SET;\n\tfunction emptySet() {\n\t return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));\n\t}\n\tvar OrderedMap = function OrderedMap(value) {\n\t return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().merge(KeyedIterable(value));\n\t};\n\t($traceurRuntime.createClass)(OrderedMap, {\n\t toString: function() {\n\t return this.__toString('OrderedMap {', '}');\n\t },\n\t get: function(k, notSetValue) {\n\t var index = this._map.get(k);\n\t return index !== undefined ? this._list.get(index)[1] : notSetValue;\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = 0;\n\t this._map.clear();\n\t this._list.clear();\n\t return this;\n\t }\n\t return emptyOrderedMap();\n\t },\n\t set: function(k, v) {\n\t return updateOrderedMap(this, k, v);\n\t },\n\t remove: function(k) {\n\t return updateOrderedMap(this, k, NOT_SET);\n\t },\n\t wasAltered: function() {\n\t return this._map.wasAltered() || this._list.wasAltered();\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._list.__iterate((function(entry) {\n\t return entry && fn(entry[1], entry[0], $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t return this._list.fromEntrySeq().__iterator(type, reverse);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t var newMap = this._map.__ensureOwner(ownerID);\n\t var newList = this._list.__ensureOwner(ownerID);\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this._map = newMap;\n\t this._list = newList;\n\t return this;\n\t }\n\t return makeOrderedMap(newMap, newList, ownerID, this.__hash);\n\t }\n\t}, {of: function() {\n\t return this(arguments);\n\t }}, Map);\n\tfunction isOrderedMap(maybeOrderedMap) {\n\t return !!(maybeOrderedMap && maybeOrderedMap[IS_ORDERED_MAP_SENTINEL]);\n\t}\n\tOrderedMap.isOrderedMap = isOrderedMap;\n\tvar IS_ORDERED_MAP_SENTINEL = '@@__IMMUTABLE_ORDERED_MAP__@@';\n\tOrderedMap.prototype[IS_ORDERED_MAP_SENTINEL] = true;\n\tOrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;\n\tfunction makeOrderedMap(map, list, ownerID, hash) {\n\t var omap = Object.create(OrderedMap.prototype);\n\t omap.size = map ? map.size : 0;\n\t omap._map = map;\n\t omap._list = list;\n\t omap.__ownerID = ownerID;\n\t omap.__hash = hash;\n\t return omap;\n\t}\n\tvar EMPTY_ORDERED_MAP;\n\tfunction emptyOrderedMap() {\n\t return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));\n\t}\n\tfunction updateOrderedMap(omap, k, v) {\n\t var map = omap._map;\n\t var list = omap._list;\n\t var i = map.get(k);\n\t var has = i !== undefined;\n\t var removed = v === NOT_SET;\n\t if ((!has && removed) || (has && v === list.get(i)[1])) {\n\t return omap;\n\t }\n\t if (!has) {\n\t i = list.size;\n\t }\n\t var newMap = removed ? map.remove(k) : has ? map : map.set(k, i);\n\t var newList = removed ? list.set(i, undefined) : list.set(i, [k, v]);\n\t if (omap.__ownerID) {\n\t omap.size = newMap.size;\n\t omap._map = newMap;\n\t omap._list = newList;\n\t omap.__hash = undefined;\n\t return omap;\n\t }\n\t return makeOrderedMap(newMap, newList);\n\t}\n\tvar Record = function Record(defaultValues, name) {\n\t var RecordType = function Record(values) {\n\t if (!(this instanceof RecordType)) {\n\t return new RecordType(values);\n\t }\n\t this._map = Map(values);\n\t };\n\t var keys = Object.keys(defaultValues);\n\t var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);\n\t RecordTypePrototype.constructor = RecordType;\n\t name && (RecordTypePrototype._name = name);\n\t RecordTypePrototype._defaultValues = defaultValues;\n\t RecordTypePrototype._keys = keys;\n\t RecordTypePrototype.size = keys.length;\n\t try {\n\t keys.forEach((function(key) {\n\t Object.defineProperty(RecordType.prototype, key, {\n\t get: function() {\n\t return this.get(key);\n\t },\n\t set: function(value) {\n\t invariant(this.__ownerID, 'Cannot set on an immutable record.');\n\t this.set(key, value);\n\t }\n\t });\n\t }));\n\t } catch (error) {}\n\t return RecordType;\n\t};\n\t($traceurRuntime.createClass)(Record, {\n\t toString: function() {\n\t return this.__toString(recordName(this) + ' {', '}');\n\t },\n\t has: function(k) {\n\t return this._defaultValues.hasOwnProperty(k);\n\t },\n\t get: function(k, notSetValue) {\n\t if (notSetValue !== undefined && !this.has(k)) {\n\t return notSetValue;\n\t }\n\t var defaultVal = this._defaultValues[k];\n\t return this._map ? this._map.get(k, defaultVal) : defaultVal;\n\t },\n\t clear: function() {\n\t if (this.__ownerID) {\n\t this._map && this._map.clear();\n\t return this;\n\t }\n\t var SuperRecord = Object.getPrototypeOf(this).constructor;\n\t return SuperRecord._empty || (SuperRecord._empty = makeRecord(this, emptyMap()));\n\t },\n\t set: function(k, v) {\n\t if (!this.has(k)) {\n\t throw new Error('Cannot set unknown key \"' + k + '\" on ' + recordName(this));\n\t }\n\t var newMap = this._map && this._map.set(k, v);\n\t if (this.__ownerID || newMap === this._map) {\n\t return this;\n\t }\n\t return makeRecord(this, newMap);\n\t },\n\t remove: function(k) {\n\t if (!this.has(k)) {\n\t return this;\n\t }\n\t var newMap = this._map && this._map.remove(k);\n\t if (this.__ownerID || newMap === this._map) {\n\t return this;\n\t }\n\t return makeRecord(this, newMap);\n\t },\n\t wasAltered: function() {\n\t return this._map.wasAltered();\n\t },\n\t __iterator: function(type, reverse) {\n\t var $__0 = this;\n\t return KeyedIterable(this._defaultValues).map((function(_, k) {\n\t return $__0.get(k);\n\t })).__iterator(type, reverse);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return KeyedIterable(this._defaultValues).map((function(_, k) {\n\t return $__0.get(k);\n\t })).__iterate(fn, reverse);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t var newMap = this._map && this._map.__ensureOwner(ownerID);\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return makeRecord(this, newMap, ownerID);\n\t }\n\t}, {}, KeyedCollection);\n\tvar RecordPrototype = Record.prototype;\n\tRecordPrototype[DELETE] = RecordPrototype.remove;\n\tRecordPrototype.merge = MapPrototype.merge;\n\tRecordPrototype.mergeWith = MapPrototype.mergeWith;\n\tRecordPrototype.mergeDeep = MapPrototype.mergeDeep;\n\tRecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;\n\tRecordPrototype.update = MapPrototype.update;\n\tRecordPrototype.updateIn = MapPrototype.updateIn;\n\tRecordPrototype.withMutations = MapPrototype.withMutations;\n\tRecordPrototype.asMutable = MapPrototype.asMutable;\n\tRecordPrototype.asImmutable = MapPrototype.asImmutable;\n\tfunction makeRecord(likeRecord, map, ownerID) {\n\t var record = Object.create(Object.getPrototypeOf(likeRecord));\n\t record._map = map;\n\t record.__ownerID = ownerID;\n\t return record;\n\t}\n\tfunction recordName(record) {\n\t return record._name || record.constructor.name;\n\t}\n\tvar Range = function Range(start, end, step) {\n\t if (!(this instanceof $Range)) {\n\t return new $Range(start, end, step);\n\t }\n\t invariant(step !== 0, 'Cannot step a Range by 0');\n\t start = start || 0;\n\t if (end === undefined) {\n\t end = Infinity;\n\t }\n\t if (start === end && __EMPTY_RANGE) {\n\t return __EMPTY_RANGE;\n\t }\n\t step = step === undefined ? 1 : Math.abs(step);\n\t if (end < start) {\n\t step = -step;\n\t }\n\t this._start = start;\n\t this._end = end;\n\t this._step = step;\n\t this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);\n\t};\n\tvar $Range = Range;\n\t($traceurRuntime.createClass)(Range, {\n\t toString: function() {\n\t if (this.size === 0) {\n\t return 'Range []';\n\t }\n\t return 'Range [ ' + this._start + '...' + this._end + (this._step > 1 ? ' by ' + this._step : '') + ' ]';\n\t },\n\t get: function(index, notSetValue) {\n\t return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue;\n\t },\n\t contains: function(searchValue) {\n\t var possibleIndex = (searchValue - this._start) / this._step;\n\t return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex);\n\t },\n\t slice: function(begin, end) {\n\t if (wholeSlice(begin, end, this.size)) {\n\t return this;\n\t }\n\t begin = resolveBegin(begin, this.size);\n\t end = resolveEnd(end, this.size);\n\t if (end <= begin) {\n\t return __EMPTY_RANGE;\n\t }\n\t return new $Range(this.get(begin, this._end), this.get(end, this._end), this._step);\n\t },\n\t indexOf: function(searchValue) {\n\t var offsetValue = searchValue - this._start;\n\t if (offsetValue % this._step === 0) {\n\t var index = offsetValue / this._step;\n\t if (index >= 0 && index < this.size) {\n\t return index;\n\t }\n\t }\n\t return -1;\n\t },\n\t lastIndexOf: function(searchValue) {\n\t return this.indexOf(searchValue);\n\t },\n\t take: function(amount) {\n\t return this.slice(0, Math.max(0, amount));\n\t },\n\t skip: function(amount) {\n\t return this.slice(Math.max(0, amount));\n\t },\n\t __iterate: function(fn, reverse) {\n\t var maxIndex = this.size - 1;\n\t var step = this._step;\n\t var value = reverse ? this._start + maxIndex * step : this._start;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t if (fn(value, ii, this) === false) {\n\t return ii + 1;\n\t }\n\t value += reverse ? -step : step;\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var maxIndex = this.size - 1;\n\t var step = this._step;\n\t var value = reverse ? this._start + maxIndex * step : this._start;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t var v = value;\n\t value += reverse ? -step : step;\n\t return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);\n\t }));\n\t },\n\t __deepEquals: function(other) {\n\t return other instanceof $Range ? this._start === other._start && this._end === other._end && this._step === other._step : $traceurRuntime.superCall(this, $Range.prototype, \"__deepEquals\", [other]);\n\t }\n\t}, {}, IndexedSeq);\n\tvar RangePrototype = Range.prototype;\n\tRangePrototype.__toJS = RangePrototype.toArray;\n\tRangePrototype.first = ListPrototype.first;\n\tRangePrototype.last = ListPrototype.last;\n\tvar __EMPTY_RANGE = Range(0, 0);\n\tvar Repeat = function Repeat(value, times) {\n\t if (times <= 0 && EMPTY_REPEAT) {\n\t return EMPTY_REPEAT;\n\t }\n\t if (!(this instanceof $Repeat)) {\n\t return new $Repeat(value, times);\n\t }\n\t this._value = value;\n\t this.size = times === undefined ? Infinity : Math.max(0, times);\n\t if (this.size === 0) {\n\t EMPTY_REPEAT = this;\n\t }\n\t};\n\tvar $Repeat = Repeat;\n\t($traceurRuntime.createClass)(Repeat, {\n\t toString: function() {\n\t if (this.size === 0) {\n\t return 'Repeat []';\n\t }\n\t return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';\n\t },\n\t get: function(index, notSetValue) {\n\t return this.has(index) ? this._value : notSetValue;\n\t },\n\t contains: function(searchValue) {\n\t return is(this._value, searchValue);\n\t },\n\t slice: function(begin, end) {\n\t var size = this.size;\n\t return wholeSlice(begin, end, size) ? this : new $Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));\n\t },\n\t reverse: function() {\n\t return this;\n\t },\n\t indexOf: function(searchValue) {\n\t if (is(this._value, searchValue)) {\n\t return 0;\n\t }\n\t return -1;\n\t },\n\t lastIndexOf: function(searchValue) {\n\t if (is(this._value, searchValue)) {\n\t return this.size;\n\t }\n\t return -1;\n\t },\n\t __iterate: function(fn, reverse) {\n\t for (var ii = 0; ii < this.size; ii++) {\n\t if (fn(this._value, ii, this) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var $__0 = this;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t return ii < $__0.size ? iteratorValue(type, ii++, $__0._value) : iteratorDone();\n\t }));\n\t },\n\t __deepEquals: function(other) {\n\t return other instanceof $Repeat ? is(this._value, other._value) : $traceurRuntime.superCall(this, $Repeat.prototype, \"__deepEquals\", [other]);\n\t }\n\t}, {}, IndexedSeq);\n\tvar RepeatPrototype = Repeat.prototype;\n\tRepeatPrototype.last = RepeatPrototype.first;\n\tRepeatPrototype.has = RangePrototype.has;\n\tRepeatPrototype.take = RangePrototype.take;\n\tRepeatPrototype.skip = RangePrototype.skip;\n\tRepeatPrototype.__toJS = RangePrototype.__toJS;\n\tvar EMPTY_REPEAT;\n\tvar Immutable = {\n\t Iterable: Iterable,\n\t Seq: Seq,\n\t Collection: Collection,\n\t Map: Map,\n\t List: List,\n\t Stack: Stack,\n\t Set: Set,\n\t OrderedMap: OrderedMap,\n\t Record: Record,\n\t Range: Range,\n\t Repeat: Repeat,\n\t is: is,\n\t fromJS: fromJS\n\t};\n\t\n\t return Immutable;\n\t}", "title": "" }, { "docid": "5101f3eca1cd68dba6dff8a69b7d574c", "score": "0.48868135", "text": "detach() {\n const argops = this._argops;\n let i, n, item, op;\n\n if (argops) {\n for (i = 0, n = argops.length; i < n; ++i) {\n item = argops[i];\n op = item.op;\n\n if (op._targets) {\n op._targets.remove(this);\n }\n }\n }\n }", "title": "" }, { "docid": "5e88f2c38a5f8379d34167d385e3dc0d", "score": "0.48806816", "text": "clearShortDefs () {\n this.shortDefs = [];\n }", "title": "" }, { "docid": "00905838f2368befc20e78271b040dad", "score": "0.48708427", "text": "function removeVersion(ret) {\n if (typeof ret.__v !== 'undefined') {\n delete ret.__v;\n }\n}", "title": "" }, { "docid": "100a8658c4cb2c12327635766d79777c", "score": "0.4868884", "text": "function deleteUnknownAutoBindMethods(component) {\n var names = Object.getOwnPropertyNames(component);\n\n names.forEach(function (name) {\n if (shouldDeleteInstanceMethod(component, name)) {\n delete component[name];\n }\n });\n}", "title": "" }, { "docid": "100a8658c4cb2c12327635766d79777c", "score": "0.4868884", "text": "function deleteUnknownAutoBindMethods(component) {\n var names = Object.getOwnPropertyNames(component);\n\n names.forEach(function (name) {\n if (shouldDeleteInstanceMethod(component, name)) {\n delete component[name];\n }\n });\n}", "title": "" }, { "docid": "100a8658c4cb2c12327635766d79777c", "score": "0.4868884", "text": "function deleteUnknownAutoBindMethods(component) {\n var names = Object.getOwnPropertyNames(component);\n\n names.forEach(function (name) {\n if (shouldDeleteInstanceMethod(component, name)) {\n delete component[name];\n }\n });\n}", "title": "" }, { "docid": "100a8658c4cb2c12327635766d79777c", "score": "0.4868884", "text": "function deleteUnknownAutoBindMethods(component) {\n var names = Object.getOwnPropertyNames(component);\n\n names.forEach(function (name) {\n if (shouldDeleteInstanceMethod(component, name)) {\n delete component[name];\n }\n });\n}", "title": "" }, { "docid": "100a8658c4cb2c12327635766d79777c", "score": "0.4868884", "text": "function deleteUnknownAutoBindMethods(component) {\n var names = Object.getOwnPropertyNames(component);\n\n names.forEach(function (name) {\n if (shouldDeleteInstanceMethod(component, name)) {\n delete component[name];\n }\n });\n}", "title": "" }, { "docid": "100a8658c4cb2c12327635766d79777c", "score": "0.4868884", "text": "function deleteUnknownAutoBindMethods(component) {\n var names = Object.getOwnPropertyNames(component);\n\n names.forEach(function (name) {\n if (shouldDeleteInstanceMethod(component, name)) {\n delete component[name];\n }\n });\n}", "title": "" }, { "docid": "100a8658c4cb2c12327635766d79777c", "score": "0.4868884", "text": "function deleteUnknownAutoBindMethods(component) {\n var names = Object.getOwnPropertyNames(component);\n\n names.forEach(function (name) {\n if (shouldDeleteInstanceMethod(component, name)) {\n delete component[name];\n }\n });\n}", "title": "" } ]
333dbbe2355eed127f80f4c7eded52c6
set SNS Topic Attribute
[ { "docid": "19243c3ebee4bcc2b0777d805a49e060", "score": "0.7156147", "text": "function setSNSTopicAttributes(topicArn, attributeName, attributeValue) {\n const params = {\n TopicArn: topicArn,\n AttributeName: attributeName, // for example setting 'DisplayName' value\n AttributeValue: attributeValue\n }\n sns.setTopicAttributes(params, (err, resp) => {\n if (err) {\n console.log(\"Error: setSNSTopicAttributes\", err, topicArn);\n return err;\n }\n console.log(\"SNS Topic Attributes updated\", topicArn);\n return;\n })\n}", "title": "" } ]
[ { "docid": "4749e0feee40952ba5d83d9bfdbffb27", "score": "0.68136847", "text": "setSns(value) {\n sns.publish = value;\n }", "title": "" }, { "docid": "0b350b3c975c01940002736fc8b00adc", "score": "0.66216147", "text": "setTopic ({ id, chan, topic }) {\n return {\n id,\n type: module.exports.SET_TOPIC,\n chan,\n topic\n }\n }", "title": "" }, { "docid": "4361fbaff560ec31b792e951f2900acf", "score": "0.6114005", "text": "set(topic) {\n this.Id = topic.Id;\n this.Description = topic.Description;\n this.IsActivated = topic.IsActivated;\n this.StartDate = new Date(topic.StartDate);\n this.EndDate = new Date(topic.EndDate);\n }", "title": "" }, { "docid": "f35dab27f946cffd424da7cdfdd19824", "score": "0.58836013", "text": "registerTopic(topic = Err.required()){\n console.log(`Registring topic ${topic.pkfp}`);\n this.topics[topic.pkfp] = topic;\n }", "title": "" }, { "docid": "b7eac6df4e592335439ca7d71b6cb8ba", "score": "0.58394086", "text": "function changeTopic(jid,nick, msgType, newSubject) {\r\n var msg = $msg({\r\n //from: jid+\"/\"+nick,\r\n to: jid,\r\n type: msgType\r\n }).c(\"subject\", { xmlns: \"jabber:client\" }).t(newSubject);\r\n\r\n return converse.send(msg);\r\n }", "title": "" }, { "docid": "21baf810f646e19534c1afb27921650a", "score": "0.5780682", "text": "topic (envelope/* , ...strings */) {}", "title": "" }, { "docid": "a9a399778ba6e43340447796a45341f0", "score": "0.56617284", "text": "changeTopic(topic) {\r\n console.log(\"Selected: \" + topic);\r\n this.setState({selectedTopic : topic})\r\n this.state.selectedObject.topic = topic\r\n this.props.socket.emit('clientmessage', {type : \"startConsumeTopic\", topic: topic.value , zooKeeper : \"52.209.29.218:2181/\"})\r\n }", "title": "" }, { "docid": "4573a073d76d17214821afb80ff63417", "score": "0.56022686", "text": "setAttribute (key, value) {\n this.setAttributeNS(null, key, value)\n }", "title": "" }, { "docid": "ea22c380a458b8af6e351c1b4cbdc87c", "score": "0.5588534", "text": "bind(_topic) {\n return {\n subscriberId: this.emailAddress,\n endpoint: this.emailAddress,\n protocol: this.props.json ? sns.SubscriptionProtocol.EMAIL_JSON : sns.SubscriptionProtocol.EMAIL,\n filterPolicy: this.props.filterPolicy,\n deadLetterQueue: this.props.deadLetterQueue,\n };\n }", "title": "" }, { "docid": "0dca8c90349ab97fcbc590301bcab4fd", "score": "0.556352", "text": "addTopic() {\n\t\tthis.$http.post(\"/topic/add\", {\n\t\t\ttopic: this.topic\n\t\t});\n\t}", "title": "" }, { "docid": "9275af49281323003c34408ebe58a531", "score": "0.5531969", "text": "get topic () {\n\t\treturn this._topic;\n\t}", "title": "" }, { "docid": "10e656980ef9c2ce9681832822c07676", "score": "0.5509763", "text": "function createSNSTopic(topicName) {\n sns.createTopic({ Name: topicName }, (err, resp) => {\n if (err) {\n console.log(\"Error: createSNSTopic\", err, topicName);\n return err;\n }\n console.log(\"SNS Topic Created\", topicName, resp.TopicArn);\n return resp.TopicArn;\n })\n}", "title": "" }, { "docid": "a8e9349cf7c28144ab3a2c8cb63d8284", "score": "0.5500865", "text": "function publishToIoTTopic(topic, payload) {\n // TODO 4: Publish to specified IoT topic using device object\n // that you created\n \n}", "title": "" }, { "docid": "22feb411f9d63d5f4b4b82c710e44e3c", "score": "0.5467293", "text": "function setTopic (idOrText) {\n const parsedInt = parseInt(idOrText, 10)\n const existingTopic = topics.find(t => t.id === parsedInt)\n collectMetacode(context, configuration, function (err, metacode) {\n if (err) {\n rtmBot.sendM(iT('en.buildingContext.facilitatorSetTopicError'), facilitatorDM)\n return\n }\n function complete(topic) {\n focalTopic = topic\n selectedMetacode = metacode\n rtmBot.sendM(iT('en.buildingContext.facilitatorSetTopic'), facilitatorDM)\n Object.keys(dmIds).forEach(function (userId) {\n rtmBot.sendM(iT('en.buildingContext.participantSetTopic', {\n topicName: focalTopic.name,\n metacodeEmoji: selectedMetacode[2],\n metacodeName: selectedMetacode[0]\n }), dmIds[userId])\n })\n }\n if (existingTopic) {\n complete(existingTopic)\n } else {\n const topic = {\n name: idOrText,\n permission\n }\n addTopicToMap(id, topic, tokens[user], function (err, t) {\n if (err) {\n rtmBot.sendM('There was an error creating that topic', facilitatorDM)\n return\n }\n configuration.linkedMap.topics.push(t)\n complete(t)\n })\n }\n })\n\n }", "title": "" }, { "docid": "9146f9e022ce6bcbe5ed36ac9865ad9a", "score": "0.5465636", "text": "function sendTopicMessage(topic){\n var websockets = require('../../../websocket');\n var conns = websockets.getConnections();\n var keys = Object.keys(conns);\n for (var i=0; i<keys.length; i++){\n checkTopicPermissions(conns[keys[i]].user, topic._id, conns[keys[i]], function(send, sock) {\n if (send) {\n if (websockets.isOpen(sock)) {\n sock.send(JSON.stringify({topic: topic}));\n }\n }\n });\n }\n}", "title": "" }, { "docid": "c2dd4337957eced4d991874f4000680d", "score": "0.5464973", "text": "topic(topic){\n if (typeof(topic) == \"string\"){\n return new AgentID(topic, true);\n }else if (topic instanceof AgentID){\n if (topic.isTopic){\n return topic\n }else {\n return new AgentID(topic.name + \"__ntf\", true);\n }\n }else{\n return new AgentID(topic.classname || typeof(topic) + \".\"+topic, true);\n }\n }", "title": "" }, { "docid": "4514ec7b8acdc3864abfbf68c85cbc6f", "score": "0.53978753", "text": "constructor(name, opts) {\n super(\"cloud:topic:Topic\", name, {}, opts);\n this.name = name;\n this.topic = new aws.sns.Topic(name, {}, { parent: this });\n this.subscriptions = [];\n const topicId = this.topic.id;\n this.publish = (item) => __awaiter(this, void 0, void 0, function* () {\n const snsconn = new aws.sdk.SNS();\n const result = yield snsconn.publish({\n Message: JSON.stringify(item),\n TopicArn: topicId.get(),\n }).promise();\n });\n this.registerOutputs({\n topic: this.topic,\n });\n }", "title": "" }, { "docid": "f6fee0efe3b9c5dc12916e9c8f1d2d32", "score": "0.53957725", "text": "get topic() {\n\t\treturn this.__topic;\n\t}", "title": "" }, { "docid": "f6fee0efe3b9c5dc12916e9c8f1d2d32", "score": "0.53957725", "text": "get topic() {\n\t\treturn this.__topic;\n\t}", "title": "" }, { "docid": "e85db167a9721ed0b386223507eaadd3", "score": "0.5392461", "text": "function generateTopic(deviceId,messageType)\n{\n\n\n}", "title": "" }, { "docid": "99375c51c5e959ee28e4d4b3a713ce0a", "score": "0.53680474", "text": "function publishMessageToSNSTopic(topicArn, message) {\n const params = {\n Message: message, \n TopicArn: topicArn\n };\n sns.publish(params, (err, resp) => {\n if (err) {\n console.log(\"Error: publishMessageToSNSTopic\", err, topicArn);\n return err;\n }\n console.log(\"Message published to SNS Topic\", topicArn, resp); \n return resp;\n })\n}", "title": "" }, { "docid": "b6a80b22176d9f2177506c7d211e960e", "score": "0.53154004", "text": "addTopic(topic) {\n if(topic in this.listeners) return;\n this.listeners[topic] = {\n 'quality': 60,\n 'width': 640,\n 'height': 480,\n };\n this.listeners[topic]['displayNode'] = $('<img style=\"width:100%;\" src=\"http://' + window.location.hostname + ':8080/stream?topic=' + topic + '&quality=' + this.listeners[topic]['quality'] + '&width=' + this.listeners[topic]['width'] + '&height=' + this.listeners[topic]['height'] + '\"></img>').appendTo(this.viewerNode);\n this.updateSizes();\n }", "title": "" }, { "docid": "00d64552d0aa94d28e76853963cdd2f8", "score": "0.53079295", "text": "_handleNewTopicChange (topic) {\n\t\tthis.setState({\n\t\t\tnewNoteTopic: topic,\n\t\t});\n\t}", "title": "" }, { "docid": "d958358a1afb116bd347aa9cefd70c5c", "score": "0.529603", "text": "getTopic(){\n\t\t\n\t}", "title": "" }, { "docid": "3c1f042fff4983ee95c26ae3af31d8c4", "score": "0.52893555", "text": "function publishToSNS(error, url) {\n if (error)\n console.log(\"publishToSNS() error: \", error);\n else {\n console.log(\"publishToSNS() prepare to publish ....\");\n var params = {\n Message: url,\n Subject: 'Detect something !',\n TopicArn: process.env['TO_SNS_TOPIC_ARN']\n };\n sns.publish(params, function(err, data) {\n if (err) console.log(err, err.stack); // an error occurred\n else console.log(\"publishToSNS() Successfully publish to SNS topic \", data); // successful response\n });//sns.publish\n\n }//else\n}", "title": "" }, { "docid": "502fc58b0cfb6067b40b9b8a6422f2a5", "score": "0.5289207", "text": "function sendToTopic(topic, msg, from) {\n var data = {\n \"type\":\"topic_msg\",\n \"sender\":from, \n \"message\":msg\n }\n console.log(data);\n to = '/topics/' + topic;\n\n // Send push notification via the Send Notifications API\n // https://pushy.me/docs/api/send-notifications\n pushyAPI.sendPushNotification(data, to, {}, function(err, id) { // Same as (err, id)) => {} ?\n if (err) {\n return console.log('Fatal Error', err);\n }\n console.log('Push sent successfully! (ID: ' + id + ')');\n })\n}", "title": "" }, { "docid": "628dbcdeee9a939f8433d0fe72666959", "score": "0.52773994", "text": "function zwaveSetMessage(topic, message) {\n try {\n\n var payload\n var trimmedTopic = topic.substring(topic.lastIndexOf(\"/\")+1)\n\n logging.info(' mqtt set message received, topic:' + trimmedTopic + ', message: ' + message)\n\n try {\n //We're expecting all messages to be in a JSON format\n payload = JSON.parse(message)\n } catch (err) {\n logging.warn('Illegal message! Msg:\"' + message + '\" Error:(' + err + ')')\n return\n }\n\n logging.info(JSON.stringify(payload, null, 2))\n\n switch (true) {\n // switch On/Off: for basic single-instance switches and dimmers\n case /switchOn/.test(trimmedTopic):\n ozw.setValue(payload.nodeid, 37, 1, 0, true)\n break\n case /switchOff/.test(trimmedTopic):\n ozw.setValue(payload.nodeid, 37, 1, 0, false)\n break\n\n // setLevel: for dimmers\n case /setLevel/.test(trimmedTopic):\n ozw.setValue(payload.nodeid, 38, 1, 0, payload.value)\n break\n\n // setValue: for everything else\n case /setValue/.test(trimmedTopic):\n logging.info(util.format(\"ZWaveOut.setValue payload: %j\", payload))\n ozw.setValue(\n payload.nodeid, (payload.cmdclass || 37), // default cmdclass: on-off\n (payload.instance || 1), // default instance\n (payload.cmdidx || 0), // default cmd index\n payload.value\n )\n break\n\n /* EXPERIMENTAL: send basically every available command down\n * to OpenZWave, just name the function in the message topic\n * and pass in the arguments as \"payload.args\" as an array:\n * {\"topic\": \"someOpenZWaveCommand\", \"payload\": {\"args\": [1, 2, 3]}}\n * If the command needs the HomeID as the 1st arg, use \"payload.prependHomeId\"\n * */\n default:\n if (trimmedTopic && typeof ozw[trimmedTopic] === 'function' && payload) {\n\n var args = payload.args || []\n\n if (payload.prependHomeId) args.unshift(ozwConfig.homeid)\n\n logging.info('attempting direct API call to ' + topic + '()')\n\n try {\n var result = ozw[trimmedTopic].apply(ozw, args)\n logging.info('direct API call success, result=' + JSON.stringify(result))\n if (typeof result != undefined) {\n payload.result = result\n // send off the direct API call's result to the output\n client.publish(zwaveTopic + 'apiResult/' + trimmedTopic, JSON.stringify(payload))\n }\n } catch (err) {\n logging.info('direct API call to ' + trimmedTopic + ' failed: ' + err, 'error')\n }\n }\n }\n }\n catch (ex) {\n logging.warn('zwave error (' + ex + ')')\n zwcallback(\"zwave error\", ex)\n return\n }\n}", "title": "" }, { "docid": "c99ef39304c3259619bc4ccc30884f86", "score": "0.52535766", "text": "function getSNSTopicAttributes(topicArn) {\n sns.getTopicAttributes({ TopicArn: topicArn }, (err, resp) => {\n if (err) {\n console.log(\"Error: getSNSTopicAttributes\", err, topicArn);\n return err;\n }\n console.log(\"SNS Topic Attributes\", topicArn, resp);\n return resp; // return object { Policy ; {} , Owner: '', SubscriptionsPending: '', TopicArn: '', EffectiveDeliveryPolicy: {}, SubscriptionsConfirmed: '', DisplayName: '', SubscriptionsDeleted: ''\n\n })\n}", "title": "" }, { "docid": "3eb7dabcf627b76ce8bccac3b475b5a3", "score": "0.52104056", "text": "get snsTopicArnInput() {\n return this._snsTopicArn;\n }", "title": "" }, { "docid": "ad5a6a49b26c1fda197033348e932a68", "score": "0.5188948", "text": "setTopicWho ({ id, chan, hostmask, time }) {\n return {\n id,\n type: module.exports.SET_TOPIC_WHO,\n chan,\n hostmask,\n time\n }\n }", "title": "" }, { "docid": "240563a38cd0a0f87d0ce5fe5c1b16f2", "score": "0.51859844", "text": "subscribe (tasmotaNode, topic, qos, callback) {\n this.subscriptions[topic] = this.subscriptions[topic] || {}\n this.subscriptions[topic][tasmotaNode.id] = callback\n this.client.subscribe(topic, { qos: qos })\n }", "title": "" }, { "docid": "14dd025fb700f2f19b4632ad3b66bd0a", "score": "0.5174042", "text": "function pub_topic() {\r\n console.log(1111);\r\n var msg = new ROSLIB.Message({\r\n data: true\r\n });\r\n topicStart.Pub(msg)\r\n}", "title": "" }, { "docid": "7435f6d6ded37df74187e53433e3f449", "score": "0.5152674", "text": "function Topic( namespace ){\n\n if ( !(this instanceof Topic) ) {\n return new Topic( namespace );\n }else{\n\n this.namespace = namespace || \"\";\n this._callbacks = [];\n this._topics = [];\n this.stopped = false;\n\n }\n }", "title": "" }, { "docid": "7435f6d6ded37df74187e53433e3f449", "score": "0.5152674", "text": "function Topic( namespace ){\n\n if ( !(this instanceof Topic) ) {\n return new Topic( namespace );\n }else{\n\n this.namespace = namespace || \"\";\n this._callbacks = [];\n this._topics = [];\n this.stopped = false;\n\n }\n }", "title": "" }, { "docid": "55defe795d3ab9e1fa5e8c0ae9048c10", "score": "0.5152515", "text": "function changeTimeTopic() {\n let discordChannel = client.channels.get(config.channelID);\n parser.updateTime()\n .then((response) => {\n discordChannel.setTopic(response);\n })\n .catch((err) => {\n discordChannel.setTopic('Could not fetch Cetus time.');\n console.log(err);\n })\n}", "title": "" }, { "docid": "07d1642b973f7c13df95b7561d17c9ea", "score": "0.5138293", "text": "bind(_topic) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_sns_ITopic(_topic);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.bind);\n }\n throw error;\n }\n return {\n subscriberId: this.url,\n endpoint: this.url,\n protocol: this.protocol,\n rawMessageDelivery: this.props.rawMessageDelivery,\n filterPolicy: this.props.filterPolicy,\n filterPolicyWithMessageBody: this.props.filterPolicyWithMessageBody,\n deadLetterQueue: this.props.deadLetterQueue,\n };\n }", "title": "" }, { "docid": "1230a645b2e8bec00471e510ed1cab5b", "score": "0.5136291", "text": "function publish(topic, data) {\n\n }", "title": "" }, { "docid": "d71694d5a5aa74cbb563cf253c555c1a", "score": "0.51204944", "text": "function deletSNSTopic(topicArn) {\n sns.deleteTopic({ TopicArn: topicArn }, err => {\n if (err) {\n console.log(\"Error: deletSNSTopic\", err, topicArn);\n return err;\n }\n console.log(\"SNS Topic Deleted\", topicArn);\n return;\n })\n}", "title": "" }, { "docid": "5d18b833788a0cd8392d6c07d3f1d89d", "score": "0.51142716", "text": "subscribe (topic){\n if (!(topic instanceof AgentID)){\n console.warn(\"Invalid AgentID\");\n return;\n }\n if (!topic.isTopic){\n topic = new AgentID(topic.name + \"__ntf\", true);\n }\n this._subscribers.push(topic);\n return true;\n }", "title": "" }, { "docid": "52cee6e69fc3d1e5356484d7fb4a46d7", "score": "0.51114136", "text": "bind(_scope, bucket) {\n this.topic.addToResourcePolicy(new iam.PolicyStatement({\n principals: [new iam.ServicePrincipal('s3.amazonaws.com')],\n actions: ['sns:Publish'],\n resources: [this.topic.topicArn],\n conditions: {\n ArnLike: { 'aws:SourceArn': bucket.bucketArn },\n },\n }));\n return {\n arn: this.topic.topicArn,\n type: s3.BucketNotificationDestinationType.TOPIC,\n dependencies: [this.topic],\n };\n }", "title": "" }, { "docid": "4927ffe5df4472c14f6fafd2def9cd6c", "score": "0.510731", "text": "serverSend(topic, payload) { }", "title": "" }, { "docid": "26f29808f18ae6298d238ff04edc3780", "score": "0.5085335", "text": "function subjectFromTopic(topic) {\n if (topic == \"customers\\/create\") {\n return \"A new customer has been created.\";\n } else if (topic == \"orders\\/create\") {\n return \"A new order has been created.\";\n } else if (topic == \"disputes\\/create\") {\n return \"A new cart has been created.\";\n }\n}", "title": "" }, { "docid": "282e006e345351077fb3895d35a8c41d", "score": "0.5060231", "text": "sendMessage(message) {\n this.mqttClient.publish('mytopic', message);\n }", "title": "" }, { "docid": "282e006e345351077fb3895d35a8c41d", "score": "0.5060231", "text": "sendMessage(message) {\n this.mqttClient.publish('mytopic', message);\n }", "title": "" }, { "docid": "7af4e811b843859b302d7c97b4996ee4", "score": "0.5055394", "text": "function test_topicSettable() {\n let channel = new irc.ircChannel(new FakeAccount(), \"#test\", \"nick\");\n // We're not in the room yet, so the topic is NOT editable.\n equal(channel.topicSettable, false);\n\n // Join the room.\n channel.getParticipant(\"nick\");\n // The topic should be editable.\n equal(channel.topicSettable, true);\n\n // Receive the channel mode.\n channel.setMode(\"+t\", [], \"ChanServ\");\n // Mode +t means that you need status to set the mode.\n equal(channel.topicSettable, false);\n\n // Receive a user mode.\n channel.setMode(\"+o\", [\"nick\"], \"ChanServ\");\n // Nick is now an op and can set the topic!\n equal(channel.topicSettable, true);\n\n run_next_test();\n}", "title": "" }, { "docid": "299729b67852e77cdd1b59237312c30d", "score": "0.50487053", "text": "publish(topic, message) {\n const msg = {\n text: message\n };\n\n if (topic === \"chattopic/mqtt\") {\n this.cargoplane.publish(topic, msg);\n } else {\n console.log(\"publishing using HTTP\");\n let publishUrl = process.env.REACT_APP_API_URL + \"publish\";\n let body = {\n topic: topic,\n text: message\n };\n Axios.post(publishUrl, body).then(() => {\n console.log(\"success\");\n });\n }\n }", "title": "" }, { "docid": "2a78ce708f1bef3037a1a2d9c6794574", "score": "0.50443375", "text": "function sendToTopic(topic, msg, from) {\n\t//build the message for FCM to send\n\tvar data = {\n\t\t\"type\": \"topic_msg\",\n\t\t\"sender\": from,\n\t\t\"message\": msg,\n\t};\n\tconsole.log(data);\n\tto = '/topics/' + topic;\n\t// Send push notification via the Send Notifications API\n\t// https://pushy.me/docs/api/send-notifications\n\tpushyAPI.sendPushNotification(data, to, {}, function (err, id) {\n\t\t// Log errors to console\n\t\tif (err) {\n\t\t\treturn console.log('Fatal Error', err);\n\t\t}\n\t\t// Log success\n\t\tconsole.log('Push sent successfully! (ID: ' + id + ')');\n\t});\n}", "title": "" }, { "docid": "9e190997815dc367daf20d9c7397e5ba", "score": "0.5039401", "text": "function sendToTopic(msg, from, topic) {\r\n //build the message for FCM to send\r\n var message = {\r\n notification: {\r\n title: 'New Message from '.concat(from),\r\n body: msg,\r\n },\r\n data: {\r\n \"type\": \"contacrt\",\r\n \"sender\": from,\r\n \"message\": msg,\r\n },\r\n \"topic\": topic\r\n };\r\n\r\n console.log(message);\r\n\r\n // Send a message to the device corresponding to the provided\r\n // registration token.\r\n sendMessage(message);\r\n}", "title": "" }, { "docid": "e353b25e4ac65cb959820d01f85fab50", "score": "0.5033837", "text": "function updateActiveTopic(topic) {\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(topic);\n // d3.select(\"#g-topic\").text((topic.commentsCount > maxComments ? \"Uma amostra dos \" : topic.commentsCount || \"Não há\") + \" comentários que utilizam a palavra “\" + topic.name + \"”\");\n } else {\n node.classed(\"g-selected\", false);\n updateMentions()\n // d3.select(\"#g-topic\").text(\"Uma amostra dos comentários\");\n }\n }", "title": "" }, { "docid": "627d1a143c6c02e15fd76a3f1595ec8c", "score": "0.50336134", "text": "function serializeSubscribeTopics( v, topics ) {\n for (var i = 0; i < topics.length; i++) {\n var topic = topics[i];\n if (typeof topic == \"string\") {\n topic = { topic: topic };\n }\n var qos = topic.qos || 0;\n var noLocal = topic.no_local || false;\n var retainAsPublished = topic.retain_as_published || false;\n var retainHandling = topic.retain_handling || 0;\n var flags = 0;\n flags |= retainHandling << 4;\n flags |= (retainAsPublished ? 1 : 0) << 3;\n flags |= (noLocal ? 1 : 0) << 2;\n flags |= qos;\n v.appendUTF8(topic.topic);\n v.append1(flags);\n }\n }", "title": "" }, { "docid": "4657eb19bacb65f8185cceb0297790ba", "score": "0.50220263", "text": "updateTopic(state, data) {\n let foundIndex = state.topics.findIndex(x => x.id === data.id); // find topic with a specific id\n state.topics[foundIndex].content = data.content;\n state.topics[foundIndex].votes = data.votes;\n }", "title": "" }, { "docid": "ce993f86fecdeefebfb32761ea56042b", "score": "0.5013556", "text": "function update_msg_attr(msgbase, msg, attr)\n{\n\tvar hdr = msgbase.get_msg_header(msg.number, /* expand: */false);\n\tif(hdr == null) {\n\t\talert(\"get_msg_header(\" + msg.number + \") failed: \" + msgbase.error);\n\t\treturn false;\n\t}\n\thdr.attr = attr;\n\tvar result = msgbase.put_msg_header(hdr);\n\tif(!result)\n\t\talert(\"put_msg_header(\" + msg.number + \") failed: \" + msgbase.error);\n\telse {\n\t\tmsg.attr = attr;\n\t\tmsg.attributes = msg_attributes(msg, msgbase);\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "176f4f2973204d727cf7300c49244640", "score": "0.49865094", "text": "function update(topic) {\n let topics = observers.filter((observer) => {\n return observer.getEventName() === topic\n })\n topics.forEach(topic => {\n topic.getAction().call()\n })\n }", "title": "" }, { "docid": "e615c45367d8896374039a96171bdfdf", "score": "0.49823487", "text": "function MQTTpublish(topic, title, msg) {\n\n console.log(\"PUBLISH\");\n if (isConnected) {\n var payload = {\n \"d\": {\n \"id\": iotplatformConfig.deviceId,\n \"ts\": (new Date()).getTime(),\n \"title\": title,\n \"msg\": msg\n }\n };\n var message = new Paho.MQTT.Message(JSON.stringify(payload));\n message.destinationName = \"iot-2/evt/\" + topic + \"/fmt/json\";;\n try {\n client.send(message);\n //console.log(\"[%s] Published\", new Date().getTime());\n $scope.infotxt = \"Published:\" + JSON.stringify(payload);\n } catch (err) {\n console.error(err);\n isConnected = false;\n }\n }\n\n }", "title": "" }, { "docid": "0bc9d38e5349a9ed49c1d9740235bbc0", "score": "0.49805826", "text": "function forward_topic() {\r\n let isi = \"maju\\n\"\r\n var msg = new ROSLIB.Message({\r\n data: isi\r\n });\r\n console.log(msg);\r\n serial_listener.publish(msg);\r\n }", "title": "" }, { "docid": "1bd7ecaaf22c0173e7a5b54027c74594", "score": "0.49670622", "text": "#attachCacheToTopic(topic) {\n topic._tinode = this;\n\n topic._cacheGetUser = (uid) => {\n const pub = this.#cacheGet('user', uid);\n if (pub) {\n return {\n user: uid,\n public: mergeObj({}, pub)\n };\n }\n return undefined;\n };\n topic._cachePutUser = (uid, user) => {\n this.#cachePut('user', uid, mergeObj({}, user.public));\n };\n topic._cacheDelUser = (uid) => {\n this.#cacheDel('user', uid);\n };\n topic._cachePutSelf = _ => {\n this.#cachePut('topic', topic.name, topic);\n };\n topic._cacheDelSelf = _ => {\n this.#cacheDel('topic', topic.name);\n };\n }", "title": "" }, { "docid": "219fc3cee661bf2a11a4335a236aa9b0", "score": "0.49544403", "text": "function changeTopic(){\n\n\t\ttopic = this.getAttribute(\"id\");\n\n\t\t// Get correct title and subtitle\n\t\tif (topic === \"income\"){\n\t\t\ttitel = \"Yearly income\";\n\t\t\tsubtitel = \"x 1000 euro\";\n\t\t}\n\t\telse if (topic === \"birthsanddeaths\"){\n\t\t\ttitel = \"Amount of births and deaths\";\n\t\t\tsubtitel = \"Per 1000 people\";\n\t\t}\n\t\telse if (topic === \"causesofdeath\"){\n\t\t\ttitel = \"Causes of Death\";\n\t\t\tsubtitel = \"Per 1000 people\";\n\t\t}\n\t\telse if (topic === \"migration\"){\n\t\t\ttitel = \"Migration\";\n\t\t\tsubtitel = \"Percentages\";\n\t\t}\n\t\telse if (topic === \"socialsecurity\"){\n\t\t\ttitel = \"Social Security\";\n\t\t\tsubtitel = \"Per 1000 people\";\n\t\t}\n\t\telse if (topic === \"education\")\n\t\t{\n\t\t\ttitel = \"Highest level of Education\";\n\t\t\tsubtitel = \"Per 1000 people\";\n\t\t}\n\n\t\t// Get correct data and update chart\n\t\tvar data = years[year];\n\t\tvar provinceDataTwo = getProvinceData(data, currentProvince);\n\t\tupdateBarchart(provinceDataOne, provinceDataTwo, currentProvince, topic, titel, subtitel, barSettings);\t\n\t}", "title": "" }, { "docid": "918eff6d6bb53f17593dd7d1121c5cb2", "score": "0.49449414", "text": "function pubMQTT(topic, payload){\n log.debug('mqtt >', topic, payload);\n mqtt.publish(topic, payload);\n}", "title": "" }, { "docid": "11126e9c28b52d83ef6469794d1c3c1f", "score": "0.49407604", "text": "updateNewChatroomTopic(evt) {\n this.setState({\n newChatroomTopic: evt.target.value\n });\n }", "title": "" }, { "docid": "4d92ff33b9877bc203ed909c9eeff213", "score": "0.49265555", "text": "_overwritePrimitiveProperties(updateTopicDoc) {\n this._topicDoc.subject = updateTopicDoc.subject;\n this._topicDoc.responsibles = updateTopicDoc.responsibles;\n this._topicDoc.isNew = updateTopicDoc.isNew;\n this._topicDoc.isRecurring = updateTopicDoc.isRecurring;\n }", "title": "" }, { "docid": "ba6106da57d67724d87f6ff1ba52174a", "score": "0.49196994", "text": "function publish(topic, payload, options) {\n options = options || {};\n let msg = {\n type: \"publish\",\n topic: topic,\n payload: payload,\n qos: options.qos || 0,\n retain: options.retain || false,\n properties: options.properties || {}\n };\n publish_mqtt_message(msg, options);\n }", "title": "" }, { "docid": "551b2f6ee195ca8db5ef40c2c9bc61d1", "score": "0.49017924", "text": "function createSNSTopicSubscription(topicArn, protocol, endPoint) {\n const params = {\n Protocol: protocol, // protocol can be any one of these: HTTP, HTTPS, Email, Email-JSON, Amazon SQS, AWS Lambda \n TopicArn: topicArn,\n Endpoint: endPoint // API url, email address, lambda function arn etc\n };\n sns.subscribe(params, (err, resp) => {\n if (err) {\n console.log(\"Error: createSNSTopicSubscription\", err, topicArn);\n return err;\n }\n console.log(\"SNS Topic Subscription created\", topicArn, resp); \n return;\n })\n}", "title": "" }, { "docid": "8fc6a0806b8d8c53a3ccba088cbbefea", "score": "0.48980722", "text": "function topic_event( event ) {\n let topic = event.target.getAttribute( \"data-on\"+event.type+\"-topic\" );\n\n if (typeof topic === \"string\") {\n let cancel = event.target.getAttribute( \"data-on\"+event.type+\"-cancel\" );\n\n if (cancel === null) {\n cancel = true;\n } else {\n switch (cancel) {\n case \"0\":\n case \"no\":\n case \"false\":\n cancel = false;\n break;\n case \"preventDefault\":\n cancel = 'preventDefault';\n break;\n default:\n cancel = true;\n break;\n }\n }\n\n if (event.target.hasAttribute( \"data-on\"+event.type+\"-message\" )) {\n let msg = event.target.getAttribute( \"data-on\"+event.type+\"-message\" );\n if (typeof msg === \"string\") {\n msg = JSON.parse(msg);\n }\n } else {\n let attrs = event.target.attributes;\n msg = {};\n for (let i = attrs.length - 1; i >= 0; i--) {\n msg[attrs[i].name] = attrs[i].value;\n }\n }\n let options = {\n cancel: cancel\n }\n if (event.target.hasAttribute( \"data-on\"+event.type+\"-response-topic\" )) {\n options.response_topic = event.target.getAttribute( \"data-on\"+event.type+\"-response-topic\" )\n }\n cotonic.ui.on(topic, msg, event, options);\n\n if(event.type === \"submit\" && event.target.getAttribute(\"data-onsubmit-reset\") !== null) {\n event.target.reset();\n }\n }\n }", "title": "" }, { "docid": "92b209dd668719fb2028af525049e964", "score": "0.48922452", "text": "function send(attraction, waitingTime) {\n\t// Send a message to devices subscribed to the provided topic.\n\tvar payload = {\n\t\tnotification: {\n\t\t\ttitle: attraction.toString(),\n\t\t\tbody: waitingTime.toString()\n\t\t}\n};\n\nvar options = {\n\tpriority: \"high\",\n\ttimeToLive: refreshRate\n};\n\tadmin.messaging().sendToTopic(attraction, payload, options)\n\t.then(function(response) {\n // See the MessagingTopicResponse reference documentation for the\n // contents of response.\n console.log(\"Successfully sent message:\", response);\n\t})\n .catch(function(error) {\n\t console.log(\"Error sending message:\", error);\n\t });\n}", "title": "" }, { "docid": "7df364bfd21ead446b892df7e309f82f", "score": "0.4856696", "text": "publish (topic, payload, options) {\n this.client.publish(topic, payload, options)\n }", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "02074975028e062a0123d1e2e2e085d1", "score": "0.48495507", "text": "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "title": "" }, { "docid": "b2c993b2ad0e6639613a1e6cb3856700", "score": "0.48349226", "text": "handleTopic(event) {\n this.setState({ topic: event.target.value });\n this.handleChange();\n }", "title": "" }, { "docid": "1a90b79f011f0183434e75f2b90bc1a3", "score": "0.48218626", "text": "setAttribute(name, value) {\n this.setAttributeNS(null, name, value);\n }", "title": "" }, { "docid": "58ba12c87c7edc57731d0b40e5fa8145", "score": "0.4817644", "text": "addTopic(state, data) {\n // find the max id in the topic list\n const maxId = state.topics.length < 1 ? 0 : state.topics.reduce(function(prev, current) {\n return (prev.id > current.id) ? prev : current\n }).id;\n data.id = maxId + 1; // assign a increase id for ne topic\n data.votes = 0;\n state.topics.push(data);\n }", "title": "" }, { "docid": "6ba332defd57a35670fb457c88438f22", "score": "0.48120993", "text": "onSettings(oldSettings, newSettings, changedKeys, callback){\n\n this._log('onSettings() in ./lib/device.js called');\n\n // if the setting MQTTtopic has changed...\n if (changedKeys.indexOf('MQTTtopic') !== -1){\n\n // trap for the topic containing a '/'; this shouldn't happen as the RegEx should stop it\n if (newSettings.topic.indexOf('/') !== -1 || newSettings.topic.indexOf('+') !== -1){\n return callback(new RangeError('MQTT topic contains one or more invalid characters'), null);\n }; // if\n\n // unsubscribe from the old topics\n client.unsubscribe(topics, function(err){\n\n if (err){ return callback(err, null) };\n\n // update with new string\n this.setSettings( {'MQTTtopic': newSettings.topic} );\n\n // update the topics array with the new MQTT server\n topics = topics.map(function(topic){\n topic = topic.split('/'); // split into an array delimited with '/'\n topic[0] = newSettings.topic;\n topic = topic.join('/'); // recombine the array into a string\n return topic; // update the array with the new topic\n }); // topics.map\n\n // subscribe to the MQTT topics, that array now updated with the new server name\n client.subscribe(topics, {}, function(err, granted){\n if (err){ return callback(err, null) };\n return callback(null); // to signal no error\n }); // client.subscribe\n\n }); // client.unsubscribe\n\n }; // if (changedKeys...)\n\n // catch all\n return callback(null); // to signal no error\n\n }", "title": "" }, { "docid": "4bafc43846e5baaed2f6b5e92548593a", "score": "0.48026058", "text": "function setCurrentTopicBeforeRequestCallback(request, postData, queryParam) {\n postData['blogId'] = this.targetTopicId;\n }", "title": "" }, { "docid": "6ac4d398153b4e5b0a7d5e547c0559f7", "score": "0.4798049", "text": "function topic(topic, noOfPic){\n\t//trim empty spaces in the topic and replace \n\ttopic = topic.trim();\n\n\t//removes multi spaces into single space\n\ttopic = topic.replace( /\\s\\s+/g, ' ' );\n\t//convert the spaces to +\n\ttopic = topic.replace(/ +/g,\"+\");\n\tthis.topic = topic.toLowerCase();\n\t\n\tthis.noOfPic = noOfPic;\n\n\tthis.createButton = function(){\n\t\tvar buttonTag = $('<button>');\n\t\tbuttonTag.addClass('btn btn-lg btn-success topicButton');\n\t\tbuttonTag.attr('data-topic', this.topic);\n\t\tbuttonTag.attr('data-totalpic', this.noOfPic);\n\t\tvar buttonText = this.topic.replace(/(\\+)+/g,\" \"); \n\t\tbuttonText= changetoCapitol(buttonText);\n\t\tbuttonTag.text(buttonText);\n\t\treturn(buttonTag);\n\t};\n\n\tthis.buttonTag= this.createButton();\n\n}", "title": "" }, { "docid": "abe710c0e4851c160f9423a6b5d01751", "score": "0.4795963", "text": "function setUserId({sID, message}) {\n // incoming connected event with data\n // debugger; \n vm.socketID = sID; \n //vm.username = username;\n }", "title": "" }, { "docid": "0e87d70ef111db01246497e915587e91", "score": "0.47944042", "text": "function subscribe(topic, callback) {\n\n }", "title": "" }, { "docid": "963231e029fa72a911a38f9a1016158d", "score": "0.47928283", "text": "function setAttributeNS(node, attributeNamespace, attributeName, attributeValue) {\n node.setAttributeNS(attributeNamespace, attributeName, attributeValue);\n }", "title": "" }, { "docid": "963231e029fa72a911a38f9a1016158d", "score": "0.47928283", "text": "function setAttributeNS(node, attributeNamespace, attributeName, attributeValue) {\n node.setAttributeNS(attributeNamespace, attributeName, attributeValue);\n }", "title": "" }, { "docid": "963231e029fa72a911a38f9a1016158d", "score": "0.47928283", "text": "function setAttributeNS(node, attributeNamespace, attributeName, attributeValue) {\n node.setAttributeNS(attributeNamespace, attributeName, attributeValue);\n }", "title": "" }, { "docid": "963231e029fa72a911a38f9a1016158d", "score": "0.47928283", "text": "function setAttributeNS(node, attributeNamespace, attributeName, attributeValue) {\n node.setAttributeNS(attributeNamespace, attributeName, attributeValue);\n }", "title": "" } ]
9c2a9b4fa4982d2b849d5f8735e56454
const w = BuildWorker(Calc) w.onmessage = e => console.log(e.data) w.postMessage(3) do in separate worker process
[ { "docid": "8f2f1fe20ee163cf99080c8c86321be1", "score": "0.0", "text": "function getEpisode(iters, actor, critic) {\n return tf.tidy(function () {\n var g = new Game_1.Game(index_1.context, index_1.canvas_width, index_1.canvas_height);\n var states = [];\n var actionprobs = [];\n var values = [];\n var actions = [];\n var rewards = [];\n for (var i = 0; i < iters; i++) {\n var state = tf.tensor([g.getState()]);\n var probs = actor.predict(state);\n var value = critic.predict(state);\n var action = tf.multinomial(probs, 1, Math.random(), true);\n var a = action.dataSync();\n var reward = g.step(a[0]);\n states.push(state);\n actionprobs.push(probs);\n values.push(value);\n actions.push(action);\n rewards.push(reward);\n }\n var valuesFixed = tf.concat(values).squeeze();\n var v = valuesFixed.dataSync();\n v = Array.from(v);\n var advantages = gae_1.GAE(rewards, v);\n var discounted_rewards = gae_1.Discount(rewards, 0.99, v[v.length - 1]);\n return {\n states: tf.concat(states),\n actionprobs: tf.concat(actionprobs),\n values: valuesFixed,\n actions: tf.concat(actions).squeeze(),\n rewards: rewards,\n advantages: tf.tensor(advantages),\n discounted_rewards: tf.tensor(discounted_rewards)\n };\n });\n}", "title": "" } ]
[ { "docid": "9354ef65853fd8b5a9a3b2ae188437d6", "score": "0.7178734", "text": "testWorker() {\n let barWorker = new BarWorker()\n barWorker.addEventListener('message', function (e) {\n console.log(e.data)\n })\n barWorker.postMessage(\"PING from the main thread\")\n }", "title": "" }, { "docid": "02628cefef767fd00ba40822cef1621e", "score": "0.6954068", "text": "function sendMessageToWorker(e) {\n\tvar data = document.getElementById(\"msg\").value;\n if (myWorker != null) {\n myWorker.port.postMessage(data);\n } \n }", "title": "" }, { "docid": "4769368f327d1814968ad4fe8eafcbc9", "score": "0.69278044", "text": "function webWorkerMessageHandler(data) {\n return new Promise(resolve => {\n layoutWorker.onmessage = e => resolve(e.data)\n layoutWorker.postMessage(data)\n })\n }", "title": "" }, { "docid": "dbc0b8e040bef1887321dccf6ca5a4d6", "score": "0.6850004", "text": "function initiateWorker () {\n\n // define callback\n let cb = (err, result) => {\n if(err) { return console.error(err); }\n\n // if worker thread is still working on list then write index and updated value\n if(result.isInProgress) {\n console.log(\"Message from worker at Index: \", result.index, \" and updated value: \", result.val);\n }\n // when worker thread complete process then console original list from main and updated list from worker thread\n else {\n console.log(\"Original List Data: \", lst);\n console.log(\"Updated List From worker: \", result.val);\n }\n };\n\n // start worker\n myWorker = startWorker(__dirname + '/workerCode.js', cb);\n\n // post a multiple factor to worker thread\n myWorker.postMessage({ multipleFactor: getRandomArbitrary(3,9) });\n}", "title": "" }, { "docid": "c32ec1be062b439c528e2d2e181bd8a7", "score": "0.6808084", "text": "function workerOnMessage(e) {\n var data = e.data\n ;\n\n switch(data.action) {\n case 'message':\n // Log a message from the web worker.\n console.log(data);\n break;\n case 'saveState':\n // send a state save message to a distributor.\n data.workunitId = workunitId;\n socket.json.send(data);\n break;\n case 'completed':\n // Set payload as completed, send data and increment stats.\n data.workunitId = workunitId;\n socket.json.send(data);\n\n stats.progress = data;\n stats.numCompleted++;\n break;\n }\n }", "title": "" }, { "docid": "2c4c7ed84b38472e7ba9476e0abbf7b8", "score": "0.65971696", "text": "function workermessage(e) {\n workermessage.last = e;\n if (e.data[0] === 'details') {\n W.xxdetails = e.data[1];\n W.newcsynthcurrent = e.data[2];\n W.xxall = e;\n log('details recovered and saved in xxall, xxdetails and newcsynthcurrent, numInstances', W.xxdetails.numInstances);\n } else if (e.data[0] === 'echo test') {\n const et = performance.now(); // <<<< this is the echo with timestamp\n const st = e.data[1]; // so measure new time and log the difference\n log('echo time ', et-st);\n } else if (e.data[0] === 'logmessage') {\n msgfix('>' + e.data[1], e.data[2]);\n } else if (e.data[0] === 'contacts result') {\n const x = {}; copyFrom(x, e.data[1]); x.data = 'DATA';\n log('contacts result', x, e.data[2]);\n } else if (e.data[0] === 'contacts springs') {\n log('contacts springs recovered');\n } else {\n log('worker comment', e.data);\n }\n}", "title": "" }, { "docid": "5395511ae43c69666ac79941e839998a", "score": "0.65765184", "text": "postMessage(msg) {\r\n this.worker.postMessage(msg);\r\n }", "title": "" }, { "docid": "075040c81ac4b7f0373152bf652f9a31", "score": "0.6537956", "text": "function trainWorker(){\n\tworker.postMessage({start: true, n: n})\n}", "title": "" }, { "docid": "654a6a033d000d02755d623edabd2a08", "score": "0.65031475", "text": "async function exec(data) {\n console.debug(\"execution in a worker has started\")\n const result = await execModule(data);\n parentPort.postMessage(result);\n}", "title": "" }, { "docid": "26768a198801705b77a0f7cd2d015c94", "score": "0.6482417", "text": "function webWorkers() {\n // Give it the name of a js file to run in the background\n const worker = new Worker('task.js');\n // self refers to the worker\n // message to the worker\n worker.postMessage('Hello');\n // Message from the worker\n self.postMessage('Finished')\n worker.addEventListener('message', (event) => {\n console.log(event.data);\n })\n worker.terminate() //Same as self.close()\n\n}", "title": "" }, { "docid": "6265b60c6c986b8f797500d87a03e6a0", "score": "0.64823145", "text": "_create_worker(){\n // Browser detection\n // Safari 3.0+ \"[object HTMLElementConstructor]\"\n let isSafari = /constructor/i.test(window.HTMLElement) || (function (p) {\n return p.toString() === \"[object SafariRemoteNotification]\"; })(!window['safari'] ||\n (typeof safari !== 'undefined' && safari.pushNotification)),\n\n runner = function _worker_runner(){\n self._isSafari = safari_test;\n\n self.onmessage = function(e) {\n //console.log('Message received from main script', this, e.data);\n //var workerResult = 'Result: ' + (e.data[0] * e.data[1]);\n\n if (!this.hasOwnProperty('_functions')) this._functions = {};\n let data = e.data;\n this._data = data;\n\n if (!self._isSafari) data.function = 'function ' + data.function;\n //console.log(data.type, data.name, data.data);\n\n if(data.type === 'register')\n this._functions[data.name] = eval('( ' + data.function + ')');\n\n if(data.type === 'process')\n (this._functions[data.name].bind(this))();\n\n if(data.type === 'run')\n (eval('( ' + data.function + ')').bind(this))();\n\n //console.log('Posting message back to main script');\n self.postMessage({'type': data.type, 'name': data.name, 'result': data.data});\n };\n },\n\n workerBlob = new Blob(\n [runner.toString()\n .replace(/^function .+\\{?|\\}$/g, '')\n .replace('safari_test', isSafari)],\n { type:'text/javascript' }\n ),\n\n workerBlobUrl = URL.createObjectURL(workerBlob);\n\n this._isSafari = isSafari;\n return new Worker(workerBlobUrl);\n }", "title": "" }, { "docid": "d3252d529fac19339d5227e394da2bd8", "score": "0.6463721", "text": "_createWorker() {\n const blob = new Blob([\n /* javascript */ `\n\t\t\t// the initial timeout time\n\t\t\tlet timeoutTime = ${(this._updateInterval * 1000).toFixed(1)};\n\t\t\t// onmessage callback\n\t\t\tself.onmessage = function(msg){\n\t\t\t\ttimeoutTime = parseInt(msg.data);\n\t\t\t};\n\t\t\t// the tick function which posts a message\n\t\t\t// and schedules a new tick\n\t\t\tfunction tick(){\n\t\t\t\tsetTimeout(tick, timeoutTime);\n\t\t\t\tself.postMessage('tick');\n\t\t\t}\n\t\t\t// call tick initially\n\t\t\ttick();\n\t\t\t`\n ], { type: \"text/javascript\" });\n const blobUrl = URL.createObjectURL(blob);\n const worker = new Worker(blobUrl);\n worker.onmessage = this._callback.bind(this);\n this._worker = worker;\n }", "title": "" }, { "docid": "c41b9fa4d709eb4b7dc5ae833d27daad", "score": "0.636836", "text": "handleMessageFromWorker(workerId, message) {\n console.log(\"Worker \" + workerId + \" says hi with msg \" + message);\n }", "title": "" }, { "docid": "0b22e2dc958f8a4200436544558c4e20", "score": "0.6347334", "text": "function workerSide() {\n const requestChannel = new BroadcastChannel(\"requestChannel\");\n const resultChannel = new BroadcastChannel(\"resultChannel\");\n\n requestChannel.addEventListener(\"message\", (ev) => {\n if (ev.data[0] instanceof ArrayBuffer) {\n const ab = ev.data[0];\n\n const myObjectBufferInWorker = loadObjectBuffer(ab);\n\n myObjectBufferInWorker.posts.sort((postA, postB) => {\n if (postA.body > postB.body) {\n return 1;\n } else {\n return -1;\n }\n });\n\n resultChannel.postMessage(ab, [ab]);\n }\n });\n}", "title": "" }, { "docid": "de5059380c7f1f6962149719209654c1", "score": "0.6331989", "text": "function calculateD()\r\n{\r\n\tdBox.innerHTML = \"&nbsp;\"\r\n\twebWorker.onmessage = function(event) {\r\n\t\tresult = event.data\r\n\t\tswapButtonClass('btn_calculateD', 'buttons')\r\n\t\tdBox.innerHTML = result\r\n\t\td = result\r\n\t}\r\n\r\n\tswapButtonClass('btn_calculateD', 'buttonDLoading')\r\n\twebWorker.postMessage([e, phi])\r\n}", "title": "" }, { "docid": "eb65b2fce39ff3e6fe8c76580f093128", "score": "0.63294", "text": "function startWorker(e) {\n if (myWorker == null) {\n myWorker = new SharedWorker(\"sharedWorker.js\");\n myWorker.port.addEventListener(\"message\", \n handleReceipt, false);\n myWorker.port.start();\n }\t\n}", "title": "" }, { "docid": "e5abbb2ca554a268b2ee153ff3397e92", "score": "0.629607", "text": "function runInWorker(data, count = 0, durations = []) {\n /*\n Store an instance of a Worker in the constant `worker`.\n Constant worker? Sounds like me 🙄 anyway,\n these guys are initialized by referencing the .js file they live in.\n\n If you're using webpack, webpack has a nice `worker-loader` you can use as well.\n */\n const worker = new Worker(\"worker.js\")\n\n /*\n Basically, you post a message to it, like this.\n This sends an Event object to the worker that looks like:\n Event { blah: something, blah: otherthing, data: \"WHAT YOU'RE SENDING\" }\n\n So then, the worker looks in event.data to receive the payload sent from here.\n Now's a good time to take a look at worker.js if you haven't already.\n */\n worker.postMessage(data)\n\n /*\n The worker talks back! WOOO! When it does, how do we handle what it says?\n This is how. It sends back an event just like the one described on line 86.\n\n So, we look in event.data and deal with it appropriately.\n In this case, I programmed the worker (see worker.js) to send back an object with\n its start and end times so we can calculate how long things took.\n\n So, on message,\n */\n worker.onmessage = event => {\n // see i wasnt lying about what it sends back\n const duration = event.data.endTime - event.data.startTime\n\n // same old drill like runInBrowser()\n const averageTime = durations.reduce((acc, duration) => acc + duration, 0) / durations.length\n resultFromWorker.innerHTML = makeResultString(averageTime)\n\n // If the function has been called 1000 times, STAHP!\n if (count >= limit) return\n\n // If not, call it again from inside.\n runInWorker(data, 1 + count, [...durations, duration])\n }\n}", "title": "" }, { "docid": "8be83772d526bd64ebb27bb13622b58b", "score": "0.6287724", "text": "async process(data) {\n return new Promise((resolve, reject) => {\n this.worker.onmessage = event => {\n this.onMessage({worker: this.worker, data: event.data, resolve, reject});\n };\n this.worker.onerror = error => {\n // Note Error object does not have the expected fields if loading failed completely\n // https://developer.mozilla.org/en-US/docs/Web/API/Worker#Event_handlers\n // https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent\n let message = `${this.name}: WorkerThread.process() failed`;\n if (error.message) {\n message += ` ${error.message} ${error.filename}:${error.lineno}:${error.colno}`;\n }\n const betterError = new Error(message);\n console.error(error); // eslint-disable-line\n reject(betterError);\n };\n const transferList = getTransferList(data);\n this.worker.postMessage(data, transferList);\n });\n }", "title": "" }, { "docid": "4bd94ea44cc14b90b6f46f5efe18df8c", "score": "0.628088", "text": "async function workerMessaged(ev) {\n updateArray(ev.data);\n log(\"chart updated\");\n ipcRenderer.send('asynMessage', normalData)\n}", "title": "" }, { "docid": "adb789fcd2bf2b154560b749b9e5ebb4", "score": "0.626652", "text": "function startWorker() {\n if(typeof(Worker) !== \"undefined\") {\n if(typeof(w) == \"undefined\") {\n //Create a new counting worker\n w = new Worker(\"/js/map/mapworker.js\");\n }\n w.onmessage = function(event) {\n console.log(event.data);\n };\n } else {\n document.getElementById(\"result\").innerHTML = \"Sorry, your browser does not support Web Workers...\";\n }\n }", "title": "" }, { "docid": "206da2058c3d89da9e403c7006d74e45", "score": "0.6205386", "text": "function EntryWorker() { }", "title": "" }, { "docid": "68b76695a1cc6cd3cbeb6d16360804fa", "score": "0.6195486", "text": "function startWorkers(e) {\n\n //Create a worker\n var myWorker = new Worker(\"./workers/visualize-worker.js\");\n myWorker.onmessage = handleReceipt;\n\n //Send the JSON object to the worker for processing\n myWorker.postMessage(getGPAAndExtracurricularHours());\n }", "title": "" }, { "docid": "1bb02c5dac2ab92e6502a8d72eeed847", "score": "0.61699235", "text": "function recvWorkerMessage(event) {\n var eventData, status, resp, cb;\n try {\n eventData = JSON.parse(event.data);\n } catch (err) {\n return sendError(vtpmComm.worker.ERR_BAD_RESP);\n }\n\n status = eventData.status;\n resp = eventData.data;\n\n /*\n * If we have a callback for this worker operation, then resp.cb looks like\n * this: [user callback index, vtpm callback index]. The first element is \n * the callback to be called on the user page when the whole operation \n * comples, and the second element is the vtpm.js callback to be called when\n * the worker completes its work.\n */\n if (resp && resp.cb instanceof Array &&\n status !== vtpmComm.worker.ST_NEED_SECURE_UI) {\n // Pop off the second element to call right now\n cb = getWorkerCallback(resp.cb);\n /*\n * Transform resp.cb back into just the index for the user callback. If\n * workerCbs[cb] returns to the vtpm via postUserMessage, vtpm_user \n * expects to see a single callback index, not an array.\n */\n resp.cb = removeWorkerCallback(resp.cb);\n workerCbs[cb](resp, status);\n delete workerCbs[cb];\n } else {\n /*\n * A few special cases where we don't have a callback in the message data\n * or we don't want to use it.\n */\n switch (status) {\n case vtpmComm.worker.ST_WORKER_READY:\n if (!Worker) {\n worker = event.source;\n }\n initAfterWorkerReady();\n break;\n case vtpmComm.worker.ST_UNWRAPPED_KEY_PAIR:\n /*\n * The worker is sending us an unwrapped key pair\n * to cache for later use.\n */\n unwrappedKeyPairs[resp.pk] = resp.unwrappedBlob;\n break;\n case vtpmComm.worker.ST_ERROR:\n sendError(resp);\n break;\n case vtpmComm.worker.ST_NEED_SECURE_UI:\n workerHandlers.onSecureUINeeded(resp);\n break;\n default:\n return sendError(vtpmComm.worker.ERR_BAD_RESP, status);\n }\n }\n }", "title": "" }, { "docid": "9e3c216b87f1ff984804b74a3c994512", "score": "0.6160206", "text": "static createWorker(code){\n\t\t let blob = new Blob([code], {type: 'application/javascript'});\n\t\t let worker = new Worker(URL.createObjectURL(blob));\n\t\t \n\t\t return worker;\n\t}", "title": "" }, { "docid": "2e469e6c28ffc275cd2b709d1ad0542f", "score": "0.6156977", "text": "function initWorker() {\n worker = new Worker('graphWorker.js');\n worker.addEventListener('message', workerMessaged);\n worker.addEventListener('error', workerError);\n}", "title": "" }, { "docid": "26a7e02ea178699d30b0839957c8c63f", "score": "0.6113763", "text": "function workerInitialized (worker) {\n\n // This will be called when worker finished compressing data. you can access data at e.data\n worker.onmessage = function (e) {\n console.log(e.data);\n sendData(e.data);\n };\n\n // Lets wait for the document to be ready, so that we will enought data to send\n $(document).ready(function () {\n // Let's create a lot of data to test the compression\n var aLongString = '',\n dataToSend;\n for (var i = 0; i < 1000; i++) {\n aLongString = aLongString + JSON.stringify(window.performance);\n }\n\n dataToSend = {\n name: 'Hemkaran Raghav',\n value: aLongString\n };\n\n // Since data is ready, will be send two calls:\n // 1. One call without compressing the data\n sendData(dataToSend);\n\n // 2. Second call after worker will compress our data\n worker.postMessage({\n id: 1,\n data: dataToSend,\n action: 'compress'\n });\n })\n }", "title": "" }, { "docid": "1d8097815cdaa866511821d9b84154a6", "score": "0.6109106", "text": "function WorkerFn(root) {\n var timers = {};\n\n root.onmessage = function (event) {\n switch (event.data.type) {\n case 'ping':\n root.postMessage({ type: 'pong' });\n break;\n\n case 'set_timeout':\n timers[event.data.id] = setTimeout(function () {\n root.postMessage({ type: 'tick', id: event.data.id });\n }, event.data.delay);\n break;\n\n case 'clear_timeout':\n clearTimeout(timers[event.data.id]);\n break;\n\n case 'set_interval':\n timers[event.data.id] = setInterval(function () {\n root.postMessage({ type: 'tick', id: event.data.id });\n }, event.data.interval);\n break;\n\n case 'clear_interval':\n clearInterval(timers[event.data.id]);\n break;\n }\n };\n}", "title": "" }, { "docid": "f6d4f009a4ab3b497c530fe0da9935c4", "score": "0.6086605", "text": "function Bar(self) {\n\n setInterval(function () {\n self.postMessage('A message sent by the worker on a regular interval')\n }, 500)\n\n self.addEventListener('message',function (e) {\n console.log(e.data)\n self.postMessage('PONG from worker')\n })\n}", "title": "" }, { "docid": "37c0e9a0e3d6ed3102f5e776ad9c4dc4", "score": "0.60848635", "text": "function worker(message) {\n console.log(`Processing \"${message.message.data}\"...`);\n\n /*\n setTimeout(() => {\n console.log(`Finished procesing \"${message.message.data}\".`);\n isProcessed = true;\n }, 30000);\n */\n }", "title": "" }, { "docid": "15f87509f63b2964b23ac79685c95e54", "score": "0.6060843", "text": "function workerThreadReceivedMessage(e)\n\t\t{\n\t\t\tvar msg = e.data;\n\n\t\t\tif (typeof Papa.WORKER_ID === 'undefined' && msg)\n\t\t\t\tPapa.WORKER_ID = msg.workerId;\n\n\t\t\tif (typeof msg.input === 'string')\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tresults: Papa.parse(msg.input, msg.config),\n\t\t\t\t\tfinished: true\n\t\t\t\t});\n\t\t\t}\n\t\t\telse if ((global.File && msg.input instanceof File) || msg.input instanceof Object)\t// thank you, Safari (see issue #106)\n\t\t\t{\n\t\t\t\tvar results = Papa.parse(msg.input, msg.config);\n\t\t\t\tif (results)\n\t\t\t\t\tglobal.postMessage({\n\t\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\t\tresults: results,\n\t\t\t\t\t\tfinished: true\n\t\t\t\t\t});\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "878301d7eee9599a6ab1b2b092ce22ca", "score": "0.60599035", "text": "function worker() {\r\n var wp = google.gears.workerPool;\r\n var db = new Database();\r\n var parentId;\r\n var url;\r\n wp.onmessage = function(a, b, message) {\r\n parentId = message.sender;\r\n url = message.text;\r\n db.open();\r\n db.readEntries({\r\n open: function() {},\r\n write: function(p, i, next) {\r\n var request = google.gears.factory.create(\r\n 'beta.httprequest', '1.0');\r\n request.open('POST', url);\r\n \t\t\t request.setRequestHeader(\r\n \t\t\t 'Content-Type', 'application/x-www-form-urlencoded');\r\n request.onreadystatechange = function() {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n wp.sendMessage(String(p.rowid), parentId);\r\n next();\r\n }\r\n else {\r\n wp.sendMessage('f', parentId);\r\n next(true);\r\n }\r\n }\r\n };\r\n // replay form data\r\n request.send(p.FormData);\r\n },\r\n close: function() {\r\n db.clear();\r\n wp.sendMessage('d', parentId);\r\n }\r\n });\r\n }\r\n }", "title": "" }, { "docid": "e89efa034c4cb0e05f865e92753e9dd3", "score": "0.6038542", "text": "function workerThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\n\t\tif (typeof Papa.WORKER_ID === 'undefined' && msg)\n\t\t\tPapa.WORKER_ID = msg.workerId;\n\n\t\tif (typeof msg.input === 'string')\n\t\t{\n\t\t\tglobal.postMessage({\n\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\tresults: Papa.parse(msg.input, msg.config),\n\t\t\t\tfinished: true\n\t\t\t});\n\t\t}\n\t\telse if ((global.File && msg.input instanceof File) || msg.input instanceof Object)\t// thank you, Safari (see issue #106)\n\t\t{\n\t\t\tvar results = Papa.parse(msg.input, msg.config);\n\t\t\tif (results)\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tresults: results,\n\t\t\t\t\tfinished: true\n\t\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "e89efa034c4cb0e05f865e92753e9dd3", "score": "0.6038542", "text": "function workerThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\n\t\tif (typeof Papa.WORKER_ID === 'undefined' && msg)\n\t\t\tPapa.WORKER_ID = msg.workerId;\n\n\t\tif (typeof msg.input === 'string')\n\t\t{\n\t\t\tglobal.postMessage({\n\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\tresults: Papa.parse(msg.input, msg.config),\n\t\t\t\tfinished: true\n\t\t\t});\n\t\t}\n\t\telse if ((global.File && msg.input instanceof File) || msg.input instanceof Object)\t// thank you, Safari (see issue #106)\n\t\t{\n\t\t\tvar results = Papa.parse(msg.input, msg.config);\n\t\t\tif (results)\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tresults: results,\n\t\t\t\t\tfinished: true\n\t\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "e89efa034c4cb0e05f865e92753e9dd3", "score": "0.6038542", "text": "function workerThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\n\t\tif (typeof Papa.WORKER_ID === 'undefined' && msg)\n\t\t\tPapa.WORKER_ID = msg.workerId;\n\n\t\tif (typeof msg.input === 'string')\n\t\t{\n\t\t\tglobal.postMessage({\n\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\tresults: Papa.parse(msg.input, msg.config),\n\t\t\t\tfinished: true\n\t\t\t});\n\t\t}\n\t\telse if ((global.File && msg.input instanceof File) || msg.input instanceof Object)\t// thank you, Safari (see issue #106)\n\t\t{\n\t\t\tvar results = Papa.parse(msg.input, msg.config);\n\t\t\tif (results)\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tresults: results,\n\t\t\t\t\tfinished: true\n\t\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "e89efa034c4cb0e05f865e92753e9dd3", "score": "0.6038542", "text": "function workerThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\n\t\tif (typeof Papa.WORKER_ID === 'undefined' && msg)\n\t\t\tPapa.WORKER_ID = msg.workerId;\n\n\t\tif (typeof msg.input === 'string')\n\t\t{\n\t\t\tglobal.postMessage({\n\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\tresults: Papa.parse(msg.input, msg.config),\n\t\t\t\tfinished: true\n\t\t\t});\n\t\t}\n\t\telse if ((global.File && msg.input instanceof File) || msg.input instanceof Object)\t// thank you, Safari (see issue #106)\n\t\t{\n\t\t\tvar results = Papa.parse(msg.input, msg.config);\n\t\t\tif (results)\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tresults: results,\n\t\t\t\t\tfinished: true\n\t\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "e89efa034c4cb0e05f865e92753e9dd3", "score": "0.6038542", "text": "function workerThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\n\t\tif (typeof Papa.WORKER_ID === 'undefined' && msg)\n\t\t\tPapa.WORKER_ID = msg.workerId;\n\n\t\tif (typeof msg.input === 'string')\n\t\t{\n\t\t\tglobal.postMessage({\n\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\tresults: Papa.parse(msg.input, msg.config),\n\t\t\t\tfinished: true\n\t\t\t});\n\t\t}\n\t\telse if ((global.File && msg.input instanceof File) || msg.input instanceof Object)\t// thank you, Safari (see issue #106)\n\t\t{\n\t\t\tvar results = Papa.parse(msg.input, msg.config);\n\t\t\tif (results)\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tresults: results,\n\t\t\t\t\tfinished: true\n\t\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "e89efa034c4cb0e05f865e92753e9dd3", "score": "0.6038542", "text": "function workerThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\n\t\tif (typeof Papa.WORKER_ID === 'undefined' && msg)\n\t\t\tPapa.WORKER_ID = msg.workerId;\n\n\t\tif (typeof msg.input === 'string')\n\t\t{\n\t\t\tglobal.postMessage({\n\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\tresults: Papa.parse(msg.input, msg.config),\n\t\t\t\tfinished: true\n\t\t\t});\n\t\t}\n\t\telse if ((global.File && msg.input instanceof File) || msg.input instanceof Object)\t// thank you, Safari (see issue #106)\n\t\t{\n\t\t\tvar results = Papa.parse(msg.input, msg.config);\n\t\t\tif (results)\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tresults: results,\n\t\t\t\t\tfinished: true\n\t\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "e89efa034c4cb0e05f865e92753e9dd3", "score": "0.6038542", "text": "function workerThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\n\t\tif (typeof Papa.WORKER_ID === 'undefined' && msg)\n\t\t\tPapa.WORKER_ID = msg.workerId;\n\n\t\tif (typeof msg.input === 'string')\n\t\t{\n\t\t\tglobal.postMessage({\n\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\tresults: Papa.parse(msg.input, msg.config),\n\t\t\t\tfinished: true\n\t\t\t});\n\t\t}\n\t\telse if ((global.File && msg.input instanceof File) || msg.input instanceof Object)\t// thank you, Safari (see issue #106)\n\t\t{\n\t\t\tvar results = Papa.parse(msg.input, msg.config);\n\t\t\tif (results)\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tresults: results,\n\t\t\t\t\tfinished: true\n\t\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "de441001a543732870ae138932f9a0d6", "score": "0.60245776", "text": "function Worker (data, func) {\n this.data = data;\n this.isRunning = false;\n this.executor = func.bind(this);\n this.id = uuid.v1();\n this.revoked = false;\n}", "title": "" }, { "docid": "927fe80a8b712befa38063cc00eddf96", "score": "0.60125625", "text": "function trainWorker() {\n const worker = new Worker(codeHref);\n worker.postMessage({ id: 0, type: \"styles\", payload: styles });\n worker.onmessage = handleMsg;\n return worker;\n }", "title": "" }, { "docid": "879783bbe8a3534c35b19ce5db0dc255", "score": "0.5999707", "text": "function webwork(callback) {\n // URL.createObjectURL\n window.URL = window.URL || window.webkitURL;\n\n const response = 'onmessage=function(event){postMessage(\" + callback + \"(event.data));}';\n\n let blob;\n try {\n blob = new Blob([response], { type: 'application/javascript' });\n } catch (e) { // Backwards-compatibility\n window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;\n blob = new BlobBuilder();\n blob.append(response);\n blob = blob.getBlob();\n }\n\n return function wwork(...args) {\n const worker = new Worker(URL.createObjectURL(blob));\n let ran;\n if (typeof args[args.length - 1] === 'function') {\n callback = args.pop();\n } else {\n callback = function empty() { };\n }\n\n worker.onmessage = function message(e) {\n if (ran) { return; }\n ran = true;\n callback(null, e.data);\n };\n worker.onerror = function error(e) {\n if (ran) { return; }\n ran = true;\n\n callback(e);\n };\n worker.postMessage.apply(worker, args);\n };\n}", "title": "" }, { "docid": "adc8a11682133e02d547e7845246a8a1", "score": "0.59834033", "text": "function messageHandler(e) {\n\tsleep(5000);\n\tpostMessage({\"count\": e.data.workerCount, \"timer\": e.data.time});\n}", "title": "" }, { "docid": "6826c197cdf8bf67fe9e27f4427ee9b3", "score": "0.5925388", "text": "function createGaugeDialWorker() {\n\t\t\tvar worker = new Worker(\"gaugeDialWorker.js\");\n\t\t\tworker.onmessage = function(event) {\n\t\t\t\tupdate(event.data);\n\t\t\t}\n\t\t\tworker.postMessage({config: config});\n\t\t\treturn worker;\n\t\t}", "title": "" }, { "docid": "2e32f54f62ea6360e0e31355d1ffabfa", "score": "0.5922317", "text": "createPlaypackWorker() {\n const { lookahead } = this.state\n\n this.playbackWorker = new PlaybackWorker();\n\n this.playbackWorker.onmessage = (e) => {\n if (e.data == \"tick\") {\n // console.log(\"tick!\");\n this.scheduler()\n } else {\n console.log(\"message: \" + e.data)\n }\n }\n this.playbackWorker.postMessage({\"interval\": lookahead})\n }", "title": "" }, { "docid": "3e1fb9da26b77b9da1d96d32398a90cc", "score": "0.5910908", "text": "function workerMessageHandler (message)\n{\n\t_Instrument(\"workerMessageHandler\");\n\n\t_Log(\"Received from worker: %O\", message);\n\n\t_InstrumentEnd();\n}", "title": "" }, { "docid": "ff25f4e7775a2b20470eecb8f93dbada", "score": "0.5900239", "text": "function addWorker(){\n return EZWebWorkers.create(\n mandelbrotWorker,\n {\n jobQueue : mandelbrotQueue,\n completeCallback : workerCompleteCallback\n }\n );\n }", "title": "" }, { "docid": "71e4067ba073ac30b7bbcf2a73b89f40", "score": "0.58945674", "text": "async *run({code}) {\n\n // we only terminate the worker when running something else\n // no termination for timeout/hangup, cause the user may be debugging the code\n if (this.worker){\n this.worker.terminate();\n this.onWorkerTerminate({type: 'terminate'});\n }\n\n // type module - to support potential imports?\n // TODO: replace this link to correct\n this.worker = new Worker('http://localhost:9080/client/evalWorker.js', {type: 'module'});\n\n console.error('this.worker', this.worker);\n\n await new Promise(resolve => {\n this.worker.addEventListener('message', event => {\n if (event.data.type == 'ready') resolve();\n }, {once: true});\n });\n\n this.worker.addEventListener('error', error => this.onWorkerError(error));\n\n this.worker.addEventListener('message', message => this.onWorkerMessage(message.data));\n\n this.worker.postMessage({\n command: 'run',\n code\n });\n\n // detect syntax error in js by using onerror? use babel in case of syntax error to show it?\n // what happens if SyntaxError in worker?\n while(true) {\n\n let resultEvent = await Promise.race([\n new Promise(resolve => this.onWorkerMessage = resolve),\n // worker terminated (by a new invocation of run)\n new Promise(resolve => this.onWorkerTerminate = resolve),\n // syntax error OR throw in our code\n new Promise(resolve => this.onWorkerError = resolve)\n ]);\n\n yield resultEvent;\n\n if (resultEvent.type == 'error') {\n // syntax error OR throw in our code\n break;\n }\n\n if (resultEvent.type == 'terminate') {\n // worker terminated\n break;\n }\n\n if (resultEvent.type == 'result') {\n // result\n break;\n }\n }\n\n }", "title": "" }, { "docid": "a43308ea32d7e200e3d4c16847ccdf99", "score": "0.5889451", "text": "function mainThreadReceivedMessage(e)\n\t\t{\n\t\t\tvar msg = e.data;\n\t\t\tvar worker = workers[msg.workerId];\n\t\t\tvar aborted = false;\n\n\t\t\tif (msg.error)\n\t\t\t\tworker.userError(msg.error, msg.file);\n\t\t\telse if (msg.results && msg.results.data)\n\t\t\t{\n\t\t\t\tvar abort = function() {\n\t\t\t\t\taborted = true;\n\t\t\t\t\tcompleteWorker(msg.workerId, { data: [], errors: [], meta: { aborted: true } });\n\t\t\t\t};\n\n\t\t\t\tvar handle = {\n\t\t\t\t\tabort: abort,\n\t\t\t\t\tpause: notImplemented,\n\t\t\t\t\tresume: notImplemented\n\t\t\t\t};\n\n\t\t\t\tif (isFunction(worker.userStep))\n\t\t\t\t{\n\t\t\t\t\tfor (var i = 0; i < msg.results.data.length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tworker.userStep({\n\t\t\t\t\t\t\tdata: [msg.results.data[i]],\n\t\t\t\t\t\t\terrors: msg.results.errors,\n\t\t\t\t\t\t\tmeta: msg.results.meta\n\t\t\t\t\t\t}, handle);\n\t\t\t\t\t\tif (aborted)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdelete msg.results;\t// free memory ASAP\n\t\t\t\t}\n\t\t\t\telse if (isFunction(worker.userChunk))\n\t\t\t\t{\n\t\t\t\t\tworker.userChunk(msg.results, handle, msg.file);\n\t\t\t\t\tdelete msg.results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (msg.finished && !aborted)\n\t\t\t\tcompleteWorker(msg.workerId, msg.results);\n\t\t}", "title": "" }, { "docid": "bb9504ca83024ae361f4509e55853ae6", "score": "0.5868591", "text": "function handle(data) {\n count++;\n\n var resultData = {\n __taskId: data.__taskId //this is mandatory for WorkerPool to identify witch task resturned result!\n };\n\n //random value to simulate computation time (between 1000 and 1500ms)\n var randTime = (Math.random() * 500 | 0) + 1000;\n\n\n // Send back the results to the parent page\n setTimeout(function () {\n resultData.result = '(' + count + ') => ' + randTime; // just send back something\n postMessage(resultData);\n }, randTime);\n \n}", "title": "" }, { "docid": "94b3baf091e2df1414d8703b09f92c20", "score": "0.5863767", "text": "handleWorkerCallback(e) {\r\n const msg = e.data;\r\n if (msg.type === 1 /* Job */) {\r\n const job = msg.data;\r\n let callback = undefined;\r\n for (let i = 0; i < this.queue.length; ++i) {\r\n const entry = this.queue[i];\r\n if (entry.job.id === job.id) {\r\n callback = entry.callback;\r\n this.queue.splice(i, 1);\r\n break;\r\n }\r\n }\r\n const elapsedTime = Math.max(0, job.finishTime - job.startTime);\r\n console.log(`Job #${job.id} completed in ${elapsedTime.toFixed(0)} ms (excluding callback overhead).`);\r\n if (callback) {\r\n callback(job.result);\r\n }\r\n }\r\n else {\r\n this.messageHandler(msg);\r\n }\r\n }", "title": "" }, { "docid": "a15498e20ac7ed3763f311427af022c3", "score": "0.58607394", "text": "function sendMsg(payload, worker) {\n const msgId = globalMsgId++\n const msg = {\n id: msgId,\n payload,\n }\n return new Promise(function(resolve, reject) {\n // save callbacks for later\n resolves[msgId] = resolve\n rejects[msgId] = reject\n worker.postMessage(msg)\n })\n}", "title": "" }, { "docid": "10a1e35ba5ccf8d56305967b68c9b16e", "score": "0.5855078", "text": "function sendMsg (payload, worker) {\n const msgId = globalMsgId++\n const msg = {\n id: msgId,\n payload\n }\n return new Promise(function (resolve, reject) {\n // save callbacks for later\n resolves[msgId] = resolve\n rejects[msgId] = reject\n worker.postMessage(msg)\n })\n}", "title": "" }, { "docid": "a6358ef9cb466da7b1eefedb26bc0fcd", "score": "0.5849971", "text": "runTask(type, onMessage, message, transfer) {\n var self = this;\n\n var worker = this.getWorker(type);\n worker.onmessage = function (event) {\n onMessage(event);\n self.returnWorker(type, worker);\n };\n\n if (transfer !== undefined) {\n worker.postMessage(message, transfer);\n } else {\n worker.postMessage(message);\n }\n }", "title": "" }, { "docid": "533611c841ca65e3e043a731bad89e0c", "score": "0.58455104", "text": "function EPE_Process(option, value)\n{\n with (EPE)\n {\n //Start the web worker or restart it if it had been terminated.\n if (worker == null)\n {\n worker = new Worker(\"worker.js\");\n worker.onmessage = function (event)\n {\n EPE_Process_Event(event.data);\n };\n }\n\n //get the image data from canvas for processing\n var imageData = context.getImageData(0, 0, canvas.width, canvas.height);\n if (imageData == null) return false;\n if (imageData.data.length == 0) return false;\n\n working = true;\n EPE_ShowStatus(\"Processing\");\n\n //start the underground working thread.\n switch (option)\n {\n case 1://invert\n case 2://black-and-white\n case 3://sepia\n case 30://grayscaling\n case 31://red cover\n case 32://green cover\n case 33://blue cover\n case 34://silhouette\n worker.postMessage({ type: 1, image: imageData, option: option });\n break;\n\n case 4://carving indent\n case 5://carving convex\n worker.postMessage({ type: 2, image: imageData, blankImage: context.createImageData(canvas.width, canvas.height), option: option - 3 });\n break;\n\n case 6://brightening\n worker.postMessage({ type: 3, image: imageData, value: value });\n break;\n\n case 8://flipping\n worker.postMessage({ type: 5, image: imageData, blankImage: context.createImageData(canvas.height, canvas.width), option: option - 3 });\n break;\n }\n }\n}", "title": "" }, { "docid": "e106828c6dcef6d1b4fe7108d9a90369", "score": "0.58413255", "text": "function mainThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\t\tvar worker = workers[msg.workerId];\n\t\tvar aborted = false;\n\n\t\tif (msg.error)\n\t\t\tworker.userError(msg.error, msg.file);\n\t\telse if (msg.results && msg.results.data)\n\t\t{\n\t\t\tvar abort = function() {\n\t\t\t\taborted = true;\n\t\t\t\tcompleteWorker(msg.workerId, { data: [], errors: [], meta: { aborted: true } });\n\t\t\t};\n\n\t\t\tvar handle = {\n\t\t\t\tabort: abort,\n\t\t\t\tpause: notImplemented,\n\t\t\t\tresume: notImplemented\n\t\t\t};\n\n\t\t\tif (isFunction(worker.userStep))\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < msg.results.data.length; i++)\n\t\t\t\t{\n\t\t\t\t\tworker.userStep({\n\t\t\t\t\t\tdata: [msg.results.data[i]],\n\t\t\t\t\t\terrors: msg.results.errors,\n\t\t\t\t\t\tmeta: msg.results.meta\n\t\t\t\t\t}, handle);\n\t\t\t\t\tif (aborted)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdelete msg.results;\t// free memory ASAP\n\t\t\t}\n\t\t\telse if (isFunction(worker.userChunk))\n\t\t\t{\n\t\t\t\tworker.userChunk(msg.results, handle, msg.file);\n\t\t\t\tdelete msg.results;\n\t\t\t}\n\t\t}\n\n\t\tif (msg.finished && !aborted)\n\t\t\tcompleteWorker(msg.workerId, msg.results);\n\t}", "title": "" }, { "docid": "e106828c6dcef6d1b4fe7108d9a90369", "score": "0.58413255", "text": "function mainThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\t\tvar worker = workers[msg.workerId];\n\t\tvar aborted = false;\n\n\t\tif (msg.error)\n\t\t\tworker.userError(msg.error, msg.file);\n\t\telse if (msg.results && msg.results.data)\n\t\t{\n\t\t\tvar abort = function() {\n\t\t\t\taborted = true;\n\t\t\t\tcompleteWorker(msg.workerId, { data: [], errors: [], meta: { aborted: true } });\n\t\t\t};\n\n\t\t\tvar handle = {\n\t\t\t\tabort: abort,\n\t\t\t\tpause: notImplemented,\n\t\t\t\tresume: notImplemented\n\t\t\t};\n\n\t\t\tif (isFunction(worker.userStep))\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < msg.results.data.length; i++)\n\t\t\t\t{\n\t\t\t\t\tworker.userStep({\n\t\t\t\t\t\tdata: [msg.results.data[i]],\n\t\t\t\t\t\terrors: msg.results.errors,\n\t\t\t\t\t\tmeta: msg.results.meta\n\t\t\t\t\t}, handle);\n\t\t\t\t\tif (aborted)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdelete msg.results;\t// free memory ASAP\n\t\t\t}\n\t\t\telse if (isFunction(worker.userChunk))\n\t\t\t{\n\t\t\t\tworker.userChunk(msg.results, handle, msg.file);\n\t\t\t\tdelete msg.results;\n\t\t\t}\n\t\t}\n\n\t\tif (msg.finished && !aborted)\n\t\t\tcompleteWorker(msg.workerId, msg.results);\n\t}", "title": "" }, { "docid": "e106828c6dcef6d1b4fe7108d9a90369", "score": "0.58413255", "text": "function mainThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\t\tvar worker = workers[msg.workerId];\n\t\tvar aborted = false;\n\n\t\tif (msg.error)\n\t\t\tworker.userError(msg.error, msg.file);\n\t\telse if (msg.results && msg.results.data)\n\t\t{\n\t\t\tvar abort = function() {\n\t\t\t\taborted = true;\n\t\t\t\tcompleteWorker(msg.workerId, { data: [], errors: [], meta: { aborted: true } });\n\t\t\t};\n\n\t\t\tvar handle = {\n\t\t\t\tabort: abort,\n\t\t\t\tpause: notImplemented,\n\t\t\t\tresume: notImplemented\n\t\t\t};\n\n\t\t\tif (isFunction(worker.userStep))\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < msg.results.data.length; i++)\n\t\t\t\t{\n\t\t\t\t\tworker.userStep({\n\t\t\t\t\t\tdata: [msg.results.data[i]],\n\t\t\t\t\t\terrors: msg.results.errors,\n\t\t\t\t\t\tmeta: msg.results.meta\n\t\t\t\t\t}, handle);\n\t\t\t\t\tif (aborted)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdelete msg.results;\t// free memory ASAP\n\t\t\t}\n\t\t\telse if (isFunction(worker.userChunk))\n\t\t\t{\n\t\t\t\tworker.userChunk(msg.results, handle, msg.file);\n\t\t\t\tdelete msg.results;\n\t\t\t}\n\t\t}\n\n\t\tif (msg.finished && !aborted)\n\t\t\tcompleteWorker(msg.workerId, msg.results);\n\t}", "title": "" }, { "docid": "e106828c6dcef6d1b4fe7108d9a90369", "score": "0.58413255", "text": "function mainThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\t\tvar worker = workers[msg.workerId];\n\t\tvar aborted = false;\n\n\t\tif (msg.error)\n\t\t\tworker.userError(msg.error, msg.file);\n\t\telse if (msg.results && msg.results.data)\n\t\t{\n\t\t\tvar abort = function() {\n\t\t\t\taborted = true;\n\t\t\t\tcompleteWorker(msg.workerId, { data: [], errors: [], meta: { aborted: true } });\n\t\t\t};\n\n\t\t\tvar handle = {\n\t\t\t\tabort: abort,\n\t\t\t\tpause: notImplemented,\n\t\t\t\tresume: notImplemented\n\t\t\t};\n\n\t\t\tif (isFunction(worker.userStep))\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < msg.results.data.length; i++)\n\t\t\t\t{\n\t\t\t\t\tworker.userStep({\n\t\t\t\t\t\tdata: [msg.results.data[i]],\n\t\t\t\t\t\terrors: msg.results.errors,\n\t\t\t\t\t\tmeta: msg.results.meta\n\t\t\t\t\t}, handle);\n\t\t\t\t\tif (aborted)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdelete msg.results;\t// free memory ASAP\n\t\t\t}\n\t\t\telse if (isFunction(worker.userChunk))\n\t\t\t{\n\t\t\t\tworker.userChunk(msg.results, handle, msg.file);\n\t\t\t\tdelete msg.results;\n\t\t\t}\n\t\t}\n\n\t\tif (msg.finished && !aborted)\n\t\t\tcompleteWorker(msg.workerId, msg.results);\n\t}", "title": "" }, { "docid": "e106828c6dcef6d1b4fe7108d9a90369", "score": "0.58413255", "text": "function mainThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\t\tvar worker = workers[msg.workerId];\n\t\tvar aborted = false;\n\n\t\tif (msg.error)\n\t\t\tworker.userError(msg.error, msg.file);\n\t\telse if (msg.results && msg.results.data)\n\t\t{\n\t\t\tvar abort = function() {\n\t\t\t\taborted = true;\n\t\t\t\tcompleteWorker(msg.workerId, { data: [], errors: [], meta: { aborted: true } });\n\t\t\t};\n\n\t\t\tvar handle = {\n\t\t\t\tabort: abort,\n\t\t\t\tpause: notImplemented,\n\t\t\t\tresume: notImplemented\n\t\t\t};\n\n\t\t\tif (isFunction(worker.userStep))\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < msg.results.data.length; i++)\n\t\t\t\t{\n\t\t\t\t\tworker.userStep({\n\t\t\t\t\t\tdata: [msg.results.data[i]],\n\t\t\t\t\t\terrors: msg.results.errors,\n\t\t\t\t\t\tmeta: msg.results.meta\n\t\t\t\t\t}, handle);\n\t\t\t\t\tif (aborted)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdelete msg.results;\t// free memory ASAP\n\t\t\t}\n\t\t\telse if (isFunction(worker.userChunk))\n\t\t\t{\n\t\t\t\tworker.userChunk(msg.results, handle, msg.file);\n\t\t\t\tdelete msg.results;\n\t\t\t}\n\t\t}\n\n\t\tif (msg.finished && !aborted)\n\t\t\tcompleteWorker(msg.workerId, msg.results);\n\t}", "title": "" }, { "docid": "e106828c6dcef6d1b4fe7108d9a90369", "score": "0.58413255", "text": "function mainThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\t\tvar worker = workers[msg.workerId];\n\t\tvar aborted = false;\n\n\t\tif (msg.error)\n\t\t\tworker.userError(msg.error, msg.file);\n\t\telse if (msg.results && msg.results.data)\n\t\t{\n\t\t\tvar abort = function() {\n\t\t\t\taborted = true;\n\t\t\t\tcompleteWorker(msg.workerId, { data: [], errors: [], meta: { aborted: true } });\n\t\t\t};\n\n\t\t\tvar handle = {\n\t\t\t\tabort: abort,\n\t\t\t\tpause: notImplemented,\n\t\t\t\tresume: notImplemented\n\t\t\t};\n\n\t\t\tif (isFunction(worker.userStep))\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < msg.results.data.length; i++)\n\t\t\t\t{\n\t\t\t\t\tworker.userStep({\n\t\t\t\t\t\tdata: [msg.results.data[i]],\n\t\t\t\t\t\terrors: msg.results.errors,\n\t\t\t\t\t\tmeta: msg.results.meta\n\t\t\t\t\t}, handle);\n\t\t\t\t\tif (aborted)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdelete msg.results;\t// free memory ASAP\n\t\t\t}\n\t\t\telse if (isFunction(worker.userChunk))\n\t\t\t{\n\t\t\t\tworker.userChunk(msg.results, handle, msg.file);\n\t\t\t\tdelete msg.results;\n\t\t\t}\n\t\t}\n\n\t\tif (msg.finished && !aborted)\n\t\t\tcompleteWorker(msg.workerId, msg.results);\n\t}", "title": "" }, { "docid": "7dcfdd474229c1798ae098ea01e0ba65", "score": "0.5836552", "text": "function mainThreadReceivedMessage(e)\n\t{\n\t\tvar msg = e.data;\n\t\tvar worker = workers[msg.workerId];\n\t\tvar aborted = false;\n\n\t\tif (msg.error)\n\t\t\tworker.userError(msg.error, msg.file);\n\t\telse if (msg.results && msg.results.data)\n\t\t{\n\t\t\tvar abort = function() {\n\t\t\t\taborted = true;\n\t\t\t\tcompleteWorker(msg.workerId, { data: [], errors: [], meta: { aborted: true } });\n\t\t\t};\n\n\t\t\tvar handle = {\n\t\t\t\tabort: abort,\n\t\t\t\tpause: notImplemented,\n\t\t\t\tresume: notImplemented\n\t\t\t};\n\n\t\t\tif (isFunction(worker.userStep))\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < msg.results.data.length; i++)\n\t\t\t\t{\n\t\t\t\t\tworker.userStep({\n\t\t\t\t\t\tdata: msg.results.data[i],\n\t\t\t\t\t\terrors: msg.results.errors,\n\t\t\t\t\t\tmeta: msg.results.meta\n\t\t\t\t\t}, handle);\n\t\t\t\t\tif (aborted)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdelete msg.results;\t// free memory ASAP\n\t\t\t}\n\t\t\telse if (isFunction(worker.userChunk))\n\t\t\t{\n\t\t\t\tworker.userChunk(msg.results, handle, msg.file);\n\t\t\t\tdelete msg.results;\n\t\t\t}\n\t\t}\n\n\t\tif (msg.finished && !aborted)\n\t\t\tcompleteWorker(msg.workerId, msg.results);\n\t}", "title": "" }, { "docid": "f0b4eac8b5b0219de048a1f2c7f832dd", "score": "0.57989365", "text": "postMessageToAllSubWorkers(message){\n for(let i=0, len=this.hitTestWorkers.length; i < len; ++i){\n let worker = this.hitTestWorkers[i];\n worker.postMessage(message);\n }\n }", "title": "" }, { "docid": "abedd2f25f073e51226e469d134c1e82", "score": "0.5798703", "text": "_call(type, name, func, data = '', callback = undefined){\n if (window.Worker){\n this._worker.postMessage({\n type: type,\n name: name,\n function: func.toString(),\n data: data\n });\n this._worker._callback = callback;\n }\n }", "title": "" }, { "docid": "e47104c747407859bbad80ecf79ab267", "score": "0.5788655", "text": "function start_web_workwer() {\n if (typeof(Worker) !== \"undefined\") {\n web_worker = new Worker(\"bw.js\");\n web_worker.onmessage = function(e) {\n tick();\n };\n } else { window.alert(\"I need web workers.\"); }\n }", "title": "" }, { "docid": "8f0f6717064ca49b6fed9350567ec5a9", "score": "0.57676446", "text": "function trainNumbersWorker(){\n\timportScripts('file:///C:/Users/clementmatheron/Desktop/Prog/neuralTest/js/helpers.js') \n\timportScripts('file:///C:/Users/clementmatheron/Desktop/Prog/neuralTest/js/matrix.js') \n\timportScripts('file:///C:/Users/clementmatheron/Desktop/Prog/neuralTest/js/network.js') \n\n\tself.trainingData = []\n\tself.testData = []\n\n\tonmessage = function(event){\n\t\tif(event.data.trainingData){\n\t\t\tevent.data.trainingData.forEach(function(v) {self.trainingData.push(v),this}); \n\t\t\tconsole.log(\"Data batch received\")\n\t\t}\n\t\tif(event.data.testData){\n\t\t\tevent.data.testData.forEach(function(v) {self.testData.push(v)}); \n\t\t\tconsole.log(\"Data batch received\")\n\t\t}\n\n\t\t// main function: run the SGD algo on the network\n\t\t// needs to be on a separate thread for big sets\n \tif(event.data.start){\n \t\tvar start = new Date().getTime();\n\t \tn = new Network(event.data.n.sizes,new CrossEntropyCost)\n\t \tn.weights = event.data.n.weights;\n \t\tn.biases = event.data.n.biases;\n\n\t\t\tconsole.log(\"Training network\")\n\t\t\tvar result = n.SGD(trainingData,1,10,0.1,5.0,testData, true, true, true, true)\n\t\t\tvar end = new Date().getTime();\n\t\t\tvar time = end - start;\n\t\t\tconsole.log('Execution time: ' + time);\n\t\t\tpostMessage({weights: n.weights,biases:n.biases, result: result})\n \t}\n\t}\t\n}", "title": "" }, { "docid": "f51095475e6e2180f8e57f7c6aade767", "score": "0.5751742", "text": "function worker(workerId){clusterWorkerId=workerId;return module.exports;}", "title": "" }, { "docid": "1277c7e0c67e3bea523922aa3c83a721", "score": "0.57428485", "text": "constructor(worker) {\n super();\n this._callbackConverter = new CallbackArgumentConverter();\n this._isInitialized = false;\n this._isReadOnly = false;\n this._supportLinks = false;\n this._supportProps = false;\n this._worker = worker;\n this._worker.addEventListener('message', (e) => {\n const resp = e.data;\n if (isAPIResponse(resp)) {\n let i;\n const args = resp.args;\n const fixedArgs = new Array(args.length);\n // Dispatch event to correct id.\n for (i = 0; i < fixedArgs.length; i++) {\n fixedArgs[i] = this._argRemote2Local(args[i]);\n }\n this._callbackConverter.toLocalArg(resp.cbId).apply(null, fixedArgs);\n }\n });\n }", "title": "" }, { "docid": "deaf7e28325bb5065e8a5b537f819097", "score": "0.57394147", "text": "function App() {\n // this JavaScript snippet is later referred to as <<react-state>>\n const [epsilon, setEpsilon] = React.useState(0.001);\n // this JavaScript snippet is appended to <<react-state>>\n function onEpsilonChange(event) {\n setEpsilon(Number(event.target.value));\n }\n // this JavaScript snippet is appended to <<react-state>>\n const [guess, setGuess] = React.useState(-20);\n\n function onGuessChange(event) {\n setGuess(Number(event.target.value));\n }\n // this JavaScript snippet is appended to <<react-state>>\n const [root, setRoot] = React.useState(undefined);\n\n function handleSubmit(event) {\n // this JavaScript snippet is later referred to as <<handle-submit>>\n event.preventDefault();\n // this JavaScript snippet is appended to <<handle-submit>>\n const worker = new Worker('worker.js');\n // this JavaScript snippet is appended to <<handle-submit>>\n worker.postMessage({\n type: 'CALCULATE',\n payload: { epsilon: epsilon, guess: guess }\n });\n // this JavaScript snippet is appended to <<handle-submit>>\n worker.onmessage = function(message) {\n if (message.data.type === 'RESULT') {\n const result = message.data.payload.root;\n setRoot(result);\n worker.terminate();\n }\n };\n }\n\n return (\n <div>\n <Heading/>\n { /* this JavaScript snippet is later referred to as <<react-form>> */ }\n <form onSubmit={handleSubmit}>\n <label>\n Epsilon:\n <input name=\"epsilon\" type=\"number\" value={epsilon} onChange={onEpsilonChange}/>\n </label>\n <label>\n Initial guess:\n <input name=\"guess\" type=\"number\" value={guess} onChange={onGuessChange}/>\n </label>\n <input type=\"submit\" value=\"Submit\" />\n </form>\n <Result root={root}/>\n </div>\n );\n}", "title": "" }, { "docid": "e7fecbc728e8b916a3590186f93d9a43", "score": "0.57052374", "text": "function fromWorker(message) {\n if (message.data.imageData) {\n imageData = message.data.imageData;\n }\n if (!paused && speed == \"Fast\") worker.postMessage({ runTo: \"Frame\" });\n}", "title": "" }, { "docid": "8d170507975730f03629f4cf739b05ea", "score": "0.5702686", "text": "function createAnimationWorker(name) {\n var worker = new Worker('shim.js');\n worker.postMessage(['name', name]);\n\n worker.onmessage = function(oEvent) {\n console.log('Main thread received message ' + ' ' + oEvent.data[0] + ' ' + oEvent.data[1] + ' ' + oEvent.data[2] + ' ' + oEvent.data[3] + ' ' + oEvent.data[4]);\n console.log('');\n elementList.execute(oEvent.data, worker);\n };\n return worker;\n }", "title": "" }, { "docid": "5ca1f3167ef49641b8418abe2b11439b", "score": "0.569578", "text": "function workerRoundTrip() {\n if (!testworker.last) { // start the test\n const w = testworker.last = new Worker('csynthWorker.js');\n w.onmessage = workermessage;\n Maestro.on('postframe', workerRoundTrip.test); // fire workerRoundTrip.test() near the end of each frame\n } else {\n testworker.last.terminate();\n delete testworker.last;\n Maestro.remove('postframe', workerRoundTrip.test); // stop firing workerRoundTrip.test()\n\n }\n}", "title": "" }, { "docid": "255d428e54faa0bcf452688f91516b44", "score": "0.56847197", "text": "function testworker(file) {\n const test = {\n dir: 'CSynth/data/Crick/',\n contacts: [\n {filename: 'Mitosis_chrII_rightarm.normMtx.s.txt', shortname: 'Mitosis'},\n {filename: 'Interphase_chrII_rightarm.normMtx.s.txt', shortname: 'Interphase'}],\n beds: ['yeast_chr_II_genes.bed', 'yeast_human_chrII_gene.bed', 'condensin_chrII.bed'],\n etc: ''\n };\n\n const w = new Worker('csynthWorker.js');\n testworker.last = w;\n w.onmessage = workermessage;\n w.postMessage(['item', test, 'contacts', 0, currentGenes]);\n}", "title": "" }, { "docid": "fd318816b77cff14121bd384327e1373", "score": "0.56719965", "text": "function wwajax (conf)\n{\n var w = new Worker('worker.js');\n w.onmessage = function(e)\n {\n switch ( e.status )\n {\n case -1:\n if ( w.errorHandler ) {\n w.errorHandler(e); }\n break;\n case 'progress':\n break;\n default:\n if ( w.successHandler ) {\n w.successHandler(e); }\n break;\n }\n };\n //w.errorHandler = conf.errorHandler;\n //w.successHandler = conf.successHandler;\n if ( conf.successHandler && typeof conf.successHandler == \"function\" )\n w.successHandler = conf.successHandler;\n var c = {};\n for ( var i in conf )\n if ( typeof conf[i] != \"function\" )\n c[i] = conf[i];\n c.cmd='config';\n// console.log(c);\n// var j = JSON.stringify(c);\n// c = JSON.parse(j);\n w.postMessage(c);\n return w;\n}", "title": "" }, { "docid": "abb9e75befd47d3043a6d31226f2cc70", "score": "0.5661227", "text": "function onWorkerMessage(event) {\n var newContact;\n function updateContactListHelper(newContact) {\n var contactDetail;\n if (Storage === undefined) {\n throw CONSTANT.ERROR.HTML5.STORAGE;\n // FUTURE: query backend server and ask for data\n } else {\n contactDetail = JSON.parse(sessionStorage.getItem(newContact.id));\n if (contactDetail) {\n // has the ID already\n sessionStorage.setItem(newContact.id, JSON.stringify(newContact.value));\n } else {\n // new contact\n aContacts.populate([newContact], populateContactHelper);\n }\n }\n }\n if (event && event.data && event.data.ok) {\n if (event.data.message) {\n newContact = JSON.parse(event.data.message);\n updateContactListHelper(newContact);\n } else {\n aNotification.notificationFail('WebWorker Fail');\n }\n\n }\n }", "title": "" }, { "docid": "8e2a205bf448d77c1dc770335f03a1f3", "score": "0.5614723", "text": "function WorkerServer () { }", "title": "" }, { "docid": "983102c53055a766b3625ae09a6c5f26", "score": "0.56075126", "text": "function exchangeRateMultiplyCallback() {\n //get inputs from the DOM\n var pesos = document.getElementById(\"pesos\").value;\n var exchangeRate = document.getElementById(\"exchangeRate\").value;\n \n //sanitize inputs\n pesos = parseFloat(pesos);\n exchangeRate = parseFloat(exchangeRate);\n \n //verify inputs\n if (isNaN(pesos) === true || isNaN(exchangeRate) === true) {\n alert(\"Please enter valid numbers!\")\n return;\n }\n \n //use the worker function and get its output\n var rubles = exchangeRateMultiply(pesos,exchangeRate);\n \n //do something \"useful\" i.e. display the answer\n document.getElementById(\"outputArea\").innerHTML = rubles +\" Rubles\";\n}", "title": "" }, { "docid": "f1d864f616c231348177e1d5f3c24c95", "score": "0.56056505", "text": "function workerMessageHandler(msg) {\r\n switch (msg.type) {\r\n case 0 /* Init */:\r\n isModuleReady = true;\r\n break;\r\n default:\r\n console.error(\"Unsupported worker message: \", msg);\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "c882e3f3b0635ede5c859b192ecda708", "score": "0.55930877", "text": "function initModule(postFn) {\n // create missing references for worker globals\n var onmessage;\n var postMessage = postFn;\n // worker content start\n \"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar errors_1 = __webpack_require__(24);\nvar constants_1 = __webpack_require__(41);\nvar websocket_1 = __importDefault(__webpack_require__(160));\nvar utils = __importStar(__webpack_require__(163));\nvar common_1 = __importDefault(__webpack_require__(61));\nvar common = new common_1.default(postMessage);\nvar api;\nvar endpoints = [];\nvar cleanup = function () {\n if (api) {\n api.dispose();\n api.removeAllListeners();\n api = undefined;\n }\n endpoints = [];\n common.removeAccounts(common.getAccounts());\n common.removeAddresses(common.getAddresses());\n common.clearSubscriptions();\n};\nvar connect = function () { return __awaiter(void 0, void 0, void 0, function () {\n var _a, server, timeout, pingTimeout, keepAlive, connection, error_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (api && api.isConnected())\n return [2, api];\n _a = common.getSettings(), server = _a.server, timeout = _a.timeout, pingTimeout = _a.pingTimeout, keepAlive = _a.keepAlive;\n if (!server || !Array.isArray(server) || server.length < 1) {\n throw new errors_1.CustomError('connect', 'Endpoint not set');\n }\n if (endpoints.length < 1) {\n endpoints = common.shuffleEndpoints(server.slice(0));\n }\n common.debug('Connecting to', endpoints[0]);\n connection = new websocket_1.default({\n url: endpoints[0],\n timeout: timeout,\n pingTimeout: pingTimeout,\n keepAlive: keepAlive,\n });\n _b.label = 1;\n case 1:\n _b.trys.push([1, 3, , 4]);\n return [4, connection.connect()];\n case 2:\n _b.sent();\n api = connection;\n return [3, 4];\n case 3:\n error_1 = _b.sent();\n common.debug('Websocket connection failed');\n api = undefined;\n endpoints.splice(0, 1);\n if (endpoints.length < 1) {\n throw new errors_1.CustomError('connect', 'All backends are down');\n }\n return [2, connect()];\n case 4:\n connection.on('disconnected', function () {\n common.response({ id: -1, type: constants_1.RESPONSES.DISCONNECTED, payload: true });\n cleanup();\n });\n common.response({\n id: -1,\n type: constants_1.RESPONSES.CONNECTED,\n });\n common.debug('Connected');\n return [2, connection];\n }\n });\n}); };\nvar getInfo = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var socket, info, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 3, , 4]);\n return [4, connect()];\n case 1:\n socket = _a.sent();\n return [4, socket.getServerInfo()];\n case 2:\n info = _a.sent();\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_INFO,\n payload: __assign({ url: socket.options.url }, utils.transformServerInfo(info)),\n });\n return [3, 4];\n case 3:\n error_2 = _a.sent();\n common.errorHandler({ id: data.id, error: error_2 });\n return [3, 4];\n case 4: return [2];\n }\n });\n}); };\nvar getBlockHash = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var socket, info, error_3;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 3, , 4]);\n return [4, connect()];\n case 1:\n socket = _a.sent();\n return [4, socket.getBlockHash(data.payload)];\n case 2:\n info = _a.sent();\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_BLOCK_HASH,\n payload: info.hash,\n });\n return [3, 4];\n case 3:\n error_3 = _a.sent();\n common.errorHandler({ id: data.id, error: error_3 });\n return [3, 4];\n case 4: return [2];\n }\n });\n}); };\nvar getAccountInfo = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, socket, info, error_4;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, , 5]);\n return [4, connect()];\n case 2:\n socket = _a.sent();\n return [4, socket.getAccountInfo(payload)];\n case 3:\n info = _a.sent();\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_ACCOUNT_INFO,\n payload: utils.transformAccountInfo(info),\n });\n return [3, 5];\n case 4:\n error_4 = _a.sent();\n common.errorHandler({ id: data.id, error: error_4 });\n return [3, 5];\n case 5: return [2];\n }\n });\n}); };\nvar getAccountUtxo = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, socket, utxos, error_5;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, , 5]);\n return [4, connect()];\n case 2:\n socket = _a.sent();\n return [4, socket.getAccountUtxo(payload)];\n case 3:\n utxos = _a.sent();\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_ACCOUNT_UTXO,\n payload: utils.transformAccountUtxo(utxos),\n });\n return [3, 5];\n case 4:\n error_5 = _a.sent();\n common.errorHandler({ id: data.id, error: error_5 });\n return [3, 5];\n case 5: return [2];\n }\n });\n}); };\nvar getAccountBalanceHistory = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, socket, history_1, error_6;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, , 5]);\n return [4, connect()];\n case 2:\n socket = _a.sent();\n return [4, socket.getAccountBalanceHistory(payload)];\n case 3:\n history_1 = _a.sent();\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_ACCOUNT_BALANCE_HISTORY,\n payload: history_1,\n });\n return [3, 5];\n case 4:\n error_6 = _a.sent();\n common.errorHandler({ id: data.id, error: error_6 });\n return [3, 5];\n case 5: return [2];\n }\n });\n}); };\nvar getCurrentFiatRates = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, socket, fiatRates, error_7;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, , 5]);\n return [4, connect()];\n case 2:\n socket = _a.sent();\n return [4, socket.getCurrentFiatRates(payload)];\n case 3:\n fiatRates = _a.sent();\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_CURRENT_FIAT_RATES,\n payload: fiatRates,\n });\n return [3, 5];\n case 4:\n error_7 = _a.sent();\n common.errorHandler({ id: data.id, error: error_7 });\n return [3, 5];\n case 5: return [2];\n }\n });\n}); };\nvar getFiatRatesForTimestamps = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, socket, tickers, error_8;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, , 5]);\n return [4, connect()];\n case 2:\n socket = _a.sent();\n return [4, socket.getFiatRatesForTimestamps(payload)];\n case 3:\n tickers = (_a.sent()).tickers;\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_FIAT_RATES_FOR_TIMESTAMPS,\n payload: { tickers: tickers },\n });\n return [3, 5];\n case 4:\n error_8 = _a.sent();\n common.errorHandler({ id: data.id, error: error_8 });\n return [3, 5];\n case 5: return [2];\n }\n });\n}); };\nvar getFiatRatesTickersList = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, socket, tickers, error_9;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, , 5]);\n return [4, connect()];\n case 2:\n socket = _a.sent();\n return [4, socket.getFiatRatesTickersList(payload)];\n case 3:\n tickers = _a.sent();\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_FIAT_RATES_TICKERS_LIST,\n payload: {\n ts: tickers.ts,\n availableCurrencies: tickers.available_currencies,\n },\n });\n return [3, 5];\n case 4:\n error_9 = _a.sent();\n common.errorHandler({ id: data.id, error: error_9 });\n return [3, 5];\n case 5: return [2];\n }\n });\n}); };\nvar getTransaction = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, socket, tx, error_10;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, , 5]);\n return [4, connect()];\n case 2:\n socket = _a.sent();\n return [4, socket.getTransaction(payload)];\n case 3:\n tx = _a.sent();\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_TRANSACTION,\n payload: {\n type: 'blockbook',\n tx: tx,\n },\n });\n return [3, 5];\n case 4:\n error_10 = _a.sent();\n common.errorHandler({ id: data.id, error: error_10 });\n return [3, 5];\n case 5: return [2];\n }\n });\n}); };\nvar pushTransaction = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var socket, resp, error_11;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 3, , 4]);\n return [4, connect()];\n case 1:\n socket = _a.sent();\n return [4, socket.pushTransaction(data.payload)];\n case 2:\n resp = _a.sent();\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.PUSH_TRANSACTION,\n payload: resp.result,\n });\n return [3, 4];\n case 3:\n error_11 = _a.sent();\n common.errorHandler({ id: data.id, error: error_11 });\n return [3, 4];\n case 4: return [2];\n }\n });\n}); };\nvar estimateFee = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var socket, resp, error_12;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 3, , 4]);\n return [4, connect()];\n case 1:\n socket = _a.sent();\n return [4, socket.estimateFee(data.payload)];\n case 2:\n resp = _a.sent();\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.ESTIMATE_FEE,\n payload: resp,\n });\n return [3, 4];\n case 3:\n error_12 = _a.sent();\n common.errorHandler({ id: data.id, error: error_12 });\n return [3, 4];\n case 4: return [2];\n }\n });\n}); };\nvar onNewBlock = function (event) {\n common.response({\n id: -1,\n type: constants_1.RESPONSES.NOTIFICATION,\n payload: {\n type: 'block',\n payload: {\n blockHeight: event.height,\n blockHash: event.hash,\n },\n },\n });\n};\nvar onTransaction = function (event) {\n if (!event.tx)\n return;\n var descriptor = event.address;\n var account = common.getAccount(descriptor);\n common.response({\n id: -1,\n type: constants_1.RESPONSES.NOTIFICATION,\n payload: {\n type: 'notification',\n payload: {\n descriptor: account ? account.descriptor : descriptor,\n tx: account\n ? utils.transformTransaction(account.descriptor, account.addresses, event.tx)\n : utils.transformTransaction(descriptor, undefined, event.tx),\n },\n },\n });\n};\nvar onNewFiatRates = function (event) {\n common.response({\n id: -1,\n type: constants_1.RESPONSES.NOTIFICATION,\n payload: {\n type: 'fiatRates',\n payload: {\n rates: event.rates,\n },\n },\n });\n};\nvar subscribeAccounts = function (accounts) { return __awaiter(void 0, void 0, void 0, function () {\n var socket;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n common.addAccounts(accounts);\n return [4, connect()];\n case 1:\n socket = _a.sent();\n if (!common.getSubscription('notification')) {\n socket.on('notification', onTransaction);\n common.addSubscription('notification');\n }\n return [2, socket.subscribeAddresses(common.getAddresses())];\n }\n });\n}); };\nvar subscribeAddresses = function (addresses) { return __awaiter(void 0, void 0, void 0, function () {\n var socket;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n common.addAddresses(addresses);\n return [4, connect()];\n case 1:\n socket = _a.sent();\n if (!common.getSubscription('notification')) {\n socket.on('notification', onTransaction);\n common.addSubscription('notification');\n }\n return [2, socket.subscribeAddresses(common.getAddresses())];\n }\n });\n}); };\nvar subscribeBlock = function () { return __awaiter(void 0, void 0, void 0, function () {\n var socket;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (common.getSubscription('block'))\n return [2, { subscribed: true }];\n return [4, connect()];\n case 1:\n socket = _a.sent();\n common.addSubscription('block');\n socket.on('block', onNewBlock);\n return [2, socket.subscribeBlock()];\n }\n });\n}); };\nvar subscribeFiatRates = function (currency) { return __awaiter(void 0, void 0, void 0, function () {\n var socket;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4, connect()];\n case 1:\n socket = _a.sent();\n if (!common.getSubscription('fiatRates')) {\n common.addSubscription('fiatRates');\n socket.on('fiatRates', onNewFiatRates);\n }\n return [2, socket.subscribeFiatRates(currency)];\n }\n });\n}); };\nvar subscribe = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, response, error_13;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 11, , 12]);\n response = void 0;\n if (!(payload.type === 'accounts')) return [3, 3];\n return [4, subscribeAccounts(payload.accounts)];\n case 2:\n response = _a.sent();\n return [3, 10];\n case 3:\n if (!(payload.type === 'addresses')) return [3, 5];\n return [4, subscribeAddresses(payload.addresses)];\n case 4:\n response = _a.sent();\n return [3, 10];\n case 5:\n if (!(payload.type === 'block')) return [3, 7];\n return [4, subscribeBlock()];\n case 6:\n response = _a.sent();\n return [3, 10];\n case 7:\n if (!(payload.type === 'fiatRates')) return [3, 9];\n return [4, subscribeFiatRates(payload.currency)];\n case 8:\n response = _a.sent();\n return [3, 10];\n case 9: throw new errors_1.CustomError('invalid_param', '+type');\n case 10:\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.SUBSCRIBE,\n payload: response,\n });\n return [3, 12];\n case 11:\n error_13 = _a.sent();\n common.errorHandler({ id: data.id, error: error_13 });\n return [3, 12];\n case 12: return [2];\n }\n });\n}); };\nvar unsubscribeAccounts = function (accounts) { return __awaiter(void 0, void 0, void 0, function () {\n var socket, subscribed;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n common.removeAccounts(accounts || common.getAccounts());\n return [4, connect()];\n case 1:\n socket = _a.sent();\n subscribed = common.getAddresses();\n if (subscribed.length < 1) {\n socket.removeListener('notification', onTransaction);\n common.removeSubscription('notification');\n return [2, socket.unsubscribeAddresses()];\n }\n return [2, socket.subscribeAddresses(subscribed)];\n }\n });\n}); };\nvar unsubscribeAddresses = function (addresses) { return __awaiter(void 0, void 0, void 0, function () {\n var socket, subscribed;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4, connect()];\n case 1:\n socket = _a.sent();\n if (!addresses) {\n common.removeAccounts(common.getAccounts());\n }\n subscribed = common.removeAddresses(addresses || common.getAddresses());\n if (subscribed.length < 1) {\n socket.removeListener('notification', onTransaction);\n common.removeSubscription('notification');\n return [2, socket.unsubscribeAddresses()];\n }\n return [2, socket.subscribeAddresses(subscribed)];\n }\n });\n}); };\nvar unsubscribeBlock = function () { return __awaiter(void 0, void 0, void 0, function () {\n var socket;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!common.getSubscription('block'))\n return [2, { subscribed: false }];\n return [4, connect()];\n case 1:\n socket = _a.sent();\n socket.removeListener('block', onNewBlock);\n common.removeSubscription('block');\n return [2, socket.unsubscribeBlock()];\n }\n });\n}); };\nvar unsubscribeFiatRates = function () { return __awaiter(void 0, void 0, void 0, function () {\n var socket;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!common.getSubscription('fiatRates'))\n return [2, { subscribed: false }];\n return [4, connect()];\n case 1:\n socket = _a.sent();\n socket.removeListener('fiatRates', onNewBlock);\n common.removeSubscription('fiatRates');\n return [2, socket.unsubscribeFiatRates()];\n }\n });\n}); };\nvar unsubscribe = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, response, error_14;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 11, , 12]);\n response = void 0;\n if (!(payload.type === 'accounts')) return [3, 3];\n return [4, unsubscribeAccounts(payload.accounts)];\n case 2:\n response = _a.sent();\n return [3, 10];\n case 3:\n if (!(payload.type === 'addresses')) return [3, 5];\n return [4, unsubscribeAddresses(payload.addresses)];\n case 4:\n response = _a.sent();\n return [3, 10];\n case 5:\n if (!(payload.type === 'block')) return [3, 7];\n return [4, unsubscribeBlock()];\n case 6:\n response = _a.sent();\n return [3, 10];\n case 7:\n if (!(payload.type === 'fiatRates')) return [3, 9];\n return [4, unsubscribeFiatRates()];\n case 8:\n response = _a.sent();\n return [3, 10];\n case 9: throw new errors_1.CustomError('invalid_param', '+type');\n case 10:\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.UNSUBSCRIBE,\n payload: response,\n });\n return [3, 12];\n case 11:\n error_14 = _a.sent();\n common.errorHandler({ id: data.id, error: error_14 });\n return [3, 12];\n case 12: return [2];\n }\n });\n}); };\nvar disconnect = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var error_15;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!api) {\n common.response({ id: data.id, type: constants_1.RESPONSES.DISCONNECTED, payload: true });\n return [2];\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4, api.disconnect()];\n case 2:\n _a.sent();\n common.response({ id: data.id, type: constants_1.RESPONSES.DISCONNECTED, payload: true });\n return [3, 4];\n case 3:\n error_15 = _a.sent();\n common.errorHandler({ id: data.id, error: error_15 });\n return [3, 4];\n case 4: return [2];\n }\n });\n}); };\nonmessage = function (event) {\n if (!event.data)\n return;\n var data = event.data;\n var id = data.id, type = data.type;\n common.debug('onmessage', data);\n switch (data.type) {\n case constants_1.MESSAGES.HANDSHAKE:\n common.setSettings(data.settings);\n break;\n case constants_1.MESSAGES.CONNECT:\n connect()\n .then(function () {\n common.response({ id: id, type: constants_1.RESPONSES.CONNECT, payload: true });\n })\n .catch(function (error) { return common.errorHandler({ id: id, error: error }); });\n break;\n case constants_1.MESSAGES.GET_INFO:\n getInfo(data);\n break;\n case constants_1.MESSAGES.GET_BLOCK_HASH:\n getBlockHash(data);\n break;\n case constants_1.MESSAGES.GET_ACCOUNT_INFO:\n getAccountInfo(data);\n break;\n case constants_1.MESSAGES.GET_ACCOUNT_UTXO:\n getAccountUtxo(data);\n break;\n case constants_1.MESSAGES.GET_TRANSACTION:\n getTransaction(data);\n break;\n case constants_1.MESSAGES.GET_ACCOUNT_BALANCE_HISTORY:\n getAccountBalanceHistory(data);\n break;\n case constants_1.MESSAGES.GET_CURRENT_FIAT_RATES:\n getCurrentFiatRates(data);\n break;\n case constants_1.MESSAGES.GET_FIAT_RATES_FOR_TIMESTAMPS:\n getFiatRatesForTimestamps(data);\n break;\n case constants_1.MESSAGES.GET_FIAT_RATES_TICKERS_LIST:\n getFiatRatesTickersList(data);\n break;\n case constants_1.MESSAGES.ESTIMATE_FEE:\n estimateFee(data);\n break;\n case constants_1.MESSAGES.PUSH_TRANSACTION:\n pushTransaction(data);\n break;\n case constants_1.MESSAGES.SUBSCRIBE:\n subscribe(data);\n break;\n case constants_1.MESSAGES.UNSUBSCRIBE:\n unsubscribe(data);\n break;\n case constants_1.MESSAGES.DISCONNECT:\n disconnect(data);\n break;\n case 'terminate':\n cleanup();\n break;\n default:\n common.errorHandler({\n id: id,\n error: new errors_1.CustomError('worker_unknown_request', \"+\" + type),\n });\n break;\n }\n};\n\n\n // worker content end\n // return worker \"onmessage\" function to BlockchainLinkWorker module\n return onmessage;\n}", "title": "" }, { "docid": "023c632021db10a1120998f50542fa91", "score": "0.55930877", "text": "function initModule(postFn) {\n // create missing references for worker globals\n var onmessage;\n var postMessage = postFn;\n // worker content start\n \"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ripple_lib_1 = __webpack_require__(165);\nvar bignumber_js_1 = __importDefault(__webpack_require__(6));\nvar errors_1 = __webpack_require__(24);\nvar constants_1 = __webpack_require__(41);\nvar utils = __importStar(__webpack_require__(482));\nvar common_1 = __importDefault(__webpack_require__(61));\nvar common = new common_1.default(postMessage);\nvar rippleApi;\nvar pingTimeout;\nvar DEFAULT_TIMEOUT = 20 * 1000;\nvar DEFAULT_PING_TIMEOUT = 3 * 60 * 1000;\nvar endpoints = [];\nvar RESERVE = {\n BASE: '20000000',\n OWNER: '5000000',\n};\nvar setPingTimeout = function () {\n if (pingTimeout) {\n clearTimeout(pingTimeout);\n }\n pingTimeout = setTimeout(onPing, common.getSettings().pingTimeout || DEFAULT_PING_TIMEOUT);\n};\nvar onPing = function () { return __awaiter(void 0, void 0, void 0, function () {\n var error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(rippleApi && rippleApi.isConnected())) return [3, 6];\n if (!(common.hasSubscriptions() || common.getSettings().keepAlive)) return [3, 5];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4, rippleApi.getServerInfo()];\n case 2:\n _a.sent();\n return [3, 4];\n case 3:\n error_1 = _a.sent();\n common.debug(\"Error in timeout ping request: \" + error_1);\n return [3, 4];\n case 4:\n setPingTimeout();\n return [3, 6];\n case 5:\n rippleApi.disconnect();\n _a.label = 6;\n case 6: return [2];\n }\n });\n}); };\nvar cleanup = function () {\n if (pingTimeout) {\n clearTimeout(pingTimeout);\n }\n if (rippleApi) {\n rippleApi.removeAllListeners();\n rippleApi = undefined;\n }\n endpoints = [];\n common.removeAddresses(common.getAddresses());\n common.clearSubscriptions();\n};\nvar connect = function () { return __awaiter(void 0, void 0, void 0, function () {\n var _a, server, timeout, api, error_2;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (rippleApi) {\n if (rippleApi.isConnected())\n return [2, rippleApi];\n }\n _a = common.getSettings(), server = _a.server, timeout = _a.timeout;\n if (!server || !Array.isArray(server) || server.length < 1) {\n throw new errors_1.CustomError('connect', 'Endpoint not set');\n }\n if (endpoints.length < 1) {\n endpoints = common.shuffleEndpoints(server.slice(0));\n }\n common.debug('Connecting to', endpoints[0]);\n _b.label = 1;\n case 1:\n _b.trys.push([1, 3, , 4]);\n api = new ripple_lib_1.RippleAPI({\n server: endpoints[0],\n timeout: timeout || DEFAULT_TIMEOUT,\n });\n api.connection.reconnect = function () { return new Promise(function () { }); };\n return [4, api.connect()];\n case 2:\n _b.sent();\n return [3, 4];\n case 3:\n error_2 = _b.sent();\n common.debug('Websocket connection failed');\n rippleApi = undefined;\n endpoints.splice(0, 1);\n if (endpoints.length < 1) {\n throw new errors_1.CustomError('connect', 'All backends are down');\n }\n return [2, connect()];\n case 4:\n api.on('ledger', function (ledger) {\n RESERVE.BASE = api.xrpToDrops(ledger.reserveBaseXRP);\n RESERVE.OWNER = api.xrpToDrops(ledger.reserveIncrementXRP);\n });\n api.on('disconnected', function () {\n common.response({ id: -1, type: constants_1.RESPONSES.DISCONNECTED, payload: true });\n cleanup();\n });\n common.response({ id: -1, type: constants_1.RESPONSES.CONNECTED });\n rippleApi = api;\n return [2, rippleApi];\n }\n });\n}); };\nvar getInfo = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var api, info, url, error_3;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 3, 4, 5]);\n return [4, connect()];\n case 1:\n api = _a.sent();\n return [4, api.getServerInfo()];\n case 2:\n info = _a.sent();\n url = api.connection._url;\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_INFO,\n payload: __assign({ url: url }, utils.transformServerInfo(info)),\n });\n return [3, 5];\n case 3:\n error_3 = _a.sent();\n common.errorHandler({ id: data.id, error: utils.transformError(error_3) });\n return [3, 5];\n case 4:\n setPingTimeout();\n return [7];\n case 5: return [2];\n }\n });\n}); };\nvar getMempoolAccountInfo = function (account) { return __awaiter(void 0, void 0, void 0, function () {\n var api, info;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4, connect()];\n case 1:\n api = _a.sent();\n return [4, api.request('account_info', {\n account: account,\n ledger_index: 'current',\n queue: true,\n })];\n case 2:\n info = _a.sent();\n return [2, {\n xrpBalance: info.account_data.Balance,\n sequence: info.account_data.Sequence,\n txs: info.queue_data ? info.queue_data.txn_count : 0,\n }];\n }\n });\n}); };\nvar getRawTransactionsData = function (options) { return __awaiter(void 0, void 0, void 0, function () {\n var api;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4, connect()];\n case 1:\n api = _a.sent();\n return [2, api.request('account_tx', options)];\n }\n });\n}); };\nvar getAccountInfo = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, account, api, info, ownersReserve, reserve, misc, error_4, mempoolInfo, misc, reserve, error_5, requestOptions, transactionsData, error_6;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n account = {\n descriptor: payload.descriptor,\n balance: '0',\n availableBalance: '0',\n empty: true,\n history: {\n total: -1,\n unconfirmed: 0,\n transactions: undefined,\n },\n misc: {\n sequence: 0,\n reserve: RESERVE.BASE,\n },\n };\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, , 5]);\n return [4, connect()];\n case 2:\n api = _a.sent();\n return [4, api.getAccountInfo(payload.descriptor)];\n case 3:\n info = _a.sent();\n ownersReserve = info.ownerCount > 0\n ? new bignumber_js_1.default(info.ownerCount).times(RESERVE.OWNER).toString()\n : '0';\n reserve = new bignumber_js_1.default(RESERVE.BASE).plus(ownersReserve).toString();\n misc = {\n sequence: info.sequence,\n reserve: reserve,\n };\n account.misc = misc;\n account.balance = api.xrpToDrops(info.xrpBalance);\n account.availableBalance = new bignumber_js_1.default(account.balance).minus(reserve).toString();\n account.empty = false;\n return [3, 5];\n case 4:\n error_4 = _a.sent();\n if (error_4.data && error_4.data.error === 'actNotFound') {\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_ACCOUNT_INFO,\n payload: account,\n });\n }\n else {\n common.errorHandler({ id: data.id, error: utils.transformError(error_4) });\n }\n return [2];\n case 5:\n _a.trys.push([5, 7, , 8]);\n return [4, getMempoolAccountInfo(payload.descriptor)];\n case 6:\n mempoolInfo = _a.sent();\n misc = account.misc;\n reserve = misc && typeof misc.reserve === 'string' ? misc.reserve : RESERVE.BASE;\n account.availableBalance = new bignumber_js_1.default(mempoolInfo.xrpBalance).minus(reserve).toString();\n account.misc.sequence = mempoolInfo.sequence;\n account.history.unconfirmed = mempoolInfo.txs;\n return [3, 8];\n case 7:\n error_5 = _a.sent();\n return [3, 8];\n case 8:\n if (payload.details !== 'txs') {\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_ACCOUNT_INFO,\n payload: account,\n });\n return [2];\n }\n _a.label = 9;\n case 9:\n _a.trys.push([9, 11, , 12]);\n requestOptions = {\n account: payload.descriptor,\n ledger_index_min: payload.from ? payload.from : undefined,\n ledger_index_max: payload.to ? payload.to : undefined,\n limit: payload.pageSize || 25,\n marker: payload.marker,\n };\n return [4, getRawTransactionsData(requestOptions)];\n case 10:\n transactionsData = _a.sent();\n account.history.transactions = transactionsData.transactions.map(function (raw) {\n return utils.transformTransaction(payload.descriptor, raw.tx);\n });\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_ACCOUNT_INFO,\n payload: __assign(__assign({}, account), { marker: transactionsData.marker }),\n });\n return [3, 12];\n case 11:\n error_6 = _a.sent();\n common.errorHandler({ id: data.id, error: utils.transformError(error_6) });\n return [3, 12];\n case 12: return [2];\n }\n });\n}); };\nvar getTransaction = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, api, tx, error_7;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, 5, 6]);\n return [4, connect()];\n case 2:\n api = _a.sent();\n return [4, api.getTransaction(payload)];\n case 3:\n tx = _a.sent();\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.GET_TRANSACTION,\n payload: {\n type: 'ripple',\n tx: tx,\n },\n });\n return [3, 6];\n case 4:\n error_7 = _a.sent();\n common.errorHandler({ id: data.id, error: utils.transformError(error_7) });\n return [3, 6];\n case 5:\n setPingTimeout();\n return [7];\n case 6: return [2];\n }\n });\n}); };\nvar estimateFee = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var api, fee, drops_1, payload, error_8;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 3, 4, 5]);\n return [4, connect()];\n case 1:\n api = _a.sent();\n return [4, api.getFee()];\n case 2:\n fee = _a.sent();\n drops_1 = api.xrpToDrops(fee);\n if (new bignumber_js_1.default(drops_1).gt('2000')) {\n drops_1 = '12';\n }\n payload = data.payload && Array.isArray(data.payload.blocks)\n ? data.payload.blocks.map(function () { return ({ feePerUnit: drops_1 }); })\n : [{ feePerUnit: drops_1 }];\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.ESTIMATE_FEE,\n payload: payload,\n });\n return [3, 5];\n case 3:\n error_8 = _a.sent();\n common.errorHandler({ id: data.id, error: utils.transformError(error_8) });\n return [3, 5];\n case 4:\n setPingTimeout();\n return [7];\n case 5: return [2];\n }\n });\n}); };\nvar pushTransaction = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var api, info, error_9;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 3, 4, 5]);\n return [4, connect()];\n case 1:\n api = _a.sent();\n return [4, api.submit(data.payload.toUpperCase())];\n case 2:\n info = _a.sent();\n if (info.resultCode === 'tesSUCCESS') {\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.PUSH_TRANSACTION,\n payload: info.tx_json.hash,\n });\n }\n else {\n common.errorHandler({ id: data.id, error: { message: info.resultMessage } });\n return [2];\n }\n return [3, 5];\n case 3:\n error_9 = _a.sent();\n common.errorHandler({ id: data.id, error: utils.transformError(error_9) });\n return [3, 5];\n case 4:\n setPingTimeout();\n return [7];\n case 5: return [2];\n }\n });\n}); };\nvar onNewBlock = function (event) {\n setPingTimeout();\n common.response({\n id: -1,\n type: constants_1.RESPONSES.NOTIFICATION,\n payload: {\n type: 'block',\n payload: {\n blockHeight: event.ledgerVersion,\n blockHash: event.ledgerHash,\n },\n },\n });\n};\nvar onTransaction = function (event) {\n setPingTimeout();\n if (event.type !== 'transaction')\n return;\n var tx = event.transaction;\n if (event.transaction.TransactionType !== 'Payment')\n return;\n var notify = function (descriptor) {\n common.response({\n id: -1,\n type: constants_1.RESPONSES.NOTIFICATION,\n payload: {\n type: 'notification',\n payload: {\n descriptor: descriptor,\n tx: utils.transformTransaction(descriptor, __assign(__assign({}, event), tx)),\n },\n },\n });\n };\n var subscribed = common.getAddresses();\n var sent = subscribed.find(function (a) { return a === tx.Account; });\n if (sent)\n notify(sent);\n var recv = subscribed.find(function (a) { return a === tx.Destination; });\n if (recv)\n notify(recv);\n};\nvar subscribeAccounts = function (accounts) { return __awaiter(void 0, void 0, void 0, function () {\n var api, prevAddresses, uniqueAddresses;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4, connect()];\n case 1:\n api = _a.sent();\n prevAddresses = common.getAddresses();\n common.addAccounts(accounts);\n uniqueAddresses = common.getAddresses().filter(function (a) { return prevAddresses.indexOf(a) < 0; });\n if (!(uniqueAddresses.length > 0)) return [3, 3];\n if (!common.getSubscription('notification')) {\n api.connection.on('transaction', onTransaction);\n common.addSubscription('notification');\n }\n return [4, api.request('subscribe', {\n accounts_proposed: uniqueAddresses,\n })];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3: return [2, { subscribed: common.getAddresses().length > 0 }];\n }\n });\n}); };\nvar subscribeAddresses = function (addresses) { return __awaiter(void 0, void 0, void 0, function () {\n var api, uniqueAddresses, request;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4, connect()];\n case 1:\n api = _a.sent();\n uniqueAddresses = common.addAddresses(addresses);\n if (!(uniqueAddresses.length > 0)) return [3, 3];\n if (!common.getSubscription('transaction')) {\n api.connection.on('transaction', onTransaction);\n common.addSubscription('transaction');\n }\n request = {\n accounts_proposed: uniqueAddresses,\n };\n return [4, api.request('subscribe', request)];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3: return [2, { subscribed: common.getAddresses().length > 0 }];\n }\n });\n}); };\nvar subscribeBlock = function () { return __awaiter(void 0, void 0, void 0, function () {\n var api;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!common.getSubscription('ledger')) return [3, 2];\n return [4, connect()];\n case 1:\n api = _a.sent();\n api.on('ledger', onNewBlock);\n common.addSubscription('ledger');\n _a.label = 2;\n case 2: return [2, { subscribed: true }];\n }\n });\n}); };\nvar subscribe = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, response, error_10;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 9, 10, 11]);\n response = void 0;\n if (!(payload.type === 'accounts')) return [3, 3];\n return [4, subscribeAccounts(payload.accounts)];\n case 2:\n response = _a.sent();\n return [3, 8];\n case 3:\n if (!(payload.type === 'addresses')) return [3, 5];\n return [4, subscribeAddresses(payload.addresses)];\n case 4:\n response = _a.sent();\n return [3, 8];\n case 5:\n if (!(payload.type === 'block')) return [3, 7];\n return [4, subscribeBlock()];\n case 6:\n response = _a.sent();\n return [3, 8];\n case 7: throw new errors_1.CustomError('invalid_param', '+type');\n case 8:\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.SUBSCRIBE,\n payload: response,\n });\n return [3, 11];\n case 9:\n error_10 = _a.sent();\n common.errorHandler({ id: data.id, error: utils.transformError(error_10) });\n return [3, 11];\n case 10:\n setPingTimeout();\n return [7];\n case 11: return [2];\n }\n });\n}); };\nvar unsubscribeAddresses = function (addresses) { return __awaiter(void 0, void 0, void 0, function () {\n var api, all;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4, connect()];\n case 1:\n api = _a.sent();\n if (!!addresses) return [3, 3];\n all = common.getAddresses();\n common.removeAccounts(common.getAccounts());\n common.removeAddresses(all);\n return [4, api.request('unsubscribe', {\n accounts_proposed: all,\n })];\n case 2:\n _a.sent();\n return [3, 5];\n case 3:\n common.removeAddresses(addresses);\n return [4, api.request('unsubscribe', {\n accounts_proposed: addresses,\n })];\n case 4:\n _a.sent();\n _a.label = 5;\n case 5:\n if (common.getAccounts().length < 1) {\n api.connection.removeListener('transaction', onTransaction);\n common.removeSubscription('transaction');\n }\n return [2];\n }\n });\n}); };\nvar unsubscribeAccounts = function (accounts) { return __awaiter(void 0, void 0, void 0, function () {\n var prevAddresses, addresses, uniqueAddresses;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n prevAddresses = common.getAddresses();\n common.removeAccounts(accounts || common.getAccounts());\n addresses = common.getAddresses();\n uniqueAddresses = prevAddresses.filter(function (a) { return addresses.indexOf(a) < 0; });\n return [4, unsubscribeAddresses(uniqueAddresses)];\n case 1:\n _a.sent();\n return [2];\n }\n });\n}); };\nvar unsubscribeBlock = function () { return __awaiter(void 0, void 0, void 0, function () {\n var api;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!common.getSubscription('ledger'))\n return [2];\n return [4, connect()];\n case 1:\n api = _a.sent();\n api.removeListener('ledger', onNewBlock);\n common.removeSubscription('ledger');\n return [2];\n }\n });\n}); };\nvar unsubscribe = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, error_11;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n payload = data.payload;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 8, 9, 10]);\n if (!(payload.type === 'accounts')) return [3, 3];\n return [4, unsubscribeAccounts(payload.accounts)];\n case 2:\n _a.sent();\n return [3, 7];\n case 3:\n if (!(payload.type === 'addresses')) return [3, 5];\n return [4, unsubscribeAddresses(payload.addresses)];\n case 4:\n _a.sent();\n return [3, 7];\n case 5:\n if (!(payload.type === 'block')) return [3, 7];\n return [4, unsubscribeBlock()];\n case 6:\n _a.sent();\n _a.label = 7;\n case 7: return [3, 10];\n case 8:\n error_11 = _a.sent();\n common.errorHandler({ id: data.id, error: utils.transformError(error_11) });\n return [2];\n case 9:\n setPingTimeout();\n return [7];\n case 10:\n common.response({\n id: data.id,\n type: constants_1.RESPONSES.UNSUBSCRIBE,\n payload: { subscribed: common.getAddresses().length > 0 },\n });\n return [2];\n }\n });\n}); };\nvar disconnect = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var error_12;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!rippleApi) {\n common.response({ id: data.id, type: constants_1.RESPONSES.DISCONNECTED, payload: true });\n return [2];\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4, rippleApi.disconnect()];\n case 2:\n _a.sent();\n common.response({ id: data.id, type: constants_1.RESPONSES.DISCONNECTED, payload: true });\n return [3, 4];\n case 3:\n error_12 = _a.sent();\n common.errorHandler({ id: data.id, error: utils.transformError(error_12) });\n return [3, 4];\n case 4: return [2];\n }\n });\n}); };\nonmessage = function (event) {\n if (!event.data)\n return;\n var data = event.data;\n common.debug('onmessage', data);\n switch (data.type) {\n case constants_1.MESSAGES.HANDSHAKE:\n common.setSettings(data.settings);\n break;\n case constants_1.MESSAGES.CONNECT:\n connect()\n .then(function () {\n common.response({ id: data.id, type: constants_1.RESPONSES.CONNECT, payload: true });\n })\n .catch(function (error) {\n return common.errorHandler({ id: data.id, error: utils.transformError(error) });\n });\n break;\n case constants_1.MESSAGES.GET_INFO:\n getInfo(data);\n break;\n case constants_1.MESSAGES.GET_ACCOUNT_INFO:\n getAccountInfo(data);\n break;\n case constants_1.MESSAGES.GET_TRANSACTION:\n getTransaction(data);\n break;\n case constants_1.MESSAGES.ESTIMATE_FEE:\n estimateFee(data);\n break;\n case constants_1.MESSAGES.PUSH_TRANSACTION:\n pushTransaction(data);\n break;\n case constants_1.MESSAGES.SUBSCRIBE:\n subscribe(data);\n break;\n case constants_1.MESSAGES.UNSUBSCRIBE:\n unsubscribe(data);\n break;\n case constants_1.MESSAGES.DISCONNECT:\n disconnect(data);\n break;\n case 'terminate':\n cleanup();\n break;\n default:\n common.errorHandler({\n id: data.id,\n error: new errors_1.CustomError('worker_unknown_request', \"+\" + data.type),\n });\n break;\n }\n};\n\n\n // worker content end\n // return worker \"onmessage\" function to BlockchainLinkWorker module\n return onmessage;\n}", "title": "" }, { "docid": "164560198656d0179ab5e170d70f3c1c", "score": "0.5586197", "text": "function body() {\n // Signal worker has started.\n this.postMessage(true);\n // Keep the worker running forever\n while (true) {\n new WeakRef([]);\n }\n}", "title": "" }, { "docid": "2f4102183b598df174e69bc7a0165d19", "score": "0.5585429", "text": "function runService (workerData) {\n return new Promise((resolve, reject) => {\n const worker = new Worker('./lib/httpClient.mjs', { workerData })\n worker.on('message', resolve)\n worker.on('error', reject)\n worker.on('exit', (code) => {\n if (code !== 0) { reject(new Error(`Worker stopped with exit code ${code}`)) }\n })\n })\n}", "title": "" }, { "docid": "d0738e32fbc8de8331c55538a6efc566", "score": "0.5575993", "text": "function setWorkerUpdate() {\n // overwrite save fuction, threre will be added a functionality to count\n // and display number of chars in edited note before saving it to\n // webstoreage\n module.save = function(note) {\n // here we post a message to webworker, worker asynchronousely\n // counts character numbers\n saver.postMessage({\n 'sleep' : sleepTime,\n 'text' : note.text\n });\n\n // this part will be invoked by webworker when she finishes her\n // asynchronous word count.\n // Notice that we are not able to modify any DOM element\n // asynchronusely inside web woreker we have to do it right here (in\n // main thread)\n saver.onmessage = function(e) {\n var charsNumber = e.data;\n updateCharsNumberAndSave(charsNumber, note);\n };\n };\n }", "title": "" }, { "docid": "48a3c14b8eb180c58e559227bbeb76c1", "score": "0.55757594", "text": "function forkWebWorker(pathToWorker) {\n return new WebWorkerProcess(pathToWorker);\n}", "title": "" }, { "docid": "94a5b9115a0b876527ee485f73a0de92", "score": "0.5568349", "text": "function startWorker() {\n if (typeof (Worker) !== \"undefined\") {\n if (typeof (w) == \"undefined\") {\n w = new Worker('javascript/damageWorker.js');\n w.addEventListener(\"message\", handleReceipt, false);\n w.postMessage(engageDetect)\n }\n }\n}", "title": "" }, { "docid": "f259768090acf5689a62486ffcd277d9", "score": "0.5542089", "text": "constructor(workerUrl, messageHandler) {\r\n this.queue = new Array();\r\n this.messageHandler = messageHandler;\r\n this.worker = new Worker(workerUrl);\r\n this.worker.onmessage = this.handleWorkerCallback.bind(this);\r\n }", "title": "" }, { "docid": "1d2a929acbdbe605829568c52111b021", "score": "0.5540134", "text": "_addWorker(worker) {\n this.workers.add(worker);\n if (this.options.onAddWorker) {\n this.options.onAddWorker();\n }\n }", "title": "" }, { "docid": "e1e2b8e33d8da548f28315596151d9e6", "score": "0.5501191", "text": "async function main() {\n try {\n // load worker\n let options = JSON.parse(Buffer.from(process.env._, 'base64'))\n delete process.env._\n let bindings = {}\n let count = 0\n process.stdin.on('data', chunk => count += chunk.length)\n let code = options.boundary\n ? await parse(await piccolo({\n 'content-type': `multipart/form-data; boundary=${options.boundary}`\n }, process.stdin), bindings)\n : (await buffer.consume(process.stdin)).toString('utf-8')\n let handler = compile(code, bindings, options)\n\n // spawn server\n await new Promise((res, rej) => {\n let server = createServer({keepAliveTimeout: options.keepalive})\n .on('request', handler)\n .on('close', res)\n .on('error', rej)\n .listen(options.port, () => {\n // graceful shutdown code:\n // stops listening for new connections, waits for requests on active\n // connections to resolve and returns 503 for future requests\n\n // once there are no more active connections, server will emit\n // 'close' which happens as soon as the last outstanding request has\n // completed (for well behaved clients that send 'connection: close'\n // on their last request), or after the http.server keep-alive\n // timeout expires (defaults to 5 seconds)\n process.on('SIGINT', () => server.on('request', http_503)\n .removeListener('request', handler)\n .close())\n process.send(options.symbol)\n })\n })\n process.exit(0)\n } catch(err) {\n console.error(err)\n process.exit(1)\n }\n}", "title": "" }, { "docid": "a20510b3849221a6e562ad00115b8abf", "score": "0.5493256", "text": "function startWorker() {\n if(typeof(Worker) !== \"undefined\") {\n if(typeof(w) == \"undefined\") {\n w = new Worker(\"/js/map/mapworker.js\");\n }\n w.onmessage = function(event) {\n console.log(JSON.parse(event.data));\n this.pos = JSON.parse(event.data).location; //Also returns an accuracy if wanted\n console.log('updated position: ');\n console.log( this.pos );\n };\n } else {\n console.log(\"No Web Worker support.\");\n }\n }", "title": "" }, { "docid": "ae7a07c435ad28317b3ac7f6e5b78118", "score": "0.5492288", "text": "function create(postMessage) {\n return new SimpleWorkerServer(postMessage);\n }", "title": "" }, { "docid": "8b6098feb8871ce479a7df381b44f2b7", "score": "0.54602766", "text": "function GreetingWorker() {}", "title": "" }, { "docid": "6a856f96762afb27b13f9bdcdc33639d", "score": "0.5441427", "text": "function WorkerDelegate(type, id, source, origin) {\n this.init(type, id, source, origin);\n}", "title": "" }, { "docid": "2251919f02cc5e00d08eb9962c61062c", "score": "0.5437898", "text": "async onWorkerMessage(event) {\n const pendingQuery = this.pendingQueries[event.data.queryId];\n const modelResults = {\n total: event.data.total\n };\n modelResults.hits = await Promise.all(\n event.data.results.map(async (hit) => {\n if (hit && hit.keyString) {\n const identifier = this.openmct.objects.parseKeyString(hit.keyString);\n const domainObject = await this.openmct.objects.get(identifier);\n\n return domainObject;\n }\n })\n );\n\n pendingQuery.resolve(modelResults);\n delete this.pendingQueries[event.data.queryId];\n }", "title": "" }, { "docid": "8ed446fcfb4b05b2b6f811372021fde0", "score": "0.5429866", "text": "#onMessage(worker, msg) {\n if (msg.type === null) {\n this.#onSystemMessage(worker, msg);\n } else if (msg.type === undefined) {\n this.emit(\"message\", worker, msg);\n } else {\n this.emit(\"message-\" + msg.type, worker, msg.message);\n }\n }", "title": "" }, { "docid": "a6f87bc25a17aac457daedbaf827d4df", "score": "0.54271704", "text": "runTask(type, onMessage, message, transfer)\n\t{\n\t\tvar self = this;\n\n\t\tvar worker = this.getWorker(type);\n\t\tworker.onmessage = function(event)\n\t\t{\n\t\t\tonMessage(event);\n\t\t\tself.returnWorker(type, worker);\n\t\t};\n\n\t\tif(transfer !== undefined)\n\t\t{\n\t\t\tworker.postMessage(message, transfer);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tworker.postMessage(message);\n\t\t}\n\t}", "title": "" }, { "docid": "fff83255d68b2663c422fcfabdbdd354", "score": "0.5420168", "text": "function onWorkerBroadcast(msg) {\n // function d(str) { console.log(`dispatch: ${str}`)}\n\n d(`onWorkerBroadcast(): msg=${JSON.stringify(msg)}`);\n\n const sender_worker_id = msg.worker_id;\n\n if (mWorkers) {\n for (let pid in mWorkers) {\n const worker = mWorkers[pid];\n\n if(worker && worker.child && msg.message && worker.worker_id !== sender_worker_id) {\n d(`send to ${worker.worker_id}`);\n worker.child.send({id: \"gcs_msg\", msg: { worker_id: worker.worker_id, message: msg.message}});\n }\n }\n }\n }", "title": "" }, { "docid": "91b3860c5a747df940645fee1a953114", "score": "0.5418352", "text": "constructor(m_options) {\n this.m_options = m_options;\n this.m_workerChannelLogger = harp_utils_1.LoggerManager.instance.create(\"WorkerChannel\");\n this.m_eventListeners = new Map();\n this.m_workers = new Array();\n // List of idle workers that can be given the next job. It is using a LIFO scheme to reduce\n // memory consumption in idle workers.\n this.m_availableWorkers = new Array();\n this.m_workerPromises = new Array();\n this.m_readyPromises = new Map();\n this.m_requests = new Map();\n this.m_workerRequestQueue = [];\n this.m_nextMessageId = 0;\n this.m_stopped = true;\n this.m_referenceCount = 0;\n /**\n * Handles messages received from workers. This method is protected so that the message\n * reception can be simulated through an extended class, to avoid relying on real workers.\n *\n * @param workerId The workerId of the web worker.\n * @param event The event to dispatch.\n */\n this.onWorkerMessage = (workerId, event) => {\n if (harp_datasource_protocol_1.WorkerServiceProtocol.isResponseMessage(event.data)) {\n const response = event.data;\n if (response.messageId === null) {\n logger.error(`[${this.m_options.scriptUrl}]: Bad ResponseMessage: no messageId`);\n return;\n }\n const entry = this.m_requests.get(response.messageId);\n if (entry === undefined) {\n logger.error(`[${this.m_options.scriptUrl}]: Bad ResponseMessage: invalid messageId`);\n return;\n }\n if (workerId >= 0 && workerId < this.m_workers.length) {\n const worker = this.m_workers[workerId];\n this.m_availableWorkers.push(worker);\n // Check if any new work has been put into the queue.\n this.checkWorkerRequestQueue();\n }\n else {\n logger.error(`[${this.m_options.scriptUrl}]: onWorkerMessage: invalid workerId`);\n }\n if (response.error !== undefined) {\n entry.resolver(new Error(response.error.toString()));\n }\n else {\n entry.resolver(undefined, response.response);\n }\n }\n else if (harp_datasource_protocol_1.WorkerServiceProtocol.isInitializedMessage(event.data)) {\n const readyPromise = this.getReadyPromise(event.data.service);\n if (++readyPromise.count === this.m_workerPromises.length) {\n readyPromise.resolve();\n }\n }\n else if (isLoggingMessage(event.data)) {\n switch (event.data.level) {\n case harp_utils_1.LogLevel.Trace:\n this.m_workerChannelLogger.trace(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Debug:\n this.m_workerChannelLogger.debug(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Log:\n this.m_workerChannelLogger.log(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Info:\n this.m_workerChannelLogger.info(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Warn:\n this.m_workerChannelLogger.warn(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Error:\n this.m_workerChannelLogger.error(...event.data.message);\n break;\n }\n }\n else {\n this.eventHandler(event);\n }\n };\n this.start();\n }", "title": "" }, { "docid": "bf86ddeaac16f31424a69f022182d4b5", "score": "0.541733", "text": "constructor(m_options) {\n this.m_options = m_options;\n this.m_workerChannelLogger = harp_utils_1.LoggerManager.instance.create(\"WorkerChannel\");\n this.m_eventListeners = new Map();\n this.m_workers = new Array();\n // List of idle workers that can be given the next job. It is using a LIFO scheme to reduce\n // memory consumption in idle workers.\n this.m_availableWorkers = new Array();\n this.m_workerPromises = new Array();\n this.m_readyPromises = new Map();\n this.m_requests = new Map();\n this.m_workerRequestQueue = [];\n this.m_nextMessageId = 0;\n this.m_stopped = true;\n this.m_referenceCount = 0;\n /**\n * Handles messages received from workers. This method is protected so that the message\n * reception can be simulated through an extended class, to avoid relying on real workers.\n *\n * @param workerId - The workerId of the web worker.\n * @param event - The event to dispatch.\n */\n this.onWorkerMessage = (workerId, event) => {\n if (harp_datasource_protocol_1.WorkerServiceProtocol.isResponseMessage(event.data)) {\n const response = event.data;\n if (response.messageId === null) {\n logger.error(`[${this.m_options.scriptUrl}]: Bad ResponseMessage: no messageId`);\n return;\n }\n const entry = this.m_requests.get(response.messageId);\n if (entry === undefined) {\n logger.error(`[${this.m_options.scriptUrl}]: Bad ResponseMessage: invalid messageId`);\n return;\n }\n if (workerId >= 0 && workerId < this.m_workers.length) {\n const worker = this.m_workers[workerId];\n this.m_availableWorkers.push(worker);\n // Check if any new work has been put into the queue.\n this.checkWorkerRequestQueue();\n }\n else {\n logger.error(`[${this.m_options.scriptUrl}]: onWorkerMessage: invalid workerId`);\n }\n if (response.errorMessage !== undefined) {\n const error = new Error(response.errorMessage);\n if (response.errorStack !== undefined) {\n error.stack = response.errorStack;\n }\n entry.resolver(error);\n }\n else {\n entry.resolver(undefined, response.response);\n }\n }\n else if (harp_datasource_protocol_1.WorkerServiceProtocol.isInitializedMessage(event.data)) {\n const readyPromise = this.getReadyPromise(event.data.service);\n if (++readyPromise.count === this.m_workerPromises.length) {\n readyPromise.resolve();\n }\n }\n else if (isLoggingMessage(event.data)) {\n switch (event.data.level) {\n case harp_utils_1.LogLevel.Trace:\n this.m_workerChannelLogger.trace(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Debug:\n this.m_workerChannelLogger.debug(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Log:\n this.m_workerChannelLogger.log(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Info:\n this.m_workerChannelLogger.info(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Warn:\n this.m_workerChannelLogger.warn(...event.data.message);\n break;\n case harp_utils_1.LogLevel.Error:\n this.m_workerChannelLogger.error(...event.data.message);\n break;\n }\n }\n else {\n this.eventHandler(event);\n }\n };\n this.start();\n }", "title": "" }, { "docid": "8b667a058f15ea466f70d7b6496ee7c2", "score": "0.54055107", "text": "async function main() {\n const compute = require('dcp/compute');\n const wallet = require('dcp/wallet');\n let startTime;\n\n const job = compute.for(\n ['red', 'green', 'yellow', 'blue', 'brown', 'orange', 'pink'],\n (colour) => {\n progress(0);\n let sum = 0;\n for (let i = 0; i < 10000; i += 1) {\n progress(i / 10000);\n sum += Math.random();\n }\n return { colour, sum };\n },\n );\n\n job.on('accepted', () => {\n console.log(` - Job accepted by scheduler, waiting for results`);\n console.log(` - Job has id ${job.id}`);\n startTime = Date.now();\n });\n\n job.on('readystatechange', (arg) => {\n console.log(`new ready state: ${arg}`);\n });\n\n job.on('result', (ev) => {\n console.log(\n ` - Received result for slice ${ev.sliceNumber} at ${\n Math.round((Date.now() - startTime) / 100) / 10\n }s`,\n );\n console.log(` * Wow! ${ev.result.colour} is such a pretty colour!`);\n });\n\n job.public.name = 'DCP chess job, nodejs';\n\n const ks = await wallet.get(); /* usually loads ~/.dcp/default.keystore */\n job.setPaymentAccountKeystore(ks);\n \n /*job.computeGroups = [\n {\n joinKey: 'kayra',\n joinSecret: 'iscool',\n }\n ];*/\n\n const results = await job.exec(compute.marketValue);\n console.log('results=', Array.from(results));\n\n let jobReport = await job.getJobInfo(job.id);\n console.log('jobReport: ', jobReport);\n}", "title": "" }, { "docid": "97c4d6b562afd974d14122469200ab9e", "score": "0.54042315", "text": "function tick() {\n \tif( !l.worker ) {\n\t \t l.worker = l.reg.active;\n\t\t\tif( l.worker ) {\n\t\t\t\tl.worker.postMessage( {op:\"Hello\" } );\n \t\n\t\t\t\tif( l.connect )\n\t\t\t\t\tl.worker.postMessage( {op:\"connect\" } );\n\t\t\t} else {\n\t\t\t\tsetTimeout( tick, 100 );\n\t\t\t}\n }\n\t}", "title": "" }, { "docid": "3fd50331028afffc122c8f1732cf4cee", "score": "0.54026884", "text": "function init(worker) {\n var bootstrapFiles = LivelyLoader.bootstrapFiles.map(function(url) {\n return url.startsWith('http:') ? url : URL.root.toString() + url; });\n worker.postMessage({\n command: 'setup',\n options: {\n locationDirectory: JSLoader.currentDir(),\n bootstrapFiles: bootstrapFiles,\n codeBase: lively.Config.codeBase,\n rootPath: lively.Config.rootPath,\n nodeJSURL: lively.Config.nodeJSURL,\n location: (function() {\n var loc = {};\n [\"hash\",\"host\",\"hostname\",\"href\",\"origin\",\"pathname\",\"port\",\"protocol\",\"search\"].forEach(function(name) {\n loc[name] = lively.Config.location[name]; });\n return loc;\n })()\n }\n });\n worker.onmessage = function(evt) {\n if (evt.data.workerReady !== undefined) { worker.ready = !!evt.data.workerReady; return; }\n if (worker.onMessage) worker.onMessage(evt);\n }\n worker.errors = [];\n worker.onerror = function(evt) {\n console.error(evt);\n worker.errors.push(evt);\n if (worker.onError) worker.onError(evt);\n }\n worker.run = function(/*func, args*/) {\n var args = Array.from(arguments), doFunc = args.shift(),\n code = Strings.format('(%s).apply(self, evt.data.args);', doFunc);\n this.basicRun({func: doFunc, args: args, useWhenDone: false});\n }\n worker.basicRun = function(options) {\n // options = {\n // func: FUNCTION,\n // args: ARRAY, /*transported to worker and applied to func*/\n // useWhenDone: BOOL\n /* If true, func receives a callback as first parameter that should be called\n with two arguments: (error, result) to indicate worker func is done. */\n var func = options.func,\n args = options.args,\n passInWhenDoneCallback = !!options.useWhenDone,\n codeTemplate = passInWhenDoneCallback ?\n 'self.isBusy = true;\\n'\n + 'function whenDone(err, result) { self.isBusy = false; postMessage({type: \"runResponse\", error: err, result: result}); }\\n'\n + '(%s).apply(self, [whenDone].concat(evt.data.args));' :\n ';(%s).apply(self, evt.data.args);',\n code = Strings.format(codeTemplate, func);\n worker.postMessage({command: 'eval', silent: true, source: code, args: args || []});\n }\n }", "title": "" }, { "docid": "ac5c8771f12f8216e8d2302d54f4ae63", "score": "0.53988045", "text": "function createWorker(workerFactory, onsuccess, onerror) {\n var worker = workerFactory();\n var onmessage = message => {\n if (worker.constructor === Worker) {\n worker.terminate();\n }\n // SharedWorker is terminated by close() in shared_worker.js.\n\n onsuccess(message.data);\n };\n if (worker.constructor === Worker) {\n worker.onmessage = onmessage;\n } else {\n worker.port.onmessage = onmessage;\n }\n worker.onerror = onerror;\n}", "title": "" } ]
90ac0ed001749a34140f8365a646fed8
handle when someone clicks on the grey area of the viewport so it autocloses the nav
[ { "docid": "6a67466a8a559ccb436b6f9f91221c10", "score": "0.0", "text": "function closePanels() {\n // close up the menu\n var panels = document.querySelectorAll('.sg-acc-panel'),\n handles = document.querySelectorAll('.sg-acc-handle');\n\n [].forEach.call(panels, function (panel) {\n panel.classList.remove('active');\n });\n\n\n [].forEach.call(handles, function (handle) {\n handle.classList.remove('active');\n });\n}", "title": "" } ]
[ { "docid": "b73ff1590a3a7cec6f4dc36ec82815b5", "score": "0.6781233", "text": "function openNav() {\n document.getElementById(\"mySidepanel\").style.width = \"250px\";\n\n // DISABLE JOYSTICK///////////////////////////\n joystickR.removeEventListener('touchStartValidation', function (event) {\n var touch = event.changedTouches[0];\n if (touch.pageX < window.innerWidth / 2 & touch.pageY > 80) return true;\n return false\n });\n\n joystickL.removeEventListener('touchStartValidation', function (event) {\n var touch = event.changedTouches[0];\n if (touch.pageX >= window.innerWidth / 2 & touch.pageY > 80) return true;\n return false\n });\n\n joystickR.addEventListener('touchStartValidation', function (event) {\n return false;\n });\n\n joystickL.addEventListener('touchStartValidation', function (event) {\n return false;\n });\n //////////////////////////////////////////////////\n}", "title": "" }, { "docid": "421173c28d6ab524441ca30bdf0a995c", "score": "0.6773472", "text": "function onTap() {\n if ($('#site-header').hasClass('toggled')) {\n $('#site-header').removeClass('toggled')\n $('#menu-primary').css('height', 'auto');\n $(window).unbind('scroll');\n $('#menu-primary').find('a, input').attr('tabindex', -1);\n } else {\n var bodyHeight = $('body').height();\n $('#site-header').addClass('toggled')\n $('#menu-primary').css('height', bodyHeight);\n $(window).scroll(onScroll);\n $('#menu-primary').find('a, input').attr('tabindex', 0);\n }\n }", "title": "" }, { "docid": "3880cfa2dbe62a792db258a75f3aa44c", "score": "0.6648293", "text": "function clickHandler(e) {\n const header = document.getElementById(\"header\");\n header.style.display = \"none\";\n e.preventDefault();\n for( link of links){\n link.classList.remove('active-navlink');\n }\n mainNav.classList.contains('transparent')? mainNav.classList.remove('transparent'): null ;\n const href = this.getAttribute(\"href\");\n this.classList.add('active-navlink');\n console.log(\"I got cliked !\"+href);\n for (section of sections) { \n let sectionId = \"#\"+section.id ;\n if (href === sectionId ) {\n \n section.classList.add('visible');\n document.querySelector(href).scrollIntoView({\n behavior: \"instant\"\n });\n } else {\n section.classList.remove('visible');\n }\n }\n \n ( burger.style.display === \"none\") ? null : toggleNavbar();\n \n \n}", "title": "" }, { "docid": "7653b8a23f52d170120955dce6ded86d", "score": "0.6572625", "text": "function clicknav(){\n $(\"a,.clicknav\").click(function(event){\n var el = $($(this).data('clicknav'));\n var offset = $(this).data('clicknav-offset');\n\n if (typeof offset === 'undefined') {\n offset = 100;\n }\n\n if (!el[0]) {\n var href = $(this).attr('href');\n if (href[0] === '#') {\n el = $($(this).attr('href'));\n }\n }\n\n if (el[0]) {\n $('body,html').animate({'scrollTop':el.offset().top - offset},500,'swing');\n event.preventDefault();\n }\n });\n }", "title": "" }, { "docid": "cb2a4f398e030835d24bf0328173b65a", "score": "0.6525171", "text": "function clickonheads() {\r\n navbar.addEventListener(\"click\", function(event) {\r\n let chosensection = document.querySelector(\"#\" + event.target.dataset.nav)\r\n chosensection.scrollIntoView();\r\n });\r\n}", "title": "" }, { "docid": "f420e5bc53988a0654fca08510282fda", "score": "0.6496633", "text": "function onClick () {\n navCur && navCur.click();\n }", "title": "" }, { "docid": "e93b974b115dee91da7f550ed087e319", "score": "0.6389359", "text": "function navigationClicks()\n{\n navigationBar.addEventListener('click',function(eventInfo)\n {\n var findSection=document.getElementById(eventInfo.target.dataset.nav);\n findSection.scrollIntoView();\n\n\n\n });\n}", "title": "" }, { "docid": "9f751803163448b643291f551d038802", "score": "0.63418925", "text": "function triggerNav() {\n \n /* \n * navopen var stores the info that the user wants to show the navbar or to hide it.\n * navopen is a boolean variable that switches the boolean variable from true to false or vice versa \n */\n navopen = !navopen;\n\n /* \n * If the navopen is true that means User wants to show the navbar then add width, border and border-color by calling the \n * helper function stated above.\n * These values are observations and hence you can change according to you.\n */\n if(navopen){\n setAttributePanel(\"350px\", \"5px solid\", \"white\");\n }else{\n\n /* Otherwise make the width: 0, border: \"\", border-color: \"\" in order to hide the side panel */\n setAttributePanel(\"0px\", \"\", \"\");\n }\n}", "title": "" }, { "docid": "bc03024877bc9637301bcc6a1caa3817", "score": "0.6311862", "text": "function navClick(listItem){\n const navList = document.getElementById('navbar__list');\n navList.addEventListener('click', scrollToView);\n}", "title": "" }, { "docid": "fcf72b4051af47128ee114bccc468f94", "score": "0.6307982", "text": "function main(){\r\n // build the nav\r\n createNav();\r\n\r\n // Add class 'active' to section when near top of viewport\r\n toggleActive();\r\n}", "title": "" }, { "docid": "5b108c49fa7ffe9cf2a9a96a62e2222a", "score": "0.6227413", "text": "function closeNav() {\n document.getElementById(\"mySidepanel\").style.width = \"0\";\n\n // ENABLE JOYSTICK ///////////////////////////////\n joystickR.removeEventListener('touchStartValidation', function (event) {\n return false;\n });\n\n joystickL.removeEventListener('touchStartValidation', function (event) {\n return false;\n });\n\n joystickR.addEventListener('touchStartValidation', function (event) {\n var touch = event.changedTouches[0];\n if (touch.pageX < window.innerWidth / 2 & touch.pageY > 80) return true;\n return false\n });\n\n joystickL.addEventListener('touchStartValidation', function (event) {\n var touch = event.changedTouches[0];\n if (touch.pageX >= window.innerWidth / 2 & touch.pageY > 80) return true;\n return false\n });\n //////////////////////////////////////////////////\n}", "title": "" }, { "docid": "44f0e25a9061176c297276b10e5e1eda", "score": "0.6217167", "text": "function _events() {\n document.getElementById('nav_open').addEventListener('click', event => {\n event.preventDefault();\n sidenav(true);\n });\n document.getElementById('nav_close').addEventListener('click', event => {\n event.preventDefault();\n sidenav(false);\n })\n}", "title": "" }, { "docid": "c3627de52fea4c73c656def8331cb4d3", "score": "0.61578876", "text": "function clickNav() {\n $(\".nav > li\").click(function(){\n var sliderSplit = this.id.split('-');\n var index = sliderSplit[1];\n if(index < index_prev) {\n index = index_prev - index;\n index_prev = sliderSplit[1];\n moveIndex(index);\n } else {\n index = index - index_prev;\n index_prev = sliderSplit[1];\n moveIndex(index);\n }\n clearInterval(interval);\n createAutoPlay();\n });\n}", "title": "" }, { "docid": "b12ea0885c1d144b66822801cc261435", "score": "0.6112578", "text": "function activateSideNav(option_element) {\n /* **************** **************** **************** **************** **************** \n * Fades in the HTML elements which are contained within a HTML element, '.copy',\n * of a given Section which had been invisible. \n * **************** *************** **************** **************** **************** */\n \n var section_value = new String();\n // This variable holds a number which represents the Section which is viewable and contains \n // the form this function processes.\n var scroll_to_value = new Number();\n \n section_value = $jQ(option_element).attr(\"id\");\n // Holds a value which matches the vertical location, in pixels.\n\n if (section_value === \"sctn_main\") {\n // If the Section to be navigated to is 'MAIN LANDING SECTION', \n // this condition is triggered.\n\n scroll_to_value = 0;\n // The vertical location to be navigated to is 0.\n } else {\n // Otherwise, if the Section to be navigated to is not 'MAIN LANDING SECTION', \n // this condition is triggered.\n\n var wndow_selector = new String();\n var wndow_elements = new Object();\n\n var wndow_height = new Number();\n\n wndow_selector = \".wndow\";\n wndow_elements = $jQ(wndow_selector);\n\n wndow_height = $jQ(wndow_elements).height();\n \n scroll_to_value = parseInt(section_value.charAt(section_value.length - 1)) * wndow_height;\n // The vertical location to be navigated to is equal to the product \n // of multiplying the number representing the Section Value multiplied by\n // the height of a HTML element using the selector, \".wndow\". \n }\n \n $jQ(window).scrollTop(scroll_to_value);\n // The browser window is navigated to the vertical location of the Section \n // being navigated to.\n}", "title": "" }, { "docid": "c56361fe79543b9137b2aa415cd6f893", "score": "0.61082643", "text": "_initNavbarClickHandler() {\n this._navbar = document.getElementById('navbar');\n\n this._navbar.addEventListener('click', (ev) => {\n ev.preventDefault();\n if (ev.target.tagName === 'A') {\n this._clearNavbarSelectedItems(this._navbar);\n\n const item = ev.target;\n const sectionName = item.getAttribute('data-section');\n if (sectionName) {\n const sectionElem = document.querySelector(`section[data-name=\"${sectionName}\"]`);\n if (sectionElem) {\n sectionElem.scrollIntoView();\n } else {\n document.vody.scrollIntoView();\n }\n }\n item.parentNode.classList.add('active');\n }\n }, true);\n }", "title": "" }, { "docid": "d5be6bdb83199912b768435babd5ee05", "score": "0.6098471", "text": "function scrollHandler() {\n const element = document.getElementById(\"navbar__list\");\n element.addEventListener(\"click\", (e) => {\n const href = element.getAttribute(\"href\");\n // Remove old active class and add the new active class\n const active = document.getElementsByClassName(\".your-active-class\");\n if (active !== null) {\n active.classList.remove(\".your-active-class\");\n }\n e.target.className = \"link__active\";\n element.scrollIntoView({ block: 'end', behavior: 'smooth' });\n });\n }", "title": "" }, { "docid": "6660d219a4f135f35a2f2bdc129be952", "score": "0.60982525", "text": "function navClickHandler() {\r\n navbar.classList.toggle('nav-active');\r\n document.body.classList.toggle('overflow-hide');\r\n}", "title": "" }, { "docid": "899c959be31e52fa2c406959caa8dd47", "score": "0.6095383", "text": "function navOverlay() {\n /* Open Menu */\n\t$( \".open-close-btn\" ).on('click touchstart', function(e) {\n\t\t// prevent default anchor click\n\t\te.preventDefault();\n\t\t$(\".overlay\").toggleClass(\"overlay-open\");\n\t\t$(\"#hamburger-icon\").toggleClass(\"hamburger-open\");\n\t});\n}", "title": "" }, { "docid": "f51182adfbe54e68deacf545dc6b414f", "score": "0.6059339", "text": "function accessTrap () {\n\n navLast.addEventListener('blur', function(e) {\n if(hasClass(primaryNavWrapper, cfg.navActiveClass)){\n primaryNavTrigger.focus();\n }\n });\n }", "title": "" }, { "docid": "b6834700cb67900b9d7084966a2c2a00", "score": "0.6054377", "text": "function menuGripClick() {\n // console.log('menuGripClick');\n\n PageData.MenuOpen = !PageData.MenuOpen;\n setMenuPosition();\n\n if (!PageData.MenuOpen && PageData.ControlsOpen) {\n PageData.ControlsOpen = false;\n setControlsPosition();\n }\n}", "title": "" }, { "docid": "79a54cf09a6278abe35136cce781e683", "score": "0.60543096", "text": "function onContentTap(gestureEvt) {\n if (sideMenuCtrl.getOpenAmount() !== 0) {\n sideMenuCtrl.close();\n gestureEvt.gesture.srcEvent.preventDefault();\n startCoord = null;\n primaryScrollAxis = null;\n } else if (!startCoord) {\n startCoord = ionic.tap.pointerCoord(gestureEvt.gesture.srcEvent);\n }\n }", "title": "" }, { "docid": "79a54cf09a6278abe35136cce781e683", "score": "0.60543096", "text": "function onContentTap(gestureEvt) {\n if (sideMenuCtrl.getOpenAmount() !== 0) {\n sideMenuCtrl.close();\n gestureEvt.gesture.srcEvent.preventDefault();\n startCoord = null;\n primaryScrollAxis = null;\n } else if (!startCoord) {\n startCoord = ionic.tap.pointerCoord(gestureEvt.gesture.srcEvent);\n }\n }", "title": "" }, { "docid": "305a4c978b035867650f1ec64835160a", "score": "0.60457844", "text": "function scrollToSection() {\n navbarList.addEventListener(\"click\", respondToClick); \n}", "title": "" }, { "docid": "7e3ff6408b3223a19ea2058624dc6169", "score": "0.60448664", "text": "handleClick(e) {\n // media queries keep sidebar open unless under a certain size\n // when closed, activating will open or close\n document.querySelector('nav#drawer').classList.toggle('open');\n e.stopPropagation();\n }", "title": "" }, { "docid": "b68914ee6eb2389fe43c4aa884fe983d", "score": "0.6023373", "text": "pageClicked(event)\n {\n let trigger = this.$refs.trigger ? this.$refs.trigger : this.$el;\n\n if (! this.hasUserAttention() || trigger === event.target) return;\n\n trigger.contains(event.target) ? null : this.lostUserAttention();\n }", "title": "" }, { "docid": "d38e717021c967e5948945693ea2ab3f", "score": "0.6018518", "text": "function navScroll() {\n // init controller\n height = window.innerHeight;\n var controller = new ScrollMagic.Controller();\n\n // build scenes\n new ScrollMagic.Scene({triggerElement: \"#intro\"})\n .setClassToggle(\"#nav\", \"bg-sienna\") // add class toggle\n .addTo(controller);\n}", "title": "" }, { "docid": "cf69b10a5c5694bdddddf9ff98000432", "score": "0.59948534", "text": "goHome () {\n this.viewer.viewport.goHome()\n }", "title": "" }, { "docid": "a92510bf468758bb6283681602e32a77", "score": "0.5991186", "text": "function openNavSlider(){\n //console.log(\"hamburger clicked\");\n let mobileNav=document.querySelector('.mobile-nav-div');\n //console.log(mobileNav);\n if(mobileNav.classList.contains('hide-nav')){\n mobileNav.classList.remove('hide-nav');\n mobileNav.classList.add('show-nav');\n } else {\n return;\n }\n}", "title": "" }, { "docid": "8cee8ab9e2e06514643adb3e6f17d53f", "score": "0.5984232", "text": "function flyToHome() {\r\n $('#main').data('clicked', true);\r\n toggleSvgButton('#main', true);\r\n\r\n closePanel2();\r\n\r\n let selectedAsset = main;\r\n onPickedAsset(selectedAsset);\r\n }", "title": "" }, { "docid": "8a4ee50071efa831f28233590ecb1de1", "score": "0.5984052", "text": "function toClickNavicon() {\n\t\t\tcount++;\n\t\t\tif (count % 2 != 0) {\n\t\t\t\tsidebar.style.left = 0;\n\t\t\t\tmoveLayout.style.marginLeft = 200 + 'px'\n\t\t\t\twrapper.style.opacity = 0.2;\n\t\t\t\tnavicon.style.color = 'rgb(250,250,250)';\n\t\t\t\tdocument.body.style.overflow = 'hidden';\n\t\t\t} \n\t\t\tif (count % 2 == 0) {\n\t\t\t\tsidebar.style.left = -200 + 'px';\n\t\t\t\tmoveLayout.style.marginLeft = 0;\n\t\t\t\twrapper.style.opacity = 1;\n\t\t\t\tnavicon.style.color = 'rgb(88,77,57)';\n\t\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f5d7769e6dd653de7811ccea6fc4bcc1", "score": "0.596461", "text": "function redrawNav(){\r\n var article1Top = 0;\r\n // The top of each article is offset by half the distance to the previous article.\r\n var article2Top = $('#frontend-school').offset().top / 2;\r\n var article3Top = ($(document).height() - $('#experience').offset().top) / 2;\r\n $('nav.nav li').removeClass('active');\r\n if($(document).scrollTop() >= article1Top && $(document).scrollTop() < article2Top){\r\n $('li.general-info').addClass('active');\r\n } else if ($(document).scrollTop() >= article2Top && $(document).scrollTop() < article3Top){\r\n $('li.frontend-school').addClass('active');\r\n } else if ($(document).scrollTop() >= article3Top){\r\n $('li.experience').addClass('active');\r\n }\r\n \r\n }", "title": "" }, { "docid": "9024fa0b1328f30bd48c6a204bc42246", "score": "0.59644896", "text": "function handleSlideNavClick() {\n $('.slideNav').hide();\n slideNavHover = true;\n slideNavEnabled = false;\n}", "title": "" }, { "docid": "e81bb991433dba36818515c5297ea525", "score": "0.5964072", "text": "function showNav() {\n \n if (this.wasClicked == false) {\n menuStyle.setAttribute(\"class\", \"responsive-style\");\n this.wasClicked = true;\n } else if (this.wasClicked == true) {\n menuStyle.removeAttribute(\"class\", \"responsive-style\");\n this.wasClicked = false;\n } \n}", "title": "" }, { "docid": "c0bbdfa20b808692362fee6ef4c5f025", "score": "0.5961872", "text": "function normal_view(){\n\tif (window.innerWidth<956){\n\t\t$burger.show();\n\t}else{\n\t\t$list.slideDown();\n\t}\n\t$chat.slideDown();\n\treset();\n}", "title": "" }, { "docid": "9eb766c333f863dd5715f351283b6086", "score": "0.59592354", "text": "function aClick(){\n\t\t\t\t\n\t\t\t\t//if hamburger icon was clicked when menu was not active\n\t\tif(isClicked){\n\t\t\t//set the width of primary content container -> content should not scale while animating\n\t\t\tvar contentWidth = jQuery('#content').width();\n\t\t\t//var contentHeight = jQuery('#content').height();\n\t\n\t\t\t//set the content with the width that it has originally\n\t\t\tjQuery('#content').css('width', contentWidth);\n\t\t\t//jQuery('#content').css('height', contentHeight);\n\t\n\t\t\t//display a layer to disable clicking and scrolling on the content while menu is shown\n\t\t\tjQuery('#contentLayer').css('display', 'block');\n\t\n\t\t\t//disable all scrolling on mobile devices while menu is shown\n\t\t\tjQuery('#container').bind('touchmove', function(e){e.preventDefault()});\n\t\t\tjQuery('body').css('overflow-y', 'hidden');\n\t\t\t\n\t\t\t//set margin for the whole container with a jquery UI animation\n\t\t\tjQuery(\"#container\").animate({\"marginTop\": [\"160px\", 'easeOutExpo']}, {\n\t\t\t\tduration: 700,\n\t\t\t\tstart: function(){\n\t\t\t\t\tjQuery('nav').animate({\"z-index\": [\"1\", \"easeOutExpo\"]}, { \n\t\t\t\t\t\t\t\t\t\t duration:130});\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t}\n\t\t\n\t\t//if hamburger icon was clicked when menu is active\n\t\telse\n\t\t{\n\t\t\t//enable all scrolling on mobile devices when menu is closed\n jQuery('#container').unbind('touchmove');\n\t\tjQuery('body').css('overflow-y', 'scroll');\n\n //set margin for the whole container back to original state with a jquery UI animation\n jQuery(\"#container\").animate({\"marginTop\": [\"0%\", 'easeOutExpo']}, {\n duration: 700,\n start: function() {\n\t\t\t\t jQuery('nav').animate({\"z-index\": [\"0\", \"easeOutExpo\"]}, { \n\t\t\t\t\t\t\t\t\t opacity: 0,\n\t\t\t\t\t\t\t\t\t duration: 130});\n\t\t\t},\n\t\t\tcomplete: function() {\n jQuery('#content').css('width', 'auto');\n\t\t\t\t //jQuery('#content').css('height', 'auto');\n jQuery('#contentLayer').css('display', 'none');\n\n }\n });\n\t\t\t\n\t\t}\n\t\t\n\t\tif (isClicked)\n\t\t{\n\t\t\tisClicked = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tisClicked = true;\n\t\t}\n\t\t\t\n }", "title": "" }, { "docid": "2d4e5f17485f935e3d12982ce78a2cee", "score": "0.59554654", "text": "function handler() {\n let scrpos=window.pageYOffset || document.scrollingElement.scrollTop;\n let vh=window.innerHeight\n let homePos=scrpos+home.getBoundingClientRect().top;\n let aboutPos=scrpos+about.getBoundingClientRect().top;\n let servicesPos=scrpos+services.getBoundingClientRect().top;\n let portfolioPos=scrpos+portfolio.getBoundingClientRect().top;\n let contactPos=scrpos+contact.getBoundingClientRect().top;\n\n if(scrpos>=homePos && scrpos<=(homePos+home.clientHeight)){\n //make it active\n document.querySelector(\".menu-item.home a\").classList.add('active')\n document.querySelector(\".nav-item.home\").classList.add('active')\n\n //home paralax effect\n let parax=home.querySelectorAll('[data-paralax]');\n parax.forEach(elm=>{\n paralax(elm,scrpos)\n })\n }else{\n document.querySelector(\".menu-item.home a\").classList.remove('active')\n document.querySelector(\".nav-item.home\").classList.remove('active') \n }\n if(scrpos>=aboutPos && scrpos<=(aboutPos+about.clientHeight)){\n //just incase about me pGW DOES NOT occupiy the whole of viewport\n document.querySelector(\".menu-item.home a\").classList.remove('active')\n document.querySelector(\".nav-item.home\").classList.remove('active') \n \n //make it active\n document.querySelector(\".menu-item.about a\").classList.add('active')\n document.querySelector(\".nav-item.about\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.about a\").classList.remove('active')\n document.querySelector(\".nav-item.about\").classList.remove('active')\n }\n if(scrpos>=servicesPos && scrpos<=(servicesPos+services.clientHeight)){\n //make it active\n document.querySelector(\".menu-item.services a\").classList.add('active')\n document.querySelector(\".nav-item.services\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.services a\").classList.remove('active')\n document.querySelector(\".nav-item.services\").classList.remove('active')\n }\n if(scrpos>=portfolioPos && scrpos<=(portfolioPos+portfolio.clientHeight)){\n //make it active\n document.querySelector(\".menu-item.portfolio a\").classList.add('active')\n document.querySelector(\".nav-item.portfolio\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.portfolio a\").classList.remove('active')\n document.querySelector(\".nav-item.portfolio\").classList.remove('active')\n }\n\n if(scrpos>=contactPos || scrpos>=(document.scrollingElement.scrollHeight-vh)){\n //make it active\n //disblae portfolio active class since contact me is not a full page section\n document.querySelector(\".menu-item.portfolio a\").classList.remove('active')\n document.querySelector(\".nav-item.portfolio\").classList.remove('active')\n\n document.querySelector(\".menu-item.contact-me a\").classList.add('active')\n document.querySelector(\".nav-item.contact-me\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.contact-me a\").classList.remove('active')\n document.querySelector(\".nav-item.contact-me\").classList.remove('active')\n }\n}", "title": "" }, { "docid": "7a341a145c0eafae6c1e233c9cd9176b", "score": "0.59472364", "text": "function navControl() {\n\n if(burger.classList.contains('burger--active')) {\n nav.classList.remove('nav_open');\n burger.classList.remove('burger--active');\n $('#menuBlockOut').addClass('hidden');\n } \n else {\n burger.classList.add('burger--active');\n nav.classList.add('nav_open');\n $('#menuBlockOut').removeClass('hidden');\n }\n }", "title": "" }, { "docid": "437b6b0b47b84254ddbceb6b1f86af13", "score": "0.59442425", "text": "function navEvent() {\n // e.preventDefault();\n const secondPage = document.querySelector('.second-page-container');\n secondPage.classList.add('hidden');\n}", "title": "" }, { "docid": "5dfd37a7b7f5e01d27fc35d6dca41ea9", "score": "0.594231", "text": "function scroll_actions(){\n // Checks if the logo has to be \"resized\". Big for intro, small if elsewhere.\n if($(this).scrollTop() > $(window).height()){\n $('#header-logo-big').toggleClass('active-logo', false);\n $('#header-logo-small').toggleClass('active-logo', true);\n $('#back-to-top').css('display', 'inline');\n }else{\n $('#header-logo-big').toggleClass('active-logo', true);\n $('#header-logo-small').toggleClass('active-logo', false);\n $('#back-to-top').css('display', 'none');\n }\n\n // Refresh the waypoints\n Waypoint.refreshAll(); \n}", "title": "" }, { "docid": "33008469a68acb90d31be861de0d8f24", "score": "0.5937344", "text": "function openNav() {\n sidenav.css(\"margin-left\", \"0\");\n sidenav.css(\"overflow\", \"auto\");\n backButton.addClass(\"active_background\");\n enableHamburger();\n menuOpen = true;\n}", "title": "" }, { "docid": "a4a5fee610f64023b5a2ae6c9d941e35", "score": "0.5937043", "text": "_manuallyToggleNavigationPane() {\n this.toggleButton.dispatchEvent(new MouseEvent('click'));\n }", "title": "" }, { "docid": "ede99e2ceace9f91e0ca96a7332efbbf", "score": "0.5936454", "text": "onClickScene_() {\n this.portraitToggleScene(true, true);\n }", "title": "" }, { "docid": "54c2479a7167094dbb4a35f8b416063d", "score": "0.59301484", "text": "function clickHandler(event)\n {\n console.log(\"offers\" + document.getElementsByClassName(\"footer\")[0].offsetTop);\n // Get value of current clicked item\n const data = event.target.firstChild.data;\n // Find class of pressed element and move to the section\n Object.keys(NavItemsData).forEach(i => {\n if(NavItemsData[i].name == data)\n {\n document.getElementsByClassName(NavItemsData[i].position)[0].scrollIntoView({ behavior: 'smooth' });\n }\n });\n }", "title": "" }, { "docid": "c6b244a4f0ce05d3b17dca7c4775b5dc", "score": "0.59016883", "text": "function onHeaderBurgerClick(){\n //menu and contacts move on scroll\n onWinResize();\n $(\".mobile-menu\").toggleClass(\"mobile-menu-hover-link\");\n $(\"aside.sidebar\").toggleClass(\"sidebar-show\");\n if($(\"aside.sidebar\").hasClass(\"sidebar-show\")){\n $(\".mobile-header\").css(\"position\", \"fixed\");\n }else{\n $(\".mobile-header\").css(\"position\", \"absolute\");\n }\n setTimeout(function(){\n $(\".sidebar .scroll-fix\").scrollTop(0);// returns position of .scroll-fix\n },500);\n }", "title": "" }, { "docid": "7a496fef39773b4305e9710b746ef5b6", "score": "0.589153", "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 $('#navbar').find('[data-scroll=\"' + id + '\"]').addClass('active');\n }\n });\n }", "title": "" }, { "docid": "bc7fff8ea61f4178424e9838b014077e", "score": "0.58899885", "text": "function navCloseHandler() {\n if (!widthFlg) {\n\n }\n }", "title": "" }, { "docid": "08817aada5989811fbcab97f59a253cd", "score": "0.5889169", "text": "function viewShown() {\n activate();\n }", "title": "" }, { "docid": "57408891441ccc97084781f3b0a07f77", "score": "0.5887608", "text": "function stillHandler() { \n Options.scenes.forEach(function(scene) {\n \tif ( pageYOffset > scene.offset) {\n \t\tscene.action(scene.target);\n \t}\n });\n }", "title": "" }, { "docid": "f661031e1782a1208f99497e3c5dff46", "score": "0.5882981", "text": "function activateMenuOnScroll(){\n waq.$menu.$anchoredSections = $();\n for(i=0;i<waq.$menu.$links.length; i++){\n var $trigger = waq.$menu.$links.eq(i);\n var $section = $( '#' + $trigger.parent().attr('class').split(\" \")[0] );\n if($section.length) waq.$menu.$anchoredSections.push($section[0]);\n }\n if(waq.$menu.$anchoredSections.length){\n waq.$menu.$anchoredSections.scrollEvents({\n flag: 'anchor',\n offset: 150,\n topUp: function(e){\n var slug = e.selection.attr('id');\n var $target = waq.$menu.$links.parent().filter('.'+slug);\n waq.$menu.$links.parent().removeClass('active');\n if($target.length){\n $target.addClass('active');\n // window.location.replace('#!/'+slug);\n };\n },\n topDown: function(e){\n var slug = $(scrollEvents.selection[minMax(e.i-1,0,100)]).attr('id')\n var $target = waq.$menu.$links.parent().filter('.'+slug);\n waq.$menu.$links.parent().removeClass('active');\n if($target.length){\n $target.addClass('active');\n // window.location.replace('#!/'+slug);\n }\n }\n\n });\n }\n // dirty fix\n $win.on('load',function(){\n waq.$menu.$links.parent().removeClass('active');\n });\n }", "title": "" }, { "docid": "4e28f9834bf239bdf7aada71cca48080", "score": "0.588018", "text": "function closeNav() {\n document.getElementById(\"myNav\").style.left = \"-100vw\";\n }", "title": "" }, { "docid": "2c3b30e00c288c4bec5dca4b4d2031cd", "score": "0.5879509", "text": "function openNav_responsive() {\n options.jq.contentWell.css({\n position : 'absolute',\n top : 0,\n left : 0,\n height : '100%',\n overflow : 'hidden'\n });\n options.jq.navContainer.animate({marginLeft: 0}, animConfig());\n options.jq.contentWell.animate({left: '100%'}, animConfig(function () {\n options.jq.contentWell.hide();\n }));\n setNavState(1);\n }", "title": "" }, { "docid": "db69c93d760e68a230a37eaeba8a3c88", "score": "0.5875369", "text": "function openVerticalArea() {\n verticalMenuObject.addClass('active');\n\n if(verticalLogo.length) {\n verticalLogo.addClass('active');\n }\n\n scrollPosition = $(window).scrollTop();\n }", "title": "" }, { "docid": "ce9c3775987fa7844da6a655db69362e", "score": "0.58750427", "text": "function navbarButtonListenerAction(){\r\n if (!(navButton_MQ.matches)) {\r\n $('.nav-button').attr('clicked','false');\r\n $('.nav-button').css('display','none');\r\n var links=$('.nav-dd .nav-link');\r\n $('.nav-dd').remove();\r\n $('.links-part').append(links);\r\n }else{\r\n $('.nav-button').css('display','inline-block');\r\n var links=$('.links-part .nav-link');\r\n links.remove()\r\n $('.ez-nav-bar').append('<div class=\"nav-dd\"></div>');\r\n $('.nav-dd').css('display','none');\r\n $('.nav-dd').append(links);\r\n var navBarHeight=$('.ez-nav-bar').css(\"height\");\r\n $('.nav-dd').css(\"top\",navBarHeight);\r\n }\r\n }", "title": "" }, { "docid": "e8b63b38007768407130df1a135b3df9", "score": "0.5870477", "text": "function transitionNavbar(){\n if(window.scrollY>100){\n handleShow(true)\n }else{\n handleShow(false)\n }\n }", "title": "" }, { "docid": "7b2f4763324e73f5bec6e56e77dd7b16", "score": "0.5863393", "text": "function navChange() {\n var scrolling = this.pageYOffset;\n var play = document.getElementsByClassName('navCont')[0];\n if (scrolling >= 450) {\n play.style.backgroundColor = \"#111\";\n } else{\n play.style.backgroundColor = \"transparent\";\n }\n}", "title": "" }, { "docid": "36a9ec398dc4d1427cb1757c2a3baaf0", "score": "0.5859436", "text": "function navbar() {\r\n $('.site-header .primary-navigation .toggle-btn').click(function() {\r\n $('body').addClass('openNav');\r\n });\r\n $('.site-header .main-navigation .close-btn').click(function() {\r\n $('body').removeClass('openNav');\r\n });\r\n }", "title": "" }, { "docid": "6646f2b16a69f4781b9ddaf36a116ede", "score": "0.5856012", "text": "function clickOnNav() {\n\t\t//click nav event\n\t\t$('.nav-icon, .left-menu').click(function(){\n\t\t\t//when menu is open\n\t\t\tif ($(this).hasClass('active')) {\n\t\t\t\tcloseSubNav();\n\t\t\t} else {\n\t\t\t//when menu is closed\n\t\t\t\topenSubNav($(this));\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "f746426cc4d30579a0b8f31651cb7b99", "score": "0.5855374", "text": "function activeCursor(e) {\n const item = e.target;\n if (item.id === \"logo\" || item.classList.contains(\"burger\")) {\n mouse.classList.add(\"nav-active\");\n } else {\n mouse.classList.remove(\"nav-active\");\n }\n if (item.classList.contains(\"button\")) {\n mouse.classList.add(\"explore-active\");\n gsap.to(\".title-swipe\", 1, { y: \"0%\" });\n mouseTxt.innerText = \"click\";\n } else {\n mouse.classList.remove(\"explore-active\");\n mouseTxt.innerText = \"\";\n gsap.to(\".title-swipe\", 1, { y: \"100%\" });\n }\n}", "title": "" }, { "docid": "77e96bb5d876be2894ad5769c56e5f17", "score": "0.5849167", "text": "function navActive(){\n let navItem = document.querySelectorAll('li');\n for(let i=0;i<5;i++){\n navItem[i].scrollIntoView({behavior: \"smooth\", block: \"end\", inline: \"nearest\"});\n navItem[i].addEventListener('mouseover',function(e){//to appear or disappear active point\n setTimeout(()=>{\n //to remove active from other\n for(let j=0;j<navItem.length/2;j++){\n if(navItem[j].querySelector('span').className.indexOf('active')!=-1){\n navItem[j].querySelector('span').classList.remove('active');\n }\n }\n if(e.target.querySelector('span')!=null){\n e.target.querySelector('span').classList+=' active';}//to add active point}\n },200);\n \n });\n // to smooth return to top\n navItem[i].addEventListener('click',function(e){\n e.preventDefault();//prevent default to make smooth scroll\n // to go to the specific part which user want to go\n let partName = '#'+e.target.innerHTML.split('<')[0].toLowerCase();//get name of section we want to go \n let sectionName = document.querySelector(''+partName+'');//to go to specific part\n sectionName.scrollIntoView({behavior: \"smooth\", block: \"start\", inline: \"nearest\"});\n });\n }\n}", "title": "" }, { "docid": "5be55c3f0075cce221f0e163c339dff8", "score": "0.5845665", "text": "listenForClick(){\n $('.backHead').on('click', function () {\n $('body, html').animate({\n scrollTop: 0,\n screenLeft: 0\n }, 300);\n $(\".scroll\").css(\"bottom\", \"100%\");\n });\n }", "title": "" }, { "docid": "55ac433898281cad4c351a169db8057e", "score": "0.5845192", "text": "function setup_home() {\n if (is_mobile()) {\n // set up nav bar\n var side_pane = $(\"#home-side-pane\")\n side_pane.hide();\n $(\".hamburger\").click(function() {\n if (side_pane.is(\":visible\")) {\n side_pane.slideUp();\n } else {\n side_pane.slideDown();\n }\n });\n }\n}", "title": "" }, { "docid": "d733a94be6add4270de1164cb8a3b029", "score": "0.5842688", "text": "function hiderevealNavPane() {//\"sideNav object****************************************************onclick\n//Before revealing it from hiding, check if the page is in a scrolled state so \n//We can return it to the floatig-navpane or navpanescroll class accordingly\n\tif(sideNav.className == \"nphidden\") {\n\t \tsideNav.className=\"floating-navpane\";\n\t \t//document.getElementsByClassName(\"floating-navpane\")[0].style.top = \n\t\t//headDiv.offsetHeight + \"px\"; //THIS IS BOUND TO CHANGE TO A MORE DYNAMIC FUNCTION\n \t}\n\telse if(sideNav.className == \"floating-navpane\") {\n\t\tsideNav.className = \"nphidden\";\n\t}\n}", "title": "" }, { "docid": "c01cc4a35e250587252ca9432bac8086", "score": "0.5829441", "text": "handleNavClicks() {\n if (hasEl(`#${this.playlistNavPrev.id}`)) {\n this.playlistNavPrev.addEventListener('click', (e) => {\n e.preventDefault()\n this.prev()\n })\n }\n if (hasEl(`#${this.playlistNavNext.id}`)) {\n this.playlistNavNext.addEventListener('click', (e) => {\n e.preventDefault()\n this.next()\n })\n }\n }", "title": "" }, { "docid": "283a67e0fd7d1c6c0299d99236c5fafe", "score": "0.58235335", "text": "function openNav() {\n document.getElementById(\"myNav\").style.width = \"100%\";\n game_state = \"paused\";\n overlay_state = \"open\";\n\tLEO_debris_generation_rate = 0;\n\tMEO_debris_generation_rate = 0;\n\tGEO_debris_generation_rate = 0;\n}", "title": "" }, { "docid": "c24980acc0fa5834344a19ccf6425556", "score": "0.58218", "text": "function navClick(navId) {\n navId = navId ? navId.toLowerCase() : 'home';\n const section = document.getElementById(navId);\n scrollTo(document.body, section.offsetTop, 500);\n}", "title": "" }, { "docid": "25fe6713496a77113d62fb82e2b1d25a", "score": "0.58213645", "text": "function selection() {\n let tags = [\"#navAbout\", \"#navExperience\", \"#navContact\"];\n let current = findView();\n // If the desktop site is displayed\n /* if (desktopSite()) {\n // If about back is visable, play animation\n if (current == \"#navAbout\") {\n aboutAnimation();\n }\n // Disable snap scroll for experience\n if (current == \"#navExperience\") {\n $(\"body\").css(\"scroll-snap-type\", \"y proximity\");\n $(\"html\").css(\"scroll-snap-type\", \"y proximity\");\n } else if (current != \"none\") {\n $(\"body\").css(\"scroll-snap-type\", \"both mandatory\");\n $(\"html\").css(\"scroll-snap-type\", \"both mandatory\");\n }\n } else {\n $(\"body\").css(\"scroll-snap-type\", \"none\");\n $(\"html\").css(\"scroll-snap-type\", \"none\");\n } */\n // Change the nav bar for current slide\n if (current != \"none\") {\n for (i in tags) {\n if (tags[i] != current) {\n $(tags[i])\n .removeClass(\"selected\")\n .addClass(\"unselected\");\n } else {\n $(tags[i])\n .removeClass(\"unselected\")\n .addClass(\"selected\");\n }\n }\n }\n}", "title": "" }, { "docid": "f04cd7be09c1aca608fce92f3863c0ba", "score": "0.5819672", "text": "function openNav(){\n mySideNav.style.height=\"0vh\";\n\n\n}", "title": "" }, { "docid": "264f5cdef93fc56336760df5292ee71a", "score": "0.5817271", "text": "function goSwitch(e) {\n smoothScrollTo(spacing, 400);\n if (e.target.id == \"links1\") {\n aboutContent.classList.remove(\"hidden\");\n aboutContent.classList.add(\"fadeIn\", \"items\");\n philosophyContent.classList.add(\"hidden\");\n teamContent.classList.add(\"hidden\");\n\n //document.querySelector(\"#about-wrapper\").style.backgroundImage = \"url('http://i31.photobucket.com/albums/c355/zHiME/MSYG%20TEMP/about-us-bg-v2-1.jpg~original')\";\n }\n }", "title": "" }, { "docid": "3482fb7e22b8559ffbe1625ed3291949", "score": "0.5815291", "text": "function goToAbout(){\r\n document.getElementById('overflow').scrollIntoView({behavior:\"smooth\"}) /*fazer scroll into view??*/\r\n theToggle.classList.remove(\"on\");\r\n document.body.style.overflow = '';\r\n [ 'toggle', 'menu'].forEach(function( id ) {\r\n\r\n document.getElementById( id ).style.transition= 'all .5s';\r\n \r\n });\r\n}", "title": "" }, { "docid": "6d04233bbb0006feb2f541acace4e508", "score": "0.58146596", "text": "function setScroll(){\n window.addEventListener(\"scroll\", ()=> {\n \n for (let i=0; i<navElements.length; ++i){\n let elementScroll = document.getElementById('section'+(i+1));\n let buttonNav = document.getElementById(\"section_nav\"+(i+1));\n if (isScrolledIntoView(elementScroll) ){\n elementScroll.classList.add(\"active\");\n buttonNav.style.background = \"orange\";\n \n }\n else{\n elementScroll.classList.remove(\"active\");\n buttonNav.style.background = \"white\";\n }\n \n }\n });\n}", "title": "" }, { "docid": "fec1861214d0f9495e75bd857021d778", "score": "0.58122534", "text": "function homeHandler(event)\n\t\t{\n\t\t\tg.reinit();\n\t\t\thideButtons(this);\n\t\t}", "title": "" }, { "docid": "5c36b13179876b9a246f2194c763fc7b", "score": "0.581184", "text": "function navBar(){\n\t\t$('.nav-button').click(function(){\n\t\t\t$('.nav-content').toggleClass('nav-hide');\n\t\t});\t\n\t}", "title": "" }, { "docid": "6da80eca2e0742e391f94463b8fc06c5", "score": "0.5811193", "text": "function changementAuto() {\n\t\t if(changement){\n\t\t $.fn.fullpage.moveSectionDown();\n\t\t }\n\t}", "title": "" }, { "docid": "772a10752e7d381d817628a2173c5744", "score": "0.58090556", "text": "function toggleView(focus) {\r\n // Only perform these actions when in \"Home\" view. \r\n if (Util.isHome) {\r\n\t\r\n // Save off the focus for later reference\r\n currentFocusContainer = focus;\r\n // Switch visible column\r\n var box = document.getElementById('scrollableArea'); \r\n box.style.marginLeft = ( focus == 'location' ) ? '-100%' : '0%';\r\n }\r\n \r\n }", "title": "" }, { "docid": "faebd7809a78d4544e9babf6d1e3107d", "score": "0.5808098", "text": "function navigate(){\n\twidth = $(window).width();\n\t$(\"#header-wrap .sidebar\").css({\n\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\topacity: \"0\"\n\t});\n\t$(\"#header-wrap .browseMenu\").css({\n\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\topacity: \"0\"\n\t});\n\n\t$(\"#header-wrap .navigat\").click(function() {\n\t\t$(\"#header-wrap .sidebar\").css({\n\t\t\ttransform: \"translateX(-8px)\",\n\t\t\topacity: \"1\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#header-wrap .browseMenu\").css({\n\t\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\t\topacity: \"0\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#content-wrap .container-fluid a\").css({\n\t\t\tpointerEvents: \"none\",\n\t\t\tcursor: \"default\",\n\t\t});\n\t\t// $(\"#content-wrap .container-fluid\").css({\n\t\t// \tposition: \"relative\",\n\t\t// \tzIndex: \"111\",\n\t\t// \tbackgroundColor: \"gray\",\n\t\t// \topacity: \"0.8\",\n\t\t// \ttransition: \"all 0.4s ease\"\n\t\t// });\n\t});\n\t$(\"#header-wrap .sidebar .buttonBrowse\").click(function() {\n\t\t$(\"#header-wrap .sidebar\").css({\n\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\topacity: \"0\",\n\t\ttransition: \"all 0.4s ease\"\n\t});\n\t\t$(\"#header-wrap .browseMenu\").css({\n\t\t\ttransform: \"translateX(0)\",\n\t\t\topacity: \"1\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t});\n\t$(\"#header-wrap .browseMenu div\").click(function() {\n\t\t$(\"#header-wrap .sidebar\").css({\n\t\t\ttransform: \"translateX(-8px)\",\n\t\t\topacity: \"1\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#header-wrap .browseMenu\").css({\n\t\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\t\topacity: \"0\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t});\n\n\t$(\"#content-wrap .container1\").click(function() {\n\t\t$(\"#header-wrap .sidebar\").css({\n\t\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\t\topacity: \"0\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#header-wrap .browseMenu\").css({\n\t\t\ttransform: \"translateX(-\"+width+\"px)\",\n\t\t\topacity: \"0\",\n\t\t\ttransition: \"all 0.4s ease\"\n\t\t});\n\t\t$(\"#content-wrap .container-fluid a\").css({\n\t\t\tpointerEvents: \"\",\n\t\t\tcursor: \"\"\n\t\t});\n\t\t// $(\"#content-wrap .container-fluid\").css({\n\t\t// \tbackgroundColor: \"\",\n\t\t// \topacity: \"\",\n\t\t// \ttransition: \"\",\n\t\t// \ttransition: \"all 0.4s ease\"\n\t\t// });\n\t});\n\n\n\t//olculerin beraberlesmesu ucun\n\tfunction widthSideBar(){\n\t\tif($(window).width() > 620){\n\t\t\twindowWidth = $(window).width() - 230;\n\t\t\t$(\"#header-wrap .sidebar\").width(windowWidth);\n\t\t\t$(\"#header-wrap .browseMenu\").width(windowWidth);\n\t\t\t$(window).resize(function() {\n\t\t\t\twindowWidth = $(window).width() - 230;\n\t\t\t\t$(\"#header-wrap .browseMenu\").width(windowWidth);\n\t\t\t\t$(\"#header-wrap .sidebar\").width(windowWidth);\n\t\t\t});\n\t\t}\n\t\tif($(window).width() < 620){\n\t\t\twindowWidth = $(window).width() - 100;\n\t\t\t$(\"#header-wrap .sidebar\").width(windowWidth);\n\t\t\t$(\"#header-wrap .browseMenu\").width(windowWidth);\n\t\t\t$(window).resize(function() {\n\t\t\t\twindowWidth = $(window).width() - 100;\n\t\t\t\t$(\"#header-wrap .browseMenu\").width(windowWidth);\n\t\t\t\t$(\"#header-wrap .sidebar\").width(windowWidth);\n\t\t\t});\n\t\t}\n\t}\n\twidthSideBar();\n\n\t//menunun uzunlugunun ekranin uzunlugu ile uygunlasmasi ucun\n\tfunction heightSideBar(){\n\t\theight = $(window).height();\n\t\t$(\"#header-wrap .sidebar\").height(height);\n\t\t$(\"#header-wrap .browseMenu\").height(height);\n\t}\n\theightSideBar();\n}", "title": "" }, { "docid": "e8307aa0cb9f3aed7312ee2ff51c36dc", "score": "0.58066946", "text": "function toggleNav(e) {\n var n = document.getElementById(\"nav\");\n b.classList.toggle(\"nav-open\");\n nb.classList.toggle(\"open\");\n b.classList.remove(\"scroll-down\");\n e.preventDefault();\n e.stopPropagation();\n}", "title": "" }, { "docid": "92288f67b542cd97047ba38c2a609b4e", "score": "0.5803757", "text": "function onClickHandlerAniversary(e) {\n\tif(e.target){\n\t\tvar navTo=false;\n\t\tvar navTarget;\n\t\tif(e.target.nodeName == \"A\")\n\t\t{\n\t\t\t$('#sec_aniversary').unbind('scroll', switchYears );\n\t\t\tvar actualSelected = document.querySelector(\"#menu_years>.selected\");\n\t\t\tif (!Modernizr.csstransitions)\n\t\t\t{\n\t\t\t\t$(actualSelected).stop(true,false).animate({fontSize:'20px', width:'77px'},200,\"easeInOutQuart\").removeClass('selected');\n\t\t\t\t$(e.target.parentNode).stop(true,false).animate({fontSize:'60px', width:'140px'},200,\"easeInOutQuart\").addClass('selected');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tactualSelected.className=\"\";\n\t\t\t\te.target.parentNode.className=\"selected\";\n\t\t\t}\n\n\t\t\t// scrolling to target section/article\n\t\t\tvar patt1=new RegExp(\"([0-9]*)$\");\n\t\t\tvar sel=document.querySelector(\"#year\"+patt1.exec(e.target.parentNode.id)[0]);\n\t\t\t$(\"#sec_aniversary\").scrollTo(sel.offsetTop+'px',1500,{easing:'easeInOutQuart',onAfter:function(){$('#sec_aniversary').bind('scroll', switchYears );}});\n\t\t}\n\t\telse if(e.target.nodeName == \"IMG\" && e.target.className == \"photo_link\")\n\t\t{\n\t\t\tvar ruta = e.target.src;\n\t\t\truta = ruta.replace('img/fotos','img/hi_res');\n\t\t\t$('#outer_container #close').hide();\n\t\t\t$('#outer_container #preload').fadeIn();\n\t\t\t$('#pane_wrapper').fadeIn(1000,function(){ load_image(ruta); });\n\t\t}\n\t};\n}", "title": "" }, { "docid": "338855689a58a0333342bf77341eb7d6", "score": "0.579975", "text": "function trigger_hplugin_event(evt){\n\tjQuery('.hero_viewport').trigger(evt);\n}", "title": "" }, { "docid": "37ab1909f85df75f473b83d5a168f9a5", "score": "0.5798099", "text": "function mainNavigation() {\r\n $(\".hamb-menu\").off(\"click\");\r\n // $(\"#nav-main-mobile button\").off(\"click\");\r\n // $(\"#nav-main li\").off(\"mouseover\");\r\n // $(\"#nav-main li\").off(\"mouseleave\");\r\n // $_window.off('scroll.mainScroll');\r\n var tl = new TimelineMax({\r\n paused: !0\r\n }),\r\n speed = .2,\r\n $hambMenu = $(\".hamb-menu\"),\r\n $hambMenuTop = $(\".hamb-menu\").find(\".top\"),\r\n $hambMenuMiddle = $(\".hamb-menu\").find(\".middle\"),\r\n $hambMenuBottom = $(\".hamb-menu\").find(\".bottom\");\r\n tl.to($hambMenuTop, speed, {\r\n y: 6\r\n }).to($hambMenuBottom, speed, {\r\n y: -8\r\n }, \"-=.2\").to($hambMenu, speed, {\r\n rotation: 180,\r\n transformOrigin: \"center center\"\r\n }, .3).to($hambMenuMiddle, speed, {\r\n opacity: 0\r\n }, .3).to($hambMenuTop, speed, {\r\n rotation: 45,\r\n transformOrigin: \"center center\"\r\n }, .4).to($hambMenuBottom, speed, {\r\n rotation: -45,\r\n transformOrigin: \"center center\"\r\n }, .4), $(\".hamb-menu\").on(\"click\", function() {\r\n var $navMobile = $(\"#nav-main-mobile\");\r\n window.pageYOffset;\r\n $(\"#header-main\").toggleClass(\"opened\"), window.viewportUnitsBuggyfill.refresh(), TweenMax.set($navMobile.find(\".pressAnime\"), {\r\n opacity: 0,\r\n y: 40\r\n }), $_body.toggleClass(\"js-nav-mobile\"), $_body.hasClass(\"js-nav-mobile\") ? (tl.play(), TweenMax.to($navMobile, .1, {\r\n autoAlpha: 1\r\n }), TweenMax.staggerTo($navMobile.find(\".pressAnime\"), .8, {\r\n opacity: 1,\r\n y: 0,\r\n ease: Power2.easeOut\r\n }, .1), disableScroll()) : (enableScroll(), tl.reverse(), TweenMax.to($navMobile, .1, {\r\n autoAlpha: 0\r\n }), TweenMax.to($navMobile.find(\".pressAnime\"), 1, {\r\n opacity: 0,\r\n y: 40\r\n }))\r\n })\r\n}", "title": "" }, { "docid": "7dfe5a7d9743508507def8ab729a4a5b", "score": "0.5795776", "text": "function openNav(d) {\n d && d.preventDefault();\n var b = document.getElementById(\"aarp-c-offscreen-nav-id\");\n var a = document.getElementsByClassName(\"aarp-c-header__menu-icon-link\")[0];\n var c = document.getElementById(\"aarp-c-body\");\n var f = b.querySelector(\"button, [href], input, select, textarea, [tabindex]\");\n if (b.offsetWidth > 0) {\n b.classList.remove(\"aarp-c-offscreen-nav__width\");\n b.setAttribute(\"aria-hidden\", \"true\");\n a.setAttribute(\"aria-label\", \"Press Space or Enter to open the AARP Menu\");\n a.focus();\n c.classList.remove(\"aarp-c-offscreen-nav__open\")\n } else {\n b.hidden = false;\n b.classList.add(\"aarp-c-offscreen-nav__width\");\n b.setAttribute(\"aria-hidden\", \"false\");\n a.setAttribute(\"aria-label\", \"Press Space or Enter to close the AARP Menu\");\n c.classList.add(\"aarp-c-offscreen-nav__open\");\n setTimeout(function () {\n f && f.focus()\n }, 500)\n }\n}", "title": "" }, { "docid": "0586deaa05546b9132a52dd4a7380fbb", "score": "0.579556", "text": "clickHandler() {\r\n // remove active from all links\r\n const links = Array.from(this.element.closest('nav').querySelectorAll('a'));\r\n links.forEach(e => e.classList.remove('active'));\r\n // add active to current root link\r\n const parentNavGroup = this.element.closest('dxp-nav-group');\r\n parentNavGroup.removeAttribute('is-active');\r\n parentNavGroup.querySelector('.nav-level-one-link').classList.add('active');\r\n // add active to current link\r\n this.element.querySelector('.mega-menu-link').classList.add('active');\r\n }", "title": "" }, { "docid": "0a09b7ff7ab5d8bccbf0e4d53ff4755b", "score": "0.5789717", "text": "function stikyNav() {\n\n top = allWindow.scrollTop();\n\n if ( top >= 100 ) {\n navBar.addClass(\"nav-sticky\");\n\n } else {\n navBar.removeClass(\"nav-sticky\");\n }\n\n // SHow Also Scroll up Button\n if ( top >= 1000 ) {\n $('.scroll-up').addClass(\"show-up-btn\");\n } else {\n $('.scroll-up').removeClass(\"show-up-btn\");\n }\n }", "title": "" }, { "docid": "046aad2e6b3c64b807edfddd1edc6a6e", "score": "0.57865185", "text": "onToggleNavigationPane() {\n this._togglePageScrollability();\n this._toggleNavigationPane();\n }", "title": "" }, { "docid": "36f87f1f1e2d4df6bef8ad41aadeac20", "score": "0.5784924", "text": "onClickUnderlay_() {\n this.portraitToggleScene(false, true);\n }", "title": "" }, { "docid": "f9ad287ab48935223b69ea4220a9e482", "score": "0.5784679", "text": "function initHit() {\n var nav = $('.slider-navigation .prev-arrow-slide');\n var nav2 = $('.slider-navigation .next-arrow-slide');\n $(document).ready(function () {\n location.hash = '#0';\n nav.wrap('<a class=\"goto-website\" href=\"http://www.hermes.com/index_fr.html\">');\n nav2.wrap('<a class=\"goto-next\" href=\"#' + 1 + '\">');\n\n slickWrapper.slickElement.on('afterChange', function (event, slick, currentSlide) {\n\n if (currentSlide == 0) {\n $('.goto-website').attr('href', 'http://www.hermes.com/index_fr.html');\n }\n else if ($('.goto-website').length > 0 && currentSlide > 0 && currentSlide < 12) {\n $('.goto-website').attr('href', '#' + (currentSlide - 1));\n $('.goto-next').attr('href', '#' + (currentSlide));\n }\n });\n });\n }", "title": "" }, { "docid": "93482c9aa6cfffa95d32756c0c5c6deb", "score": "0.57841164", "text": "function openNav() {\n\tvar overlay = document.getElementById(\"settings-overlay-container\");\n\toverlay.classList.add(\"overlay-animation\");\n\tvar purple_elem = document.getElementById('account_overridden');\n\tvar header = document.getElementById('kt_header');\n\tvar height = 0;\n\tif (typeof(purple_elem) != 'undefined' && purple_elem != null){\n\t\theight = purple_elem.offsetHeight;\n\t}\n\tif (typeof(header) != 'undefined' && header != null){\n\t\theight = height + header.offsetHeight;\n\t}\n\tdocument.getElementById(\"settings-overlay-container\").style.top = height+'px';\n\n}", "title": "" }, { "docid": "0fabb99cbff6c73f504f25adb1bb963b", "score": "0.57827115", "text": "function aboutClick(){\n\n var div = $(\"#about\");\n target_offset = div.offset();\n target_top = target_offset.top +50;\n\n $('html, body').animate({scrollTop:target_top}, 500);\n var ul = $(\"#ulNav\");\n ul.children().removeClass('highlightNav');\n $('#aboutNav').addClass('highlightNav');\n}", "title": "" }, { "docid": "326c9026e3dab8913c94057b92112504", "score": "0.5778015", "text": "function scrolEventListener(){ \n if(document.scrollingElement.scrollTop === 0){\n btn.classList.remove('show'); \n } \n allSections.forEach( (sec)=>{\n const rct = sec.getBoundingClientRect();\n \n if(rct.top >= -100 && rct.top <= 200){ \n allSections.forEach( (rem)=> {\n rem.style.background = \"\"; \n });\n sec.style.background = \"#337ab7\";\n \n allLinks.forEach((l)=>{\n if(l.id !=='button'){\n l.style.background=\"#337ab7\";\n }\n });\n allLinks.forEach((alink)=>{\n if(sec.getAttribute('data-nav')==alink.textContent){\n alink.style.background = \"blue\";\n }\n }); \n\n // show btn Back to top while scrolling \n btn.classList.add('show');\n }\n }); \n }", "title": "" }, { "docid": "1e1641911ff2bf4812a4b0828b02b45f", "score": "0.5777029", "text": "function bigNav() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $offset = nectarDOMInfo.scrollTop,\r\n\t\t\t\t\t$windowWidth = nectarDOMInfo.winW,\r\n\t\t\t\t\t$scrollTriggerOffset = ($body.is('.material')) ? 150 : 30;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($body.is('.material-ocm-open')) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($offset <= $scrollTriggerOffset && $windowWidth > 1000 || $('.small-nav').length > 0 && $('#ajax-content-wrap.no-scroll').length > 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#header-outer, #search-outer').removeClass('small-nav');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('#header-outer[data-megamenu-rt=\"1\"]').length > 0 && \r\n\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"]').length > 0 && \r\n\t\t\t\t\t\t$('#header-outer .megamenu').length > 0) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($headerOuterEl.attr('data-transparent-header') == 'true' && \r\n\t\t\t\t\t\t\t$('.nectar-box-roll').length == 0 && \r\n\t\t\t\t\t\t\t$('.megamenu.sfHover').length == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$headerOuterEl.addClass('transparent');\r\n\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('no-transition');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($headerOuterEl.attr('data-transparent-header') == 'true' && $('.nectar-box-roll').length == 0) {\r\n\t\t\t\t\t\t\t\t$headerOuterEl.addClass('transparent');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Body border full width side padding\r\n\t\t\t\t\t\tif ($('#header-outer[data-full-width=\"true\"][data-transparent-header=\"true\"]').length > 0 && \r\n\t\t\t\t\t\t$bodyBorderTop.length > 0 && \r\n\t\t\t\t\t\t$bodyBorderHeaderColorMatch == true) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('#header-outer[data-full-width=\"true\"] header > .container').stop(true, true).animate({\r\n\t\t\t\t\t\t\t\t'padding': '0 28px'\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tqueue: false,\r\n\t\t\t\t\t\t\t\tduration: 250,\r\n\t\t\t\t\t\t\t\teasing: 'easeOutCubic'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('body.material').length > 0) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('header#top nav > ul > li.menu-item-with-margin').stop(true, true).animate({\r\n\t\t\t\t\t\t\t\t'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) + parseInt(logoShrinkNum) * 3) + 'px'\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tqueue: false,\r\n\t\t\t\t\t\t\t\tduration: 140,\r\n\t\t\t\t\t\t\t\teasing: 'easeOutQuad'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Secondary header\r\n\t\t\t\t\t\tif ($headerSecondaryEl.length > 0) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$headerSecondaryEl.removeClass('hide-up');\r\n\t\t\t\t\t\t\t$headerOuterEl\r\n\t\t\t\t\t\t\t\t.removeClass('hide-up')\r\n\t\t\t\t\t\t\t\t.css('transform', 'translateY(0%)');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Box roll\r\n\t\t\t\t\t\tif ($('.nectar-box-roll').length > 0 && $('#header-outer[data-permanent-transparent=\"1\"]').length == 0) {\r\n\t\t\t\t\t\t\t$('#ajax-content-wrap').animate({\r\n\t\t\t\t\t\t\t\t'margin-top': (Math.floor(($logoHeight) + (headerPadding * 2) + nectarDOMInfo.adminBarHeight + nectarDOMInfo.secondaryHeaderHeight))\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tqueue: false,\r\n\t\t\t\t\t\t\t\tduration: 250,\r\n\t\t\t\t\t\t\t\teasing: 'easeOutCubic'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$window.off('scroll.headerResizeEffect', bigNav);\r\n\t\t\t\t\t\t$window.on('scroll.headerResizeEffect', smallNav);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Dark slider coloring border\r\n\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"]').css('transition', 'transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, margin 0.25s ease-out');\r\n\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"] .cart-menu').css('transition', 'none');\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"]').css('transition', 'transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, border-color 0.30s ease, margin 0.25s ease-out');\r\n\t\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"] .cart-menu').css('transition', 'border-color 0.30s ease');\r\n\t\t\t\t\t\t}, 300);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "title": "" }, { "docid": "07fe65696b62d0571deb794235929cc6", "score": "0.5776163", "text": "function focusOnScroll() {\n sections.forEach(section => section.classList.remove('section-active'));\n if (isElementInViewport(heading)) {\n navList.childNodes[0].classList.add('nav-active');\n navList.childNodes.forEach((navLink, index) =>\n index && navLink.classList.remove('nav-active'));\n } else {\n const actIndex = sections.findIndex(section => isElementInViewport(section.childNodes[1].childNodes[1]));\n const actSection = sections[actIndex];\n const actLink = navList.childNodes[actIndex + 1];\n actSection && actSection.classList.add('section-active');\n actLink && actLink.classList.add('nav-active');\n navList.childNodes.forEach((navLink, index) =>\n index !== (actIndex + 1) && navLink.classList.remove('nav-active'));\n }\n}", "title": "" }, { "docid": "f6358216b587596ec4de74a6df195230", "score": "0.5775706", "text": "function onScroll(event) {\n if ($('.mobileWrapp').width() < 639) {\n // console.log('asd')\n var scrollPos = $(document).scrollTop() + 65\n } else {\n // console.log('qwe')\n var scrollPos = $(document).scrollTop() + 68\n }\n $('ul.nav-script li a.ancor').each(function() {\n var currLink = $(this)\n var refElement = $(currLink.attr('href'))\n if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {\n $('ul.nav-script li a.ancor').removeClass('active')\n currLink.addClass('active')\n } else {\n currLink.removeClass('active')\n }\n })\n}", "title": "" }, { "docid": "17083be743c3f6d8f317cba13d4aa379", "score": "0.577335", "text": "function togle_nav_func() {\r\n const elem = document.getElementById('togle_nav');\r\n if (elem.currentStyle) {\r\n displayStyle = elem.currentStyle.display;\r\n } else if (window.getComputedStyle) {\r\n displayStyle = window.getComputedStyle(elem, null).getPropertyValue('display');\r\n }\r\n if (displayStyle === 'block') {\r\n elem.style.display = 'none';\r\n } else {\r\n elem.style.display = 'block';\r\n }\r\n}", "title": "" }, { "docid": "e49a4ed321430ae75dded03711cf89af", "score": "0.57699436", "text": "function onOverviewSlideClicked(event) {\n\n // TODO There's a bug here where the event listeners are not\n // removed after deactivating the overview.\n if (eventsAreBound && isOverview()) {\n event.preventDefault();\n\n var element = event.target;\n\n while (element && !element.nodeName.match(/section/gi)) {\n element = element.parentNode;\n }\n\n if (element && !element.classList.contains('disabled')) {\n\n deactivateOverview();\n\n if (element.nodeName.match(/section/gi)) {\n var h = parseInt(element.getAttribute('data-index-h'), 10),\n v = parseInt(element.getAttribute('data-index-v'), 10);\n\n slide(h, v);\n }\n\n }\n }\n\n }", "title": "" }, { "docid": "a26532960724f70eedd79057312f198d", "score": "0.5767336", "text": "onActivate(e) {}", "title": "" }, { "docid": "378be069ff32056eaaa409e5bcfe7299", "score": "0.57646406", "text": "function set_on_scrolling_scene(){\n function onMouseWheel(event) {\n // check FoV range\n if (TOPPANO.gv.cam.camera.fov <= TOPPANO.gv.para.fov.max\n && TOPPANO.gv.cam.camera.fov >= TOPPANO.gv.para.fov.min) {\n // WebKit (Safari / Chrome)\n if (event.wheelDeltaY) {\n TOPPANO.gv.cam.camera.fov -= event.wheelDeltaY * 0.05;\n }\n // Opera / IE 9\n else if (event.wheelDelta) {\n TOPPANO.gv.cam.camera.fov -= event.wheelDelta * 0.05;\n }\n // Firefox\n else if (event.detail) {\n TOPPANO.gv.cam.camera.fov += event.detail * 1.0;\n }\n }\n\n if (TOPPANO.gv.cam.camera.fov > TOPPANO.gv.para.fov.max) {\n TOPPANO.gv.cam.camera.fov = TOPPANO.gv.para.fov.max;\n }\n if (TOPPANO.gv.cam.camera.fov < TOPPANO.gv.para.fov.min) {\n TOPPANO.gv.cam.camera.fov = TOPPANO.gv.para.fov.min;\n }\n\n TOPPANO.gv.cam.camera.updateProjectionMatrix();\n // update URL after scroll stops for 0.1 second\n if (TOPPANO.gv.interact.timer !== null) {\n clearTimeout(TOPPANO.gv.interact.timer);\n }\n }\n\n let container = document.getElementById('container');\n // for IE & chrome\n container.addEventListener('mousewheel', onMouseWheel);\n // for firefox\n container.addEventListener('DOMMouseScroll', onMouseWheel);\n}", "title": "" }, { "docid": "d7cbfe38117a1811462e6301dcecc5f9", "score": "0.57598066", "text": "function onNavExitListener(e){\n if(!$(e.target).is(\".navCollapse\")\n&& !$(e.target).is(\"#cog\")){\n if($(\".navCollapse\").css(\"display\")===\"block\"){\n $(\".navCollapse\").hide('fold',function(){\n $(\"#cog\").removeClass(\"spin\");\n })\n }\n }else if($(e.target).is(\".nMobile\")){\n if($(\".navCollapse\").css(\"display\")===\"block\"){\n $(\".navCollapse\").hide('fold',function(){\n $(\"#cog\").removeClass(\"spin\");\n });\n }\n }\n}", "title": "" }, { "docid": "548cda8b9baf65d09cd7fdab8f4e0415", "score": "0.57571965", "text": "function handleNavScroll() {\n const navHeight = nav.getBoundingClientRect().bottom;\n if (window.scrollY > navHeight) {\n nav.classList.add('light-color');\n } else {\n nav.classList.remove('light-color');\n }\n}", "title": "" }, { "docid": "9e39532d009a2da9fbd7dcf386f18ec7", "score": "0.5752987", "text": "toggleNav() {\n if ($(\"#offcanvas-menu-react\").hasClass(\"navslide-show\")) {\n $(\"#offcanvas-menu-react\").removeClass(\"navslide-show\").addClass(\"navslide-hide\")\n $(\".navbar\").removeClass(\"navslide-show\").addClass(\"navslide-hide\")\n $(\".nav-canvas\").removeClass(\"navslide-show\").addClass(\"navslide-hide\")\n }\n else {\n $(\".nav-canvas\").css(\"position\", \"relative\")\n $(\"#offcanvas-menu-react\").removeClass(\"navslide-hide\").addClass(\"navslide-show\")\n $(\".navbar\").removeClass(\"navslide-hide\").addClass(\"navslide-show\")\n $(\".nav-canvas\").removeClass(\"navslide-hide\").addClass(\"navslide-show\")\n }\n }", "title": "" }, { "docid": "552dd4c00c098a7f6174cdd7c3c2cf1f", "score": "0.5752242", "text": "function navigasjonsmeny() {\n $('.trestripeknapp').click(function() {\n menyFram();\n })\n}", "title": "" }, { "docid": "522c5aa9be503468f208f8d20c0d81e0", "score": "0.5749052", "text": "function openNav() {\n $('#nav-list li').removeClass('treelisthidden');\n storage.setItem(treesettings, '1');\n $('#sideNavigation').css('display', 'block');\n\n $('#sideNavigation').css('width', '300px');\n $('body.support_kb').find('.cover').css('display', 'none');\n $('body.support_kb').find('#sidefoot').css({\n 'width': '300px',\n 'margin-left': ''\n });\n $('#sidefoot').css('display', 'block');\n $('.footer-inner').css('padding-left', '300px');\n $('body').find('main').css('width', 'calc(100% - 100px)');\n $('body.support_kb').find('#sideNavigation').css('margin-left', '0');\n $('body').find('main').css('width', 'calc(100% - 350px)');\n\n (function() {\n try {\n $('#sideNavigation').resizable(\"enable\");\n } catch (err) {\n setTimeout(arguments.callee, 200)\n }\n })();\n\n $('#side-toggle').attr('class', 'fa fa-angle-double-left');\n\n }", "title": "" }, { "docid": "28210c4fe2fb25216fef6b7e4c57fd70", "score": "0.5747599", "text": "function onLinkClick() {\n navbar.addEventListener('click', function (event) {\n const moveTo = document.querySelector('#' + event.target.dataset.nav);\n moveTo.scrollIntoView({ behavior: \"smooth\" });\n console.log('#' + event.target.dataset.nav);\n })\n}", "title": "" } ]
b3d9c5fc11d18cfdfbf2051d0a599104
will create a post component for each element in the json array(which is placed into posts)
[ { "docid": "acee4b9431f0dca443af72cadec71077", "score": "0.6181503", "text": "render() {\n\t return (\n\t \t<div className=\"content-container\">\n\t \t{\n\t \t this.state.posts.map ((item, value) => (\n\t \t \t<PostItem key={item.contentId} contentType={item.contentType} \n\t \t \timgUrls={item.thumbnails[1].url} headline={item.metadata.headline}/>\n\t \t ))\n\t \t}\t \n\t </div>\n\t );\n\t}", "title": "" } ]
[ { "docid": "03f5ba7b7bd073043db799b46a56c533", "score": "0.7083233", "text": "generatePosts(){\n const feedPosts = [];\n\n for(var i = 0; i < this.state.posts.length; i++) {\n feedPosts.push(\n <Post userName={this.state.posts[i].userName} postText={this.state.posts[i].postText} />\n );\n }\n\n return(\n feedPosts\n );\n }", "title": "" }, { "docid": "d3685e744e7db38e7b36969b8f8e7250", "score": "0.7056435", "text": "function displayPosts(stringPosts) {\n var jsonPosts = JSON.parse(stringPosts);\n var posts = [];\n jsonPosts.forEach(function (jsonPost) {\n var post = new BlogPost();\n post.fillFromJSON(jsonPost);\n posts.push(post);\n });\n posts.forEach(function (post) {\n var htmlPost = \"<div class=\\\"col-md-4\\\">\" +\n post.getHtml() +\n \"</div>\";\n $(\"#posts\")\n .append(htmlPost);\n });\n}", "title": "" }, { "docid": "470bcff7867ecb5be9f8d2bfef519c7b", "score": "0.6980701", "text": "function makePosts(num) {\n const arr = [];\n for (var i = 0; i < num; i++){\n arr.push({ id: i, userId: i, title: `title${i}`, body: `body${i}`});\n }\n return arr;\n }", "title": "" }, { "docid": "19d3a43362d11ed34fb4da554b8713d9", "score": "0.6946671", "text": "function populatePosts (array) {\n // console.log(array);\n let data = [];\n // create an array of objects of elements to append later\n array.forEach(function (object) {\n data.push({\n data: object.data.title,\n element: 'h1'\n });\n\n if (object.data.url.includes('jpg')) {\n // console.log(data);\n data.push({\n data: object.data.preview.images[0].source.url,\n element: 'img'\n });\n } else {\n data.push({\n data: 'no image',\n element: 'div'\n })\n }\n // console.log(data);\n // append posts to dom\n createAndAppendElements(data, object.data.permalink);\n data = [];\n });\n}", "title": "" }, { "docid": "63954b9733cded441a9008bd3c597680", "score": "0.69400275", "text": "function create_posts(post_json)\n{\n var parsed_json = JSON.parse(post_json);\n var html_string = '';\n $.each(parsed_json, function (jsonkey, jsonval) {\n html_string += '<ul class=\"thread accordion\" data-accordion data-allow-all-closed=\"true\">';\n html_string += '<li class=\"accordion-item\" data-accordion-item>';\n html_string += '<a href=\"#\" class=\"accordion-title\"><span class=\"stat post_score\">-</span> points <div class=\"post_title\"></div></a>';\n html_string += '<div class=\"accordion-content post_details\" data-tab-content></div>';\n html_string += '</li></ul>';\n });\n\n $('#thread').html(html_string);\n\n return parsed_json;\n}", "title": "" }, { "docid": "51045288654e97c8aa6671d42d934ae2", "score": "0.6830416", "text": "function renderPosts(posts) {\n //delete\n \n let divchild = document.createElement(\"div\");\n let article = document.createElement(\"p\");\n let title = document.createElement(\"h2\");\n \n divchild.setAttribute(\"class\", \"post\");\n\n title.appendChild(document.createTextNode(posts[0].title));\n \n article.appendChild(document.createTextNode(posts[0].body))\n \n divchild.appendChild(title)\n divchild.appendChild(article)\n \n divContenedorPost.appendChild(divchild);\n\n \n}", "title": "" }, { "docid": "78605c92141f3492a4476f20a499652f", "score": "0.6772332", "text": "function posts(arr) {\n let postApi = arr.filter((el) => el.userId == id);\n postApi.forEach(element => {\n fragmentPost.appendChild(renderPosts(element));\n });\n elPostListWrapper.appendChild(fragmentPost)\n }", "title": "" }, { "docid": "60f85376d5ecf8356ca240cc0a3ddf81", "score": "0.67201483", "text": "populatePosts (postObj) {\n this.ghostObj['data']['posts'].push(postObj);\n }", "title": "" }, { "docid": "7e97eb5df3dc0049a33a6c06dc6d6bf9", "score": "0.66487575", "text": "function renderPost() {\n let result_post = document.querySelector(\"#post-result\");\n let template = document.querySelector(\"#post-template\");\n result_post.innerHTML = \"\";\n for (i in posts) {\n let el = template.cloneNode(true);\n el.querySelector(\".card-header > h6\").innerText = `${posts[i].date}`;\n el.querySelector(\".card-header > .pointer\").setAttribute(\n \"onclick\",\n `removePost(${i})`\n );\n el.querySelector(\n \".card-body > .card-text\"\n ).innerText = `${posts[i].message}`;\n el.style.display = \"block\";\n result_post.appendChild(el);\n }\n}", "title": "" }, { "docid": "83515bd9bd9fedc938a2f4251f171945", "score": "0.6622475", "text": "function renderPosts(data) {\r\n postLists.innerHTML = null;\r\n const nameBox = document.createElement(\"h3\");\r\n nameBox.textContent = \"POSTS\";\r\n postLists.appendChild(nameBox);\r\n\r\n data.forEach((element) => {\r\n const newUserPost = userPostTemp.cloneNode(true);\r\n const postTitle = newUserPost.querySelector(\".post-title\");\r\n postTitle.textContent = element.title;\r\n postTitle.dataset.post_id = element.id;\r\n newUserPost.querySelector(\".body\").textContent = element.body;\r\n postLists.appendChild(newUserPost);\r\n });\r\n}", "title": "" }, { "docid": "9d3d59e4d954027832c936e9eac913d0", "score": "0.6541547", "text": "function appendPosts(posts) {\n posts.forEach((post) => appendPost(post));\n}", "title": "" }, { "docid": "ca1358855c101ca37965d80b6aad0010", "score": "0.653276", "text": "function makeSectionPosts(posts) {\n const sectionPosts = document.getElementById('posts');\n const postsOfArray = [...posts];\n if (sectionPosts) {\n const sectionPostsPosts = sectionPosts.getElementsByClassName('posts')[0];\n sectionPostsPosts.innerHTML = '';\n\n postsOfArray.forEach((postJson) => {\n const post = returnNeededTypePost(postJson);\n post.renderBlogPost(sectionPostsPosts);\n });\n } else {\n const fragmentPosts = document.createDocumentFragment();\n const sectionPosts = document.createElement('section');\n fragmentPosts.append(sectionPosts);\n sectionPosts.id = 'posts';\n\n const containerPosts = makeElement('div', 'container');\n sectionPosts.append(containerPosts);\n\n const rowPosts = makeElement('div', 'row');\n containerPosts.insertAdjacentElement('afterbegin', rowPosts);\n\n const sectionPostsPosts = makeElement('div', 'posts');\n rowPosts.append(sectionPostsPosts);\n if (posts.length) { // check if there is any post\n postsOfArray.forEach((postJson) => {\n const post = returnNeededTypePost(postJson);\n post.renderBlogPost(sectionPostsPosts);\n });\n // listen to delete post\n sectionPosts.addEventListener('noPostLeft', () => makeNoPostBlock(sectionPostsPosts));\n } else {\n makeNoPostBlock(sectionPostsPosts);\n }\n\n const wrapper = document.getElementsByClassName('wrapper')[0];\n fragmentPosts.append(sectionPosts);\n wrapper.append(fragmentPosts);\n }\n}", "title": "" }, { "docid": "634a2b12f19678557ab195b3d9a7db2f", "score": "0.65257204", "text": "function generatePosts(dataArr, dest) {\n dest.innerHTML = dataArr\n .map(\n (post) => `\n <div class=\"card m-2 \">\n <div class=\"card-header\">Author: ${post.author}</div>\n <div class=\"card-body\">\n <h5 class=\"card-title\">${post.title}</h5>\n <a href=\"single-posts.html?postId=${post.postId}\" class=\"btn btn-primary btn-sm\">See more</a>\n <button data-postid='${post.postId}' class=\"btn btn-sm btn-danger delete-post\">Delete</button>\n </div>\n <div class=\"card-footer\">Time ${post.timeStamp}</div>\n </div>\n `,\n )\n .join('');\n}", "title": "" }, { "docid": "560cb9605bf3f55c20e8a683933645b7", "score": "0.6451036", "text": "function getPosts() {\n const data = { channel_id: currentChannelId, last_id: lastId };\n\n fetch('api/getPostsByChannel.php',\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data),\n }\n )\n .then(response => response.json())\n .then(data => {\n console.log(data);\n\n for (i = 0 ; i < data.length ; i++) {\n body = data[i]['body'];\n author = data[i]['author'];\n lastId = data[i]['id'];\n\n document.getElementById('posts').insertAdjacentHTML('beforeend', '<div><span class=\"name\">'+ author +'</span> : '+ body +'</div>');\n }\n });\n}", "title": "" }, { "docid": "8b2f99d229e5c160e62a298836e6ff0d", "score": "0.6450278", "text": "function renderPosts(event) {\n event.preventDefault();\n let postList = localStorage.getItem(\"postList\");\n postList = JSON.parse(postList);\n\n if (postList != null) {\n for (post in postList) {\n makePost(postList[post]);\n }\n }\n}", "title": "" }, { "docid": "f4528df78749fe1da3735b226341c672", "score": "0.64445186", "text": "function getPosts() {\n $.get('/api/posts/', function (data) {\n var postsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n\n newPost = data[i];\n\n postsToAdd.push(createPostDiv(newPost));\n renderPost(postsToAdd);\n }\n });\n }", "title": "" }, { "docid": "617b7d86ed46bcefcd46f46da3c3fa68", "score": "0.6436259", "text": "function handlePosts() {\n var posts = [\n { id: 23, title: 'Daily JS News' },\n { id: 52, title: 'Code Refactor City' },\n { id: 105, title: 'The Brightest Ruby' }\n ];\n \n for (var i = 0; i < posts.length; i++) {\n savePost(posts[i]);\n }\n}", "title": "" }, { "docid": "18b71048e911819a7db40c47c8bc7090", "score": "0.64223903", "text": "function newPost(type) {\n\tif(type == 'n' && index < json_array.length-1) {\n\t\tindex++;\n\t\tdisplayData();\n\t}\n\telse if(type == 'p' && index > 0) {\n\t\tindex--;\n\t\tdisplayData();\n\t}\n}", "title": "" }, { "docid": "6691d2d98f9502a0f1c4cac6a847e7a0", "score": "0.63601404", "text": "function showPosts(postJSON) {\n posts = JSON.parse(postJSON).posts;\n for (let i = 0; i < posts.length; i++) {\n document.getElementById(\"postType_\" + i).innerHTML = convertPostKind(posts[i].kind);\n document.getElementById(\"postTitle_\" + i).innerHTML = posts[i].title;\n document.getElementById(\"postAuthor_\" + i).innerHTML = posts[i].author;\n document.getElementById(\"postDescrip_\" + i).innerHTML = posts[i].descrip;\n console.log(\"done with: \" + i);\n }\n}", "title": "" }, { "docid": "100ca6daefffa8f66053f7e6acd18eab", "score": "0.63231355", "text": "function displayPosts() {\n var posts = JSON.parse(this.response);\n var postsContainer = $(\"#posts\");\n for (var i=0; i<posts.length; i++) {\n postsContainer.append(\"<li>\" + posts[i].body + \"</li>\")\n }\n }", "title": "" }, { "docid": "7f280b28b932d2ca226e7832dc8a4e27", "score": "0.63078386", "text": "function createHTML(postsData) {\n var postlistHTML = '';\n var api_value = document.getElementById(\"restapi\").value;\n for (i = 0; i < postsData.length; i++) {\n\n postlistHTML += '<div class=\"slider--item\"' + '>'\n if (postsData[i].episode_featured_image) {\n postlistHTML += '<a target=\"_blank\" href=' + postsData[i].link + '><img src=' + postsData[i].episode_featured_image + '></a>';\n }\n postlistHTML += '<div class=\"slider--content\">'\n postlistHTML += '<h4 class=\"slider--title\"> <a target=\"_blank\" href=' + postsData[i].link + '>' + postsData[i].title.rendered + '</a></h4 >';\n postlistHTML += '<div class=\"slider--date\">' + new Date(postsData[i].date.substring(0, 10)).toDateString() + '</div>';\n postlistHTML += '<div class=\"slider--excerpt\">' + postsData[i].excerpt.rendered + '</div>';\n postlistHTML += '</div>';\n postlistHTML += '</div>';\n\n\n }\n PostsContainer.innerHTML = postlistHTML;\n }", "title": "" }, { "docid": "895adba24b5c4055befe578e8d19a666", "score": "0.6257086", "text": "function addArticlePosts() {\r\n const JSON_SRC = 'MasterPage/json/article_list.json';\r\n const GROUP_SIZE = 6;\r\n let xmlhttp = new XMLHttpRequest();\r\n let current = currentPage();\r\n xmlhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n let articleList = JSON.parse(this.responseText);\r\n articleList.reverse();\r\n let len = articleList.length;\r\n let next = current + 1;\r\n let htmlContents = '';\r\n for (let i = 0; i < len; i++) {\r\n if (i == GROUP_SIZE * next) {\r\n break;\r\n }\r\n\telse {\r\n if (parseInt(i/GROUP_SIZE) == current) {\r\n let title = articleList[i].articles;\r\n let url = articleList[i].url;\r\n let date = articleList[i].date;\r\n let typeGroup = articleList[i].type_group;\r\n let abstracts = articleList[i].abstracts;\r\n let img = articleList[i].img;\r\n htmlContents += addBlogPost(title, url, date, typeGroup\r\n\t\t\t , abstracts, img);\r\n } \r\n\t}\r\n }\r\n htmlContents += addPage('index.html?page=',current-1,next,len,GROUP_SIZE);\r\n\t\t\t\r\n if (document.getElementById) {\r\n let articlePost = document.getElementById ('article_post');\r\n if (articlePost) {\r\n placeInOuterHtml (articlePost, htmlContents);\r\n\t}\r\n }\r\n }\r\n };\r\n xmlhttp.open(\"GET\", JSON_SRC, true);\r\n xmlhttp.send();\r\n}", "title": "" }, { "docid": "a15dd8668784cbb2b2192b5869eeb86c", "score": "0.6233895", "text": "loadPosts() {\n if (this.props.thread.posts) {\n return (\n Object.keys(this.props.thread.posts).map(key =>\n <Post\n key={key}\n arraykey={key}\n post={this.props.thread.posts[key]}\n username={this.props.username}\n userid={this.props.userid}\n opname={this.props.thread.postername}\n opid={this.props.thread.posterid}\n updatePost={this.updatePost}\n deletePost={this.deletePost}\n />\n ))\n }\n }", "title": "" }, { "docid": "c946f1ac992cc05915ce7a399d85b340", "score": "0.6216112", "text": "function renderPosts() {\n // assign posts object to a variable\n var posts = memory.posts;\n // loop through posts object\n for (var i = 0; i < posts.length; i++) {\n // call render method\n memory.posts[i].render();\n };\n }", "title": "" }, { "docid": "f24bf503205805a333a0a393c19f2950", "score": "0.6211488", "text": "function addAllPost(){\n\tfor(i = 0; i < posts.length; i++){//\n\t\tdocument.getElementById(\"posts\").appendChild(posts[i]);\n\t}\n}", "title": "" }, { "docid": "fe2fcbe6e3b8452151768efed328cdc0", "score": "0.6198111", "text": "function loadPosts() {\n fetch('http://jsonplaceholder.typicode.com/posts')\n .then(function(response) {\n return response.json();\n })\n .then(function(posts) {\n console.log(posts);\n let htmlTemplate = \"\";\n for (let post of posts) {\n htmlTemplate += `\n <article>\n <h4>${post.title}</h4>\n <p>${post.body}</p>\n </article>\n `;\n }\n document.querySelector(\"#posts\").innerHTML = htmlTemplate;\n });\n}", "title": "" }, { "docid": "f71a3d964b1236cf612ceab7d223c415", "score": "0.6169242", "text": "function renderPost(posts) {\n\n if (posts.length) {\n $(\".post-area\").prepend(posts);\n }\n\n }", "title": "" }, { "docid": "2f7d00786c85f351f67b3deceb117262", "score": "0.6166365", "text": "function createPosts(post){\r\n setTimeout( () => {\r\n posts.push(post);\r\n }, 2000);\r\n}", "title": "" }, { "docid": "54af644a487b85d23fd16b0beef6994a", "score": "0.6148632", "text": "appendPostItem(data){\n const postItem =document.createElement('post-item')\n postItem.setAttribute('time',data.createdAt)\n postItem.setAttribute('author',data.authorName)\n postItem.setAttribute('content',data.content)\n const parent = this._shadowRoot.querySelector('.list-posts')\n parent.insertBefore(postItem,parent.firstChild)\n\n }", "title": "" }, { "docid": "410fa96d5442605fd69959fce7bed5d7", "score": "0.6142398", "text": "function processData(data) {\n\n //Logging the data so that you can always see what de request is providing\n console.log(data);\n\n for (i = 0; i < data.newsposts.length; i++) {\n\n var postcontainer = document.getElementById('news-updates');\n\n var fullpost = document.createElement('a');\n fullpost.setAttribute('href', 'http://localhost/Redcraft/php/fullpost.php?id=' + data.newsposts[i].id);\n\n var post = document.createElement('div');\n post.setAttribute('class', 'news-updates-post');\n post.setAttribute('id', 'news-updates-post');\n\n var postdate = document.createElement('div');\n postdate.setAttribute('class', 'news-updates-post-date');\n postdate.setAttribute('id', 'news-updates-post-date');\n postdate.innerHTML = data.newsposts[i].date;\n\n var posttitle = document.createElement('div');\n posttitle.setAttribute('class', 'news-updates-post-title');\n posttitle.setAttribute('id', 'news-updates-post-title');\n posttitle.innerHTML = data.newsposts[i].title;\n\n var postcontent = document.createElement('div');\n postcontent.setAttribute('class', 'news-updates-post-content');\n postcontent.setAttribute('id', 'news-updates-post-content');\n postcontent.innerHTML = data.newsposts[i].content;\n\n postcontainer.appendChild(fullpost);\n fullpost.appendChild(post);\n post.appendChild(postdate);\n post.appendChild(posttitle);\n post.appendChild(postcontent);\n\n }\n}", "title": "" }, { "docid": "c1644c1efc9c76228b0dd2164d55109e", "score": "0.6129408", "text": "addPost(...steps) {\n this.post.push(...steps);\n }", "title": "" }, { "docid": "fd0f7d16a5a80d0053aac2ec0f3b6302", "score": "0.61221653", "text": "function loadPosts(array) {\n\tvar container = document.getElementById(outerDiv);\n\t\n\tfor (var i = 0; i < array.length; i++) {\n\t\tvar entry = array[i];\n\t\tvar article = \"\";\n\t\tvar thumbs = \"\";\n\t\t\n\t\t//Checks if an article is present\n\t\tif (entry.article.displayName) {\n\t\t\tarticle = '<div class=\"link\"><a class=\"title\" href=\"' + \n\t\t\t\tentry.article.url + '\">' +\n\t\t\t\tentry.article.displayName + '</a><p>' +\n\t\t\t\tentry.article.content + '</p></div>';\n\t\t}\n\t\t\n\t\t//Checks if a image, album, or video is present\n\t\tif (entry.thumbnails.length > 0) {\n\t\t\tconsole.log(i);\n\t\t\tthumbs = '<div class=\"attachments\">';\n\t\t\tfor (var k = 0; k < entry.thumbnails.length; k++) {\n\t\t\t\tthumbs += '<a href=\"' + entry.thumbnails[k].link +\n\t\t\t\t'\"><img src=\"' + entry.thumbnails[k].url + '\">';\n\t\t\t}\n\t\t\tthumbs += '</div>';\n\t\t}\n\t\t\n\t\t// If you would like to use abbreviated month names, change the array to:\n\t\t// [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \n\t\t//\t\"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ]\n\t\tvar monthNames = [ \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \n\t\t\t\"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ];\n\t\t\n\t\t//Turns the data into an article div. You can change this if you want a different output\n\t\tcontainer.innerHTML += '<article>' +\n\t\t\tentry.body + article + thumbs +\n\t\t\t'<a class=\"ar-footer\" href=\"' + entry.url + '\">' + '<span class=\"date\">' + \n\t\t\tmonthNames[entry.date.getMonth()] + ' ' + entry.date.getDate() + ', ' +\n\t\t\tentry.date.getFullYear() + '</span> <span class=\"plusone\">+' + entry.plusones + \n\t\t\t'</span> <span class=\"comments\">' + entry.comments + \n\t\t\t' Comments</span> <span class=\"reshares\">' + entry.reshares + ' Reshares</span></a>' + \n\t\t\t'<a class=\"author\" href=\"' + entry.author.url + '\">By ' + entry.author.name + '</a>';\n\t}\n}", "title": "" }, { "docid": "40c6b29b5dfcd6b384f3388a8c1656bd", "score": "0.61085904", "text": "function getPost() {\n fetch('https://jsonplaceholder.typicode.com/posts')\n .then((response) => response.json())\n .then((data) => {\n // bring in the parent container that will hold & display our fetched/gotten array content\n let layoutParent = document.querySelector('#postParent');\n // userPost = data\n // console.log(userPost)\n // create an empty container that will be later used in concatenating our array list. Typical of Mr Ogo to call this html\n let layoutChild = \" \";\n // next is to loop display through the array elements using forEach\n // had to change the array name from 'data' to 'userPost' for me to fake display the 101 object for the createPost function since we have equated data to userPost on line 20. HOWEVER, i have to change it back to 'data' again so as to work on displaying each object in the data array in a new window or tab (using maybe the window.open() method)\n posts = data;\n\n posts.forEach((element, index) => {\n let stringiFiedElem = JSON.stringify(element);\n\n layoutChild += `\n <div class=\"col-6 col-md-4 col-lg-3 my-3\" >\n <div class=\"card h-100\">\n\n <div class=\"card-body\" id= \"card-element\">\n <div class=\"d-flex justify-content-end\">\n <h6 class=\"text-info\">${stringiFiedElem}</h6>\n </div>\n <h5 class=\"post-title\">${element.title}</h5>\n <p class=\"post-body\">${element.body} </p>\n \n <div class=\"d-flex justify-content-end align-items-end\">\n <button class=\"btn btn-danger\">Delete</button>\n </div>\n <div class=\"mt-3 d-flex justify-content-end align-items-end\">\n <button class=\"btn btn-warning\">Update</button>\n </div>\n\n </div>\n \n <div class=\"mt-3 d-flex justify-content-end\">\n <button class=\" mt-0 m-3 px-3 btn btn-info\" target=\"_blank\" onclick=\"openNew(\\' ${index} '\\)\">Open</button>\n </div>\n </div>\n </div>\n `;\n\n layoutParent.innerHTML = layoutChild;\n });\n\n });\n}", "title": "" }, { "docid": "0c71b508c125269e62d13688d528f8f9", "score": "0.6088568", "text": "function handlePosts() {\n var posts = [{\n id: 23,\n title: 'Daily JS News'\n },\n {\n id: 52,\n title: 'Code Refactor City'\n },\n {\n id: 105,\n title: 'The Brightest Ruby'\n }\n ];\n\n\n /*\n // ES5\n for (var i = 0; i < posts.length; i++) {\n savePost(posts[i]);\n }\n */\n\n\n posts.forEach(function (post) {\n savePost(post)\n });\n}", "title": "" }, { "docid": "661a71d7777fa369659df5eca69c38b9", "score": "0.60854995", "text": "render() {\n return (\n <div>\n <h1>Posts</h1>\n {\n this.state.posts.map(post =>{\n return <div key={post.id}>\n <h1>{post.title} </h1>\n <p>{post.body} </p>\n </div>\n })\n }\n </div>\n )\n }", "title": "" }, { "docid": "b12f8fd901274c8a506e807c262ba594", "score": "0.6077037", "text": "renderpost(){\n {return this.state.posts.map(post=> <div key={post.id} className=\"media\">\n <div className=\"media-left\">\n \n </div>\n <div className=\"media-body\">\n <a href={`/users/${post.user.username}`}><b>{post.user.username}</b></a>{' '}\n - {post.created_at}\n \n\n <p> {post.body}</p>\n </div>\n </div>)}\n }", "title": "" }, { "docid": "ce8b95a5600661a236e7b117ccd4bd8e", "score": "0.60724646", "text": "render() {\n\t\t//console.log(links);\n\t\treturn (\n\t\t\t<div className=\"Posts\" >\n\t\t\t\t{posts.map((post)=>{\n return <Post text={post.text} author={post.author}/>\n })}\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "c56cc861915cfd0402940078e58c0bde", "score": "0.6047855", "text": "function displayPostsDOM(posts) {\n posts.forEach((post) => {\n appendPostDOM(post);\n });\n}", "title": "" }, { "docid": "12f1645c7c2a61ebe63e0d9b0c356c47", "score": "0.6040028", "text": "function getPost(){\n fetch('http://jsonplaceholder.typicode.com/posts')\n .then((res) => res.json())\n .then((data) => {\n let outputPost = `<h2 class=\"bb-4\">Posts</h2>`;\n data.forEach((post) => {\n outputPost += `\n <div class=\"card csard-body mb-3 p-3\">\n <h3>${post.title}</h3>\n <p>${post.body}</p>\n </div>\n `;\n });\n document.getElementById('output').innerHTML = outputPost;\n })\n .catch((err) => console.log(err));\n}", "title": "" }, { "docid": "ffbedfbbf199196d11793f9100f393d6", "score": "0.60289174", "text": "function renderArticle(json) {\n //console.log(json.articles.length);\n for (let i = 0; i < json.articles.length; i++) {\n let li = document.createElement(\"li\");\n li.innerHTML = ` <p> Title=${json.articles[i].title} </p>\n <p> description=${json.articles[i].description} </p>\n <p> username=${json.articles[i].author.username} </p>\n <p> body=${json.articles[i].body} </p>\n <p> createdAt:${salam(json.articles[i].createdAt)}</p>`;\n ul.appendChild(li);\n }\n}", "title": "" }, { "docid": "cd9c2fab38948289b8c187b0f0ae15f1", "score": "0.60133004", "text": "render(){\n let posts = this.posts\n .map( posts => \n `<li data-post-id=\"${posts.id}\">\n <h3>${posts.id} - ${posts.title}</h3>\n <p>${posts.body}</hp>\n </li>`)\n\n return $(`<section>\n <hr>\n <ul>${posts.join(\"\")}</ul>\n </section>`);\n }", "title": "" }, { "docid": "9f3e5cb79f8f3597fdeaab7441ae8581", "score": "0.600679", "text": "function addData(postText,num) {\n var postsObject = { \"text\": postText, \"id\": num };\n posts.push(postsObject);\n}", "title": "" }, { "docid": "c069ac973aaece3b35fc92929702854c", "score": "0.60050124", "text": "createListItems() {\n // map the property(Allposts array)\n return this.props.AllPosts.map((post) => {\n return (\n <li key={post.id}>Title: {post.title} <br></br> Body:{post.body}</li>\n )\n })\n }", "title": "" }, { "docid": "df58a242efa0e0efbfbcd594e9e46419", "score": "0.60013175", "text": "renderPosts(){\n return this.props.posts.map((post) => {\n //for each post in post's arr we return li\n return (\n // back end generates id\n <li className='list-group-item' key={post.id}>\n <Link to={'posts/' + post.id}>\n <span className='pull-xs-right'>{post.categories}</span>\n <strong> {post.title}</strong>\n </Link>\n </li>\n )\n })\n }", "title": "" }, { "docid": "05a91ef9f99c2b81bfc4217914c07644", "score": "0.6001251", "text": "function Blog({ posts }) {\n return (\n <>\n <h1>This is a blog with content from an API</h1>\n <ul>\n {posts.map((post) => (\n <li key={post.id}>{post.title}</li>\n ))}\n </ul>\n </>\n )\n}", "title": "" }, { "docid": "2048c7f70c748c333b45f1eb1a99966a", "score": "0.5986742", "text": "mapPost(post){\n return {\n id: post.id,\n title: post.title.rendered,\n author: post._embedded.author[0].name,\n date: post.date,\n excerpt: post.excerpt.rendered,\n content: post.content.rendered\n }\n }", "title": "" }, { "docid": "f9274da9da6e44dc2b8739ef123b5e43", "score": "0.5981181", "text": "function create_post(post, type, user) {\n const div = document.createElement('div');\n div.id = `post-${post['id']}`;\n document.querySelector('#posts').append(div);\n // Format the post\n format_post(post, type, user);\n}", "title": "" }, { "docid": "7481222d712d754e5dd51af9e5a09adc", "score": "0.5969923", "text": "async function showPosts() {\n const posts = await getPosts();\n\n posts.forEach((post) => {\n const postEl = document.createElement(\"div\");\n postEl.classList.add(\"post\");\n postEl.innerHTML = `\n <div class=\"post-number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <div class=\"post-body\">${post.body}</div>\n </div>\n `;\n postsContainer.appendChild(postEl);\n // The Node.appendChild() method adds a node to the end of the list of children of a specified parent node.\n // The fetch() method takes one mandatory argument, the path to the resource you want to fetch.\n // It returns a Promise that resolves to the Response to that request, whether it is successful or not\n });\n}", "title": "" }, { "docid": "cf343501fc91d71d8ef497a61df01cbc", "score": "0.59667575", "text": "function postContents() {\n const regex = /[\"']/g;\n for (var i = 0; i < data.length; i++) {\n idStrTweet = data[i].IdStr;\n data[i].Text = data[i].Text.replace(regex, \"''\");\n textTweet = data[i].Text;\n urlTweet = data[i].Url;\n IdStrUser = data[i].CreatedBy.IdStr;\n\n let content = {\n idStrTweet,\n textTweet,\n urlTweet,\n IdStrUser\n }\n contents.push(content);\n }\n ajaxCall('POST', '../api/Contents', JSON.stringify(contents), postConSuccess, ecb);\n}", "title": "" }, { "docid": "24978ae48b237169902c8a8fa0c8bf4a", "score": "0.5951112", "text": "function renderPost(post){ //here we pass an object with post parameters needed to render the post\n\n //creating new elements of the layout\n var postContainer = document.createElement('div'),\n postTitle = document.createElement('h1'),\n postPicture = document.createElement('img'),\n postLink = document.createElement('a'),\n postDescription = document.createElement('p'),\n postPublicationDate = document.createElement('p');\n\n //setting proper attributes to the html tags of the layout\n postContainer.className = \"single-post \"; // here you can add bootstrap classes\n postTitle.innerHTML = post.title;\n postLink.setAttribute('href', post.link);\n postLink.setAttribute('target', '_blank');\n postLink.className = 'thumbnail'; // bootstrap thumbnail class\n postPicture.setAttribute('src', post.imageUrl);\n postDescription.innerHTML = post.description;\n postPublicationDate.innerHTML = \"Published: \" + post.date;\n\n\n //Appending elements to the DOM\n postLink.appendChild(postTitle);\n postLink.appendChild(postPicture);\n postLink.appendChild(postDescription);\n postLink.appendChild(postPublicationDate);\n postContainer.appendChild(postLink);\n document.getElementsByClassName('widget-container')[0].appendChild(postContainer);\n }", "title": "" }, { "docid": "b05277a15d289ff02daa7053928ae926", "score": "0.5938889", "text": "function addPost(texts) {\n var postIds = creatID();\n let post = {\n texts: texts,\n ids: postIds,\n comments: []\n }\n posts.push(post);\n}", "title": "" }, { "docid": "ee6fe0fc6a3863ca48f16b2d425cd435", "score": "0.59204847", "text": "render() {\n // ... breaks object into its key-value pairs\n const posts = this.state.posts.map( ( post, index ) => <Post key={ index }\n getInfo={ this.getPostInfo }\n { ...post } /> );\n // const posts = this.state.posts.map( post => <Post content={ post.content } title={ post.title } /> );\n\n // can only return one parent-level HTML element.\n return (\n <div>\n {\n this.state.showNewPostForm\n ?\n <NewPost savePost={ this.savePost.bind( this ) }/>\n :\n <button onClick={ this.toggleNewPostForm.bind( this ) }>New Post</button>\n\n }\n { posts }\n </div>\n );\n }", "title": "" }, { "docid": "746ae919a90c3d57325e7f9ecffaac06", "score": "0.59179246", "text": "function postTemplate() {\n var width = 550,\n height = 180,\n postData = [],\n individualPostSectionColor = \"white\",\n individualPostSectionHeight = 115,\n userIcon = \"M1600 1405q0 120-73 189.5t-194 69.5h-874q-121 0-194-69.5t-73-189.5q0-53 3.5-103.5t14-109 26.5-108.5 43-97.5 62-81 85.5-53.5 111.5-20q9 0 42 21.5t74.5 48 108 48 133.5 21.5 133.5-21.5 108-48 74.5-48 42-21.5q61 0 111.5 20t85.5 53.5 62 81 43 97.5 26.5 108.5 14 109 3.5 103.5zm-320-893q0 159-112.5 271.5t-271.5 112.5-271.5-112.5-112.5-271.5 112.5-271.5 271.5-112.5 271.5 112.5 112.5 271.5z\",\n likesIcon = \"M21.216 8h-2.216v-1.75l1-3.095v-3.155h-5.246c-2.158 6.369-4.252 9.992-6.754 10v-1h-8v13h8v-1h2l2.507 2h8.461l3.032-2.926v-10.261l-2.784-1.813zm.784 11.225l-1.839 1.775h-6.954l-2.507-2h-2.7v-7c3.781 0 6.727-5.674 8.189-10h1.811v.791l-1 3.095v4.114h3.623l1.377.897v8.328z\",\n commentsIcon = \"M1408 768q0 139-94 257t-256.5 186.5-353.5 68.5q-86 0-176-16-124 88-278 128-36 9-86 16h-3q-11 0-20.5-8t-11.5-21q-1-3-1-6.5t.5-6.5 2-6l2.5-5 3.5-5.5 4-5 4.5-5 4-4.5q5-6 23-25t26-29.5 22.5-29 25-38.5 20.5-44q-124-72-195-177t-71-224q0-139 94-257t256.5-186.5 353.5-68.5 353.5 68.5 256.5 186.5 94 257zm384 256q0 120-71 224.5t-195 176.5q10 24 20.5 44t25 38.5 22.5 29 26 29.5 23 25q1 1 4 4.5t4.5 5 4 5 3.5 5.5l2.5 5 2 6 .5 6.5-1 6.5q-3 14-13 22t-22 7q-50-7-86-16-154-40-278-128-90 16-176 16-271 0-472-132 58 4 88 4 161 0 309-45t264-129q125-92 192-212t67-254q0-77-23-152 129 71 204 178t75 230z\",\n commentedByIcon = \"M1792 896q0 174-120 321.5t-326 233-450 85.5q-70 0-145-8-198 175-460 242-49 14-114 22-17 2-30.5-9t-17.5-29v-1q-3-4-.5-12t2-10 4.5-9.5l6-9 7-8.5 8-9q7-8 31-34.5t34.5-38 31-39.5 32.5-51 27-59 26-76q-157-89-247.5-220t-90.5-281q0-130 71-248.5t191-204.5 286-136.5 348-50.5q244 0 450 85.5t326 233 120 321.5z\",\n iconColor = \"green\",\n wordsLengthMesage = 90,\n wordsLengthPostStory = 55,\n postCreationDate = '',\n commentCreationDate = '',\n postStory,\n postMessage,\n commentSenderName,\n commentMessage,\n postCommentCount,\n postLikeCount,\n postUserName = userName;\n\n\n /*\n Function to get the pot story without first name if psot story is present\n */\n function cutShortPostStory(pstStory) {\n //cut the post story upto the limit ;todo: could be improvised\n\n if (pstStory == \"\") {\n return \"\";\n }\n else {\n //make the first 2 spaces of the post as user name\n var indexOfFirstSpace = pstStory.indexOf(\" \");\n var sentenceAfterFirstName = pstStory.substring(indexOfFirstSpace + 1, pstStory.length);\n var lengthOfSecondSpace = sentenceAfterFirstName.indexOf(\" \");\n var tokens = pstStory.split(' ');\n postUserName = tokens[0] + \" \" + tokens[1];\n postUserName = pstStory.substring(0, eval(indexOfFirstSpace + lengthOfSecondSpace + 1));\n var postStory1 = pstStory.substring(eval(tokens[0].length + tokens[1].length + 2), pstStory.length)\n var postStory2 = (pstStory.length > wordsLengthPostStory) ? postStory1.substring(0, wordsLengthPostStory) + \"...\" : postStory1.substring(0, wordsLengthPostStory);\n return postStory2;\n }\n\n\n }\n\n function getPostData(postID) {\n //loop over chart\n for (var count = 0; count < chartData.length; count++) {\n if (chartData[count].app_specific_post_id == postID && chartData[count].is_post == \"1\") {\n\n //cut the post message upto the limit ;todo: could be improvised\n var postStory1 = (typeof chartData[count].post_story === 'undefined' || chartData[count].post_story === null) ? \"\" : chartData[count].post_story;\n postStory = cutShortPostStory(postStory1);\n\n postMessage = ((typeof chartData[count].post_message === 'undefined') || (chartData[count].post_message === null)) ? \"\" : chartData[count].post_message;\n postMessage = (postMessage == \"\") ? \"\" : (postMessage.length > wordsLengthMesage) ? postMessage.substring(0, wordsLengthMesage) + \"...\" : postMessage.substring(0, wordsLengthMesage);\n postCreationDate = new Date(chartData[count].created_time);\n postCommentCount = chartData[count].post_comment_count;\n postLikeCount = chartData[count].post_like_count;\n break;\n }\n\n\n }\n\n\n }\n\n var post = function (selection) {\n if (selection === 'undefined') {\n console.log(\"selection is undefined\");\n return;\n }\n\n if ((typeof postData == 'undefined') || (postData.length == 0)) {\n return;\n }\n\n //get the chart datas\n if (postData.is_post == \"1\") {\n postCreationDate = new Date(postData.created_time);\n //cut the post story upto the limit ;todo: could be improvised\n var postStory1 = (typeof postData.post_story === 'undefined' || postData.post_story === null) ? \"\" : postData.post_story;\n postStory = cutShortPostStory(postStory1);\n\n\n //cut the post message upto the limit ;todo: could be improvised\n postMessage = (typeof postData.post_message === 'undefined' || postData.post_message === null) ? \"\" : postData.post_message;\n postMessage = (postMessage == \"\") ? \"\" : postMessage.substring(0, wordsLengthMesage) + \"...\";\n postCommentCount = postData.post_comment_count;\n postLikeCount = postData.post_like_count;\n }\n else {\n commentCreationDate = new Date(postData.created_time);\n commentSenderName = postData.comment_sender_name;\n commentMessage = postData.comment_message;\n getPostData(postData.app_specific_post_id);\n }\n\n\n //create an outer group\n var selectedSvg = selection.append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", (postData.is_post == \"1\") ? individualPostSectionHeight : height)\n //create a rectangle and fill it white for design\n selectedSvg.append(\"rect\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .attr(\"fill\", \"none\")\n .attr(\"class\", \"postMainSection\");\n //individual post\n var individualPost = selectedSvg.append(\"g\")\n .attr(\"transform\", \"translate(0,0)\")\n .attr(\"class\", \"individualPost\");\n //fill individualPost with white\n individualPost.append(\"rect\")\n .attr(\"fill\", individualPostSectionColor)\n .attr(\"width\", width)\n .attr(\"height\", individualPostSectionHeight);\n //create a post section\n var postSection = individualPost.append(\"g\")\n .attr(\"class\", \"postSection\");\n //story section\n var storySection = postSection.append(\"g\")\n .attr(\"class\", \"StorySection\");\n\n //add user icon\n var userIconElem = storySection.append(\"svg\")\n .attr(\"fill\", iconColor)\n .attr(\"width\", 30)\n .attr(\"height\", 30)\n .attr(\"viewBox\", \"0 0 1792 1792\")\n\n //add path for user icon\n\n userIconElem.append(\"path\")\n .attr(\"d\", userIcon);\n\n storySection.append(\"text\")\n .attr(\"transform\", \"translate(30,25)\")\n .attr(\"class\", \"userName\")\n .text(postUserName)\n\n\n storySection.append(\"text\")\n .attr(\"transform\", \"translate(140,25)\")\n .text(postStory)\n //Add date of post creation\n\n postSection.append(\"text\")\n .attr(\"transform\", \"translate(5,43)\")\n .attr(\"class\", \"dateDisplay\")\n .text(postCreationDate.toLocaleString(\"en-us\", {month: \"short\"}) + \" \" + postCreationDate.getDate() + \", \" + postCreationDate.getFullYear() + \" \" + postCreationDate.toLocaleTimeString())\n //append the full psot message\n postSection.append(\"text\")\n .attr(\"transform\", \"translate(5,70)\")\n .attr(\"class\", \"postMessage\")\n .text(postMessage)\n\n //Add the comment section\n var commentSection = selectedSvg.append(\"g\")\n .attr(\"transform\", \"translate(0,100)\")\n .attr(\"class\", \"commentSection\");\n\n //create section to add stats\n var statsSection = commentSection.append(\"g\")\n .attr(\"class\", \"statsSection\");\n // add section for like stats\n var likeStats = statsSection.append(\"g\")\n .attr(\"class\", \"likeStats\")\n .attr(\"transform\", \"translate(5,-15)\");\n\n //add like icon\n var likeIcon = likeStats.append(\"svg\")\n .attr(\"fill\", iconColor)\n .attr(\"width\", 20)\n .attr(\"height\", 20)\n .attr(\"viewBox\", \"0 0 24 24\")\n\n //add path for like icon\n\n likeIcon.append(\"path\")\n .attr(\"d\", likesIcon)\n // add the like count\n\n likeStats.append(\"text\")\n .attr(\"transform\", \"translate(32,15)\")\n .attr(\"id\", \"likeCount\")\n .text(postLikeCount);\n\n\n // add section for comment stats\n var commentStats = statsSection.append(\"g\")\n .attr(\"class\", \"CommentStats\")\n .attr(\"transform\", \"translate(70,-15)\");\n\n //add comments icon\n var commentIcon = commentStats.append(\"svg\")\n .attr(\"fill\", iconColor)\n .attr(\"width\", 20)\n .attr(\"height\", 20)\n .attr(\"viewBox\", \"0 0 1792 1792\")\n\n //add path for comments icon\n\n commentIcon.append(\"path\")\n .attr(\"d\", commentsIcon)\n // add the comments count\n commentStats.append(\"text\")\n .attr(\"transform\", \"translate(35,15)\")\n .attr(\"id\", \"commmentCount\")\n .text(postCommentCount);\n\n if (postData.is_post != \"1\") {\n //user comment in post section\n var commentStarts = commentSection.append(\"g\")\n .attr(\"class\", \"commentStats\")\n .attr(\"transform\", \"translate(5,40)\");\n\n //section for comment by user name and date of comment\n var commentNameAndDate = commentStarts.append(\"g\")\n .attr(\"class\", \"commentNameandDate\")\n .attr(\"transform\", \"translate(0,-2)\");\n ;\n\n var userCommentIcon = commentStarts.append(\"g\")\n .attr(\"transform\", \"translate(5,-22)\");\n\n //add the comment icon\n var svgComment = userCommentIcon.append(\"svg\")\n .attr(\"fill\", iconColor)\n .attr(\"width\", 25)\n .attr(\"height\", 25)\n .attr(\"viewBox\", \"0 0 1792 1792\")\n //add the path of the icon\n svgComment.append(\"path\")\n .attr(\"d\", commentedByIcon);\n //add commenter name\n var commentSender = commentNameAndDate.append(\"text\")\n .attr(\"transform\", \"translate(35,-2)\")\n .attr(\"class\", \"commentSenderName\")\n .text(commentSenderName);\n //find the widht occupied by this text\n var bboxSenderComment = commentSender.node().getBBox();\n //section for user comment on the post\n //add the commented text after the sender name\n commentNameAndDate.append(\"text\")\n .attr(\"transform\", \"translate(\" + eval(35 + bboxSenderComment.width + 5) + \",-2)\")\n .attr(\"class\", \"commentText\")\n .text(commentMessage);\n\n //add commented date\n commentNameAndDate.append(\"text\")\n .attr(\"transform\", \"translate(5,20)\")\n .attr(\"class\", \"dateDisplay\")\n .text(commentCreationDate.toLocaleString(\"en-us\", {month: \"short\"}) + \" \" + commentCreationDate.getDate() + \", \" + commentCreationDate.getFullYear() + \" \" + commentCreationDate.toLocaleTimeString());\n\n\n }\n\n\n return post;\n }\n post.postData = function (arg) {\n if (arguments.length == 0)\n return postData;\n postData = arg;\n return post;\n }\n post.height = function (arg) {\n if (arguments.length == 0)\n return height;\n height = arg;\n return post;\n }\n\n post.width = function (arg) {\n if (arguments.length == 0)\n return width;\n width = arg;\n return post;\n }\n\n\n return post;\n }", "title": "" }, { "docid": "cb0ff1aee49c4812273812130549a5a7", "score": "0.591517", "text": "function createPost(id, title, body, date) { \n var post = [`<div class=\"post-preview\">`,\n `<h2 class=\"post-title\">${title}</h2>`,\n `<p class=\"post-subtitle\">${body}</p>`, \n `<p class=\"post-meta\">Posted at ${date}`,\n `<a href=\"javascript:edit(${id})\" class=\"btn\"><span class=\"glyphicon glyphicon-pencil\"></span></a>`,\n `<a href=\"javascript:del(${id})\" class=\"btn\"><span class=\"glyphicon glyphicon-trash\"></span></a></p>`,\n `</div>`,\n `<hr>`].join(\"\\n\")\n return post;\n}//E N D function createPost", "title": "" }, { "docid": "ef4b94c035f9695e01dc0ca87ba5ec25", "score": "0.5911023", "text": "function displayPostData(data) {\n var results = data.map((post, index) => {\n return renderResult(post, index);\n });\n\n if (results.length > 0) {\n $(\".posts\").html(results);\n } else {\n $(\".posts\").html(\n `<h2 class=\"first-post\">Welcome to Day! Submit your first post to start building your journal.</h2>`\n );\n $(\".first-post\").css(\"height\", \"540px\");\n $(\".first-post\").css(\"padding\", \"50px 15px 0px 15px\");\n }\n}", "title": "" }, { "docid": "048bc33fb16f8c4a67a437cb8d244909", "score": "0.5910286", "text": "function addToHTML() {\n for(var i = 0; i < blog.post.length; i++) {\n var article = document.querySelector('#blog_posts');\n var title = document.createElement('h1');\n var date = document.createElement('p');\n var image = document.createElement('img');\n var text = document.createElement('p');\n var blog_title = blog.post[i].title;\n var blog_date = blog.post[i].date;\n var blog_image = blog.post[i].image;\n var blog_text = blog.post[i].text;\n title.textContent=blog_title;\n date.textContent=blog_date;\n image.setAttribute('src', blog_image);\n text.textContent=blog_text;\n article.appendChild(title);\n article.appendChild(date);\n article.appendChild(image);\n article.appendChild(text);\n }\n}", "title": "" }, { "docid": "7729a7ffdc365755c73587d39a8174c2", "score": "0.5907819", "text": "function createNewPosts(posts,commentFn,comment){\n for(let post of posts){\n Post.create(post,function(err,newPost){\n if(err) console.log(err)\n else{\n commentFn(comment,newPost);\n }\n });\n }\n }", "title": "" }, { "docid": "1d041574b555da230b1fe7ce1602f21b", "score": "0.58984", "text": "componentDidMount() {\n fetch(\"/posts/find\", {\n method: \"GET\"\n }).then((response) => {\n response.json().then((data) => {\n\n if (data == null) {\n console.log(\"No posts found\");\n return;\n }\n \n let len = data.length;\n for (let i=(len-1); i>=0; i--) {\n let post = {\n creator: data[i].creator,\n date: data[i].date,\n time: data[i].time,\n message: data[i].message,\n id: data[i]._id\n };\n this.setState({\n posts: this.state.posts.concat(post)\n })\n }\n\n });\n });\n }", "title": "" }, { "docid": "41489dc4236ac3efbd2be48e1df0fde4", "score": "0.58952165", "text": "function Posts(props) {\n const [posts, setPosts] = useState([]);\n\n useEffect(() => {\n async function getPosts() {\n const response = await fetch(\n \"https://strangers-things.herokuapp.com/api/2109-LSU-RM-WEB-FT/posts\"\n );\n\n const responseObj = await response.json();\n\n setPosts(responseObj.data.posts);\n }\n console.log(posts);\n getPosts();\n }, [posts]);\n\n const postsToRender = posts.map((post) => {\n return <SinglePost post={post} />;\n });\n\n return (\n <div>\n <h1>Posts:</h1>\n {postsToRender}\n </div>\n );\n}", "title": "" }, { "docid": "0c0cfc2f5310f1526cd05e8bbf5ed79c", "score": "0.58912164", "text": "newPost(post) {\n\n }", "title": "" }, { "docid": "b91032ab9afc3008551cd6c7a3195f85", "score": "0.5884878", "text": "add_post(state, post){\n state.posts.push(post)\n }", "title": "" }, { "docid": "07f9c0dfc8c987b394c8a2d3f7e4fcbd", "score": "0.58835834", "text": "function populate_posts(parsed_json)\n{\n let post_counter = 0;\n const REDDIT_HOST = 'https://www.reddit.com';\n\n $.each(parsed_json, function (jsonkey, jsonval) {\n let media_html = '';\n let epoch_date = parsed_json[jsonkey]['date_created'];\n let date_object = new Date(epoch_date*1000);\n let string_date = date_object.getMonth() + '/' + date_object.getDate() + '/' + date_object.getFullYear() + ' ' + date_object.getHours() + ':' + date_object.getMinutes();\n post_counter++;\n\n if (typeof parsed_json[jsonkey]['author']['media'] !== 'undefined' && typeof parsed_json[jsonkey]['author']['media']['url'] !== 'undefined')\n {\n media_html = '<img src=\"' + parsed_json[jsonkey]['author']['media']['url'] + '\">';\n }\n\n $('.post_score', $('#thread>ul:nth-child(' + post_counter + ')')).text(\n parsed_json[jsonkey]['score']\n );\n $('.post_title', $('#thread>ul:nth-child(' + post_counter + ')')).html(\n '<div><a href=\"#\" onclick=\"call_external_url(\\'' + REDDIT_HOST + parsed_json[jsonkey]['permalink'] + '\\')\" class=\"button large\" target=\"_blank\">' + parsed_json[jsonkey]['title'] + '</a></div>'\n );\n $('.post_details', $('#thread>ul:nth-child(' + post_counter + ')')).html(\n 'Posted on ' + string_date + ' by ' + parsed_json[jsonkey]['author'] + '<br>' + media_html\n );\n });\n\n return post_counter;\n}", "title": "" }, { "docid": "695b74206e0250a6fc952cd04fa94533", "score": "0.5867024", "text": "function createPost(text, author, comments){\n fs.readFile('data/data.json', 'utf8', function (err, data) {\n \n if (err) {\n return console.log(err);\n }\n parsedData = JSON.parse(data);\n var id = parsedData.posts[parsedData.posts.length-1].id + 1\n var post = new Post(text, author, comments, id);\n parsedData.posts.push(post);\n fs.writeFileSync('data/data.json', JSON.stringify(parsedData));\n //callback(parsedData.posts)\n });\n}", "title": "" }, { "docid": "a77ff111d2ceac31e3f9caa82c2ec2e2", "score": "0.58631647", "text": "function renderPosts() {\n display.empty();\n // loops posts Arr and append the OBJs\n // debugger\n for (let i = 0; i < posts.length; i++) {\n display.append(`<form action=\"\">\n <p class='post' data-id=` + posts[i].ids + `> ` + posts[i].texts +\n ` <button type='button' class='remove' data-id=` + i +\n `>REMOVE</button>` + `</p>\n <input type=\"text\" name=\"\" class=\"commentName\" placeholder=\"name\">\n <input type=\"text\" name=\"\" class=\"commentComment\" placeholder=\"comment\">\n <ul class = \"postComment\">\n </ul>\n <button class = \"goComment\"type=\"button\">go</button>\n </form>`)\n\n // renderComments(getIndexByID(posts[i].ids), posts[i].ids);\n }\n}", "title": "" }, { "docid": "482cb953ad89bb8741553889e2619269", "score": "0.5853126", "text": "transformData(data) {\n return data.map((element) => {\n const newElement = {}\n newElement.id = element.id\n newElement.date = element.date\n newElement.content = element.content.rendered\n newElement.description = element.excerpt.rendered\n newElement.name = element.title.rendered\n newElement.slug = element.slug\n newElement.link = element.link\n newElement.parent = element.parent\n newElement.template = element.template\n return newElement\n })\n }", "title": "" }, { "docid": "714d281820a33431f404c863358d0d55", "score": "0.5853032", "text": "function makePost(postData) {\n let postList = document.getElementById(\"post-list\");\n let container = document.createElement(\"div\");\n container.id = postData.title;\n let postTitle = postData.title;\n let postContent = postData.content;\n let postDate = postData.date;\n\n container.innerHTML = `\n <h2>${postTitle} ${postDate}</h2>\n <p>${postContent}</p>\n `;\n\n let editBtn = document.createElement(\"button\");\n editBtn.innerHTML = \"Edit\";\n editBtn.type = \"button\";\n editBtn.id = \"edit:\" + postTitle;\n editBtn.addEventListener(\"clicked\", editPost);\n container.appendChild(editBtn);\n\n let deleteBtn = document.createElement(\"button\");\n deleteBtn.innerHTML = \"Delete\";\n deleteBtn.type = \"button\";\n deleteBtn.id = \"delete:\" + postTitle;\n editBtn.addEventListener(\"clicked\", deletePost);\n container.appendChild(deleteBtn);\n\n postList.appendChild(container);\n console.log(\"make post\");\n}", "title": "" }, { "docid": "5914850e224aae4bf2b5d4b23dfeedc6", "score": "0.58448684", "text": "function addPost(post) {\n var postElt = Mustache.render(postTmpl, post);\n console.log('generated HTML: %s', postElt);\n $('#index_list_posts').prepend(postElt);\n }", "title": "" }, { "docid": "e9724943b16b9d912c98810ba9922f9e", "score": "0.58390576", "text": "renderList() {\n return this.props.posts.map((post) => { // return a JSX full result\n return( // returns one piece of JSX for each iteration\n <div className=\"item\" key={post.id}>\n <i className=\"large middle aligned icon user\"></i>\n <div className=\"content\">\n <div className=\"description\">\n <h2>{post.title}</h2>\n <p>{post.body}</p>\n </div>\n </div>\n </div>\n );\n });\n }", "title": "" }, { "docid": "4550a221d2dd462b03ac6e3d913853f4", "score": "0.58272296", "text": "function handlePosts() {\n\tvar posts = [\n\t\t{ id: 23, title: 'Daily JS News' },\n\t\t{ id: 52, title: 'Code Refactor City' },\n\t\t{ id: 105, title: 'The Brightest Ruby' },\n\t];\n\n\tposts.forEach(function (post) {\n\t\tsavePost(post);\n\t});\n}", "title": "" }, { "docid": "19320f78455d97fcd659b0f0580e0aa0", "score": "0.5812823", "text": "generate()\n {\n this.post = document.createElement(\"div\");\n this.post.setAttribute(\"id\", \"haiku\"+this.id);\n this.post.setAttribute(\"class\", \"posts \" + this.gridClass);\n \n let postElements = [];\n\n let post_header = document.createElement(\"div\");\n post_header.setAttribute(\"class\", \"post-header\");\n post_header.setAttribute(\"style\", \"background-image: url('../uploads/background/\" + this.background + \"');\");\n let posts_haiku = document.createElement(\"div\");\n posts_haiku.setAttribute(\"class\", \"posts-haiku\");\n let post_haiku = document.createElement(\"div\");\n post_haiku.setAttribute(\"class\", \"post-haiku\");\n post_haiku.innerHTML = this.content;\n posts_haiku.appendChild(post_haiku);\n post_header.appendChild(posts_haiku);\n postElements.push(post_header);\n\n if(this.contentNative != \"NO\")\n {\n let lang_switch = document.createElement(\"div\");\n lang_switch.setAttribute(\"class\", \"lang-switch\");\n let lang_switcher = document.createElement(\"label\");\n lang_switcher.setAttribute(\"class\", \"lang-switcher\");\n let lang_input = document.createElement(\"input\");\n lang_input.setAttribute(\"type\", \"checkbox\");\n lang_input.setAttribute(\"class\", \"language-value\");\n let lang_slider = document.createElement(\"span\");\n lang_slider.setAttribute(\"class\", \"lang-slider\");\n lang_switcher.appendChild(lang_input);\n lang_switcher.appendChild(lang_slider);\n lang_switch.appendChild(lang_switcher);\n postElements.push(lang_switch);\n }\n\n let post_nav = document.createElement(\"div\");\n post_nav.setAttribute(\"class\", \"post-nav\");\n\n var post_nav_dot = document.createElement(\"div\");\n post_nav_dot.setAttribute(\"class\", \"post-nav-dot\");\n post_nav.appendChild(post_nav_dot);\n\n let post_nav_handwriting = document.createElement(\"div\");\n post_nav_handwriting.setAttribute(\"class\", \"post-nav-handwriting\");\n post_nav_handwriting.setAttribute(\"id\", \"post-nav-handwriting\");\n post_nav_handwriting.setAttribute(\"style\", \"background-image: url(../uploads/handwriting/\"+ this.handwriting +\")\");\n let post_nav_handwriting_close = document.createElement(\"div\");\n post_nav_handwriting_close.setAttribute(\"class\", \"post-nav-handwriting-close\");\n post_nav_handwriting_close.setAttribute(\"id\", \"post-nav-handwriting-close\");\n post_nav_handwriting.appendChild(post_nav_handwriting_close);\n post_nav.appendChild(post_nav_handwriting);\n\n var post_nav_sub = document.createElement(\"div\");\n post_nav_sub.setAttribute(\"class\", \"post-nav-sub\");\n\n let options = [\"Handwriting\", \"Report\"];\n\n if(this.loggedIn == true)\n options = [\"Handwriting\", \"Edit\", \"Delete\"];\n \n options.forEach(option => {\n let post_nav_sub_option = document.createElement(\"div\");\n post_nav_sub_option.setAttribute(\"class\", \"post-nav-sub-option\");\n post_nav_sub_option.textContent = option;\n post_nav_sub.appendChild(post_nav_sub_option);\n });\n\n post_nav.appendChild(post_nav_sub);\n\n postElements.push(post_nav);\n\n let post_footer = document.createElement('div');\n post_footer.setAttribute(\"class\", \"post-footer\");\n\n let post_author = document.createElement('div');\n post_author.setAttribute(\"class\", \"post-author\");\n post_author.textContent = this.authorName;\n post_footer.appendChild(post_author);\n\n let post_country = document.createElement('div');\n post_country.setAttribute(\"class\", \"post-country\");\n post_country.textContent = this.authorCountry;\n post_footer.appendChild(post_country);\n\n let post_like = document.createElement('div');\n post_like.setAttribute(\"class\", \"post-like\");\n if(this.likeStatus == true)\n post_like.style.backgroundImage = \"url('img/icons/heart_full_normal.svg')\";\n\n let post_like_counter = document.createElement('span');\n post_like_counter.textContent = this.likes;\n post_like.appendChild(post_like_counter);\n post_footer.appendChild(post_like);\n\n postElements.push(post_footer);\n\n postElements.forEach(element => {\n this.post.appendChild(element);\n });\n }", "title": "" }, { "docid": "b02ed51ce55f41ff5980cd63502bfe09", "score": "0.58091146", "text": "function displayPosts(posts) {\n console.log(posts)\n $.each( posts, function( key, value ) {\n post = value;\n if (key <= 6) {\n document.getElementById('posts-container').innerHTML += '<a class=\"post\" target=\"_blank\" href=\"' + post.full_url + '\">'+\n '<div style=\"background-image:url(' + post.image + ')\"><h2>Member: </h2><h3>' + post.poster_name + \"</h3>\" +\n '</div></a>';\n }\n });\n }", "title": "" }, { "docid": "d9044fc1843ffec12bb3974ca835d3c3", "score": "0.5782503", "text": "function buildPosts (all_posts, start, finish) {\n var the_start = start, the_finish = finish;\n if (the_finish > all_posts.length) the_finish = all_posts.length;\n var main = $('#main');\n for (var i = the_start; i < the_finish; i++) {\n post_obj = buildPostHTML(all_posts[i]); // build html object from post\n main.append(post_obj); // add post to Main Content\n }// for each item in array\n if (all_posts.length == the_finish) {\n main.animate({'padding-bottom':'0'});\n $('#load_more').remove();\n }\n}", "title": "" }, { "docid": "38e3373ec847d45a33e8db8d2c9644a4", "score": "0.5766135", "text": "function postJsonToElement(aPost){\n var numberless=aPost.options==\"numberless\"\n\tvar afterNo=numberless?\"XXXXXX\":aPost.after_no\n\tvar postId=afterNo+\"-\"+aPost.id\n\tvar date=new Date(aPost.timestamp*1000)\n\tvar dateString=\n\t\tpadding(date.getMonth()+1,2)+\"/\"+\n\t\tpadding(date.getDate(),2)+\"/\"+\n\t\t(\"\"+date.getFullYear()).slice(-2)+\n\t\t\"(\"+weekdays[date.getDay()]+\")\"+\n\t\tpadding(date.getHours(),2)+\":\"+\n\t\tpadding(date.getMinutes(),2)+\":\"+\n\t\tpadding(date.getSeconds(),2)\n\tvar linkReply\n\tif(!numberless){\n\t\tlinkReply=[0,\n\t\t\t\" \",\n\t\t\t[\"a\",{\n\t\t\t\thref:\"#p\"+postId,\n\t\t\t\ttitle:\"Link to this post\"\n\t\t\t},\"No.\"],\n\t\t\t[\"a\",{\n\t\t\t\thref:\"javascript:quote('\"+postId+\"');\",\n\t\t\t\tonclick:insertQuote,\n\t\t\t\ttitle:\"Reply to this post\"\n\t\t\t},postId]\n\t\t]\n\t}\n\tvar replyHideX=document.documentElement.classList.contains(\"reply-hide\")\n\tvar post=element(\n\t\t[\"div#post\",{\n\t\t\tclass:\"postContainer replyContainer greenPostContainer\",\n\t\t\tid:\"pc\"+aPost.after_no\n\t\t},\n\t\t\t(replyHideX?\n\t\t\t\t[\"div\",{\n\t\t\t\t\tid:\"sa\"+postId\n\t\t\t\t},\n\t\t\t\t\t[\"a\",{\n\t\t\t\t\t\tclass:\"hide-reply-button\"\n\t\t\t\t\t},\n\t\t\t\t\t\t[\"span\",{\n\t\t\t\t\t\t\tclass:\"fa fa-minus-square-o\"\n\t\t\t\t\t\t}]\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t:\n\t\t\t\t[\"div\",{\n\t\t\t\t\tclass:\"sideArrows\",\n\t\t\t\t\tid:\"sa\"+postId\n\t\t\t\t},\">>\"]\n\t\t\t),\n\t\t\t[\"div\",{\n\t\t\t\tclass:\"post reply\",\n\t\t\t\tid:\"p\"+postId\n\t\t\t},\n\t\t\t\t[\"div\",{\n\t\t\t\t\tclass:\"postInfoM mobile\",\n\t\t\t\t\tid:\"pim\"+postId\n\t\t\t\t},\n\t\t\t\t\t[\"span\",{\n\t\t\t\t\t\tclass:\"nameBlock\"\n\t\t\t\t\t},\n\t\t\t\t\t\t[\"span\",{\n\t\t\t\t\t\t\tclass:\"name\"\n\t\t\t\t\t\t},aPost.username],\n\t\t\t\t\t\t[\"br\"]\n\t\t\t\t\t],\n\t\t\t\t\t[\"span\",{\n\t\t\t\t\t\tclass:\"dateTime postNum\",\n\t\t\t\t\t\t\"data-utc\":aPost.timestamp\n\t\t\t\t\t},\n\t\t\t\t\t\tdateString,\n\t\t\t\t\t\tlinkReply\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t[\"div\",{\n\t\t\t\t\tclass:\"postInfo desktop\",\n\t\t\t\t\tid:\"pi\"+postId\n\t\t\t\t},\n\t\t\t\t\t[\"input\",{\n\t\t\t\t\t\ttype:\"checkbox\",\n\t\t\t\t\t\tname:\"ignore\",\n\t\t\t\t\t\tvalue:\"delete\"\n\t\t\t\t\t}],\n\t\t\t\t\t[\"span\",{\n\t\t\t\t\t\tclass:\"nameBlock\"\n\t\t\t\t\t},\n\t\t\t\t\t\t[\"span\",{\n\t\t\t\t\t\t\tclass:\"name\"\n\t\t\t\t\t\t},aPost.username]\n\t\t\t\t\t],\n\t\t\t\t\t\" \",\n\t\t\t\t\t[\"span\",{\n\t\t\t\t\t\tclass:\"dateTime\",\n\t\t\t\t\t\t\"data-utc\":aPost.timestamp\n\t\t\t\t\t},dateString],\n\t\t\t\t\t(!numberless&&\n\t\t\t\t\t\t[\"span\",{\n\t\t\t\t\t\t\tclass:\"postNum desktop\",\n\t\t\t\t\t\t\tonclick:insertQuote,\n\t\t\t\t\t\t\ttitle:\"Reply to this post\"\n\t\t\t\t\t\t},linkReply]\n\t\t\t\t\t)\n\t\t\t\t],\n\t\t\t\t[\"blockquote\",{\n\t\t\t\t\tclass:\"postMessage\",\n\t\t\t\t\tid:\"m\"+postId,\n\t\t\t\t\tinnerHTML:aPost.text.replace(/\\r/g,\"\")\n\t\t\t\t}]\n\t\t\t]\n\t\t]\n\t).post\n return post\n}", "title": "" }, { "docid": "6a19e9cb3ddffc74243e0764a9d02f9c", "score": "0.57605726", "text": "function createPost() {\n var protoClass = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'proto-post';\n var imgSrc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'https://static.scientificamerican.com/blogs/cache/file/638FC5CE-96EC-46DA-AAC64985822092FE_source.jpg?w=590&h=800&BDB89ACC-71A2-463A-928419A181070C770';\n var postContent = arguments.length > 2 ? arguments[2] : undefined;\n var authorUsername = arguments.length > 3 ? arguments[3] : undefined;\n var authorImg = arguments.length > 4 ? arguments[4] : undefined;\n var newPost = document.getElementsByClassName(protoClass)[0].cloneNode(true);\n newPost.getElementsByTagName('img')[0].src = authorImg;\n newPost.getElementsByTagName('img')[1].src = imgSrc;\n newPost.getElementsByTagName('h1')[0].textContent = authorUsername;\n newPost.getElementsByTagName('p')[0].textContent = postContent;\n return newPost;\n} //-----------------show posts from everyone------------------", "title": "" }, { "docid": "5d626e821af1fa53eb7ffc0115231637", "score": "0.5752442", "text": "nuxtServerInit(vuexContext, context ){\n\n return axios.get('https://nuxtblog-f28e2.firebaseio.com/posts.json')\n .then(res => {\n\n let preData = Object.values(res.data)\n\n let keys = Object.keys(res.data)\n\n let postArray = []\n\n for (let i=0; i< keys.length; i++){\n\n postArray[i] = {... preData[i], id:keys[i] }\n }\n\n vuexContext.commit('setPosts', postArray )\n\n }).catch(e => context.error(e))\n\n }", "title": "" }, { "docid": "232c9c80217ecdda3a7a50bc7cf3259c", "score": "0.5750392", "text": "parseResults(redditResponse) {\n const posts = redditResponse.data.children;\n const allPosts = [];\n // Parse Posts\n posts.forEach((post) => {\n const data = post.data;\n // Lets not get fired from a job I don't have yet\n if (data.over_18) {\n return;\n }\n // Create a Post Object\n const newPost = new _shared_classes__WEBPACK_IMPORTED_MODULE_3__[\"Post\"](data.id, data.permalink, data.subreddit, data.author, this.extractPreviewImages(data), data.title);\n // Push to list of posts\n allPosts.push(newPost);\n });\n console.groupEnd();\n return allPosts;\n }", "title": "" }, { "docid": "ced72985176fe3f724085a94ff1885f9", "score": "0.5747173", "text": "function loadPost() {\n\n const newxmlHttpRequest = new XMLHttpRequest();\n newxmlHttpRequest.open('GET' , '/jsondata.json' , true);\n newxmlHttpRequest.onload = function() {\n if (this.status === 200) //check the status \n {\n const post = JSON.parse(this.responseText);\n console.log(post);\n let output = `\n <div class=\"item\">\n <div class=\"image\"> <img src=\"${post.image}\"> </div>\n <div class=\"content\">\n <a class=\"header\" href=\"#\" id=\"bTitle\"> ${post.postTitle} </a>\n <div class=\"meta\">\n <span id=\"bDate\">${post.date} </span>\n <span>By: <a href=\"#\" id=\"bAuthor\"> ${post.name}</a></span>\n </div>\n <div class=\"description\"> <p id=\"bDesc\"> ${post.postText} </p> </div>\n <div class=\"extra\"> <a class=\"ui floated basic violet button\" href=\"#\">Read Mores</a> </div>\n </div>\n </div> `;\n postDiv.innerHTML = output;\n }\n }\n\n \n\n newxmlHttpRequest.send();\n\n\n\n}", "title": "" }, { "docid": "dc3c08b5b7fe135a805213551c53c2e8", "score": "0.57298636", "text": "function addList($post) {\n posts.push(new PostProperties($post));\n}", "title": "" }, { "docid": "6fced9cc4a565f9b85254d0eae731cab", "score": "0.57287985", "text": "function PostList({ posts, setPosts }) {\n // TODO: Diplay the list of posts.\n // TODO: Create at least one additional component that is used by this component.\n // TODO: Each post must have className=\"post\" for the tests to work.\n // TODO: Each post must have a delete button - <button name=\"delete\">Delete</button> - that deletes the post when clicked\n return (\n <div className=\"post-list\">\n {posts.map((post) => (\n <Post setPosts={setPosts} posts={posts} post={post} text={post} />\n ))}\n </div>\n );\n}", "title": "" }, { "docid": "97fccccd5c91444fd73fefb7d4c40fb1", "score": "0.57274187", "text": "function readPost_index(obj) {\n\t$.each(obj.post, function(index, value){\n var file = change_alias(value.title).toLowerCase().replace(/ /g, '-');\n var category = value.categories.toLowerCase().replace(/ /g, '-');\n var date = new Date(value.created);\n\t\tvar temp = `<a href=\"post.html?post=${file}\" class=\"card text-center\">\n <img src=\"${value.featureImage}\" class=\"card-img-top\" alt=\"${value.title}\">\n <div class=\"card-header\">\n <h5 class=\"card-title\">${value.title}</h5>\n </div>\n <div class=\"card-body\">\n <p class=\"card-text\"><small class=\"text-muted\">Last updated ${date.toDateString()}</small></p>\n </div>\n </a>`;\n $(`.list-${category}-js`).prepend(temp);\n\t})\t\n}", "title": "" }, { "docid": "b5acf9fa0d128916e7541f305a4fa767", "score": "0.57198465", "text": "function PostItem({ post }) {\n return (\n < div className=\"whitesquare\" >\n {post.author.avatar}\n <p className=\"nome\">{post.author.name}</p>\n <p className=\"data\" >{post.date}</p>\n <p className=\"postagem\">{post.content}</p>\n\n\n {post.comments.map(comment => (\n <div className=\"comentarios\" key={comment.id}>\n {comment.author.avatar}\n <div className=\"nomeecomentario\" >\n <p className=\"nomecomentando\" > <b>{comment.author.name}</b>{` `}\n {comment.content}</p>\n </div>\n </div>\n ))}\n </div >\n );\n}", "title": "" }, { "docid": "5f866b8f3ee4d8f7cbc90b39b3910779", "score": "0.57118696", "text": "function fakeIt() {\n for (var i = 20; i < 1000; i++) {\n posts.push({\n _id: \"5b21ca3eeb7f6fbccd47w1820\",\n byUser: \"Jan\",\n content:\n \"Integer suscipit, est eleifend rhoncus hendrerit, nisl ligula commodo metus, non tristique eros orci non sapien. Aliquam elit arcu, imperdiet a lectus euismod, convallis placerat metus. Nullam tincidunt nec tortor sit amet aliquam. Sed et rutrum nulla. In vel imperdiet lectus, sed condimentum quam. Nunc commodo eleifend mauris a tincidunt. Aenean euismod mauris nec enim scelerisque viverra. In sagittis quis leo sodales molestie. Nulla ornare condimentum velit nec imperdiet. Nullam molestie, dui nec vehicula accumsan, ex nunc pretium augue, imperdiet consequat nibh ante nec odio. Mauris mi odio, fringilla non diam id, blandit placerat dolor. Suspendisse sed tempor mauris. Aliquam nec rutrum ante, non feugiat urna. Sed id suscipit ante, et hendrerit nunc. Mauris et arcu eu sem bibendum sagittis ac non nulla.\",\n date: \"21.10.2018\",\n profileImg: \"./img/profiles/profile.svg\"\n });\n }\n\n for (var k in posts) {\n posts[k]._id = k;\n }\n}", "title": "" }, { "docid": "ea25517617cbe8b5f232e65d54f0bb84", "score": "0.57099855", "text": "function buildThumbs(json, limit)\r\n{\r\n\tvar i, result = document.createDocumentFragment();\r\n\tif( limit <= 0 )\r\n\t\treturn result;\r\n\t\r\n\tif( typeof(json) == \"string\" )\r\n\t\ttry{ json = MS_parseJSON(json); } catch(e){ return result; }\r\n\t\r\n\tfor( i = 0; limit-- > 0 && i < json.length; i++ )\r\n\t{\r\n\t\tvar borderColors = [], imgStyle = \"\", status = \"post-preview\", flag = \"\";\r\n\r\n\t\tif( json[i].has_children )\r\n\t\t{\r\n\t\t\tborderColors.push(\"#0F0\");\r\n\t\t\tstatus += \" post-status-has-children\";\r\n\t\t}\r\n\t\tif( json[i].parent_id )\r\n\t\t{\r\n\t\t\tborderColors.push(\"#CC0\");\r\n\t\t\tstatus += \" post-status-has-parent\";\r\n\t\t}\r\n\t\t\r\n\t\tif( json[i].is_deleted )\r\n\t\t{\r\n\t\t\tborderColors.push(\"#000\");\r\n\t\t\tstatus += \" post-status-deleted\";\r\n\t\t\tflag = \"deleted\";\r\n\t\t}\r\n\t\telse if( json[i].is_pending )\r\n\t\t{\r\n\t\t\tborderColors.push(\"#00F\");\r\n\t\t\tstatus += \" post-status-pending\";\r\n\t\t\tflag = \"pending\";\r\n\t\t}\r\n\t\telse if( json[i].is_flagged )\r\n\t\t{\r\n\t\t\tborderColors.push(\"#F00\");\r\n\t\t\tstatus += \" post-status-flagged\";\r\n\t\t\tflag = \"flagged\";\r\n\t\t}\r\n\t\t\r\n\t\tif( borderColors.length > 1 )\r\n\t\t{\r\n\t\t\t//\tapp/assets/javascripts/posts.js \r\n\t\t\timgStyle = \"border-color: \"\r\n\t\t\tif( borderColors.length == 3 )\r\n\t\t\t\timgStyle += borderColors[0]+\" \"+borderColors[2]+\" \"+borderColors[2]+\" \"+borderColors[1]; \r\n\t\t\telse\r\n\t\t\t\timgStyle += borderColors[0]+\" \"+borderColors[1]+\" \"+borderColors[1]+\" \"+borderColors[0];\r\n\t\t\t//$img.css(\"border\", \"2px solid\");\r\n\t\t}\r\n\t\t\r\n\t\tvar article = createElementX({ \"tag\":\"article\",\r\n\t\t\t\t\"class\":status,\r\n\t\t\t\t\"id\":\"post_\"+json[i].id,\r\n\t\t\t\t\"data-id\":json[i].id,\r\n\t\t\t\t\"data-tags\":json[i].tag_string,\r\n\t\t\t\t\"data-uploader\":json[i].uploader_name,\r\n\t\t\t\t\"data-approver-id\":( json[i].approver_id || \"\" ),\r\n\t\t\t\t\"data-rating\":json[i].rating,\r\n\t\t\t\t\"data-width\":json[i].image_width,\r\n\t\t\t\t\"data-height\":json[i].image_height,\r\n\t\t\t\t\"data-flags\":flag,\r\n\t\t\t\t\"data-parent-id\":( json[i].parent_id || \"\" ),\r\n\t\t\t\t\"data-has-children\":json[i].has_children,\r\n\t\t\t\t\"data-score\":json[i].score,\r\n\t\t\t\t\"data-fav-count\":json[i].fav_count });\r\n\t\tarticle.appendChild( createElementX({ tag:\"a\", href:\"/posts/\"+json[i].id }) ).appendChild( createElementX({ tag:\"img\", src:\"/data/preview/\"+json[i].md5+\".jpg\", alt:json[i].tag_string, title:json[i].tag_string+\" user:\"+json[i].uploader_name+\" rating:\"+json[i].rating+\" score:\"+json[i].score, style:imgStyle }) );\r\n\t\tresult.appendChild(article);\r\n\t}\r\n\treturn result;\r\n}", "title": "" }, { "docid": "36e8d1690be93e0050b47afcb70b4971", "score": "0.5709792", "text": "function recentpost() {\n\n // title = document.getElementById(\"title\").value;\n\n newpost.push({\n title: document.getElementById(\"title\").value,\n post: document.getElementById(\"post\").value\n });\n\n for (var i = 0; i < newpost.length; i++) {\n document.getElementById(\"heading\").innerHTML = newpost[i].title;\n document.getElementById(\"recent-post\").innerHTML = newpost[i].post;\n }\n\n const Http = new XMLHttpRequest();\n\n Http.open(\"POST\", url + \"/index\");\n Http.setRequestHeader(\"Content-Type\", \"application/json\");\n Http.send(JSON.stringify(newpost));\n Http.onreadystatechange = (e) => {\n // JSON.parse(Http.responseText);\n console.log(Http.responseText)\n // alert(JsonResp.message);\n\n }\n return false\n}", "title": "" }, { "docid": "b888723d982438184b7d0d17c55f867c", "score": "0.5706321", "text": "async function showPosts() {\n const posts = await getPosts();\n\n //console.log(posts);\n\n postContainer.innerHTML += posts\n .map(\n (post) => `\n <div class=\"post\">\n <div class=\"number\">${post[\"id\"]}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post[\"title\"]}</h2>\n <p class=\"post-body\">\n ${post[\"body\"]}\n </p>\n </div>\n </div>`\n )\n .join(\"\");\n}", "title": "" }, { "docid": "239abfd0ddc93ad47b27e12880c64e34", "score": "0.5700882", "text": "async function showPosts() {\n\tconst posts = await getPosts();\n\n\t// Get post one by one\n\tposts.forEach((post) => {\n\t\t// ! Create post container from api\n\t\tconst postEl = document.createElement('div');\n\t\tpostEl.classList.add('post');\n\t\tpostEl.innerHTML = `\n <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <p class=\"post-body\">${post.body}</p>\n </div>`;\n\n\t\t// ! Add the post data in to the post container\n\t\tpostContainer.appendChild(postEl);\n\t});\n}", "title": "" }, { "docid": "b074fa7a363cd7f4e62a9f53f036179c", "score": "0.56873786", "text": "function createPostsCard(object){\n let newLi = createElement({tagName: 'li', className: 'border border-1 hover rounded-3 p-3 bg-light mb-2 js-post', node: elPost});\n let postTitle = createElement({tagName: 'div', className: \"h6\", text: object.title, node: newLi});\n let postBody = createElement({tagName: 'div', text: object.body, node: newLi});\n\n newLi.addEventListener('click', function(){\n $$_(\".js-post\", elPost).forEach(function(item){\n item.classList.remove(\"active\");\n });\n elPostsSection.classList.remove(\"bg-white\");\n elCommentsSection.classList.add(\"bg-white\");\n \n newLi.classList.add('active');\n elComments.innerHTML = '';\n main(createComment, \"posts/\"+ object.id +\"/comments\");\n });\n}", "title": "" }, { "docid": "a6baf024d52a4e59f4e08ef3d93f7fd5", "score": "0.5676921", "text": "async routes () {\n let { data } = await axios.post(process.env.POSTS_URL,\n JSON.stringify({\n filter: { published: true },\n sort: {_created:-1},\n populate: 1\n }),\n {\n headers: { 'Content-Type': 'application/json' }\n })\n\n const collection = collect(data.entries)\n\n let tags = collection.map(post => post.tags)\n .flatten()\n .unique()\n .map(tag => `category/${tag}`)\n .all()\n\n let posts = collection.map(post => post.title_slug).all()\n\n if(perPage < data.total) {\n let pages = collection\n .take(perPage-data.total)\n .chunk(perPage)\n .map((items, key) => `blog/${key+2}`)\n .all()\n\n return posts.concat(tags,pages)\n }\n\n return posts.concat(tags)\n }", "title": "" }, { "docid": "e31c8d3e2681897b70b3929f16b50973", "score": "0.5663023", "text": "function populatePosts() {\n $.ajax({\n // sends a request to get the posts from the db\n url: \"/get/posts\",\n method: \"GET\",\n success: function(result) {\n // updates text with result from request\n results = JSON.parse(result);\n let displayedResult = '';\n // iterates through each post and adds it to the result\n for (i in results) {\n displayedResult += generatePosts(results[i], i);\n }\n // sets the inner html to the posts html generated in generatePosts()\n postsContent.innerHTML = displayedResult;\n }\n });\n}", "title": "" }, { "docid": "e592344e9e81884c5411584a8824bfd7", "score": "0.5662722", "text": "function post(data) {\n\n var still;\n var animated;\n var rating;\n var title;\n\n for (var j = 0; j < data.data.length; j++) {\n \n still = data.data[j].images.fixed_height_still.url;\n animated = data.data[j].images.fixed_height.url;\n rating = data.data[j].rating;\n title = data.data[j].title;\n \n $(\"#post\").append(\"<div class = 'thumbnail'></div>\");\n $(\"#post .thumbnail\").eq(j).append(\"<img>\");\n \n $(\"#post .thumbnail img\").eq(j).attr({\n \n \"src\": still, \n \"data-still\": still, \n \"data-animated\": animated, \n \"alt\": title\n \n });\n \n $(\"#post .thumbnail\").eq(j).append(\"<div class = 'caption'><h3>Rating: \" + \n rating.toUpperCase() + \"</h3>\");\n }\n}", "title": "" }, { "docid": "1851942e6f87ae067b4adcdd4c0da7eb", "score": "0.5659072", "text": "function addPost(post) {\n //const feedList = document.getElementById('');\n // creates list container for the post\n var img = null;\n if (post.image != null) {\n img = document.createElement('img');\n img.className = 'post image';\n img.src = 'data:image/jpeg;base64,' + post.image;\n }\n const list = document.createElement('li');\n list.className = 'post';\n list.setAttribute('data-id-post', '');\n // number of upvotes\n const upVotes = document.createElement('div');\n upVotes.className = 'post vote';\n upVotes.setAttribute('data-id-upvotes', '');\n upVotes.innerText = post.meta.upvotes.length;\n\n // create a container for the content\n const content = document.createElement('div');\n content.className = 'content';\n\n // title of post\n const contentTitle = document.createElement('h4');\n contentTitle.setAttribute('data-id-title', '');\n contentTitle.className = 'post-title alt-text';\n contentTitle.innerText = post.title;\n\n // contents of post\n const contentText = document.createElement('p');\n contentText.className = 'post content';\n contentText.innerText = post.text;\n\n // n comments on post\n const comments = document.createElement('p');\n comments.className = 'post-author';\n comments.innerText = post.comments.length + ' Comments';\n\n // subseddit of post\n const subText = document.createElement('p');\n subText.className = 'post-author';\n subText.innerText = 's/'+ post.meta.subseddit;\n\n // author of post + time\n const contentAuthor = document.createElement('p');\n contentAuthor.className = 'post-author';\n contentAuthor.setAttribute('data-id-author', '');\n var d = new Date(post.meta.published*1000);\n var date = formatTime(d.getDate()) + '/' + formatTime(d.getMonth()) + '/' + d.getFullYear();\n var time = formatTime(d.getHours()) + ':' + formatTime(d.getMinutes()) + ':' + formatTime(d.getSeconds());\n contentAuthor.innerText = 'Posted by @' + post.meta.author + ' at ' + time + ', ' + date;\n\n content.appendChild(contentTitle);\n content.appendChild(subText);\n content.appendChild(contentAuthor);\n content.appendChild(contentText);\n if (img != null) {\n content.appendChild(img);\n }\n content.appendChild(comments);\n list.append(upVotes);\n list.append(content);\n return list;\n}", "title": "" }, { "docid": "54c90ac3c8334df3d0a85ea3da46858a", "score": "0.56588393", "text": "function PostsMain({ posts, ...rest }) {\n return (\n <div className=\"section\">\n <div className=\"PostMain row\">\n <div className=\"PostMain-left-column\">\n <div className=\"row center\">\n <Link to=\"/posts/add\" className=\"PostMain-btn btn-large waves-effect waves-light blue\" >\n Add New Post\n </Link>\n </div>\n <PostList className=\"PostList\" posts={posts} mode={COLLECTION} {...rest} render={\n (post, rest) => (<PostCollectionItem key={post.id} post={post} {...rest} />)\n } />\n </div>\n <div className=\"PostMain-right-column\">\n <Outlet />\n </div>\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "a80e3d98ef2d14f719988e015258e5ee", "score": "0.56571937", "text": "function loadPosts() {\n const postsCollection = firebase.firestore().collection(\"postagens\");\n container.querySelector(\"#lista-feed\").innerHTML = \"Carregando...\";\n postsCollection.get().then((querySnapshot) => {\n container.querySelector(\"#lista-feed\").innerHTML = \"\";\n querySnapshot.forEach((doc) => {\n const post = { id: doc.id, data: doc.data() };\n const componente = postTemplate(post);\n console.log(componente)\n container.querySelector(\"#lista-feed\").appendChild(componente);\n });\n });\n }", "title": "" }, { "docid": "269acfd6afe421d70250ba59a9c74105", "score": "0.5650877", "text": "render() {\n console.log(this.props, \"posts\");\n console.log(this.props.PostData);\n const { PostData, isLoading} = this.props\n \n var Filteritem = PostData.sort((a, b) => b.id - a.id)\n const { textPost, imagePost } = this.state\n return (\n <div>\n <div className=\"makePost\">\n <input\n className=\"makePostInputBox\"\n onChange={this.handleChange}\n name=\"textPost\"\n value={textPost}\n placeholder=\"Start a Post\" />\n <div className=\"makePostChild2\">\n <input\n name=\"imagePost\"\n name=\"imagePost\"\n value={imagePost}\n onChange={this.handleChange}\n placeholder=\"Place the Image Url\"\n />\n <button onClick={this.handlePost}>Post on Timeline</button>\n </div>\n </div>\n <hr style={{ marginLeft: \"30px\" }} />\n {/* <div className=\"post1\">\n\n </div> */}\n <div>\n {isLoading && <div><Spinner animation=\"border\" role=\"status\">\n <span className=\"sr-only\">Loading...</span>\n </Spinner></div>}\n {!isLoading && Filteritem.map((item) => {\n return <SinglePost key={item.id} post = {item} imageComment = {this.props.avatar_url} {...this.props}/>\n })\n }\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "7341b976d745ccc3121213728ad7f383", "score": "0.56457776", "text": "function postFunction(id) {\n fetch(`${APIURL}/posts`)\n .then((response) => response.json())\n .then((data) => {\n posts(data);\n\n // ==== RENDER USERS ITEM =====\n function posts(arr) {\n let postApi = arr.filter((el) => el.userId == id);\n postApi.forEach(element => {\n fragmentPost.appendChild(renderPosts(element));\n });\n elPostListWrapper.appendChild(fragmentPost)\n }\n });\n\n // ====== CREATED ELEMENTS TO POST ITEM ========\n let renderPosts = function (post) {\n let newPost = elPostTemlate.cloneNode(true);\n\n $_(\".post__item-title\", newPost).textContent = post.title;\n $_(\".post__item-text\", newPost).textContent = post.body;\n $_(\".post__btn\", newPost).setAttribute(\"data-id\", `${post.id}`);\n\n return newPost\n }\n}", "title": "" }, { "docid": "4a48b2dc6b9bdfe91910bb27be3e431e", "score": "0.56436145", "text": "function createPost(postData) {\n const div = document.createElement('div');\n const h2 = document.createElement('h2');\n const p = document.createElement('p');\n const btn = document.createElement('button');\n\n btn.textContent = 'Delete Post';\n // On click, it should delete the item from the database\n // Then remove the item from the DOM on success\n btn.addEventListener('click', () => {\n // Pessimistic rendering, don't delete unless the post\n // was actually deleted from the DB\n fetch(`${url}/${postData.id}`, { method: 'DELETE' })\n .then(res => res.json())\n .then(() => {\n // We can access the div because it's available one level up\n // in the scope chain\n div.remove();\n })\n });\n\n h2.textContent = postData.title;\n p.textContent = postData.text;\n div.append(h2, p, btn);\n\n const postsSection = document.querySelector('.posts');\n\n postsSection.append(div);\n}", "title": "" }, { "docid": "e5dca5630c3725dbac4f6a4a2c65e803", "score": "0.5637691", "text": "async function addRecentPosts() {\n const posts = await fetchPosts();\n const recentPosts = posts.slice(-3);\n\n recentPosts.forEach((post) => {\n const postCard = createPostCard(post);\n postSection.appendChild(postCard);\n });\n}", "title": "" }, { "docid": "d9f337f8d75cd6e520e406995ae73c48", "score": "0.5636278", "text": "function generateMockPosts() {\n var postStatus = [{ key: 'good' }, { key: 'bad' }];\n var posts = [];\n var contents = _mock_posts__WEBPACK_IMPORTED_MODULE_1__[\"POSTS_CONTENTS\"];\n var i = 0;\n postStatus.forEach(function (s) {\n var startdate = moment__WEBPACK_IMPORTED_MODULE_2__();\n // for (let i = 0; i < 5; i++) {\n var types = _mock_posts__WEBPACK_IMPORTED_MODULE_1__[\"POSTS_TYPES\"];\n var max = _mock_posts__WEBPACK_IMPORTED_MODULE_1__[\"POSTS_TYPES\"].length - 1;\n var min = 0;\n var t = types[Math.round(Object(_pulse_functions__WEBPACK_IMPORTED_MODULE_0__[\"getRandomArbitrary\"])(min, max))];\n var contentIndex = Math.floor(Math.random() * contents.length);\n // const t = types[i];\n var post = {\n type: t,\n location: 'East Siberia ',\n timestamp: lodash__WEBPACK_IMPORTED_MODULE_3__[\"cloneDeep\"](startdate),\n brand: {\n name: 'adidas',\n user: 'adidas',\n avatar: 'assets/images/brands/avatars/adidas.png'\n },\n // HTML\n content: contents[contentIndex],\n media: {\n value: \"assets/images/posts/post\" + (i + 1) + \".png\",\n kind: 'image'\n },\n performance: [\n { type: 'likes', value: 780 },\n { type: 'comments', value: 780 },\n { type: 'reproductions', value: 780 }\n ],\n status: s\n };\n posts.push(post);\n startdate = startdate.subtract(1, 'hours');\n i++;\n // }\n });\n return posts;\n}", "title": "" }, { "docid": "d478508307b23b989a1e8b92ce2b0054", "score": "0.56345254", "text": "function build_post() {\n $( '.skeleton' ).removeClass( 'skeleton' );\n var date = new Date( object.date );\n if ( featured_img_ID !== 0 ) {\n if ( $( '.featured-image' ).length ) {\n $( '.featured-image' ).replaceWith( output_the_image() );\n } else {\n $( '.post' ).before( output_the_image() );\n }\n } else {\n $( '.featured-image' ).remove();\n }\n $( '.post-title' ).text( object.title.rendered );\n $( '.post-author' ).text( object._embedded.author[0].name );\n $( '.post-date' ).text( date.toDateString() );\n $( '.post-link' ).replaceWith( '<span class=\"post-link\">' + '<a href=\"' + object.link + '\" rel=\"bookmark\">Original source</a><span>' );\n $( '.post-content' ).replaceWith( '<div class=\"post-content\">' + object.content.rendered + '</div>' );\n }", "title": "" }, { "docid": "22afa62d5bb2d21909f53763fbccc2ad", "score": "0.5634451", "text": "addPost(){\n\n }", "title": "" } ]
5e2a7746c0589a97bbbd703884632951
Main character sprite animation.
[ { "docid": "0bfc8b2df9e025d5a2a40058b4a705e6", "score": "0.82745206", "text": "function animateMainCharacter() {\n let counter = 0;\n function step() {\n window.requestAnimationFrame(step)\n if (spriteOptionIndex == 3) {\n spriteOptionIndex = -1;\n }\n if (counter % 6 == 0) {\n charSprite.src = spriteOptionArray[spriteOptionIndex += 1];\n }\n counter++;\n }\n window.requestAnimationFrame(step)\n }", "title": "" } ]
[ { "docid": "25d60385fa5219e20bd54f260aa26e85", "score": "0.75415266", "text": "function runIdle()\n{\n\tidle = new PIXI.AnimatedSprite(sheet.animations[\"idle\"]);\n\t//idle.position.set(WIDTH/2, HEIGHT - 150);\n\t//idle.anchor.set(0.5);\n\tidle.animationSpeed = 0.1;\n\tcharacter.addChild(idle);\n\tidle.play();\n\t\n\tvar enemey = new PIXI.Sprite(PIXI.Texture.fromImage(\"Assets/Enemy/oni1.png\"));\n\tenemy.anchor.set(0.5);\n\tenemy.position.set(character.position.x + 100, character.position.y);\n\tgameStage.addChild(enemy);\n}", "title": "" }, { "docid": "9fbd4f9521cd8a1b55b8bceed9efc391", "score": "0.7060489", "text": "init () {\n this.character.src = this.sprite;\n this.loop = setInterval(this.render, this.interval); // It's what keeps our entity animated\n }", "title": "" }, { "docid": "978f7033a23aefdc7fbf2c90f451883c", "score": "0.7034809", "text": "show(characterSprite) {\n this.frames++;\n if (this.frames >= this.frameLimit) {\n this.frames = 0;\n this.currentLoopIndex++;\n if (this.currentLoopIndex >= this.run.length) {\n this.currentLoopIndex = 0;\n }\n }\n image(\n characterSprite,\n this.x,\n this.y,\n this.size,\n this.size + 10,\n 24 * this.run[this.currentLoopIndex] + 1,\n 0,\n 24\n );\n }", "title": "" }, { "docid": "445038eb53550962aaa664d7c72c1dd2", "score": "0.6944826", "text": "function playCharacter(){\n const newResource = PIXI.Loader.shared.resources['./Assets/adventurer-Sheet.json'];\n setupCharacter();\n\n document.addEventListener('keydown', (e) => {\n\n //gameController.movement(e);\n\n });\n document.addEventListener('keypress', (e) => {\n\n //gameController.keyP(e);\n isKeyDown = true;\n gameController.movement(e, spriteHurtBox);\n state = updateState(gameController.vx, gameController.vy, sprite);\n let currentTextures = newResource.spritesheet.animations[state];\n if (sprite.textures != currentTextures) {\n sprite.textures = currentTextures;\n sprite.play();\n }\n\n\n });\n document.addEventListener('keyup', (e) => {\n gameController.stopMovement(e, spriteHurtBox);\n state = updateState(gameController.vx, gameController.vy, sprite);\n sprite.textures = newResource.spritesheet.animations[state];\n sprite.play();\n\n });\n\n \n app.ticker.add(() => {\n characterMovement();\n state = updateState(gameController.vx, gameController.vy, sprite);\n let currentTextures = newResource.spritesheet.animations[state];\n if (sprite.textures != currentTextures) {\n sprite.textures = currentTextures;\n sprite.play();\n }\n gameController.move();\n });\n\n /*sprite.onFrameChange = function () {\n gameController.move();\n }*/\n \n\n}", "title": "" }, { "docid": "11b5803f1d74da903ae86b1415cb387c", "score": "0.68959445", "text": "function setupCharacter(){\n resource = PIXI.Loader.shared.resources[\"./Assets/adventurer-Sheet.json\"].spritesheet;\n sprite = new PIXI.AnimatedSprite(resource.animations.idle);\n // console.log('its lit');\n\n sprite = sprite;\n\n sprite.height = 35;\n sprite.width = 47;\n sprite.anchor.set(0.5, 0);\n sprite.x = 16;\n sprite.y = 192 - (16*8);\n sprite.play();\n sprite.animationSpeed = 0.1;\n\n spriteHurtBox = new hurtBox(sprite);\n spriteHurtBox.calculateCharEdges();\n gameController = new controller(sprite);\n hearts = 3;\n \n\n}", "title": "" }, { "docid": "aeef48b22d864f639b4efeef3f2b4101", "score": "0.68866086", "text": "function setupCharacter(){\n resource = PIXI.Loader.shared.resources[\"./Assets/adventurer-Sheet.json\"].spritesheet;\n sprite = new PIXI.AnimatedSprite(resource.animations.idle);\n // console.log('its lit');\n\n sprite = sprite;\n\n sprite.height = 35;\n sprite.width = 47;\n sprite.anchor.set(0.5, 0);\n sprite.x = 16;\n sprite.y = 192 - (16*8);\n sprite.play();\n sprite.animationSpeed = 0.1;\n\n spriteHurtBox = new hurtBox(sprite);\n spriteHurtBox.calculateCharEdges();\n gameController = new controller(sprite);\n \n\n}", "title": "" }, { "docid": "7e3905a4f0a91557d67bb90ffa7306f3", "score": "0.6870037", "text": "render() {\n let characterStatus = null;\n this.setFalling();\n\n let standingCharacter = [\n 12, // image: x - location\n 11, // image: y - location\n 11, // image: x - span\n 16, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height + 2, // image: height\n ];\n\n let movingCharacter = {\n // sequence 1\n 1: [\n 52, // image: x - location\n 11, // image: y - location\n 12, // image: x - span\n 16, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height + 2, // image: height\n ],\n // sequence 2\n 2: [\n 52, // image: x - location\n 40, // image: y - location\n 12, // image: x - span\n 16, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height + 2, // image: height\n ],\n // sequence 3\n 3: [\n 52, // image: x - location\n 71, // image: y - location\n 12, // image: x - span\n 16, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height + 2, // image: height\n ],\n // sequence 4\n 4: [\n 52, // image: x - location\n 101, // image: y - location\n 12, // image: x - span\n 16, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height + 2, // image: height\n ],\n // sequence 5\n 5: [\n 52, // image: x - location\n 130, // image: y - location\n 12, // image: x - span\n 16, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height + 2, // image: height\n ],\n // sequence 6\n 6: [\n 52, // image: x - location\n 161, // image: y - location\n 12, // image: x - span\n 16, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height + 2, // image: height\n ],\n };\n\n let swimmingCharacter = {\n // swimming 1\n 1: [\n 173, // image: x - location\n 10, // image: y - location\n 16, // image: x - span\n 18, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height, // image: height\n ],\n // swimming 2\n 2: [\n 173, // image: x - location\n 38, // image: y - location\n 16, // image: x - span\n 18, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height, // image: height\n ],\n // swimming 3\n 3: [\n 173, // image: x - location\n 69, // image: y - location\n 16, // image: x - span\n 18, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height, // image: height\n ],\n // swimming 4\n 4: [\n 173, // image: x - location\n 99, // image: y - location\n 16, // image: x - span\n 18, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height, // image: height\n ],\n // swimming 5\n 5: [\n 173, // image: x - location\n 128, // image: y - location\n 16, // image: x - span\n 18, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height, // image: height\n ],\n // swimming 6\n 6: [\n 173, // image: x - location\n 159, // image: y - location\n 16, // image: x - span\n 18, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height, // image: height\n ],\n };\n\n let parachute = [\n 214, // image: x - location\n 10, // image: y - location\n 18, // image: x - span\n 16, // image: y - span\n this.x - 5, // image: x- positioning\n this.y - 25, // image: y - positioning\n this.width + 10, // image: width\n this.height + 6, // image: height\n ];\n\n let crouchingCharacter = [\n 216, // image: x - location\n 101, // image: y - location\n 12, // image: x - span\n 16, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height + 2, // image: height\n ];\n\n let jumpingCharacter = [\n 92, // image: x - location\n 10, // image: y - location\n 14, // image: x - span\n 18, // image: y - span\n this.x, // image: x- positioning\n this.y, // image: y - positioning\n this.width, // image: width\n this.height + 2, // image: height\n ];\n if (!this.swimming) {\n if (this.velY < 0) { // mattL - the player is rising up if velocity < 0\n characterStatus = jumpingCharacter;\n this.drawCharacter(jumpingCharacter);\n }\n else if (this.falling && this.crouching) {\n characterStatus = [parachute, standingCharacter];\n this.drawCharacter(parachute);\n this.drawCharacter(standingCharacter);\n }\n else if (this.crouching) {\n characterStatus = crouchingCharacter;\n this.drawCharacter(crouchingCharacter);\n }\n // mattL - if the velocity is greater than 0.5\n // then the player is moving at a noticeable rate\n else if (Math.abs(this.velX) > 0.5) {\n this.characterFrame += 1;\n // mattL - increments the movingCharacter Frame Sequence to make the\n // character look like it's moving. '/ 5' sets the animation speed\n let frame = Math.floor(this.characterFrame / 5);\n // mattL - '(% 6) + 1' selects the character frame\n // ex: sequence 1 through 6\n characterStatus = movingCharacter[(frame % 6) + 1];\n this.drawCharacter(movingCharacter[(frame % 6) + 1]);\n } else {\n this.characterFrame = 0;\n this.walkingCycle = 0;\n characterStatus = standingCharacter;\n this.drawCharacter(standingCharacter);\n }\n\n } else { // mattL - if the player is swimming\n this.characterFrame += 1;\n let frame = Math.floor(this.characterFrame / 5);\n\n characterStatus = swimmingCharacter[(frame % 6) + 1];\n this.drawCharacter(swimmingCharacter[(frame % 6) + 1]);\n }\n \n\n // =========== Second Player ===========\n this.drawOtherPlayer(this.secondPlayer);\n\n if (this.playerInterval === 0) {\n this.playerInterval = 2;\n\n socket.emit('update-player', ({\n currentLevel: this.currentLevel,\n direction: this.direction,\n characterStatus,\n score : this.score,\n }));\n\n socket.on('render-players', (secondPlayer) => {\n this.secondPlayer = secondPlayer;\n });\n\n socket.on('return-star', (secondPlayer) => {\n this.starIsCaptured = true;\n socket.off('return-star');\n });\n }\n\n this.playerInterval --;\n }", "title": "" }, { "docid": "039142bb11c41f97494ad94ff8309f62", "score": "0.6858534", "text": "function draw() {\r\n\r\n background(120);\r\n\r\n // draw each frame based on the index in the array\r\n if(keyIsPressed)\r\n {\r\n if(key == \"d\")\r\n {\r\n // continue to display the image\r\n image(runanimation[j], ninjaRunObjects[j].getX(), ninjaRunObjects[j].getY());\r\n // this section slows the running right\r\n counter++;\r\n if(counter > 5)\r\n {\r\n // increment the index \"j\"\r\n incrementRunIndex();\r\n // restart our counter\r\n counter = 0;\r\n } \r\n }\r\n if(key == \"s\")\r\n {\r\n // continue to display the image\r\n image(runanimation[j], ninjaRunObjects[j].getX(), ninjaRunObjects[j].getY());\r\n // this section slows the running down\r\n counter++;\r\n if(counter > 5)\r\n {\r\n // increment the index \"j\"\r\n incrementRunIndex();\r\n // restart our counter\r\n counter = 0;\r\n } \r\n }\r\n if(key == \"a\")\r\n {\r\n // continue to display the image\r\n image(runanimation[j], ninjaRunObjects[j].getX(), ninjaRunObjects[j].getY());\r\n // this section slows the running left\r\n counter++;\r\n if(counter > 5)\r\n {\r\n // increment the index \"j\"\r\n incrementRunIndex();\r\n // restart our counter\r\n counter = 0;\r\n } \r\n }\r\n if(key == \"w\")\r\n {\r\n // continue to display the image\r\n image(runanimation[j], ninjaRunObjects[j].getX(), ninjaRunObjects[j].getY());\r\n // this section slows the jumping up\r\n counter++;\r\n if(counter > 5)\r\n {\r\n // increment the index \"j\"\r\n incrementRunIndex();\r\n // restart our counter\r\n counter = 0;\r\n } \r\n }\r\n if(key == \"x\")\r\n {\r\n // continue to display the image\r\n image(runanimation[x], ninjaRunObjects[x].getX(), ninjaRunObjects[x].getY());\r\n // this section slows the attack\r\n counter++;\r\n if(counter > 5)\r\n {\r\n // increment the index \"x\"\r\n incrementRunIndex();\r\n // restart our counter\r\n counter = 0;\r\n } \r\n }\r\n\r\n\r\n }\r\n else\r\n {\r\n image(animation[i], ninjaObjects[i].getX(), ninjaObjects[i].getY());\r\n }\r\n \r\n\r\n}", "title": "" }, { "docid": "55a13637c239a2a7c7f5e0d53fd947e6", "score": "0.68175524", "text": "function animate(){\r\n ctx.clearRect(0, 0, cW, cH);\r\n launcher.render();\r\n renderEnemies(enemies, enemies2);\r\n }", "title": "" }, { "docid": "0b125a42e843c214cc32ff6f4e2fdabe", "score": "0.6815096", "text": "basicAnimation(sprite) { // sprite is the sprite to which the animation should be applied\n var frames = [];\n for(var m = 0; m < sprite.nbFrames; m++){ // Generate the list of frames of the animations based on the initial frame and the total number of frames\n frames.push(sprite.frame+m);\n }\n sprite.animations.add('idle', frames, sprite.rate, true);\n sprite.animations.play('idle');\n }", "title": "" }, { "docid": "49f8d4c0496bf23f70e55ef869b08e85", "score": "0.6782588", "text": "animateSprite() {\n this.tickCount += 1;\n\n if (this.tickCount > this.ticksPerFrame) {\n this.tickCount = 0;\n\n if (this.frameIndex >= this.currentSpriteImages.length - 1) {\n\n this.frameIndex = 0;\n if(this.respawnShield === false) this.currentSpriteImages = ShipSprites.default;\n }\n else { this.frameIndex += 1; }\n }\n }", "title": "" }, { "docid": "6047a3c4ff192ca812d489a2bf4d64e1", "score": "0.6715772", "text": "function draw() {\r\n background(backgroundImg);\r\n\r\n if(keyDown(LEFT_ARROW)){\r\n balloon.addAnimation(\"hotAirBalloon\",balloonImage2);\r\n balloon.x = balloon .x -10\r\n }\r\n else if(keyDown(RIGHT_ARROW)){\r\n balloon.addAnimation(\"hotAirBalloon\",balloonImage2);\r\n balloon.x = balloon.x +10\r\n }\r\n else if(keyDown(UP_ARROW)){\r\n balloon.addAnimation(\"hotAirBalloon\",balloonImage2);\r\n balloon.y = balloo.y -10\r\n }\r\n else if(keyDown(DOWN_ARROW)){\r\n balloon.addAnimation(\"hotAirBalloon\",balloonImage2);\r\n balloon.y = balloon.y +10\r\n }\r\n\r\n drawSprites();\r\n \r\n}", "title": "" }, { "docid": "c5549276c86e0309a03baf4123e3eef5", "score": "0.67038447", "text": "cheer() {\n this.heroSprite.play(\"winAnimation\"); // play winning animation\n }", "title": "" }, { "docid": "c685e54324de9fabb3823aa3e8df56f3", "score": "0.66848946", "text": "function playerChar(x,y){\n // The player character's stored stuff\n// the players info\n var id=\"player\";\n var layer=2;\n var type=\"motion\";\n var tags=[\"player\"];\n Entity.call(this,x,y,id,layer,type,tags);\n// stuff that pertains to the players state\n this.facing=\"right\";\n this.width = 61;\n this.height = 61;\n this.yVel=0;\n this.hp=10;\n this.iframes=0;\n this.cooldown=0;\n// players selected powers\n this.selected1=\"magic missle\";\n this.selected2=\"staff hit\";\n// players inventory\n this.inventory=[\"med kit\", 2 ,\"bomb\", 2];\n this.powers=[\"staff hit\", \"magic missle\"];\n// used for animating\n this.tickCount = 0;\n this.ticksPerFrame = 6;\n\n this.runFrames = 8;\n this.runFrameIndex = 0;\n this.idleFrames = 4;\n this.idleFrameIndex = 0;\n this.jumpFrames = 1;\n this.jumpFrameIndex = 0;\n\n this.falling = false;\n// players update function. It updates the players above state.\n this.update = function(){\n// checks if falling. Used to draw the parachute\n if(this.yVel > 20){\n this.falling=true;\n }\n else{\n this.falling = false;\n }\n// used to check if the player is facing left or right. Used to determine if it should be drawn\n// left or right, aswell as fire direction if another direction is not held\n if(pressingLeft) {this.facing=\"left\"}\n if(pressingRight) {this.facing=\"right\"}\n// moves the player if not pressing halt\n if(!pressingHalt){\n if(pressingDown) this.y = this.y+12;\n if(pressingUp) this.y = this.y-20;\n if(pressingLeft) this.x = this.x-12;\n if(pressingRight) this.x = this.x+12;\n }\n// Updates the players gravity.\n this.yVel=this.yVel+1\n if(this.yVel>30){\n (this.yVel=30);\n }\n this.y=this.y+this.yVel;\n// If the player ions invicible, decreases the Iframes by one\n if(this.iframes>0){\n this.iframes=this.iframes-1;\n }\n// If the cooldown is 0 (player is ready to use an ability), checks for the following\n if(this.cooldown==0){\n // We priortize the power on button one over button two.\n if(pressingPower1==true){\n //We pass the direction, aswell as the current power, to the player projectile function.\n if(pressingLeft){\n this.addToList(new playerProjectile(this.x,this.y+this.height/2,\"left\",this.selected1));\n this.cooldown=this.cooldown+getProjectileCooldown(this.selected1);\n playProjectileSound(this.selected1);\n }\n else if(pressingRight){\n this.addToList(new playerProjectile(this.x+61,this.y+this.height/2,\"right\",this.selected1));\n this.cooldown=this.cooldown+getProjectileCooldown(this.selected1);\n playProjectileSound(this.selected1);\n }\n else if(pressingDown){\n this.addToList(new playerProjectile(this.x+this.width/2,this.y+61,\"down\",this.selected1));\n this.cooldown=this.cooldown+getProjectileCooldown(this.selected1);\n playProjectileSound(this.selected1);\n }\n else if(pressingUp){\n this.addToList(new playerProjectile(this.x+this.width/2,this.y,\"up\",this.selected1));\n this.cooldown=this.cooldown+getProjectileCooldown(this.selected1);\n playProjectileSound(this.selected1);\n }\n // If no direction is held, we check the direction facing rto determine where it should fire from\n else{\n if(this.facing==\"right\"){\n this.addToList(new playerProjectile(this.x+61,this.y+this.height/2,\"right\",this.selected1));\n this.cooldown=this.cooldown+getProjectileCooldown(this.selected1); \n playProjectileSound(this.selected1);\n }\n else{\n this.addToList(new playerProjectile(this.x,this.y+this.height/2,\"left\",this.selected1));\n this.cooldown=this.cooldown+getProjectileCooldown(this.selected1); \n playProjectileSound(this.selected1);\n }\n }\n }\n // same as above, but with the other button\n else if(pressingPower2==true){\n if(pressingLeft){\n this.addToList(new playerProjectile(this.x,this.y+this.height/2,\"left\",this.selected2));\n this.cooldown=this.cooldown+getProjectileCooldown(this.selected2);\n playProjectileSound(this.selected2);\n }\n else if(pressingRight){\n this.addToList(new playerProjectile(this.x+61,this.y+this.height/2,\"right\",this.selected2));\n this.cooldown=this.cooldown+getProjectileCooldown(this.selected2);\n playProjectileSound(this.selected2);\n }\n else if(pressingDown){\n this.addToList(new playerProjectile(this.x+this.width/2,this.y+61,\"down\",this.selected2));\n this.cooldown=this.cooldown+getProjectileCooldown(this.selected2);\n playProjectileSound(this.selected2);\n }\n else if(pressingUp){\n this.addToList(new playerProjectile(this.x+this.width/2,this.y,\"up\",this.selected2));\n this.cooldown=this.cooldown+getProjectileCooldown(this.selected2);\n playProjectileSound(this.selected2);\n }\n else{\n if(this.facing==\"right\"){\n this.addToList(new playerProjectile(this.x+61,this.y+this.height/2,\"right\",this.selected2));\n this.cooldown=this.cooldown+getProjectileCooldown(this.selected1); \n playProjectileSound(this.selected2); \n }\n else{\n this.addToList(new playerProjectile(this.x,this.y+this.height/2,\"left\",this.selected2));\n this.cooldown=this.cooldown+getProjectileCooldown(this.selected2); \n playProjectileSound(this.selected2);\n }\n }\n }\n //If not ready to use an ability(on cooldwon), lower the cooldown counter\n }else{\n this.cooldown=this.cooldown-1\n }\n }\n //the draw function for the player Uses the indexes in the playerChar variables to draw and \n // properly animate the player character. It chooses the image to drawn based on these indexes\n // and state\n this.draw = function(){\n this.tickCount += 1;\n if(this.tickCount > this.ticksPerFrame){\n this.runFrameIndex++;\n this.idleFrameIndex++;\n this.jumpFrameIndex++;\n this.tickCount = 0;\n if(this.runFrameIndex >= this.runFrames)\n this.runFrameIndex = 0;\n if(this.idleFrameIndex >= this.idleFrames)\n this.idleFrameIndex = 0;\n if(this.jumpFrameIndex >= this.jumpFrames)\n this.jumpFrameIndex = 0;\n }\n\n if(this.iframes%2==0){\n var img = ImageAtlas[playerAnimKey];\n\n if(pressingUp){ //JUMPING\n\n offset = 8*64+64;\n if(this.falling){\n var paraImg = ImageAtlas[parachuteKey];\n ctx.drawImage(\n paraImg, // image\n 600+5, // target x\n 330-35, // target y\n 45, // target width\n 45 // target height\n );\n //Deploy parachute\n }\n \n //Idle animation\n if(this.facing == \"right\"){\n ctx.drawImage(\n img, // image\n 64*this.jumpFrameIndex + offset,//sx \tSource x \t\n 64, //sy \tSource y \t\n 64,//sw \tSource width \tFrame width\n 64,//sh \tSource height \tFrame height\n 600, // target x\n 330, // target y\n 61, // target width\n 61 // target height\n );\n }\n else if(this.facing == \"left\"){\n ctx.drawImage(\n img, // image\n ((this.jumpFrames*2)*64-64) - (64*this.jumpFrameIndex) + offset,//sx \tSource x \t\n 64, //sy \tSource y \t\n 64,//sw \tSource width \tFrame width\n 64,//sh \tSource height \tFrame height\n 600, // target x\n 330, // target y\n 61, // target width\n 61 // target height\n );\n }\n }\n else if(pressingLeft){\n //Moving Left\n //Starts of the far right of sprite sheet\n ctx.drawImage(\n img, // image\n (img.width-64) - (64*this.runFrameIndex),//sx \tSource x \t\n 0, //sy \tSource y \t\n 64,//sw \tSource width \tFrame width\n 64,//sh \tSource height \tFrame height\n 600, // target x\n 330, // target y\n 61, // target width\n 61 // target height\n );\n }\n else if(pressingRight){\n //Moving Right \n ctx.drawImage(\n img, // image\n 64*this.runFrameIndex,//sx \tSource x \t\n 0, //sy \tSource y \t\n 64,//sw \tSource width \tFrame width\n 64,//sh \tSource height \tFrame height\n 600, // target x\n 330, // target y\n 61, // target width\n 61 // target height\n );\n }\n else{\n //Idle animation\n if(this.facing == \"right\"){\n ctx.drawImage(\n img, // image\n 64*this.idleFrameIndex,//sx \tSource x \t\n 64, //sy \tSource y \t\n 64,//sw \tSource width \tFrame width\n 64,//sh \tSource height \tFrame height\n 600, // target x\n 330, // target y\n 61, // target width\n 61 // target height\n );\n }\n else if(this.facing == \"left\"){\n ctx.drawImage(\n img, // image\n ((this.idleFrames*2)*64-64) - (64*this.idleFrameIndex),//sx \tSource x \t\n 64, //sy \tSource y \t\n 64,//sw \tSource width \tFrame width\n 64,//sh \tSource height \tFrame height\n 600, // target x\n 330, // target y\n 61, // target width\n 61 // target height\n );\n } \n }\n }\n }\n\n// The functions for player colliosion. When the player collides with an object, will select the \n// appropiate collision function based on the parameter.\n this.collision = function(entityC){\n if(entityC.tags.includes(\"block\")){\n sideColided=playercheckSide(this , entityC)\n if(sideColided==\"bottom\"){\n this.y=entityC.y-60;\n this.yVel=0;\n }\n if(sideColided==\"top\"){\n this.y=entityC.y+60;\n }\n if(sideColided==\"left\"){\n this.x=entityC.x+60;\n }\n if(sideColided==\"right\"){\n this.x=entityC.x-60;\n }\n }\n if(entityC.tags.includes(\"damaging\")){\n if(this.iframes==0){\n this.hp=this.hp-1;\n console.log(this.hp);\n this.iframes=80;\n playASound(\"soundEffects/damageTaken.mp3\");\n }\n }\n }\n}", "title": "" }, { "docid": "c56df3f71ed82a2c53e2eb57162f1547", "score": "0.66799325", "text": "function displaySprite(character ,animationArray, arrayIndex) {\n // Change the elements image path to one from the given array at the given index.\n character.attr(\"src\", animationArray[arrayIndex]);\n }", "title": "" }, { "docid": "61f8bf147b7a0273ad11697148b3b076", "score": "0.66765887", "text": "function Sprite(options) {\n\n //Sprite object properties\n var that = {}, //holds sprite properties\n frameIndex = 0, //what frame are we on\n tickCount = 0, //how much 'time' has gone by\n ticksPerFrame = options.ticksPerFrame || 0, //how many ticks must pass for a channge\n numberOfFrames = options.numberOfFrames || 1; //how many frames in this image\n\n\n that.context = options.context; //where is it drawn\n that.width = options.width;\n that.height = options.height;\n that.x = options.x; //where is it on the canvas\n that.y = options.y;\n that.deltaX = Math.floor(Math.random() * 5 + 5); //position change\n that.deltaX *= Math.floor(Math.random() * 2) == 1 ? 1 : -1;//randomize negative or positive\n that.deltaY = Math.floor(Math.random() * 5 + 5);\n that.deltaY *= Math.floor(Math.random() * 2) == 1 ? 1 : -1;\n that.image = options.image;\n that.name = options.name;\n that.scaleRatio = options.scaleRatio;\n that.destroy = false; //should we destroy it?\n\n //Sprite functions\n //update the properties as time goes\n that.update = function() {\n\n tickCount += 1;\n if (tickCount > ticksPerFrame) { //we will change it\n that.x += that.deltaX;\n that.y += that.deltaY;\n tickCount = 0;\n\n // If the current frame index is in range\n if (frameIndex < numberOfFrames - 1) {\n // Go to the next frame\n frameIndex += 1;\n } else {\n frameIndex = 0;\n }\n }\n };\n\n // Draw the animation\n //return whether or not to destroy it (i.e. it went off the screen)\n that.render = function() {\n //are we now off the screen?\n if (that.x < (-1 * that.width / numberOfFrames) || that.x > canvas.width || that.y < (-1 * that.height) || that.y > canvas.height) {\n return true;\n }\n\n //built-in function that takes the following parameters\n that.context.drawImage(\n that.image,\n frameIndex * that.width / numberOfFrames,\n 0,\n that.width / numberOfFrames,\n that.height,\n that.x,\n that.y,\n that.width / numberOfFrames * that.scaleRatio,\n that.height * that.scaleRatio);\n\n //output some info to the console\n console.log(\"sprite: \" + that.name + \" x: \" + that.x + \" y: \" + that.y);\n return false;\n };\n\n return that;\n}", "title": "" }, { "docid": "0fe5f31f8759aa8e77653af875ee133b", "score": "0.6664359", "text": "function playCharacter(){\n const newResource = PIXI.Loader.shared.resources['./Assets/adventurer-Sheet.json'];\n setupCharacter();\n\n document.addEventListener('keydown', (e) => {\n\n //gameController.movement(e);\n\n });\n document.addEventListener('keypress', (e) => {\n\n //gameController.keyP(e);\n isKeyDown = true;\n gameController.movement(e, spriteHurtBox);\n state = updateState(gameController.vx, gameController.vy, sprite);\n let currentTextures = newResource.spritesheet.animations[state];\n if (sprite.textures != currentTextures) {\n sprite.textures = currentTextures;\n sprite.play();\n }\n\n\n });\n document.addEventListener('keyup', (e) => {\n gameController.stopMovement(e, spriteHurtBox);\n state = updateState(gameController.vx, gameController.vy, sprite);\n sprite.textures = newResource.spritesheet.animations[state];\n sprite.play();\n\n });\n\n \n\n \n app.ticker.add(() => {\n if(damageboost > 0) {\n damageboost -= app.deltaTime;\n }\n characterMovement();\n\n console.log('hurtbox of the enemy:');\n enemyHurtBox.calculateEdges();\n console.log(enemyHurtBox);\n\n console.log(\"collision with enemy: \" + spriteHurtBox.collideWithEnemy(enemyHurtBox));\n\n if(damageboost <= 0 && spriteHurtBox.AABBCollision(spriteHurtBox, enemyHurtBox)){\n if(hearts > 1)\n {\n container.removeChild(heartArray[hearts - 1]);\n hearts--;\n alert('that enemy has taken your health.');\n gameController.vx = 0;\n gameController.vy = 0;\n sprite.x += (10 * spriteHurtBox.horiCollision(enemyHurtBox));\n //damageboost = app.deltaTime;\n //sprite.x = 16;\n //sprite.y = 192 - (16 * 8);\n } else if(hearts == 1){\n alert('you died.');\n gameController.vx = 0;\n gameController.vy = 0;\n sprite.x = 16;\n sprite.y = 192 - (16 * 8);\n hearts = 3;\n for (let i = 0; i < 3; i++) {\n heartArray[i] = new PIXI.Sprite.from('./Assets/heart.png');\n heartArray[i].height = 8;\n heartArray[i].width = 8;\n heartArray[i].x = 16 * i + 3;\n heartArray[i].y = 4;\n container.addChild(heartArray[i]);\n }\n reset++;\n }\n }\n\n\n\n state = updateState(gameController.vx, gameController.vy, sprite);\n let currentTextures = newResource.spritesheet.animations[state];\n if (sprite.textures != currentTextures) {\n sprite.textures = currentTextures;\n sprite.play();\n }\n gameController.move();\n\n \n\n\n if(sprite.x + spriteHurtBox.width/2 >= 800){\n alert('congratulations! you beat the demo');\n if (hearts == 3 && reset == 0) {\n alert('All hearts and 0 resets! You got an A+!')\n } else if (hearts == 3 && 2 > reset > 0 || (hearts == 2 && reset < 2)) {\n alert('All hearts and ' + reset + ' resets! You get a B')\n } else if (hearts == 2 && reset == 3 || reset == 4) {\n alert('2 hearts and ' + reset + ' resets! You get a C');\n } else if (hearts == 1 && reset == 0) {\n alert('You barely got it in one try. You can have a B+');\n } else if (hearts == 1 && 2 > reset > 0){\n alert('hmmm a few resets and a missing heart. You get a C');\n } else if (hearts == 1 && reset == 3){\n alert('You barely deserve the congratulations. You get a D!');\n } else if (hearts == 1 && reset > 3){\n alert('Sike. You get an F! 1 heart left and ' + reset + 'resets?! That is more than 3!');\n } else {\n alert('You get an F idk');\n }\n sprite.x = 16;\n sprite.y = 192 - (16 * 8);\n \n }\n\n if(spriteHurtBox.bottomEdge >= 240){\n alert('you died.');\n sprite.x = 16;\n sprite.y = 192 - (16*8);\n reset++;\n if(hearts == 0){\n for (let i = 0; i < 3; i++) {\n heartArray[i] = new PIXI.Sprite.from('./Assets/heart.png');\n heartArray[i].height = 8;\n heartArray[i].width = 8;\n heartArray[i].x = 16 * i + 3;\n heartArray[i].y = 4;\n container.addChild(heartArray[i]);\n }\n }\n }\n \n /*if(3 > hearts > 0){\n container.removeChild(heartArray[hearts - 1]);\n }*/\n \n\n \n });\n\n /*sprite.onFrameChange = function () {\n gameController.move();\n }*/\n \n\n}", "title": "" }, { "docid": "4e14f10fbaaec031458563d833e46c96", "score": "0.66474414", "text": "constructor(spriteSheet){\n super(spriteSheet);\n\n // Set player body properties.\n this.body.size.x = 24;\n this.body.size.y = 24;\n this.body.mass = 2;\n this.body.position.x = 0;\n this.body.position.y = 0;\n\n // Add animations for various player states.\n this.sprite.addAnimation('default', new Engine.Animation([\n [1,0]\n ], 1000));\n\n this.sprite.addAnimation('walk-up', new Engine.Animation([\n [1,3],\n [2,3],\n [3,3]\n ], 200));\n\n this.sprite.addAnimation('walk-down', new Engine.Animation([\n [0,0],\n [1,0],\n [2,0]\n ], 200));\n\n this.sprite.addAnimation('walk-left', new Engine.Animation([\n [0,1],\n [1,1],\n [2,1]\n ], 200));\n\n this.sprite.addAnimation('walk-right', new Engine.Animation([\n [0,2],\n [1,2],\n [2,2],\n ], 200));\n\n this.sprite.addAnimation('walk-upright', new Engine.Animation([\n [3,3],\n [4,3],\n [5,3]\n ], 200));\n\n this.sprite.addAnimation('walk-upleft', new Engine.Animation([\n [3,1],\n [4,1],\n [5,1]\n ], 200));\n\n this.sprite.addAnimation('walk-downright', new Engine.Animation([\n [3,2],\n [4,2],\n [5,2]\n ], 200));\n\n this.sprite.addAnimation('walk-downleft', new Engine.Animation([\n [3,0],\n [4,0],\n [5,0]\n ]), 200);\n\n }", "title": "" }, { "docid": "25baca8879060e7abea237df2cb1997b", "score": "0.6640664", "text": "function Character(x, y){\n this.x = x;\n this.y = y;\n// this.img = img;\n \n function display(wid, hei){\n image(this.img, this.x, this.y, wid, hei);\n }\n \n function jump(){\n this.y -= 5;\n }\n \n function fall(){\n this.y += 5;\n }\n}", "title": "" }, { "docid": "c471fffe7d377d977c0ee7aa2d69e97e", "score": "0.6638328", "text": "start(){\n player.sprite.position.x = 270;\n friend.sprite.position.x = 320;\n player.sprite.position.y = 1326;\n friend.sprite.position.y = 1326;\n }", "title": "" }, { "docid": "685d85bc7db295a84398e74825edd7f5", "score": "0.66255456", "text": "function draw()\r\n{\r\n backCtx.clearRect(0, 0, W, H);\r\n\r\n multiplicationCharacter.updateFrame();\r\n\r\n\r\n updateBackgroundEffects(1);\r\n backCtx.drawImage(multiplicationCharacter.image, multiplicationCharacter.srcX, multiplicationCharacter.srcY, multiplicationCharacter.spriteWidth,\r\n multiplicationCharacter.spriteHeight, 160, 150, multiplicationCharacter.spriteWidth, multiplicationCharacter.spriteHeight);\r\n}", "title": "" }, { "docid": "5919c3640a74fbc7e42b409ce3efea84", "score": "0.66105753", "text": "function Hero() {\n\n //Create a rectangle object that defines the position and\n //size of the sub-image you want to extract from the texture\n frames = {\n front: [new PIXI.Rectangle(188, 128, 30, 30), new PIXI.Rectangle(220, 128, 30, 30), new PIXI.Rectangle(252, 128, 30, 30)],\n back: [new PIXI.Rectangle(188, 224, 30, 30), new PIXI.Rectangle(220, 224, 30, 30), new PIXI.Rectangle(252, 224, 30, 30)],\n right: [new PIXI.Rectangle(188, 192, 30, 30), new PIXI.Rectangle(220, 192, 30, 30), new PIXI.Rectangle(252, 192, 30, 30)],\n left: [new PIXI.Rectangle(188, 160, 30, 30), new PIXI.Rectangle(220, 160, 30, 30), new PIXI.Rectangle(252, 160, 30, 30)]\n };\n\n //Loads texture from tileset\n var texture = new PIXI.Texture(PIXI.BaseTextureCache[\"assets/tileset.png\"], frames.front[0]);\n this.hasKey = false;\n //Tell the texture to use that rectangular section\n this.sprite = new PIXI.Sprite(texture);\n\n //sprites.hero.setFrame(frames.hero.front[0]);\n var animationCounter = 0;\n var animationInterval = null;\n\n //Constructor to set initial speed and location of sprite (hero)\n this.init = function() {\n //location\n this.sprite.x = 240;\n this.sprite.y = 240;\n\n //speed\n this.sprite.vy = 0;\n this.sprite.vx = 0;\n }\n this.init();\n\n /***********Setters begin***********/\n this.setPosition = function(x, y) {\n this.sprite.x = x;\n this.sprite.y = y;\n };\n\n this.setSpeed = function(vx, vy) {\n this.sprite.vx = vx;\n this.sprite.vy = vy;\n };\n /************Setters end************/\n\n /***********Getters begin***********/\n\n this.getSprite = function() {\n return this.sprite;\n };\n\n /************Getters end************/\n\n\n //Move function to control hero keyboard movements\n\n this.moveHero = function() {\n // Handle Keyboard\n //Capture the keyboard arrow keys\n var left = keyboard(37),\n up = keyboard(38),\n right = keyboard(39),\n down = keyboard(40);\n\n //Create inner scope for this object\n innerHero = this.getSprite();\n\n //Handle sprite collision by setting boundaries\n contain(this.sprite, {\n x: 28,\n y: 10,\n width: 488,\n height: 480\n });\n\n //Left arrow key `press` method\n var interval;\n left.press = function() {\n //Change the hero's velocity when the key is pressed\n innerHero.vx = -3;\n innerHero.vy = 0;\n var counter = 0;\n clearInterval(interval);\n texture.setFrame(frames.left[counter]);\n interval = setInterval(function() {\n texture.setFrame(frames.left[counter]);\n counter = (counter + 1) % 3;\n }, 100);\n };\n //Left arrow key `release` method\n left.release = function() {\n //If the left arrow has been released, and the right arrow isn't down,\n //and the hero isn't moving vertically:\n //Stop the hero\n if (!right.isDown && innerHero.vy === 0) {\n innerHero.vx = 0;\n clearInterval(interval);\n }\n };\n\n //Up\n var upTimeout;\n up.press = function() {\n innerHero.vy = -3;\n innerHero.vx = 0;\n var counter = 0;\n texture.setFrame(frames.back[counter]);\n clearInterval(interval);\n interval = setInterval(function() {\n texture.setFrame(frames.back[counter]);\n counter = (counter + 1) % 3;\n }, 100);\n };\n up.release = function() {\n if (!down.isDown && innerHero.vx === 0) {\n innerHero.vy = 0;\n clearInterval(interval);\n }\n };\n\n //Right\n var rightTimeout;\n right.press = function() {\n innerHero.vx = 3;\n innerHero.vy = 0;\n var counter = 0;\n texture.setFrame(frames.right[counter]);\n clearInterval(interval);\n interval = setInterval(function() {\n texture.setFrame(frames.right[counter]);\n counter = (counter + 1) % 3;\n }, 100);\n };\n right.release = function() {\n if (!left.isDown && innerHero.vy === 0) {\n innerHero.vx = 0;\n clearInterval(interval);\n }\n };\n\n //Down\n var downTimeout;\n down.press = function() {\n\n innerHero.vy = 3;\n innerHero.vx = 0;\n\n var counter = 0;\n texture.setFrame(frames.front[counter]);\n clearInterval(interval);\n interval = setInterval(function() {\n texture.setFrame(frames.front[counter]);\n counter = (counter + 1) % 3;\n }, 100);\n };\n down.release = function() {\n if (!up.isDown && innerHero.vx === 0) {\n innerHero.vy = 0;\n clearInterval(interval);\n }\n };\n\n //updates player location based on speed.\n this.sprite.x += innerHero.vx;\n this.sprite.y += innerHero.vy;\n }\n}", "title": "" }, { "docid": "d6c90a2733b65195e242202160babc0e", "score": "0.65965915", "text": "function animate() {\n \n // @TODO add code\n \n // update sprites\n for ( var i = 0; i < game.sprites.length; i++) {\n // compute new attributes\n // position\n game.sprites[i].position.x += game.speed * game.sprites[i].speed.x;\n game.sprites[i].position.y += game.speed * game.sprites[i].speed.y;\n // size\n if (game.sprites[i].growing) {\n game.sprites[i].size += game.speed\n * Math.sqrt(game.sprites[i].speed.x\n * game.sprites[i].speed.x + game.sprites[i].speed.y\n * game.sprites[i].speed.y) / 10;\n }\n // set sprite attributes\n // position\n game.sprites[i].sprite.position.x = game.sprites[i].position.x;\n game.sprites[i].sprite.position.y = game.sprites[i].position.y;\n // rotation\n game.sprites[i].sprite.rotation = Math.atan2(game.sprites[i].speed.y,\n game.sprites[i].speed.x);\n // scale\n if ('size' in game.sprites[i]) {\n game.sprites[i].sprite.scale.x = game.sprites[i].size\n / game.sprites[i].sprite.texture.width;\n game.sprites[i].sprite.scale.y = game.sprites[i].size\n / game.sprites[i].sprite.texture.width;\n }\n }\n \n // render\n renderer.render(stage);\n \n requestAnimFrame(animate);\n}", "title": "" }, { "docid": "4dbf8db25fe671541cb60261136af4f9", "score": "0.65713334", "text": "constructor() {\n this.sprite = 'images/char-boy.png';\n this.horizontal = 101; // size of steps left/right\n this.vertical = 83; // size of steps up/down\n this.startX = this.horizontal * 2; // start in the center of the X axis\n this.startY = (this.vertical * 4) + 55; // start in the bottom of the Y axis\n this.x = this.startX; // current x axis position\n this.y = this.startY; // current y axis position\n this.win = false;\n }", "title": "" }, { "docid": "408292bafd439098203b3ef3b04c769d", "score": "0.65570515", "text": "function animate() {\n clearInterval(randomCharMove);\n if (characters.length > 0) {\n isMoving = true;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n p1.draw();\n characters.forEach(function (character) {\n ctx.beginPath();\n ctx.rect(character.x, character.y, character.health, 5);\n ctx.fillStyle = '#03fc20';\n ctx.fill();\n ctx.closePath();\n character.draw();\n character.update();\n len = Object.keys(obstaclePosition).length;\n obstacle = Object.keys(obstaclePosition)\n if (len > 0) {\n if (obstaclePosition['archerTower2'] || obstaclePosition['archerTower']) {\n if (flag) {\n fx -= 3;\n archer_attack.play();\n setTimeout(ctx.drawImage(image6, 1202, 284, 172, 33, fx, fy, 25, 15), 2000);\n if (fx - character.x < 5) {\n if (character.health > 5) {\n character.health -= 2;\n }\n fx = 20;\n fy = 210;\n }\n }\n }\n flag = true;\n for (var j = 0; j < len; j++) {\n if (obstaclePosition[obstacle[j]].y - character.y < 30) {\n if (fx - character.x < 20) {\n flag = false;\n if (character.health < 0) {\n delete character;\n }\n\n }\n\n if (character.direction === 'right') {\n if (obstaclePosition[obstacle[j]].x - character.x < 30) {\n drag_fire.play();\n ctx.drawImage(image6, 2232, 2520, 219, 252, character.x + 30, character.y + 20, 30, 20);\n ctx.beginPath();\n ctx.rect(obstaclePosition[obstacle[j]].x - 10, obstaclePosition[obstacle[j]].y - 10, 40, 5);\n ctx.fillStyle = 'blue';\n ctx.fill();\n ctx.closePath();\n character.attacking = true;\n let x = obstaclePosition[obstacle[j]].x;\n let y = obstaclePosition[obstacle[j]].y;\n\n if (width > 0) {\n width -= 5;\n ctx.rect(x - 10, y - 10, width, 5);\n ctx.fill();\n character.attacking = false;\n } else {\n width = 40;\n character.attacking = false;\n }\n\n\n }\n if (obstaclePosition[obstacle[j]].x - character.x < 20) {\n delete obstaclePosition[obstacle[j]]\n }\n } else if (character.direction === 'down') {\n if (character.y - obstaclePosition[obstacle[j]].y < 10) {\n drag_fire.play();\n ctx.drawImage(image6, 2682, 2484, 198, 240, character.x + 5, character.y + 40, 30, 20);\n ctx.beginPath();\n ctx.rect(obstaclePosition[obstacle[j]].x - 10, obstaclePosition[obstacle[j]].y - 10, 40, 5);\n ctx.fillStyle = 'blue';\n ctx.fill();\n character.attacking = true;\n let x = obstaclePosition[obstacle[j]].x;\n let y = obstaclePosition[obstacle[j]].y;\n let width = 40;\n setTimeout(function () {\n ctx.rect(x - 10, y - 10, width, 5);\n ctx.fill();\n character.attacking = false;\n }, 1000);\n }\n if (character.y - obstaclePosition[obstacle[j]].y < 5 && character.x - obstaclePosition[obstacle[j]].x < 5) {\n delete obstaclePosition[obstacle[j]]\n }\n }\n } else {\n if (obstaclePosition[obstacle[j]].y > character.y) {\n character.direction === 'down'\n }\n }\n }\n } else {\n if (p1.isAttacking) {\n if (p1.elixirStorage < 8100000){\n p1.elixirStorage += 546000;\n }\n if (p1.goldStorage < 8100000){\n p1.goldStorage += 340000;\n }\n ctx.rect(-300, 50, 500, 400);\n ctx.fillStyle = '#000';\n ctx.fill();\n ctx.fillStyle = '#fff';\n ctx.font = \"bold 18px Arial\";\n ctx.fillText(\"340000\", -130, 250);\n ctx.fillText(\"546000\", -130, 270);\n ctx.fillText(\"14000\", 50, 270)\n ctx.fillText(\"14000\", 50, 290)\n ctx.drawImage(image6, 147, 2556, 702, 645, -250, 100, 400, 300); \n }\n }\n })\n\n }\n}", "title": "" }, { "docid": "bc0d08e294a490f121ea713adf980f2a", "score": "0.6553908", "text": "function animateChar(){\n // select all characters\n var char = $('.character img');\n\n // initialize new controller\n var ctrl = new ScrollMagic.Controller();\n\n // create timeline with tweens\n var tl = new TimelineMax();\n // iterate over characters and add the tween\n \n for (let i = 0; i<char.length; i++){\n if ((i <= 2 )|| (i > 5 && i <= 7 ) ){\n tl.add(TweenMax.fromTo(char[i], 0.35, {opacity: 0, x: '-100%'}, {opacity: 1, x: '0%', ease: Circ.easeOut}))\n // console.log(\"from left added tween\")\n } else {\n tl.add(TweenMax.fromTo(char[i], 0.35, {opacity: 0, x: '100%'}, {opacity: 1, x: '0%', ease: Circ.easeOut}))\n // console.log('from right added tween')\n } \n }\n\n // create new scrollMagic scene\n var scene = new ScrollMagic.Scene({triggerElement: '#characters-section'})\n .setTween(tl)\n .addTo(ctrl)\n .on('leave', ()=>{\n scene.removeTween();\n })\n }", "title": "" }, { "docid": "f168c5b0c35740837563849b0a5aa530", "score": "0.6552246", "text": "function EnemyCharacter(name, colour, trait, health, attack, special, sprite) {\n this.name = name;\n this.colour = colour;\n this.trait = trait;\n this.health = health;\n this.attack = attack;\n this.special = special;\n this.sprite = sprite;\n\n //Values when in game\n this.currentHealth = health;\n this.currentAttack = attack;\n this.condition = \"\";\n\n //Flip the sprite to face the player character\n this.sprite.flipX = true;\n\n //Switch Animation\n this.SwitchAnimation = function(key) {\n this.sprite.anims.play(this.name + \"_\" + key);\n };\n\n //Whenever a animation is finshed\n this.sprite.on('animationcomplete', function (anim, frame) {\n //if the animation is not idle return to idle state\n if (anim.key != \"idle\") {\n console.log(\"Switch\");\n //Get the name of the character for this animation from the key\n let name = anim.key.split('_')[0];\n //Switch Animation\n this.anims.play(name + \"_idle\");\n }\n }, this.sprite);\n}", "title": "" }, { "docid": "97287e1195b83d7719cb37ab1a340019", "score": "0.6537972", "text": "function draw() {\n // Place your drawing code here \n background('black');\n \n player.move();\n player.animate();\n player.display();\n \n zombie.move();\n zombie.animate();\n zombie.display(); \n}", "title": "" }, { "docid": "df744f7608d466a85292b1c4e726edb2", "score": "0.6537272", "text": "function Sprite() {\n\n\t}", "title": "" }, { "docid": "6a8f501120106f487bfc6b1ba244aea8", "score": "0.65275264", "text": "function gameStart(){\n //load sprites\n run = new spriteLoader(\"Images/running.png\",31,43,6,8);\n jump = new spriteLoader(\"Images/jump.png\",31,43,7,2);\n //game loop to draw the images on canvas\n render();\n}", "title": "" }, { "docid": "07df69c22f076eeb6242097ba69ee4af", "score": "0.65117985", "text": "constructor() {\n this.x = 200;\n this.y = 405;\n this.sprite = 'images/char-boy.png';\n }", "title": "" }, { "docid": "353af7b1cc4978b6084f797fd585adbe", "score": "0.6504449", "text": "function animate() {\n p.loadImage(`breathe/${zeroPad(frame)}.png`, showFrame)\n frame = (frame + 1) % 200\n }", "title": "" }, { "docid": "22dad1c396f026e05b798aa01a37b547", "score": "0.64929485", "text": "function draw() {\r\n background (imagePath) \r\n \r\n if (keyDown (UP_ARROW)) {\r\n explorer.velocityY = -7;\r\n }\r\n explorer.velocityY = explorer.velocityY + 0.5;\r\n \r\n \r\n drawSprites();\r\n}", "title": "" }, { "docid": "4ef50b9185143a54012e1a8433e22e3d", "score": "0.6486103", "text": "function animate() {\n\n\n\n\n // add game logic and movement for cpu objects\n for (var keys in cpuObjects) {\n\n collisionHandle(player, cpuObjects[keys].sprite);\n\n var tmpSprite = cpuObjects[keys].sprite;\n\n \n tmpSprite.position.x += cpuObjects[keys].dx;\n tmpSprite.position.y += cpuObjects[keys].dy;\n\n\n\n\n tmpSprite.rotation += 0.1;\n\n\n // bounce off the walls\n if (tmpSprite.position.x < 0) {\n cpuObjects[keys].dx *= -1; \n\n } else if (tmpSprite.position.x > view.width) {\n cpuObjects[keys].dx *= -1;\n \n } else if (tmpSprite.position.y < 0) {\n cpuObjects[keys].dy *= -1;\n\n } else if (tmpSprite.position.y > view.height) {\n cpuObjects[keys].dy *= -1;\n }\n\n }\n\n\n\n renderer.render(stage);\n\n requestAnimationFrame(animate);\n }", "title": "" }, { "docid": "69cf1ab9d8347dd979b564b031b7e9d8", "score": "0.64842296", "text": "walk() {\n this.heroSprite.play(\"walkAnimation\");\n // save current time as the start time of this walk\n this.walkStartTime = Date.now();\n }", "title": "" }, { "docid": "bfd21e7404b849b63cf207d0dbb5fab3", "score": "0.6481311", "text": "constructor (){\n this.sprite = 'images/char-boy.png';\n this.x = 200;\n this.y = 400;\n this.moves = 0;\n this.score = 0;\n this.lives = 3;\n this.spriteLive = 'images/Heart.png';\n }", "title": "" }, { "docid": "e3398659c16bfdc33f136f5d3d25d865", "score": "0.64748514", "text": "setCharacter(charImage) {\n this.sprite = charImage;\n }", "title": "" }, { "docid": "c9890c99dc2693a0ada0ca426e6e1b1b", "score": "0.6471193", "text": "function main(){\n\tif(!hero.isAlive){\n\t\tif(!pressSpaceToContinue){\n\t\t\tgameOver();\n\t\t\tif (32 in keysDown) {\n\t\t\t\thero.isAlive = true;\n\t\t\t\tmonstersCaught = 0;\n\t\t\t\tmonsterImage.src = \"images/newMonster.png\";\n\t\t\t\tbgImage.src = \"images/background.png\";\n\t\t\t}\n\t\t\treset();\n\t\t\trequestAnimationFrame(main);\n\t\t}\n\t\telse{\n\t\t\tif(win){\n\t\t\t\tctx.font = \"40px Comic-sans\";\n\t\t\t\tctx.textAlign = \"center\";\n\t\t\t\tctx.fillStyle = \"blue\";\n\t\t\t\tctx.font = \"40px Comic-sans \";\n\t\t\t\tctx.fillText(\"YOU WIN\",canvas.width/2,canvas.height/2);\n\t\t\t\tctx.fillText(\"YOUR SCORE: \" + monstersCaught,canvas.width/2,canvas.height/2 + 70);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tctx.fillStyle = \"red\";\n\t\t\t\tctx.font = \"40px Comic-sans\";\n\t\t\t\tctx.textAlign = \"center\";\n\t\t\t\tctx.fillStyle = \"white\";\n\t\t\t\tctx.font = \"40px Comic-sans \";\n\t\t\t\tctx.fillText(\"press space to continue to level 2\",canvas.width/2,canvas.height/2);\n\t\t\t\tif(32 in keysDown){\n\t\t\t\t\thero.isAlive = true;\n\t\t\t\t\tpressSpaceToContinue = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\trequestAnimationFrame(main);\n\t\t}\t\t\n\t}\n\telse {\n\t\tvar now = Date.now();\n\t\tvar delta = now - then;\n\t\tupdate(delta / 1000);\n\t\trender();\n\t\tthen = now;\n\t\trequestAnimationFrame(main);\n\t}\n}", "title": "" }, { "docid": "8404adbdc11fe50df6e2f32344d06bd4", "score": "0.6464266", "text": "function draw() {\n backCtx.clearRect(0, 0, W, H);\n\n minusCharacter.updateFrame();\n\n\n //updateBackgroundEffects(1);\n backCtx.drawImage(minusCharacter.image, minusCharacter.srcX, minusCharacter.srcY, minusCharacter.spriteWidth,\n minusCharacter.spriteHeight, 10, 100, W/5, H/5);\n}", "title": "" }, { "docid": "161ddd2af440eda61dd26571ad4e837c", "score": "0.64584273", "text": "function Enemy_Skeleton_Melee(game, spritesheet, spriteSheetReversed, x, y, offset, speed, scale) {\r\n\tBasicSprite.call(this, game, spritesheet, spriteSheetReversed, x, y, offset, speed, scale);\r\n\tthis.animation.frames_state[0] = 7;\r\n\tthis.animation.frames_state[2] = 10;\r\n\tthis.animation.frames_state[3] = 10;\r\n\tthis.type = \"ENEMY\";\r\n\tthis.attack_power = 5;\r\n\tthis.damage_range = 20;\r\n\tthis.health = 40;\r\n\tthis.gold = Math.floor((Math.random() * 25) + 10);\r\n\t//this.health_potion = (Math.random() < 0.4 ? 1 : 0);\r\n\tthis.expGain = 25;\r\n\tthis.skeletonSound = document.getElementById(\"skeleton\");\r\n\tthis.skeletonDeathSound = document.getElementById(\"zombie_death\");\r\n}", "title": "" }, { "docid": "8967ca6b29913b048c01544bcdb0489c", "score": "0.644936", "text": "function main(){\n ctx.clearRect(0,0,w,h);\n ctx.drawImage(background,0,0,w,h);;\n starsUpdate();\n playerUpdate();\n if (gameOn==1) {requestAnimationFrame(main)};\n } //close starsUpdate", "title": "" }, { "docid": "1ecc9395f5234d0b3562457b96def342", "score": "0.6442029", "text": "display() {\n\n if ((keyIsDown(this.leftKey)) || (keyIsDown(this.rightKey))) {\n noStroke();\n imageMode(CENTER);\n image(animationFrames[currentAnimationFrame], this.x, this.y, this.radius * 2, this.radius * 2);\n let programFramesPerAnimationFrame = floor(programFrameRate / animationFrameRate);\n if (frameCount % programFramesPerAnimationFrame === 0) {\n currentAnimationFrame++;\n if (currentAnimationFrame >= animationFrames.length) {\n currentAnimationFrame = 0;\n }\n }\n } else if (keyIsDown(this.jumpKey) && (player.y++)) {\n imageMode(CENTER);\n image(jumpUp, this.x, this.y, this.radius * 2, this.radius * 2);\n } else if (!(keyIsDown(this.jumpKey)) && (player.y--)) {\n imageMode(CENTER);\n image(jumpDown, this.x, this.y, this.radius * 2, this.radius * 2);\n } else if ((this.touching = true) && (this.vx++) && (this.vy = 0) && (this.jump = false)) {\n imageMode(CENTER);\n image(idle, this.x, this.y, this.radius * 2, this.radius * 2);\n }\n }", "title": "" }, { "docid": "a65ecc23af776c7bd452f23a24ce4f8f", "score": "0.64418525", "text": "function draw() {\r\n background(bg);\r\n\r\n if(keyDown(LEFT_ARROW)){\r\n balloon.changeAnimation(\"movingBalloon\", balloonImage2);\r\n balloon.x -= 5;\r\n F = frameCount + 1;\r\n }\r\n else if(keyDown(RIGHT_ARROW)){\r\n balloon.changeAnimation(\"movingBalloon\", balloonImage2);\r\n balloon.x += 5;\r\n F = frameCount + 1;\r\n }\r\n else if(keyDown(UP_ARROW)){\r\n balloon.changeAnimation(\"movingBalloon\", balloonImage2);\r\n balloon.y -= 5;\r\n balloon.scale += 0.008;\r\n F = frameCount + 1;\r\n }\r\n else if(keyDown(DOWN_ARROW) && balloon.y < 494){\r\n balloon.changeAnimation(\"movingBalloon\", balloonImage2);\r\n balloon.y += 5;\r\n balloon.scale -= 0.008;\r\n F = frameCount + 1;\r\n }\r\n\r\n if(frameCount === F) {\r\n balloon.changeAnimation(\"hotAirBalloon\", balloonImage1)\r\n }\r\n\r\n drawSprites();\r\n fill(0);\r\n stroke(\"white\");\r\n textSize(25);\r\n text(\"Use arrow keys to move Hot Air Balloon!\", 40, 40);\r\n}", "title": "" }, { "docid": "ade075e394d42f0a6521833e0b881a0c", "score": "0.64414394", "text": "function Character(x,y,celebrity,isPlayer) {\r\n \r\n // Variable declaration for the character\r\n this.x = x;\r\n this.y = y;\r\n this.width = celebrity.width;\r\n this.height = celebrity.height;\r\n this.background = \"black\";\r\n this.shouldJump = true;\r\n this.jumping = false;\r\n this.fallSpeed = 1;\r\n this.jumpSpeed = 17;\r\n this.shouldPunch = false;\r\n this.isWalking = false;\r\n this.isPunching = false;\r\n this.punchCounter = 0;\r\n this.spritesheetNormal = celebrity.spritesheetNormal;\r\n this.spritesheetWalking = celebrity.spritesheetWalking;\r\n //this.spritesheetPunching = celebrity.spritesheetPunching;\r\n \r\n if(x == 0) {\r\n \tthis.spritesheetPunching = celebrity.spritesheetPunchingRight;\r\n }\r\n else {\r\n \tthis.spritesheetPunching = celebrity.spritesheetPunchingLeft;\r\n }\r\n \r\n // Gets the context(board/canvas) and draws the character, with its attributes, on the context.\r\n this.draw = function(context) {\r\n\t\tif(this.isWalking)\r\n\t\t\tthis.walk(context);\r\n\t\telse if (this.isPunching) {\r\n\t\t\tthis.punch(context);\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.normal(context);\r\n }\r\n \r\n this.normal = function(context) {\r\n \tthis.spritesheetNormal.update();\r\n \tthis.spritesheetNormal.draw(context, this.x, this.y);\r\n }\r\n \r\n this.walk = function(context) {\r\n \tthis.spritesheetWalking.update();\r\n \tthis.spritesheetWalking.draw(context, this.x, this.y);\r\n }\r\n \r\n this.punch = function(context) {\r\n \tthis.spritesheetPunching.update();\r\n \tthis.spritesheetPunching.draw(context, this.x, this.y);\r\n \t\r\n \tthis.isPunching = false;\r\n }\r\n \r\n // Updates the characters attributes. Keeps track of key activities(move left, right, jump, hit etc).\r\n this.update = function() {\r\n \r\n \t// Gravity\r\n\t this.y = this.y + this.fallSpeed;\r\n\t this.fallSpeed++;\r\n\t\t// End gravity\r\n//\t\tif(!this.isWalking && key.isPressed(spaceBar) && isPlayer) { // This activates the punch\r\n\r\n//\t\t}\r\n\t\t\r\n\t\tthis.checkPunch();\r\n\t\t\r\n\t\t// Screen limit\r\n\t\tif((this.x + this.width) > width) { // If the character reaches the right most limit of the board\r\n\t\t \r\n\t\t this.x = width - this.width;\t // Sets the character position to the right edge\r\n\t\r\n\t\t}\r\n\t\t\r\n\t\tif(this.x < 0) {\t\t\t\t\t // If the character reaches the left most limit of the board\r\n\t\t this.x = 0;\t\t\t\t\t\t // Sets the character position to the left edge\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\tif((this.y + this.height) > height) { // if the character reaches the bottom most limit of the board\r\n\t\t \r\n\t\t this.y = height - this.height;\t // Sets the character position to the bottom edge\r\n\t\t \tthis.fallSpeed = 1;\r\n\t\t\tthis.shouldJump = true;\r\n\t\r\n\t\t}\r\n\t\t\r\n\t\tif(this.y < 0) {\t\t\t\t\t // If the character reaches the top most limit of the board\r\n\t\r\n\t\t this.y = 0;\t\t\t\t\t\t // Sets the character position to the top edge\r\n\t\r\n\t\t}\r\n\t\t// End limit\r\n\t\t\r\n\t\t\r\n }\r\n \r\n this.checkKeys = function() {\r\n \t\r\n if(key.isPressed(leftKey)) { \r\n\t\t\tthis.x = this.x - 3; \t\t\t\t // Move left (keymaster.js)\r\n\t\t\tthis.isWalking = true;\r\n\t \t}\r\n\t\t\r\n\t\tif(key.isPressed(rightKey)) {\r\n\t\t\tthis.x = this.x + 3; \t\t\t\t // Move right\r\n\t\t\tthis.isWalking = true;\r\n\t\t}\r\n\r\n\t\tif(key.isPressed(upKey) && this.shouldJump)\r\n\t\t\tthis.jumping = true; \t\t\t\t // Set the character to jump\r\n\t\t\t\r\n\t\tif(key.isPressed(spaceBar)) {\r\n\t\t\t//Test to see if spacebar is working\r\n\t\t\t//this.x = this.x + 3;\r\n\t\t\t//this.isWalking = true;\r\n\t\t\tthis.shouldPunch = true;\r\n\t\t}\r\n \t\r\n }\r\n \r\n this.checkDirection = function() {\r\n \t\r\n \t// Direction\r\n \t\r\n \tthis.isWalking = false;\r\n \tthis.shouldPunch = false;\r\n \t\r\n \tif(isPlayer)\r\n\t\t\tthis.checkKeys();\r\n\t\t\r\n\t\tif(this.jumping) { \t\t\t\t\t\t // While jumping\r\n\t\t\t\r\n\t\t\tthis.y = this.y - this.jumpSpeed; // Move upwards with the set jumping speed\r\n \t\tthis.jumpSpeed = this.jumpSpeed - 1; // Decrease the jumping speed\r\n \t\t\r\n \t\tif(this.jumpSpeed < 0) {\t\t\t // The jump has reached maximum height\r\n \t\t\t\r\n \t\t\tthis.jumpSpeed = 17; \t\t\t // Reset the jumping speed\r\n\t\t\t\tthis.shouldJump = false;\t\t \r\n\t\t\t\tthis.jumping = false;\r\n \t\t\r\n \t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\r\n\t\t// End direction\r\n \t\r\n }\r\n \r\n /*Checks the hitting of a celebrity. This function is called in the update function which is called ~33 times per second.\r\n \t\t\r\n */\r\n this.checkPunch = function() {\r\n \t\r\n \t// If the celebrity is on the left\r\n \tif(x == 0) {\r\n \t\r\n \t\t// If the hit should occur\r\n\t \tif(this.shouldPunch) {\r\n\t \t\t\r\n\t \t\t// As long as the celebrity has not reached the enemy\r\n\t \t\tif(this.x + this.width < positionP2+25)\r\n\t \t\t\tthis.x += 5; // Move towards the enemy\r\n\t \t\t\r\n\t \t\t// If the celebrity has reached the enemy\r\n\t \t\telse {\r\n\t \t\t\t\r\n\t \t\t\t// Make the punch\r\n\t \t\t\tif(this.punchCounter == 33) {\r\n\t \t\t\t\tthis.shouldPunch = false;\r\n\t \t\t\t\tthis.punchCounter = 0;\r\n\t \t\t\t} else {\r\n\t \t\t\t\tthis.punchCounter++;\r\n\t \t\t\t}\r\n\t \t\t\t\r\n\t \t\t\tthis.isWalking = false;\r\n\t \t\t\tthis.isPunching = true;\r\n\t \t\t}\r\n\t \t\t\r\n\t \t// When the celebrity should walk back to its position\r\n\t \t} else if(this.x > positionP1) {\r\n\t \t\tthis.isWalking = true;\r\n\t \t\tthis.x -= 5; // Move back to the normal position\r\n\t \t\t\r\n\t \t// When the celebrity should not hit and is in its normal(this.x = 0) position\r\n\t \t} else {\r\n\t \t\tthis.isWalking = false;\r\n\t \t}\r\n \t\r\n \t// If the celebrity is on the right\r\n \t} else {\r\n \t\t\r\n \t\t// If the hit should occur\r\n\t \tif (this.shouldPunch) {\r\n\t \t\t\r\n\t \t\t// As long as the celebrity has not reached the enemy\r\n\t \t\tif (this.x > positionP1+50)\r\n\t \t\t\tthis.x -= 5; // Move towards the enemy\r\n\t \t\t\t\r\n\t \t\t// If the celebrity has reached the enemy\r\n\t \t\telse {\r\n\t \t\t\t\r\n\t \t\t\t// Make the punch\r\n\t \t\t\tif(this.punchCounter == 33) {\r\n\t \t\t\t\tthis.shouldPunch = false;\r\n\t \t\t\t\tthis.punchCounter = 0;\r\n\t \t\t\t} else {\r\n\t \t\t\t\tthis.punchCounter++;\r\n\t \t\t\t}\r\n\t \t\t\t\r\n\t \t\t\tthis.isWalking = false;\r\n\t \t\t\tthis.isPunching = true;\r\n\t \t\t\t\r\n\t \t\t}\r\n\t \t}\r\n\t \t\r\n\t \t// When the celebrity should walk back to its position\r\n\t \telse if (this.x < positionP2) {\r\n\t \t\tthis.isWalking = true;\r\n\t \t\tthis.x += 5; // Move back to normal position\r\n\t \t}\r\n\t \t\r\n\t \t// When the celebrity should not hit and is in its normal(this.x = 200)\r\n\t \telse {\r\n\t \t\tthis.isWalking = false;\r\n\t \t}\r\n \t\t\r\n \t}\r\n \t\r\n }\r\n \r\n this.hit = function() {\r\n \tthis.shouldPunch = true;\r\n\t\tthis.isWalking = true;\r\n }\r\n \r\n this.dead = function() {\r\n \t\r\n }\r\n \r\n}", "title": "" }, { "docid": "021460d1543ef051f1df1b11620a1254", "score": "0.643958", "text": "function drawLives(){\n let pos = 50;\n for(i=0; i< 10; i++){\n let temp = createSprite(pos, height - 20, 50, 50);\n temp.addAnimation('run', 'images/heart/tile000.png', 'images/heart/tile007.png' )\n temp.scale = 0.4;\n append(lives, temp);\n pos += 50;\n }\n return\n}", "title": "" }, { "docid": "d13d01caa76f4ca05c889301f1f74251", "score": "0.6437405", "text": "function draw() {\n drawSprites();\n}", "title": "" }, { "docid": "261d0a80b224d407f298dfa3496fd22b", "score": "0.64336634", "text": "constructor({imageName, speed}) {\r\n this.x = -100;//Положение объекта\r\n this.y = -100;\r\n this.speed = speed;//Скорость перемещения\r\n this.velocity = new Vector(\"left\", 0);//Направление перемещения\r\n this.lastTime = 0;//Время последнего кадра\r\n this.animations = {};//Контейнер для хранения анимаций {walk_down: .., walk_up: .. и т.д. }\r\n\r\n //Форма, которая будет использоваться для коллизии. Она начинается не от левого верхнего угла спрайта, а от x: 18, y: 15\r\n this.collisionShape = {x: 18, y: 15, width: 28, height: 49};\r\n\r\n this.isShooting = false;\r\n this.isHitting = false;\r\n\r\n //Загружаем необходмые анимации для данного персонажа\r\n const animationSheet = new CharacterSheet({imageName: imageName});\r\n \"walk_down,walk_up,walk_left,walk_right\".split(\",\").forEach(name => {\r\n this.animations[name] = animationSheet.getAnimation(name);//В итоге this.animations = {walk_down: .., walk_up: .. и т.д. }\r\n });\r\n \"shoot_down,shoot_up,shoot_left,shoot_right\".split(\",\").forEach(name => {\r\n this.animations[name] = animationSheet.getAnimation(name, 50, false);//второй аргумен - скорость, false - отменить повтор\r\n });\r\n \"cut_down,cut_up,cut_left,cut_right\".split(\",\").forEach(name => {\r\n this.animations[name] = animationSheet.getAnimation(name, 50, false);//второй аргумен - скорость, false - отменить повтор\r\n });\r\n [\"death\"].forEach(name => {\r\n this.animations[name] = animationSheet.getAnimation(name, 50, false);//второй аргумен - скорость, false - отменить повтор\r\n }); \r\n this.stand(\"left\");\r\n }", "title": "" }, { "docid": "faf072b7a2a001ac4b09a2b0bcdd39f7", "score": "0.642803", "text": "function animate() {\n\trequestAnimFrame( animate );\n\tgame.tick();\n}", "title": "" }, { "docid": "854a9785aa3b8254acd917e9dc3fb9fe", "score": "0.6427886", "text": "function Patrol(spriteTexture) {\n var date = new Date;\n this.prevUpdateTime = date.getTime();\n this.currUpdateTime = date.getTime();\n this.offEdge = false;\n this.wingDeath = false;\n this.showBound = false;\n this.mHead = new SpriteRenderable(spriteTexture);\n this.mHead.setColor([1, 1, 1, 0]);\n this.mHead.getXform().setPosition(Math.random() * 125, -42.5 + (Math.random() * 85)); // gross hardcoding values in based on main camera width height, and pos in world space\n this.mHead.getXform().setSize(7.5, 7.5);\n this.mHead.setElementPixelPositions(600, 700, 0, 180);\n this.mHead._setTexInfo();\n \n this.mTopWing = new SpriteAnimateRenderable(spriteTexture);\n this.mTopWing.setColor([1, 1, 1, 0]);\n this.mTopWing.getXform().setPosition(this.mHead.getXform().getXPos(), this.mHead.getXform().getYPos());\n this.mTopWing.getXform().setSize(10, 8);\n this.mTopWing.setSpriteSequence(512, 0, // first element pixel position: top-left 512 is top of image, 0 is left of image\n 204, 164, // widthxheight in pixels\n 5, // number of elements in this sequence\n 0); // horizontal padding in between\n this.mTopWing.setAnimationType(SpriteAnimateRenderable.eAnimationType.eAnimateSwing);\n this.mTopWing.setAnimationSpeed(30);\n this.mTopWing._setTexInfo();\n \n this.mBottomWing = new SpriteAnimateRenderable(spriteTexture);\n this.mBottomWing.setColor([1, 1, 1, 0]);\n this.mBottomWing.getXform().setPosition(this.mHead.getXform().getXPos(), this.mHead.getXform().getYPos());\n this.mBottomWing.getXform().setSize(10, 8);\n this.mBottomWing.setSpriteSequence(512, 0, // first element pixel position: top-left 512 is top of image, 0 is left of image\n 204, 164, // widthxheight in pixels\n 5, // number of elements in this sequence\n 0); // horizontal padding in between\n this.mBottomWing.setAnimationType(SpriteAnimateRenderable.eAnimationType.eAnimateSwing);\n this.mBottomWing.setAnimationSpeed(30);\n this.mBottomWing._setTexInfo();\n \n this.topInterpX = new Interpolate(this.mTopWing.getXform().getXPos(), 120, 0.05);\n this.topInterpY = new Interpolate(this.mTopWing.getXform().getYPos(), 120, 0.05);\n \n this.bottomInterpX = new Interpolate(this.mBottomWing.getXform().getXPos(), 120, 0.05);\n this.bottomInterpY = new Interpolate(this.mBottomWing.getXform().getYPos(), 120, 0.05);\n \n this.headBox = new BoundingBox(this.mHead.getXform().getPosition(), this.mHead.getXform().getWidth(), this.mHead.getXform().getHeight());\n this.topWingBox = new BoundingBox(this.mTopWing.getXform().getPosition(), this.mTopWing.getXform().getWidth(), this.mTopWing.getXform().getHeight());\n this.bottomWingBox = new BoundingBox(this.mBottomWing.getXform().getPosition(), this.mBottomWing.getXform().getWidth(), this.mBottomWing.getXform().getHeight());\n this.BBwidth = this.topWingBox.maxX() - this.headBox.minX();\n this.BBheight = (this.topWingBox.maxY() - this.bottomWingBox.minY()) * 1.5;\n this.BBcenterX = this.headBox.minX() + (this.BBwidth / 2);\n this.BBcenterY = this.bottomWingBox.minY() + (this.BBheight / 2);\n var center = vec2.fromValues(this.BBcenterX, this.BBcenterY);\n this.bigBox = new BoundingBox(center, this.BBwidth, this.BBheight);\n //console.log(this.bigBox.minX(), this.bigBox.minY(), this.bigBox.maxX(), this.bigBox.maxY());\n this.speed = 5 + (5 * Math.random());\n this.dir = 90 * Math.random();\n this.verticalSpeed = Math.sin(this.dir) * this.speed;\n this.horizontalSpeed = Math.cos(this.dir) * this.speed;\n if(Math.random() < 0.25) {\n this.horizontalSpeed *= -1;\n this.verticalSpeed *= -1;\n } else if (Math.random() < 0.5) {\n this.horizontalSpeed *= -1;\n } else if (Math.random() < 0.75) {\n this.verticalSpeed *= -1;\n }\n \n //console.log(this.bigBox.minX(), this.bigBox.minY(), this.bigBox.maxX(), this.bigBox.minY());\n this.BBBB = new LineRenderable(this.bigBox.minX(), this.bigBox.minY(), this.bigBox.maxX(), this.bigBox.minY());\n this.BBBB.setPointSize(10);\n this.BBTB = new LineRenderable(this.bigBox.minX(), this.bigBox.maxY(), this.bigBox.maxX(), this.bigBox.maxY());\n this.BBTB.setPointSize(10);\n this.BBLB = new LineRenderable(this.bigBox.minX(), this.bigBox.minY(), this.bigBox.minX(), this.bigBox.maxY());\n this.BBLB.setPointSize(10);\n this.BBRB = new LineRenderable(this.bigBox.maxX(), this.bigBox.minY(), this.bigBox.maxX(), this.bigBox.maxY());\n this.BBRB.setPointSize(10);\n \n \n this.HBBB = new LineRenderable(this.headBox.minX(), this.headBox.minY(), this.headBox.maxX(), this.headBox.minY());\n this.HBBB.setPointSize(10);\n this.HBTB = new LineRenderable(this.headBox.minX(), this.headBox.maxY(), this.headBox.maxX(), this.headBox.maxY());\n this.HBTB.setPointSize(10);\n this.HBLB = new LineRenderable(this.headBox.minX(), this.headBox.minY(), this.headBox.minX(), this.headBox.maxY());\n this.HBLB.setPointSize(10);\n this.HBRB = new LineRenderable(this.headBox.maxX(), this.headBox.minY(), this.headBox.maxX(), this.headBox.maxY());\n this.HBRB.setPointSize(10);\n \n this.TWBBB = new LineRenderable(this.topWingBox.minX(), this.topWingBox.minY(), this.topWingBox.maxX(), this.topWingBox.minY());\n this.TWBBB.setPointSize(10);\n this.TWBTB = new LineRenderable(this.topWingBox.minX(), this.topWingBox.maxY(), this.topWingBox.maxX(), this.topWingBox.maxY());\n this.TWBTB.setPointSize(10);\n this.TWBLB = new LineRenderable(this.topWingBox.minX(), this.topWingBox.minY(), this.topWingBox.minX(), this.topWingBox.maxY());\n this.TWBLB.setPointSize(10);\n this.TWBRB = new LineRenderable(this.topWingBox.maxX(), this.topWingBox.minY(), this.topWingBox.maxX(), this.topWingBox.maxY());\n this.TWBRB.setPointSize(10);\n \n this.BWBBB = new LineRenderable(this.bottomWingBox.minX(), this.bottomWingBox.minY(), this.bottomWingBox.maxX(), this.bottomWingBox.minY());\n this.BWBBB.setPointSize(10);\n this.BWBTB = new LineRenderable(this.bottomWingBox.minX(), this.bottomWingBox.maxY(), this.bottomWingBox.maxX(), this.bottomWingBox.maxY());\n this.BWBTB.setPointSize(10);\n this.BWBLB = new LineRenderable(this.bottomWingBox.minX(), this.bottomWingBox.minY(), this.bottomWingBox.minX(), this.bottomWingBox.maxY());\n this.BWBLB.setPointSize(10);\n this.BWBRB = new LineRenderable(this.bottomWingBox.maxX(), this.bottomWingBox.minY(), this.bottomWingBox.maxX(), this.bottomWingBox.maxY());\n this.BWBRB.setPointSize(10);\n //this.mBottomWing = new SpriteRenderable(wingTexture);\n //this.mTopBound = new LineRenderable();\n //this.mBottomBound = null;\n //this.mLeftBound = null;\n //this.mRightBound = null;\n\n\n //GameObject.call(this, this.mHead);\n\n //this.setSpeed(0.3);\n}", "title": "" }, { "docid": "b33f7e4e20fbfcaa8bd3f9e8af40e47c", "score": "0.6425523", "text": "function draw() {\n backCtx.clearRect(0, 0, W, H);\n drawSpriteImage(backCtx, plussCharacter.animation, plussCharacter.x, plussCharacter.y, plussCharacter.w, plussCharacter.h);\n plussCharacter.animation.updateFrame();\n\n drawSpriteImage(backCtx, portalDoor.animation, portalDoor.x, portalDoor.y, portalDoor.w, portalDoor.h);\n portalDoor.animation.updateFrame();\n\n updateBackgroundEffects(1);\n\n if(currentStage >= 4 && worldKeys < 1) {\n if(goldenKey.currentFrame === 22) {\n worldKeys = 1;\n document.getElementById(\"currentKeys\").innerHTML = \"Keys: \" + worldKeys;\n portalDoor.animation = createAnimatedSprite('assets/portalOpen.png', 5100, 600, 300, 600, 17, 5);\n } else {\n drawSpriteImage(backCtx, goldenKey, W/2-(W/4), H/2-(H/3), W/2, H/2);\n goldenKey.updateFrame();\n }\n }\n}", "title": "" }, { "docid": "101a415bfb421617457800d72af05b34", "score": "0.64237803", "text": "function nextCharacter() {\n var charLen = characterSprites.length;\n var id = config.characterChosen.characterPic.curIdx;\n config.characterChosen.characterPic.curIdx = (id+1)%charLen;\n }", "title": "" }, { "docid": "aebef5437513ba9ffd676b322a8d884f", "score": "0.6422874", "text": "function animloop() {init = requestAnimFrame(animloop); draw(); gameLoop();}", "title": "" }, { "docid": "1e508312e8d407ad4a2d0ef8da3a21d0", "score": "0.64185554", "text": "function yellowCyclist(){\n player2=createSprite(1100,Math.round(random(50,250)));\n player2.scale=0.06;\n player2.addAnimation(\"opponentplayer4\",oppPinkImg1);\n player2.velocityX=-(6 + 2*distance/150);\n player2.lifetime=1200;\n yellowCG.add(player2);\n}", "title": "" }, { "docid": "b076ca21518041a39f754199b31b4c95", "score": "0.64128625", "text": "function draw() {\r\n background(bg);\r\n\r\n if(keyDown(LEFT_ARROW)){\r\n balloon.addAnimation(\"hotAirBalloon\",balloonImage2);\r\n //write code to move air balloon in left direction\r\n writeposition(-3, 0)\r\n }\r\n else if(keyDown(RIGHT_ARROW)){\r\n balloon.addAnimation(\"hotAirBalloon\",balloonImage2);\r\n //write code to move air balloon in right direction\r\n writeposition(3, 0)\r\n }\r\n else if(keyDown(UP_ARROW)){\r\n balloon.addAnimation(\"hotAirBalloon\",balloonImage2);\r\n //write code to move air balloon in up direction\r\n writeposition(0, -3)\r\n }\r\n else if(keyDown(DOWN_ARROW)){\r\n balloon.addAnimation(\"hotAirBalloon\",balloonImage2);\r\n //write code to move air balloon in down direction\r\n writeposition(0, 3)\r\n }\r\n\r\n drawSprites();\r\n fill(0);\r\n stroke(\"white\");\r\n textSize(25);\r\n text(\"**Use arrow keys to move Hot Air Balloon!\",40,40);\r\n}", "title": "" }, { "docid": "ad8f9ea9bc4bfb0122e89252686bf00c", "score": "0.641143", "text": "function walker(name, x, y){ \n\n this.char = loadImage(name);\n\n this.frame = 0; this.x = x; this.y = y; \n\n // Animation functions /////////\n\n this.flies = function(){ /*Flying dragon function*/\n\n\tif (name == 'bleu.png') { /*Bleu loop function*/\n\t var bleuf = 0, blux = 96, bluy = 103; //Bleu frame counter, x, and y\n\t for(this.fc = 0; this.fc < 10; this.fc++) { \n\t\tpush();\n\t\tif(this.frame == this.fc)\n\t\t image(this.char,this.x,this.y,blux,bluy, 150+(blux*bleuf),0,blux,bluy); \n\t\tbleuf++;\n\t\tif (bleuf > 4)\n\t\t bleuf = 0; //Repeats 4 frames\n\t\tpop(); }\n\t if(frameCount % 17 == 0) // Frame speed\n\t this.frame = (this.frame + 1)%4; \n\t}// end Bleu flies\n\n\telse { /*Rathalos loop function*/\n var rx = 100, ry = 80; //Rathalos x and y\n\t for(this.fc = 0; this.fc < 10; this.fc++) { \n\t \tpush();\n\t \tif(this.frame == this.fc)\n\t \t image(this.char,this.x,this.y,rx,ry, abs(rx*(this.fc)),0,rx,ry);\n\t \tpop(); }\n\t if(frameCount % 8 == 0) // Frame speed\n\t this.frame = (this.frame + 1)%4; \n\t}// end Rathalos flies\n\n } // end flies\n\n} // end walker", "title": "" }, { "docid": "379fb16b2017eb37c800f20c6492c1a2", "score": "0.64078206", "text": "function impact(){\n // if our character shares coordinates with the sprite (not a perfect solution, needs to be fine-tuned)\n if((charX + charWidth) >= x && (charX <= x + spriteWidth) && (charY + charHeight) >= y && (charY <= y + spriteHeight)){\n // change the background color to show impact\n canvas.style.backgroundColor = `#${Math.ceil((Math.random()*1000000))}`\n }\n}", "title": "" }, { "docid": "ea77869787208585836f808f70d41b78", "score": "0.6406376", "text": "function Animation5() {\n this.y = 0;\n\n //intializing for letters \n\n var xHeadB = 200;\n var yHeadB = 200;\n var xHeadD = 1100;\n var yHeadD = 200;\n var thin = 2;\n var thick = 20;\n\n this.draw = function() {\n scene = 1;\n background(0);\n strokeCap(SQUARE);\n stroke('white');\n strokeWeight(2);\n noFill();\n\n // images for top header & key instruction \n imageMode(CENTER, TOP);\n image(imgKeyboard, width / 2, 30, 617, 41);\n image(imgShowImage, width / 2, 370, 617, 41);\n\n // Drawing the 'b' figure \n\n // body line \n strokeWeight(thick);\n stroke('aqua');\n line(xHeadB, yHeadB + 40, xHeadB, yHeadB + 450);\n\n // belly\n ellipse(xHeadB + 100, yHeadB + 300, 200);\n\n // Drawing the 'd' figure \n\n // body line \n strokeWeight(thick);\n stroke('yellow');\n line(xHeadD, yHeadD + 40, xHeadD, yHeadD + 450);\n\n // belly\n ellipse(xHeadD - 100, yHeadD + 300, 200);\n\n // conditional for displaying the flash card for the letters\n // code logic borrowed from previous scenes\n if (flashCard == 1) {\n\n // Drawing the 'b' figure \n // head \n fill(0);\n strokeWeight(thin);\n stroke('white');\n ellipse(xHeadB + 15, yHeadB + 10, 80);\n\n //hands\n noFill();\n strokeWeight(thin);\n stroke('white');\n line(xHeadB, yHeadB + 120, xHeadB + 50, yHeadB + 80);\n line(xHeadB, yHeadB + 110, xHeadB + 50, yHeadB + 120);\n\n //legs \n line(xHeadB, yHeadB + 450, xHeadB + 0, yHeadB + 450 + 80);\n line(xHeadB, yHeadB + 450, xHeadB + 100, yHeadB + 450 + 80);\n\n // text - b has a Belly \n noStroke();\n textSize(60);\n fill(210);\n textSize(50);\n text(\"b has a\", xHeadB - 60, yHeadB - 80);\n textSize(100);\n textAlign(LEFT, CENTER);\n text(\"elly\", xHeadB + 220, yHeadB + 300);\n\n\n // Drawing the 'd' figure \n // head \n fill(0);\n strokeWeight(thin);\n stroke('white');\n ellipse(xHeadD - 15, yHeadD + 10, 80);\n\n //hands\n noFill();\n strokeWeight(thin);\n stroke('white');\n line(xHeadD, yHeadD + 120, xHeadD - 50, yHeadD + 80);\n line(xHeadD, yHeadD + 110, xHeadD - 50, yHeadD + 120);\n\n //legs \n line(xHeadD, yHeadD + 450, xHeadD - 0, yHeadD + 450 + 80);\n line(xHeadD, yHeadD + 450, xHeadD - 100, yHeadD + 450 + 80);\n\n //diaper lines\n line(xHeadD - 200, yHeadD + 330, xHeadD - 250, yHeadD + 360);\n line(xHeadD - 200, yHeadD + 350, xHeadD - 250, yHeadD + 380);\n line(xHeadD - 200, yHeadD + 370, xHeadD - 250, yHeadD + 400);\n line(xHeadD - 200, yHeadD + 310, xHeadD - 250, yHeadD + 340);\n\n // text - d wears a Diaper \n noStroke();\n textSize(60);\n fill(210);\n textSize(50);\n text(\"d wears a\", xHeadD - 100, yHeadD - 80);\n textSize(100);\n textAlign(LEFT, CENTER);\n text(\"iaper\", xHeadD + 20, yHeadD + 300);\n }\n }\n\n // showing/hiding flash card on ENTER button press\n this.keyPressed = function() {\n if (keyCode === 13) {\n flashCard = flashCard * (-1);\n }\n\n }\n\n}", "title": "" }, { "docid": "4772fedd94b249cf126c31688ad9b5ba", "score": "0.6402266", "text": "set_animation() {\n if (this.keydown.down) {\n this.image_crop = sprite_ani.pink.duck;\n } else if (!this.is_standing) {\n this.image_crop = sprite_ani.pink.jump;\n } else if (this.vx != 0) {\n this.image_crop = sprite_ani.pink[\"walk\" + (1+Math.round(this.x/20) % 2)];\n } else {\n this.image_crop = sprite_ani.pink.stand2;\n }\n if (this.is_flipped) {\n this.image_crop = sprite_ani.flip(256, this.image_crop);\n this.image.src = this.image_src_flipped;\n } else {\n this.image.src = this.image_src;\n }\n this.y = this.bottom - this.image_crop.h + this.image_crop.tpd + this.image_crop.bpd;\n this.h = this.image_crop.h - this.image_crop.tpd - this.image_crop.bpd;\n this.x = this.right - this.image_crop.w + this.image_crop.lpd + this.image_crop.rpd;\n this.w = this.image_crop.w - this.image_crop.lpd - this.image_crop.rpd;\n }", "title": "" }, { "docid": "f5755f66ae185b80ee4ad22a14226a06", "score": "0.64012384", "text": "function Player() {\n this.x = 0;\n this.y = 0;\n this.height = 16;\n this.width = 16;\n this.opacity = 0.8;\n this.sprite_w = 16;\n this.sprite_h = 16;\n this.sprite_x = 0;\n this.sprite_y = 0;\n this.hitboxWidth = 8;\n this.hitboxHeight = 8;\n this.hitoffsetx = 0;\n this.hitoffsety = -4;\n this.animations = {};\n this.current_animation = {};\n this.parallax = 0;\n this.state = 'idle';\n this.previous_state = 'idle';\n this.alive = true;\n this.controllable = false;\n this.blobs = [];\n this.splats = [];\n this.key = null;\n this.invertedControls = false;\n \n //velocity variables just in case\n this.vx = 0;\n this.vy = 0;\n \n //initiate image\n this.image = new Image();\n this.image.src = 'images/SimeSprites.png';\n \n //create animations\n this.animations.idle = new SpriteAnimation(0, 6, 10);\n this.animations.running = new SpriteAnimation(1, 7, 20);\n this.current_animation = this.animations.idle;\n \n //generate blobs upon death\n this.createBlobs = function(n) {\n //create n blobs\n for(var i = 0; i < n; i++) {\n var blob = new Blob('images/slime-ball.png');\n var speed = 0.5 + Math.random();\n var direction = Math.random()*2*Math.PI;\n blob.vx = speed*Math.cos(direction);\n blob.vy = speed*Math.sin(direction);\n blob.x = this.x;\n blob.y = this.y;\n this.blobs.push(blob);\n }\n }\n \n //draw the blobs if there are any\n this.drawBlobs = function() {\n for(var i = 0; i < this.blobs.length; i++) {\n drawObject(this.blobs[i]);\n }\n }\n \n //draw the splats if there are any\n this.drawSplats = function() {\n ctx.globalCompositeOperation = 'overlay';\n for(var i = 0; i < this.splats.length; i++) {\n drawObject(this.splats[i]);\n }\n ctx.globalCompositeOperation = 'source-over';\n }\n \n this.die = function() {\n this.alive = false;\n this.state = 'idle';\n this.invertedControls = false;\n this.current_animation = this.animations.idle;\n this.key = null;\n\n //spawn splatters\n player.createBlobs(15);\n \n //creat death splat\n var splat = new BasicObject('images/splat.png');\n splat.x = this.x;\n splat.y = this.y;\n splat.width = 30;\n splat.height = 24;\n splat.yoffset = -5;\n splat.opacity = 1.5;\n this.splats.push(splat);\n }\n \n this.reset = function() {\n this.alive = false;\n this.state = 'idle';\n this.current_animation = this.animations.idle;\n this.key = null;\n }\n \n this.madeSplat = false;\n \n this.update = function() {\n //for whether the player is alive or not\n \n //update trail if it exists\n if (this.state == 'running' && this.current_animation.current_frame == 6) {\n if (!this.madeSplat) {\n var splat = new BasicObject('images/splat.png');\n splat.x = this.x;\n splat.y = this.y;\n splat.width = 15;\n splat.height = 12;\n splat.yoffset = -5;\n splat.opacity = 1.5;\n this.splats.push(splat);\n walkSound.play();\n this.madeSplat = true;\n }\n } else {\n this.madeSplat = false;\n }\n for(var i = 0; i < this.splats.length; i++) {\n this.splats[i].opacity -= 0.01;\n if (this.splats[i].opacity < 0) {\n this.splats[i] = null;\n this.splats.splice(i,1);\n }\n }\n \n //update blobs if they exist\n for(var i = 0; i < this.blobs.length; i++) {\n this.blobs[i].update();\n if(this.blobs[i].yoffset < 0) {\n \n var splat = new BasicObject('images/splat.png');\n splat.x = this.blobs[i].x;\n splat.y = this.blobs[i].y;\n splat.width = 20;\n splat.height = 16;\n splat.yoffset = -5;\n this.splats.push(splat);\n \n this.blobs[i] = null;\n this.blobs.splice(i,1);\n }\n }\n \n //update the key if it exists\n if(this.key != null) {\n //make the key follow instead of sicking to the player\n var keyDist = 13;\n var adjustx = (this.x-this.key.x);\n var adjusty = (this.y-this.key.y);\n var dist = Math.sqrt(Math.pow(adjustx,2) + Math.pow(adjusty,2));\n this.key.x += ((dist-keyDist)/dist)*adjustx;\n this.key.y += ((dist-keyDist)/dist)*adjusty;\n }\n \n updateSpriteAnimation(this);\n \n //if player is alive\n if(!this.alive || !this.controllable) {\n return;\n }\n if(rightPressed) {\n if (this.invertedControls) {\n this.x -= 1;\n } else {\n this.x += 1;\n }\n \n }\n if(leftPressed) {\n if (this.invertedControls) {\n this.x += 1;\n } else {\n this.x -= 1;\n }\n \n }\n if(upPressed) {\n if (this.invertedControls) {\n this.y -= 1;\n } else {\n this.y += 1;\n }\n \n }\n if(downPressed) {\n if (this.invertedControls) {\n this.y += 1;\n } else {\n this.y -= 1;\n }\n \n }\n\n if(upPressed || downPressed || rightPressed || leftPressed) {\n this.previous_state = this.state;\n this.state = 'running';\n if(this.previous_state != 'running') {\n resetAnimations(this);\n this.current_animation = this.animations.running;\n }\n } else {\n this.previous_state = this.state;\n this.state = 'idle';\n if(this.previous_state != 'idle') {\n resetAnimations(this);\n this.current_animation = this.animations.idle;\n }\n }\n\n //handle completed animation\n if(this.current_animation.completed == true) {\n resetAnimations(this);\n if(upPressed || downPressed || rightPressed || leftPressed) {\n this.current_animation = this.animations.running;\n this.state = 'running';\n } else {\n this.current_animation = this.animations.idle;\n this.state = 'idle';\n }\n }\n };\n \n}", "title": "" }, { "docid": "05fd3f94a1c2978c36f4c9b0d48e51de", "score": "0.6396097", "text": "animate(){\n\n if(frameCount % this.animateSpeed === 0){\n this.sprite_number ++;\n this.sprite_number %= 2;\n }\n }", "title": "" }, { "docid": "bc51ef97a36aaf2a79ca0ff30925f8f7", "score": "0.6393549", "text": "function animate(){\n\t\n\tsword.rotation.z += 0.01;\n\t\t\n\t//render\n\trenderer.render(scene, camera);\n\trequestAnimationFrame(animate);\n}", "title": "" }, { "docid": "f2667dcc334d9bbbf86f7747d4f2352a", "score": "0.6393332", "text": "invocarRey(){\n this.rey=this.physics.add.sprite(this.reyX, this.reyY, 'rey'); \n this.rey.anims.play('rey',true); \n //alert(\"aprieten bien ese culo...\\n que lo que viene es candela\"); \n\n }", "title": "" }, { "docid": "37d94c25cdee997f19bc51c95521e673", "score": "0.63850826", "text": "function draw() {\n background(0);\n\n if (state === `animation`) {\n animation();\n }\n else if (state === `eatenEnd`) {\n eatenEnd();\n }\n else if (state === `treasureEnd`) {\n treasureEnd();\n }\n}", "title": "" }, { "docid": "d4d4160e9230dbf2c68dd29c23d5bc5d", "score": "0.6377833", "text": "function animate() {\n\trequestAnimFrame( animate );\n\tgame.background.draw();\n}", "title": "" }, { "docid": "9022163e0dddc895e0c4c3508508294e", "score": "0.6374845", "text": "function animate(){\n game.run(); // run the game\n requestAnimationFrame(animate);\n}", "title": "" }, { "docid": "2073f1171ae3b18cd5c91eda93a012cb", "score": "0.6363093", "text": "function gameStart(){\n //load sprites\n run = new spriteLoader(\"Images/running.png\",31,43,6,8);\n jump = new spriteLoader(\"Images/jump.png\",31,43,7,2);\n //game loop to draw the images on canvas\n render(drawClouds);\n render(drawFarIsland);\n render(float1);\n render(float2);\n render();\n}", "title": "" }, { "docid": "1809bd1cf1059725f06c4ddc9f0379b0", "score": "0.63591343", "text": "basicAtlasAnimation(sprite) { // sprite is the sprite to which the animation should be applied\n // sprite, nbFrames, ... are absorbed from npc.json when a new NPC() is created\n sprite.animations.add('idle', Phaser.Animation.generateFrameNames(sprite.atlasKey+'_', 0, 0+sprite.nbFrames-1), sprite.rate, true);\n sprite.animations.play('idle');\n }", "title": "" }, { "docid": "a08bc4c4afc3d860952660061561a44a", "score": "0.63581264", "text": "function pinkCyclist(){\n player1=createSprite(1100,Math.round(random(50,250)));\n player1.scale=0.06;\n player1.addAnimation(\"opponentplayer1\",oppPinkImg1);\n player1.velocityX=-(6 + 2*distance/150);\n player1.lifetime=1200;\n pinkCG.add(player1);\n}", "title": "" }, { "docid": "d6d34583e4d118305384744b8c7d350c", "score": "0.635147", "text": "function Animation() { }", "title": "" }, { "docid": "bdffd1d20046704c25bafc84ffa36574", "score": "0.63513184", "text": "function PlayAnim(animType : String)\n{\n\t//swing normal stick\n\tif(animType == \"SwingWeapon\")\n\t{\n\t\tcurFrame = 0; //make sure the frame starts at the beginning of the animation\n\t\tcurrentStatus = PlayerStatus.Attacking; //use to show the textures\n\t\tvar swingAudio : Transform = transform.Find(\"SwingSound\");\n\n\t\tswingAudio.audio.Play();\n\t\t\n\t\t//create a cube with a collider that corresponds to the attacking texture\n\t\tvar swordSwing : GameObject = GameObject.CreatePrimitive(PrimitiveType.Cube);\n\t\tswordSwing.transform.tag = \"SwingWeapon\";\n\t\tswordSwing.collider.isTrigger = true;\n\t\tswordSwing.transform.localScale = Vector3(0.7,1,1); //resize\n\t\tswordSwing.renderer.material.shader = Shader.Find(\"Transparent/Diffuse\"); //get the transparent shader\n\t\tswordSwing.renderer.material.color.a = 0; //set alpha channel to fully transparent\n\n\t\t//set the cube's position to match the texture\n\t\tif(facingLeft)\n\t\t{\n\t\t\tswordX = transform.position.x - 0.8;\n\t\t\tswordY = transform.position.y - 0.4;\n\t\t\tswordZ = transform.position.z;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswordX = transform.position.x + 0.8;\n\t\t\tswordY = transform.position.y - 0.4;\n\t\t\tswordZ = transform.position.z;\n\t\t}\n\t\t\n\t\t//move cube to position\n\t\tswordSwing.transform.Translate(Vector3(swordX,swordY,swordZ));\n\t\tswordSwing.transform.parent = transform; //make the cube a child of the player\n\t\t\t\t\n\t\t//destroy after so many seconds\n\t\tDestroy(swordSwing, 0.5);\n\t}\n\t//swing saber weapon\n\telse if(animType == \"SwingSaber\")\n\t{\n\t\tcurFrame = 0; //make sure the frame starts at the beginning of the animation\n\t\tcurrentStatus = PlayerStatus.Attacking; //use to show the textures\n\t\tswingAudio = transform.Find(\"SaberHalf\");\n\n\t\tswingAudio.audio.Play();\n\t\t\n\t\t//create a cube with a collider that corresponds to the attacking texture\n\t\tswordSwing = GameObject.CreatePrimitive(PrimitiveType.Cube);\n\t\tswordSwing.transform.tag = \"SwingSaber\";\n\t\tswordSwing.collider.isTrigger = true;\n\t\tswordSwing.transform.localScale = Vector3(1.4,1.5,1); //resize\n\t\tswordSwing.renderer.material.shader = Shader.Find(\"Transparent/Diffuse\"); //get the transparent shader\n\t\tswordSwing.renderer.material.color.a = 0; //set alpha channel to fully transparent\n\n\t\t//set the cube's position to match the texture\n\t\tif(facingLeft)\n\t\t{\n\t\t\tswordX = transform.position.x - 1.4;\n\t\t\tswordY = transform.position.y - 0.3;\n\t\t\tswordZ = transform.position.z;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswordX = transform.position.x + 1.4;\n\t\t\tswordY = transform.position.y - 0.3;\n\t\t\tswordZ = transform.position.z;\n\t\t}\n\t\t\n\t\t//move cube to position\n\t\tswordSwing.transform.Translate(Vector3(swordX,swordY,swordZ));\n\t\tswordSwing.transform.parent = transform; //make the cube a child of the player\n\t\t\t\t\n\t\t//destroy after so many seconds\n\t\tDestroy(swordSwing, 0.5);\n\t}\n\t//throw a rock\n\telse if(animType == \"ThrowProjectile\")\n\t{\n\t\tvar clone : GameObject;\n\t\t\n\t\t// find and play the audio for the projectile\n\t\tvar throwAudio : Transform = transform.Find(\"ThrowSound\");\n\t\tthrowAudio.audio.Play();\n\t\t\t\n\t\t// instantiate the projectile at the position and rotation of the player\n\t\tclone = Instantiate(projectile, transform.position, transform.rotation);\n\t\tclone.rigidbody.freezeRotation = true;\n\t\tPhysics.IgnoreCollision(clone.collider, transform.root.collider);\n\t\t\n\t\t// give the projectile an initial velocity\n\t\tif(facingLeft)\n\t\t\tclone.rigidbody.velocity = Vector3(-projectileSpeed, 0, 0);\n\t\telse\n\t\t\tclone.rigidbody.velocity = Vector3(projectileSpeed, 0, 0);\n\t\t\n\t\t// set the projectile to be destroyed\n\t\tDestroy(clone, 4);\n\t}\n\t//shoot the blast gun\n\telse if(animType == \"GunBlast\")\n\t{\n\t\t// find and play the audio for the projectile\n\t\tvar gunAudio : Transform = transform.Find(\"GunSound\");\n\t\tgunAudio.audio.Play();\n\n\t\t// instantiate the projectile at the position and rotation of the player\n\t\tif(facingLeft)\n\t\t{\n\t\t\tclone = Instantiate(gunblastLeft, transform.position, transform.rotation);\n\t\t\tclone.transform.Translate(Vector3(1,0,0.5));\n\t\t\tclone.rigidbody.velocity = Vector3(-projectileSpeed, 0, 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tclone = Instantiate(gunblastRight, transform.position, transform.rotation);\n\t\t\tclone.transform.Translate(Vector3(-1,0,0.5));\n\t\t\tclone.rigidbody.velocity = Vector3(projectileSpeed, 0, 0);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "acf985e3b6490645c62267dd08e3e0cb", "score": "0.6347557", "text": "function run(){\n game.update()\n game.gameOver()\n game.MainMenu()\n requestAnimationFrame(run);\n}", "title": "" }, { "docid": "c85f561b06404968d3b89e8ac44badff", "score": "0.6346093", "text": "function redCyclist(){\n player3=createSprite(1100,Math.round(random(50,250)));\n player3.scale=0.06;\n player3.addAnimation(\"opponentplayer7\",oppPinkImg1);\n player3.velocityX=-(6 + 2*distance/150);\n player3.lifetime=1200;\n redCG.add(player3);\n}", "title": "" }, { "docid": "82e0d1c445a577eca28d8159e93f7e95", "score": "0.6333111", "text": "function Enemie(){\n //this.type = type,\n this.x = (Math.random() * (c.canvas.width / 4)),\n this.y = 0,\n this.yFinal = 440//landing[ri]\n this.xFinal = this.yFinal\n this.number = 1,\n this.xs = 0,\n this.ys = 0,\n //this.width = 20,\n //this.height = 20,\n this.gravity = 0.9,\n this.grounded = false\n \n this.spriteWidth = 726\n this.spriteheight = 86\n this.sprCols = 7\n this.sprRows = 1\n this.width = this.spriteWidth / this.sprCols\n this.height = this.spriteheight / this.sprRows\n this.curFrame = 0;\n \n this.img = new Image() // lines added\n this.img.src = \"./img/wizz_blue/b_wizz_jump_right2.png\"\n \n this.drawInicial = function(){\n if(this.y == this.yFinal)return;\n this.y++;\n if(this.y){\n this.ys ++;\n };\n c.drawImage(this.img, this.x, this.y, 62, 90);\n } \n \n this.draw = function(){\n this.img.src = \"./img/wizz_blue/b_wizz_right_walkcopia.png\"\n this.x = 130\n this.x = this.x -1\n this.currFrame ++;\n //if(this.curFrame > this.sprCols){this.curFrame = 0} \n //if(this.finalX > 900){this.finalX = 0} else if(this.this.finalX < 0){this.finalX--}\n //c.fillStyle = \"black\";\n //c.fillRect(this.x, this.y, 30, 30);\n c.drawImage(this.img, 0+(this.spriteWidth/7*this.curFrame), 0, 103, 86, this.x, this.y, this.width, this.height); \n } \n }", "title": "" }, { "docid": "3b0f31459d18d0c598aaa1c4e8a9cfde", "score": "0.63229436", "text": "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y + enemyYMargin);\n }", "title": "" }, { "docid": "074494c2183537cece6a89dbd21f89b6", "score": "0.6322467", "text": "chUpdate() {\n if (this.noChLoop) return;\n super.update();\n\n const isOnGround = this.isTouching.ground;\n\n // change animations\n if (this.state.action === possibleActions.idle) {\n this.sprite.anims.play(\"player-idle\", true);\n } else if (this.state.action == possibleActions.running && isOnGround) {\n this.sprite.anims.play(\"player-run\", true);\n } else {\n this.sprite.anims.stop();\n this.sprite.setTexture(\"player\", 10);\n }\n }", "title": "" }, { "docid": "1826f23cef70db75215183a55b4c1e73", "score": "0.6321982", "text": "start() {\n player.sprite.position.y = 1326;\n friend.sprite.position.y = 1326;\n }", "title": "" }, { "docid": "0709ce28faee1050417bf162700ebac4", "score": "0.63205206", "text": "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x * 101, (this.y * 83)-20);\n }", "title": "" }, { "docid": "7737c108834c3ef37eda09913a9975ea", "score": "0.63193107", "text": "function drawScenery(){\n bgImage.resize(40,0);\n // for the first decoration sprite\n if(decorations.length == 0){\n tempSprite = createSprite(random(20, 80), -50, 50, 50);\n tempSprite.addImage(bgImage);\n tempSprite.setSpeed(velocity, 90)\n append(decorations, tempSprite);\n tempSprite = createSprite(random(width - 20, width - 80), -50, 50, 50);\n tempSprite.addImage(bgImage);\n tempSprite.setSpeed(velocity, 90)\n append(decorations, tempSprite);\n // for additional sprites\n }else{if(decorations[decorations.length-1].position.y > 10){\n tempSprite = createSprite(random(20, 80), -50, 50, 50);\n tempSprite.addImage(bgImage);\n tempSprite.setSpeed(velocity, 90)\n append(decorations, tempSprite);\n tempSprite = createSprite(random(width - 20, width - 80), -50, 50, 50);\n tempSprite.addImage(bgImage);\n tempSprite.setSpeed(velocity, 90)\n append(decorations, tempSprite);\n \n }\n }\n \n return\n}", "title": "" }, { "docid": "aa2c3266b173539f5ac753326dde22b8", "score": "0.6318313", "text": "constructor(sprite='images/char-horn-girl.png'){\n //Load the initial location for the character; y is always 0 x is random between 0-4\n super(sprite, {x:getRandomIntInclusive(0,MAX_X), y:MAX_Y},undefined,20,20)\n console.log(`Player: Speed: ${this.speed} Loc: ${this.loc.x} ${this.loc.y} BoundingBox: xRight:${this.boundingBox.xRight} xLeft:${this.boundingBox.xLeft} xUp:${this.boundingBox.yUp} xDown:${this.boundingBox.yDown}`);\n this.moveX = 0;\n this.moveY = 0;\n }", "title": "" }, { "docid": "b430ce368a09f40452209665a77f6576", "score": "0.63123035", "text": "function setAnimations(){\r\n if(player.weapon == \"knife\"){\r\n //player = game.add.sprite(100, 100, 'playerKnife');\r\n \r\n //player.loadTexture('playerKnife');\r\n player.animations.add('standing', [11,12,13,14,15,16,17]);\r\n player.animations.add('playerMove', [11,12,13,14,15,16,17]);\r\n player.animations.add('playerSwing', [0,1,2,3,4,5,6,7,8,9,10]);\r\n }\r\n if(player.weapon == \"handgun\"){\r\n if(player){\r\n //player.destroy();\r\n }\r\n \r\n player.loadTexture('playerHandGun', 11);\r\n \r\n /*player = game.add.sprite(currentX, currentY, 'playerHandGun');\r\n game.physics.arcade.enableBody(player);\r\n player.body.collideWorldBounds = true;\r\n player.anchor.setTo(0.5, 0.5);\r\n player.scale.setTo(0.8, 0.8);\r\n */\r\n \r\n player.animations.add('standing', [0,1,2,3,4,5,6,7,8,9]);\r\n player.animations.add('playerMove', [0,1,2,3,4,5,6,7,8,9]);\r\n player.animations.add('playerSwing', [10,11,12,13,14,15,16,17,18]);\r\n player.animations.add('playerShoot', [20, 21, 22]);\r\n \r\n }\r\n}", "title": "" }, { "docid": "66da8d8d4ec41db0f20e8a83628b1bbf", "score": "0.6306242", "text": "function makeItFall(){\n\n // update class\n $(this).removeClass(\"stillChar\");\n $(this).addClass(\"fallingChar\");\n\n // add css positioning (.fallingChar class uses fixed position):\n\n // select this span\n let thisAtt = \"char\"+chars;\n // give it an ID\n $(this).attr('id', thisAtt)\n // set css top/left to match span's previous in-line position\n let selector = \"#\"+thisAtt;\n $(selector).css(\"left\", $(this).position().left+\"px\");\n $(selector).css(\"top\", $(this).position().top+\"px\");\n\n // count fallen characters\n chars +=1;\n\n // shoot a sound\n startGranular(sample1);\n\n}", "title": "" }, { "docid": "a81396e217b0b6738f63a793fa27278a", "score": "0.630514", "text": "function run() {\n asset.scale.x = _direction;\n asset.body.velocity.x = 200 * _direction;\n asset.animations.play('run');\n setState(_run);\n }", "title": "" }, { "docid": "d3d9feadf2f433e9e7fc042c23fafc32", "score": "0.630295", "text": "function youMayBeginDesu()\r\n{\r\n if(beginWalkieWalkie)\r\n {\r\n \r\n if(!triggerOnce)\r\n {\r\n tID = setInterval ( () => {\r\n document.getElementById(\"vinnySpriteID\").style.backgroundPosition = \r\n `-${position}px 0px`; \r\n //we use the ES6 template literal to insert the variable \"position\"\r\n if (position < 576)\r\n { position = position + 64;}\r\n //we increment the position by 256 each time\r\n else\r\n { position = 64; }\r\n //reset the position to 256px, once position exceeds 1536px\r\n }\r\n , interval ); //end of setInterval\r\n //end of animateScript()\r\n triggerOnce = true;\r\n }\r\n\r\n $('.vinnyHolder').css({\r\n \r\n left: event.clientX,\r\n \r\n });\r\n }\r\n else\r\n {\r\n clearInterval(tID);\r\n \r\n triggerOnce = false;\r\n\r\n document.getElementById(\"vinnySpriteID\").style.backgroundPosition = \r\n `0px 0px`; \r\n }\r\n}", "title": "" }, { "docid": "af6169898e74869ecb1eed2dd1aa5c68", "score": "0.630071", "text": "function Character(obj, container) {\n this.obj = obj;\n this.status = \"born\";\n this.side = \"RIGHT\";\n this.brain = new Brain('animal', obj);\n\n\n\n this.actions = {\n changeGif(gif){\n this.el.appendChild(gif)\n },\n still: () => {\n this.actions.changeGif.bind(this)(this.obj.gif[this.side.toLowerCase()]['still']);\n },\n die: () => {\n\n },\n attack: () => {\n\n },\n rotate: () => {\n this\n\n this.el.style.transform = 'transform: rotateZ(186deg) rotateX(160deg)';\n },\n walk: () => {\n this.changeGif(this.obj.gif[this.rotate || 'right']['run']);\n\n let rotate = 0;\n\n switch (this.side) {\n case \"RIGHT\":\n this.obj.startPos.x = this.obj.startPos.x + this.obj.speed;\n rotate = 0;\n break;\n case \"LEFT\":\n this.obj.startPos.x = this.obj.startPos.x - this.obj.speed;\n rotate = -180;\n break;\n case \"TOP\":\n this.obj.startPos.y = this.obj.startPos.y - this.obj.speed;\n rotate = -180;\n break;\n case \"BOTTOM\":\n this.obj.startPos.y = this.obj.startPos.y + this.obj.speed;\n rotate = 0;\n break;\n default:\n return false;\n break;\n };\n\n let zIndex = this.obj.startPos.y;\n\n pubSub.publish('changePlayerPosition', this.speed, this.side);\n\n setPosition(this.obj.startPos.x, this.obj.startPos.y, rotate);\n }\n }\n\n const setPosition = (x, y, rotate = 0) => {\n this.el.style.transform = `translate(${x}px, ${y}px) rotateY(${rotate}deg)`;\n };\n\n const render = () => {\n this.actions.still();\n container.appendChild(this.el);\n this.status = 'exist';\n };\n\n const createGifSprites = (gif) => {\n const sides = Object.keys(gif);\n\n for (let side of sides) {\n let states = Object.keys(gif[side]);\n\n for (let state of states) {\n let tempGif = document.createElement('img');\n\n tempGif.src = gif[side][state];\n\n gif[side][state] = tempGif;\n }\n }\n };\n\n this.el = document.createElement('i');\n\n this.el.className = `Character Character-${this.obj.name}`;\n\n this.obj.startPos && setPosition(this.obj.startPos.x, this.obj.startPos.y);\n\n if (this.obj.gif) {\n createGifSprites(this.obj.gif)\n render();\n }\n\n\n}", "title": "" }, { "docid": "1d5c86c0499177091791c8916298d519", "score": "0.6297335", "text": "function animate(character, animationArray) {\n for (i=0; i<animationArray.length; i++) {\n // We can use setTimout in a for loop by wrapping it in a IIFE.\n (function(i) {\n // In order to setTimout or setInterval a function with parameters/arguments, you need to timeout an anonymous function which will then call your function with parameters when called.\n setTimeout(function() {\n displaySprite(character, animationArray, i);\n }, 100 * (i + 1));\n })(i);\n }\n }", "title": "" }, { "docid": "94b7af40b7c9c7187ebc88501fa44db9", "score": "0.62961847", "text": "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */ \n var now = Date.now(), dt = (now - lastTime) / 1000.0;\n gd.framesCounter++;\n if(gd.framesCounter > 10000000){gd.framesCounter = 0;};\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render(dt);\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "title": "" }, { "docid": "d1b107cab8e9e9c38d349399d4c5550c", "score": "0.62925124", "text": "function displaySprite() {\n push();\n imageMode(CORNER);\n if (isMovingLeft) {\n if (spriteTimer <= 15) {\n image(knightLeft1, spriteX, spriteY, height/spriteScale, height/spriteScale);\n spriteTimer++;\n }\n else {\n image(knightLeft2, spriteX, spriteY, height/spriteScale, height/spriteScale);\n spriteTimer++;\n if (spriteTimer === 30) {\n spriteTimer = 0;\n }\n }\n }\n else if (isMovingRight) {\n if (spriteTimer <= 15) {\n image(knightRight1, spriteX, spriteY, height/spriteScale, height/spriteScale);\n spriteTimer++;\n }\n else {\n image(knightRight2, spriteX, spriteY, height/spriteScale, height/spriteScale);\n spriteTimer++;\n if (spriteTimer === 30) {\n spriteTimer = 0;\n }\n }\n }\n else {\n image(knightStill, spriteX, spriteY, height/spriteScale, height/spriteScale);\n }\n pop();\n}", "title": "" }, { "docid": "a1648f73463374dbf73c2c4e5b75c6dc", "score": "0.6291898", "text": "function animate() {\n\t\trequestAnimFrame(animate);\n\t\tvar context = _Context;\n\t\t\n\t\t//Clear last steps stuff\n\t\tcontext.clearRect(0, 0, _GameState.CanvasWidth, _GameState.CanvasHeight);\n\n\t\tif (!_GameState.Started) {\n\t\t\t//Show the startup screen\n\t\t\tcontext.font = _Font;\n\t\t\tcontext.strokeText('Canvas Game - Press S to start', 0, 50);\n\t\t\tif (_GameState.KeysPressed[7]) {\n\t\t\t\t_GameState.Started = true;\n\t\t\t\t_GameState.playSound(\"backgroudSound\");\n\t\t\t}\n\t\t} else if (_GameState.ShotCount >= _GameState.DamageLimit) {\n\t\t\t//Show end\n\t\t\tcontext.font = _Font;\n\t\t\tcontext.strokeText('Game over - Press S to start', 0, 50);\n\t\t\tif (_GameState.KeysPressed[7]) {\n\t\t\t\t_GameState.reset();\n\t\t\t}\n\t\t} else {\n\n\t\t\t_GameState.Enemies.render();\n\t\t\t_Ship.render();\n\n\n\t\t\tif (_GameState.KeysPressed[4]) {\n\t\t\t\t_GameState.handleShot(new Projectile(_Ship.GunRotation, _Ship.GunX, _Ship.GunY));\n\n\t\t\t}\n\n\t\t\t_GameState.update();\n\t\t\t_GameState.CurrentProjectiles.render(context, _Ship, _GameState);\n\n\t\t\tif (_GameState.Enemies.count() < _GameState.maxEnemies && Math.random() < _GameState.enemySpawnProbability) {\n\t\t\t\tvar enemy = new Enemy(Math.floor(Math.random() * _GameState.CanvasWidth), Math.floor(Math.random() * _GameState.CanvasHeight));\n\t\t\t\t_GameState.Enemies.add(enemy);\n\t\t\t}\n\n\t\t\t_Ship.moveNext(_GameState.KeysPressed[0], _GameState.KeysPressed[1], _GameState.KeysPressed[2], _GameState.KeysPressed[3], _GameState.KeysPressed[5], _GameState.KeysPressed[6]);\n\t\t\tdocument.getElementById(\"info\").innerHTML = _Ship.X.toString() + \", \" + _Ship.Y.toString();\n\t\t\tdocument.getElementById(\"score\").innerHTML = \"Score: \" + _GameState.Score + \" Shot: \" + _GameState.ShotCount;\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "cedddca98a5107be82ea0802bbbc5588", "score": "0.6285436", "text": "function Animation2() {\n\n this.enter = function() {\n background(0);\n }\n\n // using an Image here to reduce certain code and time\n\n this.draw = function() {\n imageMode(CENTER, CENTER);\n image(imgHome, width / 2, height / 2);\n }\n\n // Press any key to continue\n\n this.mousePressed = function() {\n this.sceneManager.showNextScene();\n }\n\n}", "title": "" }, { "docid": "e1f98f821f27da3c071b1db886a515c7", "score": "0.628147", "text": "function Character(url, x, y, direction) {\r\n //case number\r\n this.x = x;\r\n this.y = y;\r\n this.direction = direction;\r\n //define the state of the animation : < 0 --> not moving // > 0 --> moving (represent the step in the animation)\r\n this.animationState = -1;\r\n\r\n this.image = new Image();\r\n this.image.characterReference = this;\r\n\r\n this.image.onload = function () {\r\n if (!this.complete) {\r\n console.error(\"Error loading image\");\r\n }\r\n this.characterReference.width = this.width / 4;\r\n this.characterReference.height = this.height / 8;\r\n };\r\n\r\n this.image.src = \"sprites/\" + url;\r\n}", "title": "" }, { "docid": "c0ad5b1987f68edc7998245e08caa0dc", "score": "0.627858", "text": "function animate() {\n\n\t // request another frame\n\t requestAnimationFrame(animate);\n gameLoop();\n\n\t}", "title": "" }, { "docid": "88ad4ab5191e1ba237878670960738b7", "score": "0.62768275", "text": "render() {\n\t\tctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n\t}", "title": "" }, { "docid": "88ad4ab5191e1ba237878670960738b7", "score": "0.62768275", "text": "render() {\n\t\tctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n\t}", "title": "" }, { "docid": "88ad4ab5191e1ba237878670960738b7", "score": "0.62768275", "text": "render() {\n\t\tctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n\t}", "title": "" }, { "docid": "88ad4ab5191e1ba237878670960738b7", "score": "0.62768275", "text": "render() {\n\t\tctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n\t}", "title": "" }, { "docid": "88ad4ab5191e1ba237878670960738b7", "score": "0.62768275", "text": "render() {\n\t\tctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n\t}", "title": "" }, { "docid": "88ad4ab5191e1ba237878670960738b7", "score": "0.62768275", "text": "render() {\n\t\tctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n\t}", "title": "" }, { "docid": "3ee96bd87cf9f6266fb96e12b47b71a9", "score": "0.62706155", "text": "function animate() {\n 'use strict';\n chairMovement();\n\n render();\n\n requestAnimationFrame(animate);\n}", "title": "" }, { "docid": "e8c13255f74b7d311b269b60ee4ffcc5", "score": "0.6267537", "text": "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n global.window.requestAnimationFrame(main);\n }", "title": "" }, { "docid": "bfa615efac5a071e51ade7e8459a8194", "score": "0.6263271", "text": "function animate() {\n //frame refresh command\n ctx.clearRect(0, 0, 1000, 500)\n ctx.drawImage(bg, 0, 0, 1000, 500)\n ctx.restore()\n //acceleration rules\n if (player.jump == false){\n player.xSpeed *= friction\n } else{\n player.ySpeed += gravity\n player.xSpeed *= (friction)\n }\n if (keys.up){\n if (player.jump == false && player.jumpCooldown == false){\n player.ySpeed = -13\n player.jumpCooldown = true\n player.jump = true\n }\n }\n player.jump = true\n\n //acceleration rules for enemies\n enemies.forEach((enemy) => {\n if (enemy.jump == false){\n enemy.xSpeed *= friction\n } else {\n enemy.ySpeed += gravity\n enemy.xSpeed *= friction\n }\n enemy.jump = true\n if (enemy.x < 10){\n enemy.left = true\n }\n if (enemy.x > 920){\n enemy.left = false\n }\n if (enemy.left == false){\n enemy.xSpeed = -0.8 - harder\n } else {\n enemy.xSpeed = 0.8 + harder\n }\n enemy.y += enemy.ySpeed\n enemy.x += enemy.xSpeed\n })\n //left and right movement\n if (keys.left && player.x > 10){\n player.xSpeed -= 1.5\n player.flip = true\n }\n if (keys.right && player.x < 920){\n player.xSpeed += 1.5\n player.flip = false\n }\n player.y += player.ySpeed\n player.x += player.xSpeed\n\n //constantly make updated character\n player.draw()\n //constantly make platforms\n buildPlatforms()\n //constantly make enemies\n enemies.forEach((enemy) => {\n enemy.draw()\n })\n //display score\n ctx.font = '32px serif'\n ctx.fillStyle = \"black\"\n ctx.fillText(`Score: ${score}`, 20, 40)\n //platform collision for player\n let i = -1\n if (platforms[3].x-40 < player.x && player.x < platforms[3].x-40 + platforms[3].width+20 && platforms[3].y < player.y+64 && player.y < platforms[3].y + platforms[3].height){\n i = 3\n }\n if (platforms[0].x-40 < player.x && player.x < platforms[0].x-40 + platforms[0].width+20 && platforms[0].y < player.y+64 && player.y < platforms[0].y + platforms[0].height){\n i = 0\n }\n if (platforms[1].x-40 < player.x && player.x < platforms[1].x-40 + platforms[1].width+20 && platforms[1].y < player.y+64 && player.y < platforms[1].y + platforms[3].height){\n i = 1\n }\n if (platforms[2].x-40 < player.x && player.x < platforms[2].x-40 + platforms[2].width+20 && platforms[2].y < player.y+64 && player.y < platforms[2].y + platforms[2].height){\n i = 2\n }\n if (i > -1 && player.ySpeed >= 0){\n player.jump = false\n player.y = platforms[i].y-64\n player.ySpeed = 0\n setTimeout(() => {\n player.jumpCooldown = false\n }, 1000)\n }\n\n //enemy collision for player\n enemies.forEach((enemy, index) => {\n const dist = Math.hypot((player.x+32) - (enemy.x+32), (player.y+32) - (enemy.y+32))\n if (dist-40 < 1){\n gameOver()\n }\n })\n //collision for enemies\n enemies.forEach((enemy, index) => {\n //platforms\n enemy.j = -1\n if (platforms[3].x-40 < enemy.x && enemy.x < platforms[3].x-40 + platforms[3].width+20 && platforms[3].y < enemy.y+64 && enemy.y < platforms[3].y + platforms[3].height){\n enemy.j = 3\n }\n if (platforms[0].x-40 < enemy.x && enemy.x < platforms[0].x-40 + platforms[0].width+20 && platforms[0].y < enemy.y+64 && enemy.y < platforms[0].y + platforms[0].height){\n enemy.j = 0\n }\n if (platforms[1].x-40 < enemy.x && enemy.x < platforms[1].x-40 + platforms[1].width+20 && platforms[1].y < enemy.y+64 && enemy.y < platforms[1].y + platforms[3].height){\n enemy.j = 1\n }\n if (platforms[2].x-40 < enemy.x && enemy.x < platforms[2].x-40 + platforms[2].width+20 && platforms[2].y < enemy.y+64 && enemy.y < platforms[2].y + platforms[2].height){\n enemy.j = 2\n }\n if (enemy.j > -1){\n enemy.jump = false\n enemy.y = platforms[enemy.j].y-64\n enemy.ySpeed = 0\n }\n\n //attacks\n if (player.cooldown == true){\n const dist = Math.hypot((attack.x+32) - (enemy.x+32), (attack.y+32) - (enemy.y+32))\n if (dist - 48 < 1){\n setTimeout(() => {\n deadEnemies.push(enemies[index])\n enemies.splice(index, 1)\n }, 0)\n score++\n }\n }\n })\n //function to animate enemy deaths\n deadCheck()\n\n //function to animate attacks\n attacks.forEach((attack, index) => {\n attack.draw()\n setTimeout(() => {\n attacks.splice(index, 1)\n }, 500)\n })\n}", "title": "" } ]
1372982ece09dcb953ee0c92c2d9315a
Retry 3 times if a request times out.
[ { "docid": "6466c635dc7b4e7a54b12d0f05dd4a70", "score": "0.727236", "text": "retry() {\n return new Promise((resolve, reject) => {\n var r = 1;\n this.get().then(result => {\n resolve(result);\n }).catch(er => { \n if (er.response != undefined) { r = 0}\n if (!er.code == \"ETIMEDOUT\") { r = 0 } else { this.retries++; }\n if (this.retries == 3) { r = 0 }\n if (r == 1) {\n console.log(\"Timed out. Retrying...\");\n this.retry().then(result => { resolve(result) }).catch(er => { reject(er) });\n } else {\n if (er.code == \"ETIMEDOUT\"){ \n er.message = \"Timed out after 3 attempts.\"\n er.response = {};\n er.response.statusCode = 0;\n }\n reject(er);\n }\n })\n })\n }", "title": "" } ]
[ { "docid": "0172bb5d08b06029b9afaa8b4675f810", "score": "0.7455849", "text": "function retryRequest() {\n\t var retryDelay = _retryDelays[requestsAttempted - 1];\n\t var retryStartTime = requestStartTime + retryDelay;\n\t // Schedule retry for a configured duration after last request started.\n\t setTimeout(sendTimedRequest, retryStartTime - Date.now());\n\t }", "title": "" }, { "docid": "c86dbd03377ad248c793002a794ef243", "score": "0.73921096", "text": "retryLater(count, fn) {\n var timeout = this._timeout(count);\n\n if (this.retryTimer) clearTimeout(this.retryTimer);\n this.retryTimer = Meteor.setTimeout(fn, timeout);\n return timeout;\n }", "title": "" }, { "docid": "2caccba5d3465dca2f3802feb77c69b3", "score": "0.73776025", "text": "function retryRequest() {\n var retryDelay = _retryDelays[requestsAttempted - 1];\n var retryStartTime = requestStartTime + retryDelay;\n // Schedule retry for a configured duration after last request started.\n setTimeout(sendTimedRequest, retryStartTime - Date.now());\n }", "title": "" }, { "docid": "52b4fe08bc4d24fee7725f15bb8c7e0d", "score": "0.7120627", "text": "function _getRetryTimeout() {\n return RETRY_SEC * 1000;\n }", "title": "" }, { "docid": "a00cc5d07d9bcba2b5b42173d3efbf70", "score": "0.70823145", "text": "function retry(xhr, status /*, error */){\n /* jshint validthis:true */\n if(this.tryCount < this.maxTries){\n console.error('%s: %s... retrying', xhr, status);\n this.tryCount++;\n var self = this;\n setTimeout(function(){\n $.ajax(self);\n }, 3000);\n }\n else{\n console.error(\"couldn't process request!\");\n //ToDo: show some message dialog to the user\n }\n }", "title": "" }, { "docid": "5f77505b32601fcd63969317f9361d5e", "score": "0.683959", "text": "function ajax_retry(url, retries, timeout) {\n //console.log(url, retries, timeout);\n retries = retries || 3;\n timeout = timeout || 3000;\n function action(resolve, reject) {\n $.ajax({\n url: url,\n timeout: timeout\n })\n .done(function(data, status){\n //console.log(status, data);\n if (status === 'success') {\n resolve(data);\n } else {\n //console.log(\"done (reject)\", status, data);\n reject();\n }\n })\n .fail(function(xhr, status, error){\n //console.log(status, error);\n if ((status === 'error' || status === 'timeout') && --retries > 0) {\n //console.log(\"fail\", status, error);\n action(resolve, reject);\n } else {\n reject();\n }\n });\n }\n return new Promise(action);\n }", "title": "" }, { "docid": "8bd5ca230b97f0129e571e69d303bddd", "score": "0.6839275", "text": "function retry(action, times, ...arguments) {\n let count = 0;\n\n const retrier = (...args) => {\n return action(...args)\n .catch(e => {\n count++;\n\n if (count >= times) {\n throw e;\n }\n\n return retrier(...args);\n });\n };\n\n return retrier(...arguments);\n}", "title": "" }, { "docid": "96ee9e59ce9242004b67dbe2e5be36a4", "score": "0.6797264", "text": "function repeat() {\n timeoutId = null;\n if (deadline && now.getTime() >= deadline) {\n const error = new googleError_1.GoogleError(`Total timeout of API ${apiName} exceeded ${retry.backoffSettings.totalTimeoutMillis} milliseconds before any response was received.`);\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n callback(error);\n return;\n }\n if (retries && retries >= maxRetries) {\n const error = new googleError_1.GoogleError('Exceeded maximum number of retries before any ' +\n 'response was received');\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n callback(error);\n return;\n }\n retries++;\n const toCall = timeout_1.addTimeoutArg(func, timeout, otherArgs);\n canceller = toCall(argument, (err, response, next, rawResponse) => {\n if (!err) {\n callback(null, response, next, rawResponse);\n return;\n }\n canceller = null;\n if (retry.retryCodes.indexOf(err.code) < 0) {\n err.note =\n 'Exception occurred in retry method that was ' +\n 'not classified as transient';\n callback(err);\n }\n else {\n const toSleep = Math.random() * delay;\n timeoutId = setTimeout(() => {\n now = new Date();\n delay = Math.min(delay * delayMult, maxDelay);\n const timeoutCal = timeout && timeoutMult ? timeout * timeoutMult : 0;\n const rpcTimeout = maxTimeout ? maxTimeout : 0;\n const newDeadline = deadline ? deadline - now.getTime() : 0;\n timeout = Math.min(timeoutCal, rpcTimeout, newDeadline);\n repeat();\n }, toSleep);\n }\n });\n }", "title": "" }, { "docid": "62388ea40ed8b708ae10cb17443c0112", "score": "0.6731117", "text": "function repeat() {\n timeoutId = null;\n if (deadline && now.getTime() >= deadline) {\n const error = new googleError_1.GoogleError(`Total timeout of API ${apiName} exceeded ${retry.backoffSettings.totalTimeoutMillis} milliseconds before any response was received.`);\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n callback(error);\n return;\n }\n if (retries && retries >= maxRetries) {\n const error = new googleError_1.GoogleError('Exceeded maximum number of retries before any ' +\n 'response was received');\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n callback(error);\n return;\n }\n retries++;\n const toCall = timeout_1.addTimeoutArg(func, timeout, otherArgs);\n canceller = toCall(argument, (err, response, next, rawResponse) => {\n if (!err) {\n callback(null, response, next, rawResponse);\n return;\n }\n canceller = null;\n if (retry.retryCodes.indexOf(err.code) < 0) {\n err.note =\n 'Exception occurred in retry method that was ' +\n 'not classified as transient';\n callback(err);\n }\n else {\n const toSleep = Math.random() * delay;\n timeoutId = setTimeout(() => {\n now = new Date();\n delay = Math.min(delay * delayMult, maxDelay);\n const timeoutCal = timeout && timeoutMult ? timeout * timeoutMult : 0;\n const rpcTimeout = maxTimeout ? maxTimeout : 0;\n const newDeadline = deadline ? deadline - now.getTime() : 0;\n timeout = Math.min(timeoutCal, rpcTimeout, newDeadline);\n repeat();\n }, toSleep);\n }\n });\n if (canceller instanceof Promise) {\n canceller.catch(err => {\n callback(new googleError_1.GoogleError(err));\n });\n }\n }", "title": "" }, { "docid": "c2b335c8e9b9e2c9b1a225b4a9b62fb3", "score": "0.67292076", "text": "function repeat() {\n timeoutId = null;\n if (deadline && now.getTime() >= deadline) {\n const error = new googleError_1.GoogleError('Retry total timeout exceeded before any response was received');\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n callback(error);\n return;\n }\n if (retries && retries >= maxRetries) {\n const error = new googleError_1.GoogleError('Exceeded maximum number of retries before any ' +\n 'response was received');\n error.code = status_1.Status.DEADLINE_EXCEEDED;\n callback(error);\n return;\n }\n retries++;\n const toCall = timeout_1.addTimeoutArg(func, timeout, otherArgs);\n canceller = toCall(argument, (err, response, next, rawResponse) => {\n if (!err) {\n callback(null, response, next, rawResponse);\n return;\n }\n canceller = null;\n if (retry.retryCodes.indexOf(err.code) < 0) {\n err.note =\n 'Exception occurred in retry method that was ' +\n 'not classified as transient';\n callback(err);\n }\n else {\n const toSleep = Math.random() * delay;\n timeoutId = setTimeout(() => {\n now = new Date();\n delay = Math.min(delay * delayMult, maxDelay);\n const timeoutCal = timeout && timeoutMult ? timeout * timeoutMult : 0;\n const rpcTimeout = maxTimeout ? maxTimeout : 0;\n const newDeadline = deadline ? deadline - now.getTime() : 0;\n timeout = Math.min(timeoutCal, rpcTimeout, newDeadline);\n repeat();\n }, toSleep);\n }\n });\n }", "title": "" }, { "docid": "66d1c1818da62e37af20a6451c8131cd", "score": "0.67257214", "text": "constructor(timeout = 60, retryOpts = {}) {\n this._timeout = timeout * 1000;\n this._retries = retryOpts.retries || 5;\n this._minRetryDelayInSeconds = retryOpts.minDelayInSeconds || 1;\n this._maxRetryDelayInSeconds = retryOpts.maxDelayInSeconds || 30;\n }", "title": "" }, { "docid": "267ed83181b231aa45602539f61502d9", "score": "0.65590996", "text": "function retryConnection() {\r\n setTimeout(reconnect.bind(this), this.retryDelay);\r\n }", "title": "" }, { "docid": "987d47755f9557b39de96a2296571b19", "score": "0.6487489", "text": "function retryTemporarilyUnavailableEpic(action$) {\n return action$.pipe(\n filter(action => !!action.error),\n filter(action => action.payload.status === 503),\n // Wait 10s and try again\n delay(10000),\n map(action => action.request)\n );\n}", "title": "" }, { "docid": "796f6441c0f2d9c271fe850475500062", "score": "0.6419573", "text": "_startConnectionRetryTimer() {\n this._retryTimer = setTimeout(() => {\n this._timedOut = true;\n clearTimeout(this._retryTimer);\n throw new Error(\n \"Rooibos-CI timed out. Unable to connect to the Rooibos server.\"\n );\n }, this.options.timeout);\n }", "title": "" }, { "docid": "585b031f5903564c84973e3e575d33fb", "score": "0.6358236", "text": "function retryTemporarilyUnavailableEpic(action$) {\n return action$.pipe(\n filter(action => !!action.error),\n filter(action => action.payload.statusCode === StatusCodes.SERVICE_UNAVAILABLE),\n // Wait 10s and try again\n delay(10000),\n map(action => action.request)\n );\n}", "title": "" }, { "docid": "79a86320a3742c60447a57456eb90c5a", "score": "0.63304144", "text": "function retryDownload(retries) {\n const ids = Object.keys(retries);\n ids.forEach(id => {\n // if we retried 5 times total (6 including initial try), remove the id from the retry table\n if (history.retry[id].count > 5) {\n delete history.retry[id];\n } else {\n download(id);\n }\n });\n // update history with new retries if we had to update them\n updateHistory(Date.now(), history.retry);\n}", "title": "" }, { "docid": "cc9fbc9109e56e094db5e1b4040dfed0", "score": "0.63116103", "text": "function systemErrorRetryPolicy(options = {}) {\n var _a, _b, _c;\n const retryCount = (_a = options.maxRetries) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_COUNT$1;\n const retryInterval = (_b = options.retryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_RETRY_INTERVAL$1;\n const maxRetryInterval = (_c = options.maxRetryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_CLIENT_MAX_RETRY_INTERVAL$1;\n function shouldRetry(retryData, err) {\n if (!isSystemError(err)) {\n return false;\n }\n const currentCount = retryData.retryCount;\n return currentCount <= retryCount;\n }\n function updateRetryData(retryData, err) {\n if (err) {\n if (retryData.error) {\n err.innerError = retryData.error;\n }\n retryData.error = err;\n }\n // Adjust retry count\n retryData.retryCount++;\n // Exponentially increase the delay each time\n const exponentialDelay = retryInterval * Math.pow(2, retryData.retryCount);\n // Don't let the delay exceed the maximum\n const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay);\n // Allow the final value to have some \"jitter\" (within 50% of the delay size) so\n // that retries across multiple clients don't occur simultaneously.\n const delayWithJitter = clampedExponentialDelay / 2 + getRandomIntegerInclusive(0, clampedExponentialDelay / 2);\n retryData.retryInterval = delayWithJitter;\n return retryData;\n }\n async function retry(next, retryData, request, response, requestError) {\n retryData = updateRetryData(retryData, requestError);\n if (shouldRetry(retryData, requestError)) {\n try {\n logger.info(`Retrying request in ${retryData.retryInterval}`);\n await delay(retryData.retryInterval);\n const res = await next(request);\n return retry(next, retryData, request, res);\n }\n catch (e) {\n return retry(next, retryData, request, response, e);\n }\n }\n else if (requestError || !response) {\n // If the operation failed in the end, return all errors instead of just the last one\n const err = retryData.error ||\n new RestError(\"Failed to send the request.\", {\n code: RestError.REQUEST_SEND_ERROR,\n statusCode: response === null || response === void 0 ? void 0 : response.status,\n request: response === null || response === void 0 ? void 0 : response.request,\n response\n });\n throw err;\n }\n else {\n return response;\n }\n }\n return {\n name: systemErrorRetryPolicyName,\n async sendRequest(request, next) {\n const retryData = {\n retryCount: 0,\n retryInterval: 0\n };\n try {\n const response = await next(request);\n return retry(next, retryData, request, response);\n }\n catch (e) {\n const error = e;\n return retry(next, retryData, request, error.response, error);\n }\n }\n };\n}", "title": "" }, { "docid": "0dd1631e3b09ee0d023225c889f93c45", "score": "0.6248506", "text": "retryPolicy () {\n\t\treturn new retry.DefaultRetryPolicy(3);\n\t}", "title": "" }, { "docid": "e7314d2bc7d95b91396d55c01af34417", "score": "0.62351704", "text": "function fetchWithRetries(uri, initWithRetries) {\n\t var _ref = initWithRetries || {};\n\n\t var fetchTimeout = _ref.fetchTimeout;\n\t var retryDelays = _ref.retryDelays;\n\n\t var init = _objectWithoutProperties(_ref, ['fetchTimeout', 'retryDelays']);\n\n\t var _fetchTimeout = fetchTimeout != null ? fetchTimeout : DEFAULT_TIMEOUT;\n\t var _retryDelays = retryDelays != null ? retryDelays : DEFAULT_RETRIES;\n\n\t var requestsAttempted = 0;\n\t var requestStartTime = 0;\n\t return new Promise(function (resolve, reject) {\n\t /**\n\t * Sends a request to the server that will timeout after `fetchTimeout`.\n\t * If the request fails or times out a new request might be scheduled.\n\t */\n\t function sendTimedRequest() {\n\t requestsAttempted++;\n\t requestStartTime = Date.now();\n\t var isRequestAlive = true;\n\t var request = fetch(uri, init);\n\t var requestTimeout = setTimeout(function () {\n\t isRequestAlive = false;\n\t if (shouldRetry(requestsAttempted)) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'fetchWithRetries: HTTP timeout, retrying.') : void 0;\n\t retryRequest();\n\t } else {\n\t reject(new Error(sprintf('fetchWithRetries(): Failed to get response from server, ' + 'tried %s times.', requestsAttempted)));\n\t }\n\t }, _fetchTimeout);\n\n\t request.then(function (response) {\n\t clearTimeout(requestTimeout);\n\t if (isRequestAlive) {\n\t // We got a response, we can clear the timeout.\n\t if (response.status >= 200 && response.status < 300) {\n\t // Got a response code that indicates success, resolve the promise.\n\t resolve(response);\n\t } else if (shouldRetry(requestsAttempted)) {\n\t // Fetch was not successful, retrying.\n\t // TODO(#7595849): Only retry on transient HTTP errors.\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'fetchWithRetries: HTTP error, retrying.') : void 0, retryRequest();\n\t } else {\n\t // Request was not successful, giving up.\n\t var error = new Error(sprintf('fetchWithRetries(): Still no successful response after ' + '%s retries, giving up.', requestsAttempted));\n\t error.response = response;\n\t reject(error);\n\t }\n\t }\n\t })['catch'](function (error) {\n\t clearTimeout(requestTimeout);\n\t if (shouldRetry(requestsAttempted)) {\n\t retryRequest();\n\t } else {\n\t reject(error);\n\t }\n\t });\n\t }\n\n\t /**\n\t * Schedules another run of sendTimedRequest based on how much time has\n\t * passed between the time the last request was sent and now.\n\t */\n\t function retryRequest() {\n\t var retryDelay = _retryDelays[requestsAttempted - 1];\n\t var retryStartTime = requestStartTime + retryDelay;\n\t // Schedule retry for a configured duration after last request started.\n\t setTimeout(sendTimedRequest, retryStartTime - Date.now());\n\t }\n\n\t /**\n\t * Checks if another attempt should be done to send a request to the server.\n\t */\n\t function shouldRetry(attempt) {\n\t return ExecutionEnvironment.canUseDOM && attempt <= _retryDelays.length;\n\t }\n\n\t sendTimedRequest();\n\t });\n\t}", "title": "" }, { "docid": "1eab1a9ccd1500915d4ab63ec01e8686", "score": "0.6194701", "text": "function exponentialRetryPolicy(options = {}) {\n var _a, _b, _c;\n const retryCount = (_a = options.maxRetries) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_COUNT;\n const retryInterval = (_b = options.retryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_RETRY_INTERVAL;\n const maxRetryInterval = (_c = options.maxRetryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_CLIENT_MAX_RETRY_INTERVAL;\n /**\n * Determines if the operation should be retried and how long to wait until the next retry.\n *\n * @param statusCode - The HTTP status code.\n * @param retryData - The retry data.\n * @returns True if the operation qualifies for a retry; false otherwise.\n */\n function shouldRetry(response, retryData) {\n const statusCode = response === null || response === void 0 ? void 0 : response.status;\n if (statusCode === 503 && (response === null || response === void 0 ? void 0 : response.headers.get(\"Retry-After\"))) {\n return false;\n }\n if (statusCode === undefined ||\n (statusCode < 500 && statusCode !== 408) ||\n statusCode === 501 ||\n statusCode === 505) {\n return false;\n }\n const currentCount = retryData && retryData.retryCount;\n return currentCount < retryCount;\n }\n /**\n * Updates the retry data for the next attempt.\n *\n * @param retryData - The retry data.\n * @param err - The operation's error, if any.\n */\n function updateRetryData(retryData, err) {\n if (err) {\n if (retryData.error) {\n err.innerError = retryData.error;\n }\n retryData.error = err;\n }\n // Adjust retry count\n retryData.retryCount++;\n // Exponentially increase the delay each time\n const exponentialDelay = retryInterval * Math.pow(2, retryData.retryCount);\n // Don't let the delay exceed the maximum\n const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay);\n // Allow the final value to have some \"jitter\" (within 50% of the delay size) so\n // that retries across multiple clients don't occur simultaneously.\n const delayWithJitter = clampedExponentialDelay / 2 + getRandomIntegerInclusive(0, clampedExponentialDelay / 2);\n retryData.retryInterval = delayWithJitter;\n return retryData;\n }\n async function retry(next, retryData, request, response, requestError) {\n var _a;\n retryData = updateRetryData(retryData, requestError);\n const isAborted = (_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted;\n if (!isAborted && shouldRetry(response, retryData)) {\n logger.info(`Retrying request in ${retryData.retryInterval}`);\n try {\n await delay(retryData.retryInterval);\n const res = await next(request);\n return retry(next, retryData, request, res);\n }\n catch (e) {\n return retry(next, retryData, request, response, e);\n }\n }\n else if (isAborted || requestError || !response) {\n // If the operation failed in the end, return all errors instead of just the last one\n const err = retryData.error ||\n new RestError(\"Failed to send the request.\", {\n code: RestError.REQUEST_SEND_ERROR,\n statusCode: response === null || response === void 0 ? void 0 : response.status,\n request: response === null || response === void 0 ? void 0 : response.request,\n response\n });\n throw err;\n }\n else {\n return response;\n }\n }\n return {\n name: exponentialRetryPolicyName,\n async sendRequest(request, next) {\n const retryData = {\n retryCount: 0,\n retryInterval: 0\n };\n try {\n const response = await next(request);\n return retry(next, retryData, request, response);\n }\n catch (e) {\n const error = e;\n return retry(next, retryData, request, error.response, error);\n }\n }\n };\n}", "title": "" }, { "docid": "50e8dc892d8526dacf6b4dcbdf029c36", "score": "0.6155282", "text": "function retryWait(config) {\n\n if ($rootScope.loggingIn) {\n $timeout(function () {\n return retryWait(config);\n }, 100);\n } else {\n return $q.reject(rejection);\n }\n }", "title": "" }, { "docid": "db418e8e0834f72ef14b7cbd7ee68aa6", "score": "0.6152225", "text": "function sendTimedRequest() {\n\t requestsAttempted++;\n\t requestStartTime = Date.now();\n\t var isRequestAlive = true;\n\t var request = fetch(uri, init);\n\t var requestTimeout = setTimeout(function () {\n\t isRequestAlive = false;\n\t if (shouldRetry(requestsAttempted)) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'fetchWithRetries: HTTP timeout, retrying.') : void 0;\n\t retryRequest();\n\t } else {\n\t reject(new Error(sprintf('fetchWithRetries(): Failed to get response from server, ' + 'tried %s times.', requestsAttempted)));\n\t }\n\t }, _fetchTimeout);\n\n\t request.then(function (response) {\n\t clearTimeout(requestTimeout);\n\t if (isRequestAlive) {\n\t // We got a response, we can clear the timeout.\n\t if (response.status >= 200 && response.status < 300) {\n\t // Got a response code that indicates success, resolve the promise.\n\t resolve(response);\n\t } else if (shouldRetry(requestsAttempted)) {\n\t // Fetch was not successful, retrying.\n\t // TODO(#7595849): Only retry on transient HTTP errors.\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'fetchWithRetries: HTTP error, retrying.') : void 0, retryRequest();\n\t } else {\n\t // Request was not successful, giving up.\n\t var error = new Error(sprintf('fetchWithRetries(): Still no successful response after ' + '%s retries, giving up.', requestsAttempted));\n\t error.response = response;\n\t reject(error);\n\t }\n\t }\n\t })['catch'](function (error) {\n\t clearTimeout(requestTimeout);\n\t if (shouldRetry(requestsAttempted)) {\n\t retryRequest();\n\t } else {\n\t reject(error);\n\t }\n\t });\n\t }", "title": "" }, { "docid": "adbf7d9a9e7d9b6649a4aed8cb40fb9b", "score": "0.61307585", "text": "retry(operation, count, wait) {\n if (count) {\n return this.then(_ => operation()).catch(err => {\n // console.log('retry', count, wait, err.name)\n return this.then(_ => wait && this.sleep(wait))\n .then(_ => this.retry(operation, count - 1, wait && wait * 2))\n })\n } else {\n return this.then(_ => operation())\n }\n }", "title": "" }, { "docid": "cf92c889ce2f8f685ce26791a9a61aa4", "score": "0.6107519", "text": "function fetchWithRetries(uri, initWithRetries) {\n var _ref = initWithRetries || {},\n fetchTimeout = _ref.fetchTimeout,\n retryDelays = _ref.retryDelays,\n init = _objectWithoutProperties(_ref, ['fetchTimeout', 'retryDelays']);\n\n var _fetchTimeout = fetchTimeout != null ? fetchTimeout : DEFAULT_TIMEOUT;\n var _retryDelays = retryDelays != null ? retryDelays : DEFAULT_RETRIES;\n\n var requestsAttempted = 0;\n var requestStartTime = 0;\n return new Promise(function (resolve, reject) {\n /**\n * Sends a request to the server that will timeout after `fetchTimeout`.\n * If the request fails or times out a new request might be scheduled.\n */\n function sendTimedRequest() {\n requestsAttempted++;\n requestStartTime = Date.now();\n var isRequestAlive = true;\n var request = fetch(uri, init);\n var requestTimeout = setTimeout(function () {\n isRequestAlive = false;\n if (shouldRetry(requestsAttempted)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'fetchWithRetries: HTTP timeout, retrying.') : void 0;\n retryRequest();\n } else {\n reject(new Error(sprintf('fetchWithRetries(): Failed to get response from server, ' + 'tried %s times.', requestsAttempted)));\n }\n }, _fetchTimeout);\n\n request.then(function (response) {\n clearTimeout(requestTimeout);\n if (isRequestAlive) {\n // We got a response, we can clear the timeout.\n if (response.status >= 200 && response.status < 300) {\n // Got a response code that indicates success, resolve the promise.\n resolve(response);\n } else if (shouldRetry(requestsAttempted)) {\n // Fetch was not successful, retrying.\n // TODO(#7595849): Only retry on transient HTTP errors.\n process.env.NODE_ENV !== 'production' ? warning(false, 'fetchWithRetries: HTTP error, retrying.') : void 0, retryRequest();\n } else {\n // Request was not successful, giving up.\n var error = new Error(sprintf('fetchWithRetries(): Still no successful response after ' + '%s retries, giving up.', requestsAttempted));\n error.response = response;\n reject(error);\n }\n }\n })['catch'](function (error) {\n clearTimeout(requestTimeout);\n if (shouldRetry(requestsAttempted)) {\n retryRequest();\n } else {\n reject(error);\n }\n });\n }\n\n /**\n * Schedules another run of sendTimedRequest based on how much time has\n * passed between the time the last request was sent and now.\n */\n function retryRequest() {\n var retryDelay = _retryDelays[requestsAttempted - 1];\n var retryStartTime = requestStartTime + retryDelay;\n // Schedule retry for a configured duration after last request started.\n setTimeout(sendTimedRequest, retryStartTime - Date.now());\n }\n\n /**\n * Checks if another attempt should be done to send a request to the server.\n */\n function shouldRetry(attempt) {\n return ExecutionEnvironment.canUseDOM && attempt <= _retryDelays.length;\n }\n\n sendTimedRequest();\n });\n}", "title": "" }, { "docid": "a715bfa496ee1bcb47513046b073da86", "score": "0.6096826", "text": "function retryWithMaxAttempts(callback, pollInterval, retries) {\r\n if (retries > 0) {\r\n window.setTimeout(function () {\r\n if (callback()) {\r\n retries = 0;\r\n }\r\n retries--;\r\n retryWithMaxAttempts(callback, pollInterval, retries);\r\n }, pollInterval);\r\n }\r\n}", "title": "" }, { "docid": "8ddacc9317c6fbde3612881f7836396f", "score": "0.60612404", "text": "function retryHttpRequest(config, deferred) {\n\n //Get the http service now\n $http = $http || $injector.get('$http');\n\n //Retry the request\n $http(config).then(function(response) {\n deferred.resolve(response);\n }, function(reason) {\n deferred.reject(reason);\n });\n }", "title": "" }, { "docid": "e72f3691fef4a074975dc3e75dc18ee2", "score": "0.60282284", "text": "sendRequestWithCallbackAndRetry(request, data = {}, callback, initialDelay = 1000, delayFalloff = 1.3) {\n let callbackWrapper = (res) => {\n if(!res.err) {\n callback(res);\n } else if(res.err === \"Socket Not Connected\") {\n setTimeout((() => {\n initialDelay = initialDelay * delayFalloff;\n this.sendRequestWithCallback2(request, data, callbackWrapper);\n }), initialDelay); \n } else if(res.err === \"Peer not found\") {\n callback(res); // Server could not find peer, \n } else {\n console.log(\"ERROR 12511: Unknown Error from socket...\")\n }\n }\n this.sendRequestWithCallback2(request, data, callbackWrapper);\n }", "title": "" }, { "docid": "fdc5b3bbf5690509297cbd932698ecc4", "score": "0.6026032", "text": "async function tryUrl(url, fallback, retry) {\n try {\n let response = await fallback(url);\n let data = await response.json();\n saveToCache(url, data);\n return data;\n } catch (e) {\n if (retry > 0 && e.message.includes(\"timed out\")) { \n return tryUrl(url, fallback, retry - 1);\n } else {\n throw e;\n }\n }\n}", "title": "" }, { "docid": "9a217c8aaaaf8ffa5969a09f6a4f386c", "score": "0.6020073", "text": "function retry(attempts, delay, func, error_logger) {\n\n // call func and catch errors,\n // passing remaining attempts just fyi\n return P.try(() => func(attempts))\n .catch(err => {\n\n // check attempts\n attempts -= 1;\n if (attempts <= 0 || err.DO_NOT_RETRY) {\n throw err;\n }\n\n if (error_logger) {\n error_logger(err);\n }\n\n // delay and retry next attempt\n return P.delay(delay)\n .then(() => retry(attempts, delay, func, error_logger));\n });\n}", "title": "" }, { "docid": "6d04844d44b8433035dd1d2f23236bd5", "score": "0.60183233", "text": "function sendTimedRequest() {\n requestsAttempted++;\n requestStartTime = Date.now();\n var isRequestAlive = true;\n var request = fetch(uri, init);\n var requestTimeout = setTimeout(function () {\n isRequestAlive = false;\n if (shouldRetry(requestsAttempted)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'fetchWithRetries: HTTP timeout, retrying.') : void 0;\n retryRequest();\n } else {\n reject(new Error(sprintf('fetchWithRetries(): Failed to get response from server, ' + 'tried %s times.', requestsAttempted)));\n }\n }, _fetchTimeout);\n\n request.then(function (response) {\n clearTimeout(requestTimeout);\n if (isRequestAlive) {\n // We got a response, we can clear the timeout.\n if (response.status >= 200 && response.status < 300) {\n // Got a response code that indicates success, resolve the promise.\n resolve(response);\n } else if (shouldRetry(requestsAttempted)) {\n // Fetch was not successful, retrying.\n // TODO(#7595849): Only retry on transient HTTP errors.\n process.env.NODE_ENV !== 'production' ? warning(false, 'fetchWithRetries: HTTP error, retrying.') : void 0, retryRequest();\n } else {\n // Request was not successful, giving up.\n var error = new Error(sprintf('fetchWithRetries(): Still no successful response after ' + '%s retries, giving up.', requestsAttempted));\n error.response = response;\n reject(error);\n }\n }\n })['catch'](function (error) {\n clearTimeout(requestTimeout);\n if (shouldRetry(requestsAttempted)) {\n retryRequest();\n } else {\n reject(error);\n }\n });\n }", "title": "" }, { "docid": "ab91638be359f7212dffe20e33815570", "score": "0.5988924", "text": "recover(err) {\n let newBackOff = this.backOff ? Math.min(this.backOff * 2, 6e4) : 200\n if (newBackOff > 1000 && this.backOff < 1000) this.report.delay(err)\n this.backOff = newBackOff\n setTimeout(() => {\n if (this.state.comm === 'recover') this.dispatch({type: 'retry', requestDone: true})\n }, this.backOff)\n }", "title": "" }, { "docid": "f9f58e3490e0d1e3be513dd618c7b96c", "score": "0.5987481", "text": "function backoff(tries) {\n return Math.min(Math.pow(tries * 10, 2), 10 * 1000);\n}", "title": "" }, { "docid": "f167c8c43bef28cf3cf14902f389de29", "score": "0.5978377", "text": "function _setRetryTime(linearFactor) {\r\n var SlotDelayInSeconds = 10;\r\n var delayInSeconds;\r\n if (_consecutiveErrors <= 1) {\r\n delayInSeconds = SlotDelayInSeconds;\r\n }\r\n else {\r\n var backOffSlot = (Math.pow(2, _consecutiveErrors) - 1) / 2;\r\n // tslint:disable-next-line:insecure-random\r\n var backOffDelay = Math.floor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1;\r\n backOffDelay = linearFactor * backOffDelay;\r\n delayInSeconds = Math.max(Math.min(backOffDelay, 3600), SlotDelayInSeconds);\r\n }\r\n // TODO: Log the backoff time like the C# version does.\r\n var retryAfterTimeSpan = CoreUtils.dateNow() + (delayInSeconds * 1000);\r\n // TODO: Log the retry at time like the C# version does.\r\n _retryAt = retryAfterTimeSpan;\r\n }", "title": "" }, { "docid": "1154383cde389140e94d52e53f2359e6", "score": "0.5971374", "text": "function refreshFailed(details) {\n window.clearTimeout(requestTimeout);\n retryCount++;\n reportError(details);\n scheduleRefresh();\n }", "title": "" }, { "docid": "cb229f1c5b63be26f6187e831549ac6f", "score": "0.59479564", "text": "function fetchWithRetry(url, options) {\n async function fetchWrapper() {\n const response = await node_fetch_1.default(url, options);\n // don't retry if status is 4xx\n if (response.status >= 400 && response.status < 500) {\n const contentType = response.headers.get('content-type');\n if (contentType && contentType.includes('application/json')) {\n const body = await response.json();\n throw new p_retry_1.default.AbortError(body.message);\n }\n else {\n throw new p_retry_1.default.AbortError(response.statusText);\n }\n }\n return response;\n }\n return p_retry_1.default(fetchWrapper, { retries: RETRY_COUNT });\n}", "title": "" }, { "docid": "2588f5517dcf0459495f03c744d44bb0", "score": "0.59018373", "text": "async tryRequest(request) {\n if (request.headers && !request.headers['user-agent']) {\n request = { ...request, headers: { ...request.headers, 'user-agent': 'pown' } }\n }\n\n const { maxRetries = 5, retryDely = 5000 } = request\n\n let res\n\n for (let i = 0; i < maxRetries; i++) {\n if (i > 0) {\n await sleep(retryDely)\n }\n\n try {\n res = await this.request(request)\n }\n catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(e)\n }\n\n continue\n }\n\n if (res.info.error) {\n console.error(`${res.method || 'GET'}`, res.uri, '->', res.info.error)\n }\n else {\n console.debug(`${res.method || 'GET'}`, res.uri, '->', res.responseCode, Buffer.from(res.responseBody).slice(0, 512).toString('base64'))\n\n if (res.responseCode < 500) {\n break\n }\n }\n }\n\n if (!res || res.responseCode >= 500) {\n throw new Error(`Cannot request ${res.method} ${res.uri} -> ${res.responseCode}`)\n }\n\n if (request.toJson || request.toJSON) {\n return JSON.parse(res.responseBody)\n }\n else {\n return res\n }\n }", "title": "" }, { "docid": "fcfaf7e33cedb869439dd583b03589d7", "score": "0.5885694", "text": "retryAll(updater) {\n for (let i = 0; i < buffer.length; ++i) {\n retryHttpRequest(updater(buffer[i].config), buffer[i].deferred);\n }\n buffer = [];\n }", "title": "" }, { "docid": "7fbc17c606781cce96a88da5946f30fa", "score": "0.58697915", "text": "function throttlingRetryPolicy() {\n return {\n name: throttlingRetryPolicyName,\n async sendRequest(request, next) {\n let response = await next(request);\n for (let count = 0; count < DEFAULT_CLIENT_MAX_RETRY_COUNT; count++) {\n if (response.status !== 429 && response.status !== 503) {\n return response;\n }\n const retryAfterHeader = response.headers.get(\"Retry-After\");\n if (!retryAfterHeader) {\n break;\n }\n const delayInMs = parseRetryAfterHeader(retryAfterHeader);\n if (!delayInMs) {\n break;\n }\n await delay(delayInMs);\n response = await next(request);\n }\n return response;\n }\n };\n}", "title": "" }, { "docid": "d77ce681c90a689d5d1a2d3745b9446e", "score": "0.5869618", "text": "function defaultRetryConfig() {\n return {\n maxRetries: 4,\n statusCodes: [503],\n ioErrorCodes: ['ECONNRESET', 'ETIMEDOUT'],\n backOffFactor: 0.5,\n maxDelayInMillis: 60 * 1000,\n };\n}", "title": "" }, { "docid": "3418ee605f8721c8cca6dac8ffe3b0d1", "score": "0.5866345", "text": "function retry(count) {\n if (count === void 0) {\n count = -1;\n }\n return function (source) { return source.lift(new RetryOperator(count, source)); };\n}", "title": "" }, { "docid": "9d3daeb68fa5d6d46d471d322880a37e", "score": "0.5863999", "text": "function retry(fn, retriesLeft = 3, interval = 1000) {\n return new Promise((resolve, reject) => {\n fn()\n .then(resolve)\n .catch(error => {\n setTimeout(() => {\n if (retriesLeft === 1) {\n // reject('maximum retries exceeded');\n reject(error);\n return;\n }\n\n // Passing on \"reject\" is the important part\n retry(fn, interval, retriesLeft - 1).then(resolve, reject);\n }, interval);\n });\n });\n}", "title": "" }, { "docid": "f4fd55cdbd171a13321c70f17c4ce0ca", "score": "0.5858505", "text": "function checkTries() {\n if(tries>=3){\n showError(\"Ummm.... Something's Wrong\",\"3 tries. Reset\",\"Reset password\",\"error_close\");\n }\n }", "title": "" }, { "docid": "b5ff5d575309f43205238a846ebc1177", "score": "0.58510214", "text": "function getRetryTimeoutTime(attemptNumber) {\n\t\treturn (1000 + 500*(2^(attemptNumber-1))) * getRetryRandomFactor(0.9, 1.1);\n\t}", "title": "" }, { "docid": "47677c9f782f7df03d6a35b679424b85", "score": "0.584127", "text": "function attempt(attempt = 1) {\r\n connectionPool.getConnection((error, connection) => {\r\n if (error) {\r\n if (error.code === 'PROTOCOL_CONNECTION_LOST')\r\n Log.writeError('Database connection was closed. Retry in {0}s', '10');\r\n else if (error.code === 'ER_CON_COUNT_ERROR')\r\n Log.writeError('Database has too many connections. Retry in {0}s', '10');\r\n else if (error.code === 'ECONNREFUSED')\r\n Log.writeError('Database connection was refused. Retry in {0}s', '10');\r\n else\r\n Log.writeError('Database connection error: {0}', error.code);\r\n connectionPool.retry(attempt)\r\n }\r\n if (connection) {\r\n connection.release()\r\n Log.writeLog('Database connection successful');\r\n }\r\n return;\r\n });\r\n}", "title": "" }, { "docid": "7da6e0df990b65501fa922a510bab98e", "score": "0.58367264", "text": "function retryPost(url, data, count, config) {\n\t/// <summary>Post to the server using querystring form POST format, so an object like { a: 1, b: 's' } gets sent as a\n\t/// request body like a=1&amp;b=s</summary>\n\t/// <param name=\"url\" type=\"String\">URL</param>\n\t/// <param name=\"data\" type=\"Object\">Querystring parameters to POST to server</param>\n\t/// <param name=\"count\" type=\"Number\" optional=\"true\">Optional. Number of times to retry. Uses exponential backoff.</param>\n\t/// <param name=\"config\" type=\"Object\" optional=\"true\">Optional configuration.\n\t/// {\n\t///\t\tvalidateResult: function(r) { } // Return true if the returned object is valid, false if it should be treated as a failure and retried (if retry count remains)\n\t/// }\n\t/// </param>\n\t/// <returns type=\"RetryAjaxDeferred\">jQuery AJAX Deferred, extended to support .failWillRetry()</returns>\n\treturn retryAjax(function() { return post(url, data); }, count, config);\n}", "title": "" }, { "docid": "e9153595e5e5a1e0d889598ae1dcb841", "score": "0.58275074", "text": "async _retryConnectItemQueue() {\n clearTimeout(this._retryConnectItemQueueHandle);\n\n const retryInterval = Math.max(\n MIN_CONN_RETRY,\n this.options.connectionRetryInterval\n );\n\n this._retryConnectItemQueueHandle = setTimeout(() => {\n if (this._itemQueueConnection) {\n this._itemQueueConnection.removeAllListeners();\n }\n if (this._itemQueueChannel) {\n this._itemQueueChannel.removeAllListeners();\n }\n\n this._connectItemQueue();\n }, retryInterval);\n }", "title": "" }, { "docid": "c96537447c1e9e817f019454e2be86ea", "score": "0.5824681", "text": "function connectWithRetry(){\n mongoose.connect(mongoURL, {useNewUrlParser: true, useUnifiedTopology: true})\n .then(()=> console.log(\"succesfully connected to DB\"))\n .catch((e)=> {\n console.log(e);\n setTimeout(connectWithRetry, 5000);\n }); \n}", "title": "" }, { "docid": "7e76a6020eca22c800f052e8153e7f60", "score": "0.581746", "text": "function httpDeleteRetry(internalValue, counter) {\n var deleter = deleteRecording(internalValue);\n if (deleter) {\n deleter.then(function () {\n }, function (response) {\n if (response.status > 0 && !_.inRange(response.status, 403, 405)) {\n if (counter < 3) {\n httpDeleteRetry(internalValue, ++counter);\n }\n }\n });\n }\n }", "title": "" }, { "docid": "f3dcda85a5605f628ca0f2c5c07752f2", "score": "0.58158576", "text": "function cancelRetryTimer() {\n if (_retryTimer) {\n LogSvc.info('[AtcRegistrationSvc]: Cancel retry timer');\n $timeout.cancel(_retryTimer);\n _retryTimer = null;\n }\n }", "title": "" }, { "docid": "f16f3afcacb1c33c8095b18083b282d3", "score": "0.57768214", "text": "function shouldRetry(attempt) {\n\t return ExecutionEnvironment.canUseDOM && attempt <= _retryDelays.length;\n\t }", "title": "" }, { "docid": "ed91b0957b9ab8fba363d015af93bb24", "score": "0.5769866", "text": "shouldRetry(err) {\n if (err instanceof this.errorClass) {\n return err.statusCode >= 500 && err.statusCode < 600;\n }\n return RETRY_CODES[err.code] || false;\n }", "title": "" }, { "docid": "550090e36170eaeab9eac23bb38c4f2b", "score": "0.5764387", "text": "function tryRequest() {\n attempts++;\n\n self.channel.waitForIdentified({\n host: opts.hostPort\n }, onIdentified);\n\n function onIdentified(err) {\n if (err) {\n return onResponse(err);\n }\n\n self.tchannelJSON.send(self.channel.request({\n host: opts.hostPort,\n serviceName: 'hyperbahn',\n trace: false,\n timeout: self.relayAdTimeout,\n headers: {\n cn: opts.inreq.callerName || self.callerName\n },\n parent: opts.inreq,\n retryFlags: {\n never: true\n }\n }), opts.endpoint, null, {\n services: opts.services\n }, onResponse);\n }\n\n function onResponse(err, response) {\n if (response && response.ok) {\n return callback(null, null);\n }\n\n var codeName = Errors.classify(err);\n if (attempts <= self.maxRelayAdAttempts && err &&\n (\n codeName === 'NetworkError' ||\n codeName === 'Timeout'\n )\n ) {\n setTimeout(tryRequest, self.relayAdRetryTime);\n } else {\n self.logError(err, opts, response);\n\n callback(null, null);\n }\n }\n }", "title": "" }, { "docid": "56c9258e79730d260ee8a5ef1d25435c", "score": "0.575879", "text": "function retryIfServerError(fn) {\n return Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"__awaiter\"])(this, void 0, void 0, function () {\n var result;\n return Object(__WEBPACK_IMPORTED_MODULE_2_tslib__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fn()];\n case 1:\n result = _a.sent();\n if (result.status >= 500 && result.status < 600) {\n // Internal Server Error. Retry request.\n return [2 /*return*/, fn()];\n }\n return [2 /*return*/, result];\n }\n });\n });\n}", "title": "" }, { "docid": "1c6502e1bada06e967837360c5672370", "score": "0.57522625", "text": "function retryConnection() {\n\t//Reset the dbError global variable to its default state. If an error is encountered, dbError will again become true\n\tdbError = false;\n\tcheckHideShowError($(\"#noDB\"), $(\"#noDBTxt\"), dbError);\n\t\n\tpopulateMenuLists();\n}", "title": "" }, { "docid": "d7d7d3868615fe41bc5df8123e5fa224", "score": "0.57512796", "text": "retry() { this._startLoading(); }", "title": "" }, { "docid": "7b9d64636860d4b132b6557a1bc9d6cf", "score": "0.57452995", "text": "async send_request() {\n let max_attempts =\n typeof this.max_cuncurrent_request_failures != 'number'\n ? 1\n : this.max_cuncurrent_request_failures\n\n while (max_attempts > 0) {\n max_attempts -= 1\n try {\n return await this.__do_send_request()\n } catch (err) {\n if (max_attempts == 0) throw err\n else this.emit_error_ignored(err)\n }\n }\n }", "title": "" }, { "docid": "4870de0db09b79f2bb09b460a8eaa676", "score": "0.57356435", "text": "function retryIfServerError(fn) {\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_2__[\"__awaiter\"])(this, void 0, void 0, function () {\r\n var result;\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_2__[\"__generator\"])(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, fn()];\r\n case 1:\r\n result = _a.sent();\r\n if (result.status >= 500 && result.status < 600) {\r\n // Internal Server Error. Retry request.\r\n return [2 /*return*/, fn()];\r\n }\r\n return [2 /*return*/, result];\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "4870de0db09b79f2bb09b460a8eaa676", "score": "0.57356435", "text": "function retryIfServerError(fn) {\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_2__[\"__awaiter\"])(this, void 0, void 0, function () {\r\n var result;\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_2__[\"__generator\"])(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, fn()];\r\n case 1:\r\n result = _a.sent();\r\n if (result.status >= 500 && result.status < 600) {\r\n // Internal Server Error. Retry request.\r\n return [2 /*return*/, fn()];\r\n }\r\n return [2 /*return*/, result];\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "dc10d072fa9058d459be0b28653f44c8", "score": "0.5729735", "text": "retry_(delay) {\n const self = this;\n this.begin(function(err) {\n if (err) {\n self.runFn_(err);\n return;\n }\n self.queuedMutations_ = [];\n setTimeout(function() {\n self.runFn_(null, self);\n }, delay);\n });\n }", "title": "" }, { "docid": "e9b4f726b2cb7aea2d631a957cf609df", "score": "0.5722534", "text": "function Retry(config) {\n \"use strict\";\n var attempts = 0;\n var promise;\n var signal = new Signal_1.default(function () {\n promise.cancel();\n });\n function onSuccess(value) {\n if (config.shouldRestart && config.shouldRestart()) {\n if (config.resetAttemptsOnRestart) {\n attempts = 0;\n }\n callCallback();\n }\n else {\n signal.complete(value);\n }\n }\n function onError(error) {\n if (config.adjustRetries) {\n config.retries = config.adjustRetries(error);\n }\n if (attempts < config.retries && config.canRetry(error)) {\n attempts++;\n if (config.beforeRetry) {\n config.beforeRetry();\n }\n config.async.setTimeout(callCallback, config.delay);\n }\n else {\n signal.error(error);\n }\n }\n function callCallback() {\n promise = config.callback();\n promise.done(onSuccess, onError);\n }\n callCallback();\n return signal.getPromise();\n}", "title": "" }, { "docid": "07f8de3ac69ff8229ddf51e5fce2f9f4", "score": "0.57190686", "text": "function retryOnError(mode, response) {\n function tryAgainIn(sleepTimeMs) {\n // eslint-disable-next-line no-undef\n if (networkErrorsOnConsole) console.log('log #' + mode.id + ' - Trying again in ' + sleepTimeMs + '[ms], attempt no. ' + mode.attemptNumber);\n // eslint-disable-next-line no-undef\n setTimeout(function () {\n isBulk ? sendBulkLogs(mode) : sendInputLogs(mode);\n }, sleepTimeMs);\n }\n if (mode.attemptNumber >= numberOfRetries) {\n if (response.cause) {\n // eslint-disable-next-line no-undef\n if (networkErrorsOnConsole) console.error('Failed log #' + mode.id + ' after ' + mode.attemptNumber + ' retries on error = ' + response, response);\n } else {\n // eslint-disable-next-line no-undef\n if (networkErrorsOnConsole) console.error('Failed log #' + mode.id + ' after ' + mode.attemptNumber + ' retries on error = ' + response.statusCode + ' ' + response.statusMessage);\n }\n } else {\n if (response.cause) {\n // eslint-disable-next-line no-undef\n if (networkErrorsOnConsole) console.log('log #' + mode.id + ' - failed on error: ' + response);\n } else {\n // eslint-disable-next-line no-undef\n if (networkErrorsOnConsole) console.log('log #' + mode.id + ' - failed on error: ' + response.statusCode + ' ' + response.statusMessage);\n }\n sleepTimeMs = mode.sleepUntilNextRetry;\n mode.sleepUntilNextRetry = mode.sleepUntilNextRetry * 2;\n mode.attemptNumber++;\n tryAgainIn(sleepTimeMs)\n }\n }", "title": "" }, { "docid": "275bd86b0c9aee65699809a51e0d0dc9", "score": "0.571594", "text": "_handleRetryConnect() { \n if(this.connectionState.name == 'connected'){\n this._failedRetries = 0;\n return;\n }\n \n if(this._shouldRetryConnect && this.connectionState.name == 'disconnected'){\n this._failedRetries++;\n if(this._failedRetries > CONNECT_RETRIES){\n this._logger.info(`Give up trying to reconnect after ${this._failedRetries} times`);\n this._setConnectionState({\n oldState: 4,\n newState: 500\n }); \n }\n else{\n this._logger.info(`Retrying to connect ${this._failedRetries} of ${CONNECT_RETRIES}`);\n this._taskQueue.queueMicroTask(() => {\n this._connection.start();\n });\n }\n } \n }", "title": "" }, { "docid": "9ea0125a41499fe5985aa32788e5ef8d", "score": "0.5701468", "text": "function retry_connection() {\n ws = new WebSocket(ws_url);\n init_ws();\n setTimeout(() => {\n if (ws.readyState != 1) {\n ws.close();\n retry_connection();\n }\n }, 2000);\n}", "title": "" }, { "docid": "866468ea2d7a818baab74c197f918bb5", "score": "0.5699194", "text": "function retry() {\n\t\t\tdelete pending[ idx ];\n\t\t\t__debug_414( 'Reading file: %s (%d of %d). Retry: %d of %d.', file, k, len, retries, MAX_RETRIES );\n\t\t\t_$readFile_422( file, opts, onRead );\n\t\t}", "title": "" }, { "docid": "32e302ee3f91d7e156235edc1694537d", "score": "0.568406", "text": "function retryIfServerError(fn) {\n return (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__awaiter)(this, void 0, void 0, function () {\n var result;\n return (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__generator)(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fn()];\n case 1:\n result = _a.sent();\n if (result.status >= 500 && result.status < 600) {\n // Internal Server Error. Retry request.\n return [2 /*return*/, fn()];\n }\n return [2 /*return*/, result];\n }\n });\n });\n}", "title": "" }, { "docid": "ff67456b146e6d65b2ec17cf0eb65599", "score": "0.5675006", "text": "function retryRecognition() {\n\t\tstartQueue(props.result.key);\n\t}", "title": "" }, { "docid": "36f84d00d2fb9789ecf06a396aa9e899", "score": "0.56701916", "text": "async function retryRequest(cinema) {\n return new Promise(async (resolve, reject) => {\n let retries = 0;\n const maxRetries = 10;\n let success = false;\n \n while (retries < maxRetries && !success) {\n try {\n const response = await api.get(`${cinema}/movies`);\n success = true;\n resolve(response.data.Movies); \n } catch (err) {\n const status = err?.response?.status || 500;\n console.log(`Error Status: ${status}`);\n retries++;\n }\n }\n reject(\"Sorry something went wrong, please try again later\");\n })\n }", "title": "" }, { "docid": "535451434303f9f3dfa93a5b186e4f18", "score": "0.5665857", "text": "function errorHTTPClient(request, mode, url, data, errObj, errMsg)\n{ \n\tif (request.readyState == 4 && request.retries < 3)\n { request.open(mode,url);\n request.setRequestHeader(\"Content-Type\",\"application/json\");\n request.send(data);\n request.retries++;\n }\n else\n { \n \tvar desc = errObj.error.substring(errObj.error.indexOf(\"Description=\")+12,errObj.error.lastIndexOf(\"}\"));\n }\n}", "title": "" }, { "docid": "f878906c761037dc461e8b89203ebedb", "score": "0.5663509", "text": "shouldRetryAfter(res, opts) {\n if (!opts.retry) {\n return false;\n }\n const retryAfterRaw = res.headers['retry-after'];\n if (res.status !== 429 || !retryAfterRaw) {\n return false;\n }\n // The `retry-after` header can come in either <seconds> or\n // A specific date to go check.\n let retryAfter = Number(retryAfterRaw) * 1000 + Date.now();\n if (isNaN(retryAfter)) {\n retryAfter = Date.parse(retryAfterRaw);\n if (isNaN(retryAfter)) {\n return false;\n }\n }\n // check to see if there is already a request to wait for this host\n if (opts.delayCache.has(opts.url.host)) {\n // use whichever time is higher in the cache\n const currentTimeout = opts.delayCache.get(opts.url.host);\n if (retryAfter > currentTimeout) {\n opts.delayCache.set(opts.url.host, retryAfter);\n }\n }\n else {\n opts.delayCache.set(opts.url.host, retryAfter);\n }\n opts.queue.add(async () => {\n await this.crawl(opts);\n }, {\n delay: retryAfter - Date.now(),\n });\n const retryDetails = {\n url: opts.url.href,\n status: res.status,\n secondsUntilRetry: Math.round((retryAfter - Date.now()) / 1000),\n };\n this.emit('retry', retryDetails);\n return true;\n }", "title": "" }, { "docid": "a0a94072be483e3385cdc10674096403", "score": "0.5654239", "text": "function retryQuiz() {\n\t\t\tquizFactory.changeState(\"results\", false);\n\t\t\tquizFactory.numCorrect = 0;\n\t\t}", "title": "" }, { "docid": "6a8a55b6879d7b1b3ab9bcfc2f6bde3d", "score": "0.56433994", "text": "function retryStrategyNumber(options) {\n // Ensure that the properties of RetryStrategyOptions are resilient to breaking change.\n // If the properties of the interface changes, the variables below will also need to be adapted.\n var error = options.error;\n var total_retry_time = options.total_retry_time;\n var times_connected = options.times_connected;\n var attempt = options.attempt;\n return 5000;\n}", "title": "" }, { "docid": "b286f3585feda0d071b27077ae98a7fe", "score": "0.5638547", "text": "function retry(){\n window.round = 0; \n start();\n}", "title": "" }, { "docid": "c80ea6c1f29e441112b50e0654a121bd", "score": "0.5631897", "text": "function connectWithRetry () {\n console.log('\\n\\n\\n * * * * MongoDB connection with retry * * * * \\n\\n\\n');\n\n return mongoClient.connect(MONGO_URL, function(err, connection) {\n if (err) {\n console.error('\\n\\n\\nConnection failed, retrying in 5 seconds', err);\n setTimeout(connectWithRetry, 5000);\n } else {\n initiateDB(connection);\n }\n });\n}", "title": "" }, { "docid": "9346255d1c6a20807d8ada1dbe005dc8", "score": "0.562953", "text": "disableRetry() {\n for (const key in this._handlers) {\n this._handlers[key].maxRetries = 0;\n }\n }", "title": "" }, { "docid": "4cfce4042d4e2678fbd0016738d6ac7a", "score": "0.5616097", "text": "function retryIfServerError(fn) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_2__[\"__awaiter\"])(\n this,\n void 0,\n void 0,\n function () {\n var result;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_2__[\"__generator\"])(\n this,\n function (_a) {\n switch (_a.label) {\n case 0:\n return [\n 4,\n /*yield*/\n fn(),\n ];\n\n case 1:\n result = _a.sent();\n\n if (result.status >= 500 && result.status < 600) {\n // Internal Server Error. Retry request.\n return [\n 2,\n /*return*/\n fn(),\n ];\n }\n\n return [\n 2,\n /*return*/\n result,\n ];\n }\n }\n );\n }\n );\n }", "title": "" }, { "docid": "c64c10df09dc03e95f3dee975ffcde33", "score": "0.56113017", "text": "function exponentialBackoff(max, delay, toTry, success, fail) {\n toTry()\n .then(result => success(result))\n .catch(_ => {\n if (max === 0) {\n return fail();\n }\n time('Retrying in ' + delay + 's... (' + max + ' tries left)');\n setTimeout(function() {\n exponentialBackoff(--max, delay * 2, toTry, success, fail);\n }, delay * 1000);\n });\n}", "title": "" }, { "docid": "18e3c941bb65be63f0fdb0e545299892", "score": "0.56006634", "text": "function backoff(retryTimeout) {\n return Math.min(per.maxTimeout, Math.floor(retryTimeout * per.backoff)); // exponential backoff\n }", "title": "" }, { "docid": "344f7dd8f15861506e99aa9d1b59e693", "score": "0.55932117", "text": "attempts(count) {\n return this.composeBackoff('a', new ConstantBackoff(1, count));\n }", "title": "" }, { "docid": "ea17514ce317bc51cdda7e11439307f5", "score": "0.55807346", "text": "function shouldRetry(attempt) {\n return ExecutionEnvironment.canUseDOM && attempt <= _retryDelays.length;\n }", "title": "" }, { "docid": "f9feec26039fa094257393caad55e327", "score": "0.5565884", "text": "static checkError(data, response, url) {\n // Invalid response\n if (data.status == undefined) {\n console.log(\"Error (Request): invalid api response status\");\n return [false, 0, \"Invalid api response status\"];\n }\n // API timeout\n else if (data.errno == -4039) {\n console.log(\"Error (Request): connection timeout\");\n console.log(\"On url:\", url);\n return [false, 0, \"Connection timeout\"];\n }\n\n // Default to retry\n let retry = true;\n let waitTime = 500;\n let errorCode = data.status.status_code;\n let errorMessage = data.status.message;\n\n switch (errorCode) {\n case 400: // Bad request\n retry = false;\n break;\n case 403: // Forbidden\n retry = false;\n errorMessage = \"API key invalid\";\n break;\n case 404: // Not found\n retry = false;\n break;\n case 429: // Rate limit exceeded\n let riotSleepTime = response.headers.get('Retry-After');\n if (riotSleepTime) {\n waitTime = parseInt(riotSleepTime * 1000);\n }\n errorMessage = \"API key timeout, retry in \" + parseInt(Math.round(waitTime / 1000)) + \" seconds\";\n break;\n }\n\n // Limit number of retries\n if (retry && this.curTries < this.maxTries) {\n this.curTries++;\n }\n // Show error message if no retry\n else {\n retry = false;\n console.log(\"Error (Request):\", errorCode, errorMessage);\n }\n\n return [retry, waitTime, errorMessage];\n }", "title": "" }, { "docid": "375f18b5afd3dd26572640ef0a4c4be8", "score": "0.55487925", "text": "async function exponentialBackoff(max, delay, toTry, success, fail) {\n try {\n const result = await toTry();\n success(result);\n } catch(error) {\n if (max === 0) {\n return fail();\n }\n time('Retrying in ' + delay + 's... (' + max + ' tries left)');\n setTimeout(function() {\n exponentialBackoff(--max, delay * 2, toTry, success, fail);\n }, delay * 1000);\n }\n}", "title": "" }, { "docid": "ac58f565e908fc03e8606c5c2ae4797b", "score": "0.5522357", "text": "function shouldRetry(response, retryData) {\n const statusCode = response === null || response === void 0 ? void 0 : response.status;\n if (statusCode === 503 && (response === null || response === void 0 ? void 0 : response.headers.get(\"Retry-After\"))) {\n return false;\n }\n if (statusCode === undefined ||\n (statusCode < 500 && statusCode !== 408) ||\n statusCode === 501 ||\n statusCode === 505) {\n return false;\n }\n const currentCount = retryData && retryData.retryCount;\n return currentCount < retryCount;\n }", "title": "" }, { "docid": "e54a2226d9db54da9e87cdd738fcc92f", "score": "0.55135554", "text": "async function retry(func, retryCount = 1,funcName) {\r\n return await func() \r\n .catch(e => {\r\n console.log('error ','retrying',funcName,retryCount)\r\n return retry(func, retryCount + 1,funcName);\r\n })\r\n \r\n }", "title": "" }, { "docid": "df3e687fc4a22a012dfba90bb561e9df", "score": "0.55072993", "text": "retry (req, res, next) {\n let jobId = req.params.jobId;\n let mongoJobId = typeof jobId != 'object' ? ObjectID(jobId) : jobId;\n\n // find job\n c.crn.jobs.findOne({_id: mongoJobId}, {}, (err, job) => {\n if (err){return next(err);}\n if (!job) {\n let error = new Error('Could not find job.');\n error.http_code = 404;\n return next(error);\n }\n if (job.analysis.status && job.analysis.status === 'SUCCEEDED') {\n let error = new Error('A job with the same dataset and parameters has already successfully finished.');\n error.http_code = 409;\n return next(error);\n }\n if (job.analysis.status && job.analysis.status !== 'FAILED' && job.analysis.status !== 'REJECTED') {\n let error = new Error('A job with the same dataset and parameters is currently running.');\n error.http_code = 409;\n return next(error);\n }\n\n c.crn.jobs.updateOne({_id: mongoJobId}, {\n $set: {\n 'analysis.status': 'RETRYING',\n 'analysis.jobs': [],\n 'analysis.logstreams': []\n }\n });\n\n res.send({jobId: mongoJobId});\n\n const batchJobParams = aws.batch.buildBatchParams(job);\n\n aws.batch.startBatchJobs(batchJobParams, mongoJobId, (err) => {\n if (err) {\n // This is an unexpected error, probably from batch.\n console.log(err);\n // Cleanup the failed to submit job\n // TODO - Maybe we save the error message into another field for display?\n c.crn.jobs.updateOne({_id: mongoJobId}, {$set: {'analysis.status': 'REJECTED'}});\n return;\n } else {\n emitter.emit(events.JOB_STARTED, {job: batchJobParams, createdDate: job.analysis.created, retry: true});\n }\n });\n });\n }", "title": "" }, { "docid": "cd0cb36641fc48d3b5bedfcd7dc7d8e4", "score": "0.5481085", "text": "async fail (sleepSeconds, additionalMsg) { // note: parent classe's fail is not async\n // Continue trying for polling client, don't cause crashes\n if (this.reqArgs.proxyClient && this.reqArgs.proxyClient.isPollingClient) {\n if (this.numTriesSoFar > 3) {\n this.reqArgs.proxyClient.circuit.degradeHealth();\n this.numTriesSoFar = 4;\n\n await new Promise((resolve, reject) => setTimeout(resolve, 1000)); // enforce 1 second wait to slow down\n }\n }\n\n // Check for the errors that occur randomly but aren't a big issue\n const randomErrors = [\n 'Error: socket hang up',\n 'Error: SOCKS connection failed. Host unreachable.',\n 'Error: SOCKS connection failed. Connection not allowed by ruleset',\n 'SSL routines:SSL23_GET_SERVER_HELLO',\n 'SSL routines:SSL3_GET_RECORD:wrong version number:',\n 'Error: SOCKS connection failed. General SOCKS server failure.',\n // 'Error: read ECONNRESET', (also happens but only deserves 10 second wait)\n ];\n\n const shadyErrors = [\n 'Error: unable to verify the first certificate',\n 'Error: self signed certificate',\n 'Error: self signed certificate in certificate chain',\n \"Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames\",\n 'SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac',\n 'Error: unable to get local issuer certificate',\n ];\n\n let valueToSearchErroMessage = this.data; // was additionalMsg, COULD be unreliable...?\n let randomErrorsFound = randomErrors.filter(e => valueToSearchErroMessage.indexOf(e) != -1);\n let shadyErrorsFound = shadyErrors.filter(e => valueToSearchErroMessage.indexOf(e) != -1);\n\n // Check for some known annoying errors and possibly change circuit if under tor\n if (randomErrorsFound.length) {\n sleepSeconds = 60; // wait a full minute\n\n // Switch circuit if SOCKS CONNECTION FAILED is suffering hard\n if (this.numTriesSoFar > 5) {\n sleepSeconds = 180; // 3 minutes\n\n // Irritating today. Change circuit to stop this junk\n //if (randomErrorsFound[0].indexOf('Error: SOCKS connection failed. Host unreachable.') != -1) {\n // change circuit if possible\n if (this.reqArgs.proxyClient) {\n this.reqArgs.proxyClient.forceIPChangeImmediately().then();\n }\n //}\n } else {\n // If less than 5 tries... ensure only 0.1 try added for this connection and HURRY UP to try again\n if (randomErrorsFound[0] == 'Error: SOCKS connection failed. Host unreachable.') {\n sleepSeconds = 0.5;\n this.numTriesSoFar -= 0.9;\n\n // change circuit as well\n if (this.reqArgs.proxyClient) {\n this.reqArgs.proxyClient.forceIPChangeImmediately().then();\n }\n }\n }\n } else if (shadyErrorsFound.length) {\n INFO(`[D] ${this.constructor.name}.fail - Shady error encountered: ${shadyErrorsFound[0]}`);\n if (this.reqArgs.proxyClient) {\n this.reqArgs.proxyClient.forceIPChangeImmediately().then(); // try to switch circuits if available\n }\n }\n\n // Check for Tor's weird issue where it stops working after like 5000 requests or a few days... weird\n let isTorCircuit = this.reqArgs.proxyClient && this.reqArgs.proxyClient.circuit.isLocalTor;\n if (valueToSearchErroMessage.indexOf('Error: SOCKS connection failed. TTL expired.') != -1 && this.numTriesSoFar > 3 && isTorCircuit) {\n //if (this.numTriesSoFar > 7) {\n // This is a menace, we've already tried changing exit nodes. We have to restart tor.\n return this.reqArgs.proxyClient.manager.forceRestartTorImmediately().then(() => {\n return super.fail(sleepSeconds, `[!] TTL Expired error getting out of hand. Restarting tor`);\n });\n //}\n\n //return this.reqArgs.proxyClient.manager.forceRestartTorImmediately().then(() => {\n //return super.fail(sleepSeconds, `[!] Got TTL Expired error from IP:${exitIP} SO WE CHANGED IP.`);\n //});\n } else {\n return super.fail(sleepSeconds, additionalMsg);\n }\n }", "title": "" }, { "docid": "3124835cb0a4618df12c659eb7d2422e", "score": "0.54694647", "text": "resetBackoff() {\n this.backoffTimeout.reset();\n this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.CONNECTING);\n }", "title": "" }, { "docid": "62a6bbdadce81a095e44019954b5e26a", "score": "0.5467305", "text": "request(\n { type, headers = {}, body = {} } = {},\n reqOptions = {},\n retries = 1,\n ) {\n this._pubsub.fanout({\n name: 'client:pre-request',\n data: { type, headers, body },\n });\n\n return this.transport\n .request(\n this.token,\n { type, headers, body },\n Object.assign({ debug: this._debug_requests }, reqOptions, {\n emit: this._pubsub.fanout,\n }),\n )\n .catch((err) => {\n this._pubsub.fanout({ name: 'client:error', data: err });\n\n //these are the special cases.\n //regular errors end up with code === undefined, so not retryable.\n switch (true) {\n case err === connectionClosedBeforeSend:\n //this means unconditionally retry\n return this.request(\n { type, headers, body },\n reqOptions,\n retries,\n );\n case isUnauthorized(err): //unauthorized (which means unauthenticated) invalidate TOKEN.\n this.token.invalidate();\n this._pubsub.fanout({\n name: 'client:unauthorized',\n data: null,\n });\n err.isRetryable = true;\n break;\n case isTransactionFail(err): //error persisting transaction. retryable.\n err.isRetryable = true;\n break;\n //there are other known errors, e.g. 403, 400, etc... but they are not retryable.\n default:\n if ('isRetryable' in err === false) {\n err.isRetryable = false;\n }\n\n break;\n }\n\n //a chance to retry\n if (err.isRetryable && retries > 0) {\n this._pubsub.fanout({\n name: 'client:retry',\n data: { type, headers, body },\n });\n\n return this.request(\n { type, headers, body },\n reqOptions,\n retries - 1,\n );\n }\n\n throw err;\n });\n }", "title": "" }, { "docid": "7c2389370cf0459517b2fcd7a813a296", "score": "0.54515964", "text": "resetBackoff() {\n this.backoffTimeout.reset();\n this.transitionToState([channel_1.ConnectivityState.TRANSIENT_FAILURE], channel_1.ConnectivityState.CONNECTING);\n }", "title": "" }, { "docid": "5d5a25764f9c92ed3e9bbd0b97729c0d", "score": "0.5451465", "text": "function check(i){\n if(new Date().getTime()-last429<=1000 || new Date().getTime()-lastReq<=1000){\n setTimeout(check,1000+Math.random()*10000,i);\n return;\n }\n\n lastReq = new Date().getTime();\n https.get('https://euw.api.pvp.net/observer-mode/rest/consumer/getSpectatorGameInfo/EUW1/'+playerList.entries[i].playerOrTeamId+'?api_key='+api_key, function(res) { \n //console.log(res.statusCode);\n var body=\"\";\n res.on('data', function (chunk) {\n body+=chunk;\n });\n res.on('end', function (){ \n if(res.statusCode==200){\n var obj = JSON.parse(body);\n obj.gameStartTime = new Date(obj.gameStartTime);\n\n MongoClient.connect('mongodb://localhost:27017/ss', function(err, db) {\n var collection = db.collection(\"games\");\n collection.updateOne({'gameId':obj.gameId},obj, {upsert:true},function(err, result) {\n assert.equal(null, err);\n db.close();\n });\n });\n }\n }); \n switch(res.statusCode){\n case 404:\n responses++;\n //console.log(\"404 Not Found\"); \n console.log(responses+ \".\\tNo\\t\" + playerList.entries[i].playerOrTeamName);\n break\n case 429:\n rateErrorCount++;\n last429 = new Date().getTime();\n setTimeout(check,1000+Math.random()*10000,i);\n break;\n case 403: \n //setTimeout(check,Math.random()*20000,i);\n break;\n case 200:\n responses++;\n //console.log(\"200 Success\"); \n console.log(responses + \".\\tYes\\t\" + playerList.entries[i].playerOrTeamName);\n //console.log(playerList.entries[i].playerOrTeamName + \"\\t \" + playerList.entries[i].leaguePoints);\n break;\n default:\n console.log(res.statusCode);\n }\n\n\n }).on('error', function(e) {\n console.error(e);\n });\n}", "title": "" }, { "docid": "1a0198cd979f9120ed606cc420bac1ac", "score": "0.5441643", "text": "async maybeBackoff(error) {\n if ((error === null || error === void 0 ? void 0 : error.code) === 8 /* RESOURCE_EXHAUSTED */) {\n this._backoff.resetToMax();\n }\n await this._backoff.backoffAndWait();\n }", "title": "" }, { "docid": "831b244ddc72e7b150fec0562592f7e4", "score": "0.5435518", "text": "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n super.emit(\"reconnect\", attempt);\n }", "title": "" }, { "docid": "831b244ddc72e7b150fec0562592f7e4", "score": "0.5435518", "text": "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n super.emit(\"reconnect\", attempt);\n }", "title": "" }, { "docid": "5becb00d0286c6d1ec7e6b0cb850b782", "score": "0.5434746", "text": "function updateRetryData(retryData, err) {\n if (err) {\n if (retryData.error) {\n err.innerError = retryData.error;\n }\n retryData.error = err;\n }\n // Adjust retry count\n retryData.retryCount++;\n // Exponentially increase the delay each time\n const exponentialDelay = retryInterval * Math.pow(2, retryData.retryCount);\n // Don't let the delay exceed the maximum\n const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay);\n // Allow the final value to have some \"jitter\" (within 50% of the delay size) so\n // that retries across multiple clients don't occur simultaneously.\n const delayWithJitter = clampedExponentialDelay / 2 + getRandomIntegerInclusive(0, clampedExponentialDelay / 2);\n retryData.retryInterval = delayWithJitter;\n return retryData;\n }", "title": "" }, { "docid": "ee7959c8bd7bfdb12507e4f916d921f8", "score": "0.5428209", "text": "get maxRetries() {\n return parseInt(this.options.maxRetries, 10)\n }", "title": "" }, { "docid": "3f4d2c4cdf2678da586060ebdd29b83d", "score": "0.54166245", "text": "startFailedRequestSleep() {\n return utils_1.Utils.sleepSecs(this.failedRequestSleepTime);\n }", "title": "" }, { "docid": "f321bf22a1e4a70763a3bda906bbd8ca", "score": "0.53999823", "text": "onreconnect() {\n\t const attempt = this.backoff.attempts;\n\t this._reconnecting = false;\n\t this.backoff.reset();\n\t super.emit(\"reconnect\", attempt);\n\t }", "title": "" }, { "docid": "fdb47282c090581a85a18b5830b877da", "score": "0.53886825", "text": "function retryToClick(selectorOrElement, provider, maxNumMilliseconds) {\n\t\tif (typeof maxNumMilliseconds === 'undefined') {\n\t\t\tmaxNumMilliseconds = 5000;\n\t\t}\n\t\tconst startTimestamp = +new Date();\n\t\tconst numMillisecondsBetweenTries = 100;\n\n\t\tconst retrier = _ => {\n\t\t\tconst currTimestamp = +new Date();\n\n\t\t\tif (tryToClick(selectorOrElement, provider)) {\n\t\t\t\tconst numMillisecondsElapsed = currTimestamp - startTimestamp;\n\t\t\t\tif (numMillisecondsElapsed >= numMillisecondsBetweenTries) {\n\t\t\t\t\tconsole.log(`nocookie: ↑ found that button to click after ${numMillisecondsElapsed} milliseconds. ↑`);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (currTimestamp + numMillisecondsBetweenTries <= startTimestamp + maxNumMilliseconds) {\n\t\t\t\tsetTimeout(retrier, numMillisecondsBetweenTries);\n\t\t\t}\n\t\t};\n\n\t\tretrier();\n\t}", "title": "" }, { "docid": "7b065aaaf8b155891d4150043210e2ee", "score": "0.5362804", "text": "function retry(promise, maxRetries, initialDelay = 500) {\n return __awaiter(this, void 0, void 0, function* () {\n let delay = initialDelay, n = 1, maybeError;\n // Take care of negative or zero\n maxRetries = Math.max(maxRetries, 1);\n while (n <= maxRetries) {\n try {\n // Note: return await intentional so we can catch errors\n return yield promise(n);\n }\n catch (err) {\n maybeError = err;\n yield new Promise((resolve) => setTimeout(resolve, delay));\n delay *= n;\n n++;\n }\n }\n if (maybeError) {\n throw maybeError;\n }\n });\n}", "title": "" }, { "docid": "113fa0b6ab1395c0c487a2fd61c9a576", "score": "0.53601104", "text": "function attemptRetry(milliseconds, retryQueue){\n if(milliseconds > 14400000){ // do not take longer than 4 hours\n milliseconds = 14400000;\n }\n log.error(\"Received app with incorrectly formatted info, will attempt to requery SHAID in \" + (milliseconds / 60000) + \" minutes\");\n setTimeout(function(){\n flame.async.map(retryQueue, function(appID, callback){\n flame.async.waterfall([\n app.locals.shaid.getApplications.bind(null, {\n \"uuid\": appID,\n\t\t\t\t\t\"include_deleted\": true,\n\t\t\t\t\t\"include_blacklisted\": true\n }),\n function(apps, callback){\n const fullFlow = flow([\n //first check if the apps need to be stored in the database\n flow(flame.map(apps, checkNeedsInsertionOrDeletion), {method: \"parallel\"}),\n filterApps.bind(null, false),\n //each app surviving the filter should be checked with the app_auto_approval table to see if it its status\n //should change to be accepted\n function (appObjs, callback) {\n flame.async.map(appObjs, autoApprovalModifier, callback);\n },\n\t\t\t\t\t\tfunction (appObjs, callback) {\n\t\t\t\t\t\t\tflame.async.map(appObjs, autoBlacklistModifier, callback);\n\t\t\t\t\t\t},\n function (appObjs, callback) {\n flame.async.map(appObjs, model.storeApp.bind(null, true), callback);\n }\n ], {method: \"waterfall\", eventLoop: true});\n fullFlow(function (err, res) {\n if (err) {\n log.error(err);\n // increase wait time for retry by a factor of 5\n attemptRetry(milliseconds * 5, res, callback);\n } else {\n log.info(\"App with previously malformed data successfully stored\");\n callback();\n }\n })\n }\n ], callback);\n }, function(){\n log.info(\"Apps in retry queue successfully added to the database\");\n });\n }, milliseconds);\n}", "title": "" }, { "docid": "dd8595ecd9754e0fefcfa9ccffef970b", "score": "0.53542453", "text": "function handleError(error) {\n const { response } = error;\n // If we have a response from the server, then we know we have a network connection,\n // and it's probably not our fault. FL returns 404s and 503s every now and then;\n // we'll just reschedule a retry in a minute.\n if (response) {\n if (HTTP.NOT_FOUND === response.status || response.status >= 500) {\n // Only reschedule once (otherwise, stick to the normal interval).\n if (!retry) {\n setTimeout(() => fetchMessages(true), 60 * 1000);\n }\n }\n }\n }", "title": "" } ]
da11d5e2189ff06d50f7b276facffbd3
check if any empty in board
[ { "docid": "cbebe924f576f7a9964c8edd0aa1dc71", "score": "0.8094379", "text": "function anyEmpty() {\r\n for (let i = 0; i < 3; i++) {\r\n for (let j = 0; j < 3; j++) {\r\n if (board[i][j] === '') {\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n}", "title": "" } ]
[ { "docid": "f183bd9b354c9f942838eccaede56e43", "score": "0.84199834", "text": "isBoardFull() {\n for (let row = 0; row < this.board.length; row++) {\n for (let column = 0; column < this.board[row].length; column++) {\n if (this.board[row][column] === \"\") {\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "1c3da692b94bbca47be30e1fddb877af", "score": "0.8265233", "text": "hasEmptySpace() { \n return !!this.board.filter(row => row.filter(cell => cell === EMPTY_CELL).length).length\n }", "title": "" }, { "docid": "e0554df02d085c3c336984e9b4f7158e", "score": "0.8238732", "text": "isBoardFull() {\n\n\t\tfor (var i = 0; i < this.board.length; i++) {\n\t\t\tfor (var j = 0; j < this.board.length; j++) {\n\t\t\t\tif(this.board[i][j] == Othello.EMPTY) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "title": "" }, { "docid": "a7bee6dad63c184cb95570a868b6b6fa", "score": "0.81508136", "text": "function isfull() {\n for (let i = 0; i < 3; ++i) {\n for (let j = 0; j < 3; ++j) {\n let spot = board[i][j];\n if (spot == '') {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "cc5597f40b3f911f6caae23b9ee0301d", "score": "0.8072694", "text": "function boardIsFull(board) {\n for (var x=0; x<3; x++) {\n for (var y=0; y<3; y++) {\n if (board[x][y] == '0') {\n return false;\n }\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "35be14bfcbf6219b50f1d566d6919862", "score": "0.7981661", "text": "function checkFull(board) {\n let cols = board[0].length;\n let rows = board.length;\n for (let i = 0; i < rows; i++)\n {\n for (let j = 0; j < cols; j++)\n {\n if (board[i][j] == null)\n {\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "0e6fbbf6c6bd8bf363536beb59990556", "score": "0.7892091", "text": "function isThereAnyMove(board) {\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < 3; j++) {\n if (board[i][j] === '') {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "a50cb0a6de18ed773ea6e66b7d477f23", "score": "0.7817571", "text": "isboardfull(){\n\t\treturn (!this.boardfield[0].includes(0)) &&\n\t\t\t(!this.boardfield[1].includes(0)) &&\n\t\t\t(!this.boardfield[2].includes(0));\n\t}", "title": "" }, { "docid": "2de5d40bc7bd286b9b1a20ea1c8f6706", "score": "0.7799649", "text": "isBoardFull() {\n // Iterate through the rows of the board.\n for (let i = 0; i < this.size; i++) {\n // Iterate through the columns of the board.\n for (let j = 0; j < this.size; j++) {\n // If the board has empty spaces, return false.\n if (this.board[i][j] === '-') {\n return false;\n }\n }\n }\n // If the board is full, return true.\n return true;\n }", "title": "" }, { "docid": "3b0773f6943bf3ead7cb24bf5fb1282b", "score": "0.7786231", "text": "function isBoardFull() {\n\treturn (gFullCellCount === (gBoard.length - 2) * (gBoard[0].length - 2) - 1);\n}", "title": "" }, { "docid": "0b39f16acda5f4f3ade46b3466f75f23", "score": "0.7752128", "text": "isBoardFilled(){\n for(var i=0;i<this._gameBoard.length;i++){\n for(var j=0;j<this._gameBoard.length;j++){\n if(this._gameBoard[i][j]=='-'){\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "9aaf66c53f8480ed509ed7008819326e", "score": "0.7652679", "text": "function checkBoardIsFull(arr) {\n //Takes and array and checks if every item in every row(arrays in the array), is not null\n //returns boolean\n for (let row of arr) {\n if (!row.every((item) => item !== null)) return false;\n }\n return true;\n}", "title": "" }, { "docid": "b313a46b24a7508a57aa4ab13a2713ec", "score": "0.763131", "text": "function isEmpty(){\n for(var i=0; i<3; i++) {\n for(var j=0; j<3; j++) {\n if(board[i][j] == ' ') return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "080cac49629cb34de6e5834468fea1a1", "score": "0.761236", "text": "isEmpty() {\r\n for (var i = 0; i < 3; i++)\r\n for (var j = 0; j < 3; j++)\r\n if (this.grid[i][j])\r\n return false;\r\n return true;\r\n }", "title": "" }, { "docid": "0316a4e7886b37673702d69191de6494", "score": "0.7592012", "text": "function isFilled(board) {\r\n\tfor(var i = 0; i < 15; i++) {\r\n\t\tfor(var j = 0; j < 15; j++) {\r\n\t\t\tif(board[i][j] == -1) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "50620f8e18bb62f243206d9ec27c203d", "score": "0.75838965", "text": "isEmpty() {\r\n return this.state.every((cell) => !cell);\r\n }", "title": "" }, { "docid": "26dd0c4afa82b7b8ceaa7975ebc78e3e", "score": "0.7536191", "text": "function isBoardFull(board) {\n const numSpaces = board.split(\" \").length - 1;\n\n return numSpaces < 1;\n}", "title": "" }, { "docid": "4c48dc9ec53eb9eb34e2c28378022e41", "score": "0.75346434", "text": "function checkComplete(boardState, verbose = false) {\n if (verbose) console.log(boardState);\n let emptyCount = 0;\n for (let i = 0; i < boardState.length; i++) {\n for (let j = 0; j < boardState[0].length; j++) {\n if (verbose) console.log(boardState[i][j]);\n if (boardState[i][j] == 0) {\n emptyCount++;\n }\n }\n }\n return emptyCount === 0 ? true : false;\n}", "title": "" }, { "docid": "91eb2b1b78e76ececed4cbd7b5f35eb3", "score": "0.74719155", "text": "isFull() {\r\n for (var i = 0; i < 3; i++)\r\n for (var j = 0; j < 3; j++)\r\n if (!(this.grid[i][j]))\r\n return false;\r\n return true;\r\n }", "title": "" }, { "docid": "9f27bcf7bda97ff16a5e3cb0762b6737", "score": "0.7467185", "text": "hasNoMoves() {\n const pieces = this.board.pieces(this.turn);\n for (let piece of pieces) {\n if (this.trimMoves(piece).length > 0) return false;\n }\n return true;\n }", "title": "" }, { "docid": "0fe7461d813dcadaa3c0906f34f7ff0f", "score": "0.7447859", "text": "function isGameOver(board) {\n return !board.includes(emptyPosition);\n}", "title": "" }, { "docid": "05cac5dfd8b420f76b86675047fda258", "score": "0.7403005", "text": "function checkIfBoardFull(){\n\tisFull = 0;\n\tboardBlocks.forEach(block => {\n\t\tif(block.innerText != ''){\n\t\t\tisFull++;\n\t\t}\n\t\tif(isFull === 9){\n\t\t\t//tie\n\t\t\thighlightBlocksTie();\n\t\t\tsetTimeout(resetBoard, 1500);\n\t\t\tclearInterval(resetBoard);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "1fae6328f08fb62962cdf5afa34c0b1f", "score": "0.7396758", "text": "isEmpty(){\n return this.state.every(cell => !cell);\n }", "title": "" }, { "docid": "52c60c1e1b16b15d7cf800bda3852315", "score": "0.7384606", "text": "isEmpty(row, column) {\n let val = this.gameArray[row][column];\n return val !== undefined && val.isEmpty;\n }", "title": "" }, { "docid": "1478644ddafc0b7ef2c0964df5a88c0f", "score": "0.73622215", "text": "isEmptyCellLeft(state) {\n return state.some(row => row.some(c => c === Piece.EMPTY));\n }", "title": "" }, { "docid": "693a311c5b33bd2ec2dd7a22d78244f0", "score": "0.7345568", "text": "isFull() {\n let full = true;\n for (let c = 0; c < this.cols; c++) {\n if (this.board[this.rows - 1][c] == this.emptyDisc) {\n full = false;\n }\n }\n return full;\n }", "title": "" }, { "docid": "eb8ae71bddca2c03166b88d4c8ff33c9", "score": "0.7328547", "text": "function isFull(){\n let counter = 0;\n for(let i = 0; i < 4; i++){\n for(let j = 0; j < 4; j++){\n if(ar[i][j] === 0){\n counter++;\n }\n }\n }\n if(counter != 0){\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "e4fece7cd9f505f5c974163e169766ee", "score": "0.7314536", "text": "isSpaceEmpty(row, col) {\n if (this.boardState[row][col] === BoardSpaceStatus.empty) return true;\n\n return false;\n }", "title": "" }, { "docid": "9c8a495e43500258d6a58a545a4c4692", "score": "0.7313826", "text": "function isBoardFull() {\n // if any of the gameBoard keys returns ' ' then there is still\n // a space open and the game continues\n for (var i = 0; i < keysArray.length; i++) {\n if (gameBoard[keysArray[i]] === ' ') {\n return false;\n }\n }\n\n // if none of them returned false, then the board must be full, return true\n return true;\n}", "title": "" }, { "docid": "364e9e600404651dbb89190c4981c21c", "score": "0.7296566", "text": "function emptyCells(grid) {\n return grid.filter(item => item === 'E').size === 0;\n}", "title": "" }, { "docid": "9eed3ae8d417adb5dd3c805ca61e720b", "score": "0.7246208", "text": "function isFull(row) {\n if (row < 0 || row > 6) {\n return true;\n }\n else {\n for (i = 0; i < 6; i++) {\n if (board[i] == 0) {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "0c42f9f8152a0007e40dbbebe2d64036", "score": "0.720278", "text": "function isEmpty(position) {\r\n return board[position[0]][position[1]] === \"\";\r\n}", "title": "" }, { "docid": "403e664c9019facdfac85da1c8c224b6", "score": "0.71974885", "text": "isEmpty(row, column){\n return this.gameArray[row][column].isEmpty;\n }", "title": "" }, { "docid": "ea996aabc467f38ca3cd380a8a976570", "score": "0.7156193", "text": "countEmpty() {\n let board = this.game.board;\n \tlet count = 0;\n \tfor (let i = 0; i < board.length; i++) {\n \t\tfor (let j = 0; j < board[i].length; j++) {\n \t\t\tif (board[i][j] == 0) {\n \t\t\t\tcount++;\n }\n }\n }\n \treturn count;\n }", "title": "" }, { "docid": "958d6365d98510ea7ce7055ff065505c", "score": "0.71523696", "text": "function checkForDraw(boardArr) {\n return boardArr.every((c) => {\n if (c != undefined) {\n return true;\n }\n return false;\n });\n}", "title": "" }, { "docid": "9235b83dcb2e8ba0f21dec98813858b1", "score": "0.71338654", "text": "isFull() {\r\n return this.state.every((cell) => cell);\r\n }", "title": "" }, { "docid": "1b953a68cd1be69036d9e1b2718dbb08", "score": "0.7129417", "text": "function isFull(tiles) {\n // Iterate through tiles and return flase if there is an unplayed cell\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 3; j++) {\n if (tiles[i][j] === ' ') {\n return false;\n }\n }\n }\n // If we exit the loop without returning false, then we return true\n return true;\n}", "title": "" }, { "docid": "6dd3812a68f8f45e6a3acdedd08a5ec4", "score": "0.7118437", "text": "function checkTie(){\n var boardFull = true;\n for (var i = 0; i < board.length; i++){\n if (board[i] === null){\n boardFull = false;\n }\n }if (boardFull){\n cpuScore += 1;\n resetBoard();\n }\n}", "title": "" }, { "docid": "40f0d8c34aa18e387dba15a2f6ef7fd3", "score": "0.7090866", "text": "function isTie(board) {\nvar i, j;\nfor (i = 0; i < 15; i++) {\nfor (j = 0; j < 15; j++) {\nif (board[i][j] === '') {\n// If there is an empty cell then we do not have a tie.\nreturn false;\n}\n}\n}\n// No empty cells --> tie!\nreturn true;\n}", "title": "" }, { "docid": "351dbb507b06641ccdd4962a062aacd9", "score": "0.70467484", "text": "isEmpty(row, col) {\n return this.statusGrid[row][col] === 0;\n }", "title": "" }, { "docid": "773ec017ac930d138a740605dcf5b2ea", "score": "0.7046434", "text": "function isTie(){\n\t\treturn board.slice(1).every(function(elem){\n\t\t\treturn elem !== ''; \n\t\t});\n\t}", "title": "" }, { "docid": "84231b37ea12a9d532cd57f09ef3f2cd", "score": "0.7032556", "text": "isPathEmpty(squares, piece, [destRow, destCol]) {\n let path = piece.getPathToDest([destRow, destCol]);\n for (let space of path) {\n if (squares[space[0]][space[1]]) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "489f884a9a7c950aa50cc3bcb2f3a3ba", "score": "0.7014645", "text": "function full_board_check(board){\n var i;\n for(i =1;i<10;i++){\n if (space_check(board,i)){\n return false;\n } else {\n return true;\n }\n\n }\n}", "title": "" }, { "docid": "64f6ecf237196d1f73578063494f4813", "score": "0.7013655", "text": "checkBoard(board) {\n for (var i = 0; i < 9; i++) {\n if (!this.checkRow(i, board) || !this.checkColumn(i, board) || !this.checkSubgrid(i, board)) return false;\n }\n return true;\n }", "title": "" }, { "docid": "479c3e86c8694cb9f781cd3521d9f1de", "score": "0.70123976", "text": "function checkBoard(sudokuBoard) {\n\tlet possibleMoves = []\n\n\tfor (let i = 0; i <= 80; i++) {\n\t\tif (sudokuBoard[i] === 0) {\n\t\t\tpossibleMoves[i] = []\n\t\t\tpossibleMoves[i] = checkSquare(i, sudokuBoard)\n\t\t\tif (possibleMoves[i].length === 0) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn possibleMoves\n}", "title": "" }, { "docid": "9ae32e8b19f0cce3cf74b149f5883f6d", "score": "0.7001749", "text": "function checkTie() {\n let count = 0;\n for (let i = 0; i < board.length; i += 1) {\n for (let j = 0; j < board.length; j += 1) {\n if (board[i][j] === null) {\n count += 1;\n }\n }\n }\n // game is tied if no null-spaces are left and nobody has won yet\n return count === 0;\n}", "title": "" }, { "docid": "441c42c6174b4739c629d6189f256761", "score": "0.6997498", "text": "function check(){\r\n $('#board > div').each(function(i){\r\n //this is a tile\r\n if($(this).hasClass('white')){\r\n //not done; there's a white tile\r\n return false;\r\n }\r\n \r\n if(i == Constants.NUM_TILES - 1){\r\n //last tile; if we're still here that means there's no white left\r\n userWon();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "61096dee69ebbe2f3ed1f1ccac005ffe", "score": "0.6997077", "text": "function checkForTie() {\n for (let y=0; y<HEIGHT; y++) {\n if (board[y].includes(null)) {\n return false;\n }\n else return true;\n \n }\n}", "title": "" }, { "docid": "524df7b3fa086c60a4a324a3c2aad55b", "score": "0.69966286", "text": "empty(pos) {\n return this.grid[pos[0]][pos[1]] === null;\n }", "title": "" }, { "docid": "d650eee1172ddd301e7e8a2495187d0c", "score": "0.6964058", "text": "function solutionFound(arr) {\n\tfor (var i = 0; i < SIZE_OF_BOARD; i++) {\n\t\tfor (var j = 0; j < SIZE_OF_BOARD; j++) {\n\t\t\tif (!arr[i][j])\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "57f28d63d4dc41572adb5061701cfd0c", "score": "0.69566876", "text": "function checkFull(){\n let avail = 0;\n for(let i = 0; i < N; i++){\n for(let j = 0; j < N; j++){\n if(!grid[i][j])\n avail++;\n }\n }\n\n if(avail < 1){\n endGame();\n return 0;\n }\n else if(avail > 2)\n return 2;\n else \n return 1;\n}", "title": "" }, { "docid": "f7dfd4216622ba2f0bc59e7e81ae43fb", "score": "0.69487095", "text": "function isGridFull(){\r\n\tfor(x of prow.keys()){\r\n\t\tvar tempArr=grid[x].filter(value=>value===0);\r\n\t\t\r\n\t\tif(tempArr.length>0){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "021a479257e0759f2f7c073ac5e61c5a", "score": "0.6925573", "text": "function emptyNeighbor(square) {\n\t\tvar row = parseInt(square.id.split(\"_\")[0]);\n\t\tvar col = parseInt(square.id.split(\"_\")[1]);\t\n\t\tvar emptyRow = parseInt(empty.split(\"_\")[0]);\n\t\tvar emptyCol = parseInt(empty.split(\"_\")[1]);\n\n\t\tif((row-1 == emptyRow || row+1 == emptyRow) && col == emptyCol) {\n\t\t\treturn true;\n\t\t} else if ((col-1 == emptyCol || col +1 == emptyCol) && row == emptyRow) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "11125e1ca9d2838b8a71671f95e16308", "score": "0.6910574", "text": "isFull(){\n return this.state.every(cell => cell);\n }", "title": "" }, { "docid": "23e9c38a3fa6643f84a281edae7bf2ed", "score": "0.6908083", "text": "function checkIfWin(board) {\r\n if (gFlagged !== gMinesCount) return false;\r\n debugger\r\n for (var i = 0; i < board.length; i++) {\r\n for (var j = 0; j < board[i].length; j++) {\r\n console.log(board[i][j])\r\n if (board[i][j].isMine) continue;\r\n if (board[i][j].isShown === false) return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "f33f4072857445c7f9b975bad006720a", "score": "0.6904635", "text": "isEmpty(row, col) {\n if (row < 0 || row >= this.tetromino[this.current].length)\n return false;\n if (row < 0 || row >= this.tetromino[this.current].length)\n return false;\n\n return !this.tetromino[this.current][row][col];\n }", "title": "" }, { "docid": "2761f302b4717a958617d55f660d2b01", "score": "0.6901753", "text": "function isCellEmpty(buttonID) {\n return (board[buttonID] == \"0\") ? true : false;\n}", "title": "" }, { "docid": "9cfd0c1a362f588b28e584b763c1d429", "score": "0.68952405", "text": "function isOnBoard(row,col){\n if(row >= 0 && row < numOfRow && col >= 0 && col < numOfCol){\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "d0e0818edbe3d2ab1238048a5eb2385c", "score": "0.6888837", "text": "checkAll (board) {\n return this.vertical(board) || this.diagonalRight(board) || this.diagonalLeft(board) || this.horizontal(board) || this.draw(board);\n }", "title": "" }, { "docid": "cfb485dc77ba8d6d32b61a27d8e3e0e7", "score": "0.6880641", "text": "function isFull(grid) {\n return !grid.includes(false)\n}", "title": "" }, { "docid": "e48188498b4273ad5d33114835e9e0c4", "score": "0.6863911", "text": "function isWin(){\n\n let cells = getGameBoard();\n\n // check row have same X or same O\n\n for (let i = 0; i < 3; i++){\n\n if (cells[i*3 + 0].innerHTML == \"O\" && cells[i*3 + 1].innerHTML == \"O\" && cells[i*3 + 2].innerHTML == \"O\"){\n\n return true;\n\n }else if(cells[i*3 + 0].innerHTML == \"X\" && cells[i*3 + 1].innerHTML == \"X\" && cells[i*3 + 2].innerHTML == \"X\"){\n\n return true;\n\n }\n\n }\n\n // check coll have same X or same O\n\n for (let i = 0; i < 3; i++){\n\n if (cells[0*3 + i].innerHTML == \"O\" && cells[1*3 + i].innerHTML == \"O\" && cells[2*3 + i].innerHTML == \"O\"){\n\n return true;\n\n }else if(cells[0*3 + i].innerHTML == \"X\" && cells[1*3 + i].innerHTML == \"X\" && cells[2*3 + i].innerHTML == \"X\"){\n\n return true;\n\n }\n\n }\n\n // chect atleast one cell is empty or not\n\n // if all cell is filled return -1;\n\n for (let cell of cells){\n\n if (cell.innerHTML == \"\"){\n\n return false;\n\n }\n\n }\n\n return -1;\n\n}", "title": "" }, { "docid": "0f3f147a329d9b38161f757fc8486cc1", "score": "0.6862206", "text": "function isFull() {\n let isGridFull = [];\n for (let i = 0; i < cellArray.length; i++) {\n isGridFull.push(cellArray[i].innerText);\n }\n if (isGridFull.includes(\"\")) {\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "965e4edec6335e5c253974c060a26994", "score": "0.68599486", "text": "function validateBoard() {\n // Go through the whole board and determine if any digit placed is \n // impissoble by simplest sudoku rules. i.e. is it in a box/row/col as the same digit.\n var validTileCount = 0;\n for (var i = 0; i < 81; i++) {\n var tile = getTile1D(i);\n if (tile.hasClass(\"digit\") && tile.children(\"div\").html() != \"\") { \n // if the tile is empty, it is not in error, but we don't want to count it towards validTileCount\n // so that an empty board is not considered completed\n if (!validateTile(i)) {\n tile.addClass(\"error\");\n } else {\n tile.removeClass(\"error\");\n validTileCount++;\n }\n } else {\n // Don't increment validTileCount\n tile.removeClass(\"error\");\n }\n }\n return validTileCount;\n}", "title": "" }, { "docid": "1f64123d95cdb5fc932e18af1f9196d0", "score": "0.68447393", "text": "function emptyIndexies(board) {\n return board.filter(s => s != \"O\" && s != \"X\");\n }", "title": "" }, { "docid": "936cb09a8c5da1f3d46fbf6330659ec7", "score": "0.6844439", "text": "checkTie(matBoard) {\n let isTie = true;\n for (let i = 0; i < matBoard.length; i++) {\n for (let j = 0; j < matBoard[i].length; j++) {\n if (matBoard[i][j] == undefined) {\n isTie = false;\n }\n }\n }\n return isTie;\n }", "title": "" }, { "docid": "e5141f7e3c2f12ee3cff635763afbe66", "score": "0.68413275", "text": "function emptyIndexies(board) {\n\treturn board.filter(s => s != \"O\" && s != \"X\");\n}", "title": "" }, { "docid": "3eeabd73b9398efc5551915ddc9132fd", "score": "0.6816983", "text": "function getEmptyIndexies(board){\n\t\treturn board.filter(s => s!==\"X\" && s!==\"O\");\n\t }", "title": "" }, { "docid": "90f259718a035686adf45050e9b21423", "score": "0.6802324", "text": "checkMoves() {\n /**** Check if any empty tiles remain ****/\n if (this.gameState.board.includes(0)) {\n return true;\n }\n\n /**** Check if any possible combinations remain ****/\n // Check \"vertical\" move\n for (let col = 0; col < this.size; col++) {\n let tiles = []\n for (let row = 0; row < this.size - 1; row++) {\n if (this.gameState.board[row * this.size + col] == this.gameState.board[(row + 1) * this.size + col]) {\n return true;\n }\n }\n }\n\n // Check \"horizontal\" move\n for (let row = 0; row < this.size; row++) {\n let tiles = []\n for (let col = 0; col < this.size - 1; col++) {\n if (this.gameState.board[row * this.size + col] == this.gameState.board[row * this.size + (col + 1)]) {\n return true;\n }\n }\n }\n\n /**** No Legal Moves Available */\n return false;\n\n }", "title": "" }, { "docid": "4e9a0bc6d5b1832e92c7495cfb69cb27", "score": "0.6792155", "text": "checkFinalBoard() {\n\n for (let i = 0; i < this.winPosition.length; i++) {\n\n if (\n (this.values[this.winPosition[i][0]] == this.turn) &&\n (this.values[this.winPosition[i][1]] == this.turn) &&\n (this.values[this.winPosition[i][2]] == this.turn)\n )\n return true;\n\n }\n\n return false;\n }", "title": "" }, { "docid": "748640c478067174bf464a2446f11a52", "score": "0.6765223", "text": "function checkWon(){\n // All holes above in rows 0-3 are player1\n // All other holes are either player2 or empty\n // for all validHoles\n var count = 0;\n for (var j = 0; j < TOTALROWS; j++) {\n for (var i = 0; i < TOTALCOLS; i++) {\n if(boardHoles[j][i]) {\n if(j < 4) { // check only top portion\n if(board[j][i].status.id == HoleStatusEnum.PLAYER1.id) {\n count++;\n }\n }\n }\n }\n }\n if(count === 10) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "8df1166e6df80973b86c9d3a193a4e8b", "score": "0.6753958", "text": "function full(state) {\n\treturn !get_available_moves(state).length;\n}", "title": "" }, { "docid": "a950d2e832666680b3d79c868c08f999", "score": "0.67538995", "text": "function areAllCellsShown() {\r\n var count = 0;\r\n for (var i = 0; i < gBoard.length; i++) {\r\n for (var j = 0; j < gBoard[0].length; j++) {\r\n var currCell = gBoard[i][j];\r\n if (currCell.isShown) count++;\r\n }\r\n }\r\n if (count === gLevel.size ** 2) return true;\r\n}", "title": "" }, { "docid": "2edcec7b14d656e4a38c93257c72031c", "score": "0.67358834", "text": "function check(board) {\n\tfor (let i = 0; i < win.length; i++) {\n\t\tif (\n\t\t\tboard[win[i][0]].innerHTML === board[win[i][1]].innerHTML &&\n\t\t\tboard[win[i][0]].innerHTML === board[win[i][2]].innerHTML &&\n\t\t\tboard[win[i][2]].innerHTML != ''\n\t\t) {\n\t\t\tif (board[win[i][0]].innerHTML === player_move) {\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t}\n\t}\n\tfor (let i = 0; i < board.length; i++) {\n\t\tif (board[i].innerHTML === '') return 0;\n\t}\n\treturn 3;\n}", "title": "" }, { "docid": "ab9ce3a9e7b3169125f5ef9a1cafcb69", "score": "0.6733813", "text": "function isMovesLeft(board) {\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 3; j++) {\n if (board[i][j] === null) return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "07d95856f86b773a6526b25b3ab1b40a", "score": "0.67291296", "text": "emptyInCol(i) {\n let plays = [];\n for (let j=0; j<this.ibd.size; j++) {\n if (this.ibd.cols[i].elems[j].item == '') plays.push(j);\n }\n if (plays.length == 1) return plays[0];\n if (plays.length == 0) {\n console.log(\"emptyInCol(\"+i+\") found no empties!\");\n this.dump(\"ibd\");\n alert(\"Expected an empty square in column \"+i+\". Found none!\");\n return null;\n }\n console.log(\"emptyInCol(\"+i+\") found multiple empties: \"+plays);\n this.dump(\"ibd\");\n alert(\"Expected a single empty square in column \"+i+\". Found several! \"+plays);\n return null;\n }", "title": "" }, { "docid": "66b01f6804ff76924db6d8423bc4f64c", "score": "0.67237985", "text": "gridIsValid() {\n const shipPieces = this.element.querySelectorAll(\".ship-piece\");\n const occupiedGridBoxes = this.element.querySelectorAll(`.box[occupied=\"true\"]`);\n\n return shipPieces.length === occupiedGridBoxes.length;\n }", "title": "" }, { "docid": "b2c9b44640aa2fe8145041fa316b5d59", "score": "0.6719806", "text": "eval_grid(grid) {\n\t\tlet emptycount = 0;\n\t\tfor(let rowi=0; rowi<9; rowi++) {\n\t\t\tfor(let coli=0; coli<9; coli++) {\n\t\t\t\tif(!grid[rowi][coli]) {\n\t\t\t\t\temptycount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn emptycount;\n\t}", "title": "" }, { "docid": "878e67e9a6574fe46c409654ac00e021", "score": "0.67136973", "text": "function checkDraw(squares) {\n return squares.every((value) => (value !== null))\n}", "title": "" }, { "docid": "0465d08b79d97e22b3c0b0fbc39cf1d6", "score": "0.67078584", "text": "function findEmptyLocation() {\n for(let row = 0; row < 9; row++) {\n for(let col = 0; col < 9; col++) {\n if(board[row][col] === 0) {\n return [row, col];\n }\n }\n }\n return -1; // means that the board is complete\n}", "title": "" }, { "docid": "bf13ce4edad679657a318243350342d9", "score": "0.67064357", "text": "function checkFinished(board) {\n var i, j, winner;\n\n\t// TODO rewrite this function to be dynamic so that it works with any board size\n\n function sameNotNullHorizontal(i){\n return board[i][0].v === board[i][1].v &&\n board[i][1].v === board[i][2].v &&\n board[i][0].v;\n }\n for(i = 0; i < board.length; i++){\n if(sameNotNullHorizontal(i)){\n winner = board[i][0].v;\n }\n }\n\n function sameNotNullVertical(j){\n return board[0][j].v === board[1][j].v &&\n board[1][j].v === board[2][j].v &&\n board[0][j].v;\n }\n for(j = 0; j < board.length; j++){\n if(sameNotNullVertical(j)){\n winner = board[0][j].v;\n }\n }\n\n if(board[0][0].v &&\n board[0][0].v === board[1][1].v &&\n board[1][1].v === board[2][2].v\n ){\n winner = board[1][1].v;\n }\n\n if(board[0][2].v &&\n board[0][2].v === board[1][1].v &&\n board[1][1].v === board[2][0].v\n ){\n winner = board[1][1].v;\n }\n\n if(!winner){\n //check for a draw\n var allFull = true;\n for(i = 0; i < board.length; i++){\n for(j = 0; j < board[i].length; j++){\n if(!board[i][j].v){\n allFull = false;\n break;\n }\n }\n }\n if(allFull){\n return DRAW;\n }\n }\n\n return winner;\n}", "title": "" }, { "docid": "f31d84b4ef5e3436df284a1933e1ceef", "score": "0.6698063", "text": "gameOver() {\n var w = this.winner();\n if (w || this.empty().length == 0){\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "f9274f135e8bfa6934976effafdd8e0d", "score": "0.6694858", "text": "function validSolution(board) {\r\n let valSet = new Set()\r\n for (let i = 0; i < 9; i++) {\r\n for (let j = 0; j < 9; j++) {\r\n let curr = board[i][j]\r\n valSet.add(curr + 'r' + i)\r\n valSet.add(curr + 'c' + j)\r\n valSet.add(curr + 'b' + ~~(i / 3) + ':' + ~~(j / 3))\r\n }\r\n }\r\n return board.map(v => v.length).reduce((a, b) => a + b, 0) == valSet.size / 3\r\n}", "title": "" }, { "docid": "eab68decde2d7aabfa866dfe3d4199f7", "score": "0.6687837", "text": "function checkNoMove(){\n let result = false;\n let count = 0;\n for(let i = 0; i < width; i++){\n let arrRow = arrCell.slice(count, width+count);\n let arrCol = [arrCell[i], arrCell[i+width], arrCell[i+width*2], arrCell[i+width*3]];\n \n \n for(let k = 0; k < arrRow.length - 1; k++){\n if(arrRow[k].innerHTML == arrRow[k+1].innerHTML && arrRow[k].innerHTML != ''){\n result = true;\n }\n }\n count += width;\n\n for(let l = 0; l < arrCol.length-1; l++){\n if(arrCol[l].innerHTML == arrCol[l+1].innerHTML){\n result = true;\n } \n } \n }\n return result; \n}", "title": "" }, { "docid": "9062ca7c3f18022dd8052b4d418f7540", "score": "0.66837436", "text": "function checkAllColumns(arr) {\n\tfor (var j = 0; j < SIZE_OF_BOARD; j++) {\n\t\tif (!checkColumn(j, arr))\n\t\t\treturn false;\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "f8db0a073c2c02ca2dc4c481ec41f089", "score": "0.66745925", "text": "isEmpty(row, col) {\n\t\tif (typeof this.positions[row] !== 'undefined' && typeof this.positions[row][col] === 'undefined') {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "b9a657de1bd632d001958f0f9a23fc34", "score": "0.66670513", "text": "function isStateValid(state) {\r\n var board = state.board;\r\n var numOfBs = 0, numOfWs = 0;\r\n var row = board.length;\r\n if (row !== 9)\r\n return false;\r\n for (var i = 0; i < row; i++) {\r\n if (board[i].length !== 17)\r\n return false;\r\n for (var j = abs(i - 4); j < 17 - abs(i - 4);) {\r\n var c = board[i][j];\r\n if (c !== 'O' || c !== 'B' || c !== 'W')\r\n return false;\r\n if (c === 'B')\r\n numOfBs++;\r\n if (c === 'W')\r\n numOfWs++;\r\n board[i][j] = 'O';\r\n j += 2;\r\n }\r\n }\r\n if (numOfBs + state.removedMarbles.black !== 14\r\n || numOfWs + state.removedMarbles.white !== 14)\r\n return false;\r\n var board_const = [\r\n ['', '', '', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', '', '', ''],\r\n ['', '', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', '', ''],\r\n ['', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', ''],\r\n ['', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', ''],\r\n ['O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O'],\r\n ['', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', ''],\r\n ['', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', ''],\r\n ['', '', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', '', ''],\r\n ['', '', '', '', 'O', '', 'O', '', 'O', '', 'O', '', 'O', '', '', '', '']];\r\n if (board !== board_const)\r\n return false;\r\n return true;\r\n }", "title": "" }, { "docid": "698063b5fd05c34f3053520c08366355", "score": "0.665953", "text": "function boardPlays(board) {\n var n = 0;\n for (var i=0; i<board.length; i++) {\n for (var j=0; j<board.length; j++) {\n if (board[i][j]!='') n++;\n }\n }\n return n;\n}", "title": "" }, { "docid": "5859770b8c25dd5b19bc5391172d87ac", "score": "0.66593826", "text": "function checkCorners() {\n for (var i = 0; i <= 8; i += 2) {\n if (board.indexOf(i) !== -1) {\n markData(computer, true, i.toString());\n return true;\n }\n }\n }", "title": "" }, { "docid": "e5d1caa803a9fba04f7fe4fc666eb3c7", "score": "0.66571945", "text": "function checkMoveValid(col_num, board) {\n if (!board[0][col_num]) {\n for (let i = 9; i >= 0; i--) {\n if (!board[i][col_num])\n return 1;\n }\n } \n else\n return 0;\n}", "title": "" }, { "docid": "a16c822bcef1399a249053da3ca019a7", "score": "0.66525054", "text": "function emptySquares() \n {\n return gmBoard.mainBoard.filter((s) => typeof s == \"number\");\n }", "title": "" }, { "docid": "7bb228aa495782e8ccb3ab5f43339169", "score": "0.6647123", "text": "function isBoardUneven(board) {\n const numXs = board.split(\"x\").length - 1;\n const numOs = board.split(\"o\").length - 1;\n\n const diff = Math.abs(numXs - numOs);\n\n if (diff > 1 || diff < 0) {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "630fc1a23164364307d76d1b08b88de3", "score": "0.664367", "text": "function findRandomEmptyCell(board) {\n var i = Math.floor((Math.random() * (board_width)));\n var j = Math.floor((Math.random() * (board_height)));\n while (board[i][j] != 0) {\n i = Math.floor((Math.random() * (board_width)));\n j = Math.floor((Math.random() * (board_height)));\n }\n return [i, j];\n }", "title": "" }, { "docid": "e9668ec7ab3f5a2a1ec17bc6f253c0cf", "score": "0.6640708", "text": "isEmpty() {\n return this.left === this.right || this.top === this.bottom;\n }", "title": "" }, { "docid": "d1d57b9f666ef7d3a78661830e86ac86", "score": "0.6634207", "text": "function checkAllPitsEmpty() {\n\tlet allEmptyOne = true;\n\tfor (let i = 1; i < 7; i++) {\n\t\tif (pitArray[i].numberOfStones > 0) {\n\t\t\tallEmptyOne = false;\n\t\t}\n\t}\n\tlet allEmptyTwo = true;\n\tfor (let i = 8; i < 14; i++) {\n\t\tif (pitArray[i].numberOfStones > 0) {\n\t\t\tallEmptyTwo = false;\n\t\t}\n\t}\n\treturn allEmptyOne || allEmptyTwo;\n}", "title": "" }, { "docid": "bcffb862bdeb50f9959cad9f0e87b632", "score": "0.66248345", "text": "function fullCells(arr)\n\t{\n\t\tvar occupied = [];\n\t\tfor(var i=0; i<arr.length; i++)\n\t\t\t{\n\t\t\t\tif(arr[i] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\toccupied.push(arr[i]);\n\t\t\t\t\t}\n\t\t\t}\n\t\treturn occupied;\n\t}", "title": "" }, { "docid": "a2c73b1494354b84941279cc0301d511", "score": "0.66228116", "text": "function hasWon() {\n // TODO: check the board in state to determine whether the player has won.\n // if the cells all come back as false then that means the player has met the win condition\n return board.every((row) => {\n row.every((cell) => !cell)\n })\n }", "title": "" }, { "docid": "ac3ad83f622ffca9cdfe1d224e1a93e1", "score": "0.6609338", "text": "spotEmpty(){\n for (let y = this.roomY - this.roomYChange; y !== this.roomY + this.roomYChange*this.currentRoomHeight + this.roomYChange; y += this.roomYChange){\n for (let x = this.roomX - this.roomXChange; x !== this.roomX + this.roomXChange*this.currentRoomWidth + this.roomXChange; x += this.roomXChange){\n\n if (x <= 0 || x >= this.mapSize || y <= 0 || y >= this.mapSize) return false;\n\n if (this.map[y][x] === \".\"){\n \n return false;\n }\n\n \n \n\n }\n }\n return true;\n\n }", "title": "" }, { "docid": "c482d51ce9dc3f6ab7bd5d9bdb1ef56d", "score": "0.6580005", "text": "isComplete () {\n return this.state.board.every((field) => field);\n }", "title": "" }, { "docid": "a7da55d919377d763fd73b81ef34dc6a", "score": "0.6579894", "text": "matchInBoard(){\n for(let i = 0; i < this.rows; i ++){\n for(let j = 0; j < this.columns; j ++){\n if(this.isPartOfMatch(i, j)){\n return true;\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "f30ffee5d33b98735fa1345feb04ac93", "score": "0.65779006", "text": "checkForWin() {\n let { hasWon, board } = this.state;\n hasWon = board.every(row => {\n return row.every(cell => !cell);\n });\n\n this.setState({ board, hasWon });\n }", "title": "" } ]
c17916d5373b12286c102115cf143b8f
Middleware for Prelogin check like Blocked IPs...
[ { "docid": "52699d353615a6ef0bc075c94ffa2553", "score": "0.6644464", "text": "function preLoginCheck(req, res, next) {\n if (req.isAuthenticated()) {\n console.log('Already Logged In');\n res.redirect('/profile');\n } else {\n next();\n }\n }", "title": "" } ]
[ { "docid": "00e2d9fa88a3ed55e46e41bf5bdbc00d", "score": "0.67941445", "text": "userLogin(req, res, next) {\n return spamPrevention.userLogin().getMiddleware({\n ignoreIP: false,\n key(req, res, next) {\n if (req.body.username) {\n return next(`${req.body.username}login`);\n }\n\n if (req.body.authorizationCode) {\n return next(`${req.body.authorizationCode}login`);\n }\n\n if (req.body.refresh_token) {\n return next(`${req.body.refresh_token}login`);\n }\n\n return next();\n }\n })(req, res, next);\n }", "title": "" }, { "docid": "9bb9d12a9104f067ab7fa21e933162a1", "score": "0.66571546", "text": "function checkip(req, res, next) {\n\n if (config.public_query) {\n\n return next();\n\n } else {\n\n var client_ip = ipaddr.parse(req.headers['x-forwarded-for'] || req.connection.remoteAddress);\n\n if (config.ip_whitelist[0]) {\n config.ip_whitelist.forEach(function(iprange) {\n var ip = ipaddr.parse(iprange.slice(0, iprange.indexOf('/'))),\n range = parseInt(iprange.slice(iprange.indexOf('/') + 1));\n if (client_ip.match(ip, range)) {\n return next();\n }\n });\n return res.send(401);\n }\n\n }\n\n}", "title": "" }, { "docid": "0575f2ab4667b9661f5bce22df1873fc", "score": "0.6591284", "text": "function allowExternalIP (req, res, next) {\n\tif(isAllowedIP(req.ip)){\n\t\tnext();\n\t} \n\telse{\n\t\tconsole.log(\"WARN: Rejected\",req.ip, \" To allow access restart with -X flag.\");\n\t\tres.status(403).end('');\n\t}\n}", "title": "" }, { "docid": "5aff2e57e64f261cb7c454e77fa6f93c", "score": "0.65434206", "text": "function guestOnlyMiddleware(req,res, next) {\n console.log('middleware hit before hitting controller')\n //you want to check user is log in. So that if i refresh, \n //i am still at the log in page and i don't need to re-register again\n //check if user is logged in,\n //if logged in, redirect back to dashboard\n if (req.session && req.session.user) {\n res.redirect('/users/dashboard')\n return\n }\n next() //you must have next() to allow the request to carry on.\n}", "title": "" }, { "docid": "f40971bd5dd71999a97ad26ae6337fc7", "score": "0.64036846", "text": "function loggedIn(req, res, next) {\n if (req.user) {\n next();\n } else {\n res.status(403).send();\n }\n}", "title": "" }, { "docid": "6eabbe52d8db8cfc5b0f486174c7e9f8", "score": "0.6223248", "text": "get authMiddlewareFunction(){\n return this.protected ? require('./lazy').serverAuth : (req, res, next) => {next()};;\n }", "title": "" }, { "docid": "6e83fb89d7c606aba6efa1ecddf42a38", "score": "0.62015957", "text": "function checkLoginReq (req)\n{\n //Now,as authenticate request is issued via Ajax call and we get the _ argument to avoid cache and need to match url only with the beginning\n return req.url.match(/^((\\/isauthenticated)|(\\/single-sign-on)|(\\/vcenter\\/menu)|(\\/menu)|(\\/authenticate)|(\\/vcenter\\/authenticate)|(\\/vcenter\\/isauthenticated)|(\\/logout)|(\\/vcenter\\/login)|(\\/vcenter\\/logout)|(\\/login)|(\\/vcenter))/);\n}", "title": "" }, { "docid": "6323a8ee711c2c3cdf534be6115837c8", "score": "0.6200882", "text": "function restricted(req, res, next) {\n if (req.session && req.session.loggedin) {\n next();\n } else {\n res.status(401).json({ message: \"You shall not pass!\" });\n }\n}", "title": "" }, { "docid": "765e3a8d2941d2d8c5bc5a97ee2952ef", "score": "0.6183141", "text": "function checkCustomerMiddleware(req, res, next) {\n\tif (req.session.user.role === \"guest\") {\n\t\tres.status(401).json({error: \"Not permitted\"});;\n\t} else {\n//\t\tconsole.log(`\\nSession info: ${JSON.stringify(req.session)} \\n`);\n\t\tnext();\n\t}\n}", "title": "" }, { "docid": "7c8c732e01c3500985f31a2aa2011e7b", "score": "0.6155916", "text": "function loginRequired(req, res, next) {\n // if (!req.user) {\n // return res.status(401).render(\"unauthenticated\");\n // }\n\n next();\n}", "title": "" }, { "docid": "475eb761b829a2be584276eff9bf7e48", "score": "0.6127613", "text": "function isLogined(req, res, next) {\n if (req.isAuthenticated()) { //ログイン済み\n return next();\n }\n else {\n res.redirect('/login');\n }\n}", "title": "" }, { "docid": "64b242b856e35a33b1c086bf56ce1151", "score": "0.6113676", "text": "function restrict(req, res, next) {\n if (req.session.user) {\n next();\n } else {\n utils.sendErrResponse(res, 400, 'Access denied!');\n }\n}", "title": "" }, { "docid": "71c64699722784c2c85bd9f0581e81f3", "score": "0.6090317", "text": "function login_required(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/login');\n }", "title": "" }, { "docid": "0e22ef5d0cf2fd63e2cd4c7dce4a6330", "score": "0.6088426", "text": "beforeRouteEnter (from, to, next) {\n if (!from.meta.protected || (from.meta.protected && store.getters['user/isLogged'])) {\n next()\n } else {\n next({\n name: config.LOGIN_ROUTE\n })\n }\n }", "title": "" }, { "docid": "08f64bc71e591bdb9b8699f772d4a67e", "score": "0.60823274", "text": "function backdoorCheck(req, res, next){\n if(! req.session.is_admin_logged_in)\n {\n res.redirect(\"/admin\");\n return;\n }\n next();\n}", "title": "" }, { "docid": "b77f6a9f45033701011e7a79886ce448", "score": "0.59999", "text": "function authChecker(req, res, next) {\n console.log(' ');\n console.log('-----------------------------------');\n console.log('Auth Checker');\n console.log('authorized: ' + req.client.authorized);\n console.log('req.url: ' + req.url);\n\n if(req.client.authorized === true) {\n //console.log('authChecker - authorized');\n next();\n } else if (req.url === '/favicon.ico' || req.url.indexOf('/assets/') === 0) {\n // allow files in the client/public/assets folder to be served without authorization\n // (e.g. css and javascript files)\n //console.log('authChecker - assets')\n next();\n } else {\n //console.log('authChecker - 401');\n res.status(401).sendFile('unauthorized.html', { root: __dirname + \"/../../client/private\" });\n }\n\n console.log('-----------------------------------');\n console.log(' ');\n}", "title": "" }, { "docid": "4d03b0850f5e950ce27ac14a22b4f06c", "score": "0.5993786", "text": "function gatekeeper(req, res, next){\r\n const password = req.headers.password //everything that you read from url or headers will be a string\r\n\r\n if(password && password.toLowerCase() === \"mellon\"){\r\n next()\r\n }else{\r\n res.status(401).json({message: \"you don't have clearance\"})\r\n }\r\n\r\n}", "title": "" }, { "docid": "b7e57319351825724a515de8a55a8711", "score": "0.59924555", "text": "async allowIfLoggedIn(req, res, next) {\n try {\n const user = res.locals.loggedInUser;\n if (!user) {\n return res\n .status(401)\n .json(new Error(\"BAD_REQUEST\", \"You need to be logged in\"));\n }\n req.user = user;\n next();\n } catch (error) {\n next(error);\n }\n }", "title": "" }, { "docid": "0a9e1c23dc85cab1e119919ec77d4ef0", "score": "0.5985894", "text": "function requiresLogin(req, res, next) {\n\n let cookies = parseCookies(req);\n\n try {\n let email = decodeURIComponent(cookies.email);\n let hash = decodeURIComponent(cookies.hash);\n \n sql = '';\n sql += 'SELECT * FROM public.\"user\" ';\n sql += 'WHERE cookie = $1 ';\n sql += 'AND email = $2 ';\n\n pool.connect((error, client, done) => { \n\n // use logged in client to retrieve the results of the database\n client.query(sql, [hash, email], (error, result) => { \n\n if (error) {\n \n console.log(error);\n } else {\n // result is returned as an array\n if (result.rows.length > 0) {\n // hashed cookie is valid (matched email in db) - login \n done();\n return next();\n\n } else {\n // client's cookie is bad/missing\n done();\n res.redirect('/login?msg=bad-token');\n \n }\n\n }\n \n });\n \n });\n\n } catch(err) {\n // eat the error\n res.redirect('/login?msg=bad-token');\n }\n \n}", "title": "" }, { "docid": "7e954ac5626a327a7d5b29cfa96e0427", "score": "0.5979322", "text": "function checkBeforeRendering(req, res, next) {\n if (req.isAuthenticated()) next();\n else {\n\t\tconst { msg } = req.query;\n\t\tif(msg){\n\t\t\tconsole.log(msg)\n\t\t\tres.status(200).render('login', {\n\t\t\t\tsuccess_msg: 'Password is created, you can login'\n\t\t\t});\n\t\t}\n\t\telse\n\t\t\tres.status(200).render('login')\n\t}\n}", "title": "" }, { "docid": "b9d18150f8a03c0b6eb2daf9d0b88f1a", "score": "0.5965544", "text": "function authWrap(req, res, next) {\nif (!req.app.get(\"nocheck\"))\n auth.checkAuthorization(req, res, next);\nelse\n next();\n}", "title": "" }, { "docid": "9d9a64a67b93304d81db165a8795dd55", "score": "0.59648967", "text": "function isLoggedIn(req, res, next){\n if(res.locals.currentUser){\n next();\n }\n else {\n res.sendStatus(403); // prohibited\n }\n}", "title": "" }, { "docid": "8fc65754c54b11538a40746141236cc4", "score": "0.5962765", "text": "function restrictAccess(req, res, next) {\n if (req.session && req.session.user) {\n next();\n } else {\n res.status(401).json({ message: 'access denied' });\n }\n}", "title": "" }, { "docid": "96f1f850a05566e6449e76cb32e737fe", "score": "0.592954", "text": "function isLoggedIn(req, res, next) {\n if (res.locals.currentUser) {\n next();\n } else {\n res.sendStatus(403);\n }\n}", "title": "" }, { "docid": "20ce2b18c0bea1227de14a456443a823", "score": "0.59283", "text": "globalBlock(req, res, next) {\n return spamPrevention.globalBlock().getMiddleware({\n ignoreIP: false,\n key: function (req, res, next) {\n next(url.parse(req.url).pathname);\n }\n })(req, res, next);\n }", "title": "" }, { "docid": "ce260658150b3a7af48660d43c328c0f", "score": "0.59274685", "text": "function checkMemberMiddleware(req, res, next) {\r\n\tif (req.session.user.role !== \"member\") {\r\n //res.status(401).json({error: \"Not permitted\"});;\r\n res.status(400).render(\"Forbidden.njk\", {\r\n user: req.session.user\r\n });\r\n\t} else {\r\n//\t\tconsole.log(`\\nSession info: ${JSON.stringify(req.session)} \\n`);\r\n\t\tnext();\r\n\t}\r\n}", "title": "" }, { "docid": "0d48cedc17b73530261778c0a612402f", "score": "0.5913885", "text": "function gatekeeper(req, res, next) {\n if (req.headers.password === \"mellon\") {\n next(); // allows the request to continue to the next middleware or route handler\n } else {\n res.status(401).json({\n errorMessage:\n \"Incorrect credentials, session may have timed-out. Please log back into account to continue to this page\"\n });\n }\n}", "title": "" }, { "docid": "fdf63412967f1f3d99f8be74822ee051", "score": "0.5913091", "text": "function checkLoginCB(req, res, next) {\r\n // If the user has not yet logged in, redirect the user to login page\r\n if (! checkLogin(req)) {\r\n res.status(401);\r\n res.send(\"Unauthorized. Please <a href='/login'>login</a> first.</a>\");\r\n return;\r\n }\r\n\r\n next(); // Forward the request to next middleware\r\n}", "title": "" }, { "docid": "91693a528106a4f09ae26aa137a087ca", "score": "0.5909513", "text": "function onLogin(req, res) {\r\n\temail = req.body.email;\r\n\tpass = req.body.pass;\r\n\trequire('./debug.js').log(5, 'backend', 'Auth POST received with email: ' + email + ' pass: ' + pass);\r\n\tverify(email, pass, function (code) {\r\n\t\tif (code === 0) {\r\n\t\t\trequire('./debug.js').log(5, 'backend', 'Correct login for: ' + email);\r\n\t\t\treq.session.email = email;\r\n\t\t\tres.header('Access-Control-Allow-Origin', 'http://duinocloud.com:10080/*');\r\n\t\t\tres.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');\r\n\t\t\tres.header('Access-Control-Allow-Headers', 'Content-Type');\r\n\t\t\tres.end('done');\r\n\t\t} else {\r\n\t\t\t// bad user or pass, will not send cookie\r\n\t\t\trequire('./debug.js').log(5, 'backend', 'Bad login for: ' + email + ' code: ' + code);\r\n\t\t\tres.end('bad');\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "7a5dc50a73772ae9fc5d050396a5e89d", "score": "0.5897425", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next()\n\n console.log('El usuario no esta autentificado. Requiere logearse')\n res.status(403).json({\n status: 'not_access',\n message: 'El usuario no esta autentificado. Requiere logearse'\n })\n\n}", "title": "" }, { "docid": "21f27ff9fcdeab8ed29461cfd23af4b3", "score": "0.5895546", "text": "function isLoggedIn(req,res,next){\r\n if(req.isAuthenticated()){\r\n return next()\r\n }\r\n res.redirect(\"/check\");\r\n}", "title": "" }, { "docid": "de15eaf9229d3c1484487ab7e7410d66", "score": "0.58778524", "text": "function loginRequired(req, res, next) {\n if(!req.user) return res.status(401).json({ status: 'Please log in'});\n\n return next();\n}", "title": "" }, { "docid": "368a14316725660b8fe4f4909a759ba2", "score": "0.58722013", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next()\n\n console.log('El usuario no esta autentificado. Requiere logearse')\n res.status(403).json({\n status: 'not_access',\n message: 'El usuario no esta autentificado. Requiere logearse'\n })\n}", "title": "" }, { "docid": "f2a31ae55a0e3470389d2de72a976a30", "score": "0.5869222", "text": "function isLoggedInIncheonAirport(req, res, next) {\n\n // if user is authenticated in the session, carry on \n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/login');\n}", "title": "" }, { "docid": "933e1ca20f291d4ff6964d07d8d4d98b", "score": "0.5869179", "text": "function requiresLogin(req,res,next){\n if(req.session && req.session.userId){\n return next();\n } else {\n var err = new Error('You must be logged in to access this function');\n err.status = 401;\n return next(err);\n }\n}", "title": "" }, { "docid": "50d128b425f5a01bea29ab719d017218", "score": "0.5864157", "text": "function isLoggedIn(req, res, next) {\n\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n\n res.status(403).send('Forbidden');\n}", "title": "" }, { "docid": "a70934c6bfcb08105fb614924462a2ab", "score": "0.5863404", "text": "function login (req, res) {\n req.session.started = true;\n req.session.ip = req.headers['cf-connecting-ip']\n || req.headers['x-real-ip']\n || req.connection.remoteAddress;\n res.redirect(TOKEN_LINK);\n}", "title": "" }, { "docid": "492b4003424b04d1b6bad20d963dbaa3", "score": "0.58621603", "text": "function checkAuth(req, res, next) {\n console.log('checkAuth ' + req.url);\n // don't serve /secure to those not logged in\n // you should add to this list, for each and every secure url\n if (req.url === '/lms' && (!req.session || !req.session.authenticated)) {\n res.render('authorization/login.html', {\n layout: false,\n 'title': 'Amway.voice',\n status: 403\n });\n return;\n }\n next();\n}", "title": "" }, { "docid": "54ae1bebb4ca5750d1b25af97aaf9b06", "score": "0.58552253", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next()\n\n\t console.log('El usuario no esta autentificado. Requiere logearse')\n\t res.status(403).json({\n\t status: 'not_access',\n\t message: 'El usuario no esta autentificado. Requiere logearse'\n\t })\n\n}", "title": "" }, { "docid": "498dc7c6ff5b0c8a2734200749ef6685", "score": "0.585347", "text": "function authChecker(req, res, next) {\n if (req.session.username) {\n //res.redirect(\"/home/\" + req.session.username);\n next();\n } else {\n res.redirect(\"/signin\");\n }\n}", "title": "" }, { "docid": "6aaa67d7591e3fc771fb0074677ef0b3", "score": "0.58486557", "text": "function loggedIn(req, res, next) {\n if (req.user) {\n // if request contains the user\n next(); // call next\n } else {\n res.status(403).send(\"Unauthorized\"); // throwing unauthorized\n }\n}", "title": "" }, { "docid": "e82be070fb85d332d60a0738c67f8cf7", "score": "0.5848001", "text": "function restrict(req, res, next) {\n if(req.session.user) {\n next();\n } else {\n res.redirect(\"/\");\n }\n }", "title": "" }, { "docid": "b24b9052f2e05a8c3c22957e3c9d50ac", "score": "0.58331037", "text": "function require_login(callback) {\n return function (req, res) {\n if (req.session.username === undefined) {\n res.send('Login required', 403);\n } else {\n callback(req, res);\n }\n };\n}", "title": "" }, { "docid": "635ea7987e9a5171efbb6e16b19b3d4e", "score": "0.58327603", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated() && req.user.username == \"[email protected]\") {\n return next();\n }\n res.redirect(\"/login\");\n}", "title": "" }, { "docid": "c7249c6cd42965e85daa49dbd5451b04", "score": "0.5818758", "text": "function checkAuthUser(req, res, next){\n if(req.isAuthenticated()){\n req.isLogged = true;\n next()\n }else {\n req.isLogged = false;\n next()\n }\n \n}", "title": "" }, { "docid": "7a7615052c7896dc2193cb07f59d5704", "score": "0.5815276", "text": "function gatekeeper(req,res,next) {\n \n const password = req.headers.password\n\n if (password && password.toLowerCase() ===\"mellon\") {\n next()\n }else{\n res.status(404).json({ you: \" you shall not pass\"})\n }\n \n}", "title": "" }, { "docid": "0318c0ea4648f40ca4645baf11f58afe", "score": "0.58150893", "text": "function preAuthenticate(socket) {}", "title": "" }, { "docid": "5687d4b91d3077a3066df2ce99112476", "score": "0.5814165", "text": "requiresLogin(req, res, next) {\n if (!req.me) {\n return res.status(401).end();\n }\n return next();\n }", "title": "" }, { "docid": "143cf9627750eeff1dd7763a28d4151f", "score": "0.5804937", "text": "function isLoggedIn(req, res, next) {\n if (req.user) {\n next();\n } else {\n res.sendStatus(401);\n }\n}", "title": "" }, { "docid": "33611bb63f26cf4410f5c1b86d6212f2", "score": "0.5803584", "text": "function checkLogin(req, res, next) {\r\n if (req.session && req.session.UserId) {\r\n return next();\r\n } else {\r\n var err = new Error('You must be logged in to view this page.');\r\n err.status = 401;\r\n return next(err);\r\n }\r\n}", "title": "" }, { "docid": "21149baa5bd144b828c35f18aa07b078", "score": "0.5798488", "text": "function requiresLogIn( request, response, next ) {\n if( request.session && request.session.userId ) {\n return next();\n } else {\n res.send('You must be logged in to view this page.')\n }\n}", "title": "" }, { "docid": "209d54afc28668b8f8f554011fd0e1b4", "score": "0.5795902", "text": "function loginCheck(req, res, next) {\n if (!req.user) {\n res.json({\n success: false,\n messages: ['You must be logged in'],\n errType: 'notLoggedin',\n });\n return;\n }\n\n next();\n}", "title": "" }, { "docid": "941d415d4f1fef0862f2e6b73de225cf", "score": "0.5793643", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.json('notLoggedIn');\n}", "title": "" }, { "docid": "49eaf24d3f60d009f02d0b43c1285f88", "score": "0.57834035", "text": "function isAccessGranted (req, res, next) {\n // console.log(req.headers)\n if (!app.locals.origin){\n if (req.headers.apikey) {\n if(req.headers.apikey == process.env.API_KEY) {\n next();\n } else {\n res.status(401).send(\"Error: Invalid Token\");\n }\n } else {\n res.status(401).send(\"Error: Missing Token\");\n } \n } else {\n next();\n }\n}", "title": "" }, { "docid": "6b0a1969ea517627c02687d5381bddb6", "score": "0.5781529", "text": "function isLoggedIn(req, res, next) {\n\n // if user is authenticated in the session, carry on \n if (req.isAuthenticated())\n return next();\n else{\n res.json(401,{message:\"User not authenticated. Call http://api.humandroid.us/login\"});\n }\n\n}", "title": "" }, { "docid": "ef57ccdb3c445a49f2993ecf36142ff2", "score": "0.5777097", "text": "function check (req,res,next){\n // console.log(req.session.token)\n if(req.session.user != null && req.session.token != null)\n {\n // console.log(req.session)\n next();\n }\n else\n res.sendStatus(403);\n\n}", "title": "" }, { "docid": "da2f579f37bd906008b06a291a83809a", "score": "0.57756925", "text": "function authorizeRequest(req, res, next) {\n\n if (req.user) {\n next();\n } else {\n res.status(401).send('Unauthorized. Please login.');\n }\n}", "title": "" }, { "docid": "bc0ada408fb3a14d201d6d5f62a54e72", "score": "0.5770183", "text": "function requireToken() {\n return function(req, res, next) {\n if (req.session.accessToken) {\n next();\n }\n else {\n res.redirect('/home');\n }\n }\n }", "title": "" }, { "docid": "38173d3e561431c0bdd8094c1216397a", "score": "0.5767852", "text": "apiAuthOnly(req, res, next) {\n const token = req.cookies.SMGSID;\n if (!token || !this.tokens.includes(token)) return res.sendStatus(401);\n try {\n req.user = jwt.verify(token, JWT_SECRET);\n req.token = token;\n return next();\n } catch {\n return res.sendStatus(401);\n }\n }", "title": "" }, { "docid": "380db7394a61345264630ed0bd5186e4", "score": "0.5766036", "text": "contentApiKey(req, res, next) {\n return spamPrevention.contentApiKey().getMiddleware({\n ignoreIP: false\n })(req, res, function (err, ...rest) {\n if (!err) {\n // Reset any blocks if the request is authorized\n // This ensures that the count only goes up for\n // unauthorized requests.\n res.on('finish', function () {\n if (res.statusCode < 400) {\n req.brute.reset();\n }\n });\n }\n return next(err, ...rest);\n });\n }", "title": "" }, { "docid": "5dfbb9fb3eae958a05c6b1d907bc9f24", "score": "0.5760687", "text": "function loginRequired(req, res, next) {\n if (!req.user) return res.redirect('/auth/login');\n return next();\n}", "title": "" }, { "docid": "f2b65ae54fdc2e2b4c21d3bfa22032b2", "score": "0.5760216", "text": "function preFilter(req, res, next) {\n Logger.info(\"preFilter\");\n res.statusCode = -1; //Se il postFilter riceve lo status a -1 allora la richiesta non è stata servita da nessuna API (404)\n req.start_time = new Date();\n next();\n }", "title": "" }, { "docid": "a36829c60dda4e3e45235269f718103d", "score": "0.5758568", "text": "function loginRequired(req, res, next) {\n if (!req.user) {\n return res.redirect(\"/login\")\n } else {\n // go through if you have the user set\n next();\n } \n}", "title": "" }, { "docid": "ab1f46e8d8662053447a7858d2a36cd8", "score": "0.5748483", "text": "function isAuthd(req, res, next) {\n if(req.session.auth){\n return next();\n }\n else{\n res.status(403).send(\"please signin to countinue your application.\")\n }\n}", "title": "" }, { "docid": "8d162657ba8d919e1546fca9df28e3d8", "score": "0.57464814", "text": "function authenticatedMiddleware(req, res, next) {\n // if user is authenticated let request pass\n if (req.session.user) {\n next();\n } else { // user is not authenticated send them to login\n console.log('Middleware check...user not authenticated');\n\n }\n}", "title": "" }, { "docid": "d72ce52cd4fd6d4b9c2f6e2b6179abb4", "score": "0.57447743", "text": "requireAnonymus (req, res, next) {\n if (req.session.currentUser) {\n return res.redirect('/');\n }\n next();\n }", "title": "" }, { "docid": "71c3037f035c0232471e52a6d7bdc27f", "score": "0.5742689", "text": "function checkNotAuth(req, res, next){\n if(req.isAuthenticated()){\n return next();\n }\n res.redirect('/');\n}", "title": "" }, { "docid": "627151af58337818d4fa8432a383f029", "score": "0.5740131", "text": "function checkUser(req, res, next) {\n if (isLoggedIn(req)) {\n next();\n } else {\n res.send(false);\n }\n }", "title": "" }, { "docid": "4ae0a0bba1aeb95cf6999d4d34c5b6a4", "score": "0.5739331", "text": "function restrictedUser() {\n return (req, res, next) => {\n console.log(\"restreticted req session---->\", req.session);\n if (req.session && req.session.user) {\n next();\n } else {\n res.status(403).json({ error: `you can't pass, please validate login` });\n }\n };\n}", "title": "" }, { "docid": "4ae0a0bba1aeb95cf6999d4d34c5b6a4", "score": "0.5739331", "text": "function restrictedUser() {\n return (req, res, next) => {\n console.log(\"restreticted req session---->\", req.session);\n if (req.session && req.session.user) {\n next();\n } else {\n res.status(403).json({ error: `you can't pass, please validate login` });\n }\n };\n}", "title": "" }, { "docid": "659394fe26c02435073fd833a3bdf895", "score": "0.5738377", "text": "function notLoggedin(req, res, next) {\n if (!req.isAuthenticated()) {\n return next();\n }\n res.redirect(\"/controllers/dashboard\");\n}", "title": "" }, { "docid": "5b841cec6f3bebeca713f086c96acb6c", "score": "0.5737341", "text": "function checkAuth (req, res, next) {\n\t\t// you could check user permissions here too\n\tif (req.user) return next();\n\treturn res.status(403).json({ error: 'no access' });\n}", "title": "" }, { "docid": "f8dc51679dbdcfee142602e98fb95337", "score": "0.57343316", "text": "function restricted(req, res, next) {\n const token = req.headers.authorization;\n\n if (token) {\n jwt.verify(token, secret, (err, decodedToken) => {\n if (err) {\n console.log(token,secret);\n res\n .status(403)\n .json({\n message: \"Are you a ******* hacker? Get the **** out of here!!\"\n });\n } else {\n next();\n }\n });\n } else {\n res.status(401).json({ message: \"No token provided\" });\n }\n}", "title": "" }, { "docid": "8a010925995d9aa0ae2c21fa689948fc", "score": "0.5733517", "text": "function isLoggedIn(req, res, next) {\r\n if (req.isAuthenticated()) {\r\n return next();\r\n }\r\n else {\r\n res.render(\"404\");\r\n }\r\n }", "title": "" }, { "docid": "7c8632f57c13128320955059a0e248a3", "score": "0.5732255", "text": "function isLoggedIn(req, res, next) {\n /*\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n // if they aren't redirect them to the home page\n res.redirect('../');\n */\n var baseUrl = req.baseUrl.split(\"/\");\n client_id = baseUrl[2];\n store_id = baseUrl[4];\n area_id = baseUrl[6];\n return next();\n}", "title": "" }, { "docid": "52cc329293835430b62e37c576160ccc", "score": "0.5730928", "text": "function preHandler(req)\r\n{\r\n\treturn req;\r\n}", "title": "" }, { "docid": "d74d8b3bccb88d5dd7d6c2830f41b8f8", "score": "0.5728298", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.send('noauth');\n}", "title": "" }, { "docid": "b5621698cbd5168ccf6155f1a43d3b43", "score": "0.5727102", "text": "function checkLogin(req, res, next) {\n if (req.isAuthenticated()) {\n next();\n } else {\n res.status(401).send({sucess: false, message: \"Unauthorized\"});\n }\n}", "title": "" }, { "docid": "8849430b02ba283a1ed985da6fa2a0bf", "score": "0.57229847", "text": "function requireLogin(req, res, next) {\n if (req.session.loggedin) {\n next(); // allow the next route to run\n } else {\n // require the user to log in\n return res.redirect(\"/login\"); \n }\n }", "title": "" }, { "docid": "2870ca3456ee1048aa703262d2243709", "score": "0.57206285", "text": "function loggedIn(req, res, next) {\n if (req.user) {\n next();\n }\n else {\n console.log(\"Login was not conserved\");\n res.redirect('/');\n }\n}", "title": "" }, { "docid": "ad96c37e60525bdcdb4de5c1b81a007a", "score": "0.571731", "text": "authOnly(req, res, next) {\n const token = req.cookies.SMGSID;\n if (!token || !this.tokens.includes(token)) return res.redirect('/login');\n try {\n req.user = jwt.verify(token, JWT_SECRET);\n req.token = token;\n return next();\n } catch {\n return res.redirect('/login');\n }\n }", "title": "" }, { "docid": "8df0a25d5f4488b154d07a4fb8996bfa", "score": "0.5716624", "text": "function simpleRoute(req, res, next) {\n res.status(200).end(`${req.user || \"guest\"} is allowed access to ${req.url}`);\n}", "title": "" }, { "docid": "f80f05ace61fd0f2b5d7a10538d0e292", "score": "0.5713476", "text": "function publicHandleLogin(req, res, next) {\n if (publicIsLoggedIn(req)) {\n res.send(true);\n }\n else {\n usersStore.authenticatePr(req.body.email, req.body.password)\n .then(function (user) {\n if (user) {\n var jsonWebTokenObject = publicCreateWebTokenObject(req.app, user);\n jsonWebTokenObject = Object.assign(jsonWebTokenObject, { user: user });\n res.jsonp(jsonWebTokenObject);\n res.end();\n }\n else {\n res.status('401').end()\n }\n },\n function (err) {\n res.status('401').end();\n });\n }\n}", "title": "" }, { "docid": "3dd10a7fc3c198ca1a1ae25018668907", "score": "0.5712441", "text": "function notLoggedIn(req, res, next) {\n if(!req.isAuthenticated()){\n return next();\n }\n res.redirect('/');\n}", "title": "" }, { "docid": "5c819715a842351f61f6d7412fef3b86", "score": "0.57085544", "text": "function isLoggedIn(req) {\n return true // for the moment, we'll just let everyone in\n}", "title": "" }, { "docid": "46ade3824c4d32c5896f15121c878054", "score": "0.57075924", "text": "function authRequired(req, res, next) {\n try {\n const tokenStr = req.body._token || req.query._token;\n let token = jwt.verify(tokenStr, SECRET_KEY);\n req.username = token.username;\n return next();\n }\n\n catch (err) {\n let unauthorized = new Error(\"You must authenticate first.\");\n unauthorized.status = 401; // 401 Unauthorized\n return next(unauthorized);\n }\n}", "title": "" }, { "docid": "f9baeb043d583118a0563db9c972d36b", "score": "0.5705155", "text": "function isLoggedIn(req,res,next)\n{\n if(req.isAuthenticated()){\n return next();\n }\n res.redirect(\"/login\");\n}", "title": "" }, { "docid": "ce1aee12493c2b1d6f6942d8926a4cc0", "score": "0.5703904", "text": "function isLoggedIn(req,res,next){\r\n if(req.isAuthenticated()){\r\n return next()\r\n }else{\r\n req.flash(\"error\",\"You must be logged in first\")\r\n res.redirect(\"/login\")\r\n }\r\n}", "title": "" }, { "docid": "c8ac8d81bde2b22b35258b01711a7ecc", "score": "0.57038784", "text": "function checkState(req, res, next) {\n if (req.isAuthenticated()) {\n return res.redirect(\"/\");\n }\n next();\n}", "title": "" }, { "docid": "bf0b0df9234a5cfc0d9cb92f1ad46cd7", "score": "0.5699009", "text": "function restrict(req, res, callback) {\n if (req.session) {\n if (req.session.user) {\n callback();\n } else {\n req.session.error = 'Access denied!';\n res.send(403, JSON.stringify(req.session.error));\n }\n } else {\n req.session.error = 'No session!';\n res.send(403, JSON.stringify(req.session.error));\n }\n}", "title": "" }, { "docid": "7631d643c9ac58172d59f557551ca287", "score": "0.5689566", "text": "requireAuth(req, res, next) {\n if (req.isAuthenticated()) return next();\n return res.status(401).send('Not logged in');\n }", "title": "" }, { "docid": "ce27671860d478dfe0f8d8b3cb8b2ab2", "score": "0.5686623", "text": "function checkAuthen(req, res, next) {\n // req.originalUrl\n\n if (req.cookies.name == \"login\") {\n res.cookie('name', 'login',\n { expires: new Date(Date.now() + timeOut) });\n next();\n } else {\n res.redirect(\"/login\");\n }\n}", "title": "" }, { "docid": "c993270bfe0e6956ad6b96d1b6b23f6a", "score": "0.5679277", "text": "function checkSignIn(req, res, next) {\n\t//get auth header value\n\tconsole.log('in middleware function checksignin: ');\n\t//console.log(req.cookies);\n\tconst token = req.cookies.token;\n\t//check if token is undefined\n\tif (token != undefined) {\n\t\tjwt.verify(token, process.env.ACCESS_TOKEN_SECRET, (err, user) => {\n\t\t\tif (err) {\n\t\t\t\tres.clearCookie('token');\n\t\t\t\tres.send(401, 'Invalid or missing token').end();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tres.locals.user = user;//lifetime of the reqest\n\t\t\t\tnext();//proceed\n\t\t\t}\n\t\t\t\n\t\t})\n\t}\n\telse {\n\t\treturn res.send(401, 'Invalid or missing token').end();\n\t}\n}", "title": "" }, { "docid": "d19fa0e255e4e529a7ce21f753b78122", "score": "0.56701267", "text": "function isAdminVerified(req, res, next)\n{\n // \n const isAdmin = req.headers.isadmin; \n console.log(req.headers.isadmin); \n\n // \n if (isAdmin) \n {\n // \n next(); \n }\n\n // \n else \n {\n // \n let errMessage = JSON.stringify({\"message\": \"Access denied. (User not admin)\"}); \n return res.send(errMessage).status(403); \n }\n}", "title": "" }, { "docid": "ce4a30258d9af6c84118dde5a0c9ff40", "score": "0.56685233", "text": "function ensureLoggedIn() {\n\treturn function (req, res, next) {\n\t\t// isAuthenticated is set by `deserializeUser()`\n\t\tif (!req.isAuthenticated || !req.isAuthenticated()) {\n\t\t\tres.status(401).send({\n\t\t\t\tsuccess: false,\n\t\t\t\tmessage: 'You need to be authenticated to access this page!'\n\t\t\t})\n\t\t} else {\n\t\t\tnext()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e849793021d6bab8a71cd3a6e851e75b", "score": "0.5667326", "text": "function authRequired(req, res, next) {\n try {\n const tokenStr = req.body._token;\n const token = jwt.verify(tokenStr, SECRET);\n req.username = token.username;\n return next();\n } catch (err) {\n return next(new APIError(401, 'You must authenticate first'));\n }\n}", "title": "" }, { "docid": "d28da7c0e8b19b960fd0eff5b99acbe2", "score": "0.5666771", "text": "function isLoggedIn(req, res,next){\n if(req.isAuthenticated()){\n next();\n }\n else{res.redirect('/')};\n}", "title": "" }, { "docid": "2dee2c91588ae51d36f68e3211b27796", "score": "0.566518", "text": "function isLoggedIn(req, res, next){\n\t\n\tlet first_login=(req.url=='/login')||(req.url=='/register')\n\t if(req.method == 'OPTIONS'){\n\t \tres.sendStatus(200)\n\t\t //console.log(req.url)\n\t\t //console.log(req.headers)\n\t \treturn\n\t }\n\telse if(!req.cookies&&(!first_login)){\n\t\t//console.log('cookie missing')\n\t\tres.status(401).send('Not authorized! No cookie!')\n\t\treturn\n\t}\n\telse{\n\t\t//console.log(req.method)\n\t\tconsole.log(req.url)\n\t\t//console.log(req.cookies)\n let sid = req.cookies[cookieKey]\n\t// //console.log(req)\n\t// if(!sid&&(!first_login)){\n\t// \tconsole.log('sid missing')\n\t// \tres.status(401).send('Not authorized! No cookie with sid!')\n\t// \treturn\n\t// }\n\tif(first_login){\n\t\treq.username=req.body.username\n\t\t//console.log('login!')\n\t\t//next()\n\t}\n\t//console.log('sid: '+sid)\n\tredis.hgetall(sid, function(err,userObject){\n\t\tif(userObject && userObject.username){\n\t\t\treq.username = userObject.username;\n\t\t\t//console.log('username sid:'+req.username)\n\t\t\tnext();\n\t\t}\n\t\t//if(first_login){next()}\n\t\telse{\n\t\t\t//res.status(401).send('Not authorized! Invalid cookie!')\n\t\t\tconsole.log('fb login session found here')\n\t\t\tredis.hgetall('fblogin', function(err,userObject){\n\t\t\tif(userObject && userObject.username){\t\n\t\t\treq.username=userObject.username\n\t\t\tconsole.log('sessio stored: '+userObject.username)\t}\n\t\t\tnext()\n\t\t\t})\n\t\t\t\n\t\t}\n\t})}\n}", "title": "" }, { "docid": "63f9e7437c7a17e2cdc500b1f84c2999", "score": "0.5664406", "text": "function isLoggedIn(req, res, next) {\n\nconsole.log(req);\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n\n return next();\n\n // if they aren't redirect them to the home page\n console.log(\"redirect due to not logged in\")\n res.redirect('/');\n}", "title": "" }, { "docid": "f47359647a107777f5a397a81c043f61", "score": "0.56642807", "text": "function checkAuth(req, res, next) {\n if (!req.session.user_id) {\n routes.start(req, res);\n } else {\n next();\n }\n}", "title": "" } ]
e1b8609f1fe78c60d47ab433c0a18b40
`ReactInstanceMap` maintains a mapping from a public facing stateful instance (key) and the internal representation (value). This allows public methods to accept the user facing instance as an argument and map them back to internal methods. Note that this module is currently shared and assumed to be stateless. If this becomes an actual Map, that will break. This API should be called `delete` but we'd have to make sure to always transform these to strings for IE support. When this transform is fully supported we can rename it.
[ { "docid": "aaadca4aa069312573b8dfa8e7428dc7", "score": "0.0", "text": "function get(key) {\n return key._reactInternalFiber;\n}", "title": "" } ]
[ { "docid": "739ac93e6a34eb71c5f2ad0f41ae9be5", "score": "0.5711242", "text": "createMap() {\n const { navermaps, id, registerEventInstance } = this.props;\n\n invariant(id, 'react-naver-maps: <Map /> - props.id is required');\n\n const mapOptions = pickMapOptions(this.props);\n const kvoOptions = pickKVOOptions(this.props);\n const defaultKVOOptions = pickDefaultKVOKeys(this.props);\n\n const allMapOptions = {\n ...mapOptions,\n ...kvoOptions,\n };\n\n Object.keys(defaultKVOOptions).forEach(defaultKey => {\n allMapOptions[defaultKVOKeyMap[defaultKey]] =\n defaultKVOOptions[defaultKey];\n });\n\n try {\n this.instance = new navermaps.Map(id, allMapOptions);\n } catch (e) {\n invariant(\n false,\n `react-naver-maps: <Map /> - please check <div id=#${id}> is correctly mounted`,\n );\n }\n\n // alias\n this.map = this.instance;\n registerEventInstance(this.map);\n\n // clear updating state\n this.map.addListener('idle', () => {\n this.updating = false;\n });\n }", "title": "" }, { "docid": "66214f240303db975f3031e82dd5b02c", "score": "0.5662379", "text": "constructor () {\n if (State.instance) {\n return State.instance;\n }\n State.instance = this;\n\n this.state = new Map();\n }", "title": "" }, { "docid": "cb3c7632e324fd1ca72ed24352ac18c1", "score": "0.55833805", "text": "function Map() {\n this.__keys__ = [];\n this.__values__ = [];\n}", "title": "" }, { "docid": "ccfac924383ba37256d9abc917e02cd7", "score": "0.5437218", "text": "function Map() {\r\n this.keys = [];\r\n this.values = [];\r\n}", "title": "" }, { "docid": "7c3cd89a5f193e4f5e52b97a84c68798", "score": "0.5340643", "text": "function FakeMap () {\n if (typeof Map === 'function') return new Map()\n this.keys = []\n this.values = []\n}", "title": "" }, { "docid": "78c16fe227008aa9ed64dc43e87bba4a", "score": "0.52922314", "text": "function InvokeDefinitionMap() {\n this.map = [];\n this.lookup_table = {}; // Just for building dictionary\n}", "title": "" }, { "docid": "996c26c93b7f2bf8ec51887669b6f1d7", "score": "0.5235879", "text": "function Map() {\n this.keys = OrderedSet.create();\n this.values = {};\n }", "title": "" }, { "docid": "65752ee6e04ed4cf2c175d8c7833ad1b", "score": "0.51957244", "text": "function Map(){\n\tthis.container = new Object();\n}", "title": "" }, { "docid": "73b43a2ed504a7b3ae0a32c45eba84c7", "score": "0.51647556", "text": "_saveInstanceProperties() {\n for (const [p] of this.constructor._classProperties) {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n\n this._instanceProperties.set(p, value);\n }\n }\n }", "title": "" }, { "docid": "aabedd5ef968b00a2660ea8df7d6a712", "score": "0.5148289", "text": "_saveInstanceProperties() {\n for (const [p] of this.constructor\n ._classProperties) {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n }\n }", "title": "" }, { "docid": "174aee1d037205e96973f9703aca19dc", "score": "0.5023131", "text": "function get(key){return key._reactInternals;}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4996279", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4996279", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4996279", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4996279", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4996279", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "172b4b29b1dd2c280af72f9b659e0a34", "score": "0.4996279", "text": "function h$Map() {\n this._pairsKeys = [];\n this._pairsValues = [];\n this._keys = [];\n this._size = 0;\n}", "title": "" }, { "docid": "fab7479ba7af7c85131128f69133ceb5", "score": "0.49907947", "text": "function ListMap() {\n this.map = new Map();\n}", "title": "" }, { "docid": "abb08701161ced9d1db2141b10fceda8", "score": "0.49895853", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "abb08701161ced9d1db2141b10fceda8", "score": "0.49895853", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "49c071df08d2a822e7139d114189aebb", "score": "0.4979107", "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": "8267ce04c4f8319228235eac75b46cb8", "score": "0.49720946", "text": "constructor() { this.map = new Map(); }", "title": "" }, { "docid": "546474f9f7b33296fd28c1d370d3e3da", "score": "0.4971946", "text": "function Map() {\n if (this instanceof Map) {\n this._keys = OrderedSet.create();\n this._keys._silenceRemoveDeprecation = true;\n this._values = new _emberMetalEmpty_object.default();\n this.size = 0;\n } else {\n missingNew('Map');\n }\n }", "title": "" }, { "docid": "577c8ff58346f89c683f17a58340adae", "score": "0.49641618", "text": "function CT_Map(){\n\tthis.keys = [];\n\tthis.values = [];\n\tthis.cacheKey = null;\n\tthis.cacheIndex = -1;\n}", "title": "" }, { "docid": "a63e743b9cd8d8aa08cd42d6ec1df452", "score": "0.49472916", "text": "function MapEntry$2(key, value) {\n\tif (!(this instanceof MapEntry$2))\n\t\treturn new MapEntry$2(key, value);\n\n\tthis.key = key;\n\tthis.value = value;\n}", "title": "" }, { "docid": "f900d741b6f7557fd4342b801accf3bb", "score": "0.49184018", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "af3e092fb7f7934ef27b15bac50ef8d2", "score": "0.49167535", "text": "function get(key){return key._reactInternalFiber;}", "title": "" }, { "docid": "1c591e5a0de0ea86d01ecacebf9d9ef2", "score": "0.49105057", "text": "function shimMap() {\n var MapIterator = (function () {\n function MapIterator(data, selector) {\n this.index = 0;\n this.data = data;\n this.selector = selector;\n this.keys = Object.keys(data);\n }\n MapIterator.prototype.next = function () {\n var index = this.index;\n if (index < this.keys.length) {\n this.index++;\n return { value: this.selector(this.data, this.keys[index]), done: false };\n }\n return { value: undefined, done: true };\n };\n return MapIterator;\n }());\n return (function () {\n function class_1() {\n this.data = createDictionaryObject();\n this.size = 0;\n }\n class_1.prototype.get = function (key) {\n return this.data[key];\n };\n class_1.prototype.set = function (key, value) {\n if (!this.has(key)) {\n this.size++;\n }\n this.data[key] = value;\n return this;\n };\n class_1.prototype.has = function (key) {\n // tslint:disable-next-line:no-in-operator\n return key in this.data;\n };\n class_1.prototype.delete = function (key) {\n if (this.has(key)) {\n this.size--;\n delete this.data[key];\n return true;\n }\n return false;\n };\n class_1.prototype.clear = function () {\n this.data = createDictionaryObject();\n this.size = 0;\n };\n class_1.prototype.keys = function () {\n return new MapIterator(this.data, function (_data, key) { return key; });\n };\n class_1.prototype.values = function () {\n return new MapIterator(this.data, function (data, key) { return data[key]; });\n };\n class_1.prototype.entries = function () {\n return new MapIterator(this.data, function (data, key) { return [key, data[key]]; });\n };\n class_1.prototype.forEach = function (action) {\n for (var key in this.data) {\n action(this.data[key], key);\n }\n };\n return class_1;\n }());\n }", "title": "" }, { "docid": "f2469a9a111fc08a0fde05cf4da924e6", "score": "0.4903116", "text": "function MapEntry(key, value) {\n\tif (!(this instanceof MapEntry))\n\t\treturn new MapEntry(key, value);\n\n\tthis.key = key;\n\tthis.value = value;\n}", "title": "" }, { "docid": "a7e812733a133aed343f211eda482077", "score": "0.4882101", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "a7e812733a133aed343f211eda482077", "score": "0.4882101", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "a7e812733a133aed343f211eda482077", "score": "0.4882101", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "a7e812733a133aed343f211eda482077", "score": "0.4882101", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "a7e812733a133aed343f211eda482077", "score": "0.4882101", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.4879474", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.4879474", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.4879474", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.4879474", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "761a7d3bfd1f1c7f3af5bb70a6e98296", "score": "0.48794076", "text": "function MapEntry$1(key, value) {\n\tif (!(this instanceof MapEntry$1))\n\t\treturn new MapEntry$1(key, value);\n\n\tthis.key = key;\n\tthis.value = value;\n}", "title": "" }, { "docid": "03581e33598d1c81771048b7258e6510", "score": "0.48646852", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "03581e33598d1c81771048b7258e6510", "score": "0.48646852", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "03581e33598d1c81771048b7258e6510", "score": "0.48646852", "text": "_saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }", "title": "" }, { "docid": "5053b25381eb9cdcab50d65c77987473", "score": "0.48612538", "text": "function MatchingMap() {\n // Note: identityTable and prototypeTable are object-keyed maps; they don't\n // especially need to be weak (but that doesn't hurt either).\n var identityTable = new WeakMap();\n var lastPathElementTable = Object.create(null);\n var suffixTable = [];\n var prototypeTable = new WeakMap();\n var specialCases = [];\n\n var self = this;\n\n function setByIdentity(obj, value) {\n switch (typeof obj) {\n case 'object':\n case 'function':\n identityTable.set(obj, value);\n break;\n case 'undefined':\n // TODO(kpreid): make this looseness optional, so things which\n // aren't optional aren't subject to lack of typo checking\n return;\n default:\n throw new TypeError('setByIdentity: key is not an object: ' + obj);\n }\n }\n\n function setByPropertyName(name, value) {\n lastPathElementTable[name] = value;\n }\n\n function setByPathSuffix(name, value) {\n suffixTable.push([name, value]);\n }\n\n function setByConstructor(ctor, value) {\n prototypeTable.set(ctor.prototype, value);\n }\n\n /** Use a Ref object to add to this map. */\n function set(ref, value) {\n ref.putInMap(self, value);\n }\n\n /** Shorthand for this.set(ref, true) for boolean-valued maps. */\n function mark(ref) {\n set(ref, true);\n }\n\n /**\n * Add a function which will be called to try to obtain a value.\n */\n function addSpecialCase(fn) {\n specialCases.push(fn);\n }\n\n function get(context) {\n var obj = context.get();\n var path = context.getPath();\n var value, m;\n\n if ((value = identityTable.get(obj))) {\n return value;\n }\n\n if ((m = /\\.([^.]+)$/.exec(path)) &&\n Object.prototype.hasOwnProperty.call(lastPathElementTable, m[1])) {\n return lastPathElementTable[m[1]];\n }\n\n if ((m = suffixTable.filter(function(record) {\n return isSuffix(record[0], path);\n })).length) {\n if (m.length > 1) {\n debugger;\n throw new Error('Suffix conflict (' + path + '): ' + m);\n }\n return m[0][1];\n }\n\n for (var proto = Object.getPrototypeOf(obj);\n proto !== null;\n proto = Object.getPrototypeOf(proto)) {\n if ((value = prototypeTable.get(proto))) {\n return value;\n }\n }\n\n for (var i = 0; i < specialCases.length; i++) {\n if (value = specialCases[i].call(undefined, context)) {\n return value;\n }\n }\n\n return undefined;\n }\n\n this.get = get;\n this.setByIdentity = setByIdentity;\n this.setByPropertyName = setByPropertyName;\n this.setByPathSuffix = setByPathSuffix;\n this.setByConstructor = setByConstructor;\n this.set = set;\n this.mark = mark;\n this.addSpecialCase = addSpecialCase;\n }", "title": "" }, { "docid": "1f6933b5e54edf005059e17a703b6136", "score": "0.48535258", "text": "getNativeMap() { return this._map; }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.48509988", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "3d482bcd1802cc17de10c6b1faf33c9a", "score": "0.48335087", "text": "function trackInstancesOfComponent(Component, instances) {\n var originalMountHandler = Component.prototype.componentDidMount;\n var originalUnmountHandler = Component.prototype.componentWillUnmount;\n Component.prototype.componentDidMount = function () {\n instances.push(this);\n originalMountHandler.apply(this, arguments);\n };\n Component.prototype.componentWillUnmount = function () {\n instances.splice(instances.indexOf(this), 1);\n originalUnmountHandler.apply(this, arguments);\n };\n}", "title": "" }, { "docid": "042c5e3dd0fddde6bf74e0df007772e7", "score": "0.48155564", "text": "getReactInstance (node) { \r\n\t\treturn node[Object.keys(node).find((key) => key.startsWith(\"__reactInternalInstance\"))];\r\n\t}", "title": "" }, { "docid": "01306b08f04943be7c82dd9f6caee823", "score": "0.4813588", "text": "function comm_map_struct(key, value) { \n this.key = key; \n this.value = value; \n }", "title": "" }, { "docid": "1ed9729ea9e264e1d12a9f4da4078336", "score": "0.48077253", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "d42007467f48215f69150557d6e9ac97", "score": "0.47979328", "text": "function makeInstanceFn ( aMap, argOptionMap ) {\n // == BEGIN MODULE SCOPE VARIABLES ===================================\n var\n // Set app symbols\n aKey = aMap._aKey_,\n nMap = aMap._nMap_,\n subName = '_05_css_',\n vMap = aMap._vMap_,\n\n // Set object symbols\n utilObj = aMap._01_util_,\n logObj = utilObj._getLogObj_(),\n storeObj = vMap._localStoreObj_,\n\n // Set function symbols\n logFn = logObj._logMsg_,\n castIntFn = utilObj._castInt_,\n\n // Set number symbols\n __n1 = nMap._n1_,\n __0 = nMap._0_,\n\n // Set scalar symbols\n __false = vMap._false_,\n __true = vMap._true_,\n __undef = vMap._undef_,\n\n // Set module config and state maps\n stateMap = {\n _is_ready_ : __false,\n _palette_idx_ : __undef\n },\n\n instanceMap, optionMap\n ;\n // == . END MODULE SCOPE VARIABLES ===================================\n\n // == BEGIN UTILITY METHODS ==========================================\n // == . END UTILITY METHODS ==========================================\n\n // == BEGIN DOM METHODS ==============================================\n // == . END DOM METHODS ==============================================\n\n // == BEGIN PUBLIC METHODS ===========================================\n // BEGIN public method /getPaletteCount/\n function getPaletteCount () {\n var\n palette_map_list = aMap._05_02_css_base_._paletteMapList_;\n return palette_map_list[ vMap._length_ ];\n }\n\n // . END public method /getPaletteCount/\n\n // BEGIN public method /getPaletteMixinMap/\n function getPaletteMixinMap () {\n var\n palette_map_list = aMap._05_02_css_base_._paletteMapList_,\n palette_idx = stateMap._palette_idx_;\n return palette_map_list[ palette_idx ];\n }\n\n // . END public method /getPaletteMixinMap/\n\n // BEGIN public method /setPaletteIdx/\n function setPaletteIdx ( arg_idx ) {\n var\n idx = utilObj._castInt_( arg_idx, 0 ),\n palette_map_list = aMap._05_02_css_base_._paletteMapList_,\n palette_count = palette_map_list[ vMap._length_ ],\n\n palette_idx, palette_mixin_map;\n\n // Return current palette index if request is out of range\n // or matches existing.\n if ( idx === stateMap._palette_idx_\n || idx > palette_count || idx < __0\n ) {\n return stateMap._palette_idx_;\n }\n\n // Get the mixin map for the requested idx. If no map exists,\n // use the first palette map (0).\n palette_idx = idx;\n palette_mixin_map = palette_map_list[ palette_idx ];\n if ( !palette_mixin_map ) {\n palette_idx = __0;\n palette_mixin_map = palette_map_list[ __0 ] || {};\n }\n\n // Set the cascade and safe state. Return current them index.\n xhiCSS._setCascade_( {\n _cascade_id_ : '_c01_',\n _mode_str_ : '_change_',\n _mixin_map_ : palette_mixin_map,\n _regen_type_ : '_use_'\n } );\n stateMap._palette_idx_ = palette_idx;\n return palette_idx;\n }\n\n // . END public method /setPaletteIdx/\n\n // BEGIN utility /initPaletteMap/\n // Summary : initPaletteMap( <arg_idx> ];\n // Purpose : Initialize palette_map in the following priority:\n // 1. Parameter specifying argument: palette_list[ <arg_idx> ]\n // 2. Local store map: Localstorage.<key>-_palette_map_\n // 3. Local store index: palette_list[ Localstorage.<key>-_palette_idx_ ]\n // 4. Default index (0)\n // Example : var palette_map = initPaletteMap();\n // Arguments : ( positional )\n // 0. arg_idx : (optional) Override palette index to use\n // In the future we may also support an explicit map.\n // Settings : Uses stateMap and configMap from context.\n // Returns : undef\n // Throws : none\n //\n function initPaletteMap ( arg_palette_idx ) {\n var\n input_palette_idx = castIntFn( arg_palette_idx, __n1 ),\n local_map_key = aKey + '-_palette_map_',\n local_idx_key = aKey + '-_palette_idx_',\n palette_map_list = aMap._05_02_css_base_._paletteMapList_,\n palette_map_count = palette_map_list[ vMap._length_ ],\n\n solve_idx, solve_map,\n local_json, local_idx\n ;\n\n function cleanup_fn () {\n stateMap._palette_idx_ = solve_idx;\n stateMap._palette_map_ = solve_map;\n return solve_map;\n }\n\n // 1. Use parameter specifying argument: palette_list[ <arg_idx> ]\n if ( input_palette_idx > __n1 ) {\n solve_idx = input_palette_idx >= palette_map_count\n ? palette_map_count + __n1 : input_palette_idx\n ;\n solve_map = palette_map_list[ solve_idx ];\n return cleanup_fn();\n }\n\n // 2. Use local store map: Localstorage.<key>-_palette_map_\n if ( storeObj[ vMap._hasOwnProperty_ ]( local_map_key ) ) {\n local_json = storeObj[ local_map_key ];\n try {\n solve_map = vMap._str2dataFn_( local_json );\n }\n catch ( error ) {\n logFn( '_error_', '_cannot_parse_local_palette_json_', error );\n }\n if ( solve_map ) {\n solve_idx = __n1;\n return cleanup_fn();\n }\n }\n\n // 3. Use local store index: Localstorage.<key>-_palette_idx_\n if ( storeObj[ vMap._hasOwnProperty_ ]( local_idx_key ) ) {\n local_idx = castIntFn( storeObj[ local_idx_key ], __0 );\n solve_idx = local_idx > palette_map_count\n ? palette_map_count - 1 : local_idx < __0\n ? __0 : local_idx\n ;\n }\n // 4. Use default index (__0)\n else {\n solve_idx = __0;\n }\n solve_map = palette_map_list[ solve_idx ];\n return cleanup_fn();\n }\n\n // . END utility /initPaletteMap/\n\n // BEGIN public method /initModuleFn/\n function initModuleFn ( arg_palette_idx ) {\n var palette_map;\n if ( stateMap._is_ready_ === __true ) { return; }\n\n palette_map = initPaletteMap( arg_palette_idx );\n xhiCSS._initModule_( { _style_el_prefix_ : aKey } );\n xhiCSS._setGlobalMixinMap_( {\n _mixin_map_ : aMap._05_02_css_base_._globalMixinMap_\n } );\n\n xhiCSS._setVsheet_( {\n _vsheet_id_ : '_base_',\n _mode_str_ : '_add_',\n _selector_list_ : aMap._05_02_css_base_._selectorList_\n } );\n\n xhiCSS._setVsheet_( {\n _vsheet_id_ : '_lb_',\n _mode_str_ : '_add_',\n _selector_list_ : aMap._05_03_css_lb_._selectorList_\n } );\n\n xhiCSS._setVsheet_( {\n _vsheet_id_ : '_shell_',\n _mode_str_ : '_add_',\n _selector_list_ : aMap._05_04_css_shell_._selectorList_\n } );\n\n xhiCSS._setCascade_( {\n _cascade_id_ : '_c01_',\n _mode_str_ : '_add_',\n _vsheet_id_list_ : [ '_base_', '_lb_', '_shell_' ],\n _mixin_map_ : palette_map,\n _regen_type_ : '_use_'\n } );\n stateMap._is_ready_ = __true;\n }\n // . END public method /initModuleFn/\n\n instanceMap = {\n _getCssKeyMap_ : xhiCSS._getCssKeyMap_,\n _getCssValMap_ : xhiCSS._getCssValMap_,\n _getPaletteCount_ : getPaletteCount,\n _getPaletteMixinMap_ : getPaletteMixinMap,\n _setPaletteIdx_ : setPaletteIdx,\n\n _initModuleFn_ : initModuleFn\n };\n\n optionMap = utilObj._castMap_( argOptionMap, {} );\n if ( optionMap._dont_autoadd_ !== __true ) {\n aMap[ subName ] = instanceMap;\n }\n\n return instanceMap;\n // == . END PUBLIC METHODS ===========================================\n }", "title": "" }, { "docid": "78ef0d836e2f1a79ec3fc1285fc0094c", "score": "0.47787744", "text": "function Map() {\n if (this instanceof this.constructor) {\n this._keys = OrderedSet.create();\n this._keys._silenceRemoveDeprecation = true;\n this._values = create['default'](null);\n this.size = 0;\n } else {\n missingNew(\"OrderedSet\");\n }\n }", "title": "" }, { "docid": "78ef0d836e2f1a79ec3fc1285fc0094c", "score": "0.47787744", "text": "function Map() {\n if (this instanceof this.constructor) {\n this._keys = OrderedSet.create();\n this._keys._silenceRemoveDeprecation = true;\n this._values = create['default'](null);\n this.size = 0;\n } else {\n missingNew(\"OrderedSet\");\n }\n }", "title": "" }, { "docid": "e9243be52ced41e7051c5374dffd8f16", "score": "0.4770031", "text": "function Map() {\n if (this instanceof this.constructor) {\n this._keys = OrderedSet.create();\n this._keys._silenceRemoveDeprecation = true;\n this._values = new _emberMetalEmpty_object.default();\n this.size = 0;\n } else {\n missingNew('OrderedSet');\n }\n }", "title": "" }, { "docid": "3bbfd06f46f7430cf045512f14e7027d", "score": "0.47618192", "text": "function mapByRepositoryId(widgetInstances) {\n\n return widgetInstances.reduce((map, widgetInstance) => {\n\n map.set(widgetInstance.repositoryId, widgetInstance)\n return map\n }, new Map())\n}", "title": "" }, { "docid": "2c6378e15581a8abef911ceb0d384179", "score": "0.4744543", "text": "function mapState(state) {\n let obj = {}\n Object.keys(state).forEach((key) => {\n let _key = Array.isArray(state) ? state[key] : key\n let _val = state[key]\n obj[_key] = () => this.state[_val]\n })\n return obj\n}", "title": "" }, { "docid": "d3e75d06610349672c14e6f464e45b9b", "score": "0.4732027", "text": "function mapValue(map, fn) {\n var result = Object.create(null);\n\n for (var _i2 = 0, _objectEntries2 = objectEntries$1(map); _i2 < _objectEntries2.length; _i2++) {\n var _ref2 = _objectEntries2[_i2];\n var _key = _ref2[0];\n var _value = _ref2[1];\n result[_key] = fn(_value, _key);\n }\n\n return result;\n }", "title": "" }, { "docid": "e1e28216fb9f9999817703fa06c09c21", "score": "0.4722566", "text": "function instance(state, methods) {\n let api = {};\n Object.keys(methods).forEach(key => {\n api[key] = methods[key].bind(null, state);\n });\n return api;\n}", "title": "" }, { "docid": "142997823a1ed89c0f09ec42e8660e9c", "score": "0.47184145", "text": "function MapCache(){this.__data__={};}", "title": "" }, { "docid": "142997823a1ed89c0f09ec42e8660e9c", "score": "0.47184145", "text": "function MapCache(){this.__data__={};}", "title": "" }, { "docid": "5116bd27e8e22f57816734019d34be3f", "score": "0.4713342", "text": "function SlowMap() {\n this._m = {};\n}", "title": "" } ]
eb07412c67d32575628a10c59efb1bae
Does the actual refresh
[ { "docid": "ac6bd5293d97a8cd9d64bc066dce27b0", "score": "0.0", "text": "function loadPageData() {\n var $temp = $('<div>');\n\n $temp.load(location.href + ' #mw-content-text', function () {\n var $newContent = $temp.children('#mw-content-text');\n\n if ($newContent.length) {\n $('#mw-content-text').replaceWith($newContent);\n }\n\n ajaxTimer = setTimeout(loadPageData, ajRefresh);\n });\n $temp.remove();\n }", "title": "" } ]
[ { "docid": "391b5e571d38e79d5988b8a2cc123261", "score": "0.83616763", "text": "refresh() {}", "title": "" }, { "docid": "af86c51a19285229126f987eafa422d7", "score": "0.7965547", "text": "function __refresh () {}", "title": "" }, { "docid": "239530c360200a3220f7cf5d10ab3fb7", "score": "0.77011365", "text": "function refresh() {\n\t\t\twindow.location.reload();\n\t\t}", "title": "" }, { "docid": "eb04ab1939e4cdfd2085f1345da295a4", "score": "0.7693463", "text": "refresh() {\n this.__refresh();\n }", "title": "" }, { "docid": "9da00d2e0fbab380129cb0d2e0c00383", "score": "0.7615184", "text": "refresh() {\n this.changed();\n }", "title": "" }, { "docid": "74638acfa0e4305db57e0ddbcf1b7d2e", "score": "0.75975275", "text": "function refresh() {\n window.location.reload();\n }", "title": "" }, { "docid": "1245989bc0b12a2e8655350ea36ae42a", "score": "0.75949365", "text": "doRefresh() {\n this.initPages();\n this.onPageChange(this.currentPage);\n }", "title": "" }, { "docid": "5d9be0ff3e67fc78e561405fedf146d8", "score": "0.75226873", "text": "function refresh() {\n\tlocation.reload();\n}", "title": "" }, { "docid": "042d7d7555d56efdef5c745953721e9f", "score": "0.75156176", "text": "_refresh(){\n this._refreshSize();\n this._refreshPosition();\n }", "title": "" }, { "docid": "632621e2886633817d4372ec469b06cb", "score": "0.74802387", "text": "function refresh()\n{\n\tlocation.reload();\n}", "title": "" }, { "docid": "f602067556bdfe8082d64d259a74e908", "score": "0.7430806", "text": "function refresh() {\n window .location.reload();\n }", "title": "" }, { "docid": "02f41f0e67eeabec9d958009f230314d", "score": "0.7393417", "text": "function refresh(){\n\tlocation.reload();\n}", "title": "" }, { "docid": "d269df3eef2f826be48067fb24d3e46c", "score": "0.7347582", "text": "refresh() {\n this.refresh$.next();\n }", "title": "" }, { "docid": "6607e1172c2f661a870a5d2a479390b4", "score": "0.733608", "text": "function ac_refresh(self, event, kw, src)\n {\n return 0;\n }", "title": "" }, { "docid": "3abab3f8ce3012d8263fb14dec3ee225", "score": "0.7313504", "text": "function handleRefresh(){\n setRefresh(!refresh);\n }", "title": "" }, { "docid": "4ffef84630c351d367684449ee214e9c", "score": "0.73123693", "text": "_onRefresh() {\n this.setState({ refreshing: true });\n this.fetchData().done();\n this.forceUpdate();\n this.setState({ refreshing: false });\n }", "title": "" }, { "docid": "b18556a980e6a024d90aaf5b3938f349", "score": "0.7312131", "text": "function refresh() {\n location.reload();\n}", "title": "" }, { "docid": "e074a804ad7495178fed3a73927829c5", "score": "0.7280745", "text": "refresh(){\n this.load();\n }", "title": "" }, { "docid": "6c794c12701b92a81d15ed898222e529", "score": "0.72806615", "text": "refresh() {\n this.i.sk();\n }", "title": "" }, { "docid": "c22f61c3e695111eee4723914d3b5bbd", "score": "0.72766227", "text": "afterRefresh() {\n this.client.refresh()\n }", "title": "" }, { "docid": "361032b5f31d71d6a97fa3b8de871acd", "score": "0.72637814", "text": "function refresh() {\n\n location.reload();\n\n}", "title": "" }, { "docid": "0e35cc41ba5545cbf5d7151b23a6993e", "score": "0.72419864", "text": "function refresh() {\n\tsetInterval(function() {\n\t\tconsole.log(\"refresh\");\n\t\twindow.location.reload();\n\t}, 20000);\n}", "title": "" }, { "docid": "b1ede19457d66f7e6a3cfc6acad9115a", "score": "0.7212803", "text": "function clearAndRefresh()\n {\n clear();\n refresh();\n }", "title": "" }, { "docid": "b6a0693c64003816c17554fdf4f715ee", "score": "0.7200457", "text": "refresh() {\n this.reset();\n this.loadNext();\n }", "title": "" }, { "docid": "7bdc24775d8eabd7ed697e84fdc538a4", "score": "0.7193113", "text": "function refresh() {\n getDetails();\n}", "title": "" }, { "docid": "6d55177c75eb821a952c0b56717c937a", "score": "0.7181684", "text": "function _refresh() {\r\n server.plugin( gOptions.ajaxIdentifier,\r\n {\r\n pageItems: gOptions.pageItems\r\n }, {\r\n refreshObject: gRegion$,\r\n success: _draw,\r\n loadingIndicator: gChart$,\r\n loadingIndicatorPosition: \"append\"\r\n });\r\n\r\n }", "title": "" }, { "docid": "104dce1d192014276ec1133f82dc28ad", "score": "0.71766627", "text": "function _refresh() {\n server.plugin(\n gOptions.ajaxIdentifier,\n {\n pageItems: gOptions.pageItems\n },\n {\n refreshObject: gRegion$,\n clear: _clear,\n success: _draw,\n error: _debug,\n loadingIndicator: gChart$,\n loadingIndicatorPosition: \"append\"\n }\n );\n }", "title": "" }, { "docid": "4f6d3b0391ac355133ff923af8440577", "score": "0.7175776", "text": "function refresh() {\n\t\t\tlocation.reload(true);\n\t\t\t$state.go(\"updateCoupon\");\n\t\t}", "title": "" }, { "docid": "de71023ac226b7aa6cfec15c8c14f863", "score": "0.71553177", "text": "_onRefresh() {\n\t\tthis.setState({ refreshing: true })\n\t\tthis._checkCache()\n\t}", "title": "" }, { "docid": "9cc5da8fdb03c3f58803713aeee52b7f", "score": "0.7124019", "text": "forceRefresh() {\n this.getUserData()\n }", "title": "" }, { "docid": "879a5090a18cb31f505f50513f07064c", "score": "0.71144783", "text": "refresh(){\n this.dispatcher.dispatch(this._current);\n }", "title": "" }, { "docid": "c22a59b0111bb2568299a76bb6abe037", "score": "0.7099027", "text": "function refresh(){\r\n\twindow.location.reload();\r\n}", "title": "" }, { "docid": "1146768521b4b3178ba1284865002078", "score": "0.70937234", "text": "refresh() {\n // add calls here to refresh any other dynamic component, or a clock, or whatever\n this.getPicklist(this.state.event_code);\n\tthis.getScoutingOutput(this.state.event_code);\n }", "title": "" }, { "docid": "eb6ea002f9329b740fd3900e8a024397", "score": "0.70589703", "text": "refresh()\n\t{\n\t\tthis._onChange(true, true)();\n\t}", "title": "" }, { "docid": "d4ae7ff3ce66f741aa6ab9ec8c252629", "score": "0.70434034", "text": "refresh() {\n window.location.reload();\n }", "title": "" }, { "docid": "fd59c39953dd62016b6fa341f43d370e", "score": "0.7040292", "text": "function clickedRefresh(event) {\n console.log(\"refresh\")\n window.location.reload();\n}", "title": "" }, { "docid": "29432978a9655d5c7a3bfb75258660c6", "score": "0.70298475", "text": "@api refresh() {\n logger(this.log, this.source, 'refreshing');\n refreshApex(this._refreshable);\n }", "title": "" }, { "docid": "e90b44d187f155fee3210ef3951eebca", "score": "0.70293856", "text": "function refresh() {\n loadFriends();\n loadAllEvents();\n loadAllInvites();\n }", "title": "" }, { "docid": "96628a4de93aae0ce43d3d43e42b4a5a", "score": "0.7020152", "text": "@api\n async refresh() {\n this.isLoading = true;\n this.notifyLoading(this.isLoading);\n await refreshApex(this.boats);\n this.isLoading = false;\n this.notifyLoading(this.isLoading);\n }", "title": "" }, { "docid": "ec66eb0fc22ea0e78295b85af2852b0f", "score": "0.70117027", "text": "refreshData() {\n console.log('refresh....')\n }", "title": "" }, { "docid": "92b26366f462df98c6a7ba3950c915c3", "score": "0.6996849", "text": "refresh() {\n this.open();\n }", "title": "" }, { "docid": "86dc9140516666037079da6c59323982", "score": "0.6993708", "text": "function refresh() {\n statisticsRefreshRequest();\n histogramRefreshRequest(function() {\n drawChart(params.h, params.log_scale, extractFormat(params.fmt).toUpperCase());\n });\n window.history.pushState('Object', 'Title', generateUrl(params.fmt, params.log_scale));\n}", "title": "" }, { "docid": "348a1f48d86216dc729d42bb69f2b193", "score": "0.6989408", "text": "function refresh() {\n window.location.reload();\n}", "title": "" }, { "docid": "7ac73bb8d06f1d08351837afd6cb7a86", "score": "0.69789106", "text": "function refreshActivity() {\r\n $rootScope.$broadcast('rfrshAcH', {\r\n data: 'doupdate'\r\n });\r\n }", "title": "" }, { "docid": "646796790be9b4935d6b82e91e4dc490", "score": "0.6964002", "text": "refresh() {\n this.render();\n }", "title": "" }, { "docid": "5a9ed6a96393dd39b84e904d9354deb6", "score": "0.6956256", "text": "deferredRefresh() {\n this.i.deferredRefresh();\n }", "title": "" }, { "docid": "5a9ed6a96393dd39b84e904d9354deb6", "score": "0.6956256", "text": "deferredRefresh() {\n this.i.deferredRefresh();\n }", "title": "" }, { "docid": "851657514d8df4fc6dd9564e9fdb6772", "score": "0.6950158", "text": "function refresh(){\n setTimeout(function(){document.location = '/dev/db/repmgr';}, timeout);\n}", "title": "" }, { "docid": "f359a796c280887171801fd9f42a1217", "score": "0.6947596", "text": "refresh() {\n this.render(this.domID);\n }", "title": "" }, { "docid": "75ec61c464007c2573d44d93845b5189", "score": "0.69409645", "text": "function refresh () {\n\t\t\t// If the ticker is not running already...\n\t\t\tif (ticker === 0) {\n\t\t\t\t// Let's create a new one!\n\t\t\t\tticker = self.setInterval(render, Math.round(1000 / 30));\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "facf725c2e60afddcc1ec132e5eaa9e1", "score": "0.69307745", "text": "function _refresh() {\r\n _ajax( 1 ); // Get the first record\r\n }", "title": "" }, { "docid": "b340c859eb585cbd53f212b88341ea15", "score": "0.6928174", "text": "function forceRefresh() {\n window.location.reload();\n}", "title": "" }, { "docid": "94b9e863ecef8480f11142703a849666", "score": "0.69274896", "text": "function reload() {\n getData(_curPage);\n}", "title": "" }, { "docid": "77ec748f1eabc32f4c2385f57ddf6bee", "score": "0.69213074", "text": "function refreshPage() {\n ctrl.isLoading = true;\n ctrl.isAlertShowing = false;\n\n $state.reload();\n }", "title": "" }, { "docid": "aa6ec6d19d25f69cb12362790cce9e69", "score": "0.6913172", "text": "@api \n async refresh() { \n \n this.isLoading = true;\n this.notifyLoading(true); \n refreshApex(this.boats);\n this.isLoading = false;\n this.notifyLoading(false); \n \n }", "title": "" }, { "docid": "ed3f5b75c0589fa772b082b96e577728", "score": "0.6906534", "text": "reload() {\n if (this.maxIndex > 0) {\n this.View.clearCanvas();\n this.doLoad(LOAD_RELOAD);\n }\n }", "title": "" }, { "docid": "e8e56d6726f15a720c089f9cfbd171cb", "score": "0.6905069", "text": "function refresh() {\n\n // check wether to refresh child or parent page\n if (APP.views.hasChildPage()) {\n\n page(child, APP.dom.childView, true);\n\n } else if (APP.modal.status()) {\n\n page(modal, APP.dom.modalView, true);\n\n } else {\n\n page(parent, APP.dom.parentView, true);\n }\n }", "title": "" }, { "docid": "6c46050ab92bc86da3fb8ac07c1f1e8f", "score": "0.68994564", "text": "refresh() {\n em.refreshCanvas();\n }", "title": "" }, { "docid": "527bb4d42dd9addd2a7f2301dc48d581", "score": "0.6889392", "text": "reload() {\n if (!this.isReloading && this.reloadTime > 0) {\n this.isReloading = true;\n this.time = 0;\n this.reloadBar = 0;\n }\n }", "title": "" }, { "docid": "d007e55b12a173c2b01da50f9b5d3916", "score": "0.6889198", "text": "function refreshData()\r\n\t\t{\r\n\t\t\tif(pollTimeout!==null)\r\n\t\t\t{\r\n\t\t\t\t//make poll and refresh button inactive\r\n\t\t\t\tbtnPoll.attr(\"disabled\", \"disabled\");\r\n\t\t\t\tbtnRefresh.attr(\"disabled\", \"disabled\");\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$j(\"div#progressbar\").progressbar(\"option\",\"value\",false);\r\n\r\n\t\t\t//get selected task\r\n\t\t\tvar taskID=$j(\"#task\").val();\r\n\t\t\t\r\n\t\t\t//parameterise url\r\n\t\t\tvar taskDataURL=xmlDataURL.replace(\"$\",taskID);\r\n\t\t\t\r\n\t\t\tif(nextUpdate===null)\r\n\t\t\t{\r\n\t\t\t\tnextUpdate=getStartOfDayInMillisec();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttaskDataURL+=(\"?startTime=\"+nextUpdate);\r\n\t\t\t\r\n\t\t\tnextUpdate=new Date().getTime();\r\n\r\n\t\t\t//retrieve xml data from server\r\n\t\t\tdisplayTechnicalInfo(getFormattedTime()+\"fetching data from server...\");\r\n\t\t\tloadXMLDocAsync(taskDataURL,refreshData2,5000);\t\t\r\n\t\t}", "title": "" }, { "docid": "83fa706f7dac616615236fd87c3e66f6", "score": "0.6886157", "text": "function refreshData (){\n\t\t\t\tconsole.log(\"Refrescando la data...\");\n\t\t\t\treadData();\t\n\t\t\t\treadDataProfile();\n\t\t\t\tlimpiarCampos();\t\t\t\n\t\t\t}", "title": "" }, { "docid": "0c3a2313e34ce4df04c3cdcf35643440", "score": "0.68777144", "text": "function refresh(){\n window.location.reload();\n}", "title": "" }, { "docid": "0c3a2313e34ce4df04c3cdcf35643440", "score": "0.68777144", "text": "function refresh(){\n window.location.reload();\n}", "title": "" }, { "docid": "83e09b1d7195d64c77d347d87d854a8b", "score": "0.68771046", "text": "function refresh(){\n window.location.reload()\n}", "title": "" }, { "docid": "60167f8d3326c3af55262e6227fd623b", "score": "0.685689", "text": "function refresh(){\r\n window.location.reload(false);\r\n}", "title": "" }, { "docid": "05a48c9ec97c41b070f8202c11eb535e", "score": "0.6838978", "text": "@api\n async refresh() {\n this.notifyLoading(true);\n await refreshApex(this.boatsRefresh);\n this.notifyLoading(false);\n }", "title": "" }, { "docid": "513ab9cb6718fdf25b7c49a3b835cc11", "score": "0.68323165", "text": "function refresh_content() {\n $('.refresh').on('click', function() {\n show_content();\n });\n }", "title": "" }, { "docid": "d04d94a98971e1e34582b30673068cec", "score": "0.68164945", "text": "function refreshExecutionList() {\n self.fetchExecutionList();\n self.fetchInstanceDetail();\n getRefresedTime();\n }", "title": "" }, { "docid": "c28a87056098d3b924115d289b8b6b75", "score": "0.6814075", "text": "_onRefresh (){\n this.setState({isRefreshing: true, shouldPrepend: true});\n this._fetchFeed(REFRESHING_FEED);\n this.setState({isRefreshing: false,});\n }", "title": "" }, { "docid": "c1a6b621565e9b40587ea9d8a963c969", "score": "0.6810207", "text": "onRefresh() {\n this.store.subscribe(s => {\n this.dashboardId = s.dashboardState.dashboardId;\n this.mode = s.dashboardState.dashboardMode;\n if (this.mode == \"show\")\n this.draggable = false;\n this.getWidgets();\n });\n }", "title": "" }, { "docid": "96c2102e2614c4de4f14372f92ba9d7c", "score": "0.6807233", "text": "refresh() {\n this.enter('refreshing');\n this._trigger('refresh');\n this._defineSlidesData();\n this.setOptionsForViewport();\n this._optionsLogic();\n // this.$element.addClass(this.options.refreshClass);\n this.update();\n // this.$element.removeClass(this.options.refreshClass);\n this.leave('refreshing');\n this._trigger('refreshed');\n }", "title": "" }, { "docid": "96c2102e2614c4de4f14372f92ba9d7c", "score": "0.6807233", "text": "refresh() {\n this.enter('refreshing');\n this._trigger('refresh');\n this._defineSlidesData();\n this.setOptionsForViewport();\n this._optionsLogic();\n // this.$element.addClass(this.options.refreshClass);\n this.update();\n // this.$element.removeClass(this.options.refreshClass);\n this.leave('refreshing');\n this._trigger('refreshed');\n }", "title": "" }, { "docid": "26a0bde8966cbde7c7d5207e6e7e8188", "score": "0.6797848", "text": "function refresh() {\n //made a refresh function to attached to the replay button\n location.reload(); //targeting the location object and using its reload method to refresh page\n}", "title": "" }, { "docid": "a5702445f0e1b92c173ed48078ca18db", "score": "0.67899984", "text": "refresh() {\n // FIXME: Maybe creating ListManager and BoardManager is better than this...\n if (this.refreshTimeoutId) {\n this.refreshTimeoutId = null;\n this.refresh();\n } else {\n this.refreshTimeoutId = setTimeout(() => {\n const renderItems = this.getTimeSummaries();\n this.renderer.render(renderItems);\n this.refreshTimeoutId = null;\n }, REFRESH_DURATION);\n }\n }", "title": "" }, { "docid": "e610ca568b1d894e7bb5c73198fe165a", "score": "0.67840767", "text": "function refresh () {\r\n\t\t// If the ticker is not running already...\r\n\t\tif (ticker === 0) {\r\n\t\t\t// Let's create a new one!\r\n\t\t\tticker = self.setInterval(render, Math.round(1000 / 60));\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "dcadcad06ba133e9ee89104c6ecc9ef1", "score": "0.6783633", "text": "function refreshPage() {\n window.location.reload(true);\n }", "title": "" }, { "docid": "f65ab3b49b54caebb5a889a2ac1e1a3d", "score": "0.67828643", "text": "function refresh() {\n var vp = viewport();\n if (vp) {\n // check that the offset is within bounds\n if (offsetMaxX || offsetMaxY) {\n constrainOffset(vp);\n } // if\n \n // update the last refresh x and y\n refreshX = offsetX;\n refreshY = offsetY;\n \n // trigger the refresh event\n _this.trigger('refresh', _this, vp);\n \n // invalidate\n viewChanges++;\n } // if\n }", "title": "" }, { "docid": "a367fbecd3cbc9ea72134948fbb41d4a", "score": "0.67824894", "text": "function refreshData(){\r\n\tupdateEthAccount();\r\n\tupdateGodRound();\r\n\tupdateGodPot();\r\n\tupdateRoundPot();\r\n\tupdatePharaoh();\r\n\tupdateGodTimer();\r\n\tupdatePharaohReq();\r\n\tupdateMaxSnail();\r\n\tupdateContractBalance();\r\n\tupdateFrogPot();\r\n\tupdateSnailPot();\r\n\tupdatePlayerSnail();\r\n\tupdateTokenPrice();\r\n\tupdatePlayerSnailValue();\r\n\tupdateTokenSellPrice();\r\n\tupdateMaxSnailSell();\r\n\tupdatePlayerEgg();\r\n\tupdatePlayerProd();\r\n\tupdateHatchPrice();\r\n\tupdateFullHatchCost();\r\n\tupdateFeedReward();\r\n\tupdateFullFeedReward();\r\n\tupdateUnclaimedDiv();\r\n\tupdatePlayerEarning();\r\n\tupdatePlayerRef();\r\n\tupdateButton();\r\n\t//runLog();\r\n}", "title": "" }, { "docid": "bd38ebd93a444deff290e9b5ac6ca7cd", "score": "0.6775445", "text": "refreshUpdateStatus() {}", "title": "" }, { "docid": "b11ad3283e1aef17be3ee0f2bc875381", "score": "0.67589337", "text": "function refreshAll() {\n refreshDisplay();\n refreshChart();\n color_timer();\n }", "title": "" }, { "docid": "68ede466d0e4f2ecc070ca473fb38145", "score": "0.67567784", "text": "function refreshHome() {\n setRefresh(!refresh);\n }", "title": "" }, { "docid": "fe815a0d6caf66ad64eb8bc9a199df2f", "score": "0.6725987", "text": "function refreshData() {\n invalidateLocalDataCache();\n updateAllData();\n}", "title": "" }, { "docid": "b3a5578b6556645085f5c242a789abf1", "score": "0.6714164", "text": "_einblenden(){\n location.reload();\n }", "title": "" }, { "docid": "e7c8110352ab888b4b68bfab12e9c98d", "score": "0.6712434", "text": "function runClear() {\n location.reload();\n}", "title": "" }, { "docid": "c72e53aef42bf70e96cf0807c08ca10f", "score": "0.668767", "text": "function refresh(){\r\n\t\t$(\"#inputpicture\").css(\"display\", \"none\");\r\n\t\t$(\"#message\").val(\"\");\r\n\t\t$(\"#foto\").attr(\"src\",\"\");\r\n\t\tresizedImage = \"\";\r\n\t\tcamera_state = false;\r\n\t\t$(\"#modalevent\").css(\"display\", \"none\");\r\n\t\t$(\"#megacontainer\").empty();\r\n\t\tgetEvents(localStorage.getItem(\"mail\"), localStorage.getItem(\"token\"), 5);\r\n\t}", "title": "" }, { "docid": "c4062513f24336c6059e683163bc3d5d", "score": "0.668357", "text": "function calendarRefresh()\n {\n setQueryParams();\n populatePartitionValues();\n populateExpectedPartitionValues();\n getBusinessObjectDataAvailabilities();\n }", "title": "" }, { "docid": "885d09bbcb14191f63b1a392446fc1c8", "score": "0.66785216", "text": "function updateWidget() {\n window.location.reload();\n}", "title": "" }, { "docid": "755108b32a3925a966afce2b0f39c737", "score": "0.667603", "text": "function refresh(){\n appResource.searchByName({ \n query : $scope.searchbox, \n facetFilters: queryHelper.getFacetFilters($scope.filters, facets), \n hitsPerPage: 15, \n page: $scope.filters.page, \n indexSource: queryHelper.chooseSource($scope.filters.ascendantSort) \n }).$promise\n .then(function searchSuccess(content) {\n $scope.results = content;\n $scope.nbPages = content.nbPages;\n\n //little trick to improve a liitle bit the DOM image refresh effect on user \n //and prevents picture from loading from top to bottom\n\n $scope.results.hits.map(function(hit) {\n //$timeout 0 triggered when DOM loaded so we can getElementById\n $timeout(function(){\n var img = getImage(hit);\n\t\t\t\t\t\tif(!document.getElementById(hit.objectID).hasChildNodes())\n\t\t\t\t\t\tdocument.getElementById(hit.objectID).appendChild(img);\n },0);\n });\n\n });\n }", "title": "" }, { "docid": "694171aad53ad6900afe9d6b9dfc7ddd", "score": "0.6674325", "text": "function refreshRace(reload) {\n window.location.hash = '#barchart_div';\n window.location.reload(true);\n }", "title": "" }, { "docid": "12221ada34081ebb4507a3b233ae8a33", "score": "0.66730756", "text": "function AutoRefresh(t) {\n setTimeout(\"location.reload();\", t);\n}", "title": "" }, { "docid": "23c52bc37227769ed5545294f131ea13", "score": "0.66675", "text": "function refresh() {\n\tif(window.carecompassIsLoaded == false && Patients.patientsLimitExceeded == false) {\n\t\treturn;\n\t}\n\n\tCareCompass.cleanUp();\n\tTimers.cleanUp();\n\n\twindow.carecompassIsLoaded = false;\n\tTimers.start(\"USR:CareCompass.Refresh\")\n\tif(ReviewDialog.container) {\n\t\tReviewDialog.hideOverlay();\n\t}\n\tif(ErrorScreen.isDisplayed())\n\t{\n\t\tErrorScreen.hide();\n\t}\n\tif(RelationshipDialog.container) {\n\t\tRelationshipDialog.hideOverlay();\n\t}\n\n\tif(DeveloperModeDialog.container) {\n\t\tDeveloperModeDialog.hideOverlay();\n\t}\n\tPatients.sorted = false;\n\tNewDataMenu.remove();\n\tRightClickMenu.remove();\n\tPatientDrillDown.remove();\n\tActivityListRightClickMenu.remove();\n\tPrnListRightClickMenu.remove();\n\tPatientTable.hideRowHovers();\n\tActivitiesPopOver.hide();\n\tQualityMeasurePopover.hide();\n\tPopover.remove();\n\tPatientLists.refresh();\n\tToolbar.setFocus();\n}", "title": "" }, { "docid": "6ae62de30eee78153c3dd7a92c26f3bb", "score": "0.66517675", "text": "refresh(display) {}", "title": "" }, { "docid": "c6e7d9a8cbde58f0d4987e9ad3ae394d", "score": "0.66505784", "text": "function severRefresh(newValue) {\n if (newValue) {\n if (datacontext.updateList().employee()) {\n refreshPage();\n }\n datacontext.completedRefresh();\n }\n }", "title": "" }, { "docid": "978d13ecc88dcd8f446698edf31a0c59", "score": "0.66440153", "text": "refresh() {\n updateSliderInfoFields();\n this.compares = 0;\n this.swaps = 0;\n this.startTime = performance.now();\n }", "title": "" }, { "docid": "274e91cd3c7d8a19cd876b122a402fb9", "score": "0.66409826", "text": "handleRefreshView() {\n this.template.querySelector('c-formula-share-rules-page-subheader').refreshView();\n }", "title": "" }, { "docid": "4e5af3725700be7ac20a8d1357cea940", "score": "0.6637528", "text": "function pageRefresh(){\n location.reload();\n bannerFocus.setAttribute(\"tabindex\", 1);\n bannerFocus.focus();\n }", "title": "" }, { "docid": "8bce5461829894ed7757abc4e6afe00d", "score": "0.66312796", "text": "function doRefresh()\n{\n\tJukeBoxRoomFromParse.fetch({\n\t\tsuccess: function (theRoom) {\n\t\t\tJukeBoxRoomFromParse = theRoom;\n\t\t\tjukeBoxObj.queue = theRoom.get(\"queue\");\n\t\t\tjukeBoxObj.objectId = theRoom.id;\n\t\t\t\n\t\t\tupdatePageWithQueue();\n\t\t},\n\t\terror: function(error) {\n\t\t\t\n\t\t}\n\t});\n}", "title": "" }, { "docid": "0cf91cd7d79dacc671ba25299698be80", "score": "0.66307545", "text": "refreshDisplay() {\n\t\tconsole.log(\"App.refreshDisplay called for dapp_app\");\n\t\t\n\t\t\n\t\t// reload current state\n\t\t//var $injector = $scope.injectorforrefresh\n\t\tvar $injector = this.getAngularInjector();\n\t\t\n\t\tif ($injector) {\n\t\t\t//console.log('injector properties ' + Object.getOwnPropertyNames($injector));\n\t\t\t\n\t\t\tvar $state = $injector.get('$state');\n\t\t\t$state.reload();\n\n\t\t\t//window.location.reload();\n\t\t\t// forces a complete reload\n\t\t}\n\t\t\n\t\t\n\t\treturn;\n\t\t\n\t}", "title": "" }, { "docid": "f2aa5a2ef815370709214f8316f234ee", "score": "0.66213703", "text": "function reload() {window.location.reload()}", "title": "" }, { "docid": "6ddcb005d3833ee519f83a3fdaebd354", "score": "0.66101545", "text": "start() {\n this.scheduleRefresh();\n this.refresh();\n }", "title": "" }, { "docid": "b238a071a25ff9835e55eb32b4146dea", "score": "0.6607429", "text": "function timedRefresh(timeoutPeriod) {\n setTimeout(\"location.reload(true);\",timeoutPeriod);\n }", "title": "" } ]
bed61a5a2d5d99571a3c47f85b314a39
at this point, the user has presumably seen the 'readable' event, and called read() to consume some data. that may have triggered in turn another _read(n) call, in which case reading = true if it's in progress. However, if we're not ended, or reading, and the length < hwm, then go ahead and try to read some more preemptively.
[ { "docid": "73c963be716f781b3cd131d289cf5fd8", "score": "0.0", "text": "function maybeReadMore$1(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n nextTick(maybeReadMore_$1, stream, state);\n }\n}", "title": "" } ]
[ { "docid": "2b660d69b985da5cf9746bd1aa20485a", "score": "0.7302334", "text": "_read() {\r\n\t\tthis._readingPaused = false\r\n\t\tsetImmediate(this._onReadable.bind(this))\r\n\t}", "title": "" }, { "docid": "36954bace936995643dfb2159db18efc", "score": "0.69761795", "text": "_onReadable() {\r\n\t\t// Read all the data until one of two conditions is met\r\n\t\t// 1. there is nothing left to read on the socket\r\n\t\t// 2. reading is paused because the consumer is slow\r\n\t\twhile (!this._readingPaused) {\r\n\t\t\t// First step is reading the 32-bit integer from the socket\r\n\t\t\t// and if there is not a value, we simply abort processing\r\n\t\t\tlet lenBuf = this._socket.read(4)\r\n\t\t\tif (!lenBuf) return\r\n\r\n\t\t\t// Now that we have a length buffer we can convert it\r\n\t\t\t// into a number by reading the UInt32BE value\r\n\t\t\t// from the buffer.\r\n\t\t\tlet len = lenBuf.readUInt32LE()\r\n\t\t\t// ensure that we don't exceed the max size of 256KiB\r\n\t\t\tif (len > 2 ** 18) {\r\n\t\t\t\tthis.socket.destroy(new Error('Max length exceeded'))\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\t// With the length, we can then consume the rest of the body.\r\n\t\t\tlet body = this._socket.read(len)\r\n\r\n\t\t\t// If we did not have enough data on the wire to read the body\r\n\t\t\t// we will wait for the body to arrive and push the length\r\n\t\t\t// back into the socket's read buffer with unshift.\r\n\t\t\tif (!body) {\r\n\t\t\t\tthis._socket.unshift(lenBuf)\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\t// Try to parse the data and if it fails destroy the socket.\r\n\t\t\tlet json\r\n\t\t\ttry {\r\n\t\t\t\tlet message = Buffer.from(body).toString('utf8')\r\n\t\t\t\tif (this.encrypted) {\r\n\t\t\t\t\tmessage = decrypt(this.shkey, message)\r\n\t\t\t\t}\r\n\t\t\t\tjson = JSON.parse(message)\r\n\t\t\t} catch (ex) {\r\n\t\t\t\tthis._socket.destroy()\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\t// Push the data into the read buffer and capture whether\r\n\t\t\t// we are hitting the back pressure limits\r\n\t\t\tlet pushOk = this.push(json)\r\n\r\n\t\t\t// When the push fails, we need to pause the ability to read\r\n\t\t\t// messages because the consumer is getting backed up.\r\n\t\t\tif (!pushOk) this._readingPaused = true\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e914602b9b639e9cea78158dc61c1275", "score": "0.6770317", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}", "title": "" }, { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6745738", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6745738", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "b9507326e6c08977d9affa20e7d6c660", "score": "0.674331", "text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "b9507326e6c08977d9affa20e7d6c660", "score": "0.674331", "text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "71fc27c40faa8edcede65719ec275077", "score": "0.67224264", "text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\n\tif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\n\tif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\n\tif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "e3f466b9409f5a0a6936eb1ccc14c5b7", "score": "0.66901565", "text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\n if(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\n if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\n if(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "b3bd062cd0a7cb4a4a9c093337370117", "score": "0.6663776", "text": "function $SYhk$var$howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = $SYhk$var$computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "e565f8ee7bda70dbfad6d8128ad68d46", "score": "0.6655049", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "18427f2d3d1c867c901f2b6538e7ac86", "score": "0.66193265", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "b7c85b0955a19dad7964dc867fbf85be", "score": "0.65670925", "text": "function $Fj4k$var$howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = $Fj4k$var$computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "9bb4ffd43e78855babfd661b34bb455d", "score": "0.65005785", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}", "title": "" }, { "docid": "5a71ad436419063f53a02dfa66b013fc", "score": "0.6499846", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}", "title": "" }, { "docid": "5a71ad436419063f53a02dfa66b013fc", "score": "0.6499846", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}", "title": "" }, { "docid": "609351c71b640a50894a5c0984fa2a9d", "score": "0.64841515", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}// backwards compatibility.", "title": "" }, { "docid": "c6e08050558e13ac46b3de2340fb8da9", "score": "0.6468286", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || (state.length === 0 && state.ended)) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length)\n return state.buffer.head.data.length;\n else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n if (n > state.highWaterMark)\n state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n } // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "a81349fe9b6a8135e3389bd25e00ec97", "score": "0.64663893", "text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){\n// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length}\n// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;\n// Don't have enough\nif(!state.ended){state.needReadable=true;return 0}return state.length}", "title": "" }, { "docid": "7930264f2e16cba8a3b729d3cc2c90a8", "score": "0.6382496", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63821316", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "5a0cbac0cff5e5c0fc8a4b29a050b527", "score": "0.63526386", "text": "function howMuchToRead$1(n, state) {\n\t if (n <= 0 || state.length === 0 && state.ended) return 0;\n\t if (state.objectMode) return 1;\n\n\t if (n !== n) {\n\t // Only flow one buffer at a time\n\t if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n\t } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n\t if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark$1(n);\n\t if (n <= state.length) return n; // Don't have enough\n\n\t if (!state.ended) {\n\t state.needReadable = true;\n\t return 0;\n\t }\n\n\t return state.length;\n\t} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "70715f2a0bf707809ab80c27076f02ad", "score": "0.6351698", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "64206293ec74f224b6e3a9eaae07c78c", "score": "0.63440955", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63346213", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.6330073", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.6330073", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.6330073", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.6330073", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" } ]
9fba36a31b4b0723462ee64881c817d6
sets player choice to Rock, generates CPU move, and runs game logic
[ { "docid": "f9cba7651e4d330c06045de47d1e2019", "score": "0.79648554", "text": "function chooseRock() {\r\n var playerChoice = \"Rock\";\r\n var cpuChoice = generateMove();\r\n\r\n if (playerChoice == \"Rock\" && cpuChoice == \"Rock\") {\r\n victoryText.innerHTML = \"Draw!\";\r\n cpuChoiceOutput.innerHTML = \"Rock\";\r\n userChoiceOutput.innerHTML = \"Rock\";\r\n winLoseFlag = \"D\";\r\n } else if (playerChoice == \"Rock\" && cpuChoice == \"Paper\") {\r\n victoryText.innerHTML = \"You Lose!\";\r\n cpuChoiceOutput.innerHTML = \"Paper\";\r\n userChoiceOutput.innerHTML = \"Rock\";\r\n winLoseFlag = \"L\";\r\n } else if (playerChoice == \"Rock\" && cpuChoice == \"Scissors\") {\r\n victoryText.innerHTML = \"You Win!\";\r\n cpuChoiceOutput.innerHTML = \"Scissors\";\r\n userChoiceOutput.innerHTML = \"Rock\";\r\n winLoseFlag = \"W\";\r\n }\r\n}", "title": "" } ]
[ { "docid": "a2fcb7fcf090ae5e53bd064e1a64e25f", "score": "0.76020926", "text": "function rock(playerSelect){\n playerSelect = 'rock';\n playRound(playerSelect, compSelect());\n}", "title": "" }, { "docid": "0ba56e6f62a60b686367296860c8eeee", "score": "0.7569602", "text": "function playRock() {\r\n\tlet computerSelection = computerPlay();\r\n\tplayGame(\"Rock\", computerSelection);\r\n}", "title": "" }, { "docid": "95bb7642f8aa2918b3ca5e666f01f2ae", "score": "0.74143684", "text": "function rock (){\r\n playerSelection = 'rock';\r\n game(playerSelection);\r\n}", "title": "" }, { "docid": "3879a48ac1e67e283506759bee2a54b9", "score": "0.73650795", "text": "function funcRock() {\n switch (computerSelection) {\n case \"rock\":\n displayCompSelection(computerSelection);\n playRoundResult = \"tie\";\n displayResult(\"Tie, play again!\");\n break;\n case \"paper\":\n displayCompSelection(computerSelection);\n playRoundResult = \"lose\";\n displayResult(\"You lose this round! Paper beats Rock!\");\n break;\n case \"scissors\":\n displayCompSelection(computerSelection);\n playRoundResult = \"win\";\n displayResult(\"You win this round! Rock beats Scissors!\");\n break;\n }\n }", "title": "" }, { "docid": "1ab3088da363d613971c16ebb28e6d26", "score": "0.73630774", "text": "function playRock() {\r\n playerMove = \"rock\";\r\n playGame();\r\n}", "title": "" }, { "docid": "5926f36d0a29257f3ccd2ff43b6da105", "score": "0.71794987", "text": "function playRound(playerSelection,computerSelection){\n computerSelection = computerPlay();\n playerSelection = userPlay();\n // console.log(computerSelection);\n console.log(`Computer chooses ${rpc[computerSelection]}`);\n console.log(`Player chooses ${playerSelection}`);\n // console.log(rpc[computerSelection]+playerSelection);\n switch(rpc[computerSelection] + playerSelection){\n case 'rockrock':\n case 'scissorsscissors':\n case 'paperpaper':\n console.log('TIE!');\n break;\n case 'rockscissors':\n case 'paperrock':\n case 'scissorspaper':\n computerScore++;\n console.log('YOU LOSE!');\n break;\n default:\n playerScore++;\n console.log('YOU WIN!');\n \n }\n}", "title": "" }, { "docid": "b4c0e5f00127a6827c1c7d527fdaa00e", "score": "0.71195424", "text": "function playGame(userSelect) {\n const compSelect = compRandom()\n switch (userSelect + compSelect) {\n case \"RockScissor\":\n case \"PaperRock\":\n case \"ScissorPaper\":\n win(userSelect, compSelect)\n break\n case \"RockPaper\":\n case \"PaperScissor\":\n case \"ScissorRock\":\n lose(userSelect, compSelect)\n break\n case \"RockRock\":\n case \"PaperPaper\":\n case \"ScissorScissor\":\n draw(userSelect, compSelect)\n break\n }\n if (round === maxRound) {\n gameEnd()\n }\n round++\n currentRound.innerHTML = round\n}", "title": "" }, { "docid": "a0f95625a6e334d412ab26ed2e0d0069", "score": "0.70962685", "text": "function playerChooseRock() {\r\n\tvar aiChoice = getAiChoice();\r\n\tif (aiChoice == 1) {\r\n\t\tifTie();\r\n\t} else if (aiChoice == 2) {\r\n\t\tifLose();\r\n\t} else {\r\n\t\tifWin();\r\n\t}\r\n}", "title": "" }, { "docid": "bf928bb3db897be50dd12bd6b6b8836e", "score": "0.7071914", "text": "function chooseScissors() {\r\n var playerChoice = \"Scissors\";\r\n var cpuChoice = generateMove();\r\n\r\n if (playerChoice == \"Scissors\" && cpuChoice == \"Scissors\") {\r\n victoryText.innerHTML = \"Draw!\";\r\n cpuChoiceOutput.innerHTML = \"Scissors\";\r\n userChoiceOutput.innerHTML = \"Scissors\";\r\n winLoseFlag = \"D\";\r\n } else if (playerChoice == \"Scissors\" && cpuChoice == \"Rock\") {\r\n victoryText.innerHTML = \"You Lose!\";\r\n cpuChoiceOutput.innerHTML = \"Rock\";\r\n userChoiceOutput.innerHTML = \"Scissors\";\r\n winLoseFlag = \"L\";\r\n } else if (playerChoice == \"Scissors\" && cpuChoice == \"Paper\") {\r\n victoryText.innerHTML = \"You Win!\";\r\n cpuChoiceOutput.innerHTML = \"Paper\";\r\n userChoiceOutput.innerHTML = \"Scissors\";\r\n winLoseFlag = \"W\";\r\n }\r\n}", "title": "" }, { "docid": "515401ab7e2b751df2629834cc5bcd60", "score": "0.7054151", "text": "function playRound(userSelection,cpuSelection) {\r\n\r\n\r\n // round outcomes\r\n if (userSelection === \"rock\") {\r\n if (cpuSelection === \"paper\") {\r\n cpuScore++;\r\n return \"Paper beats rock. You lose!\";\r\n } else if (cpuSelection === \"scissors\") {\r\n userScore++;\r\n return \"Rock beats scissors. You win!\";\r\n } else if (userSelection === cpuSelection) {\r\n return \"Rock can't beat rock. This is a draw.\";\r\n }\r\n\r\n } else if (userSelection === \"paper\") {\r\n if (cpuSelection === \"rock\") {\r\n userScore++;\r\n return \"Paper beats rock. You win!\"\r\n } else if (cpuSelection === \"scissors\") {\r\n cpuScore++;\r\n return \"Scissors beats paper. You lose!\"\r\n } else if (userSelection === cpuSelection) {\r\n return \"Paper can't beat paper. This is a draw.\"\r\n }\r\n\r\n } else if (userSelection === \"scissors\") {\r\n if (cpuSelection === \"rock\") {\r\n cpuScore++;\r\n return \"Rock beats scissors. You lose!\"\r\n } else if (cpuSelection === \"paper\") {\r\n userScore++;\r\n return \"Scissors beats paper. You win!\"\r\n } else if (userSelection === cpuSelection) {\r\n return \"Scissors can't beat scissors. This is a draw.\"\r\n }\r\n }\r\n}", "title": "" }, { "docid": "47470ef397d9c56f99b982f178415b15", "score": "0.7037482", "text": "function rock(e) {\n //assign player choice\n choice = \"rock\";\n \n e.preventDefault();\n\n //start play\n play(choice, playerRockIcon, playerRockBtn);\n\n}", "title": "" }, { "docid": "7008f434a976f2548c28d4234b1347cb", "score": "0.7030854", "text": "function playRoundRock () {\n let roundResult = playRound(\"rock\", computerPlay());\n score(roundResult);\n}", "title": "" }, { "docid": "2c41b8bee4cfb31e380691ea22dc91a6", "score": "0.6998086", "text": "function playGame() {\r\n const cpuMove = computerChoice();\r\n // do all the different outcomes and print if the player or CPU wins\r\n if (playerMove === cpuMove) {\r\n winner = \"Its a draw\";\r\n } else if (playerMove === \"rock\") {\r\n if (cpuMove === \"paper\") {\r\n cpuScore++;\r\n winner = \"Computer\";\r\n } else {\r\n playerScore++;\r\n winner = playerName;\r\n }\r\n } else if (playerMove === \"paper\") {\r\n if (cpuMove === \"rock\") {\r\n playerScore++;\r\n winner = playerName;\r\n } else {\r\n cpuScore++;\r\n winner = \"Computer\";\r\n }\r\n } else if (playerMove === \"scissors\") {\r\n if (cpuMove === \"rock\") {\r\n cpuScore++;\r\n winner = \"Computer\";\r\n } else {\r\n playerScore++;\r\n winner = playerName;\r\n }\r\n }\r\n\r\n // Increment the game counter\r\n numberOfGames++;\r\n\r\n // display whether the outcome is win loss or draw by changing the text currently on the page\r\n if (winner != \"Its a draw\") {\r\n document.getElementById(\"heading\").innerText =\r\n playerName +\r\n \" chose: \" +\r\n playerMove +\r\n \". \" +\r\n \" CPU chose: \" +\r\n cpuMove +\r\n \". \" +\r\n winner +\r\n \" wins the round!\";\r\n } else {\r\n document.getElementById(\"heading\").innerText =\r\n playerName +\r\n \" chose: \" +\r\n playerMove +\r\n \". \" +\r\n \" CPU chose: \" +\r\n cpuMove +\r\n \". \" +\r\n winner;\r\n }\r\n //shows how many games are left\r\n document.getElementById(\"heading2\").innerText =\r\n 5 - numberOfGames + \" games left. Click a button!\";\r\n document.getElementById(\"scoreboard\").innerText =\r\n \"Score is: \" +\r\n playerName +\r\n \": \" +\r\n playerScore +\r\n \". \" +\r\n \" Computer: \" +\r\n cpuScore;\r\n\r\n // make object for results string\r\n var gameState = {\r\n playerMove,\r\n cpuMove,\r\n playerScore,\r\n cpuScore\r\n };\r\n // add results object to array\r\n gameResult.push(gameState);\r\n\r\n var resultString = \"\";\r\n\r\n // create game history string\r\n for (let i = 0; i < gameResult.length; i++) {\r\n resultString +=\r\n \"<li>\" +\r\n playerName +\r\n \": \" +\r\n gameResult[i].playerMove +\r\n \". Computer: \" +\r\n gameResult[i].cpuMove +\r\n \". Score: \" +\r\n gameResult[i].playerScore +\r\n \" : \" +\r\n gameResult[i].cpuScore +\r\n \".\" +\r\n \"</li>\";\r\n }\r\n document.getElementById(\"gameHistoryUL\").innerHTML = resultString;\r\n\r\n //remove the event listeners so the game can end\r\n if (numberOfGames >= 5) {\r\n rockBtn.removeEventListener(\"click\", playRock);\r\n paperBtn.removeEventListener(\"click\", playPaper);\r\n scissorsBtn.removeEventListener(\"click\", playScissors);\r\n //display final score on the page\r\n if (playerScore > cpuScore) {\r\n printWinningScores(playerName + \" wins!\", \"player-wins\");\r\n } else if (cpuScore > playerScore) {\r\n printWinningScores(\"Computer wins!\", \"computer-wins\");\r\n document.getElementsByTagName(\"body\")[0].classList.add(\"lose-image\");\r\n } else {\r\n printWinningScores(\"It's a draw!\", \"draw\");\r\n }\r\n // resetGame();\r\n }\r\n}", "title": "" }, { "docid": "1071215f96a6297009c0d157636caf3f", "score": "0.6896523", "text": "function choosePaper() {\r\n var playerChoice = \"Paper\";\r\n var cpuChoice = generateMove();\r\n\r\n if (playerChoice == \"Paper\" && cpuChoice == \"Paper\") {\r\n victoryText.innerHTML = \"Draw!\";\r\n cpuChoiceOutput.innerHTML = \"Paper\";\r\n userChoiceOutput.innerHTML = \"Paper\";\r\n winLoseFlag = \"D\";\r\n } else if (playerChoice == \"Paper\" && cpuChoice == \"Scissors\") {\r\n victoryText.innerHTML = \"You Lose!\";\r\n cpuChoiceOutput.innerHTML = \"Scissors\";\r\n userChoiceOutput.innerHTML = \"Paper\";\r\n winLoseFlag = \"L\";\r\n } else if (playerChoice == \"Paper\" && cpuChoice == \"Rock\") {\r\n victoryText.innerHTML = \"You Win!\";\r\n cpuChoiceOutput.innerHTML = \"Rock\";\r\n userChoiceOutput.innerHTML = \"Paper\";\r\n winLoseFlag = \"W\";\r\n }\r\n}", "title": "" }, { "docid": "d69b0f8ed38096786129cb6e79159e24", "score": "0.6868139", "text": "function playGame() {\n\tcomputerSelect();\n\tif (humanSelect == \"paper\" || humanSelect == \"scissors\" || humanSelect == \"rock\") {\n\t\tplay(humanSelect,computerSelection);\n\t\t$('#bot').attr('src','images/' + computerSelection + '.png');\n\t\t// the bot selection image doesn't show tried use delay so you would see it for a bit\n\t\t// before showing the score\n\t\t$('#outcome').text(result);\n\t\t$('#score').text(\"Score is: \" + humanScore + \" to \" + computerScore);\n\t\t}\n\t}", "title": "" }, { "docid": "f6c3c3500cf44443eddacf6918eae711", "score": "0.68463737", "text": "function playRound(playerSelection, computerSelection){\n computerSelection = computerPlay();\n playerSelection = playerPlay();\n\n if ((playerSelection == 'Rock' && computerSelection == 'Scissors') ||\n (playerSelection == 'Scissors' && computerSelection == 'Paper') ||\n (playerSelection == 'Paper' && computerSelection == 'Rock'))\n {\n console.log(`you win- player: ${playerSelection} and computer:${computerSelection}`);\n playerScore++ ;\n }\n else if(playerSelection == computerSelection)\n {\n \n console.log(`It's a tie player:${playerSelection} and computer:${computerSelection}`);\n }\n else{\n console.log(`You lose- player: ${playerSelection} and computer:${computerSelection}`);\n computerScore++ ;\n }\n}", "title": "" }, { "docid": "981143166979a9c734dc484d9080ad7a", "score": "0.68395525", "text": "function game(playerSelection) {\n\n let computerSelection = computerPlay();\n\n //plays a round of the game!\n playRound(playerSelection, computerSelection);\n\n round += 1;\n counter(round, win, loss, tie)\n}", "title": "" }, { "docid": "18de27770ce992fc4ee8ff7b31ac6455", "score": "0.682692", "text": "function oneRound() {\n computerPlay(weapon);\n computerSelection = computerPlay(weapon);\n currentSelection();\n winRules();\n}", "title": "" }, { "docid": "6832984295aaa7e40fc9de3579bb57ec", "score": "0.68233794", "text": "function chooseRock() {\n return playRound(\"Rock\", CHOICES[Math.floor(Math.random() * CHOICES.length)]);\n}", "title": "" }, { "docid": "2fd3d4616be9fff4f569bfad859e070b", "score": "0.6795732", "text": "function playRound(userSelection) {\n\tconsole.log('You Chose ' + userSelection);\n\tcompare(userSelection, computerPlay());\n\tupdateScores();\n}", "title": "" }, { "docid": "9c54bc77fd8fee9b73b0ef610b33ef14", "score": "0.67817897", "text": "function playRock(){\n\tvar computerPlay = getComputerPlay();\n\n\tif (computerPlay == 'paper'){\n\t\t//then computer wins\n\t\t//set status to you lost sentence\n\t\tdocument.getElementById('status').innerHTML = 'you played rock, carolyn played paper, you lost :(';\n\t\t//add 1 to computer score\n\t\tvar computerScore = document.getElementById('computerScore').innerHTML;\n\t\tcomputerScore = parseFloat(computerScore);\n\t\tcomputerScore += 1;\n\t\tdocument.getElementById('computerScore').innerHTML = computerScore\n\t}\n\n\t//function computer pick rock\n\tif (computerPlay == 'rock'){\n\t\t//then tie\n\t\t//set status to you tie sentence\n\t\tdocument.getElementById('status').innerHTML = 'you played rock, carolyn played rock, you tied :|';\n\t}\n\n\tif (computerPlay == 'scissors'){\n\t\t//then computer loses\n\t\t//set status to you win sentence\n\t\tdocument.getElementById('status').innerHTML = 'you played rock, carolyn played scissors, you won :)';\n\t\t//add 1 to computer score\n\t\tvar humanScore = document.getElementById('humanScore').innerHTML;\n\t\thumanScore = parseFloat(humanScore);\n\t\thumanScore += 1;\n\t\tdocument.getElementById('humanScore').innerHTML = humanScore\n\t}\n}", "title": "" }, { "docid": "1ed83e30bf97f51e5a748f53d5e7c627", "score": "0.67711926", "text": "function playRound(playerSelection, computerSelection) {\n if (playerSelection === computerSelection) {\n console.log(\"It's a draw! You both chose the same!\");\n }\n\n if (\n (playerSelection == \"rock\" && computerSelection == \"scissor\") ||\n (playerSelection == \"scissor\" && computerSelection == \"paper\") ||\n (playerSelection == \"paper\" && computerSelection == \"rock\")\n ) {\n // Increase player score by 1 \n playerScore++\n console.log(\n \"You won with \" + playerSelection + \" against PC's \" + computerSelection\n );\n } else if (\n (computerSelection == \"rock\" && playerSelection == \"scissor\") ||\n (computerSelection == \"scissor\" && playerSelection == \"paper\") ||\n (computerSelection == \"paper\" && playerSelection == \"rock\")\n ) {\n // Increase computer score by 1\n computerScore++\n console.log(\n \"The PC won with \" + computerSelection + \" against your \" + playerSelection\n );\n }\n }", "title": "" }, { "docid": "8435508d6eee341271b793ed77d56f92", "score": "0.6770233", "text": "function playRound(playerSelection, computerSelection){\n console.log(\"==Round== \" + round);\n console.log(\"Player choose: \" + playerSelection);\n console.log(\"Computer choose: \" + computerSelection);\n\n if (playerSelection === computerSelection){\n console.log(\"Draw\");\n return;\n }\n\n if (playerSelection == \"rock\") {\n if (computerSelection == \"scissors\") {\n console.log(\"Rock beats Scissors. Player Win!\");\n playerScore++;\n } else {\n console.log(\"Paper beats Rock. Computer Win!\");\n computerScore++;\n }\n } else if (playerSelection == \"paper\") {\n if (computerSelection == \"scissors\") {\n console.log(\"Scissors beats Paper. Computer Win!\");\n computerScore++;\n } else {\n console.log(\"Paper beats Rock! Player Win!\");\n playerScore++;\n }\n } else if (playerSelection == \"scissors\") {\n if(computerSelection == \"rock\"){\n console.log(\"Rock beats Scissors. Computer Win!\");\n computerScore++;\n }\n else {\n console.log(\"Scissors beats Paper. Player Win!\")\n playerScore++;\n }\n }\n}", "title": "" }, { "docid": "04f99b7f05b2b769fecc6003b3fce593", "score": "0.67651886", "text": "function playRound(playerSelection, computerSelection) {\n computerSelection = computerPlay();\n playerSelection = prompt(\n \"Do you choose Rock, Paper or Scissors?\"\n ).toUpperCase();\n\n console.log(computerSelection);\n console.log(playerSelection);\n // PLAYER LOSES\n if (playerSelection === \"ROCK\" && computerSelection === \"paper\") {\n console.log(\"You Lose! Paper beats Rock\");\n computerScore++;\n } else if (playerSelection === \"PAPER\" && computerSelection === \"scissors\") {\n console.log(\"You Lose! Scissors beats paper\");\n computerScore++;\n } else if (playerSelection === \"SCISSORS\" && computerSelection === \"rock\") {\n console.log(\"You Lose! Rock beats scissors\");\n computerScore++;\n\n // PLAYER WINS\n } else if (playerSelection === \"ROCK\" && computerSelection === \"scissors\") {\n console.log(\"You Win! Rock beats scissors\");\n userScore++;\n } else if (playerSelection === \"PAPER\" && computerSelection === \"rock\") {\n console.log(\"You Win! Paper beats rock\");\n userScore++;\n } else if (playerSelection === \"SCISSORS\" && computerSelection === \"paper\") {\n console.log(\"You win! Scissors beats paper\");\n userScore++;\n\n // DRAW\n } else if (\n playerSelection === \"SCISSORS\" &&\n computerSelection === \"scissors\"\n ) {\n console.log(\"It's a draw!\");\n } else if (playerSelection === \"ROCK\" && computerSelection === \"rock\") {\n console.log(\"It's a draw!\");\n } else if (playerSelection === \"PAPER\" && computerSelection === \"paper\") {\n console.log(\"It's a draw!\");\n }\n\n return userScore;\n return computerScore;\n}", "title": "" }, { "docid": "5f452c5246e1607987376ac17c2851f6", "score": "0.67363524", "text": "function rockFunction() {\n var playerSelection = 'Rock'\n var computerSelection = computerPlay()\n resultsContainer.textContent = playRound(playerSelection, computerSelection)\n currentScore.textContent = updateScore()\n\n}", "title": "" }, { "docid": "95d4ad1b69b347e0aa0abd99bdb214e8", "score": "0.67329943", "text": "do_cpu_move() {\n if (this.current_player == this.opening.player_colour) {\n throw new Error(\"it is not the CPUs turn\");\n }\n setTimeout(function() {\n this.make_move(this.get_next_move());\n }.bind(this), CPU_MOVE_DELAY);\n }", "title": "" }, { "docid": "0d6bc5c9a3e6f9ad145a1e01810ac021", "score": "0.67199886", "text": "function playRound(playerSelection = \"rock\", computerSelection = \"scissors\"){\n // both player and computer selection are transform to lower case letters\n playerSelection = playerSelection.toLocaleLowerCase();\n computerSelection = computerSelection.toLocaleLowerCase();\n // Computer selection image according to the chosen play\n computerSel.src = `images/${computerSelection}.jpeg`;\n // Each scenario when the player chooses rock\n if(playerSelection === \"rock\"){\n if(computerSelection === \"scissors\"){\n playerScore++;\n roundOutcome.textContent = \"You win! Rock beats Scissors.\";\n }else if(computerSelection === \"paper\"){\n computerScore++;\n roundOutcome.textContent = \"You lose! Paper beats Rock.\";\n }else if(computerSelection === \"rock\"){\n roundOutcome.textContent = \"It's a tie! Both chose Rock. No winner!\";\n }else{\n roundOutcome.textContent = \"Something went terribly wrong.\";\n }\n // Each scenario when the player chooses paper\n }else if(playerSelection === \"paper\"){\n if(computerSelection === \"scissors\"){\n computerScore++;\n roundOutcome.textContent = \"You lose! Scissors beat Paper.\";\n }else if(computerSelection === \"paper\"){\n roundOutcome.textContent = \"It's a tie! Both chose Paper. No winner!\";\n }else if(computerSelection === \"rock\"){\n playerScore++;\n roundOutcome.textContent = \"You win! Paper beats Rock.\";\n }else{\n roundOutcome.textContent = \"Something went terribly wrong.\";\n }\n // Each scenario when the player chooses scissors\n }else if(playerSelection === \"scissors\"){\n if(computerSelection === \"scissors\"){\n roundOutcome.textContent = \"It's a tie! Both chose Scissors. No winner!\";\n }else if(computerSelection === \"paper\"){\n playerScore++;\n roundOutcome.textContent = \"You win! Scissors beat Paper.\";\n }else if(computerSelection === \"rock\"){\n computerScore++;\n roundOutcome.textContent = \"You lose! Rock beats Scissors.\";\n }else{\n roundOutcome.textContent = \"Something went terribly wrong.\";\n }\n }else{\n roundOutcome.textContent = \"Something went terribly wrong.\";\n }\n\n updateScore();\n\n // The game finishes when either the player or computer reaches 5 wins\n if(playerScore >= 5){\n alert(`Final Score\nPlayer: ${playerScore}\nComputer: ${computerScore}\n\nCongratulations! You won the match!`);\n\n restart();\n }else if(computerScore >= 5){\n alert(`Final Score\nPlayer: ${playerScore}\nComputer: ${computerScore}\n \nToo bad! you lost the match!`);\n\n restart();\n }\n}// end playRound function", "title": "" }, { "docid": "636148a777e1f04ab2955bcdd1a8ecb6", "score": "0.66788864", "text": "function compPlay() {\n if (board.gameOver) {\n return;\n }\n // allow computer opponent to play its move and render result\n var eval = board.negamax(board.maxDepth);\n board.doMove(board.bestMove);\n renderMove(board.bestMove, -board.sideToMove);\n}", "title": "" }, { "docid": "ce61779b6baa90b02c106f994eb53e71", "score": "0.6656708", "text": "function playRound(playerSelection, computerSelection) {\n computerSelection = computerPlay();\n const rock = buttons[0];\n const paper = buttons[1];\n const scissors = buttons[2];\n if ((playerSelection == rock && computerSelection == \"Scissors\") || \n (playerSelection == paper && computerSelection == \"Rock\") || \n (playerSelection == scissors && computerSelection == \"Paper\")) \n {\n round.textContent = \"You Win\";\n playerScore++;\n instantScorePlayer.textContent = \"You: \" + playerScore;\n }\n else if ((playerSelection == rock && computerSelection == \"Paper\") || \n (playerSelection == paper && computerSelection == \"Scissors\") || \n (playerSelection == scissors && computerSelection == \"Rock\"))\n {\n round.textContent = \"You Lose\";\n computerScore++;\n instantScoreComputer.textContent = \"Computer: \" + computerScore;\n }\n else{\n round.textContent = \"Draw\";\n }\n game();\n}", "title": "" }, { "docid": "50924dd5efe8ace30cb6567f2e9803e2", "score": "0.66501", "text": "function evaluateChoice(playerChoice, scoreboard)\n{\n // Create a variable that'll store the cpu's choice.\n let cpuChoice = generateCPUChoice(); // Stores \"rock\", \"paper\", or \"scissors\"\n\n // Evaluate whether both choices result in the player winning, losing, or drawing.\n switch (playerChoice)\n {\n case \"rock\":\n if (cpuChoice === \"rock\")\n {\n // Increase the number of draws by 1 and render it on the webpage.\n scoreboard.draws = scoreboard.draws + 1;\n document.querySelector(\".draws-number\").innerText = \"\" + scoreboard.draws;\n }\n else if (cpuChoice === \"paper\")\n {\n /*\n Increase the number of losses by 1 and render it on the webpage.\n If the # equals 10, call renderLossModal(scoreboard);\n */\n scoreboard.losses = scoreboard.losses + 1;\n document.querySelector(\".losses-number\").innerText = \"\" + scoreboard.losses;\n\n if (scoreboard.losses === 10)\n {\n renderLossModal(scoreboard);\n }\n }\n else // cpuChoice === \"scissors\"\n {\n /*\n Increase the number of wins by 1 and render it on the webpage.\n If the # equals 10, call renderWinModal(scoreboard);\n */\n scoreboard.wins = scoreboard.wins + 1;\n document.querySelector(\".wins-number\").innerText = \"\" + scoreboard.wins;\n\n if (scoreboard.wins === 10)\n {\n renderWinModal(scoreboard);\n }\n }\n break;\n\n case \"paper\":\n if (cpuChoice === \"rock\")\n {\n /*\n Increase the number of wins by 1 and render it on the webpage.\n If the # equals 10, call renderWinModal(scoreboard);\n */\n scoreboard.wins = scoreboard.wins + 1;\n document.querySelector(\".wins-number\").innerText = \"\" + scoreboard.wins;\n\n if (scoreboard.wins === 10)\n {\n renderWinModal(scoreboard);\n }\n }\n else if (cpuChoice === \"paper\")\n {\n // Increase the number of draws by 1 and render it on the webpage.\n scoreboard.draws = scoreboard.draws + 1;\n document.querySelector(\".draws-number\").innerText = \"\" + scoreboard.draws;\n }\n else // cpuChoice === \"scissors\"\n {\n /*\n Increase the number of losses by 1 and render it on the webpage.\n If the # equals 10, call renderLossModal(scoreboard);\n */\n scoreboard.losses = scoreboard.losses + 1;\n document.querySelector(\".losses-number\").innerText = \"\" + scoreboard.losses;\n\n if (scoreboard.losses === 10)\n {\n renderLossModal(scoreboard);\n }\n }\n break;\n \n case \"scissors\":\n if (cpuChoice === \"rock\")\n {\n /*\n Increase the number of losses by 1 and render it on the webpage.\n If the # equals 10, call renderLossModal(scoreboard);\n */\n scoreboard.losses = scoreboard.losses + 1;\n document.querySelector(\".losses-number\").innerText = \"\" + scoreboard.losses;\n\n if (scoreboard.losses === 10)\n {\n renderLossModal(scoreboard);\n }\n }\n else if (cpuChoice === \"paper\")\n {\n /*\n Increase the number of wins by 1 and render it on the webpage.\n If the # equals 10, call renderWinModal(scoreboard);\n */\n scoreboard.wins = scoreboard.wins + 1;\n document.querySelector(\".wins-number\").innerText = \"\" + scoreboard.wins;\n\n if (scoreboard.wins === 10)\n {\n renderWinModal(scoreboard);\n }\n }\n else // cpuChoice === \"scissors\"\n {\n // Increase the number of draws by 1 and render it on the webpage.\n scoreboard.draws = scoreboard.draws + 1;\n document.querySelector(\".draws-number\").innerText = \"\" + scoreboard.draws;\n }\n break;\n }\n}", "title": "" }, { "docid": "e52921858624c296f199f79b55faff71", "score": "0.6646973", "text": "function toRock(playerSelection){\n playerSelection=\"rock\";\n let computerSelection = randomSelection(selections);\n if (matches<5){\n anime({\n targets:\"#rock\",\n translateY:{\n value:-80,\n duration:300\n },\n rotate:{\n value:360,\n duration:600\n },\n scale:{\n value:2,\n duration:300\n },\n direction:\"alternate\"\n });\n }\n play(matches,playerSelection,computerSelection,playerWins,computerWins);\n matches+=1;\n printResults(matches,playerSelection,computerSelection,winner,playerWins,computerWins);\n}", "title": "" }, { "docid": "15a0bc1d7ad3f72e0b6b42e4da474cba", "score": "0.66469264", "text": "function playRound(playerSelection, computerSelection) {\n let playerSelectionLowerCase = playerSelection.toLowerCase();\n let computerSelectionLowerCase = computerSelection.toLowerCase();\n\n let playerWin = true;\n\n // game logic\n if (playerSelection === computerSelection) return \"Draw!\";\n switch (playerSelectionLowerCase) {\n case \"rock\":\n switch (computerSelectionLowerCase) {\n case \"scissors\":\n playerWin = true;\n break\n case \"paper\":\n playerWin = false;\n break\n\n }\n break;\n case \"paper\":\n switch (computerSelectionLowerCase) {\n case \"rock\":\n playerWin = true;\n break\n case \"scissors\":\n playerWin = false;\n break\n\n }\n break;\n case \"scissors\":\n switch (computerSelectionLowerCase) {\n case \"paper\":\n playerWin = true;\n break\n case \"rock\":\n playerWin = false;\n break\n\n }\n break;\n }\n\n return roundResult(playerWin, playerSelectionLowerCase, computerSelectionLowerCase);\n}", "title": "" }, { "docid": "b8e26791774728882bdd13bda538943d", "score": "0.66344607", "text": "function playRound(playerSelection) {\n\n resetColors();\n\n const p = playerSelection;\n const c = computerPlay();\n\n let playerChoice = document.getElementById(`${p}`);\n computerChoice.innerHTML = `<i class=\"far fa-hand-${c}\"></i>`;\n\n if (p === c) {\n playerChoice.style.color = 'gold';\n computerChoice.style.color = 'gold';\n return updateScore(0);\n }\n else if ((p === \"rock\" && c === \"scissors\") ||\n (p === \"paper\" && c === \"rock\") ||\n (p === \"scissors\" && c === \"paper\")) {\n \n playerChoice.style.color = 'lawngreen';\n computerChoice.style.color = 'orangered';\n return updateScore(1); \n } else {\n \n playerChoice.style.color = 'orangered';\n computerChoice.style.color = 'lawngreen';\n return updateScore(2);\n }\n}", "title": "" }, { "docid": "3f5d0b0590aef5278ff1a7c35f7b9471", "score": "0.66265386", "text": "function game() {\n\tcompHand(); \n\tglow();\n\tswitch (playerPlay + compPlay) {\n\t\tcase \"rockscissors\":\n\t\tcase \"paperrock\":\n\t\tcase \"scissorspaper\":\n\t\t\twin();\n\t\t\tbreak;\n\t\tcase \"rockpaper\":\n\t\tcase \"scissorsrock\":\n\t\tcase \"paperscissors\":\n\t\t\tlose();\n\t\t\tbreak;\n\t\tcase \"rockrock\":\n\t\tcase \"scissorsscissors\":\n\t\tcase \"paperpaper\":\n\t\t\ttie();\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "64af498b88e501af921831da3364403d", "score": "0.66039413", "text": "function playRound(playerSelection, computerSelection) {\n const playerPickLowerCase = playerSelection.toLowerCase();\n switch (playerPickLowerCase) {\n case \"rock\":\n switch (computerSelection) {\n case \"rock\":\n return \"Tie! Rock vs rock\";\n break;\n case \"paper\":\n return \"You lose! Paper beats rock\";\n break;\n case \"scissors\":\n return \"You win! Scissors beat rock\";\n default:\n break;\n }\n break;\n case \"paper\":\n switch (computerSelection) {\n case \"rock\":\n return \"You win! Paper beats rock\";\n break;\n case \"paper\":\n return \"Tie! Paper vs paper\";\n break;\n case \"scissors\":\n return \"You lose! Scissors beats paper\";\n default:\n break;\n }\n break;\n case \"scissors\":\n switch (computerSelection) {\n case \"rock\":\n return \"You lose! Rock beats scissors\";\n break;\n case \"paper\":\n return \"You win! Scissors beats paper\";\n break;\n case \"scissors\":\n return \"Tie! Scissors vs scissors\";\n default:\n break;\n }\n break;\n\n default:\n return \"invalid\"\n break;\n }\n}", "title": "" }, { "docid": "d8fcd0de2dbf60374d1fd1ba4d65c16b", "score": "0.66034573", "text": "function playRound(playerSelection, computerSelection) {\n if (playerSelection == computerSelection) {\n return \"Tie\"\n } else if (playerSelection === \"Paper\" && computerSelection == \"Rock\") {\n return \"Win\";\n } else if (playerSelection === \"Rock\" && computerSelection == \"Scisor\") {\n return \"Win\";\n } else if (playerSelection === \"Scisor\" && computerSelection == \"Paper\") {\n return \"Win\";\n } else if (playerSelection === \"Paper\" && computerSelection == \"Scisor\") {\n return \"Lose\";\n } else if (playerSelection === \"Rock\" && computerSelection == \"Paper\") {\n return \"Lose\";\n } else if (playerSelection === \"Scisor\" && computerSelection == \"Rock\") {\n return \"Lose\";\n };\n}", "title": "" }, { "docid": "a801b5c3e4517e5a6d0120d4af905961", "score": "0.6601193", "text": "function playRound(playerSelection, computerSelection) {\n console.log(playerSelection)\n console.log(computerSelection)\n \n // Rock \n if (playerSelection === \"rock\" && computerSelection === \"rock\") {\n console.log(playerScore)\n console.log(computerScore)\n return \"Tie!\"; \n } else if (playerSelection === \"rock\" && computerSelection === \"paper\") {\n console.log(playerScore)\n console.log(++computerScore)\n return \"You Lose! Paper beats Rock\"; \n } else if (playerSelection === \"rock\" && computerSelection === \"scissors\") {\n console.log(++playerScore)\n console.log(computerScore)\n return \"You Win! Rock beats Scissors\"; \n // Paper \n } else if (playerSelection === \"paper\" && computerSelection === \"rock\") {\n console.log(++playerScore)\n console.log(computerScore)\n return \"You Win! Paper beats Rock\"; \n } else if (playerSelection === \"paper\" && computerSelection === \"paper\") {\n console.log(playerScore)\n console.log(computerScore)\n return \"Tie!\"; \n } else if (playerSelection === \"paper\" && computerSelection === \"scissors\") {\n console.log(playerScore)\n console.log(++computerScore)\n return \"You Lose! Scissor beats Paper\"; \n // Scissors\n } else if (playerSelection === \"scissors\" && computerSelection === \"rock\") {\n console.log(playerScore)\n console.log(++computerScore)\n return \"You Lose! Rock beats Scissors\"; \n } else if (playerSelection === \"scissors\" && computerSelection === \"paper\") {\n console.log(++playerScore)\n console.log(computerScore)\n return \"You Win! Scissors beats Paper\"; \n } else if (playerSelection === \"scissors\" && computerSelection === \"scissors\") {\n console.log(playerScore)\n console.log(computerScore)\n return \"Tie!\"; \n } else {\n return \"Invalid Choice!\"\n } \n }", "title": "" }, { "docid": "60dedcfcd025f0c4dfe1e7b4b4408936", "score": "0.65888655", "text": "function playRound(playerSelection, computerSelection) {\n if (playerSelection == \"rock\" &&\n computerSelection == \"rock\") {\n tieWin();\n } else if (playerSelection == \"rock\" &&\n computerSelection == \"scissors\") {\n playerWin();\n } else if (playerSelection == \"rock\" &&\n computerSelection == \"paper\") {\n computerWin();\n }\n\n if (playerSelection == \"paper\" &&\n computerSelection == \"rock\") {\n playerWin();\n } else if (playerSelection == \"paper\" &&\n computerSelection == \"paper\") {\n tieWin();\n } else if (playerSelection == \"paper\" &&\n computerSelection == \"scissors\") {\n computerWin();\n }\n\n if(playerSelection == \"scissors\" &&\n computerSelection == \"rock\") {\n computerWin();\n } else if (playerSelection == \"scissors\" &&\n computerSelection == \"paper\") {\n playerWin();\n } else if (playerSelection == \"scissors\" &&\n computerSelection == \"scissors\") {\n tieWin();\n }\n\n if(computerWinAmount == 5) {\n alert(\"You lost! Better luck next time :(\");\n reset();\n } else if (playerWinAmount == 5) {\n alert(\"You won! Congratulations! :)\")\n reset();\n }\n}", "title": "" }, { "docid": "4bc029725d796300559632c1fdf45e50", "score": "0.65870863", "text": "function playRound() {\n const computer = computerPlay();\n const player = playerPlay();\n let outcome;\n if(computer ===\"Rock\" && player ===\"Rock\") {\n outcome=\"Draw! Pick Again\";\n }\n else if(computer ===\"Paper\" && player ===\"Paper\"){\n outcome=\"Draw! Pick Again\";\n }\n else if (computer ===\"Scissors\" && player ===\"Scissors\"){\n outcome=\"Draw! Pick Again\";\n } \n else if (computer ===\"Rock\" && player ===\"Paper\") {\n outcome=\"You Win! Paper Beats Rock\";\n }\n else if (computer ===\"Rock\" && player ===\"Scissors\") {\n outcome=\"You Lose! Rock Beats Scissors\";\n }\n else if (computer ===\"Paper\" && player ===\"Rock\") {\n outcome=\"You Lose! Paper Beats Rock\";\n }\n else if (computer ===\"Paper\" && player ===\"Scissors\") {\n outcome=\"You Win! Scissors Beats Paper\";\n } \n else if (computer ===\"Scissors\" && player ===\"Rock\") {\n outcome=\"You Win! Rock Beats Scissors\";\n }\n else if (computer ===\"Scissors\" && player ===\"Paper\") { \n outcome=\"You Lose! Scissors Beats Paper\";\n } \n else {\n outcome=\"i dont know what happened\";\n } \n return outcome;\n }", "title": "" }, { "docid": "a9d73577cd6313c8e21a188e697236d4", "score": "0.6583506", "text": "function playRound(playerSelection, computerSelection) {\n/* if the game is a tie.... */\n if (playerSelection == computerSelection) {\n return \"You've tied. womp womp! Try again lawl\";\n } else {\n/* from previous, if tie - nobody gets points and try again! But if not a tie, check which of rock - paper - scissors is selected then go through that selected loop to determine if win or lose*/\n if (playerSelection == 'rock') {\n if (computerSelection == 'scissors') {\n return \"YOUR Rock smashes scissors! You Win teehee\" & playerScore++;\n } else return \"Paper smothers YOUR rock! You Lose haa\" & computerScore++;\n } else if (playerSelection == 'paper') {\n if (computerSelection == 'rock') {\n return \"YOUR Paper smothers rock! You Win teehee\" & playerScore++; \n } else return \"Scissors slice and dice YOUR paper! You Lose haa\" & computerScore++;\n } else if (playerSelection == 'scissors') {\n if (computerSelection == 'rock') {\n return \"Rock smashes YOUR scissors! You Lose haa\" & computerScore++;\n } else return \"YOUR Scissors slice and dice paper! You Win teehee\" & playerScore++; \n }\n }\n}", "title": "" }, { "docid": "1adc4438adf8a482c8031210fbb350b1", "score": "0.658284", "text": "function playRound(playerSelection, computerSelection) {\n\n //Change to lowercase\n let player = playerSelection.toLowerCase();\n let computer = computerSelection.toLowerCase();\n\n\n //If player chooses rock\n if (player === 'rock') {\n if (computer === 'rock') {\n return 'It\\'s a tie. Try again'\n } else if (computer === 'paper') {\n return 'You loose. Paper beats Rock'\n } else {\n return 'You win. Rock beats scissors'\n }\n\n }\n //If player chooses paper\n else if (player === 'paper') {\n if (computer === 'paper') {\n return 'It\\'s a tie. Try again'\n }\n if (computer === 'scissors') {\n return 'You loose. Scissors beats Paper'\n } else {\n return 'You win. Paper beats Rock'\n }\n }\n\n //If player chooses scissors\n else {\n if (computer === 'scissors') {\n return 'It\\'s a tie. Try again'\n } else if (computer === 'rock') {\n return 'You lose. Rock beats Scissors'\n } else {\n return 'You win. Scissors beats Paper'\n }\n }\n }", "title": "" }, { "docid": "220b8e6091cda225690115e791028939", "score": "0.6579599", "text": "function playRound(playerSelection, ComputerSelection) {\n\n\tconsole.log(\"You:\" + playerSelection + \" Computer:\" + ComputerSelection);\n\n\tswitch(playerSelection) {\n\n\t\tcase \"rock\":\n\t\t\tif(ComputerSelection == \"rock\") {\n\t\t\t\tconsole.log(\"Draw!!! Go Again\");\n\t\t\t\treturn (\"draw\");\n\t\t\t} \n\t\t\telse if (ComputerSelection == \"paper\") {\n\t\t\t\tconsole.log(\"Computer Wins!!!\");\n\t\t\t\treturn (\"computer\");\n\t\t\t} \n\t\t\telse {\n\t\t\t\tconsole.log(\"You Win!!!\");\n\t\t\t\treturn (\"player\");\n\t\t\t}\n\n\t\tcase \"paper\":\n\t\t\tif(ComputerSelection == \"paper\") {\n\t\t\t\tconsole.log(\"Draw!!! Go Again\");\n\t\t\t\treturn (\"draw\");\n\t\t\t} \n\t\t\telse if (ComputerSelection == \"scissors\") {\n\t\t\t\tconsole.log(\"Computer Wins!!!\");\n\t\t\t\treturn (\"computer\");\n\t\t\t} \n\t\t\telse {\n\t\t\t\tconsole.log(\"You Win!!!\");\n\t\t\t\treturn (\"player\");\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"scissors\":\n\t\t\tif(ComputerSelection == \"scissors\") {\n\t\t\t\tconsole.log(\"Draw!!! Go Again\");\n\t\t\t\treturn (\"draw\");\n\t\t\t} \n\t\t\telse if (ComputerSelection == \"rock\") {\n\t\t\t\tconsole.log(\"Computer Wins!!!\");\n\t\t\t\treturn (\"computer\");\n\t\t\t} \n\t\t\telse {\n\t\t\t\tconsole.log(\"You Win!!!\");\n\t\t\t\treturn (\"player\");\n\t\t\t}\n\t\t\tbreak;\n\n\t}\n\t\n}", "title": "" }, { "docid": "84eaf561af4a4c1e3fe4c1cd5aa84603", "score": "0.65792584", "text": "function playRound(playerSelection, computerSelection) {\n if (playerSelection == 'rock') {\n if (computerSelection == 'paper') {\n return 'You Lose! Paper beats Rock';\n } else if (computerSelection == 'scissors') {\n return 'You Win! Rock beats Scissors';\n }\n } else if (playerSelection == 'paper') {\n if (computerSelection == 'scissors') {\n return 'You Lose! Scissors beats Paper';\n } else if (computerSelection == 'rock') {\n return 'You Win! Paper beats Rock';\n }\n } else {\n if (computerSelection == 'rock') {\n return 'You Lose! Rock beats Scissors';\n } else if (computerSelection == 'paper') {\n return 'You Win! Scissors beats Paper';\n }\n }\n \n return 'You Draw!';\n}", "title": "" }, { "docid": "46a1a67d6254f858f3de02b2e80168fa", "score": "0.6561806", "text": "function playRock(){ // Function to call the singleRound(\"rock\") function with the rock argument\n singleRound('rock');\n }", "title": "" }, { "docid": "dd238a0818cd177e4bfa971fba0ccbe6", "score": "0.6551061", "text": "function game(playerChoice) {\n const computerChoice = generateComputerChoice();\n switch(playerChoice + computerChoice) {\n case \"rockscissors\":\n case \"paperrock\":\n case \"scissorspaper\":\n win(playerChoice, computerChoice);\n break;\n case \"rockpaper\":\n case \"paperscissors\":\n case \"scissorsrock\":\n lose(playerChoice, computerChoice);\n break;\n case \"rockrock\":\n case \"paperpaper\":\n case \"scissorsscissors\":\n draw(playerChoice);\n break;\n };\n}", "title": "" }, { "docid": "c0a5712eef3c2daa74f5f4bc185664ed", "score": "0.65497804", "text": "function playRound(playerSelection, computerSelection) {\n\n //round result variable\n let playRoundResult = \"default\";\n\n //function if choose Rock\n function funcRock() {\n switch (computerSelection) {\n case \"rock\":\n displayCompSelection(computerSelection);\n playRoundResult = \"tie\";\n displayResult(\"Tie, play again!\");\n break;\n case \"paper\":\n displayCompSelection(computerSelection);\n playRoundResult = \"lose\";\n displayResult(\"You lose this round! Paper beats Rock!\");\n break;\n case \"scissors\":\n displayCompSelection(computerSelection);\n playRoundResult = \"win\";\n displayResult(\"You win this round! Rock beats Scissors!\");\n break;\n }\n }\n\n //function if choose Paper\n function funcPaper() {\n switch (computerSelection) {\n case \"rock\":\n displayCompSelection(computerSelection);\n playRoundResult = \"win\";\n displayResult(\"You win this round! Paper beats Rock!\");\n break;\n case \"paper\":\n displayCompSelection(computerSelection);\n playRoundResult = \"tie\";\n displayResult(\"Tie, play again!\");\n break;\n case \"scissors\":\n displayCompSelection(computerSelection);\n playRoundResult = \"lose\";\n displayResult(\"You lose this round! Scissors beats Paper!\");\n break;\n }\n }\n //function if choose Scissors\n function funcScissors() {\n switch (computerSelection) {\n case \"rock\":\n displayCompSelection(computerSelection);\n playRoundResult = \"lose\";\n displayResult(\"You lose this round! Rock beats Scissors!\");\n break;\n case \"paper\":\n displayCompSelection(computerSelection);\n playRoundResult = \"win\";\n displayResult(\"You win this round! Paper beats Rock!\");\n break;\n case \"scissors\":\n displayCompSelection(computerSelection);\n playRoundResult = \"tie\";\n displayResult(\"Tie, play again!\");\n break;\n }\n }\n\n if (playerSelection === \"rock\") {\n displayPlayerSelection(playerSelection);\n funcRock();\n } else if (playerSelection === \"paper\") {\n displayPlayerSelection(playerSelection);\n funcPaper();\n } else if (playerSelection === \"scissors\") {\n displayPlayerSelection(playerSelection);\n funcScissors();\n } else {\n alert(\"Error, type a proper object!\");\n playRoundResult = \"error\";\n }\n return playRoundResult;\n}", "title": "" }, { "docid": "8b321a35455bea2c57c7766a95b601e2", "score": "0.6544193", "text": "function playRound(playerSelection, computerSelection) {\n if (playerSelection == computerSelection) {\n gameMessage = (\"it's a draw !\"); \n }\n else if (playerSelection == \"rock\") {\n if (computerSelection == \"scissors\") {\n playerScore ++; \n gameMessage = (\"You Win ! , The Rock blunts the Scissors\");\n }\n else {\n computerScore ++;\n gameMessage = (\"You Loose ! , The Paper covers the Rock\");\n }\n }\n else if (playerSelection == \"paper\") {\n if(computerSelection == \"rock\") {\n playerScore ++; \n gameMessage = (\"You Win ! , The Paper covers the Rock\");\n }\n else {\n computerScore ++;\n gameMessage = (\"You Loose ! , The Scissors cuts the Paper\");\n } \n } \n else if (playerSelection == \"scissors\") {\n \n if(computerSelection == \"paper\") {\n playerScore ++; \n gameMessage = (\"You Win ! , The Scissors cuts the Paper\");\n }\n else {\n computerScore ++;\n gameMessage = (\"You Loose ! , The Rock blunts the Scissors\");\n }\n }\n else {\n gameMessage = (\"Right Input is: Rock, Paper or Scissors !\");\n }\n }", "title": "" }, { "docid": "ea67da626e291c8867f95dc390f9271e", "score": "0.6540318", "text": "function initialMove(){\n var player = chooseFirstPlayer();\n if(player === \"Computer\"){\n isComputerTurn = true;\n computerMove();\n }\n}", "title": "" }, { "docid": "2ccc3d9c7d575cf8dfb8d36efd67df73", "score": "0.6530433", "text": "function playRound(playerSelection, computerSelection) {\n let player=playerSelection();\n let computer=computerSelection();\n console.log(`Player play is ${player}`);\n console.log(`Computer play is ${computer}`);\n switch(true) {\n // cases where player wins\n case (player=='ROCK' && computer=='Scissors'):\n case (player=='SCISSORS' && computer=='Paper'):\n case (player=='PAPER' && computer=='Rock'):\n return ('Player Wins!');\n //cases where computer wins\n case (computer=='Rock' && player=='SCISSORS'):\n case (computer=='Scissors' && player=='PAPER'):\n case (computer=='Paper' && player=='ROCK'):\n return ('Computer Wins!');\n // Ties\n case (player=='ROCK' && computer=='Rock'):\n case (player=='SCISSORS' && computer =='Scissors'):\n case (player=='PAPER' && computer=='Paper'):\n return(\"It's a tie!\");\n // player cancels play\n case (player==undefined):\n return ('Round cancelled');\n // default value for when the player types something weird\n default:\n alert(\"The only acceptable plays are rock, paper, or scissors (case-insentive). Please type one of those options or esc to quit.\");\n return ('No winner; player did not play an acceptable move');\n }\n}", "title": "" }, { "docid": "7d8c1908a11c7bf66ff29abbb37245c1", "score": "0.65269655", "text": "function game(userSelection) {\r\ncomputerSelection = computerPlay();\r\n switch (userSelection + computerSelection) {\r\n case \"rockrock\":\r\n case \"paperpaper\":\r\n case \"scissorsscissors\":\r\n return draw(userSelection);\r\n break;\r\n case \"rockscissors\":\r\n case \"paperrock\":\r\n case \"scissorspaper\":\r\n return win(userSelection);\r\n break;\r\n case \"rockpaper\":\r\n case \"paperscissors\":\r\n case \"scissorsrock\":\r\n return lose(userSelection);\r\n break;\r\n }\r\n }", "title": "" }, { "docid": "3b2456c8d734485504170d03e4470607", "score": "0.652282", "text": "function playRound(playerSelection, computerSelection) {\n // First clear previous selections (refresh what's shown on screen):\n playerSelectionText.textContent = '';\n computerSelectionText.textContent = '';\n computerImage.setAttribute('src', 'question-mark.png');\n roundResult.textContent = '';\n\n // Get new selections\n let player=playerSelection; // no longer passing in a function with the GUI, only a string\n \n // I like how it looks with a a slight delay here to indicate a new round (in case the same selection is picked twice especially)\n setTimeout(function() {\n playerSelectionText.textContent = player;\n }, delayPlayer); // just lets the selection stay blank for a while\n\n // Run computer selection function, which has its own delay\n let computer=computerSelection();\n \n // Decide who wins the round and return it. But add the delay so the results don't come first\n switch(true) {\n // cases where player wins\n case (player=='ROCK' && computer=='Scissors'):\n case (player=='SCISSORS' && computer=='Paper'):\n case (player=='PAPER' && computer=='Rock'):\n return ('Player Wins!');\n //cases where computer wins\n case (computer=='Rock' && player=='SCISSORS'):\n case (computer=='Scissors' && player=='PAPER'):\n case (computer=='Paper' && player=='ROCK'):\n return ('Computer Wins!');\n // Ties\n case (player=='ROCK' && computer=='Rock'):\n case (player=='SCISSORS' && computer =='Scissors'):\n case (player=='PAPER' && computer=='Paper'):\n return(\"It's a tie!\");\n // player cancels play\n case (player==undefined):\n return ('Round cancelled');\n // default value for when the player types something weird (only applied to non-DOM version of game)\n default:\n // alert(\"The only acceptable plays are rock, paper, or scissors (case-insentive). Please type one of those options or esc to quit.\");\n // return ('No winner; player did not play an acceptable move');\n }\n}", "title": "" }, { "docid": "c3d8c4db0629818f0f997d996e69c7ab", "score": "0.6518734", "text": "function playRound(playerSelection, computerSelection) {\n if (playerSelection === 'rock' && computerSelection === 'paper') {\n computerScore += 1;\n return 'Paper beats rock. You lose! :(';\n } else if (playerSelection === 'rock' && computerSelection === 'scissors') {\n playerScore += 1;\n return 'Rock beats scissors. You win! :)';\n } else if (playerSelection === 'paper' && computerSelection === 'scissors') {\n computerScore += 1;\n return 'Scissors beats paper. You lose! :(';\n } else if (playerSelection === 'paper' && computerSelection === 'rock') {\n playerScore += 1;\n return 'Rock beats paper. You win! :)';\n } else if (playerSelection === 'scissors' && computerSelection === 'rock') {\n computerScore += 1;\n return 'Rock beats scissors. You lose! :(';\n } else if (playerSelection === 'scissors' && computerSelection === 'paper') {\n playerScore += 1;\n return 'Scissors beats paper. You win! :)';\n } else {\n return 'Draw... Throw again.';\n }\n}", "title": "" }, { "docid": "df29e12438f8ba46aa09765c1b8a04dc", "score": "0.6510408", "text": "function playRound(playerSelection, computerSelection) {\n if (playerSelection === \"rock\" && computerSelection === \"scissors\") {\n return \"You Win, rock beats scissors\";\n } else if (playerSelection === \"paper\" && computerSelection === \"rock\") {\n return \"You Win, paper beats rock\";\n } else if (playerSelection === \"scissors\" && computerSelection === \"paper\") {\n return \"You Win, scissors beats paper\";\n } else if (playerSelection === \"rock\" && computerSelection === \"paper\") {\n return \"You Lose, paper beats rock\";\n } else if (playerSelection === \"paper\" && computerSelection === \"scissors\") {\n return \"You Lose, scissors beats paper\";\n } else if (playerSelection === \"scissors\" && computerSelection === \"rock\") {\n return \"You Lose, rock beats scissors\";\n } else {\n return \"It is a Draw!\";\n }\n}", "title": "" }, { "docid": "932778c19ff6cae67ad0d11c54faf22c", "score": "0.651013", "text": "function playRound(computerSelection, playerSelection){\n //variables for rock paper and scissors so they will be case insesitive\n playerSelection = playerSelection.toLowerCase();\n if (computerSelection == 'rock') {\n console.log('The oppenent chose: rock')\n switch(playerSelection) {\n case 'rock':\n console.log(\"You tie! Rock ties with Rock\")\n return \"You tie! Rock ties with Rock\";\n case 'paper':\n console.log(\"You Win! Paper beats Rock\")\n return \"You Win! Paper beats Rock\";\n case 'scissors':\n console.log(\"You Lose! Rock beats Scissors\")\n return \"You Lose! Rock beats Scissors\";\n \n };\n }else if (computerSelection == 'paper') {\n console.log('The oponent chose: paper')\n switch(playerSelection) {\n case 'rock':\n console.log(\"You Lose! Paper beats Rock\")\n return \"You Lose! Paper beats Rock\";\n case 'paper':\n console.log(\"You tie! Paper ties with Paper\")\n return \"You tie! Paper ties with Paper\";\n case 'scissors':\n console.log(\"You Win! Scissors beats Paper\")\n return \"You Win! Scissors beats Paper\";\n };\n }else if (computerSelection == 'scissors'){\n console.log('The openent chose: scissors')\n switch(playerSelection) {\n case 'rock':\n console.log(\"You Win! Rock beats Scissors\")\n return \"You Win! Rock beats Scissors\";\n case 'paper':\n console.log(\"You Lose! Scissors beats Paper\")\n return \"You Lose! Scissors beats Paper\";\n case 'scissors':\n console.log(\"You tie! Scissors ties with Scissors\")\n return \"You tie! Scissors ties with Scissors\";\n };\n }else {\n return \"Sorry, but this is an error!\"\n }\n console.log(\"hello\")\n}", "title": "" }, { "docid": "77a24351d18f8d84b67dd62290917a36", "score": "0.6507003", "text": "function computerKnockTurn(){\n\t\tchangeActivePlayer();\n\t\tbackgroundForActivePlayer();\n\t}", "title": "" }, { "docid": "16544f77b7f443f0e8fcb23422d7a9cc", "score": "0.6505545", "text": "function computerPlay() {\n\tlet move = autoMove();\n\tif (move <= 1) {\n\t\tconsole.log('Computer Chose Rock');\n\t\treturn 'rock';\n\t} else if (move <= 2) {\n\t\tconsole.log('Computer Chose Paper');\n\t\treturn 'paper';\n\t} else {\n\t\tconsole.log('Computer Chose Scissors');\n\t\treturn 'scissors';\n\t}\n}", "title": "" }, { "docid": "abbb6801d2c421c6747d18d037f70efd", "score": "0.65048206", "text": "function computerSaidGo() {\n state = \"playerGo\";\n if (ableToPlay()) {\n playerClicked = 0;\n playerTurn();\n } else {\n playerScore += 1;\n drawScore();\n if (!findWinner()) {\n setTimeout(function() {\n $('#instruction p').text(\"Player scores 1 for the Go/Last\");\n }, 1000);\n state = \"resetPlayPhase\";\n $('#instruction p').text(\"You can no longer make a move, the round is over\");\n setTimeout(gameSequence, 1000);\n }\n\n }\n}", "title": "" }, { "docid": "a8545c8caae26c1f3a5dd22e786c37e5", "score": "0.6501344", "text": "function game(userchoice) { \r\n const computerchoice = getcomputerchoice();\r\n switch (userchoice + computerchoice) { \r\n case \"rs\":\r\n case \"pr\":\r\n case \"sp\":\r\n wins();\r\n break;\r\n case \"rp\":\r\n case \"ps\":\r\n case \"sr\":\r\n lose();\r\n break;\r\n case \"rr\":\r\n case \"pp\":\r\n case \"ss\":\r\n draw();\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "341a9bf2e7d6d05b189165daf737f658", "score": "0.65012294", "text": "function playRound(playerSelection, computerDecision) {\n //checks if the player win\n if (\n (playerSelection == \"scissors\" && computerDecision == \"paper\") ||\n (playerSelection == \"rock\" && computerDecision == \"scissors\") ||\n (playerSelection == \"paper\" && computerDecision == \"rock\")\n ) {\n resultCheck = \"Result of the round:¡YOU WIN THIS ROUND!\";\n playerScore++;\n }\n //checks if the player looses\n else if (\n (playerSelection == \"paper\" && computerDecision == \"scissors\") ||\n (playerSelection == \"scissors\" && computerDecision == \"rock\") ||\n (playerSelection == \"rock\" && computerDecision == \"paper\")\n ) {\n resultCheck = \"Result of the round: U loose this round\";\n computerScore++;\n }\n //checks if is a tie\n else if (playerSelection == computerDecision) {\n resultCheck = \"Result of the round: Just a tie\";\n }\n }", "title": "" }, { "docid": "5daa058a801f5969e2ebbea83fa04198", "score": "0.6499194", "text": "function playRound(playerSelection, computerSelection){\n playerSelection = playerSelection.toLowerCase();\n if (playerSelection == 'rock' && computerSelection == 'paper'){\n computerWins++;\n return 'You lose! Paper beats rock'; \n }else if (playerSelection == 'rock' && computerSelection == 'rock'){\n return 'You tie! You have both selected rock';\n }else if (playerSelection == 'rock' && computerSelection == 'scissors'){\n playerWins++;\n return 'You win! Rock beats scissors'; \n }else if (playerSelection == 'paper' && computerSelection == 'scissors'){\n computerWins++;\n return 'You lose! Scissors beats paper';\n }else if (playerSelection == 'paper' && computerSelection == 'paper'){\n return 'You tie! You have both selected paper';\n }else if (playerSelection == 'paper' && computerSelection == 'rock'){\n playerWins++;\n return 'You win! Paper beats rock';\n }else if (playerSelection == 'scissors' && computerSelection == 'rock'){\n computerWins++;\n return 'You lose! Rock beats scissors';\n }else if (playerSelection == 'scissors' && computerSelection == 'scissors'){\n return 'You tie! You have both selected scissors';\n }else if (playerSelection == 'scissors' && computerSelection == 'paper'){\n playerWins++;\n return 'You win! Scissors beats paper';\n }\n\n}", "title": "" }, { "docid": "5e288373ce0bd900ae45904f97e0b4e5", "score": "0.64952046", "text": "function playRound(playerBtn, computerSelect) {\n const playerSelect = playerBtn.target.value;\n \n switch (true) {\n case (playerSelect === \"Rock\" && computerSelect === 'Scissors'):\n result.textContent = `You Win! Rock crushes Scissors`;\n playerscorevalue.textContent = parseInt(playerscorevalue.textContent) + 1;\n break;\n case (playerSelect === \"Rock\" && computerSelect === 'Paper'):\n result.textContent = `You Lose! Paper beats Rock`;\n computerscorevalue.textContent = parseInt(computerscorevalue.textContent) + 1;\n break;\n case (playerSelect === \"Paper\" && computerSelect === 'Rock'):\n result.textContent = `You Win! Paper covers Rock`;\n playerscorevalue.textContent = parseInt(playerscorevalue.textContent) + 1;\n break;\n case (playerSelect === \"Paper\" && computerSelect === 'Scissors'):\n result.textContent = `You Lose! Scissors cuts Paper`;\n computerscorevalue.textContent = parseInt(computerscorevalue.textContent) + 1;\n break;\n case (playerSelect === \"Scissors\" && computerSelect === 'Paper'):\n result.textContent = `You Win! Scissors cuts Paper`;\n playerscorevalue.textContent = parseInt(playerscorevalue.textContent) + 1;\n break;\n case (playerSelect === \"Scissors\" && computerSelect === 'Rock'):\n result.textContent = `You Lose! Scissors can't crush Rock`;\n computerscorevalue.textContent = parseInt(computerscorevalue.textContent) + 1;\n break;\n default:\n result.textContent = `It's a tie`;\n break;\n }\n \n endGame()\n}", "title": "" }, { "docid": "26e89e400bb556c37e1cf08053dbca55", "score": "0.6492925", "text": "function playRound() {\n let playerSelection = prompt(\"Rock, Paper or Scissor?\");\n let computerSelection = computerPlay();\n \n if (playerSelection === \"Rock\" && computerSelection === \"Scissor\" || playerSelection === \"Paper\" && computerSelection === \"Rock\" || playerSelection === \"Scissor\" && computerSelection === \"Paper\") {\n playerScore++;\n return win + playerSelection + \" beats \" + computerSelection + \".\";\n} else if (computerSelection === \"Paper\" && playerSelection === \"Rock\" || computerSelection === \"Scissor\" && playerSelection === \"Paper\" || computerSelection === \"Rock\" && playerSelection === \"Scissor\") {\n computerScore++;\n return lose + computerSelection + \" beats \" + playerSelection + \".\";\n} else if (playerSelection === computerSelection) {\n return tie + playerSelection + \" does not beat \" + computerSelection + \".\";\n} else {\n computerScore++;\n return lose + computerSelection + \" beats \" + playerSelection + \".\";\n}\n}", "title": "" }, { "docid": "9ee0cbaeaccacee0584417cf8c7abd38", "score": "0.64908004", "text": "function playRound(playerSelection, computerSelection) { \n playerSelection = getInput(); \n computerSelection = computerPlay();\n//play a single round\n if(playerSelection == computerSelection){\n console.log(results[2]);\n } else if (playerSelection == \"rock\" && computerSelection == \"scissors\" ){\n console.log(`${results[0]} Rock, Smashes Scissors!`);\n playerScore++;\n } else if (playerSelection == \"rock\" && computerSelection == \"paper\"){\n console.log(`${results[1]} Paper, Covers Rock!`);\n computerScore++;\n } else if (playerSelection == \"paper\" && computerSelection == \"rock\") {\n console.log(`${results[0]} Paper, Covers Rock!`);\n playerScore++;\n } else if (playerSelection == \"paper\" && computerSelection == \"scissors\"){\n console.log(`${results[1]} Scissors, Cuts Paper!`);\n computerScore++\n } else if (playerSelection == \"scissors\" && computerSelection == \"paper\"){\n console.log(`${results[0]} Scissors, Cuts Paper`);\n playerScore++;\n } else if (playerSelection == \"scissors\" && computerSelection == \"rock\"){\n console.log(`${results[1]} Rock, Smashes Scissors`);\n computerScore++;\n }\n}", "title": "" }, { "docid": "23b6e95b888eb4abf99f54849c8f2654", "score": "0.6489943", "text": "function RockChoice() {\n playerChoice = 1; //binigyan lang ng value si Rock\n computerChoice = Math.floor(Math.random() * 3 + 1); //para mag random si computer then para mabigyan ng value si computer choicce from 1-3\n\n // uGestures Append\n uGesture(uRock);\n appendMsg();\n\n if(playerChoice === computerChoice) { //Draw no score would be added\n cGesture(cRock);\n Draw();\n \n } \n\n else if (playerChoice == 1 && computerChoice == 2){ //PLAYER LOOSE! Player: Rock && Computer: Paper\n cGesture(cPaper);\n startingCoins--; // deduct reward from user\n ComputerScore++; //add score to computer\n \n } \n else { //PLAYER WINS! Player: Rock && Computer: Scissor\n cGesture(cScissor);\n UserScore++; // add score to user\n startingCoins++ //add reward to user\n \n }\n\n userScore.textContent = UserScore; //display value of UserScore to the element tag na dala ni userScore\n computerScore.textContent = ComputerScore; //display value of ComputerScore to the element tag na dala ni computerScore\n coin.textContent = startingCoins; //display value of ComputerScore to the element tag na dala ni computerScore\n\n // kapag naubos na yung reward ni user \"Game Over\" na\n if (startingCoins === 0){\n UserScore = 0; //declare the value to 0 (reset)\n ComputerScore = 0; //declare value to 0 (reset)\n userScore.textContent = UserScore; \n computerScore.textContent = ComputerScore;\n }\n createLocalStorage();\n}", "title": "" }, { "docid": "b1cf3d97924ac6c4acb5eae7c870f8e0", "score": "0.6482384", "text": "function playRound(playerSelection, computerSelection = computerPlay()) {\n if (playerSelection === computerSelection) {\n roundResult.textContent= 'It\\'s a tie!';\n } else if (playerSelection === 'rock' && computerSelection === 'scissors' || \n playerSelection === 'paper' && computerSelection === 'rock' || \n playerSelection === 'scissors' && computerSelection === 'paper') {\n playerPoints++; \n roundResult.textContent = 'You win, ' + playerSelection + ' beats ' + computerSelection + '.';\n } else if (playerSelection === 'scissors' && computerSelection === 'rock' || \n playerSelection === 'rock' && computerSelection === 'paper' || \n playerSelection === 'paper' && computerSelection === 'scissors') {\n computerPoints++;\n roundResult.textContent = 'You lose, ' + computerSelection + ' beats ' + playerSelection + '.';\n } else {\n roundResult.textContent = 'Something went wrong. Refresh page and restart game.';\n };\n}", "title": "" }, { "docid": "7117a096b32362ba38396ce002333270", "score": "0.6480733", "text": "function cpuSelection() {\n\n let cpuChoice = Math.floor(Math.random()*3); \n\n if (cpuChoice === 0) {\n \tshowCpuChoiceRock();\n \treturn 'rock';\n } else if (cpuChoice === 1) {\n \tshowCpuChoicePaper();\n \treturn 'paper';\n } else if (cpuChoice === 2) {\n \tshowCpuChoiceScissors();\n \treturn 'scissors';\n } else {\n return \"Make a selection to begin the game\";\n }\n}", "title": "" }, { "docid": "5c608c00cbcfb38bceb5831de4b7fb70", "score": "0.6475773", "text": "function playRound(choice) {\n let computerSelection = computerPlay();\n if (choice == 'rock' & computerSelection === 'Paper'){\n result = 'You lose! Paper beats Rock!';\n }\n else if (choice == 'rock' & computerSelection ==='Scissors'){\n result = 'You win! Rock beats Scissors!';\n }\n else if (choice == 'rock' & computerSelection ==='Rock'){\n result = 'It is a draw!';\n }\n else if (choice == 'scissors' & computerSelection ==='Rock'){\n result = 'You lose! Rock beats Scissors!';\n }\n else if (choice == 'scissors' & computerSelection ==='Paper'){\n result = 'You win! Scissors beats Paper!';\n }\n else if (choice == 'scissors' & computerSelection ==='Scissors'){\n result = 'It is a draw!';\n }\n else if (choice == 'paper' & computerSelection ==='Scissors'){\n result = 'You lose! Scissors beats Paper!';\n }\n else if (choice == 'paper' & computerSelection ==='Rock'){\n result = 'You win! Paper beats Rock!';\n }\n else if (choice == 'paper' & computerSelection ==='Paper'){\n result = 'It is a draw!';\n }\nreturn result;\n}", "title": "" }, { "docid": "de105bea94c5068796c368cfc3158b5a", "score": "0.6470991", "text": "function playRound(playerSelection, computerSelection) {\n\n displayComputerSelection(computerSelection);\n\n //compare PlayerSelection and conputerSelection\n //if playerSelection (Rock) and ComputerSelection (Paper)\n if (playerSelection === 'rock' && computerSelection === 'paper') {\n loss += 1;\n const rockPaperLoss = document.querySelector('#round-result');\n rockPaperLoss.textContent = \"You Lose! Paper beats Rock\";\n return;\n }\n\n //If playerSelection (Paper) and ComputerSelection (Rock)\n else if (playerSelection === 'paper' && computerSelection === 'rock') {\n win += 1;\n const paperRockWin = document.querySelector('#round-result');\n paperRockWin.textContent = \"You Win! Paper beats Rock\";\n return;\n }\n\n //if playerSelection (Paper) and ComputerSelection (Scissors)\n else if (playerSelection === 'paper' && computerSelection === 'scissors') {\n loss += 1;\n const paperScissorsLoss = document.querySelector('#round-result');\n paperScissorsLoss.textContent = \"You Lose! Scissors beats Paper\";\n return;\n }\n\n //If playerSelection (Scissors) and ComputerSelection (Paper)\n else if (playerSelection === 'scissors' && computerSelection === 'paper') {\n win += 1;\n const ScissorsPaperWin = document.querySelector('#round-result');\n ScissorsPaperWin.textContent = \"You Win! Scissors beats Paper\";\n return;\n }\n\n //if playerSelection (Scissors) and ComputerSelection (Rock)\n else if (playerSelection === 'scissors' && computerSelection === 'rock') {\n loss += 1;\n const scissorsRockLoss = document.querySelector('#round-result');\n scissorsRockLoss.textContent = \"You Lose! Paper beats Rock\";\n return;\n }\n\n //If playerSelection (Rock) and ComputerSelection (Scissors)\n else if (playerSelection === 'rock' && computerSelection === 'scissors') {\n win += 1;\n const rockScissorsWin = document.querySelector('#round-result');\n rockScissorsWin.textContent = \"You Lose! Paper beats Rock\";\n return;\n }\n\n //if playerSelection == computerSelection then \"It's a tie!\"\n else {\n tie += 1;\n const roundTie = document.querySelector('#round-result');\n roundTie.textContent = \"You Lose! Paper beats Rock\";\n return;\n }\n}", "title": "" }, { "docid": "aa282f4e3bd88939af9067242f84410a", "score": "0.6470186", "text": "function playRock() {\n play(\"rock\");\n}", "title": "" }, { "docid": "3d8929e593bd6f28f763730123bdd4c1", "score": "0.64694023", "text": "function playGame(user_rand_pick, machine_rand_pick) {\n // Tie when user's choice is the same as the machine's\n if(user_rand_pick === machine_rand_pick)\n {\n return(\"It's a tie!\")\n }\n // User : \"Rock\"\n else if(user_rand_pick === \"Rock\"){\n if(machine_rand_pick === \"Paper\")\n {\n return(\"You lost the game :(\"); // Machine : \"Paper\" so the user lost.\n }\n\n else if(machine_rand_pick === \"Scissors\")\n {\n return(\"You beat the machine!\"); // Machine : \"Scissors\" so the user WIN!\n }\n // User : \"Paper\"\n else if(user_rand_pick === \"Paper\")\n {\n if(machine_rand_pick === \"Rock\")\n {\n return(\"You beat the machine!\"); // Machine : \"Rock\" so the user WIN!\n }\n else if(machine_rand_pick === \"Scissors\")\n {\n return(\"Machine has a better luck this time. You lost :(\"); // Machine : Scissors so the user lost.\n }\n }\n // User : \"Scissors\"\n else if(user_rand_pick === \"Scissors\")\n {\n if(machine_rand_pick === \"Paper\")\n {\n return(\"You nailed the machine!\"); // Machine : \"Paper\" so the user WIN!\n }\n else if(machine_rand_pick === \"Rock\")\n {\n return(\"Machine crushed you with the rock. You lost :(\"); // Machine : \"Rock\" so the user lost.\n }\n }\n }\n\n}", "title": "" }, { "docid": "507b38d3e0ce0eda88d9fe67ea3387ca", "score": "0.6466334", "text": "function playRound(computerSelection, playerSelection) {\n if (computerSelection == playerSelection) return \"Tie\";\n else if (computerSelection == \"Rock\" && playerSelection == \"Paper\")\n return \"You win! Paper beats Rock\";\n else if (computerSelection == \"Paper\" && playerSelection == \"Scissor\")\n return \"You win! Scissors beat paper\";\n else if (computerSelection == \"Scissor\" && playerSelection == \"Rock\")\n return \"You win! Rock beats Scissors\";\n else if (computerSelection == \"Scissor\" && playerSelection == \"Paper\")\n return \"You lose! Scissors beat Paper\";\n else if (computerSelection == \"Paper\" && playerSelection == \"Rock\")\n return \"You lose! Paper beats Rock\";\n else if (computerSelection == \"Rock\" && playerSelection == \"Scissor\")\n return \"You Lose! Rock beats Scissors\";\n}", "title": "" }, { "docid": "4eb326258e253e481f18a74389f88ab0", "score": "0.64659274", "text": "function playRound(playerChoice) {\n\tlet computerChoice = computerPlay();\n\tlet winner = getRoundWinner(playerChoice, computerChoice);\n\n\tif (winner=='player') playerWinCount++;\n\telse if (winner=='computer') compWinCount++;\n\n\tprintMssgs(playerChoice, computerChoice, winner);\n\n\tif (round > 5) addPlayAgainButton();\n}", "title": "" }, { "docid": "9bb1c13e3a4d0ed2645e12c0c373f948", "score": "0.64640814", "text": "function playRound(playerSelection, computerSelection) {\n if (playerSelection === 'rock') {\n if (computerSelection === 'rock') {\n return `It's a Tie game!`;\n } else if (computerSelection === 'paper') {\n return `You Lose! Paper beats Rock`;\n } else if (computerSelection === 'scissors') {\n return `You Win! Rock beats Scissors`;\n }\n } else if (playerSelection === `paper`) {\n if (computerSelection === 'paper') {\n return `It's a Tie game!`;\n } else if (computerSelection === 'rock') {\n return `You Win! Paper beats Rock`;\n } else if (computerSelection === 'scissors') {\n return `You Lose! Scissors beats Paper`;\n }\n } else if (playerSelection === `scissors`) {\n if (computerSelection === 'scissors') {\n return `It's a Tie game!`;\n } else if (computerSelection === 'rock') {\n return `You Lose! Rock beats Scissors`;\n } else if (computerSelection === 'paper') {\n return `You Win! Scissors beats Paper`;\n }\n }\n}", "title": "" }, { "docid": "cf463591dfe3f4ec529c1b3d8008c77a", "score": "0.6463149", "text": "function playRound(playerSelection, computerSelection) {\n console.log(`You selected: \"${playerSelection}\"`);\n console.log(`Computer selected: \"${computerSelection}\"`);\n\n // Tie \n if (playerSelection === computerSelection) {\n document.getElementById('game-result').innerHTML = \"It's a tie! Play again!\";\n document.getElementById('game-result').style.color = \"black\";\n }\n // Rock beats Scissors\n else if (playerSelection === 'rock') {\n if (computerSelection === 'scissors') {\n playerScore++;\n document.getElementById('game-result').innerHTML = \"You win! Rock beats Scissors!\";\n document.getElementById('game-result').style.color = \"green\";\n document.getElementById('human-score').innerHTML = playerScore;\n } else {\n computerScore++;\n document.getElementById('game-result').innerHTML = \"You lose! Paper beats Rock!\";\n document.getElementById('game-result').style.color = \"red\";\n document.getElementById('robot-score').innerHTML = computerScore;\n }\n }\n // Paper beats Rock\n else if (playerSelection === 'paper') {\n if (computerSelection === 'rock') {\n playerScore++;\n document.getElementById('game-result').innerHTML = \"You win! Paper beats Rock!\"\n document.getElementById('game-result').style.color = \"green\";\n document.getElementById('human-score').innerHTML = playerScore;\n } else {\n computerScore++;\n document.getElementById('game-result').innerHTML = \"You lose! Scissors beats Paper!\";\n document.getElementById('game-result').style.color = \"red\";\n document.getElementById('robot-score').innerHTML = computerScore;\n }\n }\n // Scissors beat Paper\n else if (playerSelection === 'scissors') {\n if (computerSelection === 'paper') {\n playerScore++;\n document.getElementById('game-result').innerHTML = \"You win! Scissors beats Paper!\";\n document.getElementById('game-result').style.color = \"green\";\n document.getElementById('human-score').innerHTML = playerScore;\n } else {\n computerScore++;\n document.getElementById('game-result').innerHTML = \"You lose! Rock beats Scissors!\";\n document.getElementById('game-result').style.color = \"red\";\n document.getElementById('robot-score').innerHTML = computerScore;\n }\n }\n}", "title": "" }, { "docid": "0a7c54506d7bb1388ba1398a546bcf6f", "score": "0.6461644", "text": "function game(choice) {\n playerChoice = choice;\n computerChoice = computerPlay()\n\n playRound(playerChoice,computerChoice);\n showMoves(); \n\n\n if (playerScore == 5) {gameMessage = (\"Congratulations !, You won the Game \");}\n if (computerScore == 5) {gameMessage = (\"Potluck !, Try another Game !\");}\n \n updateToDom();\n\n if (playerScore == 5 || computerScore == 5) {\n resetGame();}\n }", "title": "" }, { "docid": "f0c02d18e524810978b714a1391e2bdc", "score": "0.64594394", "text": "function playRound (playerSelection, computerSelection) {\n let result;\n\n switch(playerSelection) {\n case 'Rock':\n result = (computerSelection == \"Scissors\") ? `${playerSelection} beats ${computerSelection}.You win!` :\n (computerSelection == \"Paper\") ? `${playerSelection} is beaten by ${computerSelection}. You lose!` :\n `${playerSelection} cancels ${computerSelection}. It's a draw!`;\n break;\n case 'Paper':\n result = (computerSelection == \"Rock\") ? `${playerSelection} beats ${computerSelection}.You win!` :\n (computerSelection == \"Scissors\") ? `${playerSelection} is beaten by ${computerSelection}. You lose!` :\n `${playerSelection} cancels ${computerSelection}. It's a draw!`;\n break;\n case 'Scissors':\n result = (computerSelection == \"Paper\") ? `${playerSelection} beat ${computerSelection}.You win!` :\n (computerSelection == \"Rock\") ? `${playerSelection} are beaten by ${computerSelection}. You lose!` :\n `${playerSelection} cancel ${computerSelection}. It's a draw!`;\n break;\n }\n\n return result\n}", "title": "" }, { "docid": "607bf3a75de5ff7045141dcf9c842f76", "score": "0.64549583", "text": "function playerSelection(e){\n let playerPick = e.target;\n if (playerPick === Rock){\n playerPick = \"ROCK\"\n } else if (playerPick === Paper){\n playerPick = \"PAPER\"\n } else {\n playerPick = \"SCISSORS\"\n }\n playerButtonAnimation(playerPick);\n playRound(computerChoice(), playerPick);\n}", "title": "" }, { "docid": "708a38eae69b8bdb8eb2c79f21912f57", "score": "0.644906", "text": "function playRound(playerSelection) {\n let result = document.getElementById('info');\n result.style.fontSize = \"20px\";\n \n let computerScore = document.getElementById('computer-score');\n let playerScore = document.getElementById('player-score');\n \n let computerSelection = computerPlay();\n if (playerSelection == computerSelection) {\n result.textContent = 'Draw'\n console.log(`Draw`);\n return;\n } else if (\n (playerSelection == \"Rock\" && computerSelection == \"Paper\") ||\n (playerSelection == \"Paper\" && computerSelection == \"Scissor\") ||\n (playerSelection == \"Scissor\" && computerSelection == \"Rock\")\n ) {\n result.textContent = `You Lose! ${computerSelection} beats ${playerSelection}`;\n computerScore.textContent++;\n console.log(\n `You Lose! ${computerSelection} beats ${playerSelection}`\n );\n if (computerScore.textContent == 5) {\n result.textContent = \"Computer Won\"\n result.style.fontSize = \"40px\";\n computerScore.textContent = 0;\n playerScore.textContent = 0;\n return;\n }\n return \"computer\";\n } else {\n result.textContent = `You Win! ${playerSelection} beats ${computerSelection}`;\n playerScore.textContent++;\n console.log(`You Win! ${playerSelection} beats ${computerSelection}`);\n if (playerScore.textContent == 5) {\n result.textContent = \"Player Won\"\n result.style.fontSize = \"40px\";\n computerScore.textContent = 0;\n playerScore.textContent = 0;\n return;\n }\n return \"player\";\n }\n }", "title": "" }, { "docid": "f6ef7c17c8a3fd8c86b89a3238bd56dc", "score": "0.64468175", "text": "function playRound(playerSelection, computerSelection) {\n // output the message \"You lose/ You win! X beats Y\" depending on the move comparison\n let result;\n round++;\n roundNumber.innerHTML = `Round ${round}`;\n\n // Compares the two variables\n // it's a tie\n if (playerSelection === computerSelection) {\n results.innerHTML = \"It's a draw, try again.\";\n result = 'tie';\n }\n\n // rock beats scissors but loses to paper\n else if (playerSelection === moves[0]) {\n if (computerSelection === moves[2]) {\n playerScore += 1;\n results.innerHTML = 'You win this round!';\n roundTotal.innerHTML = `${playerScore} - ${computerScore}`;\n result = 'win';\n } else if (computerSelection === moves[1]) {\n computerScore += 1;\n results.innerHTML = 'You lose this round.';\n roundTotal.innerHTML = `${playerScore} - ${computerScore}`;\n result = 'lose';\n }\n }\n\n // paper beats rock, but loses to scissors\n else if (playerSelection === moves[1]) {\n if (computerSelection === moves[0]) {\n playerScore += 1;\n results.innerHTML = 'You win this round!';\n roundTotal.innerHTML = `${playerScore} - ${computerScore}`;\n result = 'win';\n } else if (computerSelection === moves[2]) {\n computerScore += 1;\n results.innerHTML = 'You lose this round.';\n roundTotal.innerHTML = `${playerScore} - ${computerScore}`;\n result = 'lose';\n }\n }\n\n // scissors beats paper, but loses to rock\n else if (playerSelection === moves[2]) {\n if (computerSelection === moves[1]) {\n playerScore += 1;\n results.innerHTML = 'You win this round!';\n roundTotal.innerHTML = `${playerScore} - ${computerScore}`;\n result = 'win';\n } else if (computerSelection === moves[0]) {\n computerScore += 1;\n results.innerHTML = 'You lose this round.';\n roundTotal.innerHTML = `${playerScore} - ${computerScore}`;\n result = 'lose';\n }\n }\n isMatchOver();\n return result;\n}", "title": "" }, { "docid": "8b7fcf9a063f1534db35b206c9fb2b33", "score": "0.6436044", "text": "function playRound(playerSelection,computerPlay){\n // if both choose the same\n if (playerSelection === computerPlay){\n return 'tie game!';\n }\n \n \n // if user chooses paper\n if (playerSelection ==='paper') {\n if (computerPlay ==='scissors'){\n return 'You Lose! Scissors beats Paper';\n }\n else {\n return 'You Win! Rock beats Paper';\n }\n}\n // if user chooses scissors\n if (playerSelection ==='scissors') {\n if (computerPlay ==='paper'){\n return 'You Win! Scissors beats Paper';\n }\n else {\n return 'You Lose! Rock beats Scissors';\n }\n }\n // if user chooses rock\n if (playerSelection ==='rock')\n {\n if (computerPlay ==='scissors'){\n return 'You Win! Rock beats Scissors';\n }\n else {\n return 'You Lose! Paper beats rock';\n }\n}\n}", "title": "" }, { "docid": "6a874c7128a92a7c93db0ef957025fd7", "score": "0.6431476", "text": "function playRound(playerSelection, computerSelection) {\n let lowercaseP = playerSelection.toLowerCase();\n let lowercaseC = computerSelection.toLowerCase();\n \n if (lowercaseP == \"rock\" && lowercaseC == \"scissors\") {\n\n playerScore= ++playerScore;\n player.innerText= playerScore\n\n result.innerHTML=\"<span>You Win! Rock beats Scissors.</span>\";\n \n } else if (lowercaseP == \"rock\" && lowercaseC == \"paper\") {\n\n computerScore= ++computerScore;\n enemy.innerText = computerScore;\n\n result.innerHTML=\"<span>You Lose! Paper beats Rock.</span>\" \n\n } else if (lowercaseP == \"scissors\" && lowercaseC == \"paper\") {\n\n playerScore= ++playerScore;\n player.innerText = playerScore;\n\n result.innerHTML=\"<span>You Win! Scissors beats Paper.</span>\";\n\n } else if (lowercaseP == \"scissors\" && lowercaseC == \"rock\") {\n\n computerScore= ++computerScore;\n enemy.innerText = computerScore;\n\n result.innerHTML=\"<span>You Lose! Rock beats Paper.</span>\";\n\n } else if (lowercaseP == \"paper\" && lowercaseC == \"rock\") {\n\n playerScore= ++playerScore;\n player.innerText = playerScore;\n\n result.innerHTML=\"<span>You Win! Paper beats Rock.</span>\";\n\n } else if (lowercaseP == \"paper\" && lowercaseC == \"scissors\") {\n\n computerScore= ++computerScore;\n enemy.innerText = computerScore;\n\n result.innerHTML=\"<span>You Lose! Scissors beats Paper.</span>\";\n\n } else if (lowercaseP === lowercaseC) {\n\n result.innerHTML='<span>Its a tie!</span>';\n }\n checkWinner();\n \n \n console.log(playerScore)\n console.log(computerScore)\n }", "title": "" }, { "docid": "df77a82a276e4a7b049912c7dbb8e0da", "score": "0.64282554", "text": "function playRound(playerSelection, computerSelection) {\n if (playerSelection == \"rock\" && computerSelection == \"paper\"){\n computerScore++\n return div3.textContent = (\"You Lost! This round.\")\n } else if (playerSelection == \"rock\" && computerSelection == \"scissors\") {\n playerScore++\n return div3.textContent = (\"You Won! This round.\")\n } else if (playerSelection == \"rock\" && computerSelection == \"rock\") {\n return div3.textContent = (\"It\\'s a draw\")\n } else if (playerSelection == \"paper\" && computerSelection == \"rock\") {\n playerScore++\n return div3.textContent = (\"You Won! This round.\")\n } else if (playerSelection == \"paper\" && computerSelection == \"scissors\") {\n computerScore++\n return div3.textContent = (\"You Lost! This round.\")\n } else if (playerSelection == \"paper\" && computerSelection == \"paper\") {\n return div3.textContent = (\"It\\'s a draw\")\n } else if (playerSelection == \"scissors\" && computerSelection == \"rock\") {\n computerScore++\n return div3.textContent = (\"You Lost! This round.\")\n } else if (playerSelection == \"scissors\" && computerSelection == \"paper\") {\n playerScore++\n return div3.textContent = (\"You Won! This round.\")\n } else if (playerSelection == \"scissors\" && computerSelection == \"scissors\") {\n return div3.textContent = (\"It\\'s a draw\")\n }\n }", "title": "" }, { "docid": "c262a49e1f5079252271378bbc3c8645", "score": "0.6423404", "text": "function playGround(userSelection, comSelection) {\n\t\n\tif (userSelection === comSelection) {\n\n\t\tresultM.innerHTML = \"It's a tie\";\n\n\t} \n\telse if(userSelection == 'rock') {\n\n\t\tif (comSelection == 'scissor') {\n\t\t\tuserScore++;\n\t\t\tresultM.innerHTML = \"You Win! Rock beats scissors.\";\n\t\t\tscoreU.innerHTML = userScore;\n\t\t} \n\t\telse{\n\t\t\tcomScore++\n\t\t\tresultM.innerHTML = \"You Lose! Paper beats rock.\";\n\t\t\tscoreC.innerHTML =comScore;\n\t\t}\n\t} \n\n\telse if (userSelection == 'paper') {\n\n\t\tif (comSelection == 'rock') {\n\t\t\tuserScore++;\n\t\t\tresultM.innerHTML = \"You Win! Paper beats rock\";\n\t\t\tscoreU.innerHTML = userScore;\n\t\t} \n\t\telse{\n\t\t\tcomScore++;\n\t\t\tresultM.innerHTML = \"You Lose! Scissors beat paper.\";\n\t\t\tscoreC.innerHTML = comScore;\n\t\t}\n\t} \n\n\telse{\n\t\tif (comSelection == 'paper') {\n\t\t\tuserScore++;\n\t\t\tresultM.innerHTML = \"You Win! Scissors beat paper.\";\n\t\t\tscoreU.innerHTML = userScore;\n\t\t} \n\t\telse{\n\t\t\tcomScore++;\n\t\t\tresultM.innerHTML = \"You Lose! Rock beats scissors.\";\n\t\t\tscoreC.innerHTML = comScore;\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "de1f535899674b144f6c254ae8331da0", "score": "0.64225703", "text": "function playRound(playerSelection, computerSelection) {\n\n if (playerSelection === computerSelection) { // Tie. Scores do not change.\n lastRound = \"It's a tie!\";\n } else if (playerSelection === \"Rock\" && computerSelection === \"Paper\") { // Computer wins and gains a point.\n computerScore++;\n lastRound = \"Paper beats Rock. You lose!\";\n } else if (playerSelection === \"Rock\" && computerSelection === \"Scissors\") { // Player wins and gains a point.\n playerScore++;\n lastRound = \"Rock beats Scissors. You win!\";\n } else if (playerSelection === \"Paper\" && computerSelection === \"Scissors\") { // Computer wins and gains a point.\n computerScore++;\n lastRound = \"Scissors beats Paper. You lose!\";\n } else if (playerSelection === \"Paper\" && computerSelection === \"Rock\") { // Player wins and gains a point.\n playerScore++;\n lastRound = \"Paper beats Rock. You win!\";\n } else if (playerSelection === \"Scissors\" && computerSelection === \"Rock\") { // Computer wins and gains a point.\n computerScore++;\n lastRound = \"Rock beats Scissors. You lose!\";\n } else if (playerSelection === \"Scissors\" && computerSelection === \"Paper\") { // Player wins and gains a point.\n playerScore++;\n lastRound = \"Scissors beats Paper. You win!\";\n }\n \n}", "title": "" }, { "docid": "6434a67dcad60d5bfe057618b4c29819", "score": "0.6409215", "text": "function game(playerSelection, computerSelection) {\n playerSelection = playerPlay();\n computerSelection = computerPlay();\n\n function playRound(playerSelection, computerSelection) {\n if (playerSelection === \"rock\" && computerSelection === \"paper\") {\n scoreComputer++;\n scorePlayerDisplay.innerHTML = scorePlayer.toString();\n scoreComputerDisplay.innerHTML = scoreComputer.toString();\n info.innerHTML = \"You lose! Paper beats Rock\";\n } else if (playerSelection === \"rock\" && computerSelection === \"scissors\") {\n scorePlayer++;\n scorePlayerDisplay.innerHTML = scorePlayer.toString();\n scoreComputerDisplay.innerHTML = scoreComputer.toString();\n info.innerHTML = \"You win! Rock beats Scissors!\";\n } else if (playerSelection === \"rock\" && computerSelection === \"rock\") {\n scorePlayerDisplay.innerHTML = scorePlayer.toString();\n scoreComputerDisplay.innerHTML = scoreComputer.toString();\n info.innerHTML = \"Tie! Play again\";\n } else if (playerSelection === \"paper\" && computerSelection === \"paper\") {\n scorePlayerDisplay.innerHTML = scorePlayer.toString();\n scoreComputerDisplay.innerHTML = scoreComputer.toString();\n info.innerHTML = \"Tie! Play again\";\n } else if (\n playerSelection === \"paper\" &&\n computerSelection === \"scissors\"\n ) {\n scoreComputer++;\n info.innerHTML = \"You lose! Scissors beat Paper!\";\n } else if (playerSelection === \"paper\" && computerSelection === \"rock\") {\n scorePlayer++;\n scorePlayerDisplay.innerHTML = scorePlayer.toString();\n scoreComputerDisplay.innerHTML = scoreComputer.toString();\n info.innerHTML = \"You win! Paper beats Rock\";\n } else if (\n playerSelection === \"scissors\" &&\n computerSelection === \"paper\"\n ) {\n scorePlayer++;\n scorePlayerDisplay.innerHTML = scorePlayer.toString();\n scoreComputerDisplay.innerHTML = scoreComputer.toString();\n info.innerHTML = \"You win! Scissors beat Paper\";\n } else if (\n playerSelection === \"scissors\" &&\n computerSelection === \"scissors\"\n ) {\n scorePlayerDisplay.innerHTML = scorePlayer.toString();\n scoreComputerDisplay.innerHTML = scoreComputer.toString();\n info.innerHTML = \"Tie! Play again\";\n } else if (playerSelection === \"scissors\" && computerSelection === \"rock\") {\n scoreComputer++;\n scorePlayerDisplay.innerHTML = scorePlayer.toString();\n scoreComputerDisplay.innerHTML = scoreComputer.toString();\n info.innerHTML = \"You lose! Rock beats Scissors\";\n }\n }\n\n return playRound(playerSelection, computerSelection);\n}", "title": "" }, { "docid": "1b5993a3dc820905723b78f345f5b599", "score": "0.6406982", "text": "function playRound(playerSelection){\r\n\r\n round++;\r\n computerPlay();\r\n if (playerSelection == 'rock' && computerSelection == 'scissors'){\r\n document.getElementById(\"result\").innerHTML = \"You picked \" + playerSelection + \" and the computer picked \" + computerSelection + \". <br> You win this one!\";\r\n playerScore++;\r\n } else if (playerSelection == 'paper' && computerSelection == 'rock'){\r\n document.getElementById(\"result\").innerHTML = \"You picked \" + playerSelection + \" and the computer picked \" + computerSelection + \". <br> You win this one!\";\r\n playerScore++;\r\n } else if (playerSelection == 'scissors' && computerSelection == 'paper'){\r\n document.getElementById(\"result\").innerHTML = \"You picked \" + playerSelection + \" and the computer picked \" + computerSelection + \". <br> You win this one!\";\r\n playerScore++;\r\n } else if (computerSelection == 'rock' && playerSelection == 'scissors'){\r\n document.getElementById(\"result\").innerHTML = \"You picked \" + playerSelection + \" and the computer picked \" + computerSelection + \". <br> You lost this one!\";\r\n computerScore++;\r\n } else if (computerSelection == 'paper' && playerSelection == 'rock'){\r\n document.getElementById(\"result\").innerHTML = \"You picked \" + playerSelection + \" and the computer picked \" + computerSelection + \". <br> You lost this one!\";\r\n computerScore++;\r\n } else if (computerSelection == 'scissors' && playerSelection == 'paper'){\r\n document.getElementById(\"result\").innerHTML = \"You picked \" + playerSelection + \" and the computer picked \" + computerSelection + \". <br> You lost this one!\";\r\n computerScore++;\r\n } else {\r\n document.getElementById(\"result\").innerHTML = \"Uh-oh, it's a tie!\";\r\n }\r\n}", "title": "" }, { "docid": "c86ddf64a6d7d2a0c6031e9ee54a9c11", "score": "0.6388964", "text": "function runGame(playerChoice) {\n\n let num1 = Math.floor(Math.random() * 5) + 1;\n\n let computerChoice = \"\";\n\n let computerAction = document.getElementsByClassName(\"versus-two\")[0];\n computerAction.classList.remove(\"versus-two\");\n\n if (num1 === 1) {\n computerChoice = \"computerRock\";\n computerAction.classList.add(\"rock-two\");\n } else if (num1 === 2) {\n computerChoice = \"computerPaper\";\n computerAction.classList.add(\"paper-two\");\n } else if (num1 === 3) {\n computerChoice = \"computerScissors\";\n computerAction.classList.add(\"scissors-two\");\n } else if (num1 === 4) {\n computerChoice = \"computerLizard\";\n computerAction.classList.add(\"lizard-two\");\n } else if (num1 === 5) {\n computerChoice = \"computerSpock\";\n computerAction.classList.add(\"spock-two\");\n\n }\n pickAction(playerChoice, computerChoice);\n}", "title": "" }, { "docid": "f23e3c7302915caaf969f2392a207591", "score": "0.63816714", "text": "function computerPlay() {\n var randomNum = getRandomInt(0, 2);\n var choices = [\"rock\", \"paper\", \"scissors\"];\n \n computerChoice = choices[randomNum];\n}", "title": "" }, { "docid": "f23e3c7302915caaf969f2392a207591", "score": "0.63816714", "text": "function computerPlay() {\n var randomNum = getRandomInt(0, 2);\n var choices = [\"rock\", \"paper\", \"scissors\"];\n \n computerChoice = choices[randomNum];\n}", "title": "" }, { "docid": "1f10db044010a7b51979041ea8c80173", "score": "0.6379827", "text": "function computer () {\n let caseToPlay = Math.floor(Math.random()*8)\n if (cases[caseToPlay].innerHTML === \"\" && gameOver === 0){\n cases[caseToPlay].innerHTML = \"X\"\n lastPlayerIsO = 0;\n lastPlayerIsX = 1;\n hitCount++;\n }\n else if (cases[caseToPlay].innerHTML !== \"\" && gameOver === 0) {\n computer();\n }\n}", "title": "" }, { "docid": "562c14d532a00d53e28fdcc3f9489eb0", "score": "0.6376358", "text": "function game(userChoice){\n const computerChoice = getComputerChoices();\n switch (userChoice){\n case 'Rock' : if (computerChoice === 'Rock'){\n console.log('Rock \\n');\n draw(userChoice);\n break;\n }\n else if (computerChoice === 'Paper'){\n lose(userChoice, computerChoice);\n break;\n }\n if (computerChoice === 'Scissors'){\n console.log('Scissors \\n');\n win(userChoice, computerChoice);\n break;\n }\n case 'Paper' : if (computerChoice === 'Paper'){\n draw(userChoice);\n break;\n }\n else if (computerChoice === 'Scissors'){\n console.log('Scissors \\n');\n lose(userChoice, computerChoice);\n break;\n }\n if (computerChoice === 'Rock'){\n console.log('Rock \\n');\n win(userChoice, computerChoice);\n break;\n }\n case 'Scissors' : if (computerChoice === 'Scissors'){\n console.log('Scissors \\n');\n draw(userChoice);\n break;\n }\n else if (computerChoice === 'Rock'){\n console.log('Rock \\n');\n lose(userChoice, computerChoice);\n break;\n }\n if (computerChoice === 'Paper'){\n win(userChoice, computerChoice);\n break;\n }\n }\n}", "title": "" }, { "docid": "2d8ee0b9e4928e1069e71899fc6b9475", "score": "0.63749397", "text": "function playerMove(playerMoveChosen) {\n var computerMoveChoice = computerMove();\n var gameResult = determiningWinner(playerMoveChosen, computerMoveChoice);\n displayResult(playerWins, computerWins);\n roundsPlayed++;\n if (playerWins === roundsNumber) {\n displayText(\n \"YOU WON THE ENTIRE GAME!!! Round \" +\n roundsPlayed +\n \": <strong>\" +\n gameResult +\n \"</strong> won. You played <strong>\" +\n playerMoveChosen +\n \"</strong>, computer played <strong>\" +\n computerMoveChoice +\n \"</strong> \"\n );\n gameActive = false;\n } else if (computerWins === roundsNumber) {\n displayText(\n \"COMPUTER WON THE ENTIRE GAME!!! Round \" +\n roundsPlayed +\n \": <strong>\" +\n gameResult +\n \"</strong> won. You played <strong>\" +\n playerMoveChosen +\n \"</strong>, computer played <strong>\" +\n computerMoveChoice +\n \"</strong> \"\n );\n gameActive = false;\n } else {\n displayText(\n \"Round \" +\n roundsPlayed +\n \": <strong>\" +\n gameResult +\n \"</strong> won. You played <strong>\" +\n playerMoveChosen +\n \"</strong>, computer played <strong>\" +\n computerMoveChoice +\n \"</strong>\"\n );\n }\n}", "title": "" }, { "docid": "88e45b453206512886864b0642208b0b", "score": "0.6370341", "text": "function playRound(playerSelect, computerSelect) {\n if (playerSelect === computerSelect) {\n return roundResults.textContent = tie;\n } else if (\n playerSelect === \"rock\" && computerSelect === \"paper\" ||\n playerSelect === \"paper\" && computerSelect === \"scissors\" ||\n playerSelect === \"scissors\" && computerSelect === \"rock\") {\n\n computerScore++;\n return roundResults.textContent = loss + computerSelect + \" \" + \"beats\" + \" \" + playerSelect;\n } else if (\n playerSelect === \"rock\" && computerSelect === \"scissors\" ||\n playerSelect === \"paper\" && computerSelect === \"rock\" ||\n playerSelect === \"scissors\" && computerSelect === \"paper\") {\n\n playerScore++;\n return roundResults.textContent = win + playerSelect + \" \" + \"beats\" + \" \" + computerSelect;\n }\n}", "title": "" }, { "docid": "b2bb98f7502c8fd49860b68f6b4496ab", "score": "0.6367831", "text": "function rpsLogic(){\n if(playerOne.ready === true && playerTwo.ready === true){\n //Player one win scenarios\n if (playerOne.move === \"rock\" && playerTwo.move ===\"scissor\" || playerOne.move === \"paper\" && playerTwo.move === \"rock\" || playerOne.move === \"scissor\" && playerTwo.move === \"paper\"){\n //waitFunction(2);\n alert(\"Player \"+ playerOne.name + \" Wins!\");\n playerOne.wins++;\n playerTwo.losses++;\n \n softReset();\n \n allSave();\n imageSwapOne();\n imageSwapTwo();\n }\n //Player Two win scenarios\n if (playerTwo.move === \"rock\" && playerOne.move ===\"scissor\" || playerTwo.move === \"paper\" && playerOne.move === \"rock\" || playerTwo.move === \"scissor\" && playerOne.move === \"paper\"){\n //waitFunction(2);\n alert(\"Player \"+ playerTwo.name + \" Wins!\");\n playerTwo.wins++;\n playerOne.losses++;\n softReset();\n allSave();\n imageSwapOne();\n imageSwapTwo(); \n }\n //Tie\n if (playerOne.move === playerTwo.move){\n //waitFunction(2);\n alert(\"Wow you tied!\");\n softReset();\n allSave();\n imageSwapOne();\n imageSwapTwo();\n }\n }\n}", "title": "" }, { "docid": "2b9f3ce58b67e906a695553342a4e8be", "score": "0.6364565", "text": "function play(pick){\n\n playersChoice = pick\n select('player1', playersChoice);\n //random computer's choice\n computerChoice = computerspick(1, 3);\n select('computer', computerChoice);\n\n \n //count and add points\nlet winner = calcwinner(playersChoice, computerChoice);\n\nif( winner == 0) {\n\n message('A tie');\n} else if(winner == 1){\n\n message(\"You've scored! YAAY! =D\")\n calcPlayerScore();\n document.getElementById('player1-score').innerHTML = playerScore; \n\n} else if(winner == 2){\n\n message(\"Booo, Computer's point\");\n calcComputerScore();\n document.getElementById('computer-score').innerHTML = computerScore; \n\n}\n\nif( playerScore == 3) {\n message(\"You WON! =D\");\n\n setTimeout(function(){ \n deselect('player1', playersChoice); \n deselect('computer', computerChoice);\n document.getElementById('player1-score').innerHTML = playerScore = 0; \n document.getElementById('computer-score').innerHTML = computerScore = 0; \n message('Hey ' + playerName.toUpperCase() + \" let's start over? Pick up again!\");\n }, 2500);\n\n \n \n \n \n\n} else if( computerScore == 3) {\n message(\"You LOST! =(\");\n\n setTimeout(function(){ \n deselect('player1', playersChoice); \n deselect('computer', computerChoice);\n document.getElementById('player1-score').innerHTML = playerScore = 0;\n document.getElementById('computer-score').innerHTML = computerScore = 0; \n message('Hey ' + playerName.toUpperCase() + \" let's start over? Pick up again!\");\n }, 2500);\n \n \n\n}\n //show users choice and score\n\n setTimeout(function(){ \n deselect('player1', playersChoice); \n deselect('computer', computerChoice);\n message('Hey ' + playerName.toUpperCase() + \" !\" + \" Go on! Pick an option again an check if you can beat computer ;)\");\n \n }, 2500);\n\n \n\n \n\n}", "title": "" }, { "docid": "0c6bf456f802e25ea488d1664c27c14e", "score": "0.63623285", "text": "function start_simple_player()\r\n{\r\n //we decide who is playing the game\r\n console.log(current_player+\" is currently playing the game\");\r\n if(current_player == computer_player)\r\n {\r\n play = \"yes\";\r\n //only when it is turn of the computer, does the computer play\r\n if(play == \"yes\")\r\n auto_gamer_simple();\r\n play = \"no\";\r\n }\r\n else\r\n {\r\n play = \"no\";\r\n }\r\n}", "title": "" }, { "docid": "9337b60c80b06e827d00e66223dff642", "score": "0.63603276", "text": "function playRound(playerSelection, computerSelection)\n{\nif(playerSelection == 'rock' && computerSelection == 'rock')\n return `It's a draw!`;\nelse if(playerSelection == 'rock' && computerSelection == 'paper')\n return `You lose! Paper beats rock!`;\nelse if(playerSelection == 'rock' && computerSelection == 'scissors')\n return `You win! Rock beats scissors.`;\nelse if(playerSelection == 'paper' && computerSelection == 'paper')\n return `It's a draw!`;\nelse if(playerSelection == 'paper' && computerSelection == 'rock')\n return `You win! Paper beats rock.`;\nelse if(playerSelection == 'paper' && computerSelection == 'scissors')\n return `You lose! Scissors beats paper.`;\nelse if(playerSelection == 'scissors' && computerSelection == 'scissors')\n return `It's a draw!`;\nelse if(playerSelection == 'scissors' && computerSelection == 'rock')\n return `You lose! Rock beats scissors!`;\nelse if(playerSelection == 'scissors' && computerSelection == 'paper')\n return `You win! Scissors beats paper.`;\nelse\n return `I didn't account for this scenario. You've outsmarted me so I guess You win!`\n}", "title": "" }, { "docid": "241f202c4194f5f6bec79130555eff55", "score": "0.6355242", "text": "function playround(computerselection,playerselection){\n if(computerselection===\"Rock\" && playerselection===\"Scissors\" || \n computerselection===\"Paper\" && playerselection===\"Rock\" ||\n computerselection===\"Scissors\" && playerselection===\"Paper\"||\n computerselection===\"Rock\" && playerselection===\"Lizard\" ||\n computerselection===\"Lizard\" && playerselection===\"Spock\" ||\n computerselection===\"Spock\" && playerselection===\"Scissors\" ||\n computerselection===\"Scissors\" && playerselection===\"Lizard\" ||\n computerselection===\"Lizard\" && playerselection===\"Paper\" ||\n computerselection===\"Paper\" && playerselection===\"Spock\" ||\n computerselection===\"Spock\" && playerselection===\"Rock\" ||\n computerselection===\"Rock\" && playerselection===\"Scissors\"\n )\n return \"You Lose\"\n else if(\n playerselection===\"Rock\" && computerselection===\"Scissors\" || \n playerselection===\"Paper\" && computerselection===\"Rock\" ||\n playerselection===\"Scissors\" && computerselection===\"Paper\"||\n playerselection===\"Rock\" && computerselection===\"Lizard\" ||\n playerselection===\"Lizard\" && computerselection===\"Spock\" ||\n playerselection===\"Spock\" && computerselection===\"Scissors\" ||\n playerselection===\"Scissors\" && computerselection===\"Lizard\" ||\n playerselection===\"Lizard\" && computerselection===\"Paper\" ||\n playerselection===\"Paper\" && computerselection===\"Spock\" ||\n playerselection===\"Spock\" && computerselection===\"Rock\" ||\n playerselection===\"Rock\" && computerselection===\"Scissors\"\n )\n return \"You Win\"\n else\n current.textContent=\"Its a Tie!! Try again\";\n \n}", "title": "" }, { "docid": "56671dc57f9986a52c8838e1f547ac9f", "score": "0.6353933", "text": "function pickAction(playerChoice, computerChoice) {\n if (playerChoice === \"rock\") {\n checkWinnerRock(computerChoice);\n } else if (playerChoice === \"paper\") {\n checkWinnerPaper(computerChoice);\n } else if (playerChoice === \"scissors\") {\n checkWinnerScissors(computerChoice);\n } else if (playerChoice === \"lizard\") {\n checkWinnerLizard(computerChoice);\n } else if (playerChoice === \"spock\") {\n checkWinnerSpock(computerChoice);\n }\n}", "title": "" }, { "docid": "6e2c00b3f8c6d00efb8dd96771411f33", "score": "0.6349575", "text": "play() {\n const boardCopy = this.board.copy();\n // Update the Display.\n if(this.display) {\n this.display.draw(this.board);\n }\n\n // Ask the player to make a move.\n if(this.board.player === RED) {\n this.status.innerText = \"Player 1 to move\";\n this.player1.getMove(boardCopy, move => this.doMove(move));\n } else {\n this.status.innerText = \"Player 2 to move\";\n this.player2.getMove(boardCopy, move => this.doMove(move));\n }\n }", "title": "" } ]
274dfa0180504d7f1fd2d9f782c38834
SECTION: handle `click` event
[ { "docid": "e00fb62f476506e6e719c42b0419370b", "score": "0.0", "text": "function shouldUseClickEvent(elem) {\n\t // Use the `click` event to detect changes to checkbox and radio inputs.\n\t // This approach works across all browsers, whereas `change` does not fire\n\t // until `blur` in IE8.\n\t var nodeName = elem.nodeName;\n\t return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');\n\t}", "title": "" } ]
[ { "docid": "1f47b091e89fcfe27c334cb3cfd6ca1f", "score": "0.7879277", "text": "handleClick() {}", "title": "" }, { "docid": "a1e60203b3a756e8cf072348f9391663", "score": "0.78443426", "text": "\"on-click\"() {}", "title": "" }, { "docid": "d52552afb9d7abc548317060733963da", "score": "0.7801607", "text": "@action\n handleClick() {\n if (this.args.click !== undefined) {\n this.args.click();\n }\n }", "title": "" }, { "docid": "d688c2138749fe678f3f9c2c6489711d", "score": "0.77010494", "text": "click(event) {\n this._handleAction('on-click', this._getValue(), event);\n }", "title": "" }, { "docid": "d61131bac2e1652b6615fc7555bb0e1e", "score": "0.75492567", "text": "handleClick(event) {}", "title": "" }, { "docid": "738251de42d1466cee63e3d9b21e7c8f", "score": "0.7538753", "text": "function clickHandler(event) {\n\tpressButton(event.target);\n}", "title": "" }, { "docid": "00f6f81df3adb20a3dd3611594c5729a", "score": "0.753811", "text": "function handleClick(evt) {\n}", "title": "" }, { "docid": "112fd944399678e475771999a9005827", "score": "0.75284064", "text": "function clickHandler(){\n console.log('Button Clicked');\n }", "title": "" }, { "docid": "7863fa03f50c45c3e2e764c3207cf1d1", "score": "0.75053465", "text": "function handleClick() {\n\t\tconsole.log(\"user Clicked\");\n\t}", "title": "" }, { "docid": "54982c69dc09e651aae440e5746b5b0f", "score": "0.7413424", "text": "function Click() {\n console.log(\"Clicked...\");\n }", "title": "" }, { "docid": "fd9dea43022ddfc43cf2600a1b3d5b63", "score": "0.7379595", "text": "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "title": "" }, { "docid": "fd9dea43022ddfc43cf2600a1b3d5b63", "score": "0.7379595", "text": "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "title": "" }, { "docid": "fd9dea43022ddfc43cf2600a1b3d5b63", "score": "0.7379595", "text": "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "title": "" }, { "docid": "7555e64cae546bf9585ec4e0c13cf992", "score": "0.7306097", "text": "function handleClick(e) {\n //Pass the event facade to the logger or console for\n //inspection:\n Y.log(e);\n}", "title": "" }, { "docid": "b04d977922d8d95577797c35ce14b0f3", "score": "0.7234957", "text": "function runClick(e){\n\t\t\talert(\"got click\");\n\t\t}", "title": "" }, { "docid": "70d3e75beffc58568eeceb9da87a1cbe", "score": "0.71607476", "text": "function click_handler(event) {\n\t\tconst { component, ctx } = this._svelte;\n\n\t\tcomponent.fire('change', ctx.page.component);\n\t}", "title": "" }, { "docid": "02561db9d68a13d870116c8b3c3a0388", "score": "0.71457535", "text": "function handleClick() {\n // toggles click true/false\n setClick(!click);\n }", "title": "" }, { "docid": "3143bda23e3ceda06d60f28f49c14700", "score": "0.71363443", "text": "click(event){\n alert('click')\n }", "title": "" }, { "docid": "b9ee2c6c8489f435b51cf5527dba7f95", "score": "0.71333385", "text": "onClick(e){}", "title": "" }, { "docid": "06b871c15f0b450e01a3a1f010dbe233", "score": "0.7114426", "text": "function click() {\n\n}", "title": "" }, { "docid": "8168c5432f5e7b2d75ae6798db4af789", "score": "0.7082111", "text": "function handleClick (e) {\n e.preventDefault();\n console.log('clicked');\n }", "title": "" }, { "docid": "8f6d01c663553fe85e0da3d412d73c4a", "score": "0.7080223", "text": "function handleClick() {\n setClicked(!clicked);\n }", "title": "" }, { "docid": "10b0956820bdc1e2382706ad833b4f94", "score": "0.7071997", "text": "handleClick(e) {\n let callback = this._callback;\n callback(e);\n }", "title": "" }, { "docid": "10b0956820bdc1e2382706ad833b4f94", "score": "0.7071997", "text": "handleClick(e) {\n let callback = this._callback;\n callback(e);\n }", "title": "" }, { "docid": "c0c4981ba3a00681cee8b0a9466ca933", "score": "0.705962", "text": "handleClick(e) {\n e.preventDefault();\n // console.log('The link was clicked.');\n alert('hello');\n }", "title": "" }, { "docid": "917474f63728f71462a48539d699c487", "score": "0.70008606", "text": "click(event) {\n const values = this.calc(event);\n this.get('on-click')(values);\n }", "title": "" }, { "docid": "519e090c311d68c817e6805b3be0b2c9", "score": "0.695248", "text": "function clicked() {\n console.log('btn clicked');\n}", "title": "" }, { "docid": "4aed8302a75b297cb35beb8320bf1216", "score": "0.693104", "text": "onClick() {}", "title": "" }, { "docid": "bc58ac1066f32bdba31b6d457ca6c18f", "score": "0.6889435", "text": "handleClicked(_status)\n {\n this.clicked = _status;\n }", "title": "" }, { "docid": "3a190a18b4eace2444dbc9eb03b6a56e", "score": "0.68813616", "text": "clickHandler() {\r\n\t\tif (this.clickMethod && this.targetContext && this.targetContext.data) {\r\n\t\t\tif (this.targetContext.data[this.clickMethod] instanceof Function) {\r\n\t\t\t\tthis.targetContext.data[this.clickMethod](this.data, this.getFormData());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7826f975555d7efece22a6d308825b58", "score": "0.6880711", "text": "onClick(e) {\n\t\t\t\t\t\t\thandleClick(openIndex)\n\t\t\t\t\t\t}", "title": "" }, { "docid": "feceb8c082c6d25fdf46c16812955dee", "score": "0.6876148", "text": "function processClickEvent(event) {\n // Hago algo cuando recibo el click\n}", "title": "" }, { "docid": "ec711fda00e4b14fb6bc7a4dad7c49c6", "score": "0.6850761", "text": "function clickEvent(){\n if(allowclick == 0){\n\t\tdoit();\n\t\t$(\"body\").on('click');\n }else{\n \n }\n\t}", "title": "" }, { "docid": "f237bc0f4f025c15b6ce1facb2434d79", "score": "0.6841974", "text": "function mouseClicked() { // For testing\n}", "title": "" }, { "docid": "8f3801a54112b8a0bb58002a7ae236d6", "score": "0.68306917", "text": "function clicked() {\r\n console.log('the button was clickedd')\r\n\r\n}", "title": "" }, { "docid": "5204833310e2f95ca9f69cedabda1cb7", "score": "0.6812262", "text": "_handleClick(event){\n // prevent default behavior\n event.preventDefault();\n }", "title": "" }, { "docid": "6ea3526bbbc2c28a40ec8bfe7be9f940", "score": "0.6800166", "text": "function clicked(){\n console.log('The button was clicked'); \n}", "title": "" }, { "docid": "30a7884b37c1ab94ce4a65c13abb2ed2", "score": "0.6763993", "text": "doClick() {\n return null;\n }", "title": "" }, { "docid": "bc2563081d251f5899a5a0acf82d5217", "score": "0.67361325", "text": "function click(r){\n if (r.type in clickHandlers && !clickedNodes.has(r.id))\n {\n getClickHandler(r).apply(this,[r]);\n\n clickedNodes.set(r.id,r);\n }\n }", "title": "" }, { "docid": "ac5866270bfcae965174aa61fcb51b07", "score": "0.6727638", "text": "Click() {\n if (this.Handle)\n this.Handle.click();\n }", "title": "" }, { "docid": "c39bc8ed60443a54062ff72d8c905a53", "score": "0.67222685", "text": "function click(e)\n {\n title = $('.title .text', e.currentTarget).text();\n where = $('.where .text', e.currentTarget).text();\n when = $('.when .text', e.currentTarget).text();\n arguments = [title, where, when].join(':');\n execute('app://calendar:' + arguments);\n }", "title": "" }, { "docid": "408523560406cea59fba9f99b029dfbc", "score": "0.67218995", "text": "function handleClick(e) {\n\t\te.preventDefault();\n \tconsole.log('The header was clicked.');\n\t}", "title": "" }, { "docid": "25317d0ec24b353116f402771e3f8981", "score": "0.6706858", "text": "onClick( ) {\n\n }", "title": "" }, { "docid": "25317d0ec24b353116f402771e3f8981", "score": "0.6706858", "text": "onClick( ) {\n\n }", "title": "" }, { "docid": "6d3d2847fff34f933543c19ada3e91ac", "score": "0.6703542", "text": "onClick(event) {\n this.$emit('click', event);\n }", "title": "" }, { "docid": "6d3d2847fff34f933543c19ada3e91ac", "score": "0.6703542", "text": "onClick(event) {\n this.$emit('click', event);\n }", "title": "" }, { "docid": "6d3d2847fff34f933543c19ada3e91ac", "score": "0.6703542", "text": "onClick(event) {\n this.$emit('click', event);\n }", "title": "" }, { "docid": "d11b5f9cddae062b4b666e7e34e1ff5a", "score": "0.6702877", "text": "function actionOnClick() {\n console.log(\"button clicked\");\n }", "title": "" }, { "docid": "1ea8b1970fe2cc5c1ada5efcc2f3cb5f", "score": "0.670008", "text": "function setUpClickHandler() {\n mapview.on(\"click\", function (event) {\n mapview.hitTest(event).then(function (response) {\n var results = response.results;\n if (results.length > 0) {\n for (var i = 0; i < results.length; i++) {\n // Check if we're already editing a graphic\n if (!editGraphic && results[i].graphic.layer.id === \"tempGraphics\") {\n // Save a reference to the graphic we intend to update\n editGraphic = results[i].graphic;\n\n // Remove the graphic from the GraphicsLayer\n // Sketch will handle displaying the graphic while being updated\n graphicsLayer.remove(editGraphic);\n sketchViewModel.update(editGraphic);\n break;\n }\n }\n }\n });\n });\n }", "title": "" }, { "docid": "aa659ba3e25d54d4c2e37eec4a5168aa", "score": "0.67000467", "text": "onTap_() {}", "title": "" }, { "docid": "26e6681ebce0a8686a731b6297572e9b", "score": "0.6692808", "text": "onClick(){ }", "title": "" }, { "docid": "86f5a3560df167c40b2a6caf2a48840f", "score": "0.66822153", "text": "function onClickHandle(data) {\n}", "title": "" }, { "docid": "5eaa1915f445d52fd068e587cd76c7f2", "score": "0.66801834", "text": "function clickButton() {\n console.log(\"clicked!\");\n}", "title": "" }, { "docid": "e4e8b7fbaf2d3d7f7862eb5b6cea3fba", "score": "0.66786474", "text": "function click($el) {\n $el.click();\n }", "title": "" }, { "docid": "bb26fc75a753c9d7d3d3d43bf8d1713c", "score": "0.66526467", "text": "click(){\n //Whatever you want to happen when you click this item\n app.quit();\n }", "title": "" }, { "docid": "716dc2894f76c34edb3f8ccd3ede030e", "score": "0.66490763", "text": "function handleClick(e) {\n\t\t\t\t\tvar activePoints = $scope.myChart.getElementsAtEvent(e);\n\t\t\t\t\tvar firstPoint = activePoints[0];\n\t\t\t\t\tvar label = $scope.myChart.data.labels[firstPoint._index];\n\t\t\t\t\tvar value = $scope.myChart.data.datasets[firstPoint._datasetIndex].data[firstPoint._index];\n\t\t\t\t\tif ($scope.handlers.onClick) $scope.handlers.onClick(firstPoint._index, label, value);\n\t\t\t\t}", "title": "" }, { "docid": "3058e6855613bc34d733aa5658bf5c3d", "score": "0.6633403", "text": "click(/* event */) {\n get(this, 'accordion').send('_onPanelSelection', get(this, 'panel'));\n }", "title": "" }, { "docid": "9bd85072663febbe3586d10015e7c95d", "score": "0.6620017", "text": "function clickHandler(event) {\n event.preventDefault();\n console.log(\"Click event occurred.\");\n}", "title": "" }, { "docid": "6550b83e7e77cea02d8a2f054a6f4d85", "score": "0.6617877", "text": "clickFunction(event) {\n alert(\"clicked\" + event.target.id);\n }", "title": "" }, { "docid": "0191c3e21ad883a0e44ec1b61f08cb6c", "score": "0.6611641", "text": "function onClick() {\n if (mCheckbox.is(\":checked\")) {\n mLastValue = settings.isclicked;\n mHint.text(settings.isclicked);\n settings.oncheckboxclick(settings.isclicked);\n } else {\n mLastValue = settings.notclicked;\n settings.oncheckboxclick(settings.notclicked);\n mHint.text(settings.notclicked);\n }\n //mCheckbox.text(aText);\n //settings.ondropdownclick(aText);//external clickListener\n }", "title": "" }, { "docid": "4f1943b52d65d68cb295ae1f0f286772", "score": "0.6606377", "text": "function clicked(){\n console.log(\"The button was clicked\");\n}", "title": "" }, { "docid": "a0e5af15ca757675177ab181a7520e9f", "score": "0.6603817", "text": "clickOut(e) {\n\n\t}", "title": "" }, { "docid": "8821e3121dd0a0c633c777c0a72c27ab", "score": "0.6601483", "text": "handleEventClick(clickInfo) {\r\n\t\tthis.props.openEditModal(clickInfo.event.id);\r\n\t}", "title": "" }, { "docid": "f77d1b1a79649ded8dee19a11dd80d79", "score": "0.6600002", "text": "set clickEvent(event){\n this._clickEvent = event;\n this.render();\n }", "title": "" }, { "docid": "73293acad8ed8feef0e52c85241a9726", "score": "0.65992534", "text": "function clickListItem (e) {\n if (e.target && e.target.click) {\n e.target.click();\n }\n}", "title": "" }, { "docid": "26712773193741f0f5e9d9156c0feca0", "score": "0.6595109", "text": "function handleClick(e) {\n is_inside_frame = isClickInsideFrame(e);\n\n // If click outside the frame/form, remove it.\n if (!is_inside_frame) removePopup(true, true);\n\n // If the modifier is held down and we have a selection, create a pop-up.\n if (checkModifier(options.clickModifier, e)) {\n var query = getTrimmedSelection();\n if (query !== '') {\n if (is_inside_frame) {\n if (last_query) breadcrumbs.push(last_query);\n navigateFrame(query);\n } else {\n breadcrumbs = [];\n createPopup(query, e.pageX, e.pageY, e.clientX, e.clientY, false);\n }\n e.preventDefault();\n getSelection().removeAllRanges();\n }\n }\n }", "title": "" }, { "docid": "d8da77a95a211801485005eb56a87357", "score": "0.65886736", "text": "function click() {\n d3_eventCancel();\n w.on(\"click.drag\", null);\n }", "title": "" }, { "docid": "5a9560cf56b3a204b2a485149f9dd3a5", "score": "0.65858954", "text": "_delegateClickEvent(e) {\n if (e.target === this) {\n this.querySelector('input').click();\n }\n }", "title": "" }, { "docid": "a2176c81cf5de21b657678f2417305d7", "score": "0.6584839", "text": "async handleButtonClick(row, col){\n const section = this._getSectionFromCoordinate(row, col);\n return obsService.goToScene(section.id)\n }", "title": "" }, { "docid": "0d2c5d986be7900ebca76c895763c1bc", "score": "0.657372", "text": "handleClick(e){\n e.preventDefault();\n console.log(\"Button has been clicked!\");\n }", "title": "" }, { "docid": "8a4847b1494ec08332918c6d5be9ecfc", "score": "0.6552641", "text": "function click(e) {\r\n\t\tif(!e && typeof e=='string') e=document.getElementById(e);\r\n\t\tif(!e) return;\r\n\t\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\r\n\t\tevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\r\n\t\te.dispatchEvent(evObj);\r\n\t}", "title": "" }, { "docid": "9b2875a63c97ca42a8e0444e3ff0dbc1", "score": "0.65488476", "text": "handleClick(e) {\n\t\tthis.refs.fileUploader.click();\n\t}", "title": "" }, { "docid": "bc05660f95b4566081db39237ecff120", "score": "0.6530594", "text": "async function _handleClick(clickInfo) {\n const store = overwolf.windows.getMainWindow().reduxStore;\n store.dispatch(mouseClickAction);\n}", "title": "" }, { "docid": "9685e460518d45a502b46702ea1e8b60", "score": "0.65292424", "text": "mouseClicked()\n {\n // virtual\n }", "title": "" }, { "docid": "786e5eb801d023e21f2c0a96d5e55b84", "score": "0.65227044", "text": "_click(e) {\n e.preventDefault();\n const type = this.cel.getAttribute('data-type');\n\n this[type]();\n }", "title": "" }, { "docid": "7e77a84f480aeb87c31f04e06077d1fd", "score": "0.65214133", "text": "function evtClick(e) {\n\t\t\t//if (!!$(this).closest('.ui-acco-wrap').find('.ui-acco-pnl').length) {\n\t\t\te.preventDefault();\n\t\t\tvar $this = this,\n\t\t\t\t$optAcco = $this.closestByClass('ui-acco');\n\n\t\t\t$ui.uiAccordionToggle({ \n\t\t\t\tid: $optAcco.getAttribute('data-id'), \n\t\t\t\tcurrent: [$this.getAttribute('data-n')], \n\t\t\t\tclose: $optAcco.getAttribute('data-close'), \n\t\t\t\tcallback:$optAcco.getAttribute('data-callback')\n\t\t\t});\n\t\t\t//}\n\t\t}", "title": "" }, { "docid": "e8d9f5984b096569998fe8328bb2f906", "score": "0.6512674", "text": "function handleClick () {\n alert(\"We should drink rose\");\n}", "title": "" }, { "docid": "28ec59ec2dfd0a775d9eaad182642bc6", "score": "0.65109503", "text": "onClick(event) {\n if (event.target === this._element) {\n this.notifyClick(event);\n }\n }", "title": "" }, { "docid": "36b5e11987a4e5ffe7d8557ddda22e05", "score": "0.65101445", "text": "click (event) {\n // Acceptable event modifiers\n // When the checkbox is the target a simple click is equivalent to a specific select\n const isSpecificSelect = isSimpleClick(event) ||\n ((new UAParser()).getOS() === 'Mac OS' ? event.ctrlKey : event.metaKey) // TODO Move instance to a service\n const isRangeSelect = event.shiftKey\n\n // Only process simple clicks or clicks with the acceptable modifiers\n if (isSpecificSelect || isRangeSelect) {\n event.preventDefault()\n event.stopPropagation()\n\n this.onSelect({\n isRangeSelect,\n isSpecificSelect,\n item: this.get('item')\n })\n }\n }", "title": "" }, { "docid": "87f975f33ccf8ef6692b582685a284e0", "score": "0.6499392", "text": "function doOnClick( event ) {\n var target = event.element();\n var action = self[\"onclick_\"+target.className];\n action(target);\n }", "title": "" }, { "docid": "22518eff192a299b3116dae0306fce2e", "score": "0.6498985", "text": "catchClickEvents() {\n this.jqElement.on('click', function(ev) {\n const url = $(this).data('url');\n if (typeof url !== 'undefined') {\n window.location = url;\n }\n });\n }", "title": "" }, { "docid": "b1400cd47c53ceaecf5cfd92822b3363", "score": "0.6495155", "text": "click (el, cb) {\n console.log('click', el.tagName, el.className)\n const tap = new Event('weex$tap', { bubbles: true, cancellable: true })\n el.dispatchEvent(tap)\n setTimeout(function () {\n el.click && el.click()\n setTimeout(function () {\n cb && cb()\n }, 25)\n }, 200)\n }", "title": "" }, { "docid": "f62668f1da72e86a9322b0d51a01137e", "score": "0.6493683", "text": "function liClickHandler(e) {\n /* jshint validthis: true */\n // this == elem clicked\n context._handleDOMToolClick(e, this.id, context);\n\n context._handleToolClick(e, this.id, context);\n }", "title": "" }, { "docid": "c4ce5e0ed2555f4aba5d1b25a2ca73b1", "score": "0.6486534", "text": "handleClick() {\n if (!this.callbacks.checkIfLoadingApps()) {\n this.callbacks.changeAppLoadingStatus(true);\n this.callbacks.showApps(this.word);\n this.callbacks.showRelatedWords(this.word);\n\n $(\".image-wrapper > div\").removeClass(\"selected\");\n this.domElement.addClass(\"selected\");\n\n $(\".image-refresh-button\").css(\"visibility\", \"hidden\");\n this.domElement.find(\".image-refresh-button\").css(\"visibility\", \"visible\");\n\n $('.relevant').show('slow');\n $('.app-instructions').remove();\n $(\".app-container>*\").show();\n $('.syn i').removeClass('flipped');\n }\n }", "title": "" }, { "docid": "e74074e89e6f6b8626376d2ec6d87ee7", "score": "0.6478911", "text": "function liClickHandler(e) {\n /* jshint validthis: true */\n // this == elem clicked\n context._handleDOMToolClick(e, this.id, context);\n context._handleToolClick(e, this.id, context);\n }", "title": "" }, { "docid": "50c4750b0403946cc502ba7e53dcbaeb", "score": "0.64523137", "text": "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "title": "" }, { "docid": "50c4750b0403946cc502ba7e53dcbaeb", "score": "0.64523137", "text": "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "title": "" }, { "docid": "d3e155ba93b2c26cba152d11449018d2", "score": "0.64405674", "text": "handleClick(event) {\n event.preventDefault();\n var i = event.currentTarget.dataset.id;\n console.log('key' + this.contacts[i]);\n fireEvent(this.pageRef, 'selectedContact', this.contacts[i]);\n }", "title": "" }, { "docid": "f1a83702191ecf29e84b78398b25f776", "score": "0.64304554", "text": "function clicked(event) {\n\n let ePhase = event.eventPhase;\n switch (ePhase) {\n case 0:\n console.log(\"Event.NONE\");\n break;\n case 1:\n console.log(\"Event.CAPTURING_PHASE\");\n break;\n case 2:\n console.log(\"Event.AT_TARGET\");\n break;\n case 3:\n console.log(\"Event.BUBBLING_PHASE\");\n break;\n default: break;\n }\n}", "title": "" }, { "docid": "44f137dad2fa1ae3ccd3a71cbada45f2", "score": "0.64283746", "text": "_handleClick(event) {\n if (!event.graphic.attributes) {\n return;\n }\n\n // Show the info window for our point\n this._map.infoWindow.setTitle(event.graphic.attributes.title);\n this._map.infoWindow.setContent(event.graphic.attributes.details);\n\n // Call all the click handlers\n this._clickHandlers.forEach(f => f(event));\n\n $(this._map.infoWindow.domNode).find('.actionList').addClass('hidden'); //massive hack to remove the Zoom To actionlist dom.\n this._map.infoWindow.show(event.mapPoint); //show the popup, callsbacks will fill data as it comes in\n }", "title": "" }, { "docid": "74182c5f22fb11cb11757849ae632397", "score": "0.642575", "text": "function clickHandler(e) {\n\n // Figure out whether to prevent default\n var $el = $(e.target);\n\n // Find the nearest tappable ancestor\n if (!$el.is(touchSelectors.join(', '))) {\n $el = $(e.target).closest(touchSelectors.join(', '));\n }\n\n // Prevent default if we found an internal link (relative or absolute)\n if ($el && $el.attr('href') && !$el.isExternalLink()) {\n e.preventDefault();\n } else {\n }\n\n // Trigger a tap event if touchstart is not on the job\n if ($.support.touch) {\n } else {\n $(e.target).trigger('tap', e);\n }\n\n }", "title": "" }, { "docid": "9841b95514a43901519249d1744caf27", "score": "0.6422572", "text": "function onClick(event){\n\t\t\n\t\t//double tap action\n\t\tif(g_objTouchSlider && g_objTouchSlider.isTapEventOccured(event) == false)\n\t\t\treturn(true);\n\t\t\n\t\tg_objThis.trigger(t.events.CLICK, event);\n\t\t\t\n\t\t\n\t}", "title": "" }, { "docid": "1138bfdba130b48d86707827f5c54dcd", "score": "0.64203155", "text": "handleClick(event) {\n event.preventDefault();\n }", "title": "" }, { "docid": "64d5228983e07da4a5f2b7b1f0251b98", "score": "0.64195424", "text": "function handleOnClick(e) {\n sceneManager.handleOnClick(e);\n}", "title": "" }, { "docid": "b31f755c1722d101169f0bfef9f6d628", "score": "0.6417615", "text": "function handleClick(){\n cardClick(event);\n displayStats();\n}", "title": "" }, { "docid": "13b5c93cfea5e310e4172d4cecf74f18", "score": "0.6410123", "text": "function CommonClient__clickHandler(e) {\n\t\tif (e.button !== 0) { return; } // handle left-click only\n\t\tif (e.target.target == '_top') { return; }\n\t\ttrackFormSubmitter(e.target);\n\t\tvar request = extractRequest.fromAnchor(e.target);\n\t\tif (request) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tdispatchRequestEvent(e.target, request);\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "ab514a000dcd27d0caf63baa260fa4a0", "score": "0.6405661", "text": "function click(e, type) {\r\nif(!e && typeof e=='string') e=document.getElementById(e);\r\nif(!e) {return;}\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "title": "" }, { "docid": "c013cb56fabf01eb229f6979e33ad8f2", "score": "0.6398796", "text": "_evtClick(event) {\n let target = event.target;\n switch (target) {\n case this.revertButtonNode:\n this._setValue();\n break;\n case this.commitButtonNode:\n if (!this.commitButtonNode.hidden && !this.hasClass(ERROR_CLASS)) {\n this._changeGuard = true;\n this._mergeContent();\n this._changeGuard = false;\n this._setValue();\n }\n break;\n case this.titleNode:\n case this.collapserNode:\n if (this.collapsible) {\n let collapser = this.collapserNode;\n if (collapser.classList.contains(COLLAPSED_CLASS)) {\n collapser.classList.remove(COLLAPSED_CLASS);\n this.editorHostNode.classList.remove(COLLAPSED_CLASS);\n }\n else {\n collapser.classList.add(COLLAPSED_CLASS);\n this.editorHostNode.classList.add(COLLAPSED_CLASS);\n }\n }\n break;\n case this.editorHostNode:\n this.editor.focus();\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "0f07240fcd5160ac66c0fa2a05bd0263", "score": "0.63936424", "text": "click(event) {\n // Changes scoreboard\n event.target.value ? this.scoreboard[event.target.value]++ : null;\n\n // Updates counter\n this.answerCounter += 1;\n\n // If that is still questions to be printed,\n // prints next question, else\n // captures lead\n this.answerCounter !== this.contentArray.length ? this.printQuiz() : this.leadGenerator();\n\n // Gets the focus out of the button\n event.target.blur()\n }", "title": "" }, { "docid": "0833479eb229077b407923f8c7790b1c", "score": "0.638606", "text": "handleClick(e) {\n e.preventDefault();\n\n if (e.currentTarget.value) {\n this.handleSetBanner(parseInt(e.currentTarget.value));\n this.props.history.push(`${ this.props.banners[e.currentTarget.value].title }/`)\n } else {\n this.handleSetBanner(this.getToggle(e.currentTarget.id));\n }\n }", "title": "" }, { "docid": "c23fa63b96ac08eaba30931233b14ab7", "score": "0.6378845", "text": "_handleClickToConfirm(){\n\t\tthis.BikeDetP.confirmFound(this.state.rawData,this.alertConfirmCallback);\n\t}", "title": "" } ]
cbb38cbb9a4b78bb544c0740eadf6da8
para el inicio de sesion, busca un usuario en la base de datos
[ { "docid": "01c61f72e24541624417c6b1f9bdd50d", "score": "0.5462175", "text": "oneUser (req, res, next){\n let user = {\n email: req.body.Email,\n password: req.body.Password\n }\n console.log (user);\n\n uc.getOneUser(user, (err, docs)=>{\n if(err){\n res.status(400);\n res.json({success:false,msg:\"No se pudo extraer los datos\"})\n }\n else{\n if (docs != null)\n {\n res.json(docs)\n }\n\n else {\n res.json({success:false,msg:\"No se encontro al usuario\"})\n }\n\n }\n console.log(\"busco \" + user.email + \" y \" + user.password)\n\n })\n\n }", "title": "" } ]
[ { "docid": "9baad372478aa3cbbe2ca845758b28f4", "score": "0.63742447", "text": "function getUsers(){\n // Creamos una promesa y la devolvemos\n return new Promise((resolve, reject) => {\n // Hacemos la llamada a la bbdd\n CONN.query('SELECT * FROM usuarios', (error, rows) => {\n // Cuando la bbdd nos devuelva los datos resolvemos la promesa\n resolve(rows);\n })\n })\n}", "title": "" }, { "docid": "a6f4e54025ac8b249505e56836a36cc5", "score": "0.6252388", "text": "function obtenerDatosUsuario()\n {\n var promesa = InformacionUsuarioServ.obtenerDatosUsuario();\n\n if(promesa !== undefined)\n {\n promesa.then(function() {\n vm.nombreUsuario = InformacionUsuarioDatos.getNombreUsuario() + \" \" + InformacionUsuarioDatos.getApellidoUsuario();\n vm.tipoUsuario = InformacionUsuarioDatos.getTipoUsuario();\n vm.sociales = InformacionUsuarioDatos.getSocial();\n });\n }\n }", "title": "" }, { "docid": "68bb3103e37764554a4f7b2c109b4e0c", "score": "0.6236595", "text": "searchUser(userName){\n const user = this.buscador.searcForName(userName, this.users);\n this.checkElemento(user,'usuario',userName);\n return user;\n }", "title": "" }, { "docid": "aa3a9272d67018912bb15335f56d0065", "score": "0.62339395", "text": "function buscarUsuario(req, res) {\n User.findById(req.params.id, function (err, user) {\n if (err) return res.status(500).send(\"Se ha producido un problema al encontrar al usuario.\");\n if (!user) return res.status(404).send({auth:false, mensaje: 'Usuario no encontrado.', id: req.params.id});\n res.status(200).send({auth: true, mensaje: 'Se devuelve el usuario', user: user});\n });\n}", "title": "" }, { "docid": "e78f3645672fc55b420e977d40f1c457", "score": "0.6233331", "text": "async function cargarUsuario() {//hacemos la funcion asincrona aqui dentro porue fuera no se puede\n if (!getToken()) {//si no existe un token\n setCargandoUsuario(false);//no se puede cargar el usuario insertado en localstorage porque no hay\n return;//y lo retornamos\n }\n\n try {\n const { data: usuario } = await Axios.get('/api/usuarios/whoami');//si la llamada es exitosa el servidor nos retorna un usuario que en laza con el endpoint del backend\n setUsuario(usuario);//actualizamos la informacion de usuario\n setCargandoUsuario(false);//cambiamos a false porque ya no tenemos que seguir cargando al usuario\n } catch (error) {\n console.log(error);//en caso de que haya un error\n }\n }", "title": "" }, { "docid": "c5b0a4bf06c89a7b74c75dad6485eefe", "score": "0.61410016", "text": "getUserById(id){\n const user = this.buscador.elementoById(id,this.users); \n this.checkElemento(user,'No se encontro el usuario con ID '+ id); \n return user;\n }", "title": "" }, { "docid": "9e07fa4fef574c44b2e7ac2659b14cc9", "score": "0.6123594", "text": "async function getUsuario() {\n\n\tvar queryUser = dbRef.child(\"users\");\n\tvar snap_user = await queryUser.orderByChild('uid').equalTo(usuarioLogeado.uid).once(\"value\");\n\tif (snap_user.val() != null) {\n\t\tvar key = Object.keys(snap_user.val())[0];\n\t\tvar val = Object.values(snap_user.val())[0];\n\n\t\tusuarioLogeado.nombrePerfil = val.name + \" \" + val.lastname;\n\t\tusuarioLogeado.actividades = val.actividades;\n\t\tconsole.log(\"getUsuario() => usuarioLogeado.uid: \" + usuarioLogeado.uid);\n\t} else {\n\t\tconsole.log(\"getUsuario() => Usuario no encontrado\");\n\t}\n}", "title": "" }, { "docid": "cb1590abbffed57e7bc42b02e5f7205d", "score": "0.60294026", "text": "function getUsuarioActivo( nombre ) {\n return {\n uid: 'ABC4385',\n username: nombre,\n }\n}", "title": "" }, { "docid": "9840f559ac106ce5b7f24b30a08207c8", "score": "0.5974068", "text": "async obtenerDatosRegistro() {\n\t\tlet resultados = {};\n\t\tlet fila = {};\n\t\tlet instruccionSQL = '';\n\t\tconst idNumerico = (typeof this.id === 'number' ? true : false);\n\n\t\tif (idNumerico === true) {\n\t\t\tinstruccionSQL = `\nSELECT\n\tusuario::text,\n\ttyc_aceptadas::boolean,\n\tctc::boolean,\n\tverificado::boolean\nFROM usuarios\nWHERE (\n\tid = $1\n)`;\n\t\t} else {\n\t\t\tinstruccionSQL = `\nSELECT\n\tid::bigint,\n\ttyc_aceptadas::boolean,\n\tctc::boolean,\n\tverificado::boolean\nFROM usuarios\nWHERE (\n\tusuario = $1\n)`;\n\t\t}\n\n\t\ttry {\n\t\t\tresultados = await baseDatos.query(instruccionSQL, [ this.id ]);\n\t\t\tif (resultados.rowCount > 0) {\n\t\t\t\tfila = resultados.rows[0];\n\t\t\t\tif (idNumerico === true) {\n\t\t\t\t\tthis.registro.usuario = fila.usuario;\n\t\t\t\t} else {\n\t\t\t\t\tthis.registro.usuario = this.id;\n\t\t\t\t\tthis.id = parseInt(fila.id);\n\t\t\t\t}\n\t\t\t\tthis.registro.registrado = true;\n\t\t\t\tthis.registro.tycAceptadas = fila.tyc_aceptadas;\n\t\t\t\tthis.registro.ctc = fila.ctc;\n\t\t\t\tthis.registro.verificado = fila.verificado;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthrow e;\n\t\t}\n\t}", "title": "" }, { "docid": "ac66b802096fe816fee175b42d4eb52e", "score": "0.59677404", "text": "function getUsuarioActivo(nombre){\nreturn {\n uid: 'ABC64442',\n username : nombre\n}\n}", "title": "" }, { "docid": "f24efee4fb228da5c16d071b5ef65dc3", "score": "0.5955902", "text": "static selecteUsre(inputs, CallBack) {\n\n connexion.query(\"SELECT * FROM utilisateur WHERE email =? AND mdp =?\", [inputs.email, sha1(inputs.password)], (err, result) => {\n if (err) {\n // mal de connection mot de passe ou pseudo peut etre faut \n CallBack(\"error\");\n } else {\n // bien connecter\n CallBack(result[0]);\n }\n });\n }", "title": "" }, { "docid": "9390b5bc11f388e6fc9961a2c32811a3", "score": "0.59534866", "text": "function getUsuarioActivo(nombre) {\n return {\n uid: 'ABCDEF',\n username: nombre,\n }\n}", "title": "" }, { "docid": "06312777adbc866d02de3e3f846dff8b", "score": "0.5944164", "text": "function loginUser(req, res){\n\t// Recogemos los datos del formulario:\n\tvar params = req.body;\n\tvar username = params.emailusua;\n\tvar password = params.passusua;\n\n\t// Query para comprobar usuario y contraseña en la base de datos:\n\n\tUser.findOne({emailusua: username}, (err, user)=>{\n\t\t// Si existe algun error:\n\t\tif (err) return res.status(500).send({ message: 'Error en la peticion, Revisa la conexion a la base de datos' });\n\t\tif (user) {\n\t\t\t// Encriptamos el password y comparamos utilizando el metodo \"compare\":\n\t\t\tbcrypt.compare(password, user.passusua, (err, check) =>{\n\t\t\t\tif (check) {\n\t\t\t\t\t// check es un parametro para determinar el chequeo es decir, que todo va bien\n\t\t\t\t\t// Si check es correcto, devolverempos un token:\n\t\t\t\t\tif (params.gettoken) {\n\t\t\t\t\t\t// Generar y Devolver token:, importante crear carpeta services, y dentro el archivo jwt.js\n\t\t\t\t\t\treturn res.status(200).send({\n\t\t\t\t\t\t\ttoken: jwt.createToken(user)\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// A esta altura crear la carpeta middleware\n\t\t\t\t\t}else{\n\t\t\t\t\t\t// Devolvemos datos de usuario:\n\t\t\t\t\t\treturn res.status(200).send({ user });\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t// Si no va bien, retornamos:\n\t\t\t\t\treturn res.status(404).send({ message: 'El usuario no ha sido identificado' });\n\t\t\t\t}\n\t\t\t});\n\t\t}else{\n\t\t\treturn res.status(404).send({ message: 'El usuario no ha sido identificado o no existe!!' });\n\t\t}\n\t}); // Fin de la consulta\n}", "title": "" }, { "docid": "71f8098cc72eb8bc68b53311996769b7", "score": "0.5940843", "text": "getUsers(){\n this.checkCantElements(this.users,'No hay usuarios en la app');\n return this.users;\n }", "title": "" }, { "docid": "13751af3204bf38866bb8930ba2d3b0f", "score": "0.5931425", "text": "function getUser(){\n var myDataRef=new Firebase('https://userempowerlabs.firebaseio.com/');\n myDataRef.on('value', function(nameSnapshot) {\n\n $(\"#nav-accordion\").find(\"li\").remove();/*limpio los usuario que estan mostrandose en el lateral izquierdo*/\n $(\"#integrantes\").find(\"li\").remove();/*limpio los usuario que estan mostrandose en el modal*/\n listOfUsers=[];\n nameSnapshot.forEach(function(item_){\n var nameSnapshott = item_.val();//obtengo los objetos \n var addUser = new Object();\n addUser.Name=nameSnapshott.name;\n addUser.Password=nameSnapshott.password;\n addUser.id=nameSnapshott.id;\n addUser.email=nameSnapshott.email;\n addUser.rol=nameSnapshott.rol;\n if(addUser.rol==\"usuario\") \n {\n listOfUsers.push(addUser);\n /*No muestres a tu usuario*/\n if($.session.get(\"EmailUser\")!=addUser.email)\n {\n showUserConnect(addUser);\n /*agregalo en el modal para crear un grupo*/\n UseronGroup(addUser);\n }\n }\n })\n getUsergroup();\n\n\n } );\n }", "title": "" }, { "docid": "bee1b33153cd0a7d63cb8d215deef89f", "score": "0.59082675", "text": "function loadUser() {\r\n makeHTTPRequest(`/usuarios/0`, 'GET', '', cbOk1);\r\n}", "title": "" }, { "docid": "dda625779fdc25c20b1cff31a25dcea1", "score": "0.59035224", "text": "async GetAllUser() {\n try {\n //Retornamos usuarios\n return await Users.findAll({\n include: [{ model: Roles, include: [{ model: Permisos }] }],\n })\n .then((result) => {\n return result;\n })\n .catch((err) => {\n throw new Error(err);\n });\n } catch (error) {\n throw new Error(error);\n }\n }", "title": "" }, { "docid": "22cc280374377fb42de57e06d5c07344", "score": "0.58584815", "text": "async obtenerHistorialListadoUsuarios() {\n\t\tlet resultados = {};\n\t\tconst instruccionSQL = `\nSELECT\n\tusuario::text,\n\ttiempo::timestamptz\nFROM monitorizacion_usuarios\nWHERE (\n\tid = $1\n)\nORDER BY tiempo`;\n\n\t\ttry {\n\t\t\tresultados = await baseDatos.query(instruccionSQL, [ this.id ]);\n\t\t\tthis.historial.usuarios = resultados.rows;\n\t\t} catch (_e) {}\n\t}", "title": "" }, { "docid": "500e135ca30bac5c5f0b65c28053b789", "score": "0.5837998", "text": "function TraerUsuario(usuario, pass, cbErr, cbProducto) {\n // Conexión. Función asincrónica. Recibe por callback error o cliente.\n mongoClient.connect(process.env.BD_URL, function (err, client) {\n if (err) {\n console.log(\"Hubo un error conectando con el servidor:\", err);\n // Si hay error lo retorno al callback de error y termino la función.\n cbErr(err);\n return;\n }\n\n // Conecto base de datos y colección\n const dbEcommerce = client.db(\"ProyectoEcommerce\");\n const colUsuarios = dbEcommerce.collection(\"Usuarios\");\n\n // Consulto todos los documentos y los paso a Array (función asincrónica)\n colUsuarios.findOne({nick : usuario, clave : pass }, function (err, datos) {\n // Ya tengo los datos, cierro la conexión.\n client.close();\n\n if (err) {\n console.log(\"Hubo un error al consultar:\", err);\n cbErr(err);\n return;\n }\n\n // Si llegué acá no hubo errores, los retorno al callback de datos\n cbProducto(datos);\n });\n });\n}", "title": "" }, { "docid": "56228ff961b21bfcbaeae28ed2dae901", "score": "0.5837161", "text": "function obtenerDatos() {\n //SIN VALIDAR AUN\n // nombre, apellido, email\n let nombre = document.getElementById(\"nombre\").value.toUpperCase();\n let apellido = document.getElementById(\"apellido\").value.toUpperCase();\n let email = document.getElementById(\"email\").value.toLowerCase();\n \n //contraseña\n let pass = document.getElementById(\"contrasena\").value;\n let repPass= document.getElementById(\"repContrasena\").value;\n password= checkPass(pass, repPass);\n \n //direccion\n let dir=document.getElementById(\"direccion\").value;\n let dirAdc=document.getElementById(\"direccionAdc\").value;\n let ciudad=document.getElementById(\"ciudad\").value;\n let pcia = document.getElementById(\"provincia\");\n let pciaSeleccionada = pcia.options[pcia.selectedIndex].value;\n let zip=document.getElementById(\"zip\").value;\n //ponemos la direccion en un array \n let direccion=[];\n direccion.push(dir, dirAdc, ciudad, pciaSeleccionada, zip); \n \n //boletin\n let boletin = document.getElementById(\"boletin\").checked;\n \n //creamos INSTANCIA DE LA CLASE USUARIO\n let estado, admin, codUsuario=\"US\", codigosProductos;\n usuario= new Usuario (codigo, nombre, apellido, email, password, codigosProductos, direccion, estado, admin);\n codUsuario=codUsuario+usuariosArray.lenght*10;\n //inicializamos INSTANCIA USUARIO\n usuario.codigo = codUsuario;\n usuario.nombre = nombre;\n usuario.apellido= apellido;\n\tusuario.email = email;\n\tusuario.password = password;\n usuario.codigosProductos = [];\n usuario.direccion=direccion; \n usuario.estado=true;\n usuario.admin=false; \n \n existeUsuario(usuario);\n if (existe!=null) {\n alert('el usuario ya existe');\n } else {\n usuarios.push(usuario);\n localStorage.setItem('usuario',JSON.stringify(usuarios))\n } \n\n} //fin de obtenerDatos() del registro de usuarios", "title": "" }, { "docid": "84b1c7761f775bba6d3b111b22c2d721", "score": "0.5822952", "text": "static getUsers() {\n \t\tconst query = \"SELECT asimov_users.id, asimov_users.nom, asimov_users.prenom, asimov_users.pseudo, asimov_classes.nomclasse FROM asimov_users, asimov_classes, asimov_dansclasse WHERE rang = '1' AND asimov_users.id = asimov_dansclasse.iduser AND asimov_dansclasse.idclasse = asimov_classes.idclasse ORDER BY nom ASC\"\n\t\treturn this.doQuery(query)\n \t}", "title": "" }, { "docid": "6d71bc59047a9ac798146263329ab035", "score": "0.5817649", "text": "function ingresoUsuario(req, res){\n\n\tvar parametros = req.body;\n\tvar usr = parametros.usuario;\n\tvar pass = parametros.password;\n\n\tUsuarios.findOne({usuario:usr}, (error, seleccionUsuario)=>{\n\n\t\tif(error){\n\t\t\tres.status(500).send({mensaje:\"Error al ingresar usuario\"})\n\t\t}\n\t\telse{\n\n\t\t\tif(!usr){\n\t\t\t\tres.status(404).send({mensaje:\"El usuario no Existe!\"})\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\tbcrypt.compare(pass, seleccionUsuario.password, function(error, ok){\n\t\t\t\t\tif(ok){\n\t\t\t\t\t\t//res.status(200).send({seleccionUsuario});\n\t\t\t\t\t\t//debemos enviar un parametro token en true\n\t\t\t\t\t\tif(parametros.token){\n\n\t\t\t\t\t\t\t//Devolvemos un token de jwt\n\t\t\t\t\t\t\tres.status(200).send({token: token.crearToken(seleccionUsuario)})\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tres.status(404).send({mensaje:\"Sin acceso!\"})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "ae0edf1303b34d8deac4b7c2b21fb66c", "score": "0.5815025", "text": "function recuperarUsuarios() {\n return new Promise((resolve, reject) => {\n\n modelUsuario.find().exec((err, list) => {\n if (err) {\n reject(err);\n }\n resolve(list);\n });\n });\n}", "title": "" }, { "docid": "96b581a7505d6a5fea06075ff205b45a", "score": "0.5796928", "text": "fetchAutenticarUsuario ({\n commit\n }, {\n mail,\n pass\n }) {\n return ApiService.getAutenticarUsuario(mail, pass)\n }", "title": "" }, { "docid": "d1e5eb102571bbc775ff50c9e0ddd765", "score": "0.57519877", "text": "function validarUsuario(user) {\n\tvar resultado = {};\n\tresultado.auth = false;\n\tresultado.msg = \"Acceso Denegado: No se ha encontrado el usuario. <br/>Volver a pantalla de <b><a href='/'>Login</a></b>\";\n\tresultado.indice = -1;\n\t// Buscar el usuario\n\tfor (var i in usuarios) {\n\t\tif (usuarios[i].usuario == user) {\n\t\t\tresultado.indice = i;\n\t\t\t// No tiene establecida la propiedad autorizado --> no ha entrado por login\n\t\t\tif (usuarios[i].autorizado == undefined)\n\t\t\t\tresultado.msg = \"Acceso denegado: No se ha autorizado el acceso. <br/>Volver a pantalla de <b><a href='/'>Login</a></b>\";\n\t\t\telse {\n\t\t\t\t// Tiene la propiedad establecida a false\n\t\t\t\tif (usuarios[i].autorizado == false) \n\t\t\t\t\tresultado.msg = \"Acceso denegado: No se ha autorizado el acceso. <br/>Volver a pantalla de <b><a href='/'>Login</a></b>\";\n\t\t\t\telse \n\t\t\t\t\tresultado.auth = true;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\t\n\treturn resultado;\n}", "title": "" }, { "docid": "c2f0022e334d53e76d18d8fd6ca6df63", "score": "0.5745339", "text": "function obtieneCuenta(nomeSis, callback){\n var arregloUsuarios=[];\n var coleccion = 'accounts';\n var critcol = {'nombreSistema': nomeSis};\n var sort = {};\n classdb.buscarToArray(coleccion, critcol, sort, 'charts/chartPromedioCasos/obtieneCuenta', function(cuenta){\n return callback(cuenta);\n });\t\t\n }", "title": "" }, { "docid": "0150515a1f738efe7b6dd2d30ae1c4c8", "score": "0.57389843", "text": "function recuperarUsuarioActual() {\n\t\t\n\t\t$.ajax({\t\n\t\t\ttype: 'GET',\n\t\t\turl: '/crm-app/api/v1/usuario/usuarioLogueado',\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(response) {\n\t\t\t\tconsole.log(response);\n\t\t\t\t$('#nombreUsuarioLogueado').html(response.username);\n\t\t\t\tvar usuarioLogueado = response.username;\n\t\t\t\tconsole.log(\"usuarioLogueado: \" + usuarioLogueado);\n\t\t\t\t\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\turl: '/crm-app/api/v1/usuario/perfilUsuario',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tsuccess: function(response) {\n\t\t\t\t\t\tconsole.log(response);\n\t\t\t\t\t\t$('#cargoUsuarioLogueado').html(response.cargoUsuario);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "04d740e5edde72314250ca90c7eaece7", "score": "0.57152635", "text": "function consultaPersona(tx) {\n\tvar busqueda=localStorage.busqueda;\n\tconsole.log(\"Busqueda: \"+busqueda+\"!\"); //console.log(\"Busqueda: \"+busqueda);\t3084556|EDGAR ARNULFO|SANABRIA ALDANA\n\t//if(busqueda!=null){\n\t tx.executeSql(\"SELECT cedula,nombres,apellidos FROM publicusuario where cedula = '\"+busqueda+\"' and id_proyecto = '\"+localStorage.id_proyecto+\"'\", [], resultadoCC);\n\t//}\n}", "title": "" }, { "docid": "afa5521ca3e3ad16bd5a92a0f87ab810", "score": "0.5710197", "text": "function _loadUsers()\n {\n var sql = \"select * from Users where 1\"\n db.all(sql, function(err, rows)\n {\n if(rows)\n {\n rows.map(function(row)\n {\n var user = new User(db, row)\n Users[row.userId] = user\n })\n }\n })\n }", "title": "" }, { "docid": "a03e28aeb4ba192d98e816a2775f60c2", "score": "0.5702446", "text": "function iniciar_sesion_user() { //Funcion que ingresa los datos solicitados a la base de mongodb\n\n var clase_usuario_instanciado = new usuario(\n \"\",\n document.getElementById(\"pass_user_in\").value,\n \"\",\n \"\",\n \"\",\n document.getElementById(\"mail_user_in\").value,\n \"\"\n );\n\n clase_usuario_instanciado.Login().then(function(response) {\n\n console.log(\"Success!\", response);\n localStorage.setItem(\"UserAC\",JSON.stringify(response));\n location.href = \"users_in.html\";\n\n }, function(error) {\n\n console.error(\"Failed!\", error);\n alert(\"Error \" + error);\n\n });\n\n }", "title": "" }, { "docid": "dc5101b236ae6e13615630c07851e285", "score": "0.5697833", "text": "function init(){ // función que se llama así misma para indicar que sea lo primero que se ejecute\n olvidoContController.usuarios = olvidoContService.getCorreos();\n }", "title": "" }, { "docid": "5280978279327bd326863af433c77d5e", "score": "0.5693353", "text": "function mountUserObject(usuario) {\n return {\n id: usuario.idUsuario,\n username: usuario.dsUsuario,\n password: usuario.dsSenha,\n scope: usuario.dsScope,\n }\n}", "title": "" }, { "docid": "dc48b1f395827ead4bd4c35e28a066bb", "score": "0.5692628", "text": "function muestraUsuario(usuario){\n\t\t\t\t\t\t\n\t\t\t\t$('#TypeSave').val('2');//Indicamos que es una actualización con el valor 2\n\t\t\t\t$('#grupoUsuario').show();//Mostrar los campos de Usuario\n\t\t\t\t$('#grupoNombres').show();//Mostrar los campos de Nombres\n\t\t\t\t$('#grupoCargo').show();//Mostrar los campos de Cargo\n\t\t\t\t$('#password').hide();//Ocultanos los campos de password\n\t\t\t\t//Llenamos los dados del formulario\n\t\t\t\t$('#TxtUsuario').val(usuario.src_user);\n\t\t\t\t$('#TxtNombres').val(usuario.src_name);\n\t\t\t\t$('#TxtCargo').val(usuario.src_cargo);\n\t\t\t\t$('#TxtClave').val('0');\n\t\t\t\t$('#TxtClave2').val('0');\t\t\t\t\t\t\n\n\t\t\t}", "title": "" }, { "docid": "5f6bf9e6820c936a64b1c4a9b771ec72", "score": "0.5687468", "text": "function selectUsuario(datos) {\n\n var tr = $(datos).parents(\"tr\")\n var data = tblUsuario.row(tr).data();\n $('#btnResetUser').removeAttr('disabled');\n //Capturamos valores de tabla\n usuario = {\n id_usuario: data[0],\n usuario:data[1],\n iso:data[2],\n telefono:data[3],\n correo: data[5],\n tipo: data[6],\n estado: data[8]\n };\n\n //Asignamos valores a formulario\n $('#id_usuario').val(usuario.id_usuario);\n $('#txt_usuario').val(usuario.usuario);\n $('#txt_telefono').val(usuario.telefono);\n $('#txt_correo').val(usuario.correo);\n $('#txt_correo').attr(\"data-correo\",usuario.correo);\n $('#selecTipo').val(usuario.tipo);\n select2.setCountry(usuario.iso);\n\n var Estado = document.getElementById('ckestado');\n\n /** Verifica si ya esta activado el checkbox, de lo contrario lo activa */\n if (usuario.estado==1)\n {\n if (Estado.checked == false)\n $('#ckestado').click();\n }\n else\n {\n if (Estado.checked == true)\n $('#ckestado').click();\n }\n\n }", "title": "" }, { "docid": "a6e67991ce1c81028e4b5519dc762cb7", "score": "0.56721264", "text": "function buscaUsuario(busqueda, regex){\n return new Promise((resolve,reject)=>{\n\n Usuario.find ({}, 'nombre id email')\n .or([{'nombre': regex} ,{'email':regex} ])\n .exec((error,usuario)=>{\n if(error){\n reject('error al cargar usuario', error);\n \n }else{\n resolve(usuario);\n }\n\n })\n\n });\n \n }", "title": "" }, { "docid": "0700b27072aa42ccf99685d1383527af", "score": "0.5657031", "text": "function cargarDatos() {\n\t\treturn $scope.usuarios.map(function(usuario) {\n\t\t\treturn {\n\t\t\t\tvalue: usuario.usuario,\n mail: usuario.mail,\n\t\t\t\tdisplay: usuario.usuario+' ('+usuario.nick+')'\n\t\t\t};\n\t\t});\n\t}", "title": "" }, { "docid": "0cfb4a02d9cf73176f33af09a8a6062e", "score": "0.5656821", "text": "function funcionGetUsuarios(tabla){\n\t\t$('.'+tabla).empty().append('<thead><tr><th style=\"display:none;\">ID</th><th>Usuario</th><th>Perfil</th><th>Estado</th></tr></thead>');\n\t\tstrf = q+'getSome&opcion=usuarios&valor=0';\n\t\tresultado = funcionAjaxArray(strf);\n\t if(resultado.length>0 && typeof resultado.length!=='undefined'){\n\t\tfor(var i=0; i<resultado.length; i++){\n\t\t if(typeof resultado[i].id!=='undefined'){\n\t\t\t$('.'+tabla).append('<tr><td class=\"id\" style=\"display: none;\">'+resultado[i].id+'</td>'+\n\t\t\t\t\t\t\t\t\t'<td class=\"Noeditable\"><span>'+resultado[i].login+'</span></td>'+\n\t\t\t\t\t\t\t\t\t'<td class=\"editable\" data-campo=\"usu_perfil\"><span>'+resultado[i].perfil+'</span></td>'+\n\t\t\t\t\t\t\t\t\t'<td class=\"editable\" data-campo=\"usu_estado\"><span>'+resultado[i].estado+'</span></td></tr>');\n\t\t } else funcionAbrirDialogAlerta('nada para mostrar');\n\t\t}\n\t } else funcionAbrirDialogAlerta(resultado.mensaje);\n\t}", "title": "" }, { "docid": "94d6c2402742d0c1c82e0442aacf0145", "score": "0.5651328", "text": "getAllUsers() {\n return new Promise((resolve, reject) => {\n const connection = mysql.createConnection({\n host: this.DB_HOST,\n user: this.DB_USER,\n password: this.DB_PASSWORD\n });\n connection.connect((err) => {\n if (err) {\n connection.end();\n return reject(err);\n }\n connection.query('USE cht');\n const selectQuery = `SELECT * FROM users WHERE admin = '0'`;\n connection.query(selectQuery, (err, rows) => {\n connection.end();\n if (err) {\n return reject(err);\n }\n return resolve(rows);\n });\n });\n });\n }", "title": "" }, { "docid": "78f6e0ec13b53bb646915a9b2f14c70b", "score": "0.56435096", "text": "async requestUser(data){\n let user;\n if(!(user = await this.context.connection.maybeStartConnection())){\n let session = await this.context.connection.attemptLogin(data.username);\n if(!session){\n this.clearData();\n this.context.connection.getAuthorization(async function(data, response){\n response = await this.createUser({\n fullname : data.name,\n username : data.username,\n role : \"admin\"\n });\n if(response === false || response.statusCode === 409){\n //error handle \n }\n }.bind(this, data));\n } else {\n this.context.connection.storeUser(data);\n }\n }\n console.log(user);\n this.context.startPhase('start');\n }", "title": "" }, { "docid": "407f56247a911dd225c7ecacf8472536", "score": "0.56250983", "text": "function signInUser(mail_value, password_value) {\n\n\n\t//Connexion à la base de données\n\tconst mysql = require('mysql')\n\tconst connexion = mysql.createConnection({\n\t\thost: 'localhost',\n\t\tdatabase: 'nodejs',\n\t\tuser: 'root',\n\t\tpassword: ''\n\t})\n\tlet sql = \"SELECT * FROM users WHERE mail = ? AND password = ?\";\n\tlet inserts = [mail_value, password_value];\n\tsql = mysql.format(sql, inserts);\n\n/**Promesse de requête de connexion */\n\treturn new Promise((resolve) => {\n\t\tconnexion.query(sql, function (error, results, fields) {\n\t\t\tif (error) throw error;\n\t\t\tif (results.length > 0) {\n\t\t\t\tconsole.log(\"FIND!!!!\")\n\t\t\t\tconsole.log(results[0]);\n\t\t\t\tresolve(true);\n\n\t\t\t} else {\n\t\t\t\tconsole.log(\"vide\");\n\t\t\t\tresolve(false);\n\t\t\t}\n\t\t});\n\t});\n\n\n}", "title": "" }, { "docid": "88adb3d38c0f9341ae60843b6a365f80", "score": "0.5622564", "text": "function consultarTodos() {\n for (var x = 0; x < cuentas.length; x++) {\n consultarUsuario(cuentas[x]);\n }\n}", "title": "" }, { "docid": "f64f68ce0f58d16cdc3ad145e598d5af", "score": "0.5621517", "text": "usuarioRecibido() {\n\t\t\tvar usuarioR = this.usuario;\n\t\t\tif (!this.usuario) {\n\t\t\t\t//si el usuario es null o undefined\n\t\t\t\tusuarioR = { nombre: \"Visitante\", rol: \"Estudiante\" };\n\t\t\t}\n\t\t\treturn usuarioR;\n\t\t}", "title": "" }, { "docid": "a638b476427e039e39328fee120948d8", "score": "0.56212103", "text": "function findUserActive (req, cb) { \n var id = req.user._id;\n Empleados.findOne()\n .where(\"iLogin\", ObjectId(id))\n .populate(\"tEmpleado\")\n .populate(\"iLogin\")\n .populate(\"iTarjeta\")\n .exec(function(err, empleado) {\n if(err)\n cb(true);\n req.session.errorlogin = false;\n req.session.idUserActive = empleado._id;\n cb(false, empleado);\n });\n}", "title": "" }, { "docid": "c387992aa7bda6c11803e6d719ca30c8", "score": "0.5620732", "text": "verificaUsuario(usuario){\n return axios\n .get(`${uri}/login/${usuario}`)\n .then(res => {\n return res.data;\n })\n }", "title": "" }, { "docid": "5213e2b6ad75212a3f7d0fdcda8cd920", "score": "0.56182647", "text": "async function buscarUsuario_com() {\n const datos = {\n backend: 'buscarUsuarios', inputBusqueda: document.querySelector(\"#input-busquedas\").value,\n\n };\n // Codificamos...\n const _datos = JSON.stringify(datos);\n console.log(_datos);\n // Enviamos\n try {\n const respuestaRaw = await fetch(\"core/userController.php\", {\n method: \"POST\",\n body: _datos,\n });\n // El servidor nos responderá con JSON\n const respuesta = await respuestaRaw.json();\n if (respuesta) {\n limpiar_table();\n console.log(respuesta);\n getUser_fin(respuesta);\n } else {\n console.log(\"nara\");\n }\n } catch (e) {\n // En caso de que haya un error\n console.log(e);\n }\n}", "title": "" }, { "docid": "b131cb954b247e0a1dfb777f61ed4ca0", "score": "0.56140196", "text": "function init() {\n domNombreUsuario = document.getElementById('nombreUsuario');\n domContaseniaUsuario = document.getElementById('contraseniaUsuario');\n domEstado = document.getElementById('estado');\n regexNombre = /^[a-z]{3,10}$/i;\n //if (leerClaveLocal() == null)\n usuarios = new Map();\n //else\n //usuarios = leerClaveLocal();\n crearEsqueletoBasico();\n }", "title": "" }, { "docid": "f25d47e66963bf06c1e346f0ebc294de", "score": "0.5613673", "text": "function limpiarBusqueda() {\n usuarios = JSON.parse(localStorage.getItem('usuarios'));\n mostrarUsuarios();\n console.log('Sin filtro en la tabla 👍')\n}", "title": "" }, { "docid": "a82b47ea82bc26649c4faa5406a4e0be", "score": "0.5600145", "text": "function getUser(req, res) {\n var user = req.user;\n\n User.findOne({ usuario: user.usuario.toLowerCase() }, (error, user) => {\n if (error) {\n res.status(404).send({ message: \"no se pudo obtener el usuario\" });\n } else {\n Datos.findOne({ _id: user.datos }, (error, datos) => {\n if (!error && datos) {\n let usuario = {}\n usuario.nombre = datos.nombre;\n usuario.apellidos = datos.apellidos;\n usuario.email = user.email;\n usuario.usuario = user.usuario;\n\n res.status(200).send({ message: \"ok\", usuario: usuario });\n }\n })\n\n }\n });\n\n}", "title": "" }, { "docid": "002c9391829d08ce4e5139c59221ec43", "score": "0.55989176", "text": "getAllUsers() {\n return pool.query(\n 'SELECT id, email, first_name, last_name, is_admin FROM users ORDER BY id ASC'\n );\n }", "title": "" }, { "docid": "1693baf5ed59ea38c6b7eb30c3d86ce0", "score": "0.558423", "text": "async function login(email, password) {//la funcion login le pasamos el email y el password\n const { data } = await Axios.post('/api/usuarios/login', {//le pasamos el endpoint con el backend cpar el login\n email,\n password\n });\n setUsuario(data.usuario);//guardamos el usuario\n setToken(data.token);// y el token que el usuario nos envio una vez hizo la autentificacion preservandolo aunque el usuario refresque la pagina\n }", "title": "" }, { "docid": "b158ed4e2aa2994b5688f34639fbb67d", "score": "0.558107", "text": "obtener_usuario(state, payload){\n state.token = payload;\n if(payload === ''){\n state.usuarioDB = ''\n }else{\n state.usuarioDB = decode(payload);\n router.push({name: 'home'})\n }\n }", "title": "" }, { "docid": "a7535cbae5367fd90e928d8b3efd184e", "score": "0.5579461", "text": "getUsuario(context, payload) {\n return api.get(`/usuario/${payload}`).then((response) => {\n context.commit(\"UPDATE_USUARIO\", response.data); //depois que pega o usuário e logo faz-se o update no login, entao sao duas mutações de uma vez só\n context.commit(\"UPDATE_LOGIN\", true);\n });\n }", "title": "" }, { "docid": "c19a95154fb7524eafced4d5e6dfeefe", "score": "0.5577909", "text": "function obterDadosUsuario(){\n var defer = $q.defer();\n\n UsuarioLogadoResource.get({},function(data){\n if(!data){defer.reject();return;}\n defer.resolve(data);\n },\n function(data){\n defer.reject(data);\n }\n );\n\n return defer.promise;\n }", "title": "" }, { "docid": "4e0ef7c6033f7c75c50c863c656e0a1c", "score": "0.5565447", "text": "function ingresar(ajustes){\n var credenciales;\n if (ajustes == null){\n return $q.reject('No se establecieron los ajustes correspondientes.');\n }else{\n credenciales = {'user': ajustes.usuario, 'password': ajustes.contrasena};\n return $http({method:'POST',url:ajustes.url + '/LogOn',data:credenciales}).then(function(conectado){\n if(conectado.data.estado){\n return {estado: conectado.data.estado, mensaje: conectado.data.mensaje};\n }else{\n return $q.reject({estado: conectado.data.estado, mensaje: conectado.data.mensaje});\n }\n },function(error){\n return $q.reject({estado: false, mensaje: 'Error al conectar con el servidor, verifique la direción o su conexión a internet.', error: error});\n });\n }\n }", "title": "" }, { "docid": "cc69fa1ad625ad746889143d6577c008", "score": "0.55589545", "text": "function observador(){\n\t// var nm = document.querySelector(\"#btn_nuevo\");\n firebase.auth().onAuthStateChanged(function(user) {\n if (user) {\n console.log('existe usuario activo');\n console.log(user.emailVerified);\n console.log(user.email);\n console.log(sessionStorage.getItem(\"categoriaNom\"));\n //muestra el correo del usuario en la etiqueta <li>\n\t\tdocument.getElementById(\"userActivo\").innerHTML = user.email;\n //hace visible el <li> cuando hay un usuario activo\n\t\tuserActivo.style.display = \"block\";\n\t\t// nm.style.display = \"block\";\n userActivo.style.display = \"block\";\n btn_cerrar.style.display = \"block\";\n btn_inicia.style.display = \"none\";\n estadoUser = true;\n \n // el usuario ha iniciado sesion\n var displayName = user.displayName;\n var email = user.email;\n var emailVerified = user.emailVerified;\n var photoURL = user.photoURL;\n var isAnonymous = user.isAnonymous;\n var uid = user.uid;\n var providerData = user.providerData;\n var usu_correo = user.email;\n // ...\n } else {\n // el usuario no ha iniciado sesion\n console.log('no existe usuario activo');\n console.log(sessionStorage.getItem(\"categoriaNom\"));\n estadoUser = false;\n\t\tbtn_inicia.style.display = \"block\";\n\t\t// nm.style.display = \"none\";\n // ...\n }\n });\n}", "title": "" }, { "docid": "7717e3f48e325b3852fff4385f85ddb5", "score": "0.5557497", "text": "function adicionarUsuario(){\n\tconsole.log('adicionarUsuario');\n\n\tif($(\"#frmUsuarios\").valid()){\n\t\tvar elementoUsuario = new Object();\n\t\tvar rowid = \"\";\n\t\tvar theNode = \"\";\n\n\t\t$(\"#messageErrorModal\").hide();\n\t\tif($.fn.dataTable.isDataTable('#tablaUsuarios')){\n\t\t\trowid = $('table#tablaUsuarios').dataTable().fnAddData(\n\t\t\t\t\t['' + $(\"#nombreUsuario\").val(), '' + $(\"#estadoUsuario option:selected\").text(),\n\t\t\t\t\t\t\tadherirEditarEliminar(filaUsuario, \"usuario\", \"editUsuario\", null)]);\n\t\t}else{\n\t\t\trowid = $('table#tablaUsuarios').dataTable({\n\t\t\t\t\"bProcessing\" : false,\n\t\t\t\t\"bServerSide\" : false,\n\t\t\t\t\"bFilter\" : false,\n\t\t\t\t\"bInfo\" : false,\n\t\t\t\t\"bSortable\" : false,\n\t\t\t\t\"bPaginate\" : false\n\t\t\t}).fnAddData(\n\t\t\t\t\t['' + $(\"#nombreUsuario\").val(), '' + $(\"#estadoUsuario option:selected\").text(),\n\t\t\t\t\t\t\tadherirEditarEliminar(filaUsuario, \"usuario\", \"editUsuario\", null)]);\n\t\t}\n\n\t\ttheNode = $('#tablaUsuarios').dataTable().fnSettings().aoData[rowid[0]].nTr;\n\t\ttheNode.setAttribute('id', 'f' + filaUsuario);\n\n\t\t$('td', theNode)[0].setAttribute('class', 'nombreUsuario');\n\t\t$('td', theNode)[1].setAttribute('class', 'estadoUsuario');\n\t\t$('td', theNode)[2].setAttribute('class', 'accionUsuario');\n\n\t\telementoUsuario.fila = filaUsuario;\n\t\telementoUsuario.codigoUsuario = $(\"#codigoUsuario\").val();\n\t\telementoUsuario.nombreUsuario = $(\"#nombreUsuario\").val();\n\t\telementoUsuario.estadoUsuario = $(\"#estadoUsuario option:selected\").text();\n\n\t\tUsuariosArray[countUsuarios] = elementoUsuario;\n\n\t\tfilaUsuario++;\n\t\tcountUsuarios++;\n\t\tlimpiarCamposUsuarios();\n\t}\n}", "title": "" }, { "docid": "1fdd8c400e6de5a491f99ab5f763242f", "score": "0.5554535", "text": "function getAllUser() {\n let sql = \"SELECT * FROM v_user\";\n return db.query(sql);\n}", "title": "" }, { "docid": "8de6d9903c3f49099855f5ba73279535", "score": "0.5545005", "text": "function mostrarUsuarios (req, res) {\n User.find({}, {password: 0}, function (err, users) {\n if (err) return res.status(500).send(\"Hubo un problema para encontrar a los usuarios.\");\n res.status(200).send({auth: true, mensaje: 'Se devuelven los usuarios', data: users});\n });\n}", "title": "" }, { "docid": "9afd33e7a961695a1ee3130502d66c30", "score": "0.5538249", "text": "async function populate_coordinador_all(req, res) {\n try {\n // request.user is getting fetched from Middleware after token authentication\n const user = await Coordinador.find()\n .populate('userID')\n .exec(function (err, found_user) {\n\n return res.send(found_user);\n });\n } catch (e) {\n res.send({ message: \"Error in Fetching user\" });\n }\n}", "title": "" }, { "docid": "6fb6f738d8630da124adfa81101208ba", "score": "0.5537908", "text": "function regUsuarioBD(tipoReg) {\n var userId = getUserId(),\n imgUrl = getProfile();\n \n //Si el usuario no existe, se registra.\n if (typeUser() == false) {\n if (tipoReg == 'u') {\n //El usuario se registra como individual.\n var data = {\n \"Name\": nameUser,\n \"id_profile\": userId,\n \"Num_max_peticiones\": 50,\n \"Num_peticiones\": 0,\n \"Bloqueo\": 0,\n \"img_profile\": imgUrl[1]\n };\n database.setData(\"Usuarios/\"+userId, data);\n //aviso(\"Se ha registrado correctamente\\nBienvenido a EasyRequest\");\n alertBeta();\n return;\n } else if (tipoReg == 'd') {\n if (domain[1] == 'gmail.com') {\n aviso(\"AVISO\\n'gmail.com' no se puede registrar como dominio.\\nPor favor, hágalo de forma individual\");\n return;\n }\n //El usuario se registra como dominio.\n var dominio = replaceIdDomain(domain[1]),\n data = {\n \"Name\": domain[1],\n \"id_domain\": dominio,\n \"Num_max_peticiones\": 50,\n \"Num_peticiones\": 0,\n \"Bloqueo\": 0\n };\n database.setData(\"dominios/\" + dominio, data);\n aviso(\"Su dominio \" + domain[1] + \" se ha registrado correctamente\\nBienvenido a EasyRequest\");\n return;\n }\n //Si es un dominio.\n } else if (typeUser() == 'd') {\n aviso(\"El dominio \" + domain[1] + \" ya está registrado en EasyRequest\");\n return;\n //Si es un usuario.\n } else {\n aviso(\"El usuario ya está registrado en EasyRequest\");\n return;\n }\n }", "title": "" }, { "docid": "c16d0c48281957df5ea3b2c24588995f", "score": "0.55291593", "text": "getUser(username) {\n return new Promise((resolve, reject) => {\n const connection = mysql.createConnection({\n host: this.DB_HOST,\n user: this.DB_USER,\n password: this.DB_PASSWORD,\n });\n connection.connect((err) => {\n if (err) {\n connection.end();\n return reject(err);\n }\n connection.query(\"USE cht\");\n const selectQuery = `SELECT * FROM users WHERE username = '${username}'`;\n connection.query(selectQuery, (err, rows) => {\n connection.end();\n if (err) {\n return reject(err);\n }\n if (rows.length === 0) {\n return resolve(null);\n }\n return resolve(rows[0]);\n });\n });\n });\n }", "title": "" }, { "docid": "bf4b1249f89cefb4e9afd495f4e6704f", "score": "0.5524096", "text": "function getMe(){\n //Obtener datos\n dpd.users.me(function(me){\n //Exportar Objeto Barstocrazy al contexto global\n //Almacenara valores de confiuracion\n Btz.me = me || {};\n console.log('getMe',Btz.me);\n \n if(me){\n $('#userStatus').text('Hola ' + me.username);\n }else{\n $('#userStatus').text('Registrate');\n }\n });\n }", "title": "" }, { "docid": "946953c0a0cbcba07964828b47f2077e", "score": "0.5510146", "text": "function getUsuarios(req,res){\n //orden descendente -columna. .populate('creadoPor')\n SGUsuario.find({},'nombre email').sort('nombre').populate('creadoPor').exec((err,usuarios)=>{\n if (err){\n res.status(500).send({message:'Error al devolver los marcadores: ',errors:err});\n }\n else{\n if(!usuarios){\n res.status(404).send({message:'No hay marcadores'});\n\n }else{\n res.status(200).send({usuarios});\n }\n }\n }); \n}", "title": "" }, { "docid": "f031a421d76937cc6466e90a604fe1df", "score": "0.55083406", "text": "async getUser () {\n\t\tthis.user = await this.data.users.getOneByQuery(\n\t\t\t{\n\t\t\t\tsearchableEmail: decodeURIComponent(this.request.body.email).toLowerCase()\n\t\t\t},\n\t\t\t{\n\t\t\t\thint: UserIndexes.bySearchableEmail\n\t\t\t}\n\t\t);\n\t\t\n\t}", "title": "" }, { "docid": "01b87b21ae73deca6103be299cf52285", "score": "0.5496817", "text": "function getUserLogin(req, res) {\n let params=req.query;\n \n db.query(\"SELECT * FROM `User`, `Anexes` WHERE `User`.`idUser`= `Anexes`.`User_idUser` AND `emailUser` LIKE ? AND `passwordUser` LIKE ? ; \", \n [ \n params.emailUser,\n crypto.createHash('sha256').update(params.passwordUser).digest('hex')\n ], function (rows, error) {\n \n if(error){\n res.send({error: true,verified:false, err: error});\n }else{\n if(rows.length <=0){\n res.send({error: false,verified:false}); \n }else{\n var row=rows[0];\n row.anexes={\n idAnexes:row.idAnexes,\n fileName:row.fileName \n }\n var session = crypto.createHash('sha256').update( makeid()).digest('hex');\n // TODO: create new session in database \n \n db.query(\"INSERT INTO `folyou`.`userloginhistory`(`idUserLoginHistory`,`loginTimestamp`,`expireTimestamp`,`loginKey`,`User_idUser`) VALUES (NULL, NOW(), NOW() + INTERVAL 2 DAY, ?, ?); \", [session,row.idUser], function (rows, error) {\n \n if(error){\n res.send({error: true,verified:false, err:error}); \n }else{\n res.send({error: false,verified:true, user: row, session:session});\n }\n });\n \n \n }\n }\n });\n}", "title": "" }, { "docid": "8236c1dda40f5a786528897612ffcff5", "score": "0.5492688", "text": "function getAll() {\r\n var i = 0;\r\n var trans = db.transaction([\"utenti\"]);\r\n var store = trans.objectStore(\"utenti\");\r\n\r\n store.openCursor().onsuccess = function(event) {\r\n var cursor = event.target.result;\r\n if (cursor) {\r\n arrayUsers[i]= [cursor.value.username, cursor.value.credito];\r\n i++;\r\n cursor.continue();\r\n }\r\n };\r\n}", "title": "" }, { "docid": "820127d7fbcce96b7feb7119588d11f2", "score": "0.5486668", "text": "function checkUser(){\n\t\tlet username = document.getElementById(\"username\").value;\n\t\tlet password = document.getElementById(\"password\").value;\n\t\tgetUsers(username, password);\n\n\t}", "title": "" }, { "docid": "52a3a0470a84457d72174b69e495669d", "score": "0.54819447", "text": "function Usuario(nombreUsuario, nombre, apellido, email, contrasena){\n this.nombreUsuario = nombreUsuario;\n this.nombre = nombre;\n this.apellido = apellido;\n this.correoElectronico = email;\n this.contrasena = contrasena;\n}", "title": "" }, { "docid": "d9ed6452bfc6d29d2c1d802d6dce6e10", "score": "0.5478394", "text": "function getUser() {\n\n var login = { 'Email': uc.email, 'Password': uc.password };\n\n UserFactory.getUser(login).then(\n function(response) {\n var user = response.data;\n if (user[0] == null) {\n\n $state.go('register');\n } else {\n successLogin(user[0].userId, user[0].firstName);\n }\n },\n function(error) {\n console.log(error);\n });\n } //close getUser", "title": "" }, { "docid": "bc20ccba580a3ea4c8195d4220f86612", "score": "0.5475363", "text": "function getUsers(req, res){\n\t// usuar del middleware la propiedad sub que es el Id de usuario logueado:\n\tvar idsUserid = req.user.sub;\n\n\t// Variable para paginar, por defecto = 1:\n\tvar pagina = 1;\n\n\tif (req.params.pagina) {\n\t\tpagina = req.params.pagina;\n\t}\n\t// Variable para determinar la cantidad de usuarios conectados\n\tvar itemsPerPage = 25;\n\n\t// Query de busqueda de usuarios en la BD:\n\tUser.find().sort('_id').paginate(pagina, itemsPerPage, (err, users, total) =>{\n\t\t// validamos si hay algun error de conexion a la bd o de ejecucion:\n\t\tif (err) return res.status(500).send({ \n\t\t\tmessage: 'Ha habido un error en la conexion o en la busqueda del Usuario'\n\t\t});\n\t\t// Si no obtenemos ningun usuario:\n\t\tif (!users) return res.status(404).send({\n\t\t\tmessage: 'No hay Usuarios Disponibles!.'\n\t\t});\n\t\t// Respuesta con lista de todos los usuarios:\n\t\treturn res.status(200).send({\n\t\t\tusers,\n\t\t\ttotal,\n\t\t\tpaginas: Math.ceil(total/itemsPerPage)\n\t\t});\n\t});\n\n}", "title": "" }, { "docid": "a35afbf6c870ec799760000666de4acf", "score": "0.5474348", "text": "function logInUser() {\n const userName = document.getElementById(\"usrNameInput\").value\n const email = document.getElementById(\"emailInput\").value\n userManager.getSingleUsers(userName, email).then(user => {\n //console.log(user);\n if (user.length === 0 || userName === \"\") {\n alert(\"please try again!\")\n \n } else { //load all the users stuff\n sessionActiveUser.saveActiveUser(user)\n $(\"#logIn\").empty();\n //loadTaskForm();\n loadTasks();\n removeTasks()\n\n document.querySelector(\"#inputMessageDOM\").innerHTML = inputMessageDOM.renderEntryForm();\n // posts data put into text area on click to database\n saveMessageEntryToDatabase()\n populateMessageEntriesDOMs()\n \n //renderArticleForm()\n listArticles()\n removeArticles()\n document.querySelector(\"#inputArticleDOM\").innerHTML = inputArticles.renderArticleForm();\n saveArticleToDatabase()\n \n \n \n //console.log(user)\n // Events - Mike\n const eventsForm = require(\"./events/eventsForm\");\n const saveEvents = require(\"./events/saveEvents\");\n const events = require(\"./events/events\")\n document.querySelector(\"#eventsForm\").innerHTML = eventsForm.renderEventsForm();\n const deleteEvents = require(\"./events/deleteEvents\");\n saveEvents()\n events()\n //deleteEvents()\n }\n\n\n })\n }", "title": "" }, { "docid": "09654205777b4c1a83650f368ee6edd9", "score": "0.5470297", "text": "function checar() {\n firebase.auth().onAuthStateChanged(function (user) {\n //si hay un usuario\n if (user) {\n //console.log(\"Usuario logeado\");\n //obtiene el usuario actual\n var user = firebase.auth().currentUser;\n var uid = user.uid;\n //console.log(uid);\n console.log(user);\n obtenerUsuario(uid);\n\n //$('.img-circle').attr('src', );\n //consulta el id del usuario\n db.ref('usuarios/' + uid).on('value', function(snap) {\n let usuario = snap.val();\n privilegio = usuario.puesto;\n console.log(privilegio);\n\n setTimeout(function() {\n if(privilegio === \"Administrador\") {\n $('[data-toggle=\"tooltip\"]').tooltip();\n\n mostrarOrdenes();\n mostrarProyectos();\n }\n if(privilegio === \"Usuario\") {\n $('#panel-admin').hide();\n $('#mainNav').hide();\n $('#panel-usuario').show();\n }\n }, 2000);\n })\n }\n else {\n /*Sino hay un usuario escondemos ambos panels\n *Y mostramos la ventana modal de Inicio de Sesion\n */\n $('#panel-admin').hide();\n $('#panel-usuario').hide();\n $('#mainNav').hide();\n $(\"#modal\").modal();\n $('#email').val(\"\");\n $('#contrasena').val(\"\");\n $('#puesto').val(\"\");\n }\n })\n}", "title": "" }, { "docid": "c7953f2d88a36e9a19c517f7b209aaf9", "score": "0.54686534", "text": "function registrarUsuario (req, res) {\n\n // Comprobación de campos nulos\n if (!req.body.name || !req.body.email || !req.body.password){\n return res.status(400).send({auth: false, mensaje: \"Campos faltantes.\"});\n } else {\n \n // Busca si el correo ya existe en la base\n User.findOne({ email: req.body.email }, function (err, user) {\n if (err) return res.status(500).send({auth: false, mensaje: 'Error en el servidor.'});\n \n if (user) return res.send({auth: false, mensaje: 'Este correo ya fue registrado.'});\n\n // Si no existe el correo en la base, encripta la contraseña\n var hashedPassword = bcrypt.hashSync(req.body.password, 8);\n \n // Intenta crear el usuario con la contraseña encriptada\n User.create({\n name: req.body.name,\n email: req.body.email,\n password: hashedPassword,\n permiso: \"Regular\",\n fechaCreacion: Date.now(),\n estado: \"Activo\"\n },\n function (err, user) {\n if (err) return res.status(500).send({auth: false, mensaje: 'Hubo un problema al agregar la información a la base de datos.'});\n \n // create a token - Generated jwts will include an iat (issued at) claim by default\n var token = jwt.sign({ id: user._id }, config.secret, {\n expiresIn: 86400 // Expira en 24 horas\n });\n \n res.status(200).send({ auth: true, token: token, mensaje: 'Usuario guardado con éxito.' });\n });\n }); \n }\n}", "title": "" }, { "docid": "5fac6bdd5539ea85531ca07b79f6c33f", "score": "0.54673123", "text": "function load_data(){// populate table with default users\n if (!QuiereReiniciarLaDb) { return }\n\n //A: si llego aqui, borramos las tablas y las cargamos de nuevo! \n M.User.sync({force: true}) // using 'force' it drops the table users if it already exists, and creates a new one\n .then(function(){\n // Add the default users to the database\n for(var i=0; i<users.length; i++){ // loop through all users\n M.User.create({ firstName: users[i][0], lastName: users[i][1]}); // create a new entry in the users table\n }\n }); \n\n\tM.CuentoContexto.sync({force: true}) //TODO: generalizar tipos de datos y datos iniciales\n .then(function(){\n\t\t\tObject.keys(Contextos).forEach( k => {\n\t\t\t\tvar v= Contextos[k];\n\t\t\t\tv.nombre= k;\n\t\t\t\tM.CuentoContexto.create(v);\n\t\t\t});\t\n\t\t});\n}", "title": "" }, { "docid": "69298a07e0e226857f789ddb850470af", "score": "0.5460129", "text": "function localStrategy(username, password, done){\n\tquery = 'SELECT * FROM usuarios WHERE nom_usuario = ? AND clave_usuario = ?'\n\tdbConnection.query(query, [username, password], (err, result) => {\n\t\treturn done(null, result[0]);\n\t});\n}", "title": "" }, { "docid": "25a8df0e09b1f36377a6dbe7922ff204", "score": "0.54547566", "text": "function usrASesion(user){\n \t//alert('Creando la session.')\n \t//$scope.usrConectado.nombre = user.nombre;//Info que viene de BD\n \tif(user.status == \"OK\"){\n \t$scope.usrConectado.estaConectado = true;\n \t$scope.usrConectado.message = user.message;\n \t$log.info($scope.usrConectado);\n \t\n \t//Para poder garantizar que se pueda ver los contenidos que solo son para usuarios conectados\n \t$cookieStore.put('estaConectado', true);\n \t$cookieStore.put('usuario', user);\n \t\n \t$location.path('/perfil');\n\n \t}else{\n \t\t//alert(user.message);\n \t\t$scope.salir();\n \t}\n }", "title": "" }, { "docid": "cfacca6d853963258f94914ffcaaf387", "score": "0.54539263", "text": "async obtenerDatosIdentidad() {\n\t\tlet resultados = {};\n\t\tlet fila = {};\n\t\tlet instruccionSQL = '';\n\t\tconst idNumerico = (typeof this.id === 'number' ? true : false);\n\n\t\tinstruccionSQL = `\nSELECT\n\tusuario_id::bigint,\n\tusuario_usuario::text,\n\ttelefono::text,\n\tcorreo::text,\n\tdatos_personales_primer_nombre::text,\n\tdatos_personales_segundo_nombre::text,\n\tdatos_personales_apellidos::text,\n\tdireccion_localidad::text,\n\tdireccion_region::text,\n\tdireccion_codigo_pais::text,\n\tdocumento_identidad_numero::text,\n\tdocumento_identidad_expiracion::timestamptz,\n\testado::smallint\nFROM usuarios\nWHERE (`;\n\n\t\tif (idNumerico === true) {\n\t\t\tinstruccionSQL += `\n\tusuario_id = $1\n)`;\n\t\t} else {\n\t\t\tinstruccionSQL += `\n\tusuario_usuario = $1\n)`;\n\t\t}\n\n\t\ttry {\n\t\t\tresultados = await baseDatos.query(instruccionSQL, [ this.id ]);\n\t\t\tif (resultados.rowCount > 0) {\n\t\t\t\tfila = resultados.rows[0];\n\t\t\t\tif (idNumerico === true) {\n\t\t\t\t\tif (this.registro.usuario.length === 0) {\n\t\t\t\t\t\tthis.registro.usuario = fila.usuario_usuario;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (this.registro.usuario.length === 0) {\n\t\t\t\t\t\tthis.registro.usuario = this.id;\n\t\t\t\t\t\tthis.id = parseInt(fila.usuario_id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.identidad.telefono = fila.telefono;\n\t\t\t\tthis.identidad.correo = fila.correo;\n\t\t\t\tthis.identidad.numeroIdentidad = fila.documento_identidad_numero;\n\t\t\t\tthis.identidad.fechaExpiracion = new Date(fila.documento_identidad_expiracion);\n\t\t\t\tthis.identidad.primerNombre = fila.datos_personales_primer_nombre;\n\t\t\t\tthis.identidad.segundoNombre = fila.datos_personales_segundo_nombre;\n\t\t\t\tthis.identidad.apellidos = fila.datos_personales_apellidos;\n\t\t\t\tthis.identidad.localidad = fila.direccion_localidad;\n\t\t\t\tthis.identidad.region = fila.direccion_region;\n\t\t\t\tthis.identidad.codigoPais = fila.direccion_codigo_pais;\n\t\t\t\tthis.identidad.estado = parseInt(fila.estado);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthrow e;\n\t\t}\n\t}", "title": "" }, { "docid": "785b286fdc0f549cbe9e80dbefb8351f", "score": "0.54534227", "text": "function usuarioBuscar(req, res) {\n Usuario.find()\n .then(Usuario => {\n res.send(Usuario);\n }).catch(err => {\n res.status(500).send({\n message: err.message || \"Se produjo un error al intentar recuperar el usuario.\"\n });\n });\n}", "title": "" }, { "docid": "d61dda2ba26bac924df71aed7607bf6e", "score": "0.5450251", "text": "function getLoginUsers() {\n const users = [];\n const list = storage.get(\"users\", utils.getDomain());\n if (!list) {\n return users;\n }\n Object.keys(list).forEach(user => {\n if (typeof list[user].password === \"string\" && list[user].password !== \"\") {\n users.push(user);\n }\n });\n return users;\n}", "title": "" }, { "docid": "1c93195685e8127b6635cfa34cfadef1", "score": "0.54394376", "text": "function listarUsuarios() {\r\n\t\t\tconsole.log('refrescando.......');\r\n\t\t\thttpservice.get('semestresAnteriores/listaUsuarios', null,\r\n\t\t\t\t\tsuccess = function(data, status, headers, config) {\r\n\t\t\t\t\t\tconsole.log('success.......');\r\n\t\t\t\t\t\t$scope.usuarios = data.obj;\r\n\t\t\t\t\t}, null);\r\n\t\t}", "title": "" }, { "docid": "2b2c65388ecbfa3be494418608182589", "score": "0.54383224", "text": "function comprobarLogin() {\n \n let bandera = false;\n let usuario = document.getElementById(\"inputEmailLogin\").value;\n let contrasenia = document.getElementById(\"inputPasswordLogin\").value;\n console.log(usuario);\n console.log(contrasenia);\n var nameActual;\n\n for (let i = 0; i < empresas.length; i++) {\n if ((usuario === empresas[i].correoEmpresa) && (contrasenia === empresas[i].contraseñaEmpresa)) {\n bandera = true;\n nameActual = empresas[i].nombreEmpresa;\n }\n }\n\n for (let j = 0; j < clientes.length; j++) {\n if ((usuario === clientes[j].correoCliente) && (contrasenia === clientes[j].contraseñaCliente)) {\n bandera = true;\n nameActual = clientes[j].nombreCliente;\n }\n }\n\n if (bandera === false) {\n alert(\"usuario o contraseña invalido\");\n }\n\n else {\n alert(\"Bienvenido \" + nameActual);\n document.getElementById(\"navegacion-bar\").innerHTML = \"\";\n document.getElementById(\"navegacion-bar\").innerHTML = `\n <nav class=\"navbar navbar-expand-lg navbar-light bg-light\">\n <a class=\"navbar-brand\" href=\"#\"><img src=\"../img/01-16-___logo2.png\" style=\"height: 50px;\"></a>\n\n <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarSupportedContent\"\n aria-controls=\"navbarSupportedContent\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n <span class=\"navbar-toggler-icon\"></span>\n </button>\n\n <div class=\"collapse navbar-collapse\" id=\"navbarSupportedContent\">\n <ul class=\"navbar-nav mr-auto\">\n <li class=\"nav-item active\">\n <a class=\"nav-link\" href=\"#\">Foxer<span class=\"sr-only\">(current)</span></a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"#\">Tienda</a>\n </li>\n <li class=\"nav-item dropdown\">\n <a class=\"nav-link\" href=\"../html/perfilEmpresa.html\">Bienvenido ${nameActual}</a>\n </li>\n </ul>\n\n <form class=\"form-inline my-2 my-lg-0\">\n <input class=\"form-control mr-sm-2\" type=\"search\" placeholder=\"...\" aria-label=\"Search\">\n <button class=\"btn btn-outline-success my-2 my-sm-0 mr-sm-2\" type=\"button\">Buscar</button>\n <button class=\"btn btn-outline-success my-2 my-sm-0 \" type=\"button\">\n <i class=\"fas fa-shopping-cart\"></i>\n </button>\n </form>\n </div>\n </nav>\n `;\n\n }\n}", "title": "" }, { "docid": "b2e56535a53a254ffb049751fe89b2f3", "score": "0.5435105", "text": "user( realm, username ) {\n if( !this.domains.has( realm ) ) {\n return []\n }\n\n if( !this.domains.get( realm ).users.has( username ) ) {\n return []\n }\n\n var ua = []\n this.domains.get( realm ).users.get( username ).registrations.forEach( ( r ) => { ua.push( r.info ) } )\n return ua\n }", "title": "" }, { "docid": "a8b1295b1e3dafae46b65d46b547e495", "score": "0.54271644", "text": "function loadUser() {\n console.log(\"UserService: Loading user\");\n\n clientContext.load(user);\n clientContext.executeQueryAsync(function () {\n console.log(\"UserService: User email %s fetched successfully\", user.get_email());\n\n factory.user = {\n email: user.get_email(),\n name: user.get_title()\n };\n\n loadFromUserType();\n }, onError);\n }", "title": "" }, { "docid": "145e0f793b074284c45a387c4d9fb2f2", "score": "0.54175633", "text": "async getUser(username) {\n return JSON.stringify(await this.connectAndRun(db => db.any(\"SELECT * FROM users WHERE username = $1;\", [username])));\n }", "title": "" }, { "docid": "8c65c7f4cead8b7a2ec814b5199fcb2d", "score": "0.54172355", "text": "function inicioEnvio(){\n console.log(\"Se han enviado los datos del usuario al servidor\");\n}", "title": "" }, { "docid": "101ed3363d281f0fc3db7172008f33c7", "score": "0.5416955", "text": "async function getUsuario(req, res) {\n\ttry {\n\t\tconst username = req.params.username\n\n\t\tconst user = await User.findOne({ where: { username: username } })\n\t\t\tres.send(user)\n\n\t} catch (error) {\n res.send(error)\n\t}\n}", "title": "" }, { "docid": "581069a65b8dacb51ccfc1ddb317d931", "score": "0.54128736", "text": "function inicializaAmex(usuario){\t\r\n\t\tvar param = \"inicializaAmex=ok&usuario=\"+usuario;\r\n\t\tvar json = obtenJson(param);\r\n\t\tif(json[0])\r\n\t\t\tobtenCargosTarjeta(usuario);\r\n\t}", "title": "" }, { "docid": "433049bb599f75ad7d109681c87d84b2", "score": "0.54088324", "text": "getUsuarios() {\n return this.http.get(`${this.URL_API}/Usuarios`);\n }", "title": "" }, { "docid": "e1334dd51b7f0ee3cbb4b94546ba43cf", "score": "0.54051435", "text": "addUser(name ){\n this.buscador.checkname(this.users, name, 'usuarios');\n const user = new User(this.getIndexUser(), name);\n this.users.push(user);\n return user;\n\n }", "title": "" }, { "docid": "5d885823dd48918fa79e7572cd621eee", "score": "0.5404697", "text": "function getAllUser() {\n ManagerUserService.getAllUser($rootScope.userLogin.token, $rootScope.offset).success(function (res) {\n $rootScope.listUser = res.results;\n\n $rootScope.bigTotalItems = res.count;\n }).error(function (err, status, response) {\n toastr.error('', err.detail);\n });\n }", "title": "" }, { "docid": "9f901f675a5007cb1a719c27b369c9c5", "score": "0.5404494", "text": "getUsuariosEnSala(sala) {\n return this.lista.filter(usuarioLis => usuarioLis.sala === sala);\n\n }", "title": "" }, { "docid": "0a30f5f9844c93dbf7e875b10c39bc6f", "score": "0.5391689", "text": "function getFuncionarioUsuario() {\r\n /* obtem os dados do funcionario na sessao */\r\n var user = JSON.parse(sessionStorage.getItem('funcionarioLogado'));\r\n return user.usuario;\r\n}", "title": "" }, { "docid": "13344e240b1a07035bd4f8163194787b", "score": "0.5391351", "text": "function getUsers(req, res){ // Crearem una variable que agafa l'identificador de l'usuari registrat al middleware, que ja esta guardat.\r\n var identity_user_id = req.user.sub; // Esta dintre de \"sub\" perque al servei JWT la propietat del ID es sub:\r\n var page = 1; // Li passem una variable page a 1 per defecte. Si pasa per url, s'actualtiza i entra a l'if.\r\n if(req.params.page){ // si arriba el req per un parametro de pàgina ( la paginacio que hem instalat com a modul)\r\n page = req.params.page; // Actualitza el valor per defecte si arriba el requeriment i l'aplica al passe per la pàgina. \r\n }\r\n\r\n var itemsPerPage = 5; // Li posem per defecte cuans usuaris volem per pàgina. Provarem en 5.\r\n // Li introduirem una busqueda completa de tots els usuaris en base al seu \r\n // ID. Ho paginarem a una pagina i li passarem un callback per als errors, els usuaris\r\n // i un contador per saber que hem arribat a 5 o el que li especifiquesem. \r\n\r\n \r\n User.find().sort('_id').paginate(page, itemsPerPage, (err, users, total) => {\r\n if(err) return res.status(500).send({message: 'Error en la petición'});\r\n if(!users) return res.status(404).send({message: 'No hay usuarios disponibles en la plataforma.'});\r\n\r\n followUserIds(identity_user_id).then((value) => {\r\n\r\n return res.status(200).send({ \r\n users,\r\n users_following: value.following,\r\n users_follow_me: value.followed,\r\n total, \r\n pages: Math.ceil(total/itemsPerPage)\r\n });\r\n });\r\n // Anteriorment aqui teniem passat aquest return, no obstant serà mes optim passar un array, ja que ara nomes passem el total\r\n // de users i pagines. Volem un array de ID's de user als que seguim i un per a los que mos segueixen.\r\n // Serà interesant modifcar-ho per al Front End, per pintar un botó o pintar-ne un altre, per mostrar això. Aixi que comentaré\r\n // Este tros de codi i n'aplicarem un de diferent adaptat a aquestes caracteristiques. \r\n });\r\n}", "title": "" }, { "docid": "071e2dc2ef8aadb5624bf68e73782574", "score": "0.53883135", "text": "getFacebookOrGoogleUser(authUser, bilheteUnico, rotina) {\n\t\tlet _usuario = this.Usuario;\n\t\tlet _this = this;\n\n\t\tlet idAuthUser = authUser.id;\n\n\t\treturn this.Usuario.findOne({ where: { id: idAuthUser } })\n\t\t\t.then(function (usuario) {\n\t\t\t\t// Encontrou usuário\n\t\t\t\tif (usuario) {\n\t\t\t\t\treturn _usuario.find({\n\t\t\t\t\t\tinclude: [{\n\t\t\t\t\t\t\tmodel: bilheteUnico\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ model: rotina }],\n\t\t\t\t\t\twhere: { id: idAuthUser }\n\t\t\t\t\t}).then(function (usuario) {\n\n\t\t\t\t\t\t// Tem bilhete unico\n\t\t\t\t\t\tif (_this.hasBilheteUnico(usuario)) {\n\t\t\t\t\t\t\tif (_this.hasRotina(usuario)) {\n\n\t\t\t\t\t\t\t\tconst rotinas = _this.getRotina(usuario);\n\t\t\t\t\t\t\t\tconst bilhete = _this.getBilheteUnico(usuario);\n\t\t\t\t\t\t\t\tconst usuarioFinal = _this.normalizeUser(usuario, bilhete, rotinas);\n\n\t\t\t\t\t\t\t\tlet response = {\n\t\t\t\t\t\t\t\t\terror: false,\n\t\t\t\t\t\t\t\t\tusuario: usuarioFinal\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\treturn response;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Não tem bilhete unico\n\t\t\t\t\t\t\tconst usuarioFinal = _this.normalizeUser(usuario, null, null);\n\t\t\t\t\t\t\tlet response = {\n\t\t\t\t\t\t\t\terror: false,\n\t\t\t\t\t\t\t\tusuario: usuarioFinal\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\treturn response;\n\t\t\t\t\t\t}\n\t\t\t\t\t}).catch(function (err) {\n\t\t\t\t\t\treturn errorResponse(err.message);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// Cria usuário\n\t\t\t\t\t_usuario.find({ where: { mobile_cadastro: authUser.mobile_cadastro } })\n\t\t\t\t\t\t.then(mobileUser => {\n\t\t\t\t\t\t\tif (mobileUser.length >= 5) {\n\t\t\t\t\t\t\t\treturn errorResponse(\"Limite de cadastro excedido\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\treturn _usuario\n\t\t\t\t\t\t.create(authUser)\n\t\t\t\t\t\t.then(function (usuario) {\n\t\t\t\t\t\t\tdelete usuario.dataValues.is_facebook;\n\t\t\t\t\t\t\tdelete usuario.dataValues.is_google;\n\n\t\t\t\t\t\t\tlet response = {\n\t\t\t\t\t\t\t\terror: false,\n\t\t\t\t\t\t\t\tusuario: usuario.dataValues\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\treturn response;\n\t\t\t\t\t\t}).catch(function (err) {\n\n\t\t\t\t\t\t\treturn _usuario\n\t\t\t\t\t\t\t\t.findOne({ where: { email: authUser.email } })\n\t\t\t\t\t\t\t\t.then(function (usuario) {\n\n\t\t\t\t\t\t\t\t\treturn _usuario.find({\n\t\t\t\t\t\t\t\t\t\tinclude: [\n\t\t\t\t\t\t\t\t\t\t\t{ model: bilheteUnico },\n\t\t\t\t\t\t\t\t\t\t\t{ model: rotina }],\n\t\t\t\t\t\t\t\t\t\twhere: { id: usuario.id }\n\t\t\t\t\t\t\t\t\t}).then(function (usuario) {\n\n\t\t\t\t\t\t\t\t\t\t// Tem bilhete unico\n\t\t\t\t\t\t\t\t\t\tif (_this.hasBilheteUnico(usuario)) {\n\t\t\t\t\t\t\t\t\t\t\tif (_this.hasRotina(usuario)) {\n\n\t\t\t\t\t\t\t\t\t\t\t\tconst rotinas = _this.getRotina(usuario);\n\n\t\t\t\t\t\t\t\t\t\t\t\tconst bilhete = _this.getBilheteUnico(usuario);\n\n\t\t\t\t\t\t\t\t\t\t\t\tconst usuarioFinal = _this.normalizeUser(usuario, bilhete, rotinas);\n\n\t\t\t\t\t\t\t\t\t\t\t\tlet response = {\n\t\t\t\t\t\t\t\t\t\t\t\t\terror: false,\n\t\t\t\t\t\t\t\t\t\t\t\t\tusuario: usuarioFinal\n\t\t\t\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\t\t\t\treturn response;\n\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t// Não tem bilhete unico\n\t\t\t\t\t\t\t\t\t\t\tconst usuarioFinal = _this.normalizeUser(usuario, null, null);\n\n\t\t\t\t\t\t\t\t\t\t\tlet response = {\n\t\t\t\t\t\t\t\t\t\t\t\terror: false,\n\t\t\t\t\t\t\t\t\t\t\t\tusuario: usuarioFinal\n\t\t\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\t\t\treturn response;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}).catch(function (err) {\n\t\t\t\t\t\t\t\t\t\treturn errorResponse(err.message);\n\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});\n\t\t\t\t}\n\t\t\t}).catch(function (err) {\n\t\t\t\treturn errorResponse(err.message);\n\t\t\t});\n\t}", "title": "" }, { "docid": "c6d7e5d059136c2f46f67c9f8c30f24b", "score": "0.5387236", "text": "function getInactivos() {\n $http.get(\"api/user/inactivos\").then(function success(res) {\n console.log(\"usuarios.inactivos\", res.data);\n usuarios.inactivos = res.data;\n $rootScope.$broadcast('usuarios.inactivos'); //Se informa a los controladores que cambio usuarios.inactivos\n }, function error(err) {\n console.log(\"error cargar usuarios.inactivos\", err);\n })\n }", "title": "" }, { "docid": "5823829f3bb764e1daf77b29f64d2793", "score": "0.5386043", "text": "function sesionActual(u){\r\n\tlocalStorage.setItem('UsuarioActual', u);\r\n\thabilitarPrincipal();\r\n}", "title": "" }, { "docid": "8fac06ea93f529ba691c8a81cc319352", "score": "0.5384083", "text": "async function consulta_usuario(usuarios){\n let resultadoUsuario = await sequelize.query('SELECT * FROM usuarios WHERE email = ?',{\n type: sequelize.QueryTypes.SELECT,\n replacements:[usuarios]\n \n })\n return resultadoUsuario\n}", "title": "" }, { "docid": "402d5d08b60ba7fff233b6e5e871a45e", "score": "0.5383587", "text": "static userAllData(username, callback)\n { db.get('select * from User INNER JOIN Account on User.username = Account.username where User.username = ?', username, (err, row) => {\n if (err)\n return console.error(err.message);\n callback(row);\n });\n }", "title": "" }, { "docid": "b4bdfc9aaaf445bf245357b60a6e5cda", "score": "0.5381233", "text": "function getUser(req, res){\n\t// Recogemos el id por URL, cuando es por URL utilizamos .params, cuando es por post o get usamos .body\n\tvar userId = req.params.id;\n\n\tUser.findById(userId, (err, user) =>{\n\t\t// validamos si hay algun error de conexion a la bd o de ejecucion:\n\t\tif (err) return res.status(500).send({ \n\t\t\tmessage: 'Ha habido un error en la conexion o en la busqueda del Usuario'\n\t\t});\n\t\tif (!user) return res.status(404).send({\n\t\t\tmessage: 'No se han encontrado conincidencias con el parametro de busqueda'\n\t\t});\n\t\t// Si encuentra al usuario, nos muestra al usuario:\n\t\treturn res.status(200).send({ user });\n\t});\n}", "title": "" }, { "docid": "9d9b4669734a1c3ad8d06b3e2163bc04", "score": "0.5381087", "text": "function buscarUsuario(regex) {\n\n return new Promise((resolve, reject) => {\n\n Usuario.find({}, 'nombre email role')\n .or([{ 'nombre': regex }, { 'email': regex }])\n .exec((err, usuariosDB) => {\n if (err) {\n reject('Error al cargar usuarios', err);\n } else {\n resolve(usuariosDB);\n }\n })\n });\n}", "title": "" } ]
03827de52c99d54b5b3b36a44f9aa2ab
checks if player wants to play again
[ { "docid": "7bc679bd9ad47fcaa4604b3a48510fea", "score": "0.0", "text": "function playAgain(winner)\n{\n // prevents players from moving\n player1.lives = -1;\n player2.lives = -1;\n\n // hides the game world and displays a play again button\n $(\"#world\").hide();\n $(\"body\").append(`<button type=\"button\" id=\"play-again\" name=\"button\"> Play Again</button>`)\n\n $(`#play-again`).click(function()\n {\n // deletes the play again button\n $(\"#play-again\").remove();\n\n // resets the array to it's default values\n map = [[4,1,0,0,0,0,0,0,0],\n [1,3,0,3,0,3,0,3,0],\n [0,0,0,0,0,0,0,0,0],\n [0,3,0,3,0,3,0,3,0],\n [0,0,0,0,0,0,0,0,0],\n [0,3,0,3,0,3,0,3,0],\n [0,0,0,0,0,0,0,0,0],\n [0,3,0,3,0,3,0,3,1],\n [0,0,0,0,0,0,0,1,5]];\n\n // increases the winners win property value\n if (winner.name === \"Player1\")\n {\n player1.wins++;\n let wins = player1.wins;\n player1 = new Player(\"Player1\", 4, 2, 1, 0, 0, wins);\n player2 = new Player(\"Player2\", 5, 2, 1, 8, 8, 0);\n }\n else\n {\n player2.wins++;\n let wins = player2.wins;\n player1 = new Player(\"Player1\", 4, 2, 1, 0, 0, 0);\n player2 = new Player(\"Player2\", 5, 2, 1, 8, 8, wins);\n }\n\n drawWorld();\n $(\"#world\").show();\n audio(0);\n\n // adds a new victories score to the display\n $(\"#p1lives\").html(`Player 1 Lives: ${player1.lives}`);\n $(\"#p1wins\").html(`Victories: ${player1.wins}`)\n $(\"#p2lives\").html(`Player 2 Lives: ${player2.lives}`);\n $(\"#p2wins\").html(`Victories: ${player2.wins}`)\n })\n}", "title": "" } ]
[ { "docid": "4b1a050266b9d59a3de0ff803787036b", "score": "0.74116147", "text": "playAgain() {\n this.reset();\n this.play();\n }", "title": "" }, { "docid": "2316e3b0279f0fc4ab028f664273ee29", "score": "0.73700804", "text": "function checkPlayAgain(){\n\tplayAgainEntity = Entities.addEntity(getCardProperties(-1, PLAY_AGAIN_TEXTURE, NORMAL_ROTATION, PLAYER_DISTANCE));\n}", "title": "" }, { "docid": "349e56890c5e5280e2fd06452e1fd877", "score": "0.7296178", "text": "function playAgain(){\n\t//retorna o fim do jogo para false\n\texecutouFimJogo = false;\n\t//reiniciar o jogo\n\treiniciar();\n //fechar o resultado\n\tfecharModalResultado();\n}", "title": "" }, { "docid": "3bfc8c0b21237ab81803e6c3627780f9", "score": "0.7216924", "text": "function checkGameOver() {\n if (couragePlayer.dogGone) {\n showGameOver = true;\n //stops music\n mainMusic.stop();\n //plays the lose song\n loseMusic.play();\n }\n}", "title": "" }, { "docid": "18490325d2cd850479869352664290db", "score": "0.7161633", "text": "function playAgain() {\n\t\t\t\tvar audio = new Audio('assets/wow.mp3');\n\t\t\t\taudio.play();\n\t\t\t\twinShow.innerHTML = '';\n\t\t\t\tfor (var i = 0; i < 9; i++) \n\t\t\t\t{\n\t\t\t\t\tself.syncWithFirebase.slots[i].allianceSlot = false;\n\t\t\t\t\tself.syncWithFirebase.slots[i].hordeSlot = false;\n\t\t\t\t\tsomeoneWon = false;\n\t\t\t\t}\n\t\t\t\tself.syncWithFirebase.counter = 0;\n\t\t\t\tself.syncWithFirebase.$save();\n\t\t\t}", "title": "" }, { "docid": "e401648fc34fe30c6a35483efa6c7fe5", "score": "0.71337026", "text": "function playAgain() {\n resetBoard();\n initialDeal();\n }", "title": "" }, { "docid": "aebf93958a0dece1c83d366736bcaa03", "score": "0.7040425", "text": "function playAgain(){\n\t rl.question(\"Play again? (Y/N)\", (replay) => {\n\t replay = replay.toLowerCase();\n\t\t if (replay === 'y'){\n\n\t\t board = [\n \t\t\t [' ', ' ', ' '],\n \t\t\t [' ', ' ', ' '],\n \t\t\t [' ', ' ', ' ']\n\t\t \t ];\n\t\twinConditionX = 0;\n\t \twinConditionO = 0;\n\t\twinner= false;\t\n\t\t\t getPrompt();\n\t }\n//if user doesnt want to play again, ext\n\t\t else {process.exit();}\n\t }); \n\t }", "title": "" }, { "docid": "176c6a5eff669d947f7e4cb5657166bb", "score": "0.7036115", "text": "function endGame() {\n gameOver = true ;\n buttonPressed = false;\n song.play();\n}", "title": "" }, { "docid": "82d9037e72cc905f50afe46e221ef4af", "score": "0.70125943", "text": "function playAgain(){\n\t// add code here\n}", "title": "" }, { "docid": "89496506812ce126f06438f8143eba2f", "score": "0.6995241", "text": "function playAgain(){\n\t\t// add code here\n\t\tinit();\n\t\t$('body, .header, .main-content').removeClass('loser');\n\t\t$('body, .header, .main-content').removeClass('winner');\n\t\t$('#message').html(\"\");\n\t\t$('#winnerImage').detach();\n\t\t\t$('#submit_button').prop('disabled', false);\n\t\t\t$('#hint').prop('disabled', false);\n\t\t\t$('#question').prop('disabled', false);\n\n\t}", "title": "" }, { "docid": "17cd984d6ce9811b3d0520f4ab65c0f0", "score": "0.6981845", "text": "function playAgain() {\n\tvar playGameAgain = [\n\t {\n\t type: 'confirm',\n\t name: 'playAgain',\n\t message: 'Do you want to play again?',\n\t default: true\n\t }\n\t];\n\n\tinquirer.prompt(playGameAgain).then(userWantsTo => {\n\t\tif (userWantsTo.playAgain){\n\t\t\tlettersAlreadyGuessedList = \"\";\n\t\t\tlettersAlreadyGuessedListArray = [];\n\t\t\tslotsFilledIn = 0;\n\t\t\tconsole.log(gameTextColor(\"Great! Welcome back. Let's begin...\"));\n\t\t\tstartGame();\n\t\t}\n\n\t\telse {\n\t\t\tconsole.log(gameTextColor(\"Good bye! Come back soon.\"));\n\t\t\treturn;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "28cf653ce0221c90e7508f7c0ab4037d", "score": "0.69774234", "text": "function checkFinished() {\n if (ytplayer.getPlayerState() >= 1 && ytplayer.getPlayerState() != 2)\n if (ytplayer.getCurrentTime() >= endTime())\n ytplayer.pauseVideo();\n}", "title": "" }, { "docid": "c519879857e6b3d344d2e87831e23723", "score": "0.6975999", "text": "function playAgain() {\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"Do you want to play again?\",\n name: \"again\"\n }\n ]).then(function (user) {\n if(user.again === true) {\n letsPlay();\n } else {\n stopGame();\n }\n });\n\n}", "title": "" }, { "docid": "1be2f13e62e6f99193e58bf93b54b992", "score": "0.6936005", "text": "function playTrue() {\r\n play = true;\r\n }", "title": "" }, { "docid": "3332afcdbb93c9a41cdc4721996c9bcb", "score": "0.6913778", "text": "function playAgain () {\n\tbeginGame();\n\tclosePopup();\n}", "title": "" }, { "docid": "97e494d9aa447c4593ba55420757fb74", "score": "0.69025356", "text": "function playAgain(){\n\t// add code here\n\tplayersGuesses = [];\n\thint = true;\n\twon = false;\n\twinningNumber = generateWinningNumber();\n\tplayersGuess = undefined;\n\t$('img').hide();\n\tif ($('p').hasClass(\"right\")){\n\t\t$('p').removeClass(\"right\");\n\t}\n\tif ($('p').hasClass(\"wrong\")){\n\t\t$('p').removeClass(\"wrong\");\n\t}\n\t$('p').text(\"Guess a number to start playing!\");\n}", "title": "" }, { "docid": "60b36b5bac3802971adaef290c5aaead", "score": "0.6874037", "text": "function playAgain() {\n\tgameOver = false;\n\tplayer.color = \"green\";\n\tlevel = 1;\n\tscore = 0;\n\tlives = 3;\n\tbadArc.speed = 2;\n\tgoodArc.speed = 2;\n}", "title": "" }, { "docid": "a1e46ef80fde9dcfbbc7f16483a44639", "score": "0.68215936", "text": "function playPause() {\r\n\tplay = !play;\r\n\tif(play) {\r\n\t\tloop();\r\n\t}\r\n}", "title": "" }, { "docid": "eae8072c305bba41641893054e8328e5", "score": "0.68207985", "text": "function playAgain() {\n\tvar playGameAgain = [\n\t {\n\t type: 'confirm',\n\t name: 'playAgain',\n\t message: 'Do you want to play again?',\n\t default: true\n\t }\n\t];\n\n\tinquirer.prompt(playGameAgain).then(userWantsTo => {\n\t\tif (userWantsTo.playAgain){\n\t\t\t//Empty out the array that contains the letters already guessed.\n\t\t\tlettersAlreadyGuessedList = \"\";\n\t\t\tlettersAlreadyGuessedListArray = [];\n\t\t\t//Set number of slots filled in with letters back to zero.\n\t\t\tslotsFilledIn = 0;\n\t\t\tconsole.log(\"Great! Welcome back. Let's begin...\");\n\t\t\t//start a new game.\n\t\t\tstartGame();\n\t\t}\n\n\t\telse {\n\t\t\t//If user doesn't want to play again, exit game.\n\t\t\tconsole.log(\"Good bye! Come back soon.\");\n\t\t\treturn;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "69d063c4c7405e184b4abbc88de09211", "score": "0.6761524", "text": "function checkResetTime() {\n var now = $.now(); \n if (now - endTime >= lostPause) {\n restartGame();\n }\n }", "title": "" }, { "docid": "2e37814616511518e1ec16103402c4d4", "score": "0.67596304", "text": "function gameCheck() {\n if (player1HP <= 0) {\n \tfinishSound.play();\n\t\t\t$('#player1Status').text('YOU LOSE!');\n \t$('#player2Status').text('YOU WIN!');\n \t$('#player1button').prop('disabled', true);\n \t$('#player2button').prop('disabled', true);\n } else if (player2HP <= 0) {\n\t\t\tfinishSound.play();\n\t\t\t$('#player1Status').text('YOU WIN!');\n \t$('#player2Status').text('YOU LOSE!');\n \t$('#player1button').prop('disabled', true);\n \t$('#player2button').prop('disabled', true);\n }\n }", "title": "" }, { "docid": "0f0723cc8b265c1b1544d545176f6f16", "score": "0.6756939", "text": "function loseGame(reset) {\n var loseGame = $('#lose-sound')[0];\n var gameOver = $('#game-over')[0];\n loseGame.play();\n setTimeout(function() {\n $('.game-over').removeClass('hidden');\n gameOver.play();\n enablePlayAgain(reset, true);\n }, 1000);\n\n}", "title": "" }, { "docid": "a6f17bee19f4a17249d39ae99a72514e", "score": "0.67304015", "text": "isPlaying() {\n return !(this.player.paused || this.client.paused);\n }", "title": "" }, { "docid": "2e94eb7bf0ffe8434c41e8bb5fa928ff", "score": "0.6730277", "text": "function playAgain(){\n setBoard();\n p1Score = 0;\n p2Score = 0;\n currentPlayer = 1;\n showElement(\"player2_highlight\");\n hideElement(\"player2_highlight\");\n hideElement(\"player2Win_label\");\n hideElement(\"player1Win_label\");\n setText(\"score1_label\", p1Score);\n setText(\"score2_label\", p2Score);\n setScreen(\"gamePlay_screen\");\n}", "title": "" }, { "docid": "fc86405a09ed4ff186d20e8bc03949cc", "score": "0.67136294", "text": "function hasWon() {\n if (allPlayersArr.length === 0 && userPlayer.health > 0 && !restartGame()) {\n $('audio#youWinAudio')[0].play();\n return true;\n }\n \n else return false; \n}", "title": "" }, { "docid": "ae6ae07b4498fa4733c341eecf23b228", "score": "0.66910005", "text": "function gameRestart() {\n gameTimerStop(gameTimer);\n readyToPlay();\n}", "title": "" }, { "docid": "85257182b84a67b8ce03daca247797cb", "score": "0.66808414", "text": "function continuePlaying(){\r\n\thideDiv('endGame');\r\n\tretreat();\r\n\t}", "title": "" }, { "docid": "650f007b34cbde012b91f5d4edb920e8", "score": "0.6679469", "text": "gameIsOver() {\n this.pauseGame = true;\n this.winner = false;\n }", "title": "" }, { "docid": "808e39d5ca92a64d2148685ba4806d30", "score": "0.66705084", "text": "function playAgain(){\r\n startGame();\r\n}", "title": "" }, { "docid": "fbedcd49e7200a4cb85ea3b569a32565", "score": "0.66693234", "text": "function handlePlayerQuit() {\n disqualifyPlayer();\n }", "title": "" }, { "docid": "2f776e944e8e66df9ea3bb52f2fc40bf", "score": "0.66475725", "text": "nextPlayer() {\n this.nextPlayerIndex();\n\n if (this.playerIndex === this.dealerIndex) {\n this.isRoundFinished = true;\n\n return true;\n }\n\n this.players.forEach((p) => (p.isPlaying = false));\n this.currentPlayer.isPlaying = true;\n\n return false;\n }", "title": "" }, { "docid": "38ce10c5e4dd0e4c36d70b62716218c4", "score": "0.6644706", "text": "function replayGame() {\n console.log(\"Want to play again?\");\n if (confirm(\"Play again?\") == true) {\n console.log(`Okay, let me just reset everything *BEEPBOOPBEEP*\\n\\n`);\n resetGame();\n return game();\n } else {\n console.log(\n \"Then I'll be waiting for you to find some courage for a rematch!\"\n );\n resetGame();\n }\n}", "title": "" }, { "docid": "eecc34d8e58dee0eca64c02582655504", "score": "0.66096485", "text": "function playAgain(){\n\t// add code here\n generateWinningNumber();\n tries = [];\n msgUpdate(\"\");\n $(\".guessCount\").html(\"\");\n $(\"#message\").removeClass(\"win\")\n $(\"#message\").removeClass(\"lose\");\n enableGuess();\n}", "title": "" }, { "docid": "019703b05884e80a646e36b3704a6e26", "score": "0.66069376", "text": "function playAgain() {\n gameState.currentBoard = [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"];\n gameState.winsRemaining = [\n \"012\",\n \"345\",\n \"678\",\n \"036\",\n \"147\",\n \"258\",\n \"048\",\n \"246\"\n ];\n gameState.movesMade = 0;\n gameState.currentPlayer = \"X\";\n gameState.gameOver = false;\n storage.setGameState(gameState);\n ui.draw(gameState);\n ui.displayMessage(\" to move\", playerImages[gameState.currentPlayer]);\n ui.playAgainButton.classList.add(\"hide\");\n ui.gridContainer.addEventListener(\"click\", makeMove);\n }", "title": "" }, { "docid": "a66da2649bbea0621681d887f6acdc97", "score": "0.65947723", "text": "play(e) {\n this.player.setChoice(e.currentTarget.getAttribute('data-choice'));\n return this.checkWinner(this.player.getChoice(), this.machine.getChoice());\n }", "title": "" }, { "docid": "2f3a7746a9f4c9149563101597eaf364", "score": "0.65871507", "text": "function endGame() {\n\n playing = false;\n noLoop();\n}", "title": "" }, { "docid": "f7d0aaa03c3f4a4988062908eace5cef", "score": "0.6586793", "text": "function loserC() {\n if (toggleAudio()) {\n audioFile.lose.play();\n }\n if (confirm(`Unlucky, you lost!\\nWould you like to play again?`)) {\n resetC();\n }\n}", "title": "" }, { "docid": "97576bfd5cbda69cc43975d49753aa09", "score": "0.65808743", "text": "function stop()\r\n{\r\n\tplay=!play;\r\n}", "title": "" }, { "docid": "4d0f8104f0c62697288aed4e0e00fa4b", "score": "0.6575668", "text": "function justplay(){\r\n \tif(Playing_song==false){\r\n \t\tplaysong();\r\n\r\n \t}else{\r\n \t\tpausesong();\r\n \t}\r\n }", "title": "" }, { "docid": "7313c56302014480d739628e450b8561", "score": "0.6571382", "text": "get isPlaying() {\r\n return $(\"#phrase .letter.hide\").length !== 0 && // Check if player hasn't won\r\n this.missed < this.totalHearts; // and hasn't lost\r\n }", "title": "" }, { "docid": "8b27ada90190d058c1122d9cee71033a", "score": "0.6567225", "text": "function checkPlay(play) {\n if (play == true) {\n window.location.reload();\n } else {\n playing = true;\n console.log('We are playing');\n document.getElementById('score').style.display = 'block';\n document.getElementById('timeRemaining').style.visibility = 'visible';\n document.getElementById('instruction').innerHTML = 'click on the correct answer';\n document.getElementById('start').innerHTML = 'Reset';\n }\n}", "title": "" }, { "docid": "a6642e0d8cd4808770b5f5f28bdde4ef", "score": "0.65666264", "text": "function restart() {\n // localStorage.clear();\n countDown = 26;\n $('#playerRight').text('');\n $('#playerWrong').text('');\n run();\n $('#q1Choice1').prop('checked', true);\n $('#q2Choice1').prop('checked', true);\n $('#q3Choice1').prop('checked', true);\n $('#q4Choice1').prop('checked', true);\n $('#q5Choice1').prop('checked', true);\n $('#q6Choice1').prop('checked', true);\n $('#q7Choice1').prop('checked', true);\n }", "title": "" }, { "docid": "2f32d22d89c612f9e6cfa689c662900d", "score": "0.65572894", "text": "function justplay(){\n \tif(Playing_song==false){\n \t\tplaysong();\n\n \t}else{\n \t\tpausesong();\n \t}\n }", "title": "" }, { "docid": "2f32d22d89c612f9e6cfa689c662900d", "score": "0.65572894", "text": "function justplay(){\n \tif(Playing_song==false){\n \t\tplaysong();\n\n \t}else{\n \t\tpausesong();\n \t}\n }", "title": "" }, { "docid": "28e6bca9e6c1885a2c3e58de392221bf", "score": "0.65476626", "text": "function gameLose()\n {\n var sounds = game.add.audio('failure');\n sounds.play(); \n }", "title": "" }, { "docid": "eb30e6fb0b75e3021e8907e47f431d92", "score": "0.6546233", "text": "function checkGameStatus() {\n\tif (matchedCards.length == totalCards.length){\n\t\twindow.clearInterval(t);\n\t\taudioObj.start.stop();\n\t\taudioObj.finish.play();\n\t\tmodalPopupView.init();\n\t}\n}", "title": "" }, { "docid": "a7487dec35c2e4d14ce5e8daf68ce885", "score": "0.6538201", "text": "function checkWin() {\n if($(\"#opp-player>div\").length == 0 && $(\"#def-player>div\").length == 0) {\n //Game over, attack button off\n $(\".attack\").off(\"click\");\n\n //Hide Attack button\n $(\"#attack\").hide();\n\n //Show Play Again button\n $(\"#replay\").show();\n \n //Instruction for the player to follow\n $(\"#comments\").html(\"woohoo!! you won\");\n\n //When Play Again button pressed, calls replay function\n $(\"#replay\").click(function() {\n replay();\n });\n }\n }", "title": "" }, { "docid": "fc64b5fbeec0dcbce9d93a5b74360323", "score": "0.6532519", "text": "function playAgainMenu(e){\n var element = getElementAt(e.getX(),e.getY());\n if(element != null && lost == true && element.getColor() == Color.white){\n add(player1LifeBar1);\n add(player1LifeBar2);\n add(player1LifeBar3);\n add(player2LifeBar1);\n add(player2LifeBar2);\n add(player2LifeBar3);\n player1Lives = 3;\n player2Lives = 3;\n remove(endScreen);\n remove(oneWin);\n remove(twoWin);\n remove(play);\n remove(playText);\n canShoot = true;\n playerTurn =1;\n lost = false;\n }\n}", "title": "" }, { "docid": "5a4c4ec97839776eebf0a1e0a74d1d43", "score": "0.6525313", "text": "checkIsPaused() {\n if (this.isFinished) return;\n\n if (this.isPaused) {\n this.continueGame();\n } else {\n this.pauseGame();\n }\n\n this.isPaused = !this.isPaused;\n }", "title": "" }, { "docid": "bf2f9674cd3a514281cf602e8fd65bef", "score": "0.6520171", "text": "function checkStatus() {\n if (!isPlaying && time === 0) {\n message.innerHTML = \"Game Over!\";\n score = -1;\n }\n}", "title": "" }, { "docid": "0d08a95be265afee0ad361435d188b1f", "score": "0.65113837", "text": "function checkLoss()\n{\nif(remainingGuesses == 0) {\n resetGame();\n alert(\"YOU LOSE!\")\n// loseSound.play();\n// document.getElementById(\"gameover-image\").style.cssText = \"display: block\";\ndocument.getElementById(\"pressKeyTryAgain\").style.cssText = \"display:block\";\nhasFinished = true;\n}\n}", "title": "" }, { "docid": "faf90799ec8f80d5a72dd4d45e514e34", "score": "0.6507719", "text": "function justplay(){\n if (playing_song==false){\n playsong();\n }else {\n pausesong();\n }\n}", "title": "" }, { "docid": "18954256d69aeb1170dd4e0397b1fb06", "score": "0.65047395", "text": "unpause() {\n if (this.state.status !== AudioPlayerStatus.Paused)\n return false;\n this.state = {\n ...this.state,\n status: AudioPlayerStatus.Playing,\n missedFrames: 0,\n };\n return true;\n }", "title": "" }, { "docid": "7a01bf0ee7ac47bd9f93fba031e60d6d", "score": "0.6504731", "text": "function checkStart() {\n console.log(ytplayer.getPlayerState());\n if (ytplayer.getPlayerState() >= 1 && ytplayer.getPlayerState() != 2)\n if (ytplayer.getCurrentTime() >= startTime()) {\n // Display the player and resume the volume\n $('#ytPlayer').css('visibility', 'visible');\n ytplayer.setVolume(volume);\n clearInterval(intervalCode);\n }\n}", "title": "" }, { "docid": "489d8697eb8a1628a95fc544ec5eb2a3", "score": "0.65007526", "text": "function play() {\n paused = false;\n player.play();\n }", "title": "" }, { "docid": "ce71246bc0c2e4bef8b2ef0bb34afff7", "score": "0.6494374", "text": "function doPlayAgain(){\n resetGame();\n closePopUp();\n}", "title": "" }, { "docid": "1583f4ad142cf5b5c7a91d6b70ad0c85", "score": "0.6493948", "text": "function playAgain() {\n\n\t\tarrMovies = [],\n\t\tarrMatches = [],\n\t\tintMatch = 0;\n\n\t\tinitGame();\n\t}", "title": "" }, { "docid": "326a5f76ceb8aefcfc67082c7c8a4da6", "score": "0.6487963", "text": "function pause() {\n setPlaying(false);\n }", "title": "" }, { "docid": "5b327aa25ebdcf4a72eaa39cae33e00c", "score": "0.64801264", "text": "function just_play(){\r\n if(playing_song == false){\r\n playsong();\r\n }else {\r\n pausesong();\r\n }\r\n}", "title": "" }, { "docid": "c5dec722db76367242bca361938164aa", "score": "0.64717364", "text": "playAgain() {\n this.client.emit('playAgain')\n }", "title": "" }, { "docid": "42ed1190533f0d7c7e7cf3eec1f0bafb", "score": "0.6470693", "text": "function playAgain()\n{\n //handle the last game results\n if (myScene.game.winner == 1)\n player1Score++;\n else if (myScene.game.winner == 2)\n player2Score++;\n\n //create new game instance\n play();\n}", "title": "" }, { "docid": "d003b013212c13502956aa171cf46192", "score": "0.6455884", "text": "function testSong(){\n var SonsPlaying = song.isPlaying();\n if ( SonsPlaying === false ){\n song.play();\n }\n if ( SonsPlaying === true ){\n flag = true;\n }\n}", "title": "" }, { "docid": "7499b57ae9f35495711fcc10f635581a", "score": "0.6455048", "text": "function playAgain() {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"playagain\",\n message: \"Play again? y/n\"\n }\n ])\n .then(function (answers) {\n if (answers.playagain.toLowerCase() === \"y\") {\n initializeGame();\n } else if (answers.playagain.toLowerCase() === \"n\") {\n console.log(chalk.blueBright(\"See ya!\"));\n } else {\n console.log(chalk.cyan(\"Yes or No, partner? (y/n)\"));\n playAgain();\n }\n });\n}", "title": "" }, { "docid": "bc7a14a23cfdf5d450f1e0347b3452cd", "score": "0.64540297", "text": "function playAgain(){\n\t// add code here\n\tprompt(\"You lost. Resetting the mystery number.\")\n \tgenerateWinningNumber();\n}", "title": "" }, { "docid": "b2f89b07798a6c1cb9877ec5cd35ea62", "score": "0.6451666", "text": "function playAgain(event){\n if(event.target.textContent ===\"PLAY AGAIN\"){\n window.location.reload();\n }\n}", "title": "" }, { "docid": "f47dad8ba1ae98135ef8904916c204ff", "score": "0.64505273", "text": "function falseArrest(player) {\n\tplaySound(10);\n\n\n}", "title": "" }, { "docid": "1befda19f9119028dac13797d161a0f7", "score": "0.64463305", "text": "function playOrStop() {\n if (playing)\n stop();\n else play();\n}", "title": "" }, { "docid": "987290e19e2ffcf019846eab8a79e393", "score": "0.6439101", "text": "function contin() {\n inquirer.prompt([{\n type: 'confirm',\n name: 'continue',\n message: 'would you like to play again?',\n default: 'Yes'\n }]).then((res) => {\n if (res.continue) {\n game()\n }\n })\n}", "title": "" }, { "docid": "268017c889d657e5ebd321a347b13b80", "score": "0.64321333", "text": "function wrongAnswer(){\n wrong.currentTime = 0;\n wrong.play();\n clearInterval(timer);\n secondsLeft = 30;\n $('#answer').text('Wrong..');\n writeUp();\n console.log('you guessed the wrong answer!');\n wrongGuesses++;\n }", "title": "" }, { "docid": "ab0dc4ce547bc26d880d5bd5b34d9be4", "score": "0.6431905", "text": "function checkAnswer(currentlevel)\r\n{\r\n if(gamePattern[currentlevel]===userClickedPattern[currentlevel]){\r\n console.log(\"sucess\");\r\n if(gamePattern.length===userClickedPattern.length)\r\n {\r\n setTimeout(function(){\r\n nextSquence();\r\n },1000);\r\n }\r\n }\r\n else{\r\n var audio = new Audio(\"sounds/wrong.mp3\");\r\n audio.play();\r\n //animataion for wrong\r\n $(\"body\").addClass(\"game-over\");\r\n setTimeout(function(){\r\n $(\"body\").removeClass(\"game-over\");\r\n },2000);\r\n $(\"#level-title\").text(\"game over, press Any key to Start\");\r\n startOver();\r\n }\r\n}", "title": "" }, { "docid": "d889b8e53f951d7f3ef73298ebd2392a", "score": "0.64290905", "text": "function justplay() {\r\n if (Playing_song == false) {\r\n playsong();\r\n\r\n } else {\r\n pausesong();\r\n }\r\n}", "title": "" }, { "docid": "7403e8bf8da14ed928cc5c7496e47e5d", "score": "0.64246213", "text": "function playOrPause() {\n console.log(isPlay);\n srcImage = allSongs[songIndex].imageeSrc;\n\n if (isPlay === \"play\") {\n play();\n } else {\n pause();\n }\n}", "title": "" }, { "docid": "b38ed72bbfac62b5a7423b879e4e5519", "score": "0.6420537", "text": "function shotMiss() {\n if (gameOn == true) {\n shot.currentTime = 0;\n if (!soundmuted) {\n shot.play();\n }\n }\n}", "title": "" }, { "docid": "09ea31a533740e32d44989a8360d5b8a", "score": "0.6415772", "text": "function justplay()\r\n{\r\n if(playing_song==false)\r\n {\r\n playsong();\r\n}else {\r\n pausesong();}\r\n}", "title": "" }, { "docid": "a701f4c5043dd3c7c53139b1b93701db", "score": "0.64021444", "text": "function playAgain() {\n inquirer.prompt([{\n type: 'input',\n message: 'Would you like to play again? Please type \"y\" for Yes and \"n\" for No',\n name: 'playAgain'\n }]).then(function(user) {\n var answer = user.playAgain;\n if (answer == 'y') {\n game.userPrompt(function() {\n newWord = new word.Word(game.chosenWord);\n userGuess();\n });\n } else if (answer === 'n') {\n console.log(\"Thank you for playing! I HOPE YOU ENJOYED THE GAME!\");\n return;\n }\n })\n }", "title": "" }, { "docid": "3238944aab4adb586dd8de0a67215a51", "score": "0.64000434", "text": "function checkPlayerDie(){\n\tif(isPlummeting && gameChar_y>height){\n\t\tlives-=1;\n\t\tfallSound.play();\n\t\tif (lives>0){\n\t\t\tstartGame();\n\t\t}\n\t}\n\t\n}", "title": "" }, { "docid": "9def6a288cdde4890d1372458f731201", "score": "0.6391336", "text": "function enablePlayAgain(reset, isLose) {\n if (isLose) {\n $('#restart').click(function() {\n $('.game-over').addClass('hidden');\n zeroStats();\n reset();\n });\n } else {\n var button = document.querySelector('.btn');\n button.addEventListener('click', function () {\n button.classList.add('hidden');\n zeroStats();\n reset();\n });\n }\n}", "title": "" }, { "docid": "cfb1f17c9dd33422d377309de31e2758", "score": "0.6386465", "text": "function pause() {\n paused = true;\n player.pause();\n }", "title": "" }, { "docid": "7711b0e31f28b0a5ba97904e0d59a069", "score": "0.6384679", "text": "function finishGame() {\n $('.player1').removeClass('highlightCurrentPlayer');\n $('.player2').removeClass('highlightCurrentPlayer');\n clearTimer();\n self.inPlay = false;\n }", "title": "" }, { "docid": "9fe1345195653e2ae21ffb664d8046af", "score": "0.6382783", "text": "playSiren()\n {\n if (!playSiren.isPlaying() && !eatTheBigDot.isPlaying())\n {\n playSiren.play();\n }\n else if ((oppBlinky.gameState === \"scared\" || oppPinky.gameState === \"scared\" || oppInky.gameState === \"scared\" || oppClyde.gameState === \"scared\") && (!eatTheBigDot.isPlaying()))\n {\n eatTheBigDot.play();\n }\n }", "title": "" }, { "docid": "df40dc1e791b2f1240676dbae4c7f131", "score": "0.637393", "text": "function justplay() {\n if (playing_song == false) {\n playsong();\n } else {\n pausesong();\n }\n}", "title": "" }, { "docid": "a13e0095bd7968a9066ec7f2ad4423cd", "score": "0.6373822", "text": "function playAudio() {\r\n var play = prompt('Are you sure (type: yes or no)?');\r\n \r\n //yes - play the audio\r\n if (play == 'yes' || play == 'Yes' || play == 'YES') {\r\n replayCount++; //counts how many times audio has played\r\n audioWin.play();\r\n\r\n if (replayCount == 1) {\r\n alert('This is the first time the audio is playing');\r\n }\r\n else {\r\n alert('The audio replayed ' + replayCount + ' times');\r\n }\r\n }\r\n \r\n //no - don't play the audio\r\n else if (play == 'no' || play == 'No' || play == 'NO') {\r\n alert('Ok not playing');\r\n }\r\n else {\r\n alert('Improper input');\r\n playAudio(); //retry getting input\r\n }\r\n}", "title": "" }, { "docid": "2337307d6a230e5d4b75193c24e32f6a", "score": "0.63718385", "text": "function isOver() {\n if (matchedCards.length === cards.length) { \n stopTimer()\n alert('CONGRATULATIONS!, Play again?')\n }\n }", "title": "" }, { "docid": "5bc826dd1fa99393f0e79cb8c83aaadb", "score": "0.6369362", "text": "function play(){\n //console.log(\"tubeShark resuming!\");\n GS.player.resumeSong();\n}", "title": "" }, { "docid": "6ccde9621e43a2b4010be61434dea53a", "score": "0.63530636", "text": "function playAgain(){\n\tgenerateWinningNumber();\n}", "title": "" }, { "docid": "b2d8613d66c49af8bd2de8a5f1580bce", "score": "0.63524944", "text": "function endGame() {\n gameOver = true;\n //prompt for reset\n // $(\"#alert\").html(\"Please refresh the page to play again.\");\n}", "title": "" }, { "docid": "468f5b020be3c7cbcebda2163669b246", "score": "0.6344953", "text": "gameOver() {\r\n this.stopMusic();\r\n this.gameOverSound.play();\r\n }", "title": "" }, { "docid": "dddd844a9df1230a28a43d6b0ca0c8c7", "score": "0.63421375", "text": "function replay() {\r\n inquirer\r\n // prompt yes or no to replay\r\n .prompt([\r\n {\r\n type: \"confirm\",\r\n name: \"confirm\",\r\n message: \"play again?\"\r\n }\r\n ])\r\n .then(confirmation => {\r\n // if yes, reset varaibles for new game\r\n if (confirmation.confirm) {\r\n chosenWord = wordSelection();\r\n word = new Word(chosenWord);\r\n remainingGuesses = 7;\r\n word.displayWord();\r\n\r\n // recursion to start again\r\n getUserPrompt();\r\n } else {\r\n // display message top the user and exit\r\n console.log(\"Thank you for playing\");\r\n return;\r\n }\r\n });\r\n}", "title": "" }, { "docid": "a8c4e0385b83b39d91eb332f279aaf12", "score": "0.6341707", "text": "function playAgain(ans) {\n if (ans == 2) {\n alert(\"Thanks for playing!\");\n }\n else {\n return 0;\n }\n}", "title": "" }, { "docid": "9d20d05a7dbca4a035cea7b4f06f9288", "score": "0.6340264", "text": "continueGame() {\n this.startAnimations();\n this.startInterval();\n this.startLoop();\n $('.btn-pause img').attr('src', 'assets/img/pause.png');\n if (!this.isMuted) {\n this.backgroundSound.volume = 1;\n }\n }", "title": "" }, { "docid": "94228f16989e1e0bba9afea99a1696ae", "score": "0.633806", "text": "function play()\n{\n\tupdate();\n\tactualplaymode = 1;\n}", "title": "" }, { "docid": "983cb90b02790963ba3ece766f3e3a36", "score": "0.6338027", "text": "function gameOver() {\r\n gameSequence = [];\r\n playerSequence = [];\r\n started = false;\r\n level = 0;\r\n $('h1').text('Game Over, Press Any Key to Restart');\r\n // Red animation to the background\r\n $('body').addClass('game-over');\r\n\r\n setTimeout(()=> {\r\n $('body').removeClass('game-over');\r\n }, 200);\r\n // Play audio from wrong choice\r\n var wrong = new Audio('sounds/wrong.mp3');\r\n wrong.play();\r\n\r\n $('.modal-text').text('Game Over, Play Again?');\r\n $('.start-btn').text('Play Again');\r\n\r\n modal.fadeIn(300);\r\n darkOverlay.fadeIn(300);\r\n}", "title": "" }, { "docid": "2a80cf8cc1389a6379f49065cbf07e43", "score": "0.6330894", "text": "function promptLoss() {\n isGameOver = true;\n updateMessage(\"You have been defeated!\");\n pause(battleTheme);\n playLoop(defeatTheme);\n promptRestart();\n\n}", "title": "" }, { "docid": "c6d3a7d474914e8252759536e8c3418e", "score": "0.63291883", "text": "function unPause(){\r\n\t\tif (pause){\r\n\t\t\trunPiece();\r\n\t\t\tpause = false;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "title": "" }, { "docid": "170c3fa1ee4accc04497a4d54b6b1b66", "score": "0.631972", "text": "function restart() {\n softBtnSound.play();\n if ( round > 0 == true && learnMode == false) byeSound.play();\n init();\n}", "title": "" }, { "docid": "998fe58f56d1db7feb3fefd13fedf72a", "score": "0.63196564", "text": "function check_winner(){\n\t\tif (player_one_position === 94 && player_two_position != 94) {\n\t\t\tend_time = $.now();\n\t\t\ttime = ((end_time - start_time) / 1000);\n\t\t\tgame_on = false;\n\t\t\t$(\".winner\").html( player_name + \" WINS with a time of \" + time + \" seconds!!\");\n\t\t\t$(\"#restart\").removeClass('hidden');\n\t\t\t$(\"#restart\").addClass('show');\n\t\t\t$(\"body\").off(\"keydown\");\n\n\t\t} else if (player_one_position != 94 && player_two_position === 94) {\n\t\t\tend_time = $.now();\n\t\t\ttime = ((end_time - start_time) / 1000);\n\t\t\tgame_on = false;\n\t\t\t$(\".winner\").html(\"Robot WINS with a time of \" + time + \" seconds!!\");\n\t\t\t$(\"#restart\").removeClass('hidden');\n\t\t\t$(\"#restart\").addClass('show');\n\t\t\t$(\"body\").off(\"keydown\");\n\t\t}\n\t}", "title": "" }, { "docid": "5c1dc9b1d8e9c345546add9ca32a77a6", "score": "0.63177586", "text": "function onPlayerStateChange(event) {\nif (event.data == YT.PlayerState.ENDED || event.data == YT.PlayerState.PAUSED ){\n afterPlay();\n}\n}", "title": "" }, { "docid": "26fb1734a9d683c2ad47de98e34da780", "score": "0.63079697", "text": "function isPlaying() {\n return !audio.paused;\n }", "title": "" }, { "docid": "08623c5fe3ce3be3ee5429dd73977291", "score": "0.6305178", "text": "function checkIfCorrect() {\n //If the guesses are down to zero\n if (guessesRemaining === 0) {\n console.log(\"Thanos just snapped his fingers!\")\n losses ++;\n //Displaying wins and losses\n console.log(\"wins: \" + wins);\n console.log(\"losses: \" + losses);\n replay();\n\n}\n else if (slots === someWord.letters.length) {\n console.log(\"You just saved the world \"+ answers.playerName +\"!\");\n wins++;\n //Displaying wins and losses\n console.log(\"wins: \" + wins);\n console.log(\"losses: \" + losses);\n replay();\n}\n else {\n guessLetter(\"\");\n }\n\nfunction replay(){\n \n let playAgain = [\n {\n type: 'confirm',\n\t name: 'playAgain',\n\t message: 'Do you want to play again?',\n\t default: true\n\t }\n\t];\n inquirer.prompt(playGameAgain).then(userChoice => {\n if (userWantsTo.playAgain){\n lettersUsed = \"\";\n lettersUsedArray=[];\n slots = 0;\n startPlay();\n }\n else{\n console.log(\"Thanos just snapped his fingers. I guess your gone!\");\n return;\n }\n});\n}\n}", "title": "" }, { "docid": "c7735f3320c8b68c6ddc8a78169145a5", "score": "0.6294977", "text": "function continueAttack() {\r\n itemSelect.play(null,null,1,false,true);\r\n //Player 1 idle animation appears.\r\n if (player1 == false && player2 == true)\r\n {\r\n pR.visible = true;\r\n pRL.visible = false;\r\n pRH.visible = false;\r\n pRB.visible = false;\r\n pRS.visible = false;\r\n }\r\n //Player 2 idle animation appears.\r\n if (player1 == true && player2 == false)\r\n {\r\n pL.visible = true;\r\n pLL.visible = false;\r\n pLH.visible = false;\r\n pLB.visible = false;\r\n pLS.visible = false;\r\n }\r\n //Signifies player's turn.\r\n player1TurnText.visible =! player1TurnText.visible;\r\n player2TurnText.visible =! player2TurnText.visible;\r\n //Other player can do 1 action.\r\n isContinue = true;\r\n }", "title": "" }, { "docid": "bfc65d1d11cd0161d8e114decf86483d", "score": "0.62942046", "text": "function lossCheck()\n\t{\n\t\tif(currentWord.guessCount === 0) //test to see if there are more guesses and if not then user loses\n\t\t{\n\t\t\tlosses++;\n\t\t\tdocument.getElementById(\"losses\").innerHTML = \"Losses: \"+ losses; // shows win count to user\n\t\t\tif(currentWord!==gameWords[4])\n\t\t\t{\n\t\t\t\tplayAgain = confirm(\"You have lost! Go watch more movies! Or if you dare, would you like to play again?\"); //asks user to play again\n\t\t\t\tplayAgainResponse(); //test play again response\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\talert(\"You lost the last challenge but thanks for playing!\");\n\t\t\t\tlocation.reload();\n\t\t\t}\n\t\t}\n\t}", "title": "" } ]
31e364ab2deabfd37bbd16f3b8748ed2
function used for updating state abbr with a transition to new locations
[ { "docid": "4b37718ce5a536ad974c977f3975f8cd", "score": "0.5181281", "text": "function renderAbbr(abbrGroup, xLinearScale, yLinearScale, chosenXAxis) {\n abbrGroup.transition()\n .duration(1000)\n .attr(\"x\", d => xLinearScale (d[chosenXAxis]))\n .attr(\"y\", d => yLinearScale(d.name));\n return abbrGroup;\n }", "title": "" } ]
[ { "docid": "9e93e0aa078042edbcf9426babb03396", "score": "0.6758773", "text": "function renderStateAbbr(stateAbbr, newXScale, chosenXAxis, newYScale, chosenYAxis) {\n\n stateAbbr.transition()\n .duration(1000)\n .attr(\"x\", d => newXScale(d[chosenXAxis]))\n .attr(\"y\", d => newYScale(d[chosenYAxis]));\n\n\n return stateAbbr;\n}", "title": "" }, { "docid": "21b248261db394d40d1d0b185c8d8fb2", "score": "0.6713242", "text": "function abbrState(input, to){\n\n var states = [\n ['Arizona', 'AZ'],\n ['Alabama', 'AL'],\n ['Alaska', 'AK'],\n ['Arizona', 'AZ'],\n ['Arkansas', 'AR'],\n ['California', 'CA'],\n ['Colorado', 'CO'],\n ['Connecticut', 'CT'],\n ['Delaware', 'DE'],\n ['Florida', 'FL'],\n ['Georgia', 'GA'],\n ['Hawaii', 'HI'],\n ['Idaho', 'ID'],\n ['Illinois', 'IL'],\n ['Indiana', 'IN'],\n ['Iowa', 'IA'],\n ['Kansas', 'KS'],\n ['Kentucky', 'KY'],\n ['Kentucky', 'KY'],\n ['Louisiana', 'LA'],\n ['Maine', 'ME'],\n ['Maryland', 'MD'],\n ['Massachusetts', 'MA'],\n ['Michigan', 'MI'],\n ['Minnesota', 'MN'],\n ['Mississippi', 'MS'],\n ['Missouri', 'MO'],\n ['Montana', 'MT'],\n ['Nebraska', 'NE'],\n ['Nevada', 'NV'],\n ['New Hampshire', 'NH'],\n ['New Jersey', 'NJ'],\n ['New Mexico', 'NM'],\n ['New York', 'NY'],\n ['North Carolina', 'NC'],\n ['North Dakota', 'ND'],\n ['Ohio', 'OH'],\n ['Oklahoma', 'OK'],\n ['Oregon', 'OR'],\n ['Pennsylvania', 'PA'],\n ['Rhode Island', 'RI'],\n ['South Carolina', 'SC'],\n ['South Dakota', 'SD'],\n ['Tennessee', 'TN'],\n ['Texas', 'TX'],\n ['Utah', 'UT'],\n ['Vermont', 'VT'],\n ['Virginia', 'VA'],\n ['Washington', 'WA'],\n ['West Virginia', 'WV'],\n ['Wisconsin', 'WI'],\n ['Wyoming', 'WY'],\n ];\n\n if (to == 'abbr'){\n input = input.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n for(i = 0; i < states.length; i++){\n if(states[i][0] == input){\n return(states[i][1]);\n }\n }\n } else if (to == 'name'){\n input = input.toUpperCase();\n for(i = 0; i < states.length; i++){\n if(states[i][1] == input){\n return(states[i][0]);\n }\n }\n }\n}", "title": "" }, { "docid": "a7c4e7fb9281fa54c8a7edae2c0b4dae", "score": "0.65856045", "text": "function updateStates(stateAbbr,xLinearScale,yLinearScale,chosenXAxis,chosenYAxis){\n stateAbbr.transition()\n .duration(1000)\n .attr(\"x\", d => xLinearScale(d[chosenXAxis]))\n .attr(\"y\", d => yLinearScale(d[chosenYAxis]));\n\n return stateAbbr;\n}", "title": "" }, { "docid": "88f1ef40382d173807f24efbcca04a88", "score": "0.6093819", "text": "function updateStateTooltip() {\n // Filter by year selected\n var currentFires = fireCounts.filter(function (d) {\n return d.FIRE_YEAR === yearSelected.toString();\n })\n\n states.append(\"title\")\n .text(function (d) {\n var stateInfo = currentFires.find(({STATE}) => STATE === d.properties.name)\n var acresBurned = \"no data\";\n if (stateInfo !== undefined) {\n acresBurned = stateInfo[\"NUM_BURNED_ACRES_PER_10K_ACRE\"] + \" acres burned per 10k acres\";\n }\n return d.properties.name + '\\n' + acresBurned;\n });\n }", "title": "" }, { "docid": "6aa1aa77cd8e4c93b2e49c693464f0d5", "score": "0.60405385", "text": "showStates(){\n fill(0);\n textSize(15);\n textAlign(CENTER);\n push();\n text(this.name, this.x, this.y); //abbreviation\n pop();\n }", "title": "" }, { "docid": "fc770b71680212c58f9a8eb3371b0e58", "score": "0.5897455", "text": "function SayStates() {\n var ss;\n var states = new Array(\n \"AL>Alabama\",\n \"AK>Alaska\",\n \"AB>Alberta\",\n \"AZ>Arizona\",\n \"AR>Arkansas\",\n \"BC>British Columbia\",\n \"CA>California\",\n \"CO>Colorado\",\n \"CT>Connecticut\",\n \"DE>Delaware\",\n \"FL>Florida\",\n \"GA>Georgia\",\n \"HI>Hawaii\",\n \"ID>Idaho\",\n \"IL>Illinois\",\n \"IN>Indiana\",\n \"IA>Iowa\",\n \"KS>Kansas\",\n \"KY>Kentucky\",\n \"LA>Louisiana\",\n \"ME>Maine\",\n \"MB>Manitoba\",\n \"MD>Maryland\",\n \"MA>Massachusetts\",\n \"MI>Michigan\",\n \"MN>Minnesota\",\n \"MS>Mississippi\",\n \"MO>Missouri\",\n \"MT>Montana\",\n \"NE>Nebraska\",\n \"NV>Nevada\",\n \"NB>New Brunswick\",\n \"NF>Newfoundland\",\n \"NH>New Hampshire\",\n \"NJ>New Jersey\",\n \"NM>New Mexico\",\n \"NY>New York\",\n \"NC>North Carolina\",\n \"ND>North Dakota\",\n \"NT>Northwest Territories\",\n \"NS>Nova Scotia\",\n \"OH>Ohio\",\n \"OK>Oklahoma\",\n \"ON>Ontario\",\n \"OR>Oregon\",\n \"PA>Pennsylvania\",\n \"PE>Prince Edward Island\",\n \"PQ>Quebec\",\n \"RI>Rhode Island\",\n \"SK>Saskatchewan\",\n \"SC>South Carolina\",\n \"SD>South Dakota\",\n \"TN>Tennessee\",\n \"TX>Texas\",\n \"UT>Utah\",\n \"VT>Vermont\",\n \"VA>Virginia\",\n \"WA>Washington\",\n \"DC>Washington DC\",\n \"WV>West Virginia\",\n \"WI>Wisconsin\",\n \"WY>Wyoming\",\n \"YT>Yukon Territory\");\n\n document.write(\"<OPTION selected value=% >North America</OPTION>\");\n for (ss in states) {\n document.write(\"<OPTION value=\" + states[ss] + \"</OPTION>\");\n }\n}", "title": "" }, { "docid": "bb891b898745e21716f50c056c0eed45", "score": "0.5847661", "text": "function changeNY() {\n changeLocation(nyLoc);\n}", "title": "" }, { "docid": "8f1a0e4a3d9ee8b01cb9ac5f99f86372", "score": "0.5697533", "text": "function updateSiteText() {\n var specialtyName = appState.specialtyName.toLowerCase();\n\n\nvar mapTitleText;\n switch (\"\" + appState.physicianCode + appState.calculation + \"\") {\n case \"1net\":\n mapTitleText = \"To which states is \" + appState.stateName + \" a <span style='color:#5e3c99'>net importer</span> or <span style='color:#e66101'>net exporter</span> of residents?\";\n break;\n case \"2net\":\n mapTitleText = \"To which states is \" + appState.stateName + \" a <span style='color:#5e3c99'>net importer</span> or <span style='color:#e66101'>net exporter</span> of physicians?\";\n break;\n case \"1netToAll\":\n mapTitleText = \"Which states are <span style='color:#5e3c99'>net importers</span> or <span style='color:#e66101'>net exporters</span> of residents?\";\n break;\n case \"2netToAll\":\n mapTitleText = \"Which states are <span style='color:#5e3c99'>net importers</span> or <span style='color:#e66101'>net exporters</span> of physicians?\";\n break;\n case \"1import\":\n mapTitleText = \"Who is training \"+appState.stateName+\"'s physicians in \"+specialtyName+\"?\";\n break;\n case \"2import\":\n mapTitleText = \"Where is \"+appState.stateName+\" importing physicians in \"+specialtyName+\" from?\";\n break;\n case \"1export\":\n mapTitleText = \"Where is \"+appState.stateName+\" exporting residents in \"+specialtyName+\" to?\";\n break;\n case \"2export\":\n mapTitleText = \"Where is \"+appState.stateName+\" exporting physicians in \"+specialtyName+\" to?\";\n break;\n case \"1retention\":\n mapTitleText = \"How well does each state retain its residents?\"; // in \" + specialtyName + \"?\";\n break;\n case \"2retention\":\n mapTitleText = \"How well does each state retain its physicians?\"; // in \" + specialtyName + \"?\";\n break;\n\n }\n\ndocument.getElementById(\"map-title\").innerHTML = mapTitleText;\nupdateNoteBox();\n}", "title": "" }, { "docid": "76876d7dce2df3b0dfaf1013e0bf8eca", "score": "0.56396806", "text": "function shortenStateName(state) {\n\tvar states = {\n\t\t'Alabama': 'AL', 'Alaska': 'AK', 'American Samoa': 'AS', 'Arizona': 'AZ',\n\t\t'Arkansas': 'AR', 'California': 'CA', 'Colorado': 'CO', 'Connecticut': 'CT',\n\t\t'Delaware': 'DE', 'District Of Columbia': 'DC', 'Federated States Of Micronesia': 'FM',\n\t\t'Florida': 'FL', 'Georgia': 'GA', 'Guam': 'GU', 'Hawaii': 'HI', 'Idaho': 'ID',\n\t\t'Illinois': 'IL', 'Indiana': 'IN', 'Iowa': 'IA', 'Kansas': 'KS', 'Kentucky': 'KY',\n\t\t'Louisiana': 'LA', 'Maine': 'ME', 'Marshall Islands': 'MH', 'Maryland': 'MD',\n\t\t'Massachusetts': 'MA', 'Michigan': 'MI', 'Minnesota': 'MN', 'Mississippi': 'MS',\n\t\t'Missouri': 'MO', 'Montana': 'MT', 'Nebraska': 'NE', 'Nevada': 'NV', 'New Hampshire': 'NH',\n\t\t'New Jersey': 'NJ', 'New Mexico': 'NM', 'New York': 'NY', 'North Carolina': 'NC',\n\t\t'North Dakota': 'ND', 'Northern Mariana Islands': 'MP', 'Ohio': 'OH', 'Oklahoma': 'OK',\n\t\t'Oregon': 'OR', 'Palau': 'PW', 'Pennsylvania': 'PA', 'Puerto Rico': 'PR', 'Rhode Island': 'RI',\n\t\t'South Carolina': 'SC', 'South Dakota': 'SD', 'Tennessee': 'TN', 'Texas': 'TX', 'Utah': 'UT',\n\t\t'Vermont': 'VT', 'Virgin Islands': 'VI', 'Virginia': 'VA', 'Washington': 'WA',\n\t\t'West Virginia': 'WV', 'Wisconsin': 'WI', 'Wyoming': 'WY'\n\t};\n\t\n\tif( states.hasOwnProperty(state) ) {\n\t\treturn states[state];\n\t}\n\t\n\treturn state;\n}", "title": "" }, { "docid": "5a2748f7f9de24add39d42eaced4ece0", "score": "0.558357", "text": "function makePlacemark(latlng){\n var id = new Date().getTime().toString();\n// var id = PLACEMARK.length;\n document.title = \"NEW_PLACEMARK_ADDED_STATE#\" + id + \"#\" +latlng;\n}", "title": "" }, { "docid": "b793858900565484ed7c051bf233310e", "score": "0.55475175", "text": "function usaInfo() {\n $(\"#state-name\").html('<strong>United States</strong>');\n var usaDetails = \"Total newspapers, 2004: <span class='teal'>8,583\";\n usaDetails += \"</span></br>Total newspapers, 2016: <span class='teal'>7,826\";\n usaDetails += \"</span></br>Percent change in newspapers, 2004 to 2014: <span class='teal'>-8.8%\";\n $(\"#state-info\").html(usaDetails);\n }", "title": "" }, { "docid": "6e2779bb3174a051e2f150c3479f5cd6", "score": "0.54900604", "text": "function byStateEnter(index){\n\n\t//fades out the banner over the image with the state name\n\t$(\"#state\"+index+\">.mapLocation-centeredImgText\").stop().fadeOut(350);\n\n}", "title": "" }, { "docid": "abe0a0f9b29c2d9f3fff5ff77f0dd0ea", "score": "0.54583406", "text": "function make_link(seq,state)\n{\n\t//https://chart.googleapis.com/chart?chst=d_map_pin_letter_withshadow&chld=A|FF0000|0000FF\n\t//var link = \"https://chart.googleapis.com/chart?chst=d_bubble_icon_text_small&chld=ski|bb|\"+seq+\"|FFFF23|000000\";\n\tcolors = \"99FF66\";\n\tif (state==2) {\n\t\tcolors = \"336699\";\t\n\t}\n\tvar link = \"https://chart.googleapis.com/chart?chst=d_map_spin&chld=0.9|0|\"+colors+\"|12|_|\"+seq;\t\n\t//var link=\"http://google-maps-icons.googlecode.com/files/red\"+seq+;\n\treturn link;\n}", "title": "" }, { "docid": "c1c33119a53da34bb7b8ea01897db866", "score": "0.5455086", "text": "function moveAbbr(abbrGroup, newXScale, chosenXaxis, newYScale, chosenYAxis) {\n\n abbrGroup.transition()\n .duration(1000)\n .attr(\"x\", d => newXScale(d[chosenXAxis]))\n .attr(\"y\", d=> newYScale(d[chosenYAxis]));\n\n return abbrGroup;\n}", "title": "" }, { "docid": "879a54498355b2d87a3e6c81867a5249", "score": "0.54380083", "text": "function lookupAbbreviation(name) {\r\n var stateMap = {\r\n \"Alabama\": \"AL\",\r\n \"Alaska\": \"AK\",\r\n \"Arizona\": \"AZ\",\r\n \"Arkansas\": \"AR\",\r\n \"California\": \"CA\",\r\n \"Colorado\": \"CO\",\r\n \"Connecticut\": \"CT\",\r\n \"Delaware\": \"DE\",\r\n \"District of Columbia\": \"DC\",\r\n \"Florida\": \"FL\",\r\n \"Georgia\": \"GA\",\r\n \"Hawaii\": \"HI\",\r\n \"Idaho\": \"ID\",\r\n \"Illinois\": \"IL\",\r\n \"Indiana\": \"IN\",\r\n \"Iowa\": \"IA\",\r\n \"Kansas\": \"KS\",\r\n \"Kentucky\": \"KY\",\r\n \"Louisiana\": \"LA\",\r\n \"Maine\": \"ME\",\r\n \"Maryland\": \"MD\",\r\n \"Massachusetts\": \"MA\",\r\n \"Michigan\": \"MI\",\r\n \"Minnesota\": \"MN\",\r\n \"Mississippi\": \"MS\",\r\n \"Missouri\": \"MO\",\r\n \"Montana\": \"MT\",\r\n \"Nebraska\": \"NE\",\r\n \"Nevada\": \"NV\",\r\n \"New Hampshire\": \"NH\",\r\n \"New Jersey\": \"NJ\",\r\n \"New Mexico\": \"NM\",\r\n \"New York\": \"NY\",\r\n \"North Carolina\": \"NC\",\r\n \"North Dakota\": \"ND\",\r\n \"Ohio\": \"OH\",\r\n \"Oklahoma\": \"OK\",\r\n \"Oregon\": \"OR\",\r\n \"Pennsylvania\": \"PA\",\r\n \"Puerto Rico\": \"PR\",\r\n \"Rhode Island\": \"RI\",\r\n \"South Carolina\": \"SC\",\r\n \"South Dakota\": \"SD\",\r\n \"Tennessee\": \"TN\",\r\n \"Texas\": \"TX\",\r\n \"Utah\": \"UT\",\r\n \"Vermont\": \"VT\",\r\n \"Virginia\": \"VA\",\r\n \"Washington\": \"WA\",\r\n \"West Virginia\": \"WV\",\r\n \"Wisconsin\": \"WI\",\r\n \"Wyoming\": \"WY\"\r\n }\r\n if (name in stateMap) {\r\n return stateMap[name];\r\n } \r\n return \"State not found\";\r\n}", "title": "" }, { "docid": "dd0592804594d30a79963e85c26f733e", "score": "0.5437671", "text": "function displayAbbr(){\n\tvar boy = document.getElementsByTagName(\"body\")[0];\n\tvar h1C = document.createElement(\"h1\");\n\th1C.innerHTML = \"缩列词\";\n\tboy.appendChild(h1C);\n\n\tvar abbrG = document.getElementsByTagName(\"abbr\");\n\tvar dlC = document.createElement(\"dl\");\n\tboy.appendChild(dlC);\n\n\tfor (var i = 0; i < abbrG.length; i++) {\n\t\tvar dtC = document.createElement(\"dt\");\n\t\tvar ddC = document.createElement(\"dd\");\n\t\tdlC.appendChild(dtC);\n\t\tdlC.appendChild(ddC);\n\t\tdtC.innerHTML = abbrG[i].innerHTML;\n\t\tddC.innerHTML = abbrG[i].title;\n\t}\t\n}", "title": "" }, { "docid": "37ca3437aaf848815f8522a9e19b9da0", "score": "0.54288614", "text": "function renderAbbr(abbrGroup, newXScale, chosenXaxis, newYScale, chosenYaxis) {\n\n abbrGroup.transition()\n .duration(1000)\n .attr(\"dx\", d => newXScale(d[chosenXAxis])-5)\n .attr(\"dy\", d => newYScale(d[chosenYAxis])+5);\n\n return abbrGroup;\n}", "title": "" }, { "docid": "a59ae66a437ef07dcaf1930d44d52245", "score": "0.5428187", "text": "setAfterName(listing) {\n let afterName = 't3_' + listing.data.id;\n if (this.state.position > -1) {\n let subreddits = this.state.subreddits.slice();\n subreddits[this.state.position].anchor = afterName;\n this.setState({ subreddits });\n } else {\n this.setState({ frontAnchor: afterName });\n }\n }", "title": "" }, { "docid": "d7200251b4c6b45df9c9f14ffc18b736", "score": "0.5411692", "text": "function goto_state(st)\n{\n\tvar states = {'AK':'Alaska', 'AL':'Alabama', 'AR':'Arkansas', 'AZ':'Arizona', 'CA':'California', 'CO':'Colorado', 'CT':'Connecticut', 'DE':'Delaware', 'DC':'District of Columbia', 'FL':'Florida', 'GA':'Georgia', 'HI':'Hawaii', 'IA':'Iowa', 'ID':'Idaho', 'IL':'Illinois', 'IN':'Indiana', 'KS':'Kansas', 'KY':'Kentucky', 'LA':'Louisiana', 'MA':'Massachusetts', 'MD':'Maryland', 'ME':'Maine', 'MI':'Michigan', 'MN':'Minnesota', 'MS':'Mississippi', 'MO':'Missouri', 'MT':'Montana', 'NC':'North Carolina', 'ND':'North Dakota', 'NE':'Nebraska', 'NH':'New Hampshire', 'NJ':'New Jersey', 'NM':'New Mexico', 'NV':'Nevada', 'NY':'New York', 'OH':'Ohio', 'OK':'Oklahoma', 'OR':'Oregon', 'PA':'Pennsylvania', 'RI':'Rhode Island', 'SC':'South Carolina', 'SD':'South Dakota', 'TN':'Tennessee', 'TX':'Texas', 'UT':'Utah', 'VA':'Virginia', 'VT':'Vermont', 'WA':'Washington', 'WI':'Wisconsin', 'WV':'West Virginia', 'WY':'Wyoming'};\n\t\n\tISCJS.cl(\"Running goto_state:\"+st+\":\"+st.length);\n\t var state = st;\n\tif(st.length == 2) {\n\t\tstate = states[st.toUpperCase()];\t\n\t\tstate = state.replace(' ', '-');\n\t\tdocument.location = document.location.protocol+'//'+document.location.hostname+'/tag/'+state.toLowerCase()+'/';\n\t}\n}", "title": "" }, { "docid": "0e4a08b7b3e4e32b712f856b683f60a0", "score": "0.53878504", "text": "stateUpdate (state, target) {\n if (target.t === 'orga') {\n Vue.set(state, target.t, target.data[0]);\n } else {\n Vue.set(state, target.t, target.data);\n }\n }", "title": "" }, { "docid": "eafbaf95595b375eea08bbe0f0f5113c", "score": "0.5372505", "text": "function parseAbbr(str, parserInline, options, env) {\n var state, labelEnd, pos, max, label, title;\n\n if (str.charCodeAt(0) !== 0x2A/* * */) { return -1; }\n if (str.charCodeAt(1) !== 0x5B/* [ */) { return -1; }\n\n if (str.indexOf(']:') === -1) { return -1; }\n\n state = new StateInline(str, parserInline, options, env, []);\n labelEnd = parseLinkLabel(state, 1);\n\n if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return -1; }\n\n max = state.posMax;\n\n // abbr title is always one line, so looking for ending \"\\n\" here\n for (pos = labelEnd + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x0A) { break; }\n }\n\n label = str.slice(2, labelEnd);\n title = str.slice(labelEnd + 2, pos).trim();\n if (title.length === 0) { return -1; }\n if (!env.abbreviations) { env.abbreviations = {}; }\n // prepend ':' to avoid conflict with Object.prototype members\n if (typeof env.abbreviations[':' + label] === 'undefined') {\n env.abbreviations[':' + label] = title;\n }\n\n return pos;\n}", "title": "" }, { "docid": "b8db8a7a1d8b6bf8a324e8af4518f51e", "score": "0.53545654", "text": "update() {\n if (optionKeys.a && optionKeys.b && optionKeys.c) {\n this.transition(this.line1, `APPLE`);\n } else {\n this.transition(this.line0, `options`);\n }\n }", "title": "" }, { "docid": "c63238820a625982189be106bf34e049", "score": "0.53472173", "text": "function change_region(elem) {\n // Get the region name.\n current_region = $('a', elem).attr('region');\n // Highlight the chosen region.\n $('#region-dropdown li').removeClass('active');\n $(elem).addClass('active');\n // Change region name text displayed to the user.\n $(region_text).text(regions[current_region].name);\n // Go ahead and update the table.\n update_cost();\n}", "title": "" }, { "docid": "89c28a316a794529cd34b5b7a03c88f5", "score": "0.5318444", "text": "function edit(){\n transition(EDIT)\n }", "title": "" }, { "docid": "b16b6b742032c8e95c1fbdd3e48b88b5", "score": "0.5298801", "text": "function OnTitleStateUpdate(self, state)\n {\n set_title_value(self, state);\n }", "title": "" }, { "docid": "5a007ec493a6ccc06131f6f73a0753c4", "score": "0.5288952", "text": "UPDATE_GOAL_NAME (state, name) {\n state.name = name;\n }", "title": "" }, { "docid": "ccf3e75fa5846f0b259d56d50f3f27e3", "score": "0.52889216", "text": "function hc_namednodemapsetnameditemwithnewvalue() {\n var success;\n if(checkInitialization(builder, \"hc_namednodemapsetnameditemwithnewvalue\") != null) return;\n var doc;\n var elementList;\n var newAttribute;\n var testAddress;\n var attributes;\n var newNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n testAddress = elementList.item(2);\n newAttribute = doc.createAttribute(\"lang\");\n attributes = testAddress.attributes;\n\n newNode = attributes.setNamedItem(newAttribute);\n assertNull(\"prevValueNull\",newNode);\n \n}", "title": "" }, { "docid": "37546c60a51563f416f2a701e9813002", "score": "0.5283492", "text": "function advance_state() {\n if (cur_state + 1 < all_states.length) {\n cur_state += 1;\n draw_towers(all_states[cur_state]);\n }\n}", "title": "" }, { "docid": "5bbb117a3f02a0df475ee5639281b3b5", "score": "0.52799684", "text": "function renderAbbr(abbrGroup, xLinearScale, chosenXAxis) {\n abbrGroup.transition()\n .duration(1000)\n .attr(\"dx\", d => xLinearScale(d[chosenXAxis]))\n .text(d => d.abbr)\n return abbrGroup\n}", "title": "" }, { "docid": "d7843b0584c71c025d7e3bcb18293641", "score": "0.52653307", "text": "function editAppointment(){\n transition(EDIT);\n }", "title": "" }, { "docid": "4ee544fd4c1520cfef158c30480ce84a", "score": "0.52552825", "text": "function updateMatches()\n {\n stateInput.style.backgroundColor = \"#fff\";\n var str = stateInput.value.toLowerCase();\n\n curMatches = [ ];\n curPositions = [ ]; // parallel array for underlining\n for (var i = 0; i < allStates.length; i++)\n {\n var pos = allStates[i].toLowerCase().indexOf(str);\n if ( pos >= 0 )\n {\n curMatches[curMatches.length] = i;\n curPositions[curPositions.length] = pos;\n }\n }\n if (curMatches.length > 0)\n {\n firstPrompt = 0;\n lastPrompt = (curMatches.length > MAX_PROMPTS) ? (MAX_PROMPTS - 1) : (curMatches.length - 1);\n }\n else\n {\n firstPrompt = lastPrompt = -1;\n }\n highlightIndex = -1;\n }", "title": "" }, { "docid": "1163b407ab609549251296031335f7e4", "score": "0.52467644", "text": "#updateAria() {\n // For ellipsis based tooltips we dont do this\n if (this.state.noAria) {\n return;\n }\n this.popup.alignTarget = typeof this.target === 'object'\n ? this.target\n : document.querySelectorAll(this.target)[0];\n\n const id = `${this.id || 'ids'}-tooltip`;\n if (this.popup.alignTarget && this.popup.alignTarget.querySelector(`#${id}`)) {\n this.popup.alignTarget.querySelector(`#${id}`).textContent = this.textContent;\n return;\n }\n\n if (this.popup.alignTarget) {\n const ariaSpan = `<ids-text id=\"${id}\" audible=\"true\">${this.textContent}</ids-text>`;\n this.popup.alignTarget.insertAdjacentHTML('beforeend', ariaSpan);\n this.popup.alignTarget.setAttribute('aria-describedby', `#${id}`);\n }\n }", "title": "" }, { "docid": "09fda96d551aab3ece28b40c5d80c380", "score": "0.5245931", "text": "function set_state_identifier(id, state, altText) {\n var icons = {\n newSection: \"<i class='fa fa-asterisk background inverse info obj_tooltip' title='New Section'></i>\",\n completeSection: \"<i class='fa fa-check-circle background inverse success obj_tooltip' title='Section has been completed'></i>\",\n someQuestionsUnanswered: \"<i class='fa fa-plus-circle background inverse success obj_tooltip' title='Some questions unanswered'></i>\",\n mandatoryQuestionsUnanswered: \"<i class='fa fa-exclamation-triangle background inverse warning obj_tooltip' title='Some questions unanswered'></i>\",\n allQuestionsUnanswered: \"<i class='fa fa-times-circle background inverse info obj_tooltip' title='All questions unanswered'></i>\",\n findIcon: function(n){\n switch(n) {\n case 0:\n return this.allQuestionsUnanswered;\n break;\n case 1:\n return this.mandatoryQuestionsUnanswered;\n break;\n case 2:\n return this.someQuestionsUnanswered;\n break;\n case 3:\n return this.completeSection;\n break;\n case 4:\n return this.newSection;\n break;\n }\n }\n };\n $(\"#img\"+id).empty();\n // $(\"#img\"+id).append(\"<img class='obj_tooltip' src='\"+RAILS_ROOT+\"/assets/submissionstate/fidelitybyagapeh/\"+state+\".png' alt='\"+altText+\"' title='\"+altText+\"' width='20px' height='20px'/>\");\n $(\"#img\"+id).append(icons.findIcon(parseInt(state)));\n}", "title": "" }, { "docid": "e0301e563d7fee896692c952c8bd6094", "score": "0.5243904", "text": "function generate_states()\n {\n var MAX_PROMPTS = 8; // Max number of matches to show\n\n var stateInput = null; // The text box for selecting a state\n var statePrompt = null; // The dynamic suggestion overlay\n\n var thisKey = 0; // Key just released\n var lastKey = 0; // Previously release key\n var arrowPress = false; // Was last key event keypress for an arrow key?\n\n var curMatches = []; // Array of all states that match current type-in\n var curPositions = []; // Parallel array of match positions for underlining\n var firstPrompt = -1; // Index of first matched state to show, if any matches\n var lastPrompt = -1; // Index of last matched state to show, if any matches\n var highlightIndex = -1; // Index of selected state, if any, in curMatches\n var selectedStateIndex = -1; // Index of selected state, if any, in allStates[]\n\n var allStates = [ \"AL Alabama\", \"AK Alaska\", \"AS American Samoa\", \"AZ Arizona\", \"AR Arkansas\",\n \"CA California\", \"CO Colorado\", \"CT Connecticut\", \"DE Delaware\", \"DC District Of Columbia\",\n \"FM Federated States Of Micronesia\", \"FL Florida\", \"GA Georgia\", \"GU Guam\", \"HI Hawaii\", \"ID Idaho\",\n \"IL Illinois\", \"IN Indiana\", \"IA Iowa\", \"KS Kansas\", \"KY Kentucky\", \"LA Louisiana\", \"ME Maine\",\n \"MH Marshall Islands\", \"MD Maryland\", \"MA Massachusetts\", \"MI Michigan\", \"MN Minnesota\", \"MS Mississippi\",\n \"MO Missouri\", \"MT Montana\", \"NE Nebraska\", \"NV Nevada\", \"NH New Hampshire\", \"NJ New Jersey\",\n \"NM New Mexico\", \"NY New York\", \"NC North Carolina\", \"ND North Dakota\", \"MP Northern Mariana Islands\",\n \"OH Ohio\", \"OK Oklahoma\", \"OR Oregon\", \"PW Palau\", \"PA Pennsylvania\", \"PR Puerto Rico\", \"RI Rhode Island\",\n \"SC South Carolina\", \"SD South Dakota\", \"TN Tennessee\", \"TX Texas\", \"UT Utah\", \"VT Vermont\",\n \"VI Virgin Islands\", \"VA Virginia\", \"WA Washington\", \"WV West Virginia\", \"WI Wisconsin\", \"WY Wyoming\",\n \"AE Armed Forces Africa\", \"AA Armed Forces Americas (except Canada)\", \"AE Armed Forces Canada\",\n \"AE Armed Forces Europe\", \"AE Armed Forces Middle East\", \"AP Armed Forces Pacific\" ];\n\n\n // updateMatches()\n // ----------------------------------------------------------------------------\n /* Update the filtered list.\n */\n function updateMatches()\n {\n stateInput.style.backgroundColor = \"#fff\";\n var str = stateInput.value.toLowerCase();\n\n curMatches = [ ];\n curPositions = [ ]; // parallel array for underlining\n for (var i = 0; i < allStates.length; i++)\n {\n var pos = allStates[i].toLowerCase().indexOf(str);\n if ( pos >= 0 )\n {\n curMatches[curMatches.length] = i;\n curPositions[curPositions.length] = pos;\n }\n }\n if (curMatches.length > 0)\n {\n firstPrompt = 0;\n lastPrompt = (curMatches.length > MAX_PROMPTS) ? (MAX_PROMPTS - 1) : (curMatches.length - 1);\n }\n else\n {\n firstPrompt = lastPrompt = -1;\n }\n highlightIndex = -1;\n }\n\n // generateHTML()\n // ----------------------------------------------------------------------------\n /* Generate paragraphs for the currently displayed currently matched states.\n * Underline current match string, and highlight selected one if there is one.\n */\n function generateHTML()\n {\n// console.log(\"generateHTML: \"+firstPrompt+\", \"+lastPrompt+\" (\"+highlightIndex+\")\");\n\n var returnVal = \"\";\n selectedStateIndex = -1;\n\n if (curMatches.length === 0)\n {\n return \"<p>No Match</p>\";\n }\n\n var curPromptIndex = 0;\n for (var i = firstPrompt; i <= lastPrompt; i++)\n {\n var str = allStates[curMatches[i]];\n var pos = curPositions[i];\n var len = stateInput.value.length;\n var prefix = str.substr(0,pos);\n var match = str.substr(pos, len);\n var suffix = str.substr(pos + len);\n\n if (len > 0)\n {\n match = \"<span class='underline'>\" + match + \"</span>\";\n }\n\n if (curPromptIndex++ === highlightIndex)\n {\n returnVal += \"<p class='highlight'>\" + prefix + match + suffix + \"</p>\";\n selectedStateIndex = curMatches[i];\n }\n else\n {\n returnVal += \"<p>\" + prefix + match + suffix + \"</p>\";\n }\n }\n\n // No state highlighted, but only one matches: select it.\n if (curMatches.length === 1)\n {\n selectedStateIndex = curMatches[0];\n }\n return returnVal;\n }\n\n // showPrompt()\n // -------------------------------------------------------------------\n /* Generate filtered list and display the prompt\n */\n function showPrompt()\n {\n// console.log(\"showPrompt:\");\n statePrompt.innerHTML = generateHTML();\n statePrompt.style.display = \"block\";\n }\n\n // hidePrompt()\n // -------------------------------------------------------------------\n /* On Enter or blur, update text box contents and hide the prompt.\n */\n function hidePrompt()\n {\n// console.log(\"hidePrompt: \" + selectedStateIndex);\n if (selectedStateIndex >= 0)\n {\n stateInput.value = allStates[selectedStateIndex].substring(0, 2);\n stateInput.style.backgroundColor = \"#cfc\";\n }\n else\n {\n stateInput.value = \"\";\n stateInput.style.backgroundColor = \"#fcc\";\n }\n statePrompt.style.display = \"none\";\n highlightIndex = -1;\n }\n\n // blurHandler()\n // ----------------------------------------------------------------------------------\n function blurHandler(evt)\n {\n// console.log(\"blurHandler:\");\n hidePrompt();\n }\n\n // Keyboard Event Handlers\n // ==================================================================================\n /*\n * Goal: To respond to each keystroke and auto-repeat event exactly once.\n *\n * Arrow keys are the problem: Opera and Gecko give one keypress and one keyup\n * event for each down-up; IE gives one keyup for each down-up; Safari gives two\n * keypress and keyup events for each down-up.\n *\n * Safari uses keyCodes 63,232 and 63,233 for arrow keys; all others use 38 and 40.\n *\n * Need to filter out dupes on Safari, need to ignore keyup on all but IE.\n */\n\n // doDownArrow()\n // ----------------------------------------------------------------------------------\n /* Move down the match list.\n */\n function doDownArrow()\n {\n// console.log(\"doDownArrow: \" + arrowPress);\n if (curMatches.length === 0)\n {\n updateMatches();\n }\n\n if (highlightIndex < (curMatches.length - 1))\n {\n highlightIndex++;\n }\n if (highlightIndex > (MAX_PROMPTS - 1))\n {\n highlightIndex--;\n firstPrompt++;\n lastPrompt++;\n }\n showPrompt();\n return;\n }\n\n // doUpArrow()\n // ----------------------------------------------------------------------------------\n /* Move up the match list.\n */\n function doUpArrow()\n {\n // Up Arrow: move up the match list\n if (curMatches.length === 0)\n {\n updateMatches();\n }\n\n if (--highlightIndex < 0)\n {\n highlightIndex = 0;\n if( firstPrompt > 0)\n {\n firstPrompt--;\n lastPrompt--;\n }\n }\n showPrompt();\n return;\n }\n\n // keyupHandler()\n // ----------------------------------------------------------------------------------\n /* Handles keyup events: process Arrow, Enter, Esc, and Tab; update the list of\n * matches for all others.\n */\n function keyupHandler(evt)\n {\n evt = evt ? evt :document.event;\n// console.log(\"keyupHandler: \" + evt.keyCode + \"; arrowPress: \" + arrowPress + \"; highlightIndex:\" + highlightIndex);\n// alert(\"Keyup: \" + evt.keyCode);\n lastKey = thisKey;\n thisKey = evt.keyCode;\n\n if ( !arrowPress && (thisKey === 40) )\n {\n // Down arrow with no previous keypress (IE7)\n doDownArrow();\n return;\n }\n\n if ( !arrowPress && (thisKey === 38) )\n {\n // Up arrow keyup with no previous keypress (IE7)\n doUpArrow();\n return;\n }\n\n if (arrowPress &&\n ((thisKey === 40) || (thisKey === 38) || ((thisKey === 63233) || (thisKey === 63232))))\n {\n // Ignore keyup events for arrow keys if they were processed as keypress events.\n return;\n }\n if (thisKey === 13)\n {\n if (lastKey === 13)\n {\n // Ignore double-Enter\n return;\n }\n // Enter: Kill prompt, but use current selection, if there is one.\n if ((curMatches.length > 1) && (highlightIndex < 0))\n {\n selectedStateIndex = -1;\n }\n hidePrompt();\n return;\n }\n if (thisKey === 27)\n {\n // Escape: Kill prompt and disregard current selection, even if there is one.\n selectedStateIndex = -1;\n hidePrompt();\n return;\n }\n\n if (thisKey === 9)\n {\n // Tab key: blurHandler will handle handling it\n return;\n }\n // Not arrow, not return, not escape, not tab: updateMatches\n updateMatches();\n showPrompt();\n }\n\n // keypressHandler()\n // ----------------------------------------------------------------------------------\n /* Process keypress events for arrow keys.\n */\n function keypressHandler(evt)\n {\n evt = evt ? evt :document.event;\n// console.log(\"keypressHandler: \" + evt.keyCode);\n// alert(\"Keypress: \" + evt.keyCode);\n arrowPress = true;\n var keycode = evt.keyCode;\n if ((keycode === 40) || (keycode === 63233))\n {\n doDownArrow();\n return;\n }\n\n if ((keycode === 38) || (keycode === 63232))\n {\n doUpArrow();\n return;\n }\n arrowPress = false;\n keyupHandler(evt);\n }\n\n // setXY()\n // ---------------------------------------------------------------\n /* Position and size the prompt.\n */\n function setXY()\n {\n var x = stateInput.offsetLeft;\n var y = stateInput.offsetTop + stateInput.clientHeight;\n var obj = statePrompt;\n do\n {\n if (obj.scrollTop !== undefined)\n {\n y -= obj.scrollTop;\n }\n if (obj.scrollLeft !== undefined)\n {\n x -= obj.scrollLeft;\n }\n obj = obj.parentNode;\n } while (obj);\n statePrompt.style.left = x + \"px\";\n statePrompt.style.top = y + \"px\";\n statePrompt.style.width = stateInput.clientWidth + \"px\";\n }\n\n // Return an object with access by closure to all of the above\n // ==============================================================================\n return {\n\n // init()\n // ------------------------------------------------------------------------------\n /* Implement the Core.runnable interface ... as it were.\n */\n init: function ()\n {\n// console.log(\"init:\");\n stateInput = document.getElementById('state-input');\n statePrompt = document.getElementById('state-prompt');\n\n statePrompt.style.backgroundColor = \"#eee\";\n statePrompt.style.opacity = \"0.8\"; // do it here to avoid css hacks\n stateInput.value = \"\";\n firstPrompt = lastPrompt = -1;\n\n Core.addEventListener(stateInput, \"focus\", showPrompt);\n Core.addEventListener(stateInput, \"keypress\", keypressHandler);\n Core.addEventListener(stateInput, \"keyup\", keyupHandler);\n Core.addEventListener(stateInput, \"blur\", blurHandler);\n Core.addEventListener(document, \"size\", setXY);\n Core.addEventListener(document, \"scroll\", setXY);\n setXY();\n }\n\n };\n }", "title": "" }, { "docid": "1ef1f0655da0ecbaadcf4f52ec5acc78", "score": "0.5236233", "text": "function changeLA() {\n changeLocation(laLoc);\n}", "title": "" }, { "docid": "690c61fcca3f2dc157dcfc48bbd2338e", "score": "0.52336407", "text": "function setState(el) {\n\t// var stateObj = { section: el.target.hash };\n\t// history.pushState(stateObj, el.target.title, el.target.href);\n}", "title": "" }, { "docid": "0343c482f5aa8cede96908a4efa285c8", "score": "0.52293324", "text": "function resetHighlight(e) {\n county.resetStyle(e.target);\n $(\".update\").html(\"<b>Oregon</b><br>2.9% of the Population 5 Year and over speaking English less than well\");\n}", "title": "" }, { "docid": "825fe16a5ae11dde32412c6b39242097", "score": "0.5195999", "text": "function show_state_labs() {\n var state_id = $('#state_selector option:selected').val();\n var state_name = $('#state_selector option:selected').text();\n var none_text =\n \"<p>Sorry, we don't know of any child development labs in \" +\n state_name + \" yet!</p>\";\n\n\n var lab_list = {\n \"NA\": \"\",\n \"AL\": \"<p><a href='http://www.ches.ua.edu/hdfs/cdrc/'target='_blank'>University of Alabama Child Development Research Center</a></p><p><a href='http://monaelsheikh.com/'target='_blank'>Auburn University Child Sleep, Health, and Development Lab</a></p>\",\n \"AK\": \"<p><a href=''target='_blank'></a></p>\",\n \"AZ\": \"<p><a href='http://web.arizona.edu/~tigger/'target='_blank'>University of Arizona Child Cognition Lab (Tigger Lab)</a></p><p><a href='http://web.arizona.edu/~tweety/'target='_blank'>University of Arizona Language Development Lab (Tweety Lab)</a></p><p><a href='http://nau.edu/SBS/IHD/Research/CDLL/'target='_blank'>Northern Arizona University Child Development and Language Lab</a></p>\",\n \"AR\": \"<p><a href='http://acnc.uamsweb.com/research-2/our-laboratories-2/early-diets-and-long-term-health-lab/'target='_blank'>Arkansas Children's Nutrition Center Growth and Development Laboratory</a></p>\",\n \"CA\": \"<p><a href='http://www-psych.stanford.edu/~babylab/'target='_blank'>Stanfordís Center for Infant Studies</a></p><p><a href='http://www-cogsci.ucsd.edu/~deak/cdlab/'target='_blank'>UCSD Cognitive Development Lab</a></p><p><a href='http://babytalk.psych.ucla.edu/home.htm'target='_blank'>UCLA Language and Cognitive Development Lab</a></p><p><a href='http://psychology.berkeley.edu/participant-recruitment/rsvp-research-subject-volunteer-pool'target='_blank'>UC Berkeley Psychology Department (list of studies)</a></p><p><a href='http://babycenter.berkeley.edu/'target='_blank'>UC Berkeley Infant Studies Center</a></p><p><a href='http://bungelab.berkeley.edu/participate/'target='_blank'>UC Berkeley Building Blocks of Cognition Lab</a></p><p><a href='http://www.cogsci.uci.edu/cogdev/information.html'target='_blank'>UC Irvine Sarnecka Cognitive Development Lab</a></p><p><a href='https://labs.psych.ucsb.edu/german/tamsin/'target='_blank'>UCSB Cognition & Development Laboratory</a></p><p><a href='http://www.csus.edu/indiv/a/alexanderk/lab.htm'target='_blank'>CSU Sacramento Cognitive Development Lab</a></p><p><a href='http://mindbrain.ucdavis.edu/labs/Rivera/'target='_blank'>UC Davis Neurocognitive Development Lab</a></p><p><a href='http://dornsife.usc.edu/labs/mid-la/participate/'target='_blank'>USC Minds in Development Lab</a></p><p><a href='http://www.ccl.ucr.edu/'target='_blank'>UC Riverside Childhood Cognition Lab</a></p>\",\n \"CO\": \"<p><a href='http://sleep.colorado.edu/'target='_blank'>UC Boulder Sleep and Development Lab</a></p><p><a href='http://www.ucdenver.edu/academics/colleges/medicalschool/departments/psychiatry/Research/developmentalresearch/Pages/Overview.aspx'target='_blank'>University of Colorado Denver Developmental Psychiatry Research Group</a></p><p><a href='http://www.du.edu/psychology/child_health_and_development/'target='_blank'>University of Colorado Denver Child Health & Development Lab</a></p><p><a href='http://psych.colorado.edu/~cdc/whoweare.htm'target='_blank'>University of Colorado Denver Cognitive Development Center</a></p>\",\n \"CT\": \"<p><a href='http://cogdev.research.wesleyan.edu/'target='_blank'>Wesleyan University Cognitive Development Labs</a></p><p><a href='http://cogdevlab.sites.yale.edu/'target='_blank'>Yale Cognition and Development Lab</a></p><p><a href='http://www.yale.edu/infantlab/Welcome.html'target='_blank'>Yale Infant Cognition Center</a></p><p><a href='http://www.yale.edu/minddevlab/'target='_blank'>Yale Mind and Development Lab</a></p><p><a href='http://www.yale.edu/cnl/faculty.html'target='_blank'>Yale Child Neuroscience Lab</a></p>\",\n \"DE\": \"<p><a href='http://www.udel.edu/ILP/about/team.html'target='_blank'>University of Delaware Infant Language Project</a></p>\",\n \"FL\": \"<p><a href='http://casgroup.fiu.edu/dcn/pages.php?id=3636'target='_blank'>FIU Developmental Cognitive Neuroscience Lab</a></p><p><a href='http://online.sfsu.edu/devpsych/fair/index.html'target='_blank'>FSU Family Interaction Research Lab</a></p><p><a href='http://psy2.fau.edu/~lewkowicz/cdlfau/default.htm'target='_blank'>FAU Child Development Lab</a></p><p><a href='http://infantlab.fiu.edu/Infant_Lab.htm'target='_blank'>FIU Infant Development Lab</a></p>\",\n \"GA\": \"<p><a href='http://www.gcsu.edu/psychology/currentresearch.htm#Participate'target='_blank'>Georgia College Psychology Department</a></p>\",\n \"HI\": \"<p><a href='http://www.psychology.hawaii.edu/concentrations/developmental-psychology.html'target='_blank'>University of Hawaii Developmental Psychology</a></p>\",\n \"ID\": \"<p><a href=''target='_blank'></a></p>\",\n \"IL\": \"<p><a href='http://internal.psychology.illinois.edu/~acimpian/'target='_blank'>University of Illinois Cognitive Development Lab</a></p><p><a href='http://internal.psychology.illinois.edu/infantlab/'target='_blank'>University of Illinois Infant Cognition Lab</a></p><p><a href='http://bradfordpillow.weebly.com/cognitive-development-lab.html'target='_blank'>Northern Illinois University Cognitive Development Lab</a></p><p><a href='http://www.childdevelopment.northwestern.edu/'target='_blank'>Northwestern University's Project on Child Development</a></p><p><a href='http://woodwardlab.uchicago.edu/Home.html'target='_blank'>University of Chicago Infant Learning and Development Lab</a></p>\",\n \"IN\": \"<p><a href='http://www.iub.edu/~cogdev/'target='_blank'>Indiana University Cognitive Development Lab</a></p><p><a href='http://www.psych.iupui.edu/Users/kjohnson/cogdevlab/INDEX.HTM'target='_blank'>IUPUI Cognitive Development Lab</a></p><p><a href='http://www.evansville.edu/majors/cognitivescience/language.cfm'target='_blank'>University of Evansville Language and Cognitive Development Laboratory</a></p>\",\n \"IA\": \"<p><a href='http://www.medicine.uiowa.edu/psychiatry/cognitivebraindevelopmentlaboratory/'target='_blank'>University of Iowa Cognitive Brain Development Laboratory</a></p>\",\n \"KS\": \"<p><a href='http://www2.ku.edu/~lsi/labs/neurocognitive_lab/staff.shtml'target='_blank'>KU Neurocognitive Development of Autism Research Laboratory</a></p><p><a href='http://healthprofessions.kumc.edu/school/research/carlson/index.html'target='_blank'>KU Maternal and Child Nutrition and Development Laboratory</a></p><p><a href='http://greenhoot.wordpress.com/meet-the-research-team/'target='_blank'>KU Memory and Development Lab</a></p>\",\n \"MN\": \"<p><a href='http://www.cehd.umn.edu/icd/research/seralab/'target='_blank'>University of Minnesota Language and Cognitive Development Lab</a></p><p><a href='http://www.cehd.umn.edu/icd/research/cdnlab/'target='_blank'>University of Minnesota Cognitive Development & Neuroimaging Lab</a></p><p><a href='http://www.cehd.umn.edu/icd/research/carlson/'target='_blank'>University of Minnesota Carlson Child Development Lab</a></p>\",\n \"KY\": \"<p><a href='http://www.wku.edu/psychological-sciences/labs/cognitive_development/index.php'target='_blank'>Western Kentucky University Cognitive Development Lab</a></p>\",\n \"LA\": \"<p><a href=''target='_blank'></a></p>\",\n \"ME\": \"<p><a href='http://people.usm.maine.edu/bthompso/Site/Development%20Lab.html'target='_blank'>USM Human Development Lab</a></p><p><a href='http://www.colby.edu/psychology/labs/cogdev1/LabAlumni.html'target='_blank'>Colby Cognitive Development Lab</a></p>\",\n \"MD\": \"<p><a href='http://education.umd.edu/HDQM/labs/Fox/'target='_blank'>University of Maryland Child Development Lab</a></p><p><a href='http://ncdl.umd.edu/'target='_blank'>University of Maryland Neurocognitive Development Lab</a></p>\",\n \"MA\": \"<p><a href='http://eccl.mit.edu/'target='_blank'>MIT Early Childhood Cognition Lab</a></p><p><a href='http://gablab.mit.edu/'target='_blank'>MIT Gabrieli Lab</a></p><p><a href='http://saxelab.mit.edu/people.php'target='_blank'>MIT Saxelab Social Cognitive Neuroscience Lab</a></p><p><a href='https://software.rc.fas.harvard.edu/lds/'target='_blank'>Harvard Laboratory for Developmental Sciences</a></p><p><a href='http://www.bu.edu/cdl/'target='_blank'>Boston University Child Development Labs</a></p><p><a href='babies.umb.edu'target='_blank'>UMass Boston Baby Lab</a></p><p><a href='http://people.umass.edu/lscott/lab.htm'target='_blank'>UMass Amherst Brain, Cognition, and Development Lab</a></p><p><a href='http://www.northeastern.edu/berentlab/research/infant/'target='_blank'>Northeastern Infant Phonology Lab</a></p>\",\n \"MI\": \"<p><a href='http://www.educ.msu.edu/content/default.asp?contentID=903'target='_blank'>MSU Cognitive Development Lab</a></p><p><a href='http://ofenlab.wayne.edu/people.php'target='_blank'>Wayne State University Cognitive Brain Development Lab</a></p>\",\n \"MS\": \"<p><a href=''target='_blank'></a></p>\",\n \"MO\": \"<p><a href='http://www.artsci.wustl.edu/~children/'target='_blank'>Washington University Cognition and Development Lab</a></p><p><a href='http://mumathstudy.missouri.edu/#content'target='_blank'>University of Missouri-Columbia Math Study</a></p>\",\n \"MT\": \"<p><a href='http://www.montana.edu/wwwpy/brooker/html/meet.html'target='_blank'>Montana State University DOME Lab</a></p>\",\n \"NE\": \"<p><a href='http://www.boystownhospital.org/research/clinicalbehavioralstudies/Pages/LanguageDevelopmentLaboratory.aspx'target='_blank'>Boys Town National Research Hospital Language Development Laboratory</a></p><p><a href='http://research.unl.edu/dcn/'target='_blank'>University of Nebraska-Lincoln Developmental Cognitive Neuroscience Laboratory</a></p>\",\n \"NV\": \"<p><a href='http://www.unl.edu/dbrainlab/'target='_blank'>University of Nebraska-Lincoln Developmental Brain Lab</a></p>\",\n \"NH\": \"<p><a href='http://cola.unh.edu/news/frl'target='_blank'>University of New Hampshire Family Research Lab</a></p>\",\n \"NJ\": \"<p><a href='http://www.shu.edu/academics/gradmeded/ms-speech-language-pathology/dlc-lab.cfm'target='_blank'>Seton Hall University Developmental Language and Cognition Laboratory</a></p><p><a href='http://www.ramapo.edu/sshs/childlab/'target='_blank'>Ramapo College Child Development Lab</a></p><p><a href='http://ruccs.rutgers.edu/~aleslie/'target='_blank'>Rutgers University Cognitive Development Lab</a></p><p><a href='http://babylab.rutgers.edu/HOME.html'target='_blank'>Rutgers University Infancy Studies Lab</a></p><p><a href='http://ruccs.rutgers.edu/languagestudies/people.html'target='_blank'>Rutgers University Lab for Developmental Language Studies</a></p>\",\n \"NM\": \"<p><a href=''target='_blank'></a></p>\",\n \"NY\": \"<p><a href='http://www.columbia.edu/cu/needlab/'target='_blank'>Columbia Neurocognition, Early Experience, and Development (NEED) Lab</a></p><p><a href='https://www.facebook.com/pages/Child-Development-Lab-the-City-University-of-New-York/42978619994'target='_blank'>CUNY Child Development Lab</a></p>\",\n \"NC\": \"<p><a href='http://people.uncw.edu/nguyens/'target='_blank'>UNCW Cognitive Development Lab</a></p>\",\n \"ND\": \"<p><a href='http://www.cvcn.psych.ndsu.nodak.edu/labs/woods/'target='_blank'>NDSU Infant Cognitive Development Lab</a></p>\",\n \"OH\": \"<p><a href='http://cogdev.cog.ohio-state.edu/'target='_blank'>OSU Cognitive Development Lab</a></p><p><a href='http://www.ohio.edu/chsp/rcs/csd/research/dplab.cfm'target='_blank'>Ohio University Developmental Psycholinguistics Lab</a></p>\",\n \"OK\": \"<p><a href=''target='_blank'></a></p>\",\n \"OR\": \"<p><a href='http://bdl.uoregon.edu/Participants/participants.php'target='_blank'>University of Oregon Brain Development Lab</a></p><p><a href='http://www.uolearninglab.com'target='_blank'>University of Oregon Learning Lab</a></p>\",\n \"PA\": \"<p><a href='http://www.temple.edu/infantlab/'target='_blank'>Temple Infant & Child Lab</a></p><p><a href='http://lncd.pitt.edu/wp/'target='_blank'>University of Pittsburgh Laboratory of Neurocognitive Development</a></p><p><a href='https://sites.sas.upenn.edu/cogdevlab/'target='_blank'>UPenn Cognition & Development Lab</a></p><p><a href='http://babylab.psych.psu.edu/'target='_blank'>Penn State Brain Development Lab</a></p>\",\n \"RI\": \"<p><a href='http://www.brown.edu/Research/dcnl/'target='_blank'>Brown University Developmental Cognitive Neuroscience Lab</a></p>\",\n \"SC\": \"<p><a href='http://academicdepartments.musc.edu/joseph_lab/'target='_blank'>MUSC Brain, Cognition, & Development Lab</a></p>\",\n \"SD\": \"<p><a href=''target='_blank'></a></p>\",\n \"TN\": \"<p><a href='http://web.utk.edu/~infntlab/'target='_blank'>UT Knoxville Infant Perception-Action Lab</a></p><p><a href='http://peabody.vanderbilt.edu/departments/psych/research/research_labs/educational_cognitive_neuroscience_lab/index.php'target='_blank'>Vanderbilt Educational Cognitive Neuroscience Lab</a></p>\",\n \"TX\": \"<p><a href='http://www.ccdlab.net/'target='_blank'>UT-Austin Culture, Cognition, & Development Lab</a></p><p><a href='http://homepage.psy.utexas.edu/HomePage/Group/EcholsLAB/'target='_blank'>UT-Austin Language Development Lab</a></p><p><a href='http://www.utexas.edu/cola/depts/psychology/areas-of-study/developmental/Labs--Affiliations/CRL.php'target='_blank'>UT-Austin Children's Research Lab</a></p><p><a href='http://www.uh.edu/class/psychology/dev-psych/research/cognitive-development/index.php'target='_blank'>University of Houston Cognitive Development Lab</a></p>\",\n \"UT\": \"<p><a href=''target='_blank'></a></p>\",\n \"VT\": \"<p><a href='http://www.uvm.edu/psychology/?Page=developmental_labs.html&SM=researchsubmenu.html'target='_blank'>University of Vermont Developmental Laboratories (overview)</a></p>\",\n \"VA\": \"<p><a href='http://people.jmu.edu/vargakx/'target='_blank'>James Madison University Cognitive Development Lab</a></p><p><a href='http://www.psyc.vt.edu/labs/socialdev'target='_blank'>Virginia Tech Social Development Lab</a></p><p><a href='http://faculty.virginia.edu/childlearninglab/'target='_blank'>University of Virginia Child Language and Learning Lab</a></p><p><a href='http://denhamlab.gmu.edu/labmembers.html'target='_blank'>George Mason University Child Development Lab</a></p>\",\n \"WA\": \"<p><a href='http://depts.washington.edu/eccl/'target='_blank'>University of Washington Early Childhood Cognition</a></p><p><a href='https://depts.washington.edu/uwkids/'target='_blank'>University of Washington Social Cognitive Development Lab</a></p><p><a href='http://ilabs.uw.edu/institute-faculty/bio/i-labs-andrew-n-meltzoff-phd'target='_blank'>University of Washington Infant and Child Studies Lab</a></p>\",\n \"WV\": \"<p><a href='http://www.wvuadolescentlab.com/'target='_blank'>WVU Adolescent Development Lab</a></p>\",\n \"WI\": \"<p><a href='https://sites.google.com/site/haleyvlach/'target='_blank'>University of Wisconsin Learning, Cognition, & Development Lab</a></p>\",\n \"WY\": \"<p><a href=''target='_blank'></a></p>\"\n };\n\n if (state_name === '[Select a state...]') {\n state_name = \"\";\n }\n\n $('#labs_in_state').html(lab_list[state_id]);\n $('#state_name').text(state_name);\n\n if ($('#labs_in_state a')[0].text.length == 0) {\n $('#labs_in_state').html(none_text);\n }\n\n }", "title": "" }, { "docid": "aa2bce99fc53447228e3c46251b7d8bf", "score": "0.5187064", "text": "function bkabbr_vref(bk,ch,vn)\n{\n return BkAbbr[bk]+(BkNumChs[bk]==1?'':ch+':')+vn\n}", "title": "" }, { "docid": "d13df409e42a57b84963896e61c31d7e", "score": "0.51838195", "text": "function updateURLState() {\n var menuState = layerMenu.getMenuState(),\n fullState = {};\n\n menuState = menuState.map(function(layer) {\n\n delete layer.element;\n\n layer.uri = layer.uri.replace(/%22/g,\"'\");\n\n return layer;\n\n });\n\n fullState[\"m\"] = menuState; //Data layers\n fullState[\"d\"] = layerMenu.getDropdownState(); //Raster layers\n fullState[\"r\"] = document.querySelector(\"#hexagon-radius\").value; //Radius slider\n\n that.statefulQueryString.set(\"state\", encodeURIComponent(LZString.compressToBase64(JSON.stringify(fullState))));\n }", "title": "" }, { "docid": "f0af317f1ffaaa900bc7a3180599c16c", "score": "0.5183063", "text": "function anichange() {\r\n\t\tdocument.getElementById(\"mytextarea\").innerHTML = ANIMATIONS[document.getElementById(\"animation\").value];\r\n\t}", "title": "" }, { "docid": "2c18c06c748ca92091c1e9d107ad0ff6", "score": "0.5173764", "text": "function renderLocation() {\n const stateDropDown = document.querySelector( '#location' );\n const selectedDropDown = stateDropDown.options[stateDropDown.selectedIndex];\n const state = selectedDropDown.textContent;\n const locations = document.querySelectorAll( '.location' );\n // forEach could be used here, but it's not supported in IE11.\n for ( let i = 0, len = locations.length; i < len; i++ ) {\n locations[i].innerText = state;\n }\n }", "title": "" }, { "docid": "39ed38ec3eef9179d735795a81e089f8", "score": "0.5170439", "text": "function alias(orig, alt){\n\t\t$(\".poem\").hover(\n\t\t\tfunction(){\n\t\t\t\t//checks if the html of the page matches the input of the function\n\t\t\t\tif($(this).text()===orig){$(this).text(alt);/*changes the text*/};\n\t\t\t},\n\t\t\tfunction(){\n\t\t\t\tif($(this).text()===alt){$(this).text(orig);/*restores the text*/};\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "1eb955f10f3b79f0828df281ec68678b", "score": "0.5164314", "text": "function findStateAbbrev(state) {\n var i, index = -1;\n for (i = 0; i < stateList.length; i++) {\n if (state.toLowerCase() == stateList[i].state.toLowerCase()) {\n return stateList[i].abbrev;\n }\n }\n return \"\";\n}", "title": "" }, { "docid": "b75485004d16433336cb080fae1e1dc4", "score": "0.516056", "text": "function renderStateText(stateTextGroup, newXScale, chosenXAxis, newYScale, chosenYAxis){\n stateTextGroup.transition()\n .duration(1000)\n .attr(\"x\", d => newXScale(d[chosenXAxis]))\n .attr(\"y\", d => newYScale(d[chosenYAxis]) + 5);\n return stateTextGroup;\n}", "title": "" }, { "docid": "dfb6122f410eddba8ccd801ac7e8367e", "score": "0.5153781", "text": "function letterChanges(str) {}", "title": "" }, { "docid": "2f003c78a011233b5dd6753d54aea2b6", "score": "0.5152373", "text": "function setLocationWithUrl(id, name, url) {\n\n $(\"#locationText\").text(name);\n $.cookie('sk_locationid', id);\n $.cookie('sk_locationName', name);\n document.title = \"Showhear - Concerts in \" + name;\n\n name = name.replace(/\\//g,\"\");\n name = name.replace(/ /g,\"-\");\n name = name.replace(/--/g,\"-\");\n\n\n var urlString = \"/area/\" + id +\"-\"+ name;\n // console.log(\"name: \" + name + \" url: \" + urlString);\n\n window.history.pushState(\"teststate\", \"Showhear - Concerts in \" + name, url);\n}", "title": "" }, { "docid": "2138280a904834bf99ef370da3cce41c", "score": "0.51508504", "text": "function setupNamelist() {\n state.names_setup = true;\n state.names = [\"Aby\", \"Aage\", \"Aakesh\", \"Aanon\", \"Aarlen\", \"Aaron\", \"Aart\", \"Aasta\", \"Abarden\", \"Abbathor\", \"Abbathorn\", \"Abraham\", \"Abryn\",\n \"Abu\", \"Acadia\", \"Achard\", \"Acheron\", \"Achim\", \"Achlarg\", \"Ada\", \"Adair\", \"Adalbert\", \"Adanac\", \"Adario\", \"Adeisteen\", \"Adelaide\",\n \"Adelin\", \"Adelot\", \"Adeen\", \"Aden\", \"Adena\", \"Aderyn\", \"Adeva\", \"Adger\", \"Adia\", \"Adin\", \"Adina\", \"Aditu\", \"Adlay\",\n \"Adolf\", \"Adolmus\", \"Adoniram\", \"Adraeran\", \"Adriaan\", \"Adriel\", \"Adrienne\", \"Aedha\", \"Aeiran\", \"Ael\", \"Aelgifu\", \"Aelis\", \"Aerdrie\",\n \"Aeriel\", \"Aerin\", \"Aeris\", \"Aeriss\", \"Aeron\", \"Aeru'in\", \"Aeruin\", \"Aethelweard\", \"Aethon\", \"Aethyr\", \"Afra\", \"Agate\", \"Agatha\",\n \"Agathon\", \"Agathos\", \"Agenor\", \"Agidius\", \"Agnar\", \"Agora\", \"Agrias\", \"Aguidran\", \"Aguilla\", \"Ahanna\", \"Ahmre\", \"Aicha\", \"Aidan\",\n \"Aidaron\", \"Aiden\", \"Aidred\", \"Aidro\", \"Aidwin\", \"Aifreda\", \"Aifrida\", \"Aiker\", \"Aikikia\", \"Aikman\", \"Ailcaer\", \"Aileen\", \"Ailric\",\n \"Ailvar\", \"Aimee\", \"Aimo\", \"Aino\", \"Ainu\", \"Aipheus\", \"Airalyn\", \"Aircristir\", \"Airen\", \"Airis\", \"Airmid\", \"Aisha\", \"Aislinn\",\n \"Aithne\", \"Aitken\", \"Akebia\", \"Aki\", \"Akira\", \"Aksel\", \"Al\", \"Aladan\", \"Aladar\", \"Aladdin\", \"Alain\", \"Alaine\", \"Alais\",\n \"Alan\", \"Alana\", \"Alanson\", \"Alardan\", \"Alaric\", \"Alarion\", \"Alaris\", \"Alaron\", \"Alastair\", \"Alastrina\", \"Alastyr\", \"Albaral\", \"Alberich\",\n \"Alberik\", \"Alberon\", \"Albert\", \"Alberta\", \"Albin\", \"Albion\", \"Albrecht\", \"Albright\", \"Alcan\", \"Alcina\", \"Alda\", \"Aldaren\", \"Aldegond\",\n \"Alden\", \"Aldert\", \"Aldhelm\", \"Aldis\", \"Aldrich\", \"Aldridge\", \"Aldus\", \"Aldwerth\", \"Aldwin\", \"Aldwulf\", \"Alea\", \"Alec\", \"Alena\",\n \"Alers\", \"Ales\", \"Alessandra\", \"Alexander\", \"Alexei\", \"Alf\", \"Alfdis\", \"Alfgeir\", \"Alfhid\", \"Alfons\", \"Alford\", \"Alfred\", \"Algernon\",\n \"Algus\", \"Alhana\", \"Ali\", \"Alia\", \"Alicia\", \"Aliendre\", \"Alienor\", \"Alin\", \"Aline\", \"Alineric\", \"Alisbone\", \"Alison\", \"Alistair\",\n \"Alister\", \"Allaire\", \"Allard\", \"Allart\", \"Allene\", \"Alliston\", \"Almas\", \"Almer\", \"Almira\", \"Almroth\", \"Almu\", \"Aloise\", \"Alor\",\n \"Alora\", \"Alorosaz\", \"Aloysius\", \"Alphons\", \"Alrik\", \"Alsop\", \"Althalus\", \"Altin\", \"Alton\", \"Alured\", \"Alvan\", \"Alvey\", \"Alvina\",\n \"Alvord\", \"Alvred\", \"Alwen\", \"Alwyn\", \"Alya\", \"Alyanna\", \"Alyce\", \"Alyssa\", \"Alyvia\", \"Ama\", \"Amadis\", \"Amain\", \"Amalina\",\n \"Aman\", \"Amanfea\", \"Amar\", \"Amarah\", \"Amber\", \"Ambros\", \"Amelia\", \"Ames\", \"Amethyst\", \"Amilion\", \"Amin\", \"Amina\", \"Amineh\",\n \"Ammdar\", \"Amschel\", \"Amundi\", \"Anandra\", \"Anastasia\", \"Anatol\", \"Anatolia\", \"Ancarion\", \"Ancelyn\", \"Anclaiar\", \"Ancla´ar\", \"Andara'an\", \"Andaraan\",\n \"Andemon\", \"Andni\", \"Andolan\", \"Andre\", \"Andrei\", \"Andrew\", \"Andrus\", \"Aneurin\", \"Anfar\", \"Angelica\", \"Angelina\", \"Angharad\", \"Angheryn\",\n \"Angmar\", \"Angus\", \"Anici\", \"Anigh\", \"Anika\", \"Anita\", \"Anitra\", \"Anlaf\", \"Anna\", \"Annion\", \"Annora\", \"Anouar\", \"Anseim\",\n \"Ansel\", \"Anskar\", \"Anson\", \"Antal\", \"Antalya´ar\", \"Antares\", \"Antheirne\", \"Anton\", \"Antone\", \"Antony\", \"Antrim\", \"Anvar\", \"Anya\",\n \"Anzie\", \"Apad\", \"April\", \"Apthorp\", \"Aquill\", \"Arabel\", \"Arabella\", \"Arabeth\", \"Aradan\", \"Aradh\", \"Aragon\", \"Aragorn\", \"Arakin\",\n \"Aralik\", \"Aranel\", \"Arania\", \"Arathorn\", \"Aravis\", \"Arawn\", \"Arax\", \"Araz\", \"Archibald\", \"Arcarune\", \"Arctor\", \"Ardal\", \"Arden\",\n \"Arder\", \"Ardesh\", \"Ardis\", \"Areagne\", \"Arell\", \"Areta\", \"Aretas\", \"Argethlam\", \"Argoeth\", \"Ari\", \"Aria\", \"Ariad\", \"Arian\",\n \"Arianth\", \"Aribeth\", \"Aric\", \"Arid\", \"Ariel\", \"Aries\", \"Arilyn\", \"Arioch\", \"Arka\", \"Arkadia\", \"Arkron\", \"Arkwright\", \"Arlaith\",\n \"Arlan\", \"Arlana\", \"Arlean\", \"Arleano\", \"Arlo\", \"Arlya\", \"Armand\", \"Armar\", \"Armin\", \"Armitage\", \"Armo\", \"Armod\", \"Arn\",\n \"Arnbella\", \"Arnesen\", \"Arnfinn\", \"Arngrim\", \"Arni\", \"Arnlaug\", \"Arno\", \"Arnold\", \"Arnor\", \"Arnora\", \"Arnot\", \"Arnthora\", \"Arnuif\",\n \"Arnulf\", \"Arnvid\", \"Aron\", \"Arrah\", \"Arronax\", \"Arshavir\", \"Arshel\", \"Artemis\", \"Artemus\", \"Arthol\", \"Arthryn\", \"Arthur\", \"Artnistead\",\n \"Artreyu\", \"Artur\", \"Arun\", \"Arvid\", \"Arvida\", \"Arving\", \"Arvo\", \"Arwen\", \"Arwin\", \"Aryen\", \"Aryion\", \"Aryon\", \"Aryus\",\n \"Arzamark\", \"Asa\", \"Asaf\", \"Aschar\", \"Asfrid\", \"Asgard\", \"Asger\", \"Asgerd\", \"Asgrim\", \"Ash\", \"Ashan\", \"Ashane\", \"Ashburton\",\n \"Ashcar\", \"Ashdown\", \"Ashgaroth\", \"Ashley\", \"Ashlyn\", \"Ashne'e\", \"Ashnici\", \"Ashur\", \"Asiria\", \"Askew\", \"Askold\", \"Aslak\", \"Aslan\",\n \"Asleif\", \"Aslior\", \"Asperon\", \"Asta\", \"Astar\", \"Astinus\", \"Astnid\", \"Astnild\", \"Astoiphe\", \"Astra\", \"Astraea\", \"Astran\", \"Astrid\",\n \"Astrin\", \"Atazra\", \"Athabasca\", \"Athana\", \"Athol\", \"Atiaran\", \"Atli\", \"Atmeh\", \"Atreyu\", \"Atropos\", \"Atticus\", \"Attor\", \"Atul\",\n \"Aturin\", \"Atyre\", \"Aubrey\", \"Aud\", \"Audrey\", \"Audrianna\", \"Audric\", \"August\", \"Augustus\", \"Aule\", \"Aulius\", \"Aun\", \"Aura\",\n \"Aurian\", \"Auril\", \"Aurion\", \"Aurora\", \"Avall\", \"Avarath\", \"Avascaen\", \"Avedar\", \"Aveole\", \"Avery\", \"Avon\", \"Avril\", \"Axel\",\n \"Aya\", \"Ayame\", \"Ayaron\", \"Ayarèn\", \"Ayin\", \"Ayir\", \"Aylin\", \"Aylmer\", \"Ayrie\", \"Azeal\", \"Azeezeh\", \"Azgoth\", \"Azhrarn\",\n \"Aziz\", \"Azmodeus\", \"Azrean\", \"Azreck\", \"Azriaz\", \"Aztira\", \"Azure\", \"Azuth\", \"Baba\", \"Babacar\", \"Babrak\", \"Babrine\", \"Babylos\",\n \"Baduk\", \"Baern\", \"Baeron\", \"Baervan\", \"Bag\", \"Bahamut\", \"Baird\", \"Bal\", \"Balain\", \"Baldor\", \"Baldrick\", \"Balduin\", \"Baldur\",\n \"Baldwin\", \"Balendar\", \"Balfour\", \"Balin\", \"Baliol\", \"Ballard\", \"Balor\", \"Balthasard\", \"Balthazar\", \"Bandobras\", \"Bane\", \"Baraca\", \"Barahir\",\n \"Barak\", \"Baralan\", \"Baravar\", \"Barbara\", \"Bardach\", \"Bardel\", \"Bardi\", \"Bardsley\", \"Bardwell\", \"Barend\", \"Barent\", \"Baring\", \"Barll\",\n \"Barlo\", \"Barlow\", \"Barnabas\", \"Barnas\", \"Barnus\", \"Barr\", \"Barret\", \"Barron\", \"Barry\", \"Barstow\", \"Barthel\", \"Bartle\", \"Bartnel\",\n \"Barton\", \"Baslayan\", \"Bayard\", \"Beams\", \"Beatrix\", \"Bechir\", \"Beck\", \"Bede\", \"Bedegran\", \"Begnus\", \"Beldaran\", \"Beldas\", \"Belerion\",\n \"Belgarath\", \"Belgarion\", \"Belita\", \"Bella\", \"Belle\", \"Bellin\", \"Bellinus\", \"Belloc\", \"Belrene\", \"Beltane\", \"Belva\", \"Ben\", \"Benekander\",\n \"Bengt\", \"Benita\", \"Benoist\", \"Beorn\", \"Beowulf\", \"Bera\", \"Bercan\", \"Berek\", \"Berem\", \"Beren\", \"Bergen\", \"Bergthor\", \"Berim\",\n \"Bern\", \"Berna\", \"Bernhart\", \"Bernt\", \"Berronar\", \"Berryn\", \"Bersi\", \"Berta\", \"Bertil\", \"Bertilde\", \"Bertram\", \"Bertran\", \"Bertrem\",\n \"Beryl\", \"Besma\", \"Bestagar\", \"Beth\", \"Bevil\", \"Beyash\", \"Beylard\", \"Bhimrao\", \"Bhoskar\", \"Bhupindar\", \"Bidwell\", \"Bilbo\", \"Bile\",\n \"Bilmar\", \"Bindon\", \"Bion\", \"Bipin\", \"Birath\", \"Birbeck\", \"Birchard\", \"Birger\", \"Birgit\", \"Birket\", \"Bisuneh\", \"Bjarni\", \"Bjorn\",\n \"Bjornstern\", \"Blackwood\", \"Blade\", \"Blaen\", \"Blair\", \"Blame\", \"Blasco\", \"Blaze\", \"Bledsoe\", \"Blenda\", \"Bleran\", \"Blount\", \"Blunyc\",\n \"Bninna\", \"Bo\", \"Bodil\", \"Bodvar\", \"Bolthorn\", \"Boner\", \"Booker\", \"Boott\", \"Boris\", \"Bork\", \"Borlace\", \"Bormor\", \"Boromir\",\n \"Bors\", \"Botho\", \"Botolf\", \"Bourke\", \"Bowie\", \"Boyd\", \"Bracca\", \"Brace\", \"Bracken\", \"Brand\", \"Brandec\", \"Brangwen\", \"Brann\",\n \"Brannon\", \"Branwell\", \"Branwen\", \"Breanon\", \"Bremen\", \"Brenna\", \"Brenner\", \"Brent\", \"Bress\", \"Bretaine\", \"Breyugar\", \"Brianna\", \"Bridget\",\n \"Brielle\", \"Brigantu\", \"Brighton\", \"Brinn\", \"Brion\", \"Bristan\", \"Brita\", \"Brithael\", \"Brock\", \"Brockden\", \"Brodhead\", \"Brodribb\", \"Brogan\",\n \"Bron\", \"Brona\", \"Bronwyn\", \"Bror\", \"Broun\", \"Bruna\", \"Bruno\", \"Brunt\", \"Brynhild\", \"Brynit\", \"Bryoni\", \"Bunnvor\", \"Bupu\",\n \"Burcan\", \"Buri\", \"Burkard\", \"Buzurg\", \"Byam\", \"Byblos\", \"Byre\", \"Byrna\", \"Byrne\", \"Bysshe\", \"Cabell\", \"Cabillo\", \"Caddor\",\n \"Caden\", \"Cadfael\", \"Cadmar\", \"Cadrach\", \"Cadwallader\", \"Caecyn\", \"Cael\", \"Caelon\", \"Caer\", \"Cai\", \"Cail\", \"Cairn\", \"Caitlin\",\n \"Caladon\", \"Calandria\", \"Calbraith\", \"Calder\", \"Cale\", \"Caleb\", \"Calera\", \"Caliban\", \"Callan\", \"Callcott\", \"Calmic\", \"Calrohir\", \"Calumn\",\n \"Calvert\", \"Camber\", \"Cambree\", \"Camiya\", \"Canina\", \"Caprice\", \"Cardon\", \"Caramon\", \"Carelia\", \"Carey\", \"Caribou\", \"Caris\", \"Carl\",\n \"Carless\", \"Carli\", \"Carlyle\", \"Caryne\", \"Caron\", \"Carsten\", \"Carvell\", \"Caryl\", \"Cashin\", \"Caspian\", \"Cassandra\", \"Cassaway\", \"Cathal\",\n \"Catherine\", \"Cathla'in\", \"Cathlain\", \"Cathlin\", \"Cayl\", \"Caylin\", \"Cecilia\", \"Cecily\", \"Cedric\", \"Cedrick\", \"Cedrim\", \"Celadae\", \"Celebdil\",\n \"Celeborn\", \"Celeren\", \"Celes\", \"Celeste\", \"Celestine\", \"Celia\", \"Celowen\", \"Cemark\", \"Ceomyr\", \"Ceowulf\", \"Cercyon\", \"Ceremon\", \"Cerimon\",\n \"Cerindar\", \"Cermor\", \"Cernd\", \"Ceryx\", \"Cespar\", \"Cevir\", \"Ceylinn\", \"Chaka\", \"Chalfant\", \"Challen\", \"Chamon\", \"Chanti\", \"Chard\",\n \"Charissa\", \"Charlene\", \"Charlotte\", \"Chauncey\", \"Chauntea\", \"Chavir\", \"Chaya\", \"Checotah\", \"Chevonne\", \"Chevran\", \"Chichester\", \"Chimaera\", \"Chiodwig\",\n \"Chiron\", \"Chittenden\", \"Chloe\", \"Christopher\", \"Chronepsis\", \"Chronos\", \"Chrowder\", \"Chuz\", \"Cid\", \"Cilmar\", \"Cinerva\", \"Cirkin\", \"Civar\",\n \"Claed\", \"Clafin\", \"Claire\", \"Clarinda\", \"Claudia\", \"Cleghorn\", \"Clerihew\", \"Clinch\", \"Clipster\", \"Clopton\", \"Cloud\", \"Clover\", \"Clovis\",\n \"Cnud\", \"Cnut\", \"Coalter\", \"Cobryn\", \"Coddry\", \"Coel\", \"Coela\", \"Cohn\", \"Colden\", \"Colgan\", \"Colmen\", \"Colon\", \"Colwyn\",\n \"Coma\", \"Conall\", \"Conan\", \"Congal\", \"Conlan\", \"Conn\", \"Connell\", \"Connidas\", \"Connon\", \"Connop\", \"Conor\", \"Conrad\", \"Constantius\",\n \"Conwy\", \"Conyasal\", \"Coprates\", \"Cora\", \"Coral\", \"Corbin\", \"Corellon\", \"Coren\", \"Corin\", \"Corinne\", \"Corinth\", \"Cormac\", \"Cornelius\",\n \"Corrowr\", \"Corry\", \"Corryn\", \"Corwin\", \"Cotton\", \"Cowan\", \"Cowden\", \"Cowper\", \"Coyan\", \"Craigh\", \"Cray\", \"Crewzel\", \"Creydah\",\n \"Cronyn\", \"Croyble\", \"Crundall\", \"Crynal\", \"Crysania\", \"Cryshandylin\", \"Cryunnos\", \"Cuall\", \"Cuane\", \"Cuddry\", \"Cuhaid\", \"Culiross\", \"Culkin\",\n \"Cullen\", \"Cullyn\", \"Cuthalion\", \"Cuthbert\", \"Cylarus\", \"Cylie\", \"Cylmar\", \"Cymbeline\", \"Cyndor\", \"Cynoril\", \"Cyria\", \"Cyriel\", \"Cyrilla\",\n \"Cyrillus\", \"Cyrus\", \"Cyryl\", \"Cythnar\", \"Cyton\", \"Daburn\", \"Daen\", \"Dagar\", \"Dagda\", \"Dagmar\", \"Dagni\", \"Dagny\", \"Dagwyn\",\n \"Dahil\", \"Daikkah\", \"Daila\", \"Daila'in\", \"Daimhin\", \"Daimon\", \"Daisy\", \"Dakamon\", \"Dakoda\", \"Dalamar\", \"Dall\", \"Dalla\", \"Dallandra\",\n \"Dalziel\", \"Damar\", \"Damien\", \"Damon\", \"Dana\", \"Danforth\", \"Daniel\", \"Dannun\", \"Dannyn\", \"Danu\", \"Danuvius\", \"Daood\", \"Daphin\",\n \"Dara\", \"Daragor\", \"Darandriel\", \"Darell\", \"Darien\", \"Dario\", \"Darius\", \"Darkash\", \"Darkboon\", \"Darkspur\", \"Darlis\", \"Daron\", \"Darrell\",\n \"Darrin\", \"Darvin\", \"Daryan\", \"Dashiell\", \"Dashwood\", \"Dasyani\", \"Dathan\", \"Dathanja\", \"Daugas\", \"David\", \"Davnet\", \"Davros\", \"Dawn\",\n \"Dayyan\", \"Dekteon\", \"Delevan\", \"Delita\", \"Dell\", \"Dellin\", \"Delmund\", \"Demarest\", \"Demi\", \"Deminar\", \"Demtris\", \"Denethor\", \"Denhain\",\n \"Denor\", \"Denton\", \"Denzil\", \"Deogol\", \"Derfel\", \"Derian\", \"Dermaria\", \"Derran\", \"Derroll\", \"Derval\", \"Dervilia\", \"Desmona\", \"Devabriel\",\n \"Devaron\", \"Deveron\", \"Devra\", \"Dexter\", \"Dhakos\", \"Dhan\", \"Dharijor\", \"Dholemtrix\", \"Dhur\", \"Diadra\", \"Diagur\", \"Dian\", \"Diarmud\",\n \"Diderik\", \"Diehi\", \"Dighton\", \"Dillon\", \"Dimura\", \"Dinham\", \"Dinivan\", \"Dino\", \"Dionetta\", \"Diony\", \"Dirk\", \"Dirrach\", \"Divos\",\n \"Djamal\", \"Dmitri\", \"Doak\", \"Dolman\", \"Dolyan\", \"Domnu\", \"Donagh\", \"Donal\", \"Donblas\", \"Dongal\", \"Doniol\", \"Donivesh\", \"Donovan\",\n \"Doral\", \"Dorea\", \"Dorian\", \"Dorin\", \"Dorn\", \"Dornhnall\", \"Dorr\", \"Dorsan\", \"Dorvai\", \"Dotta\", \"Doud\", \"Dougal\", \"Doust\",\n \"Draco\", \"Dragan\", \"Dragus\", \"Dragutin\", \"Draka\", \"Drake\", \"Drako\", \"Dran\", \"Draoi\", \"Draven\", \"Drax\", \"Drayko\", \"Dred\",\n \"Dreed\", \"Drexel\", \"Drezael\", \"Drezaem\", \"Drin\", \"Drinda\", \"Drion\", \"Drusilla\", \"Drynn\", \"Dréagg\", \"Duain\", \"Duald\", \"Duana\",\n \"Duer\", \"Dugal\", \"Dugald\", \"Dugdale\", \"Dulasiri\", \"Dumathoin\", \"Dunbar\", \"Dundas\", \"Dunglas\", \"Dunnabar\", \"Dunstan\", \"Dunwody\", \"Duny\",\n \"Dunya\", \"Dur-Shuk\", \"Duran\", \"Durek\", \"Durin\", \"Durnik\", \"Durward\", \"Dwarkanath\", \"Dweomer\", \"Dwyer\", \"Dyce\", \"Dyer\", \"Dygardo\",\n \"Dyke\", \"Dylan\", \"Dymphna\", \"Dynar\", \"Dyneley\", \"Dynera\", \"Dynie\", \"Dytan\", \"Dyvim\", \"E'thane\", \"Eadweard\", \"Eager\", \"Eamon\",\n \"Eanger\", \"Eardley\", \"Earle\", \"Earnest\", \"Eastman\", \"Ebany\", \"Ebba\", \"Eberhard\", \"Ebony\", \"Echael\", \"Eckert\", \"Eckhard\", \"Ector\",\n \"Edcyl\", \"Edda\", \"Edeva\", \"Edgar\", \"Edina\", \"Edla\", \"Edmond\", \"Edmondstone\", \"Edric\", \"Edrie\", \"Edson\", \"Eduard\", \"Edwin\",\n \"Edwina\", \"Edwyn\", \"Eevin\", \"Efiath\", \"Efrem\", \"Egan\", \"Egbert\", \"Egerton\", \"Egil\", \"Egon\", \"Egron\", \"Ehlreth\", \"Ehrman\",\n \"Eilhard\", \"Eilif\", \"Eilinud\", \"Einar\", \"Eindrini\", \"Eirech\", \"Eirik\", \"Eiron\", \"Eithne\", \"Eivind\", \"Ekaterina\", \"Elaine\", \"Elath\",\n \"Elbert\", \"Eldath\", \"Eldavon\", \"Eldgrim\", \"Eldid\", \"Eldin\", \"Eldon\", \"Eldred\", \"Eldric\", \"Eldrin\", \"Eldron\", \"Eldìvèn\", \"Eleanor\",\n \"Eleazar\", \"Electa\", \"Elelil\", \"Elena\", \"Elendil\", \"Eleno'in\", \"Elentari\", \"Elerion\", \"Elessar\", \"Elfnida\", \"Elfnide\", \"Elfnieda\", \"Elford\",\n \"Elhanan\", \"Eliakini\", \"Eliard\", \"Elinor\", \"Elion\", \"Eliseth\", \"Elispeth\", \"Elisseer\", \"Elistan\", \"Eliwood\", \"Elizabeth\", \"Ella\", \"Ellanath\",\n \"Ellen\", \"Ellin\", \"Ellingwood\", \"Ellydryr\", \"Ellynor\", \"Elmeric\", \"Elmira\", \"Eloisa\", \"Elora\", \"Elowen\", \"Elrad\", \"Elric\", \"Elrik\",\n \"Elrodin\", \"Elron\", \"Elrond\", \"Elsa\", \"Elsbeth\", \"Elsdon\", \"Elspeth\", \"Elswyth\", \"Elton\", \"Elu\", \"Elva\", \"Elvalind\", \"Elvarion\",\n \"Elvin\", \"Elvina\", \"Elvira\", \"Elvrit\", \"Elvérion\", \"Elwell\", \"Elwin\", \"Elwyn\", \"Elysia\", \"Emberyl\", \"Emerynn\", \"Emirah\", \"Emma\",\n \"Emna\", \"Emory\", \"Endemian\", \"Endicott\", \"Endoray\", \"Endrede\", \"Endsor\", \"Engeihard\", \"Enigma\", \"Enn\", \"Ennorath\", \"Envi\", \"Enzoray\",\n \"Eolair\", \"Eomer\", \"Eosin\", \"Eowyn\", \"Ephyre\", \"Erana\", \"Erard\", \"Ercan\", \"Erdmann\", \"Erebor\", \"Ergon\", \"Erian\", \"Eric\",\n \"Erich\", \"Erie\", \"Erik\", \"Erika\", \"Erilyth\", \"Erland\", \"Erlend\", \"Erling\", \"Ernald\", \"Ernan\", \"Ernata\", \"Errine\", \"Ervin\",\n \"Eryka\", \"Eryn\", \"Esghar\", \"Eslin\", \"Esmeralda\", \"Esmond\", \"Esnar\", \"Essa\", \"Esselin\", \"Estheria\", \"Estrella\", \"Etelka\", \"Ethelbearn\",\n \"Ethelbert\", \"Ethelburga\", \"Ethelred\", \"Ethelreda\", \"Eudo\", \"Eugene\", \"Eulala\", \"Evadne\", \"Evaine\", \"Evald\", \"Evan\", \"Evarts\", \"Evelina\",\n \"Evelyn\", \"Everard\", \"Evert\", \"Evind\", \"Evo\", \"Evolyn\", \"Evska\", \"Ewald\", \"Ewen\", \"Ewugan\", \"Eystein\", \"Eyulf\", \"Eyvind\",\n \"Ezail\", \"Ezellohar\", \"Ezirith\", \"Ezme\", \"Ezrabar\", \"Ezri\", \"Faber\", \"Fabian\", \"Fael\", \"Faelyn\", \"Fahs\", \"Fairfax\", \"Fairtnan\",\n \"Falathar\", \"Falcon\", \"Falgar\", \"Fali\", \"Falias\", \"Falkiner\", \"Falmalinnar\", \"Falyrias\", \"Fanchon\", \"Fangorn\", \"Fanshaw\", \"Faraday\", \"Farah\",\n \"Farale\", \"Faramir\", \"Faran\", \"Farathar\", \"Farid\", \"Farith\", \"Farli\", \"Farnham\", \"Farouk\", \"Farquhar\", \"Farrin\", \"Farwehl\", \"Fatima\",\n \"Fausto\", \"Fawn\", \"Faysal\", \"Fea\", \"Feargus\", \"Fedor\", \"Feike\", \"Felam\", \"Felladin\", \"Fellador\", \"Fellathor\", \"Fellow\", \"Fenella\",\n \"Fenton\", \"Fenwick\", \"Fera\", \"Ferantay\", \"Ferazhin\", \"Ferdinand\", \"Fergus\", \"Fernand\", \"Feron\", \"Feustmann\", \"Fhinders\", \"Fhorgeir\", \"Fiana\",\n \"Fiathna\", \"Fielding\", \"Fikir\", \"Filippe\", \"Finarfin\", \"Finbar\", \"Findegil\", \"Findley\", \"Finegan\", \"Fingal\", \"Fingalla\", \"Fingil\", \"Finias\",\n \"Finn\", \"Finnbogi\", \"Finos\", \"Fiona\", \"Fiorag\", \"Fiori\", \"Firca\", \"Firin\", \"Firon\", \"Firozhan\", \"Fistandantilus\", \"Fistar\", \"Fistor\",\n \"Fitzedward\", \"Fitzroy\", \"Fizban\", \"Fjolnir\", \"Flandrena\", \"Flare\", \"Flavius\", \"Flint\", \"Floki\", \"Florimund\", \"Flosi\", \"Flygare\", \"Flynn\",\n \"Fnida\", \"Fomorii\", \"Forbus\", \"Forester\", \"Fornost\", \"Foronte\", \"Fothergill\", \"Francisco\", \"Frayja\", \"Freda\", \"Frederic\", \"Frederica\", \"Frederick\",\n \"Fredrick\", \"Fredrik\", \"Freeborn\", \"Freeman\", \"Frey\", \"Freya\", \"Freydis\", \"Fridgeir\", \"Frodo\", \"Fryniwyd\", \"Fuad\", \"Fumorak\", \"Furnifold\",\n \"Fury\", \"Fyodor\", \"Fyodr\", \"Fyza\", \"Gaarn\", \"Gabniela\", \"Gabriel\", \"Gadsby\", \"Gaea\", \"Gael\", \"Gaelinar\", \"Gaena\", \"Gaerdal\",\n \"Gaillard\", \"Gairdner\", \"Galach\", \"Galadren\", \"Galan\", \"Galanna\", \"Galapas\", \"Galaphon\", \"Galar\", \"Galbard\", \"Galderon\", \"Galdor\", \"Gale\",\n \"Galeia\", \"Galen\", \"Galfrey\", \"Galion\", \"Galrandar\", \"Galrion\", \"Gama\", \"Gandalf\", \"Ganduil\", \"Ganith\", \"Gannon\", \"Ganvan\", \"Gardi\",\n \"Garet\", \"Gareth\", \"Garion\", \"Garith\", \"Garl\", \"Garland\", \"Garlenon\", \"Garn\", \"Garon\", \"Garrick\", \"Garrott\", \"Garth\", \"Gartnas\",\n \"Garvin\", \"Garwood\", \"Gaston\", \"Gavendra\", \"Gavin\", \"Gavina\", \"Gawain\", \"Gealsgiath\", \"Gebhard\", \"Geir\", \"Geirmund\", \"Geirstein\", \"Gelonna\",\n \"Genevieve\", \"Geoffrey\", \"Georgii\", \"Gerald\", \"Gerard\", \"Gerd\", \"Gerhard\", \"Gerhart\", \"Gerloc\", \"Gerrard\", \"Gerreint\", \"Gerrish\", \"Gertrude\",\n \"Gervaise\", \"Gesin\", \"Gest\", \"Ghirra\", \"Ghislain\", \"Gholson\", \"Gia\", \"Gibbon\", \"Gilberta\", \"Gilda\", \"Gilden\", \"Gildersleeve\", \"Giles\",\n \"Gilfanon\", \"Gilian\", \"Gilir\", \"Gilli\", \"Gillion\", \"Gillyn\", \"Gilm\", \"Gilraen\", \"Gilthanas\", \"Gimli\", \"Gird\", \"Girin\", \"Gisgin\",\n \"Gizur\", \"Gladstone\", \"Glassford\", \"Glebur\", \"Gleda\", \"Gleocyn\", \"Gleridower\", \"Glida\", \"Glogan\", \"Gloisur\", \"Glorfindel\", \"Glugwyn\", \"Glum\",\n \"Glyn\", \"Glynn\", \"Gnazia\", \"Godfred\", \"Godfrey\", \"Godwin\", \"Goibhniu\", \"Golding\", \"Goldwin\", \"Gollum\", \"Gongalo\", \"Goodhue\", \"Gorbash\",\n \"Gordalius\", \"Gorias\", \"Gorion\", \"Gorm\", \"Gotthard\", \"Govier\", \"Govind\", \"Gowen\", \"Grace\", \"Graham\", \"Graine\", \"Gralon\", \"Grani\",\n \"Grania\", \"Gravin\", \"Greegan\", \"Greenleaf\", \"Gregor\", \"Gregory\", \"Grendahl\", \"Greyfell\", \"Grian\", \"Gridley\", \"Griffid\", \"Griffin\", \"Griffith\",\n \"Griggs\", \"Grim\", \"Grima\", \"Grimhilda\", \"Grimnir\", \"Grindan\", \"Griniing\", \"Grisha\", \"Griswold\", \"Groa\", \"Grover\", \"Grunak\", \"Grunnhild\",\n \"Gruumsh\", \"Gualat\", \"Gudmund\", \"Gudmundur\", \"Gudrid\", \"Gudris\", \"Gudrun\", \"Guibert\", \"Guida\", \"Guido\", \"Gulian\", \"Gunila\", \"Gunnar\",\n \"Gunning\", \"Gunther\", \"Gurnarok\", \"Gurney\", \"Gustav\", \"Guthorm\", \"Guthrie\", \"Guthum\", \"Gutzon\", \"Guy\", \"Gwacyn\", \"Gwaihir\", \"Gweddyn\",\n \"Gwen\", \"Gwenca\", \"Gwenda\", \"Gwendolyn\", \"Gwenevere\", \"Gweniver\", \"Gwildor\", \"Gwoc\", \"Gwomyr\", \"Gwydion\", \"Gwyn\", \"Gwyneth\", \"Gwynfryd\",\n \"Gwyran\", \"Gwythinn\", \"Gyda\", \"Gylian\", \"Gymir\", \"Haakon\", \"Habib\", \"Hablot\", \"Hack\", \"Haddon\", \"Hadrian\", \"Haestan\", \"Hafez\",\n \"Hafgrim\", \"Hagar\", \"Haigh\", \"Hakatri\", \"Haki\", \"Hakon\", \"Halbert\", \"Halcyon\", \"Haldane\", \"Haldor\", \"Hale\", \"Halfdan\", \"Haliina\",\n \"Hall\", \"Halldis\", \"Halldor\", \"Halley\", \"Hallfred\", \"Hallfrid\", \"Hallgerd\", \"Hallkel\", \"Hallock\", \"Halloweii\", \"Hallveig\", \"Halvord\", \"Hamlin\",\n \"Hamnet\", \"Hanford\", \"Hani\", \"Haninah\", \"Hannibal\", \"Hanoran\", \"Hansine\", \"Hapweth\", \"Harald\", \"Harbaugh\", \"Harcourt\", \"Hardernan\", \"Hardon\",\n \"Hardwicke\", \"Harek\", \"Harkness\", \"Harlan\", \"Harlo\", \"Harold\", \"Haroon\", \"Harpo\", \"Harren\", \"Harthan\", \"Harthran\", \"Hartpole\", \"Hartwig\",\n \"Harwood\", \"Hasket\", \"Hassan\", \"Hastein\", \"Hatcher\", \"Hattrick\", \"Hauk\", \"Havard\", \"Havelock\", \"Hayvan\", \"Hazard\", \"Hazel\", \"Haziran\",\n \"Hazrond\", \"Healdon\", \"Heardred\", \"Heaslip\", \"Heather\", \"Hector\", \"Hedda\", \"Hedin\", \"Hedwig\", \"Heimer\", \"Helena\", \"Helga\", \"Helgi\",\n \"Helir\", \"Helix\", \"Helm\", \"Helma\", \"Helmi\", \"Heman\", \"Hemming\", \"Hendrik\", \"Hengist\", \"Henna\", \"Henrick\", \"Henry\", \"Geramon\",\n \"Herdis\", \"Herekin\", \"Hereward\", \"Herijar\", \"Hermione\", \"Heron\", \"Hertha\", \"Heryom\", \"Herzog\", \"Heward\", \"Hhaba'id\", \"Hhabezur\", \"Hickling\",\n \"Hidohebhi\", \"Hifryn\", \"Hild\", \"Hilda\", \"Hildebrand\", \"Hildegarde\", \"Hildric\", \"Himli\", \"Hisar\", \"Hislop\", \"Hjalmar\", \"Hjalti\", \"Hjeldin\",\n \"Hjort\", \"Hjorth\", \"Hlif\", \"Hoadley\", \"Hoar\", \"Hobart\", \"Hodgdon\", \"Hogg\", \"Hogni\", \"Holbrook\", \"Holger\", \"Holgi\", \"Hollister\",\n \"Holly\", \"Homli\", \"Hookham\", \"Horan\", \"Horatio\", \"Hord\", \"Horik\", \"Hormstein\", \"Horsa\", \"Hortensia\", \"Horton\", \"Hoskuld\", \"Hosni\",\n \"Hossein\", \"Howarth\", \"Howland\", \"Hrafn\", \"Hrapp\", \"Hrefna\", \"Hrethel\", \"Hring\", \"Hroald\", \"Hrodyn\", \"Hrolf\", \"Hrothgar\", \"Hrugan\",\n \"Hruggek\", \"Hruse\", \"Hrut\", \"Huffatn\", \"Hulbeart\", \"Hulda\", \"Hultz\", \"Humbert\", \"Hunter\", \"Hurd\", \"Hurgal\", \"Hurvin\", \"Hussain\",\n \"Hustana\", \"Hyarantar\", \"Hyarante\", \"Hyder\", \"Hyfryn\", \"Hygelac\", \"Hylissa\", \"Hynman\", \"Hyrak\", \"Ian\", \"Iana\", \"Ibitz\", \"Ibrahim\",\n \"Ibrandul\", \"Ica\", \"Icarus\", \"Icava\", \"Ick\", \"Ida\", \"Idarolan\", \"Iden\", \"Idris\", \"Iduna\", \"Iduné\", \"Ies'lorn\", \"Igjaru\",\n \"Igor\", \"Ikarin\", \"Ilena\", \"Ilermath\", \"Ilia\", \"Iliriya\", \"Illentik\", \"Illuin\", \"Illyana\", \"Ilmare\", \"Ilniora\", \"Ilthoss\", \"Iluvatar\",\n \"Ilya\", \"Ilyesha\", \"Imajin\", \"Imnar\", \"Imoen\", \"Imphela\", \"Imrador\", \"Imrahan\", \"Imrahim\", \"Imril\", \"Imryr\", \"Inahwen\", \"Indech\",\n \"Indigo\", \"Indira\", \"Indreju\", \"Indria\", \"Ingald\", \"Ingeborg\", \"Ingen\", \"Ingi\", \"Ingirid\", \"Ingolf\", \"Ingram\", \"Ingrid\", \"Ingunn\",\n \"Inifael\", \"Inigo\", \"Inisfa'il\", \"Iosaz\", \"Iosef\", \"Irgash\", \"Irial\", \"Irian\", \"Iris\", \"Irma\", \"Irphilin\", \"Irsai\", \"Irvin\",\n \"Irwick\", \"Isael\", \"Isak\", \"Isambard\", \"Isbeorn\", \"Iscal\", \"Iselore\", \"Isengard\", \"Isengrim\", \"Iserion\", \"Isgrimnur\", \"Ishmael\", \"Isidora\",\n \"Isiki\", \"Isildur\", \"Isilith\", \"Isleif\", \"Ismail\", \"Isolde\", \"Isorn\", \"Issak\", \"Ithaca\", \"Iuz\", \"Ivan\", \"Ivar\", \"Ivor\",\n \"Ivy\", \"Iwanda\", \"Iyu'nigato\", \"Izard\", \"Izebel\", \"Izvire\", \"Jace\", \"Jacinth\", \"Jacoby\", \"Jacor\", \"Jade\", \"Jaden\", \"Jadzia\",\n \"Jael\", \"Jaffar\", \"Jagadis\", \"Jaheira\", \"Jahrec\", \"Jahverbhai\", \"Jalasil\", \"Jalavier\", \"Jaligal\", \"Jamila\", \"Janda'nan\", \"Jandanan\", \"Janix\",\n \"Janna\", \"Janus\", \"Janvel\", \"Jarak\", \"Jarazal\", \"Jared\", \"Jarek\", \"Jarnagua\", \"Jarriel\", \"Jarvin\", \"Jasara\", \"Jasek\", \"Jaseve\",\n \"Jasha\", \"Jasmine\", \"Jason\", \"Javair\", \"Javon\", \"Jawaharial\", \"Jayce\", \"Jayden\", \"Jaylidan\", \"Jayna\", \"Jaysen\", \"Jazhara\", \"Jazrel\",\n \"Jedd\", \"Jeffen\", \"Jehryn\", \"Jelyn\", \"Jenantar\", \"Jenkin\", \"Jennifer\", \"Jens\", \"Jensine\", \"Jephson\", \"Jerec\", \"Jeryth\", \"Jesiper\",\n \"Jespar\", \"Jesslyn\", \"Jestyn\", \"Jethis\", \"Jevan\", \"Jevist\", \"Jezryanadar\", \"Jhael\", \"Jhaelen\", \"Jhany\", \"Jhardamòr\", \"Jharkor\", \"Jhary\",\n \"Jihad\", \"Jillian\", \"Jingizu\", \"Jintah\", \"Jiriki\", \"Jirnost\", \"Jocelyn\", \"Jochan\", \"Johannes\", \"John\", \"Jolan\", \"Jomano\", \"Jonaya\",\n \"Joran\", \"Jordan\", \"Joriel\", \"Jornadesh\", \"Jorunn\", \"Joscelyn\", \"Joseph\", \"Josephine\", \"Josette\", \"Joshua\", \"Jotham\", \"Jovena\", \"Jubini\",\n \"Jullana\", \"Junius\", \"Juno\", \"Juntalin\", \"Jura\", \"Jurim\", \"Jusif\", \"Juss\", \"Jyresh\", \"K'aarna\", \"Kaarna\", \"Kael\", \"Kaelin\",\n \"Kaffa\", \"Kai\", \"Kaia\", \"Kailyn\", \"Kaimana\", \"Kaitlinn\", \"Kaja\", \"Kalan\", \"Kalantir\", \"Kalar\", \"Kaldar\", \"Kaleen\", \"Kalen\",\n \"Kalf\", \"Kalia\", \"Kalina\", \"Kalvan\", \"Kalvaro\", \"Kalyra\", \"Kalysha\", \"Kamril\", \"Kamshir\", \"Kanoa\", \"Kaori\", \"Kaprin\", \"Kara\",\n \"Karali\", \"Karel\", \"Karelia\", \"Kari\", \"Karim\", \"Karinca\", \"Karine\", \"Karis\", \"Karitsa\", \"Karker\", \"Karl\", \"Karlsefni\", \"Karran\",\n \"Karya\", \"Kaschak\", \"Kasia\", \"Kaspar\", \"Kasreyn\", \"Kathena\", \"Kathran\", \"Katishimo\", \"Katla\", \"Katnina\", \"Katrin\", \"Katrina\", \"Kavalam\",\n \"Kavalnir\", \"Kaylianna\", \"Kaylin\", \"Kazairl\", \"Kazalim\", \"Kazir\", \"Keavy\", \"Keelan\", \"Kegan\", \"Keiko\", \"Keldorn\", \"Kelin\", \"Kellin\",\n \"Kelma'in\", \"Kelson\", \"Kelth\", \"Kelvin\", \"Kemble\", \"Kendall\", \"Kendra\", \"Kendrick\", \"Kenesaw\", \"Kenin\", \"Kenny\", \"Kenobi\", \"Kenrick\",\n \"Kerik\", \"Kerish\", \"Kermit\", \"Kerrigan\", \"Keshar\", \"Kesrick\", \"Kethios\", \"Ketial\", \"Ketil\", \"Kettali\", \"Kevan\", \"Keven\", \"Kevlin\",\n \"Keyrnon\", \"Khader\", \"Khalia\", \"Khalid\", \"Khanzadian\", \"Kharas\", \"Khealynn\", \"Khelben\", \"Kheldor\", \"Khelen\", \"Khelin\", \"Khelyn\", \"Khendraja'aro\",\n \"Khenel\", \"Khezeed\", \"Khindawe\", \"Khirsha\", \"Khlor\", \"Khris\", \"Khyved\", \"Ki'ushapo\", \"Kian\", \"Kiborno\", \"Kiera\", \"Kieran\", \"Kikkasut\",\n \"Kilas\", \"Kilian\", \"Killion\", \"Kimmuriel\", \"Kimura\", \"Kinloch\", \"Kinson\", \"Kippler\", \"Kira\", \"Kiri\", \"Kirjava\", \"Kirk\", \"Kirren\",\n \"Kirsopp\", \"Kirsten\", \"Kishin\", \"Kisin\", \"Kitiara\", \"Kjeldor\", \"Kjindar\", \"Klaus\", \"Klean\", \"Klerak\", \"Knud\", \"Knut\", \"Knute\",\n \"Koabon\", \"Kolbein\", \"Kolchash\", \"Kolskegg\", \"Kolya\", \"Kona\", \"Konrad\", \"Konstantine\", \"Korban\", \"Kord\", \"Koreth\", \"Korgan\", \"Korm\",\n \"Kormar\", \"Kornag\", \"Korska\", \"Kosh\", \"Kota\", \"Kovelir\", \"Krinn\", \"Krishnalai\", \"Kroh\", \"Krom\", \"Kronos\", \"Kuno\", \"Kurd\",\n \"Kurn\", \"Kurt\", \"Kurin\", \"Kuros\", \"Kurtulmak\", \"Ky'ishi\", \"Ky'varan\", \"Kyle\", \"Kylindra\", \"Kypros\", \"Kyrie\", \"Kyriel\", \"La'ahl\",\n \"Lachesis\", \"Lachian\", \"Ladia\", \"Ladoros\", \"Laeli\", \"Laelia\", \"Laerrui\", \"Lahar\", \"Lahsai\", \"Lalely\", \"Lamar\", \"Lambi\", \"Lan\",\n \"Lana\", \"Lance\", \"Lancelot\", \"Landailyn\", \"Landoris\", \"Landrea\", \"Laneth\", \"Langhorne\", \"Langrian\", \"Langston\", \"Lanthal\", \"Lanthorn\", \"Larad\",\n \"Lardner\", \"Larisa\", \"Larkin\", \"Larn\", \"Larnea\", \"Lars\", \"Larz\", \"Lashar\", \"Lateia\", \"Lathander\", \"Laurana\", \"Laurelin\", \"Laxton\",\n \"Lazar\", \"Lazlo\", \"Lea\", \"Leareth\", \"Leathian\", \"Lec\", \"Ledyard\", \"Leela\", \"Legolas\", \"Legrand\", \"Leif\", \"Leighton\", \"Leika\",\n \"Leila\", \"Leilah\", \"Leli\", \"Lembar\", \"Lenka\", \"Lenox\", \"Leo\", \"Leofric\", \"Leon\", \"Leonard\", \"Leonardo\", \"Leopond\", \"Lesesne\",\n \"Lestyn\", \"Leta\", \"Letor\", \"Lev\", \"Lewellyri\", \"Lexan\", \"Lexx\", \"Lhuc\", \"Lia\", \"Liana\", \"Liena\", \"Lightfoot\", \"Liliane\",\n \"Lilin\", \"Lina\", \"Lindar\", \"Linmer\", \"Linnea\", \"Lios\", \"Liphar\", \"Lippard\", \"Liptrot\", \"Lirith\", \"Lithar\", \"Littleton\", \"Livermore\",\n \"Livia\", \"Ljot\", \"Ljotolf\", \"Lluth\", \"Llyn\", \"Llythin\", \"Lobelia\", \"Lobryn\", \"Lobur\", \"Locke\", \"Lockwood\", \"Loddlaen\", \"Lodica\",\n \"Lodin\", \"Loella\", \"Logan\", \"Loibur\", \"Loili\", \"Lola\", \"Lonvan\", \"Lore\", \"Loric\", \"Lorin\", \"Lormyr\", \"Lothar\", \"Lothrop\",\n \"Lott\", \"Lotta\", \"Loudon\", \"Louisa\", \"Lovegood\", \"Lovva\", \"Lovyan\", \"Luas\", \"Lucan\", \"Lucca\", \"Lucia\", \"Lucian\", \"Lucinda\",\n \"Lucius\", \"Lucrecia\", \"Ludmila\", \"Luella\", \"Lufkin\", \"Lugh\", \"Luhsane\", \"Lum\", \"Lumbar\", \"Luna\", \"Lunar\", \"Lunetta\", \"Lupin\",\n \"Lurican\", \"Lurue\", \"Luscan\", \"Luther\", \"Luthian\", \"Luvina\", \"Lycias\", \"Lydia\", \"Lylas\", \"Lyle\", \"Lymo\", \"Lyndall\", \"Lyndon\",\n \"Lynette\", \"Lynis\", \"Lynn\", \"Lypilla\", \"Lyra\", \"Lyrian\", \"Lyrin\", \"Lyron\", \"Lysander\", \"Lyssa\", \"Lythia\", \"Lythian\", \"Lytler\",\n \"Lyzandra\", \"Lyzette\", \"Lórien\", \"Mabon\", \"Macallan\", \"Macaulay\", \"Macer\", \"Mackim\", \"Macvey\", \"Maddern\", \"Maddock\", \"Madelon\", \"Madhao\",\n \"Madora\", \"Maec\", \"Maegwin\", \"Mael\", \"Maerraent\", \"Mafka\", \"Magda\", \"Magh\", \"Magill\", \"Magna\", \"Magnus\", \"Magus\", \"Mahion\",\n \"Mahmud\", \"Mahri\", \"Maia\", \"Maidah\", \"Maidak\", \"Maihar\", \"Makoma\", \"Malach\", \"Malachias\", \"Maladack\", \"Malador\", \"Malak\", \"Malar\",\n \"Malcoff\", \"Malcolm\", \"Malfar\", \"Malia\", \"Maliforin\", \"Malkil\", \"Malto\", \"Malvin\", \"Malvtha\", \"Mama\", \"Mamba\", \"Mana\", \"Manala\",\n \"Manaverr\", \"Manfred\", \"Mankey\", \"Mannin\", \"Manon\", \"Mansour\", \"Manton\", \"Manwe\", \"Maoll\", \"March\", \"Marcus\", \"Marena\", \"Margarita\",\n \"Margery\", \"Mariandor\", \"Marid\", \"Marina\", \"Marion\", \"Marissa\", \"Marisse\", \"Mark\", \"Markham\", \"Maroof\", \"Marques\", \"Marsden\", \"Marshtnan\",\n \"Marsineh\", \"Marta\", \"Martin\", \"Martus\", \"Mary\", \"Maryn\", \"Mathilda\", \"Mathilde\", \"Matilda\", \"Matthew\", \"Matthias\", \"Maudlin\", \"Maura\",\n \"Mavis\", \"Maxander\", \"Maxfield\", \"Maximilian\", \"Maximus\", \"Maya\", \"Mayhew\", \"Mazrak\", \"Medar\", \"Medart\", \"Medea\", \"Meder\", \"Medrom\",\n \"Megan\", \"Meghnad\", \"Mehmet\", \"Mekeesha\", \"Melba\", \"Melchior\", \"Meleri\", \"Meliadoul\", \"Melian\", \"Melisande\", \"Melkor\", \"Mellyora\", \"Melnyth\",\n \"Melora\", \"Melva\", \"Melvaig\", \"Memor\", \"Men\", \"Menard\", \"Mendolin\", \"Menelvagor\", \"Mennefer\", \"Meoran\", \"Mephistopheles\", \"Merah\", \"Merasye\",\n \"Meredith\", \"Meriadoc\", \"Merifa\", \"Merivan\", \"Merlin\", \"Merrilee\", \"Merryn\", \"Mervyn\", \"Merwold\", \"Merwolf\", \"Mes'ard\", \"Meta\", \"Methos\",\n \"Methuen\", \"Michael\", \"Michel\", \"Mideya\", \"Midhat\", \"Midra\", \"Mignon\", \"Miguel\", \"Mikhail\", \"Mila\", \"Milada\", \"Milander\", \"Milandro\",\n \"Mileaha\", \"Millard\", \"Milo\", \"Mimir\", \"Mina\", \"Minella\", \"Miner\", \"Minna\", \"Minx\", \"Mira\", \"Miragon\", \"Miranda\", \"Mirandros\",\n \"Miriel\", \"Mirrash\", \"Mirromi\", \"Miryam\", \"Misha\", \"Mishanti\", \"Misin\", \"Mist\", \"Mithrandir\", \"Mithryl\", \"Mitre\", \"Miwa\", \"Mizra\",\n \"Moda\", \"Modeus\", \"Moffett\", \"Mohammed\", \"Mohieddin\", \"Moina\", \"Moira\", \"Moiriane\", \"Moisur\", \"Molina\", \"Mona\", \"Monach\", \"Montfort\",\n \"Mora\", \"Moradin\", \"Mord\", \"Moredlin\", \"Morgan\", \"Morgon\", \"Morgwin\", \"Moriana\", \"Morik\", \"Morin\", \"Morley\", \"Morna\", \"Morpheus\",\n \"Morrigan\", \"Mortos\", \"Mortrock\", \"Morven\", \"Moya\", \"Muammar\", \"Mubur\", \"Muhammed\", \"Muhlwena\", \"Mujibur\", \"Muktar\", \"Munin\", \"Murdo\",\n \"Murias\", \"Murina\", \"Murrough\", \"Mussa\", \"Mustadio\", \"Mustafa\", \"Mylin\", \"Mylé\", \"Myna\", \"Myra\", \"Myriam\", \"Myrick\", \"Myrmeen\",\n \"Myrna\", \"Myron\", \"Myrrdyn\", \"Myrrha\", \"Myshella\", \"Mythil\", \"Myvor\", \"N'hadha\", \"Nada\", \"Nadezhda\", \"Nadia\", \"Nadir\", \"Nagai\",\n \"Nagel\", \"Nagvar\", \"Nahar\", \"Naia\", \"Naidel\", \"Najib\", \"Nakea\", \"Nalia\", \"Nall\", \"Nanorion\", \"Naois\", \"Naomi\", \"Napollo\",\n \"Narasen\", \"Narcista\", \"Narisa\", \"Narvi\", \"Nasir\", \"Nasser\", \"Natalia\", \"Natasha\", \"Nathalia\", \"Nathalie\", \"Natty\", \"Nazar\", \"Nebron\",\n \"Nedda\", \"Nedstar\", \"Neelix\", \"Negley\", \"Nemm\", \"Nemuel\", \"Neral\", \"Neri\", \"Nerian\", \"Nerilka\", \"Nerissa\", \"Nerull\", \"Nesbit\",\n \"Nesta\", \"Nethuan\", \"Neva\", \"Nevaeh\", \"Nevard\", \"Nevena\", \"Nevile\", \"Nevyn\", \"Newall\", \"Newbold\", \"Newman\", \"Neysa\", \"Neza\",\n \"Nibbidard\", \"Nichol\", \"Nicor\", \"Nienna\", \"Night\", \"Nigil\", \"Nikolai\", \"Nikua\", \"Nila\", \"Nimir\", \"Nimrodel\", \"Nina\", \"Ninian\",\n \"Niomir\", \"Nira'in\", \"Nirnir\", \"Nita\", \"Nivek\", \"Nivilian\", \"Nizam\", \"Nizar\", \"Nobanion\", \"Nodaran\", \"Noela\", \"Nolan\", \"Nona\",\n \"Noora\", \"Nor\", \"Nordri\", \"Noreen\", \"Norine\", \"Norle\", \"Norna\", \"Norval\", \"Norvin\", \"Norwood\", \"Nova\", \"Novalis\", \"Novita\",\n \"Novomira\", \"Nu'endo\", \"Nuada\", \"Nuadi\", \"Nuala\", \"Nuale\", \"Nuanni\", \"Nungo\", \"Nunila\", \"Nura\", \"Nurdoch\", \"Nurgan\", \"Nuri\",\n \"Nushia\", \"Nyassa\", \"Nylan\", \"Nymara\", \"Nynaeve\", \"Nyra\", \"Nytasa\", \"Oakes\", \"Oalyn\", \"Obed\", \"Oberon\", \"Ocar\", \"Oda\",\n \"Odar\", \"Odd\", \"Oden\", \"Odilia\", \"Odimus\", \"Odo\", \"Odona\", \"Ofeig\", \"Ogden\", \"Oghma\", \"Ogma\", \"Ogmund\", \"Ogrus\",\n \"Okander\", \"Olac\", \"Olaf\", \"Oldac\", \"Oldham\", \"Olga\", \"Olissa\", \"Olof\", \"Olorin\", \"Oloru\", \"Olvir\", \"Olya\", \"Omandras\",\n \"Omar\", \"Omassus\", \"Ombrum\", \"Omer\", \"Onslow\", \"Onufrio\", \"Onund\", \"Onyx\", \"Ooma\", \"Oona\", \"Oonai\", \"Opal\", \"Ophelia\",\n \"Orah\", \"Orcrist\", \"Ordway\", \"Oriana\", \"Orin\", \"Orion\", \"Orius\", \"Orivaen\", \"Orlandu\", \"Orlata\", \"Orm\", \"Ormsby\", \"Orome\",\n \"Oron\", \"Orren\", \"Orridge\", \"Orsola\", \"Orson\", \"Osa\", \"Osiris\", \"Oskavar\", \"Ospar\", \"Osric\", \"Oswin\", \"Othello\", \"Othilia\",\n \"Otho\", \"Othran\", \"Otiluke\", \"Otkel\", \"Otrygg\", \"Ottar\", \"Ottilia\", \"Otto\", \"Overton\", \"Owain\", \"Owen\", \"Owyn\", \"Ozatras\",\n \"Ozto\", \"Ozur\", \"Padraic\", \"Padrias\", \"Paget\", \"Pala\", \"Palma\", \"Pamar\", \"Pan\", \"Parbha\", \"Pargascor\", \"Parr\", \"Pasca\",\n \"Paschal\", \"Passmore\", \"Patnas\", \"Pattabhai\", \"Pavel\", \"Pean\", \"Pearl\", \"Pearsall\", \"Peffer\", \"Peiham\", \"Peitar\", \"Peleg\", \"Pelipi\",\n \"Pellin\", \"Pendleton\", \"Penfield\", \"Pengolod\", \"Penhallow\", \"Penniman\", \"Penrhyn\", \"Pepperell\", \"Pereban\", \"Peredon\", \"Peregrin\", \"Peregrine\", \"Perith\",\n \"Peronn\", \"Perrin\", \"Persifor\", \"Pestivar\", \"Peter\", \"Pethros\", \"Petra\", \"Petrea\", \"Petronella\", \"Pflarr\", \"Phanuel\", \"Pharatnond\", \"Pharcellus\",\n \"Phelim\", \"Philo\", \"Philpot\", \"Phimister\", \"Phoenix\", \"Phyrrus\", \"Pia\", \"Picar\", \"Pickman\", \"Pigot\", \"Pike\", \"Pine\", \"Pinkham\",\n \"Pinkney\", \"Pinkstone\", \"Piotr\", \"Pittheus\", \"Plaisted\", \"Plunimer\", \"Plunkett\", \"Polassar\", \"Pollard\", \"Pollock\", \"Polonius\", \"Polycarp\", \"Pomeroy\",\n \"Porthios\", \"Powell\", \"Prafulla\", \"Prendergast\", \"Preston\", \"Prichard\", \"Proctor\", \"Prospero\", \"Provida\", \"Psilofyr\", \"Puck\", \"Pue\", \"Pulisk\",\n \"Pulteney\", \"Purdon\", \"Pyke\", \"Pyros\", \"Pysander\", \"Quaan\", \"Quagel\", \"Qualin\", \"Quan\", \"Quarles\", \"Quasar\", \"Quascar\", \"Quass\",\n \"Quebba\", \"Quelfinas\", \"Quesan\", \"Queygo\", \"Quiddle\", \"Quinn\", \"Quiss\", \"Quixano\", \"Quora\", \"Quvar\", \"Quvean\", \"Raagon\", \"Raban\",\n \"Rabind\", \"Rabur\", \"Rach\", \"Rachid\", \"Rackafel\", \"Rackhir\", \"Radagast\", \"Radija\", \"Rae\", \"Rael\", \"Raen\", \"Rafa\", \"Rafael\",\n \"Rafur\", \"Ragen\", \"Ragna\", \"Ragnal\", \"Ragnar\", \"Ragnhild\", \"Rahaz\", \"Rai\", \"Raikes\", \"Rails\", \"Raimon\", \"Raina\", \"Raine\",\n \"Raisa\", \"Raistlin\", \"Ralina\", \"Ralmanor\", \"Ralph\", \"Ramen\", \"Ramli\", \"Ramman\", \"Ramona\", \"Ramora\", \"Ramous\", \"Ramza\", \"Ranald\",\n \"Ranath\", \"Rancor\", \"Rand\", \"Randar\", \"Randoer\", \"Randolf\", \"Randor\", \"Ranfurly\", \"Ranjan\", \"Rankin\", \"Rannuif\", \"Rannveig\", \"Raphael\",\n \"Rary\", \"Rashiel\", \"Rasputin\", \"Rathack\", \"Rathanos\", \"Rathgar\", \"Rattray\", \"Rauros\", \"Ravenor\", \"Ravi\", \"Rayne\", \"Razamor\", \"Raziel\",\n \"Razzan\", \"Rebecca\", \"Recoun\", \"Redcliffe\", \"Regalorn\", \"Regnar\", \"Reina\", \"Reis\", \"Relm\", \"Rem\", \"Remi\", \"Remnor\", \"Remus\",\n \"Renar\", \"Renata\", \"Rendel\", \"Rengoll\", \"Reoc\", \"Resha\", \"Rethral\", \"Reva\", \"Rex\", \"Reyna\", \"Rezah\", \"Rhadry\", \"Rhaederle\",\n \"Rhaeryn\", \"Rhea\", \"Rhiannon\", \"Rhiow\", \"Rhodhy\", \"Rhona\", \"Rhonda\", \"Rhora\", \"Rhorleif\", \"Rhorvald\", \"Rhundas\", \"Rhymer\", \"Rhynn\",\n \"Rhys\", \"Riallus\", \"Riamon\", \"Rickard\", \"Ricyn\", \"Rigolio\", \"Rilir\", \"Rinaldus\", \"Ringgold\", \"Risaya\", \"Riss\", \"Rith\", \"Riven\",\n \"Roach\", \"Roark\", \"Rockhill\", \"Rodefer\", \"Roderic\", \"Rodhan\", \"Rognvald\", \"Roignar\", \"Roland\", \"Rolf\", \"Rollo\", \"Roman\", \"Romelia\",\n \"Romer\", \"Romney\", \"Ronan\", \"Root\", \"Rorik\", \"Rosalyn\", \"Rosamund\", \"Roscoe\", \"Rose\", \"Rosefyre\", \"Roseline\", \"Roshena\", \"Rosskeen\",\n \"Roundell\", \"Rowena\", \"Ruadan\", \"Ruan\", \"Rubar\", \"Ruben\", \"Rubrick\", \"Ruby\", \"Rucker\", \"Rudyard\", \"Rufina\", \"Rufus\", \"Ruggles\",\n \"Ruhollah\", \"Ruinar\", \"Rulian\", \"Rulinian\", \"Rumil\", \"Runa\", \"Runold\", \"Runolf\", \"Runus\", \"Rurik\", \"Rusgar\", \"Ruth\", \"Rutland\",\n \"Ruwen\", \"Ryana\", \"Rycaro\", \"Rychanna\", \"Rygar\", \"Ryll\", \"Rylla\", \"Rynnyn\", \"Ryodan\", \"Ryoga\", \"Ryoka\", \"Saalem\", \"Sabal\",\n \"Sabhel\", \"Sabriel\", \"Sabrok\", \"Sacheverall\", \"Sackville\", \"Saddam\", \"Sadler\", \"Sador\", \"Saedd\", \"Saermund\", \"Saeunn\", \"Safrin\", \"Saia\",\n \"Said\", \"Saifai\", \"Saiwyn\", \"Salina\", \"Salmon\", \"Salter\", \"Sam\", \"Sambrea\", \"Samia\", \"Samira\", \"Sammel\", \"Samuel\", \"Sanfrid\",\n \"Sano'rye\", \"Sanoreya\", \"Sanoria\", \"Sarcyn\", \"Sardior\", \"Sardul\", \"Sarel\", \"Sarevok\", \"Sargonus\", \"Saria\", \"Sarina\", \"Sarisin\", \"Sariya\",\n \"Sarrask\", \"Saruman\", \"Sasha\", \"Saska\", \"Saturn\", \"Sauron\", \"Savah\", \"Savion\", \"Sawdon\", \"Sayan\", \"Scenesefa\", \"Scudamore\", \"Scythe\",\n \"Sebastian\", \"Sebrinth\", \"Sechier\", \"Sedgely\", \"Seersha\", \"Segojan\", \"Sehanine\", \"Seitarin\", \"Selema\", \"Selena\", \"Selene\", \"Selig\", \"Selim\",\n \"Selina\", \"Selis\", \"Selith\", \"Selune\", \"Selwyn\", \"Semuta\", \"Senith\", \"Senna\", \"Sephia\", \"Sephya\", \"Sepiroth\", \"Seramir\", \"Seraphina\",\n \"Serena\", \"Serenyi\", \"Sergei\", \"Seriozha\", \"Seryan\", \"Seryl\", \"Seryth\", \"Seth\", \"Sethron\", \"Sevadia\", \"Severin\", \"Sevros\", \"Sevy\",\n \"Sha'dar\", \"Sha'rell\", \"Shackerley\", \"Shadizad\", \"Shadrach\", \"Shadworth\", \"Shaera\", \"Shaivar\", \"Shaivir\", \"Shala\", \"Shalamar\", \"Shalandain\", \"Shalat\",\n \"Shalhassan\", \"Shalindra\", \"Shalon\", \"Shalpan\", \"Shamane\", \"Shamir\", \"Shana\", \"Shandalar\", \"Shanell\", \"Shar\", \"Sharada\", \"Sharaq\", \"Shard\",\n \"Sharif\", \"Sharilla\", \"Sharl\", \"Sharla\", \"Sharmaine\", \"Sharman\", \"Sharna\", \"Sharnira\", \"Sharra\", \"Sharteel\", \"Shaundra\", \"Sharyn\", \"Shayera\",\n \"Shayla\", \"Shayll\", \"Shayonea\", \"Shea\", \"Sheegoth\", \"Sheeryl\", \"Sheherazad\", \"Shemsin\", \"Sheridan\", \"Sherif\", \"Sherry\", \"Shezael\", \"Shima'onari\",\n \"Shintaro\", \"Shiza\", \"Shuinn\", \"Shuna\", \"Shurakai\", \"Shurik\", \"Shushila\", \"Shylock\", \"Siandar\", \"Sibert\", \"Sibyl\", \"Sidhe\", \"Siglinde\",\n \"Sigmund\", \"Signe\", \"Sigred\", \"Sigrid\", \"Sigtrydd\", \"Sigurd\", \"Sigvaldi\", \"Silatasar\", \"Silius\", \"Silma\", \"Silmariel\", \"Silphane\", \"Silvain\",\n \"Silvan\", \"Silvanus\", \"Silvera\", \"Silveron\", \"Silvia\", \"Silvyn\", \"Simir\", \"Simmu\", \"Sinbad\", \"Sindarin\", \"Sinir\", \"Sinjin\", \"Siranush\",\n \"Sirisir\", \"Sirli'in\", \"Sirona\", \"Sirranon\", \"Sirwin\", \"Sisimar\", \"Siski\", \"Sivesh\", \"Siveth\", \"Siward\", \"Sjerdi\", \"Skamkel\", \"Skelmar\",\n \"Skorian\", \"Slade\", \"Slania\", \"Slater\", \"Slava\", \"Sligh\", \"Slingsby\", \"Smedley\", \"Snargg\", \"Snorri\", \"Snyder\", \"Sodorn\", \"Soilir\",\n \"Soisil\", \"Sokki\", \"Solaris\", \"Solera\", \"Solevig\", \"Solmund\", \"Solomon\", \"Solvi\", \"Sonnet\", \"Sooth\", \"Sora\", \"Sorass\", \"Sorcha\",\n \"Sorin\", \"Sornovas\", \"Soth\", \"Southall\", \"Sovaz\", \"Soveh\", \"Soyadi\", \"Sparrow\", \"Sprigg\", \"Squall\", \"Srass\", \"Stabyl\", \"Stanwood\",\n \"Starkad\", \"Starke\", \"Stedman\", \"Stefan\", \"Stehman\", \"Stein\", \"Steinkel\", \"Steinthor\", \"Stelectra\", \"Stenger\", \"Stenwulf\", \"Steponas\", \"Sterndale\",\n \"Stetson\", \"Stetter\", \"Stiliman\", \"Stilingfleet\", \"Stopford\", \"Storm\", \"Stowna\", \"Strachan\", \"Straygoth\", \"Stroud\", \"Strudwick\", \"Strybyorn\", \"Strykar\",\n \"Sturla\", \"Sturm\", \"Styx\", \"Sudeha\", \"Suleiman\", \"Sulimo\", \"Sulkas\", \"Sumarlidi\", \"Suras\", \"Surridge\", \"Susin\", \"Susur\", \"Sutan\",\n \"Svala\", \"Svan\", \"Svante\", \"Svatopluk\", \"Sveata\", \"Sven\", \"Swain\", \"Swartwout\", \"Sydnor\", \"Syllva\", \"Sylvane\", \"Sylvia\", \"Sylvin\",\n \"Sylvine\", \"Syndarra\", \"Synnyn\", \"Syranita\", \"Syrioll\", \"Tabar\", \"Tabitha\", \"Tabor\", \"Tabu\", \"Tacey\", \"Tachel\", \"Tadashi\", \"Tadeus\",\n \"Tadia\", \"Tadisha\", \"Tadra\", \"Taennyn\", \"Taeynnyn\", \"Taggart\", \"Tahir\", \"Tailabar\", \"Taina\", \"Takhisis\", \"Taleen\", \"Talen\", \"Taleth\",\n \"Talia\", \"Taliesin\", \"Talin\", \"Talmora\", \"Talobar\", \"Talona\", \"Taloxi\", \"Taltos\", \"Talus\", \"Tamar\", \"Tamara\", \"Tameryn\", \"Tamias\",\n \"Tamlin\", \"Tamoreya\", \"Tanina\", \"Tanis\", \"Tanith\", \"Tanyc\", \"Tar\", \"Tara\", \"Taran\", \"Tarcia\", \"Taria\", \"Tarik\", \"Taromas\",\n \"Taron\", \"Tarran\", \"Taryn\", \"Tas\", \"Tasharra\", \"Tasker\", \"Tatyana\", \"Taurus\", \"Taveli\", \"Taylian\", \"Taylin\", \"Tedra\", \"Tegan\",\n \"Tekia\", \"Telena\", \"Tell\", \"Tench\", \"Tenna\", \"Tenser\", \"Teoddry\", \"Ter\", \"Teralyn\", \"Teressa\", \"Terix\", \"Teruah\", \"Tesin\",\n \"Tesla\", \"Tessa\", \"Tevran\", \"Thaal\", \"Thacker\", \"Thaddeus\", \"Thaki\", \"Thal\", \"Thalen\", \"Thalessa\", \"Thalia\", \"Thalna\", \"Tham\",\n \"Thana\", \"Thane\", \"Thanatos\", \"Thantos\", \"Thar\", \"Tharbad\", \"Tharkesh\", \"Tharn\", \"Thax\", \"Thecla\", \"Theda\", \"Theleb\", \"Theoden\",\n \"Theodor\", \"Theodoric\", \"Theodosia\", \"Theodric\", \"Theoric\", \"Thera\", \"Therad\", \"Theresa\", \"Therios\", \"Theros\", \"Thesius\", \"Thieras\", \"Thieryn\",\n \"Thingyr\", \"Thio\", \"Tholan\", \"Thomas\", \"Thomulor\", \"Thora\", \"Thoran\", \"Thorarin\", \"Thorburn\", \"Thord\", \"Thordarson\", \"Thordis\", \"Thorfel\",\n \"Thorfinn\", \"Thorfinna\", \"Thorgeir\", \"Thorgerd\", \"Thorgest\", \"Thorgils\", \"Thorgrim\", \"Thorgunna\", \"Thorhall\", \"Thorhalla\", \"Thorhild\", \"Thorin\", \"Thorir\",\n \"Thorkatla\", \"Thorkell\", \"Thorkild\", \"Thormod\", \"Thormodr\", \"Thormond\", \"Thorn\", \"Thorndike\", \"Thornwell\", \"Thorold\", \"Thorolf\", \"Thorsager\", \"Thorstein\",\n \"Thorunn\", \"Thorvald\", \"Thorvaldur\", \"Thorvar\", \"Thorzyl\", \"Thoth\", \"Thrain\", \"Thrand\", \"Throck\", \"Thule\", \"Thurid\", \"Thylda\", \"Thyra\",\n \"Thyri\", \"Thyrza\", \"Thyssa\", \"Tiana\", \"Tiffany\", \"Tihan\", \"Tika\", \"Tilford\", \"Tilica\", \"Tilir\", \"Tillinghast\", \"Tilloch\", \"Timon\",\n \"Tioniel\", \"Tirion\", \"Tisha\", \"Tisheri\", \"Titania\", \"Titia\", \"Titiana\", \"Tivernee\", \"Tiyagar\", \"Tnin\", \"Tobias\", \"Tobis\", \"Todhunter\",\n \"Tolbert\", \"Tolenka\", \"Topaz\", \"Topham\", \"Torc\", \"Tortbold\", \"Tosti\", \"Tosya\", \"Toulac\", \"Tovi\", \"Trafford\", \"Trebor\", \"Trelane\",\n \"Trelawny\", \"Trella\", \"Trevel\", \"Trick\", \"Trigg\", \"Trill\", \"Triona\", \"Trir\", \"Tristam\", \"Tristan\", \"Trost\", \"Trotwood\", \"Trowbridge\",\n \"Truesdell\", \"Tuane\", \"Tufnell\", \"Tugan\", \"Tuilleth\", \"Tulio\", \"Tulkas\", \"Tundine\", \"Tunstall\", \"Tuor\", \"Turan\", \"Turgoz\", \"Turhan\",\n \"Turin\", \"Turpin\", \"Tuttle\", \"Tuula\", \"Twyla\", \"Tylden\", \"Tyldoran\", \"Tylen\", \"Tylien\", \"Tylynn\", \"Tymar\", \"Tymora\", \"Tymoriel\",\n \"Tynnyn\", \"Tyr\", \"Tyra\", \"Tyranina\", \"Tyreen\", \"Tyrwhitt\", \"Uamian\", \"Ubriani\", \"Ucarsh\", \"Uda\", \"Uhier\", \"Uhlain\", \"Uhlume\",\n \"Uholedil\", \"Uinen\", \"Ula\", \"Ulf\", \"Ulgor\", \"Ulis\", \"Uljas\", \"Ulji\", \"Ulmaerr\", \"Ulmo\", \"Ulosh\", \"Ulric\", \"Ulrich\",\n \"Ultron\", \"Umaiar\", \"Umbar\", \"Umda\", \"Umgalad\", \"Una\", \"Uneitna\", \"Ungon\", \"Unius\", \"Unn\", \"Unrak\", \"Unwin\", \"Upal\",\n \"Upton\", \"Urabi\", \"Urania\", \"Uranos\", \"Uranus\", \"Uriel\", \"Urish\", \"Urokoz\", \"Ursula\", \"Usher\", \"Uta\", \"Utumno\", \"Uusoae\",\n \"Uvanimor\", \"Uziel\", \"Vabryn\", \"Vadarin\", \"Vadi\", \"Vaeddyn\", \"Vagn\", \"Vai\", \"Val\", \"Valadan\", \"Valandario\", \"Valandor\", \"Valarindi\",\n \"Valborg\", \"Valda\", \"Valdain\", \"Valdemar\", \"Valen\", \"Valenka\", \"Valentia\", \"Valerand\", \"Valeria\", \"Valerian\", \"Valeska\", \"Valgar\", \"Valgard\",\n \"Valgerd\", \"Valiah\", \"Valion\", \"Valisa\", \"Valiss\", \"Valistor\", \"Valkor\", \"Valla\", \"Vallo\", \"Valmar\", \"Valminder\", \"Valor\", \"Valsera\",\n \"Valurian\", \"Valya\", \"Valynard\", \"Vandrad\", \"Vane\", \"Vanechka\", \"Vanidor\", \"Vanion\", \"Vannevar\", \"Vannyn\", \"Vanya\", \"Vanyar\", \"Vanyel\",\n \"Varda\", \"Vardis\", \"Varina\", \"Varion\", \"Varken\", \"Varnum\", \"Vasava\", \"Vash\", \"Vasha\", \"Vasilii\", \"Vasin\", \"Vaydin\", \"Vaydir\",\n \"Vayi\", \"Vecna\", \"Veda\", \"Veldahar\", \"Veldan\", \"Velex\", \"Velior\", \"Venable\", \"Vendor\", \"Veorcyn\", \"Vercyn\", \"Verdina\", \"Vereesa\",\n \"Verline\", \"Vermund\", \"Verna\", \"Ves\", \"Vespar\", \"Vestein\", \"Veva\", \"Vevina\", \"Vexter\", \"Viasta\", \"Vicarr\", \"Vicat\", \"Vicentia\",\n \"Viconia\", \"Victor\", \"Vida\", \"Vidkun\", \"Vidron\", \"Vieno\", \"Viera\", \"Vierna\", \"Vigdis\", \"Vigfus\", \"Vilhelm\", \"Vilka\", \"Vilrna\",\n \"Vinatta\", \"Vincas\", \"Vincent\", \"Vintar\", \"Violet\", \"Vircyn\", \"Vishali\", \"Viveka\", \"Vladimir\", \"Vladislav\", \"Vlaric\", \"Vobur\", \"Voirath\",\n \"Vokos\", \"Voldor\", \"Volkan\", \"Volney\", \"Volodya\", \"Volund\", \"Vonya\", \"Voranor\", \"Vrashin\", \"Vulpen\", \"Vurog\", \"Vusil\", \"Vyecheslav\",\n \"Vyner\", \"Wadleigh\", \"Waenwryht\", \"Wager\", \"Waisham\", \"Waivan\", \"Wakeman\", \"Wakkar\", \"Walborg\", \"Walda\", \"Waldan\", \"Waldegrave\", \"Waldemar\",\n \"Waleran\", \"Walford\", \"Walid\", \"Walker\", \"Wanhim\", \"Waring\", \"Wariv\", \"Wark\", \"Warne\", \"Warrender\", \"Warrigel\", \"Warwick\", \"Waryk\",\n \"Watson\", \"Watt\", \"Waylan\", \"Wayland\", \"Waylon\", \"Wealin\", \"Wedlake\", \"Weilborn\", \"Weiryn\", \"Wel\", \"Wemick\", \"Wendolyn\", \"Wertha\",\n \"Westcott\", \"Westen\", \"Weyrn\", \"Wharrom\", \"Whitwell\", \"Whyte\", \"Wicca\", \"Wideman\", \"Wightman\", \"Wildhair\", \"Wilfrid\", \"Wilhelm\", \"Wilhelmina\",\n \"Wilibald\", \"Will\", \"Willa\", \"William\", \"Willock\", \"Willow\", \"Wilma\", \"Wilmar\", \"Wilner\", \"Wilven\", \"Windham\", \"Winfrey\", \"Winian\",\n \"Winslow\", \"Winton\", \"Wisp\", \"Wisuth\", \"Wivianne\", \"Wizlow\", \"Woart\", \"Wodan\", \"Wolfgang\", \"Wolmar\", \"Womal\", \"Woodfin\", \"Woodruff\",\n \"Wooligar\", \"Wortley\", \"Wotan\", \"Wulf\", \"Wulfgar\", \"Wulfric\", \"Wulgar\", \"Wychnor\", \"Wycliffe\", \"Wyllows\", \"Wyly\", \"Wynkyn\", \"Wynne\",\n \"Wynston\", \"Wyvan\", \"Xaandria\", \"Xaath\", \"Xabian\", \"Xabiel\", \"Xabu\", \"Xain\", \"Xalthan\", \"Xan\", \"Xanaphel\", \"Xanathar\", \"Xander\",\n \"Xandra\", \"Xandria\", \"Xanthon\", \"Xanthus\", \"Xarek\", \"Xarolith\", \"Xaver\", \"Xavier\", \"Xavin\", \"Xela\", \"Xelmonth\", \"Xena\", \"Xenia\",\n \"Xenoba\", \"Xera\", \"Xercon\", \"Xerravin\", \"Xiombarg\", \"Xoncarg\", \"Xoran\", \"Xulan\", \"Xyas\", \"Xydra\", \"Xyko\", \"Xylah\", \"Xylia\",\n \"Xymoya\", \"Xystus\", \"Xythrin\", \"Xytrin\", \"Yacima\", \"Yaheira\", \"Yahira\", \"Yaigin\", \"Yakov\", \"Yalan\", \"Yali\", \"Yalin\", \"Yalniz\",\n \"Yamari\", \"Yana\", \"Yandell\", \"Yangin\", \"Yanira\", \"Yannul\", \"Yara\", \"Yaraia\", \"Yarali\", \"Yardim\", \"Yardley\", \"Yari\", \"Yarim\",\n \"Yarin\", \"Yarir\", \"Yaritza\", \"Yartrina\", \"Yasimina\", \"Yasir\", \"Yasmina\", \"Yasser\", \"Yastar\", \"Yatay\", \"Yavana\", \"Yazihane\", \"Yelain\",\n \"Yeni\", \"Yetne\", \"Yevgenii\", \"Yezade\", \"Ygerna\", \"Ygraine\", \"Yishana\", \"Ynryc\", \"Ynvar\", \"Yoda\", \"Yolanda\", \"Yondalla\", \"York\",\n \"Yradry\", \"Yreoddyn\", \"Yrrkoon\", \"Yrsa\", \"Yrun\", \"Yryllyn\", \"Ysabel\", \"Ysgerryn\", \"Ysolde\", \"Yuri\", \"Yvain\", \"Yvette\", \"Yvonne\",\n \"Yvyr\", \"Yénisar\", \"Yérusha\", \"Zabdiel\", \"Zacarias\", \"Zachary\", \"Zachris\", \"Zadock\", \"Zahara\", \"Zahra\", \"Zaidh\", \"Zalazar\", \"Zalbar\",\n \"Zan\", \"Zandra\", \"Zanifa\", \"Zanthar\", \"Zara\", \"Zaranthe\", \"Zared\", \"Zarimarth\", \"Zarquan\", \"Zathras\", \"Zavel\", \"Zaviv\", \"Zay\",\n \"Zazumel\", \"Zebalane\", \"Zebulon\", \"Zehir\", \"Zelda\", \"Zemenar\", \"Zenda\", \"Zendrac\", \"Zenith\", \"Zenobia\", \"Zenon\", \"Zepher\", \"Zephyr\",\n \"Zerika\", \"Zerin\", \"Zeswick\", \"Zhalore\", \"Zhanna\", \"Zharvek\", \"Zhenya\", \"Zhirek\", \"Zhirem\", \"Zhoreb\", \"Zia\", \"Zigmal\", \"Zilar\",\n \"Zinaida\", \"Zincir\", \"Zion\", \"Ziona\", \"Zircon\", \"Zirzihin\", \"Zita\", \"Zoe\", \"Zolabar\", \"Zoltan\", \"Zona\", \"Zora\", \"Zorashad\",\n \"Zorayas\", \"Zorlan\", \"Zosia\", \"Zotar\", \"Zumurrud\", \"Zurrog\", \"Zykhiralamshad\"];\n makeArrays();\n}", "title": "" }, { "docid": "61ed21490e6c4ecbafa9622ae888beb9", "score": "0.51474357", "text": "function byStateLeave(index){\n\t\n\t//fades in the banner over the image with the state name\n\t$(\"#state\"+index+\">.mapLocation-centeredImgText\").stop().fadeIn(350);\n\n}", "title": "" }, { "docid": "5d689a629f35dadb7f0307b54c32e907", "score": "0.5147316", "text": "changeAddressBar(src) {\n this.setState({ address: src });\n }", "title": "" }, { "docid": "bde06703e82b2d8e01ca2de3062aff9f", "score": "0.5138857", "text": "function draw_states(){\n\t\t\n\t}", "title": "" }, { "docid": "84ff162aac03418efd7a9a57e91c2901", "score": "0.51297176", "text": "function drawTransitionsLabels(transitions, cells, graph) {\n\t\tif (transitions != undefined) {\n\t\t\tgraph.getModel().beginUpdate();\n\t\t\t\n\t\t\tfor (var i in transitions) {\n\t\t\t\ttransition = transitions[i];\n\t\t\t\tvar cell = findCellById(cells, 'transition_' + transition.transitionID);\n\t\t\t\t\n\t\t\t\tif (cell != null) {\n\t\t\t\t\tvar edgeState = editor.graph.view.getState(cell, true);\n\t\t\t\t\t\n\t\t\t\t\tvar x = transition.labelPositionA;\n\t\t\t\t\tvar y = transition.labelPositionB;\n\t\t\t\t\tvar geometry = graph.getCellGeometry(cell);\n\t\n\t\t\t\t\tif (geometry != null && edgeState.text != null) {\n\t\t\t\t\t\tgeometry = geometry.clone();\n\t\t\t\t\t\tgeometry.relative = false;\n\t\t\t\t\t\tgeometry.offset = calculateLabelAbsolutePosition(edgeState, x, y, true);\n\t\t\t\t\t\tgraph.model.setGeometry(cell, geometry);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tgraph.getModel().endUpdate();\n\t\t}\n\t}", "title": "" }, { "docid": "cc388ba3ab3c66b6c6b1bf6175fc991c", "score": "0.51279324", "text": "function updateLocale() \n{\n\t// Standard processing from base game, this is mandatory\n\tupdateLocaleBase();\n\t\n\t// Mod specific changes.\n\tgameState.sTown = \"Brichester\";\n\tfindPerson(\"Glenvale\").name = gameState.sTown;\n\t\n\t// Change item descriptions\n\t// Wooden box\n\tvar item = getBaseItemObj(25);\n\titem.getDescription = function() {\n\t\treturn 'A bound wooden box intricately decorated, with an old metal clasp.</p><p>The box is currently <b>' + (perYou.checkFlag(6) ? 'open' : 'closed') + '</b>.';\n\t}\n\t// Dragon Vase\n\titem = getBaseItemObj(29);\n\titem.getDescription = function() {\n\t\tvar perAbby = findPerson(\"Abby\");\n\t\tif (perAbby.getQuestDragonGem() < 3) perAbby.setQuestDragonGem(3); //Have Seen - KNOW of the Vase\n\t\treturn 'A dragon vase made of some strange metal you do not recognise';\n\t}\n}", "title": "" }, { "docid": "bec93e4de0b55c4750e5a88a8db9f7b8", "score": "0.5124442", "text": "function changedState(currentStateStr, newStateStr) {\n print(\"changed state\" + \"current state = \" + currentStateStr + \" new state = \" + newStateStr);\n\n}", "title": "" }, { "docid": "262053d72605473261d7eff5562a80cb", "score": "0.51243985", "text": "function resetHighlight(e) {\n county.resetStyle(e.target);\n $(\".update\").html(\"Hover over a Census Tract\");\n}", "title": "" }, { "docid": "1f29770f70d016efd5b8cb9ed23a732e", "score": "0.51084065", "text": "function updateMarkerAddress(str){\n //document.getElementById('address').innerHTML = str;\n }", "title": "" }, { "docid": "52fa11eb54e4799f53e3b9ea85209b38", "score": "0.50977564", "text": "function updateState(state, color) {\r\n\tdocument.getElementById(\"connectionLabel\").textContent=state;\r\n\tdocument.getElementById(\"connectionLabel\").style.color=color;\r\n}", "title": "" }, { "docid": "d61ad9a2b5269c4ecf2d802b4381da71", "score": "0.5091952", "text": "function letterChanges(str) {\n\n}", "title": "" }, { "docid": "8e7949c652c5f0bf16ade64ee0f54892", "score": "0.5091393", "text": "function term_hover(term) {\n var old_term = termID + vis_state.term;\n if (vis_state.term != \"\" && old_term != term.id) {\n term_off(document.getElementById(old_term));\n }\n vis_state.term = term.innerHTML;\n term_on(term);\n state_save(true);\n }", "title": "" }, { "docid": "195ab2beb6785cee0b3ddbf6800359e1", "score": "0.5086211", "text": "function updateUrl() {\n // Do this instead of directly setting window.location.hash to prevent adding extra history entries\n var baseUrl = window.location.origin + '/basic-income/custom/';\n var url = baseUrl + '#' + encodeURIComponent(state2hash(state));\n document.getElementById('cliptext').value = url;\n\n var text = 'Check out my basic income model for ' + state.regionName[0];\n\n if (document.getElementById('ubiShareTwitter')) {\n document.getElementById('ubiShareTwitter').dataset.url = url;\n document.getElementById('ubiShareTwitter').dataset.text = text;\n }\n if (document.getElementById('ubiShareFacebook')) {\n document.getElementById('ubiShareFacebook').dataset.url = url;\n document.getElementById('ubiShareFacebook').dataset.text = text;\n }\n if (document.getElementById('ubiShareEmail')) {\n document.getElementById('ubiShareEmail').dataset.url = url;\n document.getElementById('ubiShareEmail').dataset.text = text;\n }\n }", "title": "" }, { "docid": "883d762737c6130c479fced743d0fc61", "score": "0.5084202", "text": "function updateTitle(map, attribute) {\n var div = document.getElementById(\"title\");\n div.innerHTML = \"Top 15 Carbon Emitters by Country: \" + attribute.slice(5); \n}", "title": "" }, { "docid": "ce92f6f1b8f4ee47450baf8eb3041e11", "score": "0.5077128", "text": "function findStateName(abbrev) {\n var i, index = -1;\n for (i = 0; i < stateList.length; i++) {\n if (abbrev.toUpperCase() == stateList[i].abbrev) {\n return stateList[i].state;\n }\n }\n return \"\";\n}", "title": "" }, { "docid": "ce36387a79a030b11c83a352d37fad4f", "score": "0.507072", "text": "updateTool(newState) {\n if (newState == null) { newState = {} }\n for (let k in this.state) {\n if (!(k in newState)) {\n newState[k] = this.state[k];\n }\n }\n const fontSize = this.getFontSizes()[newState.fontSizeIndex];\n const items = [];\n if (newState.isItalic) { items.push(\"italic\") }\n if (newState.isBold) { items.push(\"bold\") }\n items.push(`${fontSize}px`);\n items.push(FONT_NAME_TO_VALUE[newState.fontName]);\n this.props.lc.tool.font = items.join(\" \");\n this.props.lc.trigger(\"setFont\", items.join(\" \"));\n }", "title": "" }, { "docid": "a72c0e49d9d8ddb0220f0d5956a180e5", "score": "0.5062993", "text": "function __updateStateModal(event) {\n\n Object.entries(\n Object.assign(...Object.entries(__stateData)\n .filter(entry => !entry[0].startsWith('_'))\n .map(entry => entry[1])))\n .filter(entry => typeof entry[1] !== 'object')\n .map( entry => [ $(`#batteryModal td.sv_${entry[0]}`), entry[1] ])\n .filter( entry => entry[0] )\n .forEach( entry => entry[0].text(entry[1]) );\n }", "title": "" }, { "docid": "ec92dc135f6cc8d8a9c6e3e56f3da30f", "score": "0.5059731", "text": "function updateState(index) {\n var newstate = read.question('enter the new state name');\n data[index].state = newstate;\n writefile(data);\n }", "title": "" }, { "docid": "7efd09952383bf6772c3bd84554ac10e", "score": "0.50567704", "text": "function renumberWaypoints() {\n \"use strict\";\n var waypoint;\n for (waypoint in waypoints) {\n if (waypoints.hasOwnProperty(waypoint)) {\n waypoints[waypoint].getElementsByTagName(\"span\")[0].innerHTML = alphabet[waypoint];\n }\n }\n }", "title": "" }, { "docid": "c3bfeec7e3b2e6fe1eb71d306499f693", "score": "0.50518584", "text": "function realChangeLetter(spanList, position, realString, finalColor) {\n\tspanList[position].textContent = realString[position];\n\tspanList[position].style.color = finalColor;\n}", "title": "" }, { "docid": "c3964f9db664061ba1dbd251dde09d61", "score": "0.50438607", "text": "function updateGeneralLocationInformation(address) {\n\tvar output = \"You are positioned at <b>\" + Math.round(selectedLocation.lng() * 10000) / 10000 + \"</b> longitude and <b>\"\n\t\t\t+ Math.round(selectedLocation.lat() * 10000) / 10000 + \"</b> latitude\";\n\tif (!(address == \"\")) {\n\t\toutput += \", which is also known as <b>\" + address + \"</b>\";\n\t}\n\toutput += \".\";\n\tdocument.getElementById(\"location_stream\").innerHTML = output;\n}", "title": "" }, { "docid": "7782bb482d1294e9d08b2ff98da583da", "score": "0.5042621", "text": "function updatePosViewingLink() {\n var selPos = getSelPos();\n if (selPos != null && selPos != '') {\n $('#aChangePositions').html(\"<span class='ui-button-text' >\" + selPos + \"</span>\");\n if(hasCookie('selPos'))\n $('#aChangePositions').addClass('ui-state-active');\n }\n}", "title": "" }, { "docid": "3a987532935addc922d32cb7b38267d8", "score": "0.5041203", "text": "updateName() {\n const names = [];\n if (this.state.danceLevels.length > 0) {\n names.push(this.state.danceLevels[0]);\n }\n if (this.state.style) {\n names.push(this.state.style);\n }\n if (this.state.dance) {\n names.push(this.state.dance);\n }\n\n this.setState({\n name: names.join('-'),\n });\n }", "title": "" }, { "docid": "80ee52b0e9843a8ff2f092c57af5cb94", "score": "0.50377095", "text": "changeState(state) {\r\n let find = Object.keys(this.config.states).indexOf(state);\r\n if (find < 0)\r\n throw Error();\r\n\r\n this.historyStaties.push({name: state, value: this.config.states[state]});\r\n //return this.historyStaties[this.historyStaties.length - 1].name;\r\n this.currentState = state;\r\n this.currentPosition = this.historyStaties.length;\r\n return this.currentState;\r\n }", "title": "" }, { "docid": "d22fe966e0319dc17c88c1d95b4b2d3a", "score": "0.50372976", "text": "function update(key) {\n d3.select('.bars').selectAll('rect')\n .attr('y', y(0))\n .attr('height', 0)\n .transition() // bar graph animation\n .duration(800)\n .attr('y', (d) => {return y(d[key])})\n .attr('height', (d) => {return y(0) - y(d[key])})\n .delay((d,i) => {return(i*20)});\n \n d3.selectAll('.bartextState').remove()\n d3.selectAll('.bartextPop').remove()\n \n let stateName = state_converter.find((d) => {return d.stateAbr == key}).stateName\n \n d3.select(\"#viz1-statename\").html(stateName)\n d3.select(\"#viz1-population\").html(numberWithCommas(pop_data.find((d) => {return d.NAME == stateName}).POPESTIMATE2019))\n\n bars\n .append('text') // adds new bar graph title\n .attr('class', 'bartextState')\n .attr('x', (barsW / 2)) \n .attr('y', 705)\n .style('font-size', '16px')\n .style('font-weight', 'bold')\n .style('fill', '#CC442F')\n .text(stateName)\n \n bars // adds population\n .append('text')\n .attr('class', 'bartextPop')\n .attr('x', (width / 2)) \n .attr('y', 755)\n .style('font-size', '16px')\n .style('font-weight', 'bold')\n .style('fill', '#CC442F')\n .text(pop_data.find((d) => {return d.NAME == stateName}).POPESTIMATE2019);\n }", "title": "" }, { "docid": "2512336736985052cf21a160b2bd1b74", "score": "0.50352114", "text": "function dispensary() {\n function validateState(state) {\n var stateNames = ['ARIZONA', 'ALABAMA', 'ALASKA', 'ARIZONA', 'ARKANSAS', 'CALIFORNIA', 'COLORADO', 'CONNECTICUT', 'DELAWARE', 'FLORIDA', 'GEORGIA', 'HAWAII', 'IDAHO', 'ILLINOIS', 'INDIANA', 'IOWA', 'KANSAS', 'KENTUCKY', 'KENTUCKY', 'LOUISIANA', 'MAINE', 'MARYLAND', 'MASSACHUSETTS', 'MICHIGAN', 'MINNESOTA', 'MISSISSIPPI', 'MISSOURI', 'MONTANA', 'NEBRASKA', 'NEVADA', 'NEW HAMPSHIRE', 'NEW JERSEY', 'NEW MEXICO', 'NEW YORK', 'NORTH CAROLINA', 'NORTH DAKOTA', 'OHIO', 'OKLAHOMA', 'OREGON', 'PENNSYLVANIA', 'RHODE ISLAND', 'SOUTH CAROLINA', 'SOUTH DAKOTA', 'TENNESSEE', 'TEXAS', 'UTAH', 'VERMONT', 'VIRGINIA', 'WASHINGTON', 'WEST VIRGINIA', 'WISCONSIN', 'WYOMING'];\n var stateAbbr = ['AZ', 'AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'FL', 'GA', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'];\n\n if (stateAbbr.indexOf(state.toUpperCase()) > -1) return state;\n var stateNameIdx = stateNames.indexOf(state.toUpperCase());\n if (stateNameIdx > -1) return stateAbbr[stateNameIdx];\n return '';\n }\n\n return {\n\n all: function all() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return new _promise2.default(function (resolve, reject) {\n return (0, _util.sendRequest)('dispensaries', options, resolve, reject, _util.handleResult);\n });\n },\n\n dispensary: function dispensary(state, city, slug) {\n return new _promise2.default(function (resolve, reject) {\n if (!state) return reject(new Error('State is required'));\n var validState = validateState(state);\n if (!validState) return reject(new Error('Invalid State'));\n if (!city) return reject(new Error('City is required.'));\n if (!slug) return reject(new Error('Slug is required.'));\n return (0, _util.sendRequest)('dispensaries/' + validState + '/' + city + '/' + slug, null, resolve, reject, _util.handleResult);\n });\n },\n\n strains: function strains(state, city, slug) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n return new _promise2.default(function (resolve, reject) {\n if (!state) return reject(new Error('State is required'));\n var validState = validateState(state);\n if (!validState) return reject(new Error('Invalid State'));\n if (!city) return reject(new Error('City is required.'));\n if (!slug) return reject(new Error('Slug is required.'));\n return (0, _util.sendRequest)('dispensaries/' + validState + '/' + city + '/' + slug + '/strains', options, resolve, reject, _util.handleResult);\n });\n },\n\n extracts: function extracts(state, city, slug) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n return new _promise2.default(function (resolve, reject) {\n if (!state) return reject(new Error('State is required'));\n var validState = validateState(state);\n if (!validState) return reject(new Error('Invalid State'));\n if (!city) return reject(new Error('City is required.'));\n if (!slug) return reject(new Error('Slug is required.'));\n return (0, _util.sendRequest)('dispensaries/' + validState + '/' + city + '/' + slug + '/extracts', options, resolve, reject, _util.handleResult);\n });\n },\n\n edibles: function edibles(state, city, slug) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n return new _promise2.default(function (resolve, reject) {\n if (!state) return reject(new Error('State is required'));\n var validState = validateState(state);\n if (!validState) return reject(new Error('Invalid State'));\n if (!city) return reject(new Error('City is required.'));\n if (!slug) return reject(new Error('Slug is required.'));\n return (0, _util.sendRequest)('dispensaries/' + validState + '/' + city + '/' + slug + '/edibles', options, resolve, reject, _util.handleResult);\n });\n },\n\n products: function products(state, city, slug) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n return new _promise2.default(function (resolve, reject) {\n if (!state) return reject(new Error('State is required'));\n var validState = validateState(state);\n if (!validState) return reject(new Error('Invalid State'));\n if (!city) return reject(new Error('City is required.'));\n if (!slug) return reject(new Error('Slug is required.'));\n return (0, _util.sendRequest)('dispensaries/' + validState + '/' + city + '/' + slug + '/products', options, resolve, reject, _util.handleResult);\n });\n }\n\n };\n}", "title": "" }, { "docid": "1639ae2a6dcffe9803f9fa3c59bff951", "score": "0.50343025", "text": "function changeTitle(s) {\n\n\tvar lineTitle = d3.select(s).selectAll('.title.station');\n\tvar lineText = lineTitle\n\t\t.text();\n\n\tvar lineText = lineText.substr(0, lineText.indexOf(':')) + ': ';\n\tlineTitle.text(lineText + selectStation);\n\n}", "title": "" }, { "docid": "c7bfec372c77c8e87397a4e9a27fe7a7", "score": "0.50336784", "text": "toggleActiveClass(index, e) {\n e.preventDefault();\n let active = e.target;\n let rect = active.getBoundingClientRect();\n let amPm = '';\n\n console.log(this.state.hours);\n \n console.log(this.state.amPm);\n this.setState({\n activeIndex: index,\n activeClick: !this.state.activeClick,\n activeCity: e.target.textContent,\n hours: useAmOrPm(amPm, this.state.hours),\n firstLinkActive: false,\n linePosition: rect.left,\n lineWidth: rect.width,\n transitionFx: true,\n });\n\n\n let activeCity = active.textContent; // get the string of the active city: i.e 'New York City'\n this.getSelectedCityTimeZone(activeCity);\n }", "title": "" }, { "docid": "7de855464fda161951698d83f36266c4", "score": "0.5027814", "text": "function findState(address) {\n\t\n\t//statesLayer_civic.setMap(map);\n\t\n\t\n\t\tvar row = address.row;\n\t\tfor (var x in row) {\n\t\t\t\t if (row.hasOwnProperty('name')){\n\t\t\t\t\t myHtml = row['name'].value;\n\t\t\t\t }\n\t\t\t }\n\t //Get a click to return a state name as myHtml\n\t\t\tvar addressStr=myHtml;\n\t\t\t\n if (!address && (addressStr != '')) \n address = \"State of \"+addressStr;\n\t else \n address = addressStr;\n if ((address != '') && (address != 'Alaska') && geocoder) {\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {\n if (results && results[0]\n\t && results[0].geometry && results[0].geometry.viewport) \n map.fitBounds(results[0].geometry.viewport);\n } else {\n alert(\"No results found\");\n }\n } else {\n alert(\"Geocode was not successful for the following reason: \" + status);\n\t \t\t}\n\t\t\t}\n\t\t)\n\t }\n\t//This makes the MSALayer appear after the map zooms in\t \n\t\tMSALayer.setMap(map);\n\t\t\t document.getElementById('info').innerHTML=myHtml; \n \t}", "title": "" }, { "docid": "81ebe0b861eea29676e5229930888f87", "score": "0.50222564", "text": "update(x, y, name, value)\r\n {\r\n scope.state[y][x][name] = value;\r\n }", "title": "" }, { "docid": "40d0cd008a3e4c55b2b6863750be5546", "score": "0.5009624", "text": "alarm_update_state_badges_display(state) {\n\t\t// Hide all state bades\n\t\tname = this.name\n\t\tthis.states.forEach(function(item){\n\t\t\tvar badge_div_id = '#div_alarm_state' + '_' + item +'_' + name\n\t\t\t$(badge_div_id).hide();\n\t\t});\n\t\t// Show the current state badge\n\t\tvar badge_div_id = '#div_alarm_state'+'_'+ state +'_' + name\n\t\t$(badge_div_id).show();\n\t}", "title": "" }, { "docid": "4cf399aadb6e7f4633325cea384a6596", "score": "0.5004926", "text": "function assertStateAbbrev(inputState)\n{\n\tif (inputState)\n\t{\n\t\tif (inputState.length > 2)\n\t\t{\n\t\t\tfor (var i = 0; i < allStates.length; i++)\n\t\t\t{\n\t\t\t\tif (inputState.toUpperCase() == allStates[i].toUpperCase())\n\t\t\t\t{\n\t\t\t\t\treturn allStateAbbrev[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn inputState.toUpperCase();\n\t}\n\treturn inputState;\n}", "title": "" }, { "docid": "91148403fb1edd6c345b227f0a780749", "score": "0.49997848", "text": "function setStationTitle(){\n var stationID = getQueryString(\"station\");\n var newTitle = mapGIDtoGName[mapSIDtoNID[stationID]]+\"-\"+mapSIDtoSName[stationID];\n $(\"#spnTitle\").text(newTitle);\n document.title = \"DQA \"+newTitle;\n}", "title": "" }, { "docid": "2e62394de9b2438f97ffc63008437d67", "score": "0.49987397", "text": "changeTitle() {\n this.titleString = `Life: A Metaphor.`;\n this.nextStateTimer = setTimeout(this.nextState.bind(this), 3000);\n }", "title": "" }, { "docid": "7c6e2ea9654ed760ebf361f8e7c3155a", "score": "0.49940816", "text": "function updateToolTip(chosenYAxis,chosenXAxis,stateCircles,stateText) {\n \n //Initialize tool tip\n var toolTip = d3.tip()\n .attr(\"class\",\"d3-tip\")\n .offset([80, -60])\n .html( d => {\n if(chosenXAxis === \"poverty\")\n return (`${d.state}<br>${chosenYAxis}:${d[chosenYAxis]}% \n <br>${chosenXAxis}:${d[chosenXAxis]}%`)\n else if (chosenXAxis === 'income')\n return (`${d.state}<br>${chosenYAxis}:${d[chosenYAxis]}% \n <br>${chosenXAxis}:$${d[chosenXAxis]}`)\n else\n return (`${d.state}<br>${chosenYAxis}:${d[chosenYAxis]}% \n <br>${chosenXAxis}:${d[chosenXAxis]}`)\n });\n // Create tooltip in the chart\n stateCircles.call(toolTip);\n // Create event listeners to display and hide the tooltip\n stateCircles.on('mouseover', toolTip.show).on('mouseout', toolTip.hide);\n \n d3.selectAll('.stateText').call(toolTip);\n d3.selectAll('.stateText').on('mouseover', toolTip.show).on('mouseout', toolTip.hide);\n \n return stateCircles;\n return stateText;\n }", "title": "" }, { "docid": "0f855e6af6f1bc0a4690cb38ac9d712e", "score": "0.49821022", "text": "function createAccompanyingText(d) {\n\n var iState;\n var nGuns = 0; // number of the guns traced to the current state\n var nTotGuns = 0; // number of guns traced in all states\n var nStates = 0; // number of states where guns were traced\n\n if (d != null) {\n iState = Number(d.id)-1;\n var stateName = gunTraceData.states[iState].name;\n\n for (var k in gunTraceData.states) {\n for (var j in gunTraceData.states[k].data) {\n nTotGuns += gunTraceData.states[k].data[j];\n if (k == iState) {\n nGuns += gunTraceData.states[k].data[j];\n\n if (gunTraceData.states[k].data[j] > 0) {\n nStates++;\n }\n }\n }\n }\n document.getElementById(\"displayStateDetails\").setAttribute(\"style\",\"visibility: visible;\");\n document.getElementById(\"displayStateTable\").setAttribute(\"style\",\"visibility: visible;\");\n document.getElementById(\"stateName\").innerHTML = stateName;\n document.getElementById(\"originState\").innerHTML = stateName;\n document.getElementById(\"numGunsTraced\").innerHTML = nmbFormatter(nGuns);\n document.getElementById(\"pctAllTracedGuns\").innerHTML = pctFormatter(nGuns, nTotGuns);\n document.getElementById(\"gunsPerCapita\").innerHTML = nmbFormatter(nGuns/gunTraceData.states[iState].population * 100000,2);\n displayGunTraceList(iState);\n }\n}", "title": "" }, { "docid": "a20aa0997b8e88c42c62275875ac8aa5", "score": "0.49786", "text": "textAnchorTween(a) {\n var i = d3.interpolate({ x0: a.x0_s, x1: a.x1_s }, a);\n return (t) => {\n var b = i(t);\n a.x0_s = b.x0;\n a.x1_s = b.x1;\n return this.calculateTextAnchor(b);\n };\n }", "title": "" }, { "docid": "b0e4279b2f35ffdc9bd8f54979d9033f", "score": "0.4970025", "text": "function setActiveChapter(chapterName) {\n if (chapterName === activeChapterName) return;\n\n // setting the new active country to the active color\n if (chapterName !== 'africa') {\n map.setPaintProperty(chapterName, 'fill-color', colorActive);\n }\n if (oldChapter !== 'africa') {\n //setting the previous country to the inactive color\n map.setPaintProperty(oldChapter, 'fill-color', colorNotActive);\n }\n\n //Moving camera to new country\n map.flyTo(mapLocations[chapterName].camera);\n\n //document.getElementById(chapterName).setAttribute('class', 'active');\n //document.getElementById(activeChapterName).setAttribute('class', '');\n\n activeChapterName = chapterName;\n activeRedCrossWork = ''; // setting this so that when you scroll backwards red cross work numbers still appear\n\n // fade out previous number and then fade in new numbers\n var needHtml = countDiv + mapLocations[chapterName].inNeed + needText;\n var foodHtml = countDiv + mapLocations[chapterName].foodNeed + foodText;\n var idpHtml = countDiv + mapLocations[chapterName].idp + idpText;\n \n setNumberCountUp(chapterName, needHtml, 'inNeed', foodHtml, 'foodNeed', idpHtml, 'idp', 10);\n\n oldChapter = chapterName;\n}", "title": "" }, { "docid": "67c24af3fcfe6fd8fd4fa8cf60fb8b1a", "score": "0.49694505", "text": "setCurrentStepTitle(state, currentStepTitle) { \r\n state.currentStepTitle = currentStepTitle;\r\n }", "title": "" }, { "docid": "5abba0155530a989e30eba0a9f3147f7", "score": "0.49636656", "text": "function changeAttribution() {\n var attributionHTML = $('.leaflet-control-attribution')[0].innerHTML;\n var credit = 'Developed by <a href=\"https://farazahmed95.github.io/site/\" target=\"_blank\" />Faraz Ahmed</a>'; \n credit += ' | Map: ' ;\n $('.leaflet-control-attribution')[0].innerHTML = credit + attributionHTML;\n }", "title": "" }, { "docid": "7dbae0b02176c49cc4ee5d5a822e4c3a", "score": "0.4961691", "text": "function locationUpdate() {\n link\n .transition()\n .attr(\"x1\", function(d) { return d.source.x - viewportX; }) \n .attr(\"y1\", function(d) { return d.source.y - viewportY; })\n .attr(\"x2\", function(d) { return d.target.x - viewportX; })\n .attr(\"y2\", function(d) { return d.target.y - viewportY; });\n\n node\n .selectAll(\"circle\")\n .transition()\n .attr(\"transform\", function(d) { return \"translate(\" + (d.x - viewportX) + \",\" + (d.y - viewportY) + \")\"; });\n\n node\n .selectAll(\"text\")\n .text(function(d) { return d.name })\n .transition()\n .attr(\"transform\", function(d) { \n return \"translate(\" + (d.x - viewportX - 10) + \",\" \n + (d.y-viewportY) + \")\"; \n });\n}", "title": "" }, { "docid": "34b69a5a5d3fadc5a9082d94d46c0043", "score": "0.49612948", "text": "function updateUrl() {\n // Do this instead of directly setting window.location.hash to prevent adding extra history entries\n /*var baseUrl = window.location.origin + '/basic-income-basic-job/local/';\n var url = baseUrl + '#' + encodeURIComponent(state.regionName + ',' + state.basicIncome + ',' + numAdults + ',' + state.laborForce + ',' + state.disabledAdults);\n if (window.location.pathname.indexOf('local') >= 0) {\n window.location.replace(url);\n }\n document.getElementById('permalink').value = 'Permalink not implemented yet, but eventually this will link to a self-contained mini-page';*/\n }", "title": "" }, { "docid": "0b97bf61ec921b263bb13c630bd9608b", "score": "0.49592215", "text": "function fixStateName(state){\n if(state.parent){\n state.name = state.parent.name + '.' + state.name;\n }\n }", "title": "" }, { "docid": "767a4460c436826a9157beb6f9fa453a", "score": "0.49578908", "text": "updateLabelText() { }", "title": "" }, { "docid": "41e447d38063ce1f14d869cf6244f6ae", "score": "0.4957573", "text": "function tooltip(state) {\n data = data_main;\n var row = data.filter(function (d) {\n return d.abbrev == state;\n });\n\n row.forEach(function (d) {\n d3.selectAll(\".tt-name\").text(d.state);\n d3.selectAll(\".tt_approp_percap15\").text(formatmoney(+d.approp_percap15));\n d3.select(\"#tt_fundingperthousinc\").text(formatdollars(+d.fundingperthousinc));\n d3.select(\"#tt_grants_needbased\").text(formatmoney(+d.grants_needbased));\n d3.select(\"#tt_grants_nonneedbased\").text(formatmoney(+d.grants_nonneedbased));\n d3.select(\"#tt_approp_15\").text(formatfunding(+d.approp_15));\n d3.select(\"#tt_approp0115\").text(formatpct(+d.approp0115));\n d3.select(\"#tt_approp_percap0115\").text(formatpct(+d.approp_percap0115));\n });\n}", "title": "" }, { "docid": "acfb194ad7ec13b40966d1b05dfd1315", "score": "0.4950943", "text": "function showMeaning() {\n /* == Keep in mind: ==\n This function launches after the next word is ready (index++)\n Reason: it launches onmouseover only\n That is why: 'dict[keys[indexes[index-1]]]' (-1!)\n */\n\n sub.innerHTML = dict[keys[indexes[index-1]]];\n }", "title": "" }, { "docid": "85816e01c562054454f4f470480e901b", "score": "0.49495122", "text": "function stateChanged() {\n window.location = \"/cities-and-states-01/\" + this.value;\n}", "title": "" }, { "docid": "41b25d83a6d0608b284c4d6a447d3c9f", "score": "0.494597", "text": "function setupUsStateMap() {\n $('#show-us-map-container').click(function() {\n $('#map-intro').hide();\n $('#us-map-container').show();\n drawUsStatesWithLabels();\n })\n\n $('#start-us-state-map-quiz').click(function() {\n $('#us-map-container').find(\"svg\").remove();\n setupUsStateQuiz();\n drawUsStatesForQuiz();\n })\n}", "title": "" }, { "docid": "b83e6ecc5843f3dce7612477cd8442cf", "score": "0.49361828", "text": "function createAccompanyingText(d) {\n\n var iState;\n var nGuns = 0; // number of the guns traced to the current state\n var nTotGuns = 0; // number of guns traced in all states\n var nStates = 0; // number of states where guns were traced\n\n if (d != null) {\n iState = Number(d.id)-1;\n var stateName = gunTraceData.states[iState].name;\n\n for (var k in gunTraceData.states) {\n for (var j in gunTraceData.states[k].data) {\n nTotGuns += gunTraceData.states[k].data[j];\n if (k == iState) {\n nGuns += gunTraceData.states[k].data[j];\n\n if (gunTraceData.states[k].data[j] > 0) {\n nStates++;\n }\n }\n }\n }\n document.getElementById(\"displayStateDetails\").setAttribute(\"style\",\"visibility: visible;\");\n document.getElementById(\"displayStateTable\").setAttribute(\"style\",\"visibility: visible;\");\n document.getElementById(\"stateName\").innerHTML = stateName;\n document.getElementById(\"originState\").innerHTML = stateName;\n document.getElementById(\"stateOfOrigin\").innerHTML = stateName;\n document.getElementById(\"numGunsTraced\").innerHTML = nmbFormatter(nGuns);\n document.getElementById(\"pctAllTracedGuns\").innerHTML = pctFormatter(nGuns, nTotGuns);\n document.getElementById(\"gunsPerCapita\").innerHTML = nmbFormatter(nGuns/gunTraceData.states[iState].population * 100000,2);\n createTop10Table(iState);\n }\n}", "title": "" }, { "docid": "4daec9b13b3ca6604214d3a2d74c1270", "score": "0.49315023", "text": "function state(loc) {\n if (state_revealed.hasOwnProperty(loc)) {\n return state_revealed[loc]\n } else {\n var targetNode = document.getElementById(loc);\n if (square_states[targetNode.className] == \"flagged\" || square_states[targetNode.className] > -1) {\n state_revealed[loc] = square_states[targetNode.className];\n return state_revealed[loc];\n }\n return square_states[targetNode.className];\n }\n}", "title": "" }, { "docid": "b6dabbb3f18b0fa146c91ca454a7eee6", "score": "0.49287644", "text": "function changeLocation(){\r\n var randyChange = document.getElementById('randy').value;\r\n allUnicorns[0].location = randyChange;\r\n\r\n var sallyChange = document.getElementById('sally').value;\r\n allUnicorns[1].location = sallyChange;\r\n\r\n var patsyChange = document.getElementById('patsy').value;\r\n allUnicorns[2].location = patsyChange;\r\n\r\n unicornTable.innerHTML = '';\r\n renderHeader();\r\n renderAll();\r\n saveUnicornStatus();\r\n}", "title": "" }, { "docid": "00fdc8ed58bac8dd3b357a1bd05c131c", "score": "0.492244", "text": "function byLocationEnter(index){\n\t\n\n\t$(\"#location\"+index+\">div>.mapLocation-centeredImgTextBg\").css(\"opacity\",\"0\");\n\n\t$(\"#location\"+index+\">.mapLocation-centeredImgText\").stop().animate({\"top\":$(\"#location\"+index).height()/2-50+\"px\"},300);\n\t\n\t$(\"#location\"+index+\">.mapLocation-buttonHolder\").css(\"display\",\"block\");\n\t$(\"#location\"+index+\">.mapLocation-buttonHolder\").stop().animate({\"top\":\"60%\",\"opacity\":\"1\"},300);\n\t\n\n\n}", "title": "" }, { "docid": "8496337933bdf9fc72aacb5cfb4c2879", "score": "0.49224114", "text": "update() {\n if (this.stateStr.length === 0) {\n return;\n }\n this.tipLabel.string = `${this.stateStr} `;\n if (this.isLoading) {\n this.tipLabel.string += `${Math.floor(this.progress * 100)}%`;\n } else {\n const t = Math.floor(Date.now() / 1000) % 4;\n for (let i = 0; i < t; ++i) {\n this.tipLabel.string += '.';\n }\n }\n }", "title": "" } ]
763ffbee1d20496e43af7a1bc434ee43
Update the view UI by applying the change of focused item
[ { "docid": "95cd3315ebef24429fe7e95ca6585fcf", "score": "0.63653827", "text": "refreshFocus() {\n const index = Math.round((this.focused - this.start) / 86400000);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }", "title": "" } ]
[ { "docid": "c874c4e8d22f4965dfe0d1d6a2241eb8", "score": "0.69739324", "text": "_updateFocus() {\n\t\tif ( this.isFocused ) {\n\t\t\tconst editable = this.selection.editableElement;\n\n\t\t\tif ( editable ) {\n\t\t\t\tthis.domConverter.focus( editable );\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "40bffdeb289fa6586c8b7157f7d7bb1d", "score": "0.69676596", "text": "function focus() {\n var input = this;\n // Remove old bindings.\n focused && $(focused).unbind('keyup', farb.updateValue)\n .unbind('keyup', preview).unbind('keyup', resetScheme)\n .parent().removeClass('item-selected');\n\n // Add new bindings.\n focused = this;\n farb.linkTo(function (color) { callback(input, color, true, false); });\n farb.setColor(this.value);\n $(focused).keyup(farb.updateValue).keyup(preview).keyup(resetScheme)\n .parent().addClass('item-selected');\n }", "title": "" }, { "docid": "bdff30fb57ec07d0ce24e857120481af", "score": "0.67857707", "text": "activateFocus() {\n this.isFocused_ = true;\n this.styleFocused_(this.isFocused_);\n this.adapter_.activateLineRipple();\n this.notchOutline(this.shouldFloat);\n if (this.adapter_.hasLabel()) {\n this.adapter_.shakeLabel(this.shouldShake);\n this.adapter_.floatLabel(this.shouldFloat);\n }\n if (this.helperText_) {\n this.helperText_.showToScreenReader();\n }\n }", "title": "" }, { "docid": "fe64688d622e51e92603ab49f87335fc", "score": "0.6729387", "text": "activateFocus() {\n this.isFocused_ = true;\n this.styleFocused_(this.isFocused_);\n this.adapter_.activateLineRipple();\n if (this.outline_) {\n this.updateOutline();\n }\n if (this.label_) {\n this.label_.styleShake(this.isValid(), this.isFocused_);\n this.label_.styleFloat(\n this.getValue(), this.isFocused_, this.isBadInput_());\n }\n if (this.helperText_) {\n this.helperText_.showToScreenReader();\n }\n }", "title": "" }, { "docid": "c2e7a8b51e19ca3187eae196aab5cc5b", "score": "0.6657822", "text": "activateFocus() {\n this.isFocused_ = true;\n this.styleFocused_(this.isFocused_);\n this.adapter_.activateLineRipple();\n this.notchOutline(this.shouldFloat);\n if (this.adapter_.hasLabel()) {\n this.adapter_.shakeLabel(this.shouldShake);\n this.adapter_.floatLabel(this.shouldFloat);\n }\n if (this.helperText_) {\n this.helperText_.showToScreenReader();\n }\n }", "title": "" }, { "docid": "43d7011476161c6034f7295e2da01c9e", "score": "0.6603358", "text": "updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const first = startOfYearPeriod(viewDate, this.navStep);\n const last = first + 9 * this.step;\n \n this.first = first;\n this.last = last;\n this.start = first - this.step;\n this.focused = startOfYearPeriod(viewDate, this.step);\n }", "title": "" }, { "docid": "922d83ca19ac0b6a0bd18fbe55036a57", "score": "0.6540104", "text": "refreshFocus() {\n const index = Math.round((this.focused - this.start) / this.step);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }", "title": "" }, { "docid": "0367a0d05d26bbeee0dd34d14b9fc31f", "score": "0.6492932", "text": "refreshFocus() {\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[this.focused].classList.add('focused');\n }", "title": "" }, { "docid": "6c8fec7e46847bb9932602a79343c49d", "score": "0.64849454", "text": "refreshFocus() {\n const index = Math.round((this.focused - this.start) / 86400000);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }", "title": "" }, { "docid": "88d383d35e96bad69e36e7942df91ecf", "score": "0.64801323", "text": "function update_view()\n\t{\n\t\tvar item, offset;\n\n\t\tfor ( var i = 0 ; i < List.items.length ; i++ ) {\n\t\t\titem = List.items[i].get( Sprite );\n\n\t\t\tif ( !is_in_view( i ) ) {\n\t\t\t\titem.setAlpha( 0 );\n\t\t\t} else {\n\t\t\t\toffset = ( i - List.scroll );\n\n\t\t\t\titem\n\t\t\t\t\t.setAlpha( 1 )\n\t\t\t\t\t.setXY( 0, offset * List.spacing );\n\n\t\t\t\tif ( i === List.selection ) {\n\t\t\t\t\tList.highlight.get( Sprite )\n\t\t\t\t\t\t.setXY( 0, offset * List.spacing );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tupdate_scrollbar();\n\t}", "title": "" }, { "docid": "a90c36d821ac7c355126eeecb4294e71", "score": "0.6478738", "text": "updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n this.year = viewDate.getFullYear();\n this.focused = viewDate.getMonth();\n }", "title": "" }, { "docid": "6ce93a4be8df855d7f10aeb5c71c894b", "score": "0.64657205", "text": "_updateFocus(origin) {\n this.focused = origin !== null;\n this.stateChanges.next();\n }", "title": "" }, { "docid": "b4fc810478a3482075ae5ebf84b01472", "score": "0.6462301", "text": "updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const first = startOfYearPeriod(viewDate, this.navStep);\n const last = first + 9 * this.step;\n\n this.first = first;\n this.last = last;\n this.start = first - this.step;\n this.focused = startOfYearPeriod(viewDate, this.step);\n }", "title": "" }, { "docid": "29ddb59027a3938091312123f7094604", "score": "0.6412047", "text": "refreshFocus() {\n const index = Math.round((this.focused - this.start) / this.step);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }", "title": "" }, { "docid": "29ddb59027a3938091312123f7094604", "score": "0.6412047", "text": "refreshFocus() {\n const index = Math.round((this.focused - this.start) / this.step);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }", "title": "" }, { "docid": "e00cf7be4ca9b602e19b4f64983bab65", "score": "0.6404901", "text": "_setFocusedOption(option) {\n this._keyManager.updateActiveItem(option);\n }", "title": "" }, { "docid": "f7bfd01f6ce6f369aa7082be14c553eb", "score": "0.63829166", "text": "refreshFocus() {\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[this.focused].classList.add('focused');\n }", "title": "" }, { "docid": "f7bfd01f6ce6f369aa7082be14c553eb", "score": "0.63829166", "text": "refreshFocus() {\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[this.focused].classList.add('focused');\n }", "title": "" }, { "docid": "7114f5db34643930d4ac2eb8a06dd717", "score": "0.6379919", "text": "updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const viewYear = viewDate.getFullYear();\n const viewMonth = viewDate.getMonth();\n const firstOfMonth = dateValue(viewYear, viewMonth, 1);\n const start = dayOfTheWeekOf(firstOfMonth, this.weekStart, this.weekStart);\n \n this.first = firstOfMonth;\n this.last = dateValue(viewYear, viewMonth + 1, 0);\n this.start = start;\n this.focused = this.picker.viewDate;\n }", "title": "" }, { "docid": "132106a49cf08ee598fd7c7dcc259256", "score": "0.63601214", "text": "focusItem() {\n this.options[this.focusIndex].focus();\n }", "title": "" }, { "docid": "7d39ec53ff3bd083b3d4540a64453cb9", "score": "0.6330901", "text": "changeFocus(newViewDate) {\n this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refreshFocus';\n this.views.forEach((view) => {\n view.updateFocus();\n });\n return this;\n }", "title": "" }, { "docid": "7d39ec53ff3bd083b3d4540a64453cb9", "score": "0.6330901", "text": "changeFocus(newViewDate) {\n this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refreshFocus';\n this.views.forEach((view) => {\n view.updateFocus();\n });\n return this;\n }", "title": "" }, { "docid": "dbb211e334de3a62e99a70de408c64a4", "score": "0.63240933", "text": "componentWillUpdate() {\n if (this.base.contains(document.activeElement)) {\n this.focusElement = document.activeElement;\n }\n }", "title": "" }, { "docid": "ecdf0b629a4a90cdb4b006470891cd61", "score": "0.63178277", "text": "changeFocus(newViewDate) {\n this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refreshFocus';\n this.views.forEach((view) => {\n view.updateFocus();\n });\n return this;\n }", "title": "" }, { "docid": "f301aa071af16b05c267b279bef7de14", "score": "0.6299488", "text": "selectFocused() {\n this._tabs[this._focusIndex].selectItem();\n }", "title": "" }, { "docid": "f9092878cace9d80ad5a5332ec985533", "score": "0.6294947", "text": "updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const viewYear = viewDate.getFullYear();\n const viewMonth = viewDate.getMonth();\n const firstOfMonth = dateValue(viewYear, viewMonth, 1);\n const start = dayOfTheWeekOf(firstOfMonth, this.weekStart, this.weekStart);\n\n this.first = firstOfMonth;\n this.last = dateValue(viewYear, viewMonth + 1, 0);\n this.start = start;\n this.focused = this.picker.viewDate;\n }", "title": "" }, { "docid": "029c5ca9c70aa68e3656a5a7ea3a8569", "score": "0.627702", "text": "componentDidUpdate() {\n this.isFocused = false;\n }", "title": "" }, { "docid": "be72ed0cffea4245a89837698c697b5f", "score": "0.62338907", "text": "updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n this.year = viewDate.getFullYear();\n this.focused = viewDate.getMonth();\n }", "title": "" }, { "docid": "be72ed0cffea4245a89837698c697b5f", "score": "0.62338907", "text": "updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n this.year = viewDate.getFullYear();\n this.focused = viewDate.getMonth();\n }", "title": "" }, { "docid": "bf649d77300994075832b83ae26051c4", "score": "0.6185521", "text": "setInputFocused (state) {\n state['focus'] = true\n }", "title": "" }, { "docid": "566ab6e23b078128b353d3bd217ab608", "score": "0.61685985", "text": "updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const first = (0,_lib_date_js__WEBPACK_IMPORTED_MODULE_1__.startOfYearPeriod)(viewDate, this.navStep);\n const last = first + 9 * this.step;\n\n this.first = first;\n this.last = last;\n this.start = first - this.step;\n this.focused = (0,_lib_date_js__WEBPACK_IMPORTED_MODULE_1__.startOfYearPeriod)(viewDate, this.step);\n }", "title": "" }, { "docid": "a05a8f358364b59fd5f506be9e46b8a6", "score": "0.61560464", "text": "componentDidUpdate() {\n this._container.focus();\n }", "title": "" }, { "docid": "681342b9f5ea1e8d472145e8635d0980", "score": "0.61338943", "text": "edit_focus() {\n // Stop the poll timer so the display does not bump\n // it may take several seconds for the user to change the value\n app.stop_timer();\n }", "title": "" }, { "docid": "dcc98c027b771666b6cee322642846ea", "score": "0.61194634", "text": "function selectedItemChange(selectedItem, previousSelectedItem) {\n\n if (selectedItem) {\n if (self.displayProperty) {\n self.searchText = selectedItem[self.displayProperty];\n\n }\n }\n else if (previousSelectedItem && self.searchText) {\n if (previousSelectedItem[self.displayProperty] === self.searchText) {\n self.searchText = '';\n hasFocus = false;\n }\n }\n\n if (selectedItem !== previousSelectedItem) announceItemChange();\n\n\n\n\n }", "title": "" }, { "docid": "a57ae94ff41a3369a14a19f5c950fd2b", "score": "0.6094935", "text": "_updateFocusForDestroyedChips() {\n // Move focus to the closest chip. If no other chips remain, focus the chip-list itself.\n if (this._lastDestroyedChipIndex != null) {\n if (this.chips.length) {\n const newChipIndex = Math.min(this._lastDestroyedChipIndex, this.chips.length - 1);\n this._keyManager.setActiveItem(newChipIndex);\n }\n else {\n this.focus();\n }\n }\n this._lastDestroyedChipIndex = null;\n }", "title": "" }, { "docid": "a57ae94ff41a3369a14a19f5c950fd2b", "score": "0.6094935", "text": "_updateFocusForDestroyedChips() {\n // Move focus to the closest chip. If no other chips remain, focus the chip-list itself.\n if (this._lastDestroyedChipIndex != null) {\n if (this.chips.length) {\n const newChipIndex = Math.min(this._lastDestroyedChipIndex, this.chips.length - 1);\n this._keyManager.setActiveItem(newChipIndex);\n }\n else {\n this.focus();\n }\n }\n this._lastDestroyedChipIndex = null;\n }", "title": "" }, { "docid": "bad1ff801c926a8504f355478e67605f", "score": "0.60813004", "text": "function setFocus() {\n ctrl.inputFocused = true;\n\n if (angular.isFunction(ctrl.itemFocusCallback)) {\n ctrl.itemFocusCallback({ inputName: ctrl.inputName });\n }\n }", "title": "" }, { "docid": "e60cecf81b1654b7f7f52eda2ce153a6", "score": "0.607914", "text": "focusin() {\n this.focused = true;\n this.cdr.detectChanges();\n }", "title": "" }, { "docid": "1cb31dd956310e923f002d7bbdff1539", "score": "0.6062579", "text": "function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }", "title": "" }, { "docid": "1cb31dd956310e923f002d7bbdff1539", "score": "0.6062579", "text": "function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }", "title": "" }, { "docid": "1cb31dd956310e923f002d7bbdff1539", "score": "0.6062579", "text": "function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }", "title": "" }, { "docid": "1cb31dd956310e923f002d7bbdff1539", "score": "0.6062579", "text": "function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }", "title": "" }, { "docid": "1cb31dd956310e923f002d7bbdff1539", "score": "0.6062579", "text": "function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }", "title": "" }, { "docid": "1cb31dd956310e923f002d7bbdff1539", "score": "0.6062579", "text": "function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }", "title": "" }, { "docid": "0018b2d121d41d4a2013d9c436a95c66", "score": "0.60530376", "text": "if (this.shouldBeFocused) {\n this.focus();\n }", "title": "" }, { "docid": "a57c3e5ba3af9aff19e740fd1fd810db", "score": "0.60287285", "text": "onComponentFocusChanged() {\n\t\t$(ReactDOM.findDOMNode(this.refs.normalLine)).toggleClass('focus');\n\t\t$(ReactDOM.findDOMNode(this.refs.focusLine)).toggleClass('focus');\n\t}", "title": "" }, { "docid": "baa658367883fc2a48b8c065b1e2f829", "score": "0.6021659", "text": "updateSelectedItem() {\n if (!this.slottedItems)\n return;\n this.slottedItems.forEach((item, index) => {\n // TODO(b/265209253): implement\n // item.itemId = `${this.itemIdPrefix}-${index}`;\n if (this.selectedItem && item === this.selectedItem && this.list) {\n item.ariaSelected = 'true';\n // Scroll into view\n if (this.list.scrollTop + this.list.offsetHeight <\n item.offsetTop + item.offsetHeight) {\n this.list.scrollTop =\n item.offsetTop + item.offsetHeight - this.list.offsetHeight;\n }\n else if (this.list.scrollTop > item.offsetTop + 2) {\n this.list.scrollTop = item.offsetTop;\n }\n }\n else {\n item.ariaSelected = 'false';\n }\n });\n }", "title": "" }, { "docid": "eba57bbb87c83025045ae1f72918bc9f", "score": "0.5997507", "text": "function focusItem(elm) {\n var tree = elm.closest('.treevue');\n if (tree.length === 1) {\n tree.find('.' + focusClass).removeClass(focusClass).attr(\n 'tabindex', -1);\n \n elm.focus().attr('tabindex', 0).\n addClass(focusClass);\n \n // Move the tree fallback\n tree.find('.treevue_fallback').detach().prependTo(elm);\n }\n }", "title": "" }, { "docid": "a3af13296dd3997a7cf4113bcbc366b9", "score": "0.59972835", "text": "onWillFocus() {\n }", "title": "" }, { "docid": "b2343d1b91ab9317d6d69b4d3ecf3293", "score": "0.59915423", "text": "_updateStateOnClick() {\n const that = this;\n\n that._changeCheckState();\n that.focus();\n }", "title": "" }, { "docid": "0eb5d6d5b0be7fac76f057cc3fe6c891", "score": "0.59848064", "text": "function handleFocus() {\n if (onFocus) {\n onFocus();\n }\n\n if (!isSelected) {\n // We know for certain that on focus, the old selection is invalid.\n // It will be recalculated on the next mouseup, keyup, or touchend\n // event.\n var index = undefined;\n record.current = _objectSpread(_objectSpread({}, record.current), {}, {\n start: index,\n end: index,\n activeFormats: EMPTY_ACTIVE_FORMATS\n });\n onSelectionChange(index, index);\n setActiveFormats(EMPTY_ACTIVE_FORMATS);\n } else {\n onSelectionChange(record.current.start, record.current.end);\n setActiveFormats((0,_get_active_formats__WEBPACK_IMPORTED_MODULE_19__.getActiveFormats)(_objectSpread(_objectSpread({}, record.current), {}, {\n activeFormats: undefined\n }), EMPTY_ACTIVE_FORMATS));\n } // Update selection as soon as possible, which is at the next animation\n // frame. The event listener for selection changes may be added too late\n // at this point, but this focus event is still too early to calculate\n // the selection.\n\n\n rafId.current = getWin().requestAnimationFrame(handleSelectionChange);\n getDoc().addEventListener('selectionchange', handleSelectionChange);\n\n if (setFocusedElement) {\n (0,_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_20__[\"default\"])('wp.blockEditor.RichText setFocusedElement prop', {\n alternative: 'selection state from the block editor store.'\n });\n setFocusedElement(instanceId);\n }\n }", "title": "" }, { "docid": "9bdce12352e846499204269d1a97528f", "score": "0.5977188", "text": "_setFocusOnOpen() {\n if (this.lastUserSelectedOption) {\n this._updateFocusedId(parseInt(this.lastUserSelectedOption.getAttribute('data-option-index'), 10));\n } else {\n this._moveFocusDown();\n }\n }", "title": "" }, { "docid": "be9add962963970b636b3d052ba8d712", "score": "0.59534127", "text": "function handleFocus() {\n if (tabState == 'blur')\n requestUpdate();\n tabState = 'focus';\n }", "title": "" }, { "docid": "bde125a88d72521c334ebaa3eab3a3d9", "score": "0.5935146", "text": "function onFocused(success) {\n if (success) {\n self.focused = true;\n done();\n } else {\n self.focused = false;\n done('failed');\n }\n }", "title": "" }, { "docid": "4b5a2fdf6ac1b6cfacf98bd346d6cf30", "score": "0.59242064", "text": "onFocus(event) {\n if (this.focused) return;\n\n this.focused = true;\n\n // Events are posted even if not interactive so that the board can track\n // the currently focused tile.\n this._emit({\n type: 'focus',\n target: this,\n });\n }", "title": "" }, { "docid": "a49ff1bdff88bd0e4eec59b31cee580d", "score": "0.59238803", "text": "didFocus () {\n this.getElement().classList.add('setting--focus')\n }", "title": "" }, { "docid": "c406c71b870f728b65ea80c62b5f7546", "score": "0.59209335", "text": "focus(position) {\n this.keyManager.setActiveItem(position);\n this.luxFocusedPositionChange.emit(position);\n this.luxFocusedItemChange.emit(this.keyManager.activeItem);\n this.previousFocusedPosition = position;\n }", "title": "" }, { "docid": "ea5f5da2dff006046aa872a25cd9ffeb", "score": "0.5918683", "text": "updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const viewYear = viewDate.getFullYear();\n const viewMonth = viewDate.getMonth();\n const firstOfMonth = (0,_lib_date_js__WEBPACK_IMPORTED_MODULE_1__.dateValue)(viewYear, viewMonth, 1);\n const start = (0,_lib_date_js__WEBPACK_IMPORTED_MODULE_1__.dayOfTheWeekOf)(firstOfMonth, this.weekStart, this.weekStart);\n\n this.first = firstOfMonth;\n this.last = (0,_lib_date_js__WEBPACK_IMPORTED_MODULE_1__.dateValue)(viewYear, viewMonth + 1, 0);\n this.start = start;\n this.focused = this.picker.viewDate;\n }", "title": "" }, { "docid": "f7861e6c74de3e93b29218481a59f443", "score": "0.59079164", "text": "function handleOnFocus() {\n setFocusing(true)\n }", "title": "" }, { "docid": "2e5d1d0864e0f66f2b199a877dc0673b", "score": "0.59078133", "text": "updateActiveLink() {\n if (!this._items) {\n return;\n }\n const items = this._items.toArray();\n for (let i = 0; i < items.length; i++) {\n if (items[i].active) {\n this.selectedIndex = i;\n this._changeDetectorRef.markForCheck();\n return;\n }\n }\n // The ink bar should hide itself if no items are active.\n this.selectedIndex = -1;\n this._inkBar.hide();\n }", "title": "" }, { "docid": "2e5d1d0864e0f66f2b199a877dc0673b", "score": "0.59078133", "text": "updateActiveLink() {\n if (!this._items) {\n return;\n }\n const items = this._items.toArray();\n for (let i = 0; i < items.length; i++) {\n if (items[i].active) {\n this.selectedIndex = i;\n this._changeDetectorRef.markForCheck();\n return;\n }\n }\n // The ink bar should hide itself if no items are active.\n this.selectedIndex = -1;\n this._inkBar.hide();\n }", "title": "" }, { "docid": "9470b49132835a88724174a389fab404", "score": "0.5907209", "text": "function activate(item) {\n //Evitar que se haga focus sobre los labels de progreso y duracion\n if(item.id == 'progress-lbl'|| item.id=='duration-lbl'){\n return;\n } \n // Set all of the buttons to tabindex -1\n toolbar.querySelectorAll('.player-buttons').forEach((btn) => btn.tabIndex = -1);\n // Make the current button \"active\"\n item.tabIndex = 0;\n item.focus();\n item.style.borderColor = 'red'; \n }", "title": "" }, { "docid": "1e80e6177d2df391e7cce8ebd743ac51", "score": "0.58716726", "text": "afterGuiAttached() {\n if (this._highlightAllOnFocus) {\n this._input.select()\n } else {\n if (this._focusAfterAttached) {\n this.focusIn()\n }\n }\n }", "title": "" }, { "docid": "4372e42c8f1d0d61a667af8d66144bc3", "score": "0.58625406", "text": "input_onfocus(e)\n {\n this.input_focused = true;\n if(!this.dropdown_widget.shown && !this.edit_widget.shown)\n this.show_history();\n }", "title": "" }, { "docid": "912d8dbaebc57743d7897b36f04d9619", "score": "0.5856323", "text": "componentDidUpdate() {\n this.refs.contentWrapper[this.props.isVisible ? 'focus' : 'blur']();\n }", "title": "" }, { "docid": "b981b771f5f3e724f906b39a0cb0863e", "score": "0.5849325", "text": "function updateAndNotifyFocus(key){\n\telementOnFocus = key;\n\n\tif(elementOnFocus==null) \n\t\tinitializeMap();\n\n\tif(operatorManager == null)\n\t\toperatorManager = new OperatorManager;\n\toperatorManager.changedFocus(elementOnFocus, false);\n}", "title": "" }, { "docid": "fa6887bc9c9fddc7e49f558a556224e8", "score": "0.5839974", "text": "focus() {\n\t\tthis.children.first.focus();\n\t}", "title": "" }, { "docid": "5e4291b383bd6d724741c2109dd42a97", "score": "0.5838072", "text": "function setPreviousFocusItem(item) {\r\n previousFocusItem = item;\r\n }", "title": "" }, { "docid": "83c9e1835c23954e0cc41aabb5b1a7a3", "score": "0.58377576", "text": "textHandler() {\n this.updateActiveItemIndex(-1);\n }", "title": "" }, { "docid": "59ab54e133f29ecf4fe6cb2280f57b5f", "score": "0.5836986", "text": "function focus(which_way) {\n\t\t\tvar i = 0,\n\t\t\t\thighlighted = $('.lnf-highlight')\n\t\t\t\twhere_to = 0;\n\n\t\t\t// If there isn't a focused item, make it the first one.\n\t\t\tif ( $('.lnf-focused-item').length === 0 ) {\n\t\t\t\twhich_way = 0;\n\t\t\t} else {\n\t\t\t\t// Get the index of the currently focused item.\n\t\t\t\ti = $.inArray( $('.lnf-focused-item .lnf-highlight')[0], highlighted );\n\t\t\t}\n\n\t\t\t// Make the selection wrap around to the beginning when hitting the end and vice versa\n\t\t\tif ( i+which_way < 0 ) { // when pressing up on the first item.\n\t\t\t\twhere_to = highlighted.length-1;\n\t\t\t} else if ( i+which_way > highlighted.length-1 ) { // when pressing down on the last item.\n\t\t\t\twhere_to = 0;\n\t\t\t} else { // otherwise it's safe to go to the next/previous item.\n\t\t\t\twhere_to = i+which_way;\n\t\t\t}\n\n\t\t\t// Remove the currently focused item.\n\t\t\t$('.lnf-focus, .lnf-focused-item').removeClass('lnf-focus').removeClass('lnf-focused-item');\n\n\t\t\t// Add the highlight class to the li that's highest up in the dom.\n\t\t\tvar parent_lis = $( $('.lnf-highlight').get(where_to) ).parents('li');\n\t\t\t$(parent_lis[parent_lis.length-1]).addClass('lnf-focus');\n\t\t\t// Also indicate which is the currently selected link (so the user can see where hitting the Enter key takes them.)\n\t\t\t$( $('.lnf-highlight').get(where_to) ).parents('a').addClass('lnf-focused-item');\n\t\t}", "title": "" }, { "docid": "da93af360d5271a89843e55f9ecf1dcc", "score": "0.58142704", "text": "function focusPreviousItem() {\n const item = document.activeElement;\n if (item.previousElementSibling) {\n if(item.previousElementSibling.id!='progress'){\n activate(item.previousElementSibling);\n desactivate(item);\n }\n }\n }", "title": "" }, { "docid": "3adef480c10f8701ec5ad29bd7b6e6c0", "score": "0.5812999", "text": "focus() {\n this.setFocus(0, 1);\n }", "title": "" }, { "docid": "b94378a435d27e47b9abd500263c389c", "score": "0.5810617", "text": "updateFocus_() {\n const state = this.computeState_();\n switch (state) {\n case State.SIM_LOCKED:\n if (this.$$('#unlockPinButton')) {\n this.$$('#unlockPinButton').focus();\n }\n break;\n case State.SIM_UNLOCKED:\n if (this.$$('#simLockButton')) {\n this.$$('#simLockButton').focus();\n }\n break;\n }\n }", "title": "" }, { "docid": "2ac8eaded93ccc9f8340c89f2d0017a2", "score": "0.580261", "text": "focusItemAtIndex(index){\n for (let x in this.refs) {\n if (this.refs[x].value === index) {\n this.refs[x].focus();\n }\n }\n }", "title": "" }, { "docid": "3a4a9a7bccd783fc03fae60d42f41a9b", "score": "0.57981914", "text": "focusInput() {\n this._displayState.forceFocus = true;\n this._displayState.searchInputFocused = true;\n // Trigger a rerender without resetting the forceFocus.\n this._displayUpdateSignal.emit(this._displayState);\n this._displayState.forceFocus = false;\n }", "title": "" }, { "docid": "9b13de787c063e1a760600633d5a2c53", "score": "0.57887954", "text": "update() \n {\n this.getData()\n .then(data => {\n const {modelName, pricing, modelDetails} = data\n // Remove any focused elements\n const activeElements = document.querySelectorAll(\".focusMini\")\n activeElements ? activeElements.forEach(el => {\n el.classList.remove(\"focusMini\")\n el.classList.add(\"nonActive\")\n }) : null\n\n this.imageElement.classList.add(\"focusMini\")\n\n this.renderer.render({\n model : modelName,\n pricing : pricing,\n details : modelDetails\n })\n });\n }", "title": "" }, { "docid": "56716ae481c3fe2e30f42ab00fea1d36", "score": "0.57866514", "text": "if (this.state.selectedIndex >= 0) {\n this.menu_.items[this.state.selectedIndex].focus();\n }", "title": "" }, { "docid": "ea0c028261bccec51d5099b56863edca", "score": "0.5784311", "text": "function handleFocusIndexChange(newIndex,oldIndex){if(newIndex===oldIndex)return;if(!getElements().tabs[newIndex])return;adjustOffset();redirectFocus();}", "title": "" }, { "docid": "e687b1680bbb3385f8146215f817378f", "score": "0.57655674", "text": "onDidFocus() {\n if (!this.state.isFocused) this.setState({isFocused: true});\n }", "title": "" }, { "docid": "985a86b4630136fedfe33c244224e3b0", "score": "0.5762559", "text": "function setActiveItem() {\n\t\t\t\t\t\t// get hierarchy of selected state\n var trail = getTrail($scope.items, $state.current.name, $stateParams);\n\t\t\t\t\t\tvar len = trail.length;\n\n\t\t\t\t\t\t// set currently selected item as active\n\t\t\t\t\t\tif(len > 0) {\n\t\t\t\t\t\t\tvar newCurrentItem = trail[len-1];\n\t\t\t\t\t\t\tsetCurrentItem(newCurrentItem);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// loop through and set open/reveal, so the selected item is in view\n\t\t\t\t\t\tfor(var i = 0; i < len; i += 1) {\n\t\t\t\t\t\t\tvar activeItem = trail[i];\n\t\t\t\t\t\t\tif(activeItem.reveal && !activeItem.revealOpen) {\n\t\t\t\t\t\t\t\tactiveItem.revealOpen = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!activeItem.isOpen) {\n\t activeItem.isOpen = true;\n\t }\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// ensure children are no longer active\n\t\t\t\t\t\tif(len > 0 && trail[len-1].items) {\n\t\t\t\t\t\t\tunselect(trail[len-1].items); \n\t\t\t\t\t\t} \n }", "title": "" }, { "docid": "438684612204a8a172e2fdefcada8a67", "score": "0.5750089", "text": "function focus_input() {\n focused = this;\n }", "title": "" }, { "docid": "96e049b6bdeac8d29b780b9508b84cef", "score": "0.5733495", "text": "focus() {\n this.el_.focus();\n }", "title": "" }, { "docid": "96e049b6bdeac8d29b780b9508b84cef", "score": "0.5733495", "text": "focus() {\n this.el_.focus();\n }", "title": "" }, { "docid": "52767b63280e75d471874393de9b07b7", "score": "0.5724439", "text": "handleFocus() {\n this.showDelayed();\n }", "title": "" }, { "docid": "7c0fd9506710182edf150759319e4cf3", "score": "0.57195246", "text": "_highlightCorrectOption() {\n if (this._keyManager) {\n if (this.empty) {\n this._keyManager.setFirstItemActive();\n }\n else {\n this._keyManager.setActiveItem(this._selectionModel.selected[0]);\n }\n }\n }", "title": "" }, { "docid": "7c0fd9506710182edf150759319e4cf3", "score": "0.57195246", "text": "_highlightCorrectOption() {\n if (this._keyManager) {\n if (this.empty) {\n this._keyManager.setFirstItemActive();\n }\n else {\n this._keyManager.setActiveItem(this._selectionModel.selected[0]);\n }\n }\n }", "title": "" }, { "docid": "23efe0fff64f26405b8f2ffb627e114c", "score": "0.57193214", "text": "_focusChanged(isFocused) {\n if (isFocused !== this.focused && (!this.readonly || !isFocused)) {\n this.focused = isFocused;\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "23efe0fff64f26405b8f2ffb627e114c", "score": "0.57193214", "text": "_focusChanged(isFocused) {\n if (isFocused !== this.focused && (!this.readonly || !isFocused)) {\n this.focused = isFocused;\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "b81d9963afbca7a4b081bf2205a8a49d", "score": "0.57146823", "text": "handleFocusIn(_, listItemIndex) {\n if (listItemIndex >= 0) {\n this.adapter.setTabIndexForElementIndex(listItemIndex, 0);\n }\n }", "title": "" }, { "docid": "42543d8c260d35db399d109139ae8323", "score": "0.57116807", "text": "componentDidUpdate() {\n if (this.props.exercise.checking === false) {\n this.translationInput.current.focus();\n } else {\n this.translationInput.current.blur();\n }\n }", "title": "" }, { "docid": "814e24692313631f6360f9e77dd1d91b", "score": "0.57052684", "text": "componentDidUpdate() {\n if (this.state.editing) {\n var input = React.findDOMNode(this.refs.input);\n if (document.activeElement !== input) {\n var val = input.value;\n input.value = val;\n input.focus();\n }\n }\n }", "title": "" }, { "docid": "e656b90e29860ec8cda3958955c58c53", "score": "0.57034475", "text": "dblclick() {\n\t\tthis.setView( 'focus' );\n\t}", "title": "" }, { "docid": "250c7114e2b99386848341c831187b25", "score": "0.5702922", "text": "_updateFocusForDestroyedChips() {\n // Move focus to the closest chip. If no other chips remain, focus the chip-grid itself.\n if (this._lastDestroyedChipIndex != null) {\n if (this._chips.length) {\n const newChipIndex = Math.min(this._lastDestroyedChipIndex, this._chips.length - 1);\n this._keyManager.setActiveCell({\n row: newChipIndex,\n column: Math.max(this._keyManager.activeColumnIndex, 0)\n });\n }\n else {\n this.focus();\n }\n }\n this._lastDestroyedChipIndex = null;\n }", "title": "" }, { "docid": "db8f0454d58f489e3fcef4154d79180d", "score": "0.5700419", "text": "function update(){\n previewControl.forceRedraw();\n }", "title": "" }, { "docid": "6420965439bc72c239e201bc871d7934", "score": "0.56986535", "text": "onUpKey() {\n\n var len = this.choices.realLength;\n this.pointer = this.pointer > 0 ? this.pointer - 1 : len - 1;\n this.render();\n\n }", "title": "" }, { "docid": "230764f6c09a41182f62dab9b6bf1fd5", "score": "0.56960523", "text": "onScrollChange_() {\n if (SwitchAccess.mode === Mode.POINT_SCAN) {\n return;\n }\n\n if (this.node_.isValidAndVisible()) {\n // Update focus ring.\n FocusRingManager.setFocusedNode(this.node_);\n }\n this.group_.refresh();\n ActionManager.refreshMenuUnconditionally();\n }", "title": "" }, { "docid": "6f80cb65d53b7bce53d19d2689c53fbe", "score": "0.5692098", "text": "receiveFocus () {\n this.setState({ searchDisplay: 'focused'})\n }", "title": "" }, { "docid": "56d6cffa652cb6c73b8811f96bd9b3be", "score": "0.56900984", "text": "haxactiveElementChanged(el, val) {\n if (val) {\n this._haxstate = val;\n }\n }", "title": "" }, { "docid": "56d6cffa652cb6c73b8811f96bd9b3be", "score": "0.56900984", "text": "haxactiveElementChanged(el, val) {\n if (val) {\n this._haxstate = val;\n }\n }", "title": "" } ]
eeff326b182b861425b8e92cd4aae59b
parses the url and returns the sessionid string as ";jsessionid=36D3F2066920A17A8A2CB7379CE1AF87.chdist51"
[ { "docid": "a08390f759b20366fbd5dba07388a8a0", "score": "0.85979027", "text": "function extractSessionId(url)\n{\n\tvar sessionid = \"\";\n\tvar start = url.indexOf(\";jsessionid\");\n\tif(start != -1)\n\t{\n\t\tsessionid = url.substring(start);\n\t\tvar end = sessionid.indexOf(\"?\");\n\t\tif(end != -1)\n\t\t{\n\t\t\tsessionid = sessionid.substring(0, end);\n\t\t}\n\t}\n\treturn sessionid;\n}", "title": "" } ]
[ { "docid": "033f4cb6ea5239a7ad84c20d3a342437", "score": "0.721136", "text": "function getSession (html) {\n let start = html.indexOf('jsessionid=') + 'jsessionid='.length\n let end = html.indexOf('?', start)\n return html.substr(start, end - start)\n}", "title": "" }, { "docid": "609d04ca6ed3c886eae8d1f292c3d5c2", "score": "0.7043745", "text": "function GetSessionID(){\n\tvar SessionID = \"\";\n\tvar sentenceIni = window.location.href;\n\tvar sentence1 = \"session=\";\n\tvar pos1 = sentenceIni.indexOf(sentence1,0);\n\tif (pos1 >= 0 ){\n\t\tSessionID = sentenceIni.substring(pos1+sentence1.length,pos1+sentence1.length+12);\n\t}\n\t//alert(SessionID);\n\treturn SessionID;\n}", "title": "" }, { "docid": "5bcb656fac88265a4129f582d808d4ba", "score": "0.69526815", "text": "function fetch_sessionhash()\n{\n\treturn (SESSIONURL == '' ? '' : SESSIONURL.substr(2, 32));\n}", "title": "" }, { "docid": "a3a3e8a2f77607119a063bfe6a2f1008", "score": "0.68611825", "text": "function GetSessionID(){\r\n var SessionID = \"\";\r\n var sentenceIni = window.location.href;\r\n var sentence1 = \"session=\";\r\n var pos1 = sentenceIni.indexOf(sentence1,0);\r\n if (pos1 >= 0 ){\r\n SessionID = sentenceIni.substring(pos1+sentence1.length,pos1+sentence1.length+12);\r\n }\r\n //alert(SessionID);\r\n return SessionID;\r\n}", "title": "" }, { "docid": "50689dd481f5a4a0d398165c673a542a", "score": "0.671785", "text": "function extractIdFromUrl( url ) {\n if ( !url ) {\n return;\n }\n\n var matches = url.match( rWebUrl );\n return matches ? matches[0].substr(10) : \"\";\n }", "title": "" }, { "docid": "a60d5ccac2e8b24da4cc0d445012d09d", "score": "0.66870135", "text": "function extractIdFromUrl( url ) {\n if ( !url ) {\n return;\n }\n\n var matches = urlRegex.exec( url );\n\n // Return id, which comes after first equals sign\n return matches ? matches[1] : \"\";\n }", "title": "" }, { "docid": "8601587c3da37e94fc1c90472803597e", "score": "0.66572756", "text": "function get_id_session() {\n var temp;\n var cookies;\n cookies = document.cookie.split(\";\");\n for (var i = 0; i < cookies.length; ++i) {\n temp = cookies[i];\n while (temp.charAt(0) == \" \") {\n temp = temp.substring(1, temp.length);\n }\n if (temp.indexOf(\"ID_sesji=\") == 0) {\n return temp.substring(\"ID_sesji=\".length, temp.length);\n }\n }\n return \"\";\n}", "title": "" }, { "docid": "c5e6d05aa28440d08727bb3a1dc613af", "score": "0.6346104", "text": "function extractIdFromUri( url ) {\n if ( !url ) {\n return;\n }\n\n var matches = urlRegex.exec( url );\n\n // Return id, which comes after first equals sign\n return matches ? matches[1] : \"\";\n }", "title": "" }, { "docid": "6db010b3f036d4c5d7f4be619d30a616", "score": "0.6216795", "text": "async getId () {\n let response = await fetch (\"https://test-ancil-overlay.herokuapp.com/v1.2/funnel/cache.js?agent_id=test&flight_string=SFO*2019-10-15T07:20*CQ*123*JFK*2019-10-15T08:45&adults=1\");\n let body = await response.text();\n return JSON.parse(body.slice(22,-2)).session_id\n }", "title": "" }, { "docid": "8dbfaf2208f2fabe4d30cd4471e5f884", "score": "0.6076284", "text": "function getIDfromURL() {\n var url = window.location.href;\n var endofurl = url.split('=');\n var cur_uid = endofurl[endofurl.length-1];\n return cur_uid;\n}", "title": "" }, { "docid": "59d4e09423f82bda0b8076d32280b16f", "score": "0.6003055", "text": "function getSession() {\n var sessionCookie = document.cookie.replace(/(?:(?:^|.*;\\s*)nreLabsSession\\s*\\=\\s*([^;]*).*$)|^.*$/, \"$1\");\n if (sessionCookie == \"\") {\n sessionId = makeid();\n document.cookie = \"nreLabsSession=\" + sessionId;\n return sessionId;\n }\n return sessionCookie;\n}", "title": "" }, { "docid": "335e8c382ef60b3902df5ef4804f5218", "score": "0.5977352", "text": "function parseSidUrl(baseUrl, urlExt) {\n sidPos = baseUrl.indexOf('/?SID=');\n sid = '';\n urlExt = (urlExt != undefined) ? urlExt : '';\n\n if(sidPos > -1) {\n sid = '?' + baseUrl.substring(sidPos + 2);\n baseUrl = baseUrl.substring(0, sidPos + 1);\n }\n\n return baseUrl+urlExt+sid;\n}", "title": "" }, { "docid": "dcf24b54f2f08f34672539d4750201f1", "score": "0.59708077", "text": "function parseSidUrl(baseUrl, urlExt) {\n var sidPos = baseUrl.indexOf('/?SID=');\n var sid = '';\n urlExt = (urlExt != undefined) ? urlExt : '';\n\n if(sidPos > -1) {\n sid = '?' + baseUrl.substring(sidPos + 2);\n baseUrl = baseUrl.substring(0, sidPos + 1);\n }\n\n return baseUrl+urlExt+sid;\n}", "title": "" }, { "docid": "dcf24b54f2f08f34672539d4750201f1", "score": "0.59708077", "text": "function parseSidUrl(baseUrl, urlExt) {\n var sidPos = baseUrl.indexOf('/?SID=');\n var sid = '';\n urlExt = (urlExt != undefined) ? urlExt : '';\n\n if(sidPos > -1) {\n sid = '?' + baseUrl.substring(sidPos + 2);\n baseUrl = baseUrl.substring(0, sidPos + 1);\n }\n\n return baseUrl+urlExt+sid;\n}", "title": "" }, { "docid": "dcf24b54f2f08f34672539d4750201f1", "score": "0.59708077", "text": "function parseSidUrl(baseUrl, urlExt) {\n var sidPos = baseUrl.indexOf('/?SID=');\n var sid = '';\n urlExt = (urlExt != undefined) ? urlExt : '';\n\n if(sidPos > -1) {\n sid = '?' + baseUrl.substring(sidPos + 2);\n baseUrl = baseUrl.substring(0, sidPos + 1);\n }\n\n return baseUrl+urlExt+sid;\n}", "title": "" }, { "docid": "75f76d8e9e139517456bda6a1620e025", "score": "0.5944799", "text": "function parseSidUrl(baseUrl, urlExt) {\n var sidPos = baseUrl.indexOf('/?SID=');\n var sid = '';\n urlExt = (urlExt != undefined) ? urlExt : '';\n\n if (sidPos > -1) {\n sid = '?' + baseUrl.substring(sidPos + 2);\n baseUrl = baseUrl.substring(0, sidPos + 1);\n }\n\n return baseUrl + urlExt + sid;\n}", "title": "" }, { "docid": "7204a4eaff40aefc289bad708b8d82ce", "score": "0.58458245", "text": "function getVideoId(url)\r\n{\r\n url = url.split(\"?v=\")[1]\r\n try { url = url.split(\"&\")[0]; }\r\n catch (error) {}\r\n return url;\r\n}", "title": "" }, { "docid": "4bf89a675d7c28d9fed57b7d68407f20", "score": "0.58442676", "text": "function getId(url) {\n var regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n var match = url.match(regExp);\n\n if (match && match[2].length == 11) {\n return match[2];\n } else {\n return 'error';\n }\n}", "title": "" }, { "docid": "e823844b8a973fa19604aaf48f6a83f4", "score": "0.58176553", "text": "function getUTUBEID(url) {\n\tid_start = url.indexOf('/v') + 3;\n\turl = url.slice(id_start);\n\tid_end = url.indexOf('&');\n\tif (id_end == -1) {\n\t\t// no query paramters\n\t} else {\n\t\turl = url.slice(0, id_end);\n\t}\n\treturn url;\n}", "title": "" }, { "docid": "e823844b8a973fa19604aaf48f6a83f4", "score": "0.58176553", "text": "function getUTUBEID(url) {\n\tid_start = url.indexOf('/v') + 3;\n\turl = url.slice(id_start);\n\tid_end = url.indexOf('&');\n\tif (id_end == -1) {\n\t\t// no query paramters\n\t} else {\n\t\turl = url.slice(0, id_end);\n\t}\n\treturn url;\n}", "title": "" }, { "docid": "51b63c9e0545e12c5a8778d497759ecf", "score": "0.5816176", "text": "function getIdFromUrl(url) { return url.match(/[-\\w]{25,}/); }", "title": "" }, { "docid": "51eaae1401991b9da4d8364424041021", "score": "0.5797864", "text": "function getIdFromUrl(url) {\n return url.match(/[-\\w]{25,}/);\n }", "title": "" }, { "docid": "6252e934a110a14296983bffdcc4c7fa", "score": "0.5777136", "text": "function getDebugSessionKey() {\n const matches = window.location.href.match(/[?&]debug_session=([^&]+)\\b/);\n return (matches && matches.length > 0) ? matches[1] : null;\n}", "title": "" }, { "docid": "dccdf7ccb9f4edfbb97c5dfe19d25eea", "score": "0.57668656", "text": "getSessionIDCookie(){\n const cookies = document.cookie.split(\";\");\n const sessionIDIndex = cookies.findIndex(cookie => cookie.includes(\"sessionID=\"))\n console.log(sessionIDIndex)\n if (sessionIDIndex !== -1) {\n const sessionID = parseInt(cookies[sessionIDIndex].split(\"=\")[1]);\n if (isNaN(sessionID))\n return null \n return sessionID\n }\n else {\n return null;\n }\n }", "title": "" }, { "docid": "0ecb2162e5cc6c5a427c1ed3f8e114a0", "score": "0.57080334", "text": "function getId(url) {\n const regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/;\n const match = url.match(regExp);\n\n return (match && match[2].length === 11)\n ? match[2]\n : null;\n }", "title": "" }, { "docid": "0ecb2162e5cc6c5a427c1ed3f8e114a0", "score": "0.57080334", "text": "function getId(url) {\n const regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/;\n const match = url.match(regExp);\n\n return (match && match[2].length === 11)\n ? match[2]\n : null;\n }", "title": "" }, { "docid": "4dfaa888028d5607c1f7ed6d423e3330", "score": "0.5704877", "text": "function postIdFromUrl(url) {\r\n var matches = url.match(/(?:http\\:\\/\\/)?(?:[a-z0-9\\.\\-\\_]+\\/)+([a-z0-9]+)-.*/i);\r\n return matches[1];\r\n}", "title": "" }, { "docid": "7cc409c574840984f79993e1257779a4", "score": "0.5699338", "text": "function processUrl(url){\n\tvar rawid = url.split(\"v=\")[1];\n\tif(rawid == null || rawid.length==0){\n\t\treturn false;\n\t}\n\tid = rawid.replace(/(&|#).+/g, \"\");\n\tvar time = -1;\n\tvar timeraw = url.split(\"t=\")[1];\n\tif(!(timeraw == null || timeraw.length==0)){\n\t\t//process time\n\t\ttimeraw = timeraw.replace(/(&|#).+/g, \"\");\n\t\tif(timeraw.match(/[0-9]+/gi) && timeraw > -1){\n\t\t\ttime = timeraw;\n\t\t}else{\n\t\t\tvar values = timeraw.match(/([0-9]+m)?([0-9]+(s)?){1}/gi);\n\t\t\tif(values != null){\n\t\t\t\tminutes = timeraw.split(\"m\")[0];\n\t\t\t\tif(minutes == timeraw || minutes == null || minutes.length == 0){\n\t\t\t\t\tminutes = 0;\n\t\t\t\t}\n\t\t\t\tseconds = timeraw.split(\"m\")[1];\n\t\t\t\tif(seconds == null || seconds.length == 0){\n\t\t\t\t\tseconds = timeraw;\n\t\t\t\t}\n\t\t\t\tseconds = seconds.replace(\"s\", \"\");\n\t\t\t\tif(minutes > -1 && seconds > -1){\n\t\t\t\t\ttime = 60*minutes + 1*seconds;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn {id: id, time: time};\n}", "title": "" }, { "docid": "629797079b16ef6ecf8c60edb23cb317", "score": "0.569172", "text": "function _append_swsession(strURL)\r\n{\r\n\tvar strPrefix = (strURL.indexOf(\"&\")>-1)?\"&\":\"?\";\r\n\tstrURL += strPrefix + \"sessid=\" + app._swsessionid;\r\n\treturn strURL;\r\n}", "title": "" }, { "docid": "a249278ef2754747937ae8b5c6994f64", "score": "0.56720597", "text": "function generateSessionID() {\n const d = new Date();\n const month = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n const m = month[d.getMonth()]\n return m + d.getDate() + \"-\" + d.getHours() + d.getMinutes() + \"-\" + d.getSeconds() + d.getMilliseconds()\n}//used to generate session id", "title": "" }, { "docid": "4a9ff7dd5197300d9b087263a4e5c957", "score": "0.56682986", "text": "function getIdFromUrl(url) {\n return url.match(/[-\\w]{25,}/);\n}", "title": "" }, { "docid": "959bc016ca189043088e0d99477fede7", "score": "0.5661038", "text": "function cleanURL(url) {\n\t\t\tvar url_hash = window.location.hash;\n\t\t\tvar hash_regexp = new RegExp(\"STS=\", \"i\");\n\t\t\tvar match_results = url_hash.match(hash_regexp); // elements 1,3\n\t\t\tif( match_results != null ) {\n\t\t\t\tvar url_arr = url.split('#');\n\t\t\t\treturn url_arr[0];\n\t\t\t} else {\n\t\t\t\treturn url;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "b58b94bb810fb4cc5c9eb38eb7a376e8", "score": "0.5648003", "text": "function getUserIDfromURL(argURL) {\n\treturn /(\\d{5,})/.exec(argURL)[1];\n}", "title": "" }, { "docid": "936d7de9e3648aca3675f219ac45bbc7", "score": "0.5636858", "text": "function _getPhpSessionId(cookiesStr) {\n var cookies = _parseCookies(cookiesStr);\n return cookies.PHPSESSID\n }", "title": "" }, { "docid": "e4346f6c3460861c05abb5630fdaf79f", "score": "0.56211394", "text": "function parseId(url) {\n // http://stackoverflow.com/a/14701040\n var match = /^.*(youtube.com\\/|v\\/|e\\/|u\\/\\w+\\/|embed\\/|v=)([^#\\&\\?]*).*/.exec(url);\n\n if (match instanceof Array && match[2] !== undefined) {\n return match[2];\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "2d537a62c575a6a1b15453f914bda7c3", "score": "0.55756515", "text": "function youtubeid(url) {\n var myregexp = /(?:youtube\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/ ]{11})/i;\n var videoID = url.match(myregexp);\n // var ytid = url.match(\"[\\\\?&]v=([^&#]*)\");\n videoID = videoID[1];\n return videoID;\n }", "title": "" }, { "docid": "69e181cf745cf678596e62a4231a912c", "score": "0.55655545", "text": "function getLinkId(url) {\n\n var id = url.slice(url.lastIndexOf('/') + 1, url.length);\n //console.log(\"ID= \" + id);\n return id;\n\n}//get link id", "title": "" }, { "docid": "79264bb38b06e2215d4e6ab0f64b9846", "score": "0.5535863", "text": "function idFromUrl(url) {\n var last3 = url.slice(-3);\n if (last3[0] === \"/\") return url.slice(-2)\n if (last3[1] === \"/\") return url.slice(-1);\n return last3;\n }", "title": "" }, { "docid": "7a8a61c60cbe45dba4e8c3661bf97998", "score": "0.5518851", "text": "function GetUrlIdParameterFromUrl(url) {\n \n // If url is null or empty\n if (url == undefined || url == \"\") { return \"\"; }\n \n // try for youtube\n var youtubeRegex = /(\\?v=|\\/\\d\\/|\\/embed\\/|\\/v\\/|\\.be\\/)([a-zA-Z0-9\\-\\_]+)/;\n var result = url.match(youtubeRegex);\n if (result) { return result[2]; }\n \n // try for ted\n var ted_re = /(?:http:\\/\\/)?(?:www\\.)?ted.com\\/([a-zA-Z0-9\\-\\_]+)\\/([a-zA-Z0-9\\-\\_]+)/;\n result = url.match(ted_re);\n if (result) { return result[2]; }\n \n return \"\";\n }", "title": "" }, { "docid": "c9792c3cc797a5ffcbd20a4bc6833b64", "score": "0.5508366", "text": "function getSessionUrl(baseUrl, id) {\n return coreutils_1.URLExt.join(baseUrl, SESSION_SERVICE_URL, id);\n }", "title": "" }, { "docid": "8d2c8a397bf4a18fd0c6ac80acde59a9", "score": "0.54864347", "text": "function getGroupID(URL) {\n var start_pos = URL.indexOf('=') + 1;\n var end_pos = URL.indexOf('&study_group_uuid', start_pos);\n var studyGroupID = URL.substring(start_pos, end_pos);\n console.log(studyGroupID);\n return studyGroupID;\n}", "title": "" }, { "docid": "abb014965d7135fcfed9fd13db1c5776", "score": "0.54781795", "text": "function getObjectidFromUrl(url) {\n var urlObject = urlUtils.urlToObject(url);\n if (urlObject.query && urlObject.query.OBJECTID) {\n return urlObject.query.OBJECTID;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "d68856b76d149be2f9145998e581f219", "score": "0.54650676", "text": "function convertURLTOID(url) {\n let regex = /[/](\\d)+[/]/;\n\n if (typeof url == \"string\") {\n return regex.exec(url)[0].split('/')[1]\n } else {\n url.forEach((url) => {\n for (let key in url) {\n url[key] = convertURLTOID(url[key]);\n }\n })\n return url;\n }\n }", "title": "" }, { "docid": "c33d644ad67382447844b037829bb3c2", "score": "0.544877", "text": "function yt_id(url){\n var ytid = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n id = url[2].split(/[^0-9a-z_]/i);\n id = id[0];\n } else { id = url; }\n return id;\n }", "title": "" }, { "docid": "b601e9eb563cb2826d8801ea051a512e", "score": "0.54060817", "text": "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n }", "title": "" }, { "docid": "760bba637810d700b2ce269860ec87a5", "score": "0.5387137", "text": "function extractSubscriptionUrl(url) {\n let result;\n const matchRes = url.match(/.*\\/subscriptions\\/[a-f0-9-]+\\//gi);\n if (matchRes && matchRes[0]) {\n result = matchRes[0];\n }\n else {\n throw new Error(`Unable to extract subscriptionId from the given url - ${url}.`);\n }\n return result;\n}", "title": "" }, { "docid": "760bba637810d700b2ce269860ec87a5", "score": "0.5387137", "text": "function extractSubscriptionUrl(url) {\n let result;\n const matchRes = url.match(/.*\\/subscriptions\\/[a-f0-9-]+\\//gi);\n if (matchRes && matchRes[0]) {\n result = matchRes[0];\n }\n else {\n throw new Error(`Unable to extract subscriptionId from the given url - ${url}.`);\n }\n return result;\n}", "title": "" }, { "docid": "c9fc55cda58c26d67d483b26ddd5d57f", "score": "0.5373839", "text": "function get_videoID()\r\n{\r\n\tv_id_patch=url.split(\"v=\");\r\n\tid_offset=v_id_patch[1].indexOf(\"&\");\r\n\tif(id_offset==-1) id_offset=v_id_patch[1].length;\r\n\tvid_id=v_id_patch[1].substring(0,id_offset);\r\n}", "title": "" }, { "docid": "e047680f76fb7f1fcbf735781b9381ef", "score": "0.53549135", "text": "function getAuthInfoFromUrl(url) {\n var authResponse = url.split(\"?\")[1];\n var toJson = '{\"' + authResponse.replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}';\n var authInfo = JSON.parse(\n toJson,\n function (key, value) { return key === \"\" ? value : decodeURIComponent(value); });\n \n return authInfo;\n }", "title": "" }, { "docid": "ada2e370e68e6d03b9a78b207b74e5ae", "score": "0.53547883", "text": "function handleOpenURL(url) {\n console.log(\"received url: \" + url);\n var urlParts = url.split('//'); //split url to remove 'secapp://'\n var addressInternal = urlParts[1]; //store remainder of string\n var addressInternalParts = addressInternal.split('/'); //split again\n if (addressInternalParts[0] == 'trip') { //if intent is trip related\n var tripid = addressInternalParts[1]; //store tripid\n console.log(tripid);\n postLoginURL = true; //intent triggered to true\n sessionStorage.setItem(\"thistripid\", tripid); //store tripid into session storage\n } //passes onto authHandler()\n}", "title": "" }, { "docid": "004cb550f1b89ff2579a310847d3d44b", "score": "0.5352477", "text": "getSongIdFromUrl(url) {\n let videoId,\n ampersandPosition;\n\n if (!url) return false;\n\n if (url.indexOf('?v=') !== -1) videoId = url.split('?v=')[1];\n else if (url.indexOf('youtu.be/') !== -1) videoId = url.split('youtu.be/')[1];\n\n if (!videoId) return url;\n\n ampersandPosition = videoId.indexOf('&');\n\n if (ampersandPosition !== -1) videoId = videoId.substring(0, ampersandPosition);\n\n return videoId;\n }", "title": "" }, { "docid": "97acf289d4091d30d9f39fbc853d6779", "score": "0.534862", "text": "function vcExtractYoutubeId( url ) {\n\tif ( 'undefined' === typeof(url) ) {\n\t\treturn false;\n\t}\n\n\tvar id = url.match( /(?:https?:\\/{2})?(?:w{3}\\.)?youtu(?:be)?\\.(?:com|be)(?:\\/watch\\?v=|\\/)([^\\s&]+)/ );\n\n\tif ( null !== id ) {\n\t\treturn id[ 1 ];\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "c08d43a083cae9ed78f9f19fa2e9cae5", "score": "0.5327618", "text": "function getUserId()\n{\n\tvar url = window.location.href;\n\treturn url.split(\"=\")[1].split('#')[0];\n}", "title": "" }, { "docid": "7529a420c6dcbae49425590af4b948bc", "score": "0.5324799", "text": "function getHashFromUrl(url) {\n\tconsole.log(String(url).slice(String(url).search('#') + 1));\n\treturn String(url).slice(String(url).search('#') + 1);\n}", "title": "" }, { "docid": "cab7b10db78023358ceb878a50399f9e", "score": "0.5323676", "text": "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n}", "title": "" }, { "docid": "cab7b10db78023358ceb878a50399f9e", "score": "0.5323676", "text": "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n}", "title": "" }, { "docid": "40d01522b756b37f85cfb84162e58b65", "score": "0.5323248", "text": "function getYouTubeCode(url) {\n return url.split('?v=')[1];\n }", "title": "" }, { "docid": "f71c9faf7f8141c1b37e61b9060f1758", "score": "0.5323178", "text": "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n}", "title": "" }, { "docid": "f42ec711e1427e5cab664f551420d472", "score": "0.530846", "text": "function getCitationId(url) {\n var parts = url.split('?');\n if (parts.length > 1) {\n var id = parts[1].split('&')[0];\n return id.split('=')[1];\n }\n return null;\n }", "title": "" }, { "docid": "cde19832add0e4038e4c223266225614", "score": "0.5305528", "text": "function loggedIn(url){\n\tvar split = url.split(\"#\");\n\tif (split.length > 1){\n\t\tvar token = split[1].split(\"=\")[1];\n\t\treturn token;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "334406e5c73cbbb9e4d2432cc786508f", "score": "0.5303253", "text": "function getVideoIDfromLink(url)\n{\n\t\tvar regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n\t\tvar match = url.match(regExp);\n\t\tif (match&&match[2].length==11){\n\t\t\t\treturn match[2];\n\t\t}else{\n\t\t\t\t//error\n\t\t}\n}", "title": "" }, { "docid": "b6126b7cfc135f2d9ddb680c06df5f89", "score": "0.5301293", "text": "function parseTopURL() {\n let query = window.location.search.substring(1);\n let args = query.split('&');\n for(let i=0; i<args.length; i++) {\n let pair = args[i].split('=');\n if(pair[0] === 'id') {\n return pair[1]\n }\n }\n return undefined;\n}", "title": "" }, { "docid": "ef156e617a57b03581d724fa87d3e0ba", "score": "0.52817434", "text": "function get_idfacebook_from_url() {\n\n adverra_id_extractor();\n function adverra_id_extractor() {\n text = '';\n // iziToast.info({\n // title: 'รอสักครู่',\n // position: 'topCenter',\n // timeout: 2000,\n // message: 'กำลังเช็ค ID...',\n // });\n\n\n // original_url = $('#adverra_id_extractor_url').val();\n // original_url = `https://www.facebook.com/DevasBrightmoon/videos/171934840819450/?v=171934840819450`;\n // original_url = `https://www.facebook.com/pg/ETD.ERRORTODAY`;\n original_url = `https://www.facebook.com/groups/dmts.g/permalink/2177334155612192/`;\n url = original_url;\n var url_process = url.match(/([a-z]+\\:\\/+)([^\\/\\s]*)([a-z0-9\\-@\\^=%&;\\/~\\+]*)[\\?]?([^ \\#]*)#?([^ \\#]*)/ig);\n if (url_process) {\n\n url = url.replace(\"https\\:\\/\\/\", \"\").replace(\"http\\:\\/\\/\", \"\").replace(\"\\:\\/\\/\", \"\");\n url = url.split(\"\\/\");\n if (url[0].match(\".facebook.com\")) {\n if (url[1].split(\"?\")) {\n if (url[1] && url[1] != \"\") {\n\n\n /////////////////////////////////////////\t \n var url_array_collect = [];\n for (temp_var = 1; url[temp_var]; temp_var++) {\n console.log(\"url[\" + temp_var + \"]=\" + url[temp_var].split(\"\\?\")[0]);\n if (url[temp_var].split(\"\\?\")[0] && url[temp_var].split(\"\\?\")[0] != \"\") {\n url_array_collect.push(url[temp_var].split(\"\\?\")[0]);\n }\n if (url[temp_var].split(\"\\?\")[1] && url[temp_var].split(\"\\?\")[1] != \"\") {\n var location_search = \"\\?\" + url[temp_var].split(\"\\?\")[1];\n }\n }\n\n\n var post_id = getParam('fbid', location_search);\n\n var set = getParam('set', location_search);\n var story_fbid = getParam('story_fbid', location_search);\n var account_id = getParam('id', location_search);\n //to detect facebook notes\n if (url[1] == \"notes\") {\n if (!isNaN(url[4])) {\n title = \"Note ID\";\n console.log(title + \"=\" + url[4]);\n append_html_code(title, url[4]);\n }\n if (!isNaN(url[3])) {\n title = \"Note ID\";\n console.log(title + \"=\" + url[3]);\n append_html_code(title, url[3]);\n }\n }\n if (account_id) {\n if (!isNaN(account_id)) {\n title = \"Account ID\";\n console.log(title + \"=\" + account_id);\n append_html_code(title, account_id);\n }\n }\n if (story_fbid) {\n if (!isNaN(story_fbid)) {\n title = \"Post ID\";\n console.log(title + \"=\" + story_fbid);\n append_html_code(title, story_fbid);\n }\n }\n if (post_id != \"\") {\n var photo_post_id = post_id;\n if (!isNaN(photo_post_id)) {\n title = \"Post ID/Photo ID:\";\n types = '2';\n }\n append_html_code(title, photo_post_id);\n }\n if (set) {\n set = set.split(\".\");\n if (set) {\n var account_id = set[3];\n if (!isNaN(account_id)) {\n title = \"Account ID:\";\n console.log(title + \"=\" + account_id);\n append_html_code(title, account_id);\n }\n }\n }\n //extract account id from https://www.facebook.com/profile.php?id=100009125604149\n if (original_url.match(\"profile\\.php\")) { }\n if (original_url.match(\"\\/photos\\/\")) {\n splited = original_url.split(\"/\");\n photo_id = splited[splited.length - 2];\n if (!isNaN(photo_id)) {\n title = \"Photo ID:\";\n console.log(title + \"=\" + photo_id);\n append_html_code(title, photo_id);\n }\n }\n console.log(url_array_collect);\n extraction_process_url_params(url_array_collect);\n\n\n\n\n\n\n /////////////////////////\t \n\n\n\n }\n else {\n\n\n console.log('เกิดข้อผิดพลาด', 'ไม่สามารถดึง ID กรุณากรอก URL อื่น', 'error');\n\n\n }\n }\n }\n else {\n\n console.log('เกิดข้อผิดพลาด', 'URL ที่ใส่ ต้องเป็น URL ของ Facebook', 'error');\n }\n }\n else {\n\n console.log('นี่ไม่ใช่ URL ', 'กรุณากรอก URL ของ Facebook', 'error');\n\n }\n\n\n }\n\n\n\n\n\n\n\n function extract_page_id(page_id) {\n if (!isNaN(page_id)) {\n console.log(\"page id=\" + page_id);\n title = \"Page id:\";\n append_html_code(title, page_id);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function extract_post_id(post_id) {\n if (!isNaN(post_id)) {\n console.log(\"post_id=\" + post_id);\n title = \"Post id:\";\n append_html_code(title, post_id);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function event_post_id_append(post_id) {\n if (!isNaN(post_id)) {\n console.log(\"event_post_id=\" + post_id);\n title = \"Event post id:\";\n append_html_code(title, post_id);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function group_post_id_append(post_id) {\n if (!isNaN(post_id)) {\n console.log(\"group_post_id=\" + post_id);\n title = \"Group post id:\";\n append_html_code(title, post_id);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function id_extract_event(account_username) {\n if (!isNaN(account_username)) {\n console.log(\"Event id is:\" + account_username);\n title = \"Event ID:\";\n append_html_code(title, account_username);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function extract_video_id(video_id) {\n if (!isNaN(video_id)) {\n console.log(\"video id is=\" + video_id);\n title = \"Post ID/ Video id:\";\n append_html_code(title, video_id);\n }\n }\n function id_extract_group(account_username) {\n\n if (isNaN(account_username)) {\n pageurl = \"https://mbasic.facebook.com/groups/\" + account_username;\n dinesh = new XMLHttpRequest();\n dinesh.open(\"GET\", pageurl, true);\n dinesh.onreadystatechange = function () {\n console.log(`dinesh.readyState: `, dinesh.readyState);\n console.log(`dinesh.status: `, dinesh.status);\n if (dinesh.readyState == 4 && dinesh.status == 200) {\n var responsa = dinesh.responseText.match(/\\/groups\\/\\d+/g)[0];\n responsa = responsa.replace(\"\\/groups\\/\", \"\");\n title = \"Group ID:\";\n console.log(title + responsa);\n append_html_code(title, responsa);\n }\n }\n dinesh.send();\n } else {\n title = \"Group ID:\";\n console.log(title + account_username);\n append_html_code(title, account_username);\n }\n }\n\n\n\n\n\n function append_html_code(title, id) {\n title = '<b style=\"font-size:20px;font-weight:bold\">' + title;\n text = text + '<p>' + title + '<input class=\"copytext' + id + '\" type=\"text\" value=\"' + id + '\" style=\"font-size:30px; text-align:center;width:90%;\" ><a datashow=\"copytext' + id + '\" class=\"copyto btn-floating mb-1 btn-flat waves-effect waves-light pink accent-2 white-text\"> <i class=\"material-icons\">content_copy</i></a><p></b>';\n\n console.log({\n title: 'Copy ตัวเลขไปใช้ได้เลยค่ะ',\n type: 'success',\n html: text,\n })\n // iziToast.success({\n // title: 'เรียบร้อย',\n // position: 'topCenter',\n // timeout: 3000,\n // message: 'พบ ID แล้ว Copy ไปใช้ได้เลย',\n // });\n }\n\n\n\n\n\n\n function extraction_process_url_params(url_array_collect) {\n console.log(url_array_collect);\n\n\n if (url_array_collect[2]) {\n if (url_array_collect[2] == \"permalink\") {\n if (url_array_collect[0] == \"groups\") {\n id_extract_group(url_array_collect[1]);\n if (!isNaN(url_array_collect[3])) {\n group_post_id_append(url_array_collect[3]);\n }\n }\n if (url_array_collect[0] == \"events\") {\n id_extract_event(url_array_collect[1]);\n if (!isNaN(url_array_collect[3])) {\n event_post_id_append(url_array_collect[3]);\n }\n }\n }\n if (url_array_collect[1] == \"videos\") {\n extract_video_id(url_array_collect[2]);\n }\n if (url_array_collect[0] == \"pages\") {\n if (!isNaN(url_array_collect[2])) {\n extract_page_id(url_array_collect[2]);\n }\n }\n if (url_array_collect[1] == \"posts\") {\n if (url_array_collect[0]) {\n id_extract_account(url_array_collect[0]);\n }\n if (!isNaN(url_array_collect[2])) {\n extract_post_id(url_array_collect[2]);\n }\n } else {\n id_extract_account(url_array_collect[0]);\n }\n } else {\n if (url_array_collect[1]) {\n if (url_array_collect[0] == \"groups\") {\n id_extract_group(url_array_collect[1]);\n }\n if (url_array_collect[0] == \"events\") {\n id_extract_event(url_array_collect[1]);\n }\n if (url_array_collect[0] == \"pg\") {\n id_extract_account(url_array_collect[1]);\n }\n } else {\n id_extract_account(url_array_collect[0]);\n }\n }\n }\n\n\n\n\n\n\n\n\n\n function id_extract_account(account_username) {\n\n function error_msgs() {\n //toastr.error(\"Unable to retrieve account ID\");\n }\n\n if (isNaN(account_username)) {\n responsa = '';\n pageurl = \"https://m.facebook.com/\" + account_username + \"\";\n\n dinesh = new XMLHttpRequest();\n dinesh.open(\"GET\", pageurl, true);\n dinesh.onreadystatechange = function () {\n if (dinesh.readyState == 4 && dinesh.status == 200) {\n var responsa = dinesh.responseText;\n responsa = responsa.replace(/&quot;/g, '\"');\n if (responsa.match(/\"profile_id\":\\d+/g)) {\n\n var last_array = (responce_id = responsa.match(/\"profile_id\":\\d+/g).length - 1);\n\n var responce_id = responsa.match(/\"profile_id\":\\d+/g)[last_array];\n responce_id = responce_id.replace('\"profile_id\":', \"\");\n if (!isNaN(responce_id)) {\n title = \"Account ID:\";\n console.log(title + \"=\" + responce_id);\n append_html_code(title, responce_id);\n\n\n } else {\n error_msgs();\n }\n }\n\n else\n\n if (responsa.match(/page_id:\\\"\\d+/g)) {\n\n var last_array = responsa.match(/page_id:\\\"\\d+/g)[0];\n responce_id = last_array.replace('page_id:\\\"', \"\");\n if (!isNaN(responce_id)) {\n title = \"Page ID:\";\n console.log(title + responce_id);\n append_html_code(title, responce_id);\n\n\n } else {\n error_msgs();\n }\n }\n\n\n\n\n }\n }\n dinesh.send();\n } else {\n alert(\"account id is:\" + responsa.id);\n //document.getElementById(\"fst789_id_extractor_result\").innerText = account_username;\n }\n }\n\n\n\n\n\n\n\n\n\n function getParam(sname, location_search) {\n if (location_search && sname) {\n\n var params = location_search.substr(location_search.indexOf(\"?\") + 1);\n var sval = \"\";\n params = params.split(\"&\");\n // split param and value into individual pieces\n for (var i = 0; i < params.length; i++) {\n temp = params[i].split(\"=\");\n if ([temp[0]] == sname) { sval = temp[1]; }\n }\n\n return sval;\n } else {\n return '';\n }\n }\n\n}", "title": "" }, { "docid": "0ea1cf8229000eb4ab71b205947b4986", "score": "0.5279682", "text": "function getSpotifyPlaylistID(link) {\n var id;\n var indexEndOfID = link.indexOf(\"?\", link.search(\"playlist\") + 9);\n if (indexEndOfID != -1) {\n id = link.slice(link.search(\"playlist\") + 9, indexEndOfID);\n } else {\n id = link.slice(link.search(\"playlist\") + 9);\n }\n //console.log(id);\n return id;\n}", "title": "" }, { "docid": "b436e27273fa78b19bc67c33210ab858", "score": "0.52718383", "text": "function getYoutubeId(link){\r\n let id = link.split(\"=\")[1].split(\"&\")[0];\r\n return id;\r\n}", "title": "" }, { "docid": "9af47728c5746e09b140f94d9295dcc0", "score": "0.52701813", "text": "function get_youtube_id_from_url(url) {\n var patt = new RegExp('v=([0-9a-zA-Z_-])+');\n var id = patt.exec(url);\n if (id != null && id.length > 0) {\n return id[0].substr(2);\n }\n return '';\n}", "title": "" }, { "docid": "0ae286e10338f5724bb830035537b44e", "score": "0.526858", "text": "getVideoID(){\n return location.href.split('/').pop().replace('#','');\n }", "title": "" }, { "docid": "c434e9977dcdcd29a59b76983c3926b8", "score": "0.52642757", "text": "function getSessionIndex() {\n var url = window.location.pathname;\n url = url.substr(url.lastIndexOf('/') + 1);\n return url;\n }", "title": "" }, { "docid": "b4eb406408b188b55585a62d179a358b", "score": "0.5254559", "text": "function cutWebviewId(url) {\n\tvar startIndex = url.lastIndexOf(\"/\");\n\tvar endIndex = url.lastIndexOf(\".html\");\n\tvar wvId = url.substring(startIndex + 1, endIndex);\n\treturn wvId;\n}", "title": "" }, { "docid": "0fd40a8a283ec5619ff208ed97641c20", "score": "0.5245562", "text": "_extractUserIdentifier(path) {\n\n\t\tlet extractor = (path.startsWith('/profile.php?') ? /(?:\\?id=[0-9]+)/ : /\\/([^\\/?]+)[\\/?]?/);\n\t\tlet parts = path.match(extractor);\n\n\t\tif (parts && parts.length > 1) {\n\t\t\treturn parts[1]\n\t\t}\n\t\treturn path;\n\t}", "title": "" }, { "docid": "6202e55a5c28aae34c2c8f565513bd0f", "score": "0.5238206", "text": "function extractUrl(url) {\n\t\t\tvar pos = url.indexOf('url='),\n\t\t\t\tpos2 = url.indexOf('ibm.com/links');\n\n\t\t\tif (pos !== -1 && pos2 !== -1 && pos2 < pos) {\n\t\t\t\turl = url.substr(pos + 4);\n\t\t\t}\n\n\t\t\treturn decodeURIComponent(url);\n\t\t}", "title": "" }, { "docid": "009e5685cf7169e1df71369099cebc12", "score": "0.5209864", "text": "getUserIdFromURL() {\n const url = window.location.href;\n let userId = url.match(endNumberPattern);\n\n if (userId) {\n userId = parseInt(userId[1]);\n } else {\n userId = 0;\n }\n\n return userId;\n }", "title": "" }, { "docid": "9d2de2232fc48f927fefa800810dbf2a", "score": "0.5179753", "text": "getCode(url, parse =true) {\n if (!parse)\n return url;\n\n if (!url.startsWith('http') || url.indexOf(\"sy.qkj.com.cn\") > 0)\n return url;\n\n let idx = url.lastIndexOf(\"=\");\n if (idx == -1)\n idx = url.lastIndexOf(\"/\");\n if (idx == -1)\n return false;\n\n return url.substring(idx + 1).trim();\n }", "title": "" }, { "docid": "dc090bdd2c076b290b91a690197dabac", "score": "0.5179106", "text": "function getAnalyticsSessionID() {\n var sessionCookieVal = $.cookie('twc-analytics-session')\n if (sessionCookieVal) {\n return sessionCookieVal;\n }\n /* Given that we don't know exactly where this is being called from, make it synchronous to avoid timing issues.\n * the time the servlet takes to respond should also be minimal enough to not have the user notice it. */\n $.ajax({\n type: 'GET',\n async: false,\n url: '/bin/services/generate/id',\n cache: false,\n data: 'maxIDLength=16&baseEncoding=32'\n })\n .done(function(data, textStatus, jqXHR) {\n $.cookie('twc-analytics-session', data, { expires: null, path: '/'}); // create the cookie to expire at browser close\n })\n .fail(function(jqXHR, errorType, exception) {\n console.log(exception); // log the error\n });\n return $.cookie('twc-analytics-session');\n}", "title": "" }, { "docid": "c7ead6ca93f3b53ed889a48cc96d32ae", "score": "0.51721454", "text": "function getPokemonId(url){\n\treturn url.slice(33, url.length-1);\n}", "title": "" }, { "docid": "20fc82293b5c21b4b94c5b81c1214eaa", "score": "0.5144776", "text": "function roomID(type){\n var matchRoomRequest;\n //urls for express sessions and normal sessions \n //are not the same \n if(type==\"workspace\"){\n matchRoomRequest = /.*\\/workspace\\/(.+)/;\n }\n else{\n matchRoomRequest = /.*\\/express\\/(.{32})/;\n }\n var match = matchRoomRequest.exec(document.URL);\n\n if(match){\n return match[1];\n }\n}", "title": "" }, { "docid": "c190eae0e343f0db73d9ad957982a673", "score": "0.514167", "text": "function tinyUrltoID(tinyUrl) { \n var id = 0; // initialize result \n \n // A simple base conversion logic \n for (var i = 0; i < tinyUrl.length; i++) \n { \n if ('a' <= tinyUrl.charAt(i) && tinyUrl.charAt(i) <= 'z'){\n id = id * 62 + tinyUrl.charAt(i).charCodeAt() - 'a'.charCodeAt(); \n }\n\n if ('A' <= tinyUrl.charAt(i) && tinyUrl.charAt(i) <= 'Z'){\n id = id * 62 + tinyUrl.charAt(i).charCodeAt() - 'A'.charCodeAt() + 26; \n }\n\n if ('0' <= tinyUrl.charAt(i) && tinyUrl.charAt(i) <= '9'){\n id = id * 62 + tinyUrl.charAt(i).charCodeAt() - '0'.charCodeAt() + 52; \n }\n } \n return id; \n}", "title": "" }, { "docid": "c3b9d65923801062de2f8352ed53e59b", "score": "0.51301676", "text": "function getYoutubeId(url) {\n url = url || '';\n\n var matches = url.match(/.*?youtu.be\\/([^\\/]+)\\/*/i);\n if (matches) {\n return matches[1];\n }\n\n matches = url.match(/.*?youtube\\.com\\/watch\\?v=([^\\/]+)\\/*.*/i);\n if (matches) {\n return matches[1];\n }\n\n return '';\n }", "title": "" }, { "docid": "fb0bee294208471c79f6936616c3692c", "score": "0.5123427", "text": "function getIdFromUrl(urlData,id){\n\t// let arr = ulr.split(\"-\");\n\tlet arr2 = ulr.indexOf(id);\n\tlet arr3 = ulr.substr(arr2, id.length);\n\treturn arr3;\n}", "title": "" }, { "docid": "5d7b2b3761fe2bd15aa33bc0e6567d70", "score": "0.5120707", "text": "function getSessionId() {\n return (CONVIO || {}).pageSessionID;\n }", "title": "" }, { "docid": "646cc9333cc9b0ba9fd4c551fdb883ad", "score": "0.51187015", "text": "function getsessionkey(){\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"Get\", apihost+\"/user/getsessionkey\", false);\n\t// xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n\txhr.onload = function(event){\n\t\tif(xhr.status === 200){\n\t\t\t// console.log(xhr.response);\n\t\t\tsessiondata.sessionkey=xhr.response;\n\t\t\tstoresessiondata();\n\t\t\tsendsessiondata();\n\t\t} else {\n\t\t\tconsole.log(xhr.status+\" : \"+xhr.statusText);\n\t\t}\n\t};\n\txhr.send();\n}", "title": "" }, { "docid": "f0586f3db6d3777f0da69e97227e2aeb", "score": "0.51138765", "text": "function get_sm_name(page_url){\r\n\t//GM_log(page_url);\r\n\r\n\tvar site_start = page_url.indexOf('&s=');\r\n\tif (site_start==-1){\r\n\t\tsite_start = page_url.indexOf('&S=');\r\n\t}\r\n\tvar site_end = page_url.indexOf('&r',site_start);\r\n\tvar site_url= page_url.substring(site_start+3,site_end);\r\n\r\n\t//GM_log(site_start +\"|\"+site_end +\"|\"+site_url);\t\r\n\treturn site_url;\r\n}", "title": "" }, { "docid": "89fbc297578cd1e52801adef75be539b", "score": "0.51104826", "text": "function get_catalog_id() {\n var url = new URL(window.location.href);\n var catalog_id = url.searchParams.get(\"catalogId\");\n return catalog_id;\n}", "title": "" }, { "docid": "62e699a988e396af3ca1afd387f83019", "score": "0.510798", "text": "function getYoutubeIdByUrl (url)\r\n {\r\n var regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\r\n var match = url.match(regExp);\r\n\r\n if (match && match[2].length == 11) {\r\n return match[2];\r\n } else {\r\n return false;\r\n }\r\n\r\n }", "title": "" }, { "docid": "5344137ebe650e5322228d387c64ca89", "score": "0.5103454", "text": "function getVideoID(url){\n var regExp = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#&?]*).*/;\n var match = url.match(regExp);\n return (match&&match[7].length==11)? match[7] : false;\n }", "title": "" }, { "docid": "d2b5f7b92556ddf0d850749ad689c6e2", "score": "0.5102249", "text": "function extractIdFromUri( uri ) {\n if ( !uri ) {\n return;\n }\n\n var matches = uri.match( rPlayerUri );\n return matches ? matches[0].substr(30) : \"\";\n }", "title": "" }, { "docid": "ba45f235c028bc50e0e53312bb37bebf", "score": "0.5090194", "text": "function getVideoId()\n {\n if (window.location.search.length > 0)\n {\n var s = window.location.search.substring(1);\n var requestObjects = s.split('&');\n for (var i = 0, len = requestObjects.length; i < len; i += 1)\n {\n var obj = requestObjects[i].split('=');\n if (obj[0] === \"v\")\n {\n console.log(\"Video ID is \" + obj[1]);\n return obj[1];\n }\n }\n }\n\n return null;\n }", "title": "" }, { "docid": "7bb333a3de212b2d3f26a06d2f908644", "score": "0.50892067", "text": "function getSessionId () {\n var url = \"php/selectSessionbyId.php\";\n var data = \"sessions=\"+idNumber; \n ajaxRequest(\"POST\", url, true, data, displayNotes)\n}", "title": "" }, { "docid": "90b2fedf516c6144079266158bbf4cc8", "score": "0.5074718", "text": "function str2cid(url) {\n let hash = crypto\n .createHash(\"sha256\")\n .update(url)\n .digest(\"base64\");\n\n return new CID(hash);\n}", "title": "" }, { "docid": "7ac5da46afa7ec96f1650ad206439777", "score": "0.50709695", "text": "function generateSessionId(agentId,customerWebValueCode) {\n console.log(customerWebValueCode);\n var d = new Date();\n var sessionId = d.getTime();\n var dbobj = dbinterface.initialize();\n var conn = dbinterface.connectDB(dbobj, customerWebValueCode);\n var filter = \"where AgentId = '\" + agentId + \"' \";\n status = \"SessionId = '\" + sessionId + \"' \";\n console.log(filter + status);\n dbinterface.updateDataToTable(dbobj, conn, AGENT_TABLE, filter, status, function (err, data) {\n if (err) {\n // error handling code goes here\n console.log(\"ERROR : \", err);\n } else {\n // code to execute on data retrieval\n\n console.log(\"Updated\");\n\n }\n dbinterface.endConnection(dbobj, conn);\n });\n return sessionId;\n}", "title": "" }, { "docid": "dd242773ae9743bbcdd3ec6e07c7b32d", "score": "0.5069018", "text": "function getURL() {\n var url = window.location.pathname.split('/').slice(0, 4).join('/')\n\n return url + '/' + cid + '/'\n}", "title": "" }, { "docid": "15e9ec6a5e70c83073c07d6ba6c55a30", "score": "0.5067039", "text": "function getSoundcloudIDfromURL(url,callback) {\n\tvar url = \"https://api.soundcloud.com/resolve.json?client_id=\"+config.soundcloud.id+\"&url=\"+url;\n\trequest({url:url,json:true},function(error,response,data) {\n\t\tif(!error && response.statusCode == 200) {\n\t\t\tcallback(data.id);\n\t\t}\n\t})\n}", "title": "" }, { "docid": "de9b9c3c3f989843163d95207687489e", "score": "0.5066885", "text": "function getYouTubePlaylistID(link) {\n var id;\n var indexEndOfID = link.indexOf(\"&\", link.search(\"list=\") + 5);\n if (indexEndOfID != -1) {\n id = link.slice(((link.search(\"list=\")) + 5), indexEndOfID);\n } else {\n id = link.slice((link.search(\"list=\")) + 5);\n }\n //console.log(id);\n return id;\n}", "title": "" }, { "docid": "9827eb2b0c2267ca2e0790d3d0addde3", "score": "0.5066324", "text": "function getPss() {\n var url = window.location.href.toString();\n var pss = \"\";\n if (url.indexOf(\"pss=\") != -1) {\n pss = url.split(\"pss=\")[1].split(\"&\")[0];\n }\n\n return pss.replace(\"%20\",\" \");\n}", "title": "" }, { "docid": "9a4b920a6997d4351ec500ea5c3b8270", "score": "0.50588757", "text": "function getSetID(url) {\n return /\\d{6,}/g.exec(url)[0];\n }", "title": "" }, { "docid": "dc08f6bbc8a3eccc3a481a3f3f92ce0e", "score": "0.50562096", "text": "function extractId(href) {\n return href.replace(/^[a-z-]+:\\/+?[^\\/]+/i, '') // Remove protocol & domain\n .replace(/^\\//, '') // Remove root /\n .replace(/\\.[a-zA-Z]+$/, '') // Remove simple extension\n .replace(/[^\\.\\w-]+/g, '-') // Replace illegal characters\n .replace(/\\./g, ':'); // Replace dots with colons(for valid id)\n}", "title": "" }, { "docid": "073064d49e68b850f7ccceb4801d5980", "score": "0.50558174", "text": "getSessionId() {\n return this.session && this.session.id;\n }", "title": "" }, { "docid": "058c381adeb3d084ad6e42475358b824", "score": "0.5050644", "text": "function getId() {\n var url = window.location.pathname.split('/')\n\n return url[url.length - 3]\n}", "title": "" }, { "docid": "d8bed9ff1bc93e25c12102bc4d348459", "score": "0.5047502", "text": "function getSoundcloudIDFromURL(url, callback) {\n var url = \"https://api.soundcloud.com/resolve.json?client_id=\"+config.soundcloud.id+\"&url=\"+url;\n request({url:url, json:true}, function (error, response, data) {\n if (!error && response.statusCode == 200) {\n callback(data.id);\n }\n })\n}", "title": "" }, { "docid": "fcbf9051207275ff89a729ba41f5f001", "score": "0.5046222", "text": "function getPlaylistID() {\n const url = window.location.search;\n if (url.indexOf(\"?playlist_id=\") !== -1) {\n let currentPlaylist = url.split(\"=\")[1];\n return currentPlaylist;\n }\n }", "title": "" } ]
621745566e4d3ee13634a09f12fe03ee
AJAX Bongeszes kozben Ajax keressel lehet a kovetkezo 10 jatekot kerni.
[ { "docid": "b36e23eecfd270caeba2d164fc223207", "score": "0.0", "text": "* browseAjax (request, response){\n var category = request.param(\"category\");\n\n if(category !== \"All\"){\n var games = yield Database.select(\"*\").from(\"games\").where('categories', 'LIKE', '%' + category + '%');\n }\n else{\n games = (yield Game.all()).toJSON();\n }\n\n var nextChunk = request.all().nextChunk,\n wholeLength = Math.floor(games.length / 10),\n maxBorder = nextChunk > wholeLength ? games.length : nextChunk * 10, //A felso hatar mindig 9, kiveve az utolso, nem 10db -os resz (pl. 9, 19...)\n minBorder = (nextChunk - 1) * 10; //Az also hatar mindig egesz (0, 10, 20...)\n\n games = games.slice(minBorder, maxBorder);\n\n for(var i=0; i<games.length; ++i){\n games[i] = {\n id: games[i].id,\n name: games[i].name,\n img: games[i].pictures.split(\";\")[0],\n releasedate: games[i].releasedate,\n price: games[i].price\n };\n }\n\n response.send(games);\n }", "title": "" } ]
[ { "docid": "00b87463e0d175abbf45cb871b1568a5", "score": "0.70940167", "text": "function listado_facturas()\n{\n var url=\"datos.php\"\n var cliente = $F('id_cliente')\n var mes = $('meses').value\n var pars='opcion=12&cliente='+ cliente +'&mes='+ mes\n var myAjax = new Ajax.Request(url,\n {\n method: 'post',\n parameters: pars,\n onComplete: function gen(t)\n {\n $('facturacion').innerHTML = t.responseText\n }\n });\n \n}", "title": "" }, { "docid": "f63a7c82975b285b1c32732e87fdb7e9", "score": "0.70348424", "text": "function nazioni(){\n\tvar d = document.getElementById(\"printhere\");\n\t $.ajax({\n\t\t url: 'http://localhost/ProgettoEsame/Progetto-esame/back-end/nazioni.php',\n\t\t method: 'GET',\n\t\t contenttype: 'json',\n\t\t success: function (data, textStatus, jQxhr) {\n\t\t\t $.each(data.regioni, function (i, post) {\n aggiungi(post.id_regione, post.nome, \"regione\");\n });\n\t\t },\n\t\t error: function (jQxhr, textStatus, errorThrown) {\n\t\t\t console.log(errorThrown);\n\t\t }\n });\n}", "title": "" }, { "docid": "5be129da6319441e8b101ce9657eb22a", "score": "0.7033713", "text": "function tampilsemua(){ \n $.ajax({ url: server+'carimasjid.php', data: \"\", dataType: 'json', success: function (rows){\n cari_masjid(rows);\n }});\n }", "title": "" }, { "docid": "394614a01e5c489996f2585f265d61cd", "score": "0.7025591", "text": "function getNodosRuta(){\n switchRutas=1;\n \n $.ajax({\n type: 'GET',\n contentType: 'application/json',\n url:rootURLgetNodos ,\n dataType: \"json\",\n success: renderNodosRuta\n });\n}", "title": "" }, { "docid": "327a384d064870559839361803824e0a", "score": "0.69834447", "text": "function vp()\n{\n\tif(obj_ajax.readyState == 4)\n\t{ \n\t\t// valor 4: respuesta recibida y lista para ser procesada\n\t\tif(obj_ajax.status == 200)\n\t\t{ \n\t\t\t// El valor 200 significa que ha ido todo bien en la carga\n\t\t\t// Aquí se procesa lo que se haya devuelto:\n\t\t\tconsole.log(\"se ha terminado la carga de datos clasificacion -> devolviendo\");//devolvemos mensaje por log\n\t\t\tinfo=JSON.parse(obj_ajax.responseText);//creamos el objeto datos con los datos parseados\n\t\t\tconsole.log(\"informacion devuelta:\"+obj_ajax.responseText);//devolvemos por consola sus valores devueltos\n\t\t\t//foormatear(clasificacion,\"clasificacion\");//mostramos la informacion en la pagina \n\t\t}\n\t\telse \n\t\t{\n\t\t\tconsole.warn(\"no se ha podido completar la peticion ajax-html de index-clasificacion\");//devolvemos mensaje por log\n\t\t\t//zoom_activo();//activamos el slider sin opcion que significa que ha ido mal\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6b30af317ca6f5631a31e24194d3e4d5", "score": "0.695133", "text": "function getNodosAristas(){\n $.ajax({\n type: 'GET',\n contentType: 'application/json',\n url:rootURLgetNodos ,\n dataType: \"json\",\n success: renderNodosAristas\n });\n}", "title": "" }, { "docid": "3bc11b27f20508a0d7734f9967b1feaa", "score": "0.6937174", "text": "function pobierzListReklam() {\n\t$.ajax({\n\t\turl: 'http://q4.maszyna.pl/api/adds',\n\t\ttype: 'get',\n\t\tdataType: 'json',\n\n\t\terror: function(){\n\t\t\tvar errorBox = \"\";\n\t\t\terrorBox += '<div class=\"alert alert-error\">';\n errorBox += \t'<h4><strong>Nie udało się pobrać informacji z serwera, wystąpił błąd.</strong></h4>';\n \terrorBox += '</div>';\n \talertBox.append(errorBox);\n\t\t\tconsole.log(\"error\");\t\t\t\t\n\t\t},\n\t\tbeforeSend: function() {\n\t\t\tvar infoBox = \"\";\n\t\t\tinfoBox += '<div class=\"alert alert-info\">';\n \tinfoBox += \t'<h4><strong>Trwa pobieranie informacji z serwera, proszę czekać.</strong></h4>';\n \tinfoBox += '</div>';\n \talertBox.append(infoBox);\n\t\t\tconsole.log(\"wysyłamy zapytanie\");\n\t\t},\n\t\tcomplete: function() {\n\t\t\t// usuwamy box alert-info, zostawiamy alert-error jeśli wystąpił błąd\n\t\t\t$(\".alert-info\").alert('close');\n\t\t\tconsole.log(\"request completed\");\n\t\t},\n\t\tsuccess: function(data) {\n\t\t\t$.each(data, function(index, item){\n\n\t\t\t\t// tworzymy szkielet html do którego będą wrzucone dane z GET\n\t\t\t\tvar htmlString = \"\";\n\t\t\t\thtmlString += '<div class=\"reklama-item well-custom\" data-id-reklamy=\"'+ item._id.$id + '\"' + 'data-nazwa-reklamy=\"'+ item.name + '\"' + '>';\n\t\t\t\thtmlString += \t\t'<div class=\"img-holder\">';\n\t\t\t\thtmlString += \t\t\t'<img class=\"media-object\" src=\"/uploads/' + item.path + '\"' + '</img>';\n\t\t\t\thtmlString += \t\t'</div>';\n\t\t\t\thtmlString += \t\t'<div class=\"media-body\">';\n\t\t\t\thtmlString += \t\t\t'<h1>' + item.name + '</h1>';\n\t\t\t\thtmlString += \t\t'</div>';\n\t\t\t\thtmlString += \t\t'<div class=\"media-details\">';\n\t\t\t\thtmlString += \t\t\t'<p class=\"lead\">' + item.text + '</p>';\n\t\t\t\thtmlString += \t\t'</div>';\n\t\t\t\thtmlString += \t\t'<div class=\"media-buttons normal\">';\n\t\t\t\thtmlString += \t\t\t'<a href=\"#\" class=\"pull-left edytuj-reklame\" alt=\"\"><i class=\"icon-edit\"></i>Edytuj reklamę</a>';\n\t\t\t\thtmlString += \t\t\t'<a href=\"#\" class=\"pull-right usun-reklame\" alt=\"\"><i class=\"icon-trash\"></i>Usuń reklamę</a>';\n\t\t\t\thtmlString += \t\t'</div>';\n\t\t\t\thtmlString += \t\t'<div class=\"media-buttons edit\">';\n\t\t\t\thtmlString += \t\t\t'<a href=\"#\" class=\"pull-left zapisz-zmiany\" alt=\"\"><i class=\"icon-ok\"></i>Zapisz zmiany</a>';\n\t\t\t\thtmlString += \t\t\t'<a href=\"#\" class=\"pull-right odrzuc-zmiany\" alt=\"\"><i class=\"icon-remove\"></i>Odrzuć zmiany</a>';\n\t\t\t\thtmlString += \t\t'</div>';\n\t\t\t\thtmlString += '</div>';\n\t\t\t\tmiejsce.append(htmlString);\n\t\t\t});\n\t\t\t$(\".alert\").alert('close');\n\t\t\t// dodajWyswietlanieSzczegolow();\n\t\t\tdodajMozliwoscEdycji();\n\t\t\tdodajMozliwoscUsuwania();\n\t\t}\n\t});\n\tconsole.log(\"pobierzListReklam\");\n}", "title": "" }, { "docid": "1b6bf1076890ccc7eeeca0fe0c7e0fc8", "score": "0.6927866", "text": "function DodajAjaxEvente() {\n\n $(\"button[ajax-poziv='da']\").click(function () {\n\n var btn = $(this);\n btn.attr(\"ajax-poziv\", \"dodan\");\n event.preventDefault();\n var url = btn.attr(\"ajax-url\");\n //var url2 = btn.attr(\"href\");\n var rez = btn.attr(\"ajax-rez\");\n\n //var url;\n //if (url1 instanceof String)\n // url = url1;\n //else\n // url = url2;\n\n $.get(url,function (rezultat) {\n $(\"#\" + rez).html(rezultat);\n }\n )\n });\n\n $(\"a[ajax-poziv='da']\").click(function () {\n\n event.preventDefault();\n\n var btn = $(this);\n btn.attr(\"ajax-poziv\", \"dodan\");\n var url1 = btn.attr(\"ajax-url\");\n //var url2 = btn.attr(\"href\");\n var rez = btn.attr(\"ajax-rez\");\n\n //var url;\n //if (url1 instanceof String)\n // url = url1;\n //else\n // url = url2;\n\n $.get(url, function (rezultat) {\n $(\"#\" + rez).html(rezultat);\n }\n )\n });\n\n $(\"form[ajax-poziv='da']\").submit(function () {\n\n event.preventDefault();\n\n var forma = $(this);\n forma.attr(\"ajax-poziv\", \"dodan\");\n var url1 = forma.attr(\"ajax-url\");\n var url2 = forma.attr(\"action\");\n var rez = forma.attr(\"ajax-rez\");\n\n var url;\n\n if (url1 instanceof String)\n url = url1;\n else\n url = url2;\n\n $.ajax({\n async: true,\n type: \"POST\",\n url: url,\n data: forma.serialize(),\n success: function (rezultat) {\n $(\"#\" + rez).html(rezultat);\n }\n });\n });\n}", "title": "" }, { "docid": "c7ceafc94f8438c8621e7b8616b09634", "score": "0.6920201", "text": "function hitung_jumlah_bahanBaku(){\n\t\t$.ajax({\n\t\t\turl: base_url+'app/controllers/Perencanaan_bahan_baku.php',\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tdata: {\n\t\t\t\t'action': 'hitung_jumlah_bahanbaku',\n\t\t\t\t'nilai_perencanaan': parseFloat($(\"#hasil_perencanaan\").val().trim()),\n\t\t\t\t'produk': $(\"#produk\").val().trim(),\n\t\t\t},\n\t\t\tbeforeSend: function(){\n\t\t\t\tsetLoading();\n\t\t\t},\n\t\t\tsuccess: function(output){\n\t\t\t\tconsole.log(output);\n\t\t\t\tsetLoading(false);\n\n\t\t\t\tlistJumlahBahanBaku = [];\n\t\t\t\tindexJumlahBahanBaku = 0;\n\n\t\t\t\tvar index = indexJumlahBahanBaku++;\n\t\t\t\t$('#tabel_jumlah_bahanBaku tbody tr').each(function (index) {\n\t\t\t\t $(this).remove(); // hapus data ditabel\n\t\t\t\t});\n\n\t\t\t\t$.each(output, function(index, item){\n\t\t\t\t\tvar dataKomposisi = {\n\t\t\t\t\t\tindex: index,\n\t\t\t\t\t\tid_komposisi: item.id_komposisi,\n\t\t\t\t\t\tid_bahan_baku: item.id_bahan_baku,\n\t\t\t\t\t\tkd_bahan_baku: item.kd_bahan_baku,\n\t\t\t\t\t\tnama_bahan_baku: item.nama_bahan_baku,\n\t\t\t\t\t\tsatuan_bahan_baku: item.satuan_bahan_baku,\n\t\t\t\t\t\tpenyusutan: item.penyusutan,\n\t\t\t\t\t\tjumlah_bahanBaku: item.jumlah_bahanBaku,\n\t\t\t\t\t};\n\t\t\t\t\tlistJumlahBahanBaku.push(dataKomposisi);\n\t\t\t\t});\n\n\t\t\t\t$.each(listJumlahBahanBaku, function(index, item){\n\t\t\t\t\t$(\"#tabel_jumlah_bahanBaku > tbody:last-child\").append(\n\t\t\t\t\t\t\"<tr>\"+\n\t\t\t\t\t\t\t\"<td></td>\"+ // nomor\n\t\t\t\t\t\t\t\"<td>\"+item.kd_bahan_baku+\"</td>\"+ // kode\n\t\t\t\t\t\t\t\"<td>\"+item.nama_bahan_baku+\"</td>\"+ // bahan baku\n\t\t\t\t\t\t\t\"<td>\"+item.jumlah_bahanBaku+\" \"+item.satuan_bahan_baku+\"</td>\"+ // jumlah\n\t\t\t\t\t\t\"</tr>\"\n\t\t\t\t\t);\n\t\t\t\t\tnumberingList_jumlah_bahanBaku();\n\t\t\t\t});\n\t\t\t},\n\t\t\terror: function (jqXHR, textStatus, errorThrown){ // error handling\n\t setLoading(false);\n\t swal(\"Pesan Error\", \"Operasi Gagal, Silahkan Coba Lagi\", \"error\");\n\t console.log(jqXHR, textStatus, errorThrown);\n\t }\n\t\t})\n\t}", "title": "" }, { "docid": "ba7e94ddf65594f276e48fb49263f462", "score": "0.6906", "text": "function dellAnnonce(id)\n{\n var xmlhttp;\n if (window.XMLHttpRequest)\n {// code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp=new XMLHttpRequest();\n }\n else\n {// code for IE6, IE5\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange=function()\n {\n if (xmlhttp.readyState==4 && xmlhttp.status==200)\n {\n document.getElementById(\"reponseMessage\").style.display = \"\";\n document.getElementById(\"reponseMessage\").innerHTML=\"L'annonce est supprim&eacute;e\";\n }\n }\n xmlhttp.open(\"GET\",\"controleurs/ajaxFormulaires.php?type=trDellAnn&id=\"+id,true);\n xmlhttp.send();\n}", "title": "" }, { "docid": "86a9aad28025207a8ae0250a611fabe8", "score": "0.6854834", "text": "function trampas()\n{\n\tif(obj_ajax.readyState == 4)\n\t{ \n\t\t// valor 4: respuesta recibida y lista para ser procesada\n\t\tif(obj_ajax.status == 200)\n\t\t{ \n\t\t\t// El valor 200 significa que ha ido todo bien en la carga\n\t\t\t// Aquí se procesa lo que se haya devuelto:\n\t\t\tconsole.log(\"se ha terminado la carga de datos clasificacion -> devolviendo\");//devolvemos mensaje por log\n\t\t\tinfo=JSON.parse(obj_ajax.responseText);//creamos el objeto datos con los datos parseados\n\t\t\tconsole.log(\"informacion devuelta:\"+obj_ajax.responseText);//devolvemos por consola sus valores devueltos\n\t\t\t//foormatear(clasificacion,\"clasificacion\");//mostramos la informacion en la pagina \n\t\t}\n\t\telse \n\t\t{\n\t\t\tconsole.warn(\"no se ha podido completar la peticion ajax-html de index-clasificacion\");//devolvemos mensaje por log\n\t\t\t//zoom_activo();//activamos el slider sin opcion que significa que ha ido mal\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9c7aa89ef6bdaa859aae924ffa5f452a", "score": "0.68449587", "text": "function GetBakimRaporuAjaxCall() {\n ShowLoader();\n $.ajax({\n type: \"POST\",\n contentType: \"application/json;charset=utf-8\",\n url: HttpUrls.GetBakimRaporu,\n success: (list) => {\n if (list.length !== 0) {\n\n console.log(list);\n $(recordsNotFound.bakimOzeti).css('display', 'none');\n CreateBakimRaporuTable(list, TablesId.bakimOzeti);\n }\n else {\n $(`${recordsNotFound.bakimOzeti} h3`).text('Hiç Bir Kayit Bulunmamaktadır');\n $(recordsNotFound.bakimOzeti).css('display', 'block');\n HideLoader();\n }\n }\n });\n}", "title": "" }, { "docid": "e3d3d59863e8be645aba1a613c3c9ea1", "score": "0.68232477", "text": "function ver_servicios_contratados(id_cliente)\n{\n var url= \"datos.php\";\n if (id_cliente == null)\n var id_cliente = $F('id_cliente');\n var mes = $('meses').value\n var pars = \"opcion=3&cliente=\"+id_cliente+\"&mes=\"+mes+\"&anyo=\"+$('anyo').value;\n var myAjax = new Ajax.Request(url,\n {\n method: 'post',\n parameters: pars,\n onComplete: \n function gen(respuesta) \n { \n //alert(respuesta.responseText)\n $('tabla').innerHTML = respuesta.responseText;\n }\n });\n}", "title": "" }, { "docid": "c99d26fe3507fce7f0b42ab9ae20eb1e", "score": "0.6823004", "text": "function ProvjeriSkolu()\n{\n\tvar xmlhttp = new XMLHttpRequest();\n\tvar opcina = document.getElementById(\"NazivOpcine\").value;\n\tvar skola = document.getElementById(\"NazivSkole\").value;\n\t\n\txmlhttp.onreadystatechange = function()\n\t{\n\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) \n\t\t{\n\t\t\tvar objekat = JSON.parse(xmlhttp.responseText);\n\t\t\tdocument.getElementById(\"greska_skola\").innerHTML = \" \";\n\t\t\tif(typeof objekat.ok === \"undefined\" && typeof objekat.greska !== \"undefined\") document.getElementById(\"greska_skola\").innerHTML = objekat.greska;\n\t\t}\n\t\t\n\t}\n\n\txmlhttp.open(\"GET\", \"http://zamger.etf.unsa.ba/wt/srednja_skola.php?opcina=\" + opcina + \"&skola=\" + skola ,true);\n\txmlhttp.send();\n}", "title": "" }, { "docid": "2e1f43d57b1acad962d603c8a422b747", "score": "0.6820916", "text": "function agrega_servicio()\n{\n var url='datos.php'\n var cliente = $F('id_cliente')\n var formulario = $('frm_alta')\n var pars='opcion=9&cliente='+cliente+'&'+Form.serialize(formulario)\n var myAjax = new Ajax.Request(url,\n {\n method: 'post',\n parameters: pars,\n onComplete: function gen(t)\n {\n precarga()\n $('debug').innerHTML = t.responseText\n }\n });\n \n}", "title": "" }, { "docid": "a8a511d9664fc0db7a8695b8fc7a113d", "score": "0.68176764", "text": "function diasParaPagar() {\n\n var htmResponseProx = document.getElementById('htmResponseProx');\n\n $.ajax({\n\n url: base_url+\"index.php/dashboardnuevo/dias_para_pagar\",\n type: 'POST',\n global: false,\n beforeSend: function (xhr) {\n xhr.overrideMimeType(\"text/plain; charset=utf-8\");\n },\n success: function (data) {\n\n //respuesta del query de dias para pagar\n var Obj=$.parseJSON(data);\n \n var respAjaxProxComp = Obj['html_response'];\n htmResponseProx.innerHTML = respAjaxProxComp;\n\n // apertura de toas de informacion de proxima compra\n $('.toast').toast('show');\n\n }\n });\n \n}", "title": "" }, { "docid": "4071023d1d44de4c19b75fa7afcce39c", "score": "0.6801709", "text": "function lSegitiga() {\n var alas = document.getElementById('alass').value;\n var tinggi = document.getElementById('tinggis').value;\n\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4) {\n if(this.status == 200) {\n var r = JSON.parse(this.responseText);\n \n document.getElementById(\"answer\").innerHTML = \"Luas Segitiga = \"+r.hasil+\" \"+satuan+\"²\";\n }\n else if(this.status == 400) {\n document.getElementById(\"answer\").innerHTML = \"Tidak boleh kosong / 0\";\n }\n }\n };\n var params = url_+\"/luas_segitiga?alas=\"+alas+\"&tinggi=\"+tinggi;\n xhttp.open(\"GET\", params, true);\n xhttp.send();\n}", "title": "" }, { "docid": "a383f40a9fae8a08ac469d28cca7a2e7", "score": "0.67996967", "text": "function gestion_facturas(tipo) //ya genera el listado\n{\n var url=\"datos.php\"\n var pars\n tipo = eval(tipo)\n if(tipo == 1)\n {\n pars='opcion=11&tipo=1'\n \n }\n else\n {\n var cliente = $F('id_cliente')\n var mes = $('meses').value\n pars='opcion=11&cliente='+ cliente +'&mes='+ mes + '&tipo=0'\n }\n var estilo = $('tabla').style\n estilo.display='block'\n estilo.visibility='visible'\n var myAjax = new Ajax.Request(url,\n {\n method: 'post',\n parameters: pars,\n onComplete: function gen(t)\n {\n $('tabla').innerHTML = t.responseText\n }\n });\n}", "title": "" }, { "docid": "c4a92a3c31e6d479adfeb9aeb6d53f10", "score": "0.6787213", "text": "function observaciones(servicio)\n{\n var url=\"datos.php\"\n var pars='opcion=10&servicio='+servicio\n var estilo = $('observa').style\n estilo.display='block'\n estilo.visibility='visible'\n var myAjax = new Ajax.Request(url,\n {\n method: 'post',\n parameters: pars,\n onComplete: function gen(t)\n {\n $('observa').innerHTML = t.responseText\n }\n });\n \n}", "title": "" }, { "docid": "74424b5e84cfbc7f31049c6aa5b33502", "score": "0.67791647", "text": "function updateVerkopen(ajax){\n\n}", "title": "" }, { "docid": "f842220573e62c8d2c4d7446e4585601", "score": "0.6775579", "text": "function busquedaDni(busqueda) {\n $.ajax({\n type: \"GET\",\n url: URL_CORLAD+\"/web/busquedaDNI/\"+busqueda,\n data: \"json\",\n beforeSend: ()=>{\n blockearbutton()\n },\n success: function (response) {\n desblockearbutton()\n if (response){\n detalleUsuario(response.id);\n insertarDatos(response);\n $('#agremiadoEncontrado').fadeOut();\n }else{\n borrarDatos();\n $('#agremiadoEncontrado').fadeIn();\n }\n }\n });\n }", "title": "" }, { "docid": "b3a30d3394d4dd3b6de3442f3b857af9", "score": "0.6774869", "text": "function LoadTK(a) {\n var tk = a;\n // alert(tk);\n $.ajax({\n type: \"POST\",\n url: \"/taikhoan/find\",\n data: JSON.stringify({ TK_ID: tk }),\n contentType: \"application/json\",\n success: function(response) {\n $.each(response, function(i, taikhoan) {\n console.log(taikhoan);\n\n $(\"#TK_ID\").html(taikhoan.TK_ID);\n $(\"#TK_HOTEN\").html(taikhoan.TK_HOTEN);\n if (taikhoan.TK_HIEULUC == 1) {\n $(\"#TK_HIEULUC\").html(\"Còn hiệu lực\");\n } else if (taikhoan.TK_HIEULUC == 0) {\n $(\"#TK_HIEULUC\").html(\"Đã vô hiệu\");\n }\n $(\"#TK_LOAI\").html(taikhoan.TK_LOAI);\n $(\"#TK_DONVI\").html(taikhoan.TK_DONVI);\n });\n },\n error: function(e) {\n console.log(e);\n }\n });\n}", "title": "" }, { "docid": "9b282ec1b782ad5a6df382fa63c8e21b", "score": "0.6751529", "text": "function searchStokInUrunEtiketi() {\n let UreunEtiketiSearcedValue = $('#inp-urunEtiketi-inputSearch');\n $.ajax({\n type: \"POST\",\n contentType: \"application/json;charset=utf-8\",\n data: JSON.stringify(UreunEtiketiSearcedValue.val()),\n url: HttpUrls.getStokByStk,\n success: (list) => {\n creatStokgenTable(list,TablesId.UrunEtiketi_searchStkInStokgen);\n }\n });\n ShowLoader();\n}", "title": "" }, { "docid": "598afe9c17907cd1c0791421ba8c969e", "score": "0.6739443", "text": "function somma_inside(p_num1, p_num2){\n l_pathServer = \"http://127.0.0.1/grestServer/serverRest/server.php\";\n l_jsonData = {numero1:p_num1, numero2:p_num2 };\n callAjax(\"somma\", \"1\", l_jsonData, l_pathServer\n ,function(data){\n messageBox(\"dialog-confirm\", \"Funzione Somma\", \"Risultato \"+data.data.somma);\n $(\"#risultato\").val(data.data.somma); \n //alert(JSON.stringify(data));\n }\n ,function(errMsg) { messageBox(\"dialog-confirm\", \"Funzione Somma\", errMsg); }\n );\n }", "title": "" }, { "docid": "4dcc51527b25fcd24657b92694cb45bb", "score": "0.6733488", "text": "function ver_frm_agregar_servicio(cliente)\n{\n var url='datos.php'\n var pars='opcion=7&cliente='+cliente\n var myAjax = new Ajax.Request(url,\n {\n method: 'post',\n parameters: pars,\n onComplete: function gen(t)\n {\n $('form_agregar').innerHTML = t.responseText\n }\n });\n \n}", "title": "" }, { "docid": "906253a9c069c5e359be07c1b38c0f1c", "score": "0.6693309", "text": "function verTodosComentarios1(idArticulo) {\r\n\tidArticulo = $('articulo').value;\r\n\tvar cantidad = 4;\r\n\tnew Ajax.Request('/GetComentarioXArticuloAction.do?param=' + Math.random()\r\n\t\t\t+ '&idArticulo=' + idArticulo + '&cantidad=' + cantidad, {\r\n\t\tmethod : 'get',\r\n\t\tonSuccess : function(transport) {\r\n\t\t\tif (transport.readyState == 4) {\r\n\t\t\t\t$('divComentarios').innerHTML = '';\r\n\t\t\t\t$('divComentarios').innerHTML = transport.responseText;\r\n\t\t\t\tif(transport.responseText==\"\")\r\n\t\t\t\t\t$('comentarios').style.display=\"none\";\r\n\t\t\t\tlanzarPopego();\r\n\t\t\t} else {\r\n\t\t\t\t$('divComentarios').innerHTML = 'Cargando comentarios!!!';\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "b97a15cc65553258d1f5412ef32e4bc4", "score": "0.66853154", "text": "function btn_ver_tikeo()\n {\n var ID_tikeo = $('#ID_contenido').val();\n var ob ={ID_tikeo:ID_tikeo};\n \n $.ajax({\n type: 'POST',\n url:'../vista/vista_examinar_tikeo.php',\n data: ob,\n beforeSend: function(objeto){\n \n },\n success: function(data)\n { \n $('#panel_examinar_tikeo').html(data);\n }\n });\n }", "title": "" }, { "docid": "2975bbddebebd40749b6ca587bb0739e", "score": "0.6676446", "text": "function refreshJ(url)\n {\n $.ajax({\n type: 'POST',\n url: url,\n dataType: 'json',\n data: {},\n success: function(data)\n {\n if(!data.error)\n {\n if(!data.nobody)\n {\n $(\"#maxJokers\").show();\n for(var i=0;i<data.name.length;i++)\n {\n $(\"#maxJokers\").append(\"<p> <b>Alerte : </b> \"+data.name[i]+\" (\"+data.uid[i]+\") a \"+data.nbjocker[i]+\" jokers !</p>\");\n }\n }\n }\n }\n })\n }", "title": "" }, { "docid": "ba69958409cf4f597b30e9716ba7941c", "score": "0.6670733", "text": "function ordering(id_barang) {\n // var quiz_id = document.getElementById(\"quiz\").value;\n var jumlah_belanja = $('input#jumlah_belanja').val()\n\n\n console.log(jumlah_belanja);\n\n\n $.ajax({\n url: `http://127.0.0.1:5000/Order/${id_barang}`,\n method: \"POST\",\n contentType: \"application/json\",\n data: JSON.stringify({\n jumlah_belanja: jumlah_belanja,\n\n }),\n success: function () {\n alert(\"anda berhasil membeli barang IMPIAN\");\n // window.location.href = 'contract_list.html'\n },\n error: function () {\n alert(\"cek semua inputanya\");\n },\n complete: function () {\n console.log(\"mantul\");\n }\n });\n}", "title": "" }, { "docid": "6fa6d1d88faa4738b4c67d879616ec54", "score": "0.666258", "text": "function peticionCompletada(data, status, jqXHR){\n //$(\"#contenido_de_ajax\").html(data[0].username);\n $(\"#contenido_de_ajax\").html(\"<p>hola soy juan</p>\");\n for(i in data){\n $(\"#contenido_de_ajax\").append(data[i].titulo +\"<br/>\");\n $(\"tbody\").append(\"<tr>\" \n +\"<td>\" +data[i].id +\"</td>\" \n +\"<td>\" +data[i].titulo +\"</td>\" \n +\"<td>\" +data[i].director +\"</td>\" \n +\"<td>\" +data[i].sinopsis +\"</td>\" \n +\"<td>\" +data[i].fecha +\"</td>\" \n +\"<td>\" +data[i].valoracion +\"</td>\" \n +\"<td class='borrar'>\" +\"<button>Borrar</button>\" +\"</td>\" \n +\"<td class='modificar'>\" +\"<button>Seleccionar</button>\" +\"</td>\" \n\n //Esto era el codigo para //url: \"https://jsonplaceholder.typicode.com/users\"\n //+\"<td>\" +data[i].address +\"</td>\"\n //address es un objeto json, hago stringify para poder inprimirlo en la columna address \n //+\"<td>\" +JSON.stringify(data[i].address) +\"</td>\" \n \n \n //Utilidades de JSON para estudiar\n //JSON.stringify(object)\n //Para pasar un string a un objeto json\n // JSON.parse(string)\n +\"</tr>)\");//Fin del append\n }\n //alert(\"Peticion completada con status: \" +status +\" : \" +data);\n console.log(\"Peticion completada con status: \" +status +\" : \" +data);\n\n //Ver texto de todas las celdas de una fila sin formato\n //verTextoDeUnaFila();\n //Resaltar fila cuando hago hover\n resaltarFilaEnTablaCuandoHover();\n //Activar click en celda borrar\n activarBorrado();\n //Activar click celda modificar\n activarModificar();\n}//Fin de peticion completada", "title": "" }, { "docid": "46db61c28b216ab6ae82e80b8d76e052", "score": "0.66521186", "text": "function vi_creditos()\n{\n\t$.ajax({\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t url: 'ventas/vi_pedidosCredito.php',\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t cache:false,\n\t\t\t\t\t error:function(XMLHttpRequest, textStatus, errorThrown){\n\t\t\t\t\t\t console.log(arguments);\n\t\t\t\t\t\t var error;\n\t\t\t\t\t\t if (XMLHttpRequest.status === 404) error=\"Pagina no existe\"+XMLHttpRequest.status;// display some page not found error \n\t\t\t\t\t\t if (XMLHttpRequest.status === 500) error=\"Error del Servidor\"+XMLHttpRequest.status; // display some server error \n\t\t\t\t\t\t $('#'+donde).html('<div class=\"alert_error\">'+error+'</div>');\t\t\t\t\t\t \n\t\t\t\t\t },\n\t\t\t\t\t success:function(msj){\t\n\t\t\t\t\t //console.log(\"el msj de generarCreditodeCaja = \"+msj);\n\t\t\t\t\t\t$('#tbl_creditos').html(msj);\n\t\t\t\t\t \n\t\t\t\t\t \t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t });\n}", "title": "" }, { "docid": "27615de67b21b922d9c2942b3fa5d4a4", "score": "0.66495305", "text": "function mostras_ventas_guardadas(){\r\n \r\n let base_url = document.getElementById('base_url').value;\r\n let controlador = base_url+'venta/get_ventas_guardadas';\r\n\r\n\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{},\r\n async: false, \r\n success:function(respuesta){\r\n\r\n let vg = JSON.parse(respuesta);\r\n let html = \"\";\r\n for(var i=0; i<vg.length;i++){\r\n \r\n html += \"<button class='btn btn-warning btn-xs' onclick='cargar_venta(\"+JSON.stringify(vg[i][\"codigo_venta\"])+\")' title='\"+vg[i][\"codigo_venta\"]+\" \"+vg[i][\"nombre_venta\"]+\"'><fa class='fa fa-cart-arrow-down'></fa> <br>\"+Number(vg[i][\"totalbs\"]).toFixed(2)+\"<br>\"+\"</button>\";\r\n \r\n }\r\n \r\n $(\"#div_ventas_guardadas\").html(html);\r\n \r\n\r\n },\r\n error:function(respuesta){\r\n res = 0;\r\n }\r\n }); \r\n\r\n \r\n}", "title": "" }, { "docid": "9e9a78d02c46e30d73a372075380f095", "score": "0.6646455", "text": "function showUsulanMusnah(id, url) {\n $.ajax({\n type: \"post\",\n method: \"get\",\n url: url,\n data: \"id=\" + id,\n dataType: \"html\",\n beforeSend: function () {\n $(\"loadingModal\").append(\"sedang mengambil data . . . \");\n },\n success: function (response) {\n //$('#formUsulanMusnah').empty();\n //$('#formUsulanMusnah').append(response);\n document.getElementById(\"formUsulanMusnah\").innerHTML = response;\n },\n complete() {\n $(\"loadingModal\").append(\"\");\n },\n });\n}", "title": "" }, { "docid": "af291c040d50698754db74ac16919ce4", "score": "0.6642351", "text": "function loadTableBody(){\n\tvar x = $(\"#tb_prenota tbody\"); //ottieni riferimento a <tbody>\n\tvar lab = $(\"#idLab\").text();\n\t$.post(\"../postazioni\", {\"action\": \"lista_pos_json\", \"id_lab\":lab }, function(resp, stat, xhr){\n\t\tif(xhr.readyState == 4 && stat == \"success\"){\n\t\t\tvar o = JSON.parse(resp); //conversione in oggetto JS da strina JSON ricevuta da servlet\n\t\t\tvar size = sizeObject(o); //calcolo del numero di proprieta' presenti nell'oggetto\n\t\t\tvar str = \"\";\n\t\t\tfor(var i=0; i < size; i++){\n\t\t\t\tvar k = o[\"post\"+i]; //prendi l'oggetto JS associato alla proprieta' 'pren' dell'oggetto JS\n\t\t\t\tif(k.stato){\t//se il laboratorio e' aperto, mostra postazioni disponibili\n\t\t\t\t\tstr+= \"<tr><td name=\\\"numeroPost\\\">\" + k.numero + \"<td><select name=\\\"fascia_oraria_action\\\" onChange=\\\"verifyPostazioneAvailable($(this));\\\">\" +\n\t\t\t\t\t\t\"<option value=\\\"09:00-11:00\\\">Mattina (9 - 11)</option><option value=\\\"11:00-13:00\\\">Mattina (11 - 13)</option>\"+\n\t\t\t\t\t\t\"<option value=\\\"13:00-15:00\\\">Pomeriggio (13 - 15)</option><option value=\\\"15:00-17:00\\\">Pomeriggio (15 - 17)</option></select></td>\" +\n\t\t\t\t\t\t\"<td><button name=\\\"effettuaPren_button\\\" type=\\\"button\\\" onclick=\\\"effettuaPrenotazione($(this))\\\">Prenota</button></td></tr>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$(\"#div_tb_prenota_content\").show();\n\t\t\tx.html(str);\n\t\t\t\n\t\t\t//inserite qui perche' AJAX effettua richieste asincrone\n\t\t\tdeletePostazioniOccupateFromSelect();\n\t\t\tdeleteFasceOrarieByOraCorrente();\n\t\t}else{\n\t\t\twindow.location.href = \"./error.jsp\"; //pagina errore 404\n\t\t}\n\t});\n}", "title": "" }, { "docid": "f2120350a34bedf3ddbfe15fb1f93f40", "score": "0.6641801", "text": "function kustutaKirjed() {\n // Tee lisatakse allik-URL-le (origin)\n var url = '/kustuta';\n var perioodiMuster = $('#perioodiMusterKustuta').val();\n if (perioodiMuster && perioodiMuster.length > 0) {\n url = url + '?p=' + perioodiMuster;\n }\n // Puhasta eelmine tulem\n $('#Tulem').text('');\n $('#AutentimisteArv').text('');\n\n // AJAX-päringutes parem kasutada ajax meetodit\n $.ajax({\n url: url,\n method: 'DELETE',\n dataType: \"json\",\n data: null,\n error: (jqXHR, textStatus, errorThrown) => {\n console.log('Serveri poole pöördumine ebaõnnestus: ',\n textStatus, ': ', errorThrown);\n kuvaTeade('Serveri poole pöördumine ebaõnnestus', 'viga');\n },\n success: (data, status, xhr) => {\n /* Saadud andmed on kujul\n { err: null v veateade,\n kustutati: 1 }\n */\n if (data.err === null) {\n kuvaTeade('Kustutati ' + data.kustutati.toString() +\n ' kirjet.', 'info');\n }\n else {\n console.log('/kustuta: ' + data.err);\n kuvaTeade(data.err, 'viga');\n }\n }\n });\n}", "title": "" }, { "docid": "4b8deab5000bf82e8bbbb01e06a9b5e1", "score": "0.66413295", "text": "function btn_ver_entrega()\n {\n var ID_entrega = $('#ID_contenido').val();\n var ob ={ID_entrega:ID_entrega};\n \n $.ajax({\n type: 'POST',\n url:'../vista/vista_examinar_entrega.php',\n data: ob,\n beforeSend: function(objeto){\n \n },\n success: function(data)\n { \n $('#panel_examinar_entrega').html(data);\n }\n });\n }", "title": "" }, { "docid": "14cf29354c432f450010a860be9523fb", "score": "0.66379195", "text": "function peticionAjaxGenerica(){\n //$(\"#contenido_de_ajax\").load(\"ejempklo-17-fichero_alojado_en_servidor.txt\");\n $.ajax({\n //Puede ser una cadena, un array o un objeto de JS\n //Asi aparece en el url los datos\n //?nombre=Ruben&nivel_de_cafe=medio\n data: {nombre:\"Ruben\", nivel_de_cafe: \"medio\"},\n //Tipo de peticion http\n type:\"GET\",\n //tipo de dato esperado\n dataType: \"json\",\n //URL de comunicacion con el servicio\n //url: \"https://jsonplaceholder.typicode.com/albums\"\n //url: \"https://jsonplaceholder.typicode.com/users\"\n url: \"http://localhost:3000/peliculas\" \n }).done(peticionCompletada).fail(peticionFallida);\n}//Fin de peticionAjaxGenerica (GET)", "title": "" }, { "docid": "817d36bfd17a91b3e04414023b6ac3d7", "score": "0.6635929", "text": "function onLoadGrKelas(e){\n\t\t$.ajax({\n\t\t\ttype : 'POST',\n\t\t\turl : 'ajax-adm.php',\n\t\t\tdata : {\n\t\t\t\ttxInd : 'guru-for-kelas',\n\t\t\t},\n\t\t\tcomplete : function(response){\n\t\t\t\t$(\".option-kelas-guru\").html(response.responseText);\n\t\t\t},\n\t\t\terorr : function(){\n\t\t\t\talert(\"Connection to database failed!\");\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "1314723771f329f8bc406deae0c39df4", "score": "0.66252315", "text": "function TraerTipoBienes(ActualizarTipoBienes)\n{ \n var IdTipoBienes=ActualizarTipoBienes;\n var NombreProceso=\"TraerTipoBienes\";\n var parametros = {\"NombreProceso\" : NombreProceso,\"IdTipoBienes\":IdTipoBienes};\n $.ajax({\n data: parametros,\n url: '../modulos/inventario/funciones.php',\n type: 'post', \n success: function (response) { \n var datos = JSON.parse(response);\n document.getElementById(\"TipoBienesId\").value = datos[0].IdTipoBienes;\n document.getElementById(\"NuevoTipoBienesNombre\").value = datos[0].NombreTipoBienes;\n \n \n }\n });\n}", "title": "" }, { "docid": "0f0913b518acc3d07dccb4b73166f266", "score": "0.66228235", "text": "function taakButton(i){\n\tdataString = \"gebruikersnaam=\" + window.sessionStorage.getItem(\"gebruikersnaam\") + \"&taakNr=\" + i + \"&method=voltooid\";\n\t$.ajax({\n\t\t type: \"GET\",\n\t\t url: \"/schoonmaakapp/SchemaServlet\",\n\t\t data: dataString,\n\t\t dataType: \"text\",\n \n\t\t success: function(d) {\n\t\t\t //schema herladen nadat taak als voltooid is opgeslagen\n\t\t\t window.location.assign(\"schema.html\");\n\t\t },\n \n\t\t error: function(jqXHR, textStatus, errorThrown){\n\t\t\t console.log(\"error: \" + textStatus);\n\t\t },\n \n\t });\n}", "title": "" }, { "docid": "f7d8c80a8a706e72dc27ad22b43e8752", "score": "0.6622019", "text": "function survol(e)\n{\n\t\n\t$.ajax(\n\t\t\t\t{\n\t\t\t\t\turl: \"calendrier/affichageReservations.php\",\n\t\t\t\t\tdata: {id:e},\n\t\t\t\t\ttype : \"GET\",\n\t\t \t\t//dataType : \"json\",\n\t\t\t\t\t success: function(data) {\n\t\t\t\n\t\t \t\t\t\t\n\t\t \t\t\t\t\n\t\t \t\t\t\t//Modification de l'affichage du nombre de place \n\t\t \t\t\t\t//$('#nombrePlace').text(data.valPlace);\n\t\t \t\t\t\t\n\t\t \t\t\t\t\n\t\t \t\t\t\t\n\t\t \t\t\t\t$(\"#listeDesInscripts\").html(data);\n\t\t \t\t\t\t\n\t\t \t\t\t\t\n\t\t \t\t\t\t//cacher la fenetre modale\n\t\t \t\t\t\t//$('#myModal2').modal('hide');\n\t\t \t\t\t\n \t\t\t\t},\n \t\t\t\terror : function(data) { alert(code) }\n \t\t }\n\t);\n\t\n\t\n\treturn false;\n\t\n\t\n\t\n\t\n}", "title": "" }, { "docid": "b0910ae83f9341b8c990811fac61a673", "score": "0.66185856", "text": "function ver_info_consulta_med(id_consulta_medica){\r\n \r\n var baseURL = $('body').data('baseurl');//url base\r\n \r\n $('#info_detalle').html('<i class=\"fa fa-spinner fa-spin fa-5x\"></i> Cargando Información Consulta Médica...');\r\n \r\n $.ajax({\r\n data: {\"id_consulta_med\" : id_consulta_medica},\r\n type: \"POST\",\r\n dataType: \"html\",\r\n url: baseURL+\"ficha_medica/detalle_consulta_medica\",\r\n success: function(resp){\r\n \r\n //Cargamos datos revision por sistema\r\n $('#info_detalle').html(resp);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "088e82bce58ddbf59305a1b7aa95bd4c", "score": "0.6617131", "text": "function okunmaAdedi(data)\n{\n $.post(\"ajax.php?form_type=okunmaAdedi\", data);\n}", "title": "" }, { "docid": "4b24062e7b7da7d228b31c829d4bc49b", "score": "0.66155", "text": "function charger_dossier_table()\n{\n site = parseInt($('#site').val().trim());\n lien = Routing.generate('dossier_dossiers')+'/'+site; \n \n $.ajax({\n data: {},\n url: lien,\n contentType: \"application/x-www-form-urlencoded;charset=utf-8\",\n beforeSend: function(jqXHR) {\n jqXHR.overrideMimeType('text/html;charset=utf-8');\n },\n dataType: 'html',\n success: function(data){\n $('#js_activation_dossier').html(data);\n gerer_height();\n }\n });\n}", "title": "" }, { "docid": "0b0c3acfcfa9246a8fa0693173918f23", "score": "0.6615473", "text": "function cecodiRechercheComplete(pseudo){\r\n\tif(pseudo !='') {\r\n\t\tcecodiRechercheDirect();\r\n\t\t$('cecodiBox').innerHTML = \"<img class='centerimage' src='../images/attente.gif'/>\";\r\n\t\tnew Ajax.Request('../cecodis/cecodi_recherche_complete.php',\r\n\t\t\t{\r\n\t\t\t\tmethod:'get',\r\n\t\t\t\tparameters: {pseudo: pseudo},\r\n\t\t\t\trequestHeaders: {Accept: 'application/json'},\r\n\t \t\t\tonSuccess: function(transport, json){\r\n\t \t\t\t\t$('cecodiBox').innerHTML = transport.responseText;\r\n\t \t\t },\r\n\t\t\t onFailure: function(){ alert(\"failure\");} \r\n\t\t\t});\r\n\t} else {\r\n\t\t$('cecodiBox').innerHTML = \"\";\r\n\t}\r\n}", "title": "" }, { "docid": "a6162765f6ceead702d93cae94805442", "score": "0.6611949", "text": "function TraerBienes(IdBienes)\n{\n var IdBienes=IdBienes;\n var NombreProceso=\"TraerBienes\";\n var parametros = {\"NombreProceso\" : NombreProceso,\"IdBienes\":IdBienes};\n $.ajax({\n data: parametros,\n url: '../modulos/inventario/funciones.php',\n type: 'post',\n beforeSend: function () {\n },\n success: function (response) {\n var datos = JSON.parse(response);\n //console.log(datos);\n document.getElementById(\"BienesId\").value = datos[0].IdBienes;\n document.getElementById(\"NuevoBienesNombre\").value = datos[0].NombreBienes;\n document.getElementById(\"NuevoBienesValor\").value = datos[0].ValorBienes; \n document.getElementById(\"NuevoBienesEstado\").value = datos[0].EstadoBienes;\n document.getElementById(\"NuevoBienesIdTipoBienes\").value=datos[0].IdTipoBienes;\n document.getElementById(\"NuevoBienesObservaciones\").value=datos[0].ObservacionBienes; \n }\n });\n}", "title": "" }, { "docid": "a2dc7b2ca45db7f8963d53fe21842a46", "score": "0.66109544", "text": "function fTablaAjax()\n{\n\tvar xmlhttp;\n\tvar Campo = $('#txtBusqueda').val();\n\tvar VentPadre = $('#txtVentPadre').val();\n\tvar Pagina = $('#txtPagina').val();\n\tvar TamanoPagina = $('#txtTamanoPagina').val();\n\tvar Estatus = $('#cmbEstatus').val();\n\tvar IdMotivoCambioE = $('#cmbIdMotivoCambioEBusq').val();\n\tvar IdMateriaPrima = $('#cmbIdMateriaPrimaBusq').val();\n\t\n\tif (window.XMLHttpRequest)\t{// code for IE7+, Firefox, Chrome, Opera, Safari\n\t\txmlhttp = new XMLHttpRequest();\n\t}\n\telse\t{// code for IE6, IE5\n\t\txmlhttp = new ActiveXObject('Microsoft.XMLHTTP');\n\t}\n\t\n\txmlhttp.onreadystatechange=function()\n\t{\n\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200)\t{\n\t\t\t$('#divTablaBusqueda').html(xmlhttp.responseText);\n\t\t}\n\t}\n\t\n\t/*SCRIPT QUE CONTENTRA LA TABLA*/\n\txmlhttp.open('POST','../Modelos/Scripts/InventarioMP.ajax.php',true);\n\txmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');\n\t/*DATOS A ENVIAR AL SCRIPT DE LA TABLA*/\n\txmlhttp.send('Campo=' + Campo + '&Pagina=' + Pagina + '&TamanoPagina=' + TamanoPagina + '&VentPadre=' + VentPadre + '&Estatus=' + Estatus + '&IdMotivoCambioE=' + IdMotivoCambioE + '&IdMateriaPrima=' + IdMateriaPrima);\n}", "title": "" }, { "docid": "7cd6adf4b2d6336b601d5483d0cd98b3", "score": "0.65979254", "text": "function searchForDetalle(id){\n var action= 'searchForDetalle';\n var user= id;\n\n $.ajax({\n url : 'ajax.php',\n type : \"POST\",\n async: true,\n data: {action:action,user:user},\n success: function(response){\n // console.log(response);\n if(response!= 'error'){\n var info = JSON.parse(response);\n // console.log(info);\n $('#detalle_venta').html(info.detalle);\n $('#detalle_totales').html(info.totales);\n //bloque de campos\n $('#txt_cant_producto').attr('disabled','disabled');\n\n }else{\n console.log('contacta con Teams de desarrollador');\n } \n \n },\n error: function(error){\n }\n });\n \n}", "title": "" }, { "docid": "208f3af498869b0c61a01510d845ace8", "score": "0.65890694", "text": "function _mojeNapoje() {\r\n document.getElementById('result').innerHTML = '';\r\n request = getRequestObject();\r\n request.onreadystatechange = function() {\r\n if (request.readyState == 4) {\r\n objJSON = JSON.parse(request.response);\r\n var txt = `\r\n <table class=\"MenuTable\">\r\n <thead><tr>\r\n <td width=\"30%\">Czas sprzygotowania</td>\r\n <td width=\"10%\">Liczba porcji</td>\r\n <td width=\"10%\">Napój</td>\r\n <td width=\"15%\">Alkohol</td>\r\n <td width=\"15%\">Koktajl</td>\r\n </tr></thead>\r\n `;\r\n for (var id in objJSON) {\r\n obj = objJSON[id];\r\n txt += `\r\n <tr>\r\n <td>`+obj['czas_przygotowania']+` min</td>\r\n <td>`+obj['liczba_porcji']+` szt.</td>\r\n <td>`+obj['napoj']+`</td>\r\n <td>`+obj['alkohol']+`</td>\r\n <td>`+obj['koktajl']+`</td>\r\n </tr>\r\n `;\r\n }\r\n txt += `</table>`;\r\n document.getElementById('data').innerHTML = txt;\r\n }\r\n }\r\n request.open(\"GET\", baseURL+\"mojeNapoje\");\r\n request.send(null);\r\n}", "title": "" }, { "docid": "9e345e60266bb1e49d94c7cbacb5b475", "score": "0.6586956", "text": "function acount_ajax_handler() {\n var ajaxgo = false; // глобальная переменная, чтобы проверять обрабатывается ли в данный момент другой запрос\n // после загрузки DOM\n var userform = $('.userform'); // пишем в переменную все формы с классом userform\n function req_go(data, form, options) { // ф-я срабатывающая перед отправкой\n if (ajaxgo) { // если какой либо запрос уже был отправлен\n form.find('.response').addClass('response-block');\n form.find('.response').html('<p class=\"error\"><?php _e( \"Waite...\") ?></p>'); // в див для ответов напишем ошибку\n return false; // и ничего не будет делать\n }\n form.find('input[type=\"submit\"]').attr('disabled', 'disabled'); // выключаем кнопку и пишем чтоб подождали\n form.find('.response').html(''); // опусташаем див с ответом\n ajaxgo = true; // записываем в переменную что аякс запрос ушел\n }\n function req_come(data, statusText, xhr, form) { // ф-я срабатывающая после того как пришел ответ от сервера, внутри data будет json объект с ответом\n console.log(arguments); // это для дебага\n var response = '';\n if (data.success) { // если все хорошо и ошибок нет\n response = '<p class=\"success\">' + data.data.message + '</p>'; // пишем ответ в <p> с классом success\n } else { // если есть ошибка\n response = '<p class=\"error\">' + data.data.message + '</p>'; // пишем ответ в <p> с классом error\n form.find('.response').addClass('response-block');\n form.find('.response').html(response); // выводим ответ\n }\n \n if (data.data.redirect) window.location.href = data.data.redirect; // если передан redirect, делаем перенаправление\n ajaxgo = false; // аякс запрос выполнен можно выполнять следующий\n }\n\n var args = { // аргументы чтобы прикрепить аякс отправку к форме\n dataType: 'json', // ответ будем ждать в json формате\n beforeSubmit: req_go, // ф-я которая сработает перед отправкой\n success: req_come, // ф-я которая сработает после того как придет ответ от сервера\n error: function(data) { // для дебага\n console.log(arguments);\n },\n url: ajax_var.url // куда отправляем, задается в wp_localize_script\n };\n userform.ajaxForm(args); // крепим аякс к формам\n\n $('.logout').click(function(e){ // ловим клик по ссылке \"выйти\"\n e.preventDefault(); // выключаем стандартное поведение\n if (ajaxgo) return false; // если в данный момент обрабатывается другой запрос то ничего не делаем\n var lnk = $(this); // запишем ссылку в переменную\n $.ajax({ // инициализируем аякс\n type: 'POST', // шлем постом\n url: ajax_var.url, // куда шлем\n dataType: 'json', // ответ ждем в json\n data: 'action=logout_me&nonce=' + $(this).data('nonce'), // что отправляем\n beforeSend: function(data) { // перед отправкой\n ajaxgo = true; // аякс отпраляется\n },\n success: function(data){ // после того как ответ пришел\n if (data.success) { // если ошибок нет\n window.location.reload(true); // и обновляемся\n } else { // если ошибки есть\n alert(data.data.message); // просто покажим их алертом\n }\n },\n error: function (xhr, ajaxOptions, thrownError) { // для дебага\n console.log(arguments);\n },\n complete: function(data) { // при любом исходе\n ajaxgo = false; // аякс больше не выполняется\n }\n });\n });\n }", "title": "" }, { "docid": "b1825f96b3d8d8955c12f3ceb6e385a6", "score": "0.6582395", "text": "function chitiet(cnt){\r\n\t\t$('.chitiet-box').show();\r\n\t\tvar get_chitiet_id=\"#ma_hd\"+cnt;\r\n\t\tvar get_loai_hd=\"#loaihd\"+cnt;\r\n\t\tvar chitiet_id=$(get_chitiet_id).val();\r\n\t\tvar loai_hd=$(get_loai_hd).val();;\r\n\t\t$('#ma_hd').val(chitiet_id);\r\n\t\r\n\t\t$.ajax({\r\n\t\t\ttype:\"POST\",\r\n\t\t\turl:\"modules/ql/modules/lichsu/xuly.php\",\r\n\t\t\tdata:\"chitiet=\"+chitiet_id+\"&loai=\"+loai_hd,\r\n\t\t\tdataType:\"json\",\r\n\t\t\tsuccess: function(obb){\r\n\t\t var cntt=(Object.keys(obb).length);\r\n\t\t\t\tvar i=0;\r\n\t\t\t\t$('#tbody_chitiet').empty();\r\n\t\t\t\twhile(i<=cntt){\r\n\t\t\t\t\t$('#tbody_chitiet').append(\"<tr><td>\"+obb[i].sanpham_id+\"</td><td class='td_ten'>\"+obb[i].ten_sanpham+\"</td><td class='td_giatri'>\"+obb[i].gia+\"</td><td class='td_giatri'>\"+obb[i].soluong+\"</td><td class='td_giatri'>\"+obb[i].thanhtien+\"</td></tr>\");\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n}", "title": "" }, { "docid": "4adb3f50cf026ca7376d0d9b9519c6e1", "score": "0.657461", "text": "function queryAjax() {\n console.log('Посылаю запрос принимай')\n }", "title": "" }, { "docid": "2f23a0ea1187be93f535504155890147", "score": "0.6573879", "text": "function hitung_peramalan(){\n\t\t$.ajax({\n\t\t\turl: base_url+'app/controllers/Perencanaan_bahan_baku.php',\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tdata: {\n\t\t\t\t'action': $(\"#btnHitung_peramalan\").val().trim(),\n\t\t\t\t'periode': $(\"#periode\").val().trim(),\n\t\t\t\t'produk': $(\"#produk\").val().trim(),\n\t\t\t},\n\t\t\tbeforeSend: function(){\n\t\t\t\tsetLoading();\n\t\t\t},\n\t\t\tsuccess: function(output){\n\t\t\t\tconsole.log(output);\n\t\t\t\tsetLoading(false);\n\t\t\t\t// setValue_peramalan(output.setValue);\n\t\t\t\tif(!output.status){\n\t\t\t\t\t$.toast({\n\t\t\t\t\t\theading: 'Pesan Error',\n\t\t\t\t\t\ttext: 'Harap Cek Kembali Field Periode dan Produk!',\n\t\t\t\t\t\tposition: 'top-right',\n\t\t\t loaderBg: '#ff6849',\n\t\t\t icon: 'error',\n\t\t\t hideAfter: 3000,\n\t\t\t stack: 6\n\t\t\t\t\t});\n\t\t\t\t\tsetError_peramalan(output.setError);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlistJumlahBahanBaku = [];\n\t\t\t\t\tindexJumlahBahanBaku = 0;\n\n\t\t\t\t\tvar index = indexJumlahBahanBaku++;\n\n\t\t\t\t\t$('#tabel_jumlah_bahanBaku tbody tr').each(function (index) {\n\t\t\t\t\t $(this).remove(); // hapus data ditabel\n\t\t\t\t\t});\n\n\t\t\t\t\t$.each(output.jumlah_bahanBaku, function(index, item){\n\t\t\t\t\t\tvar dataKomposisi = {\n\t\t\t\t\t\t\tindex: index,\n\t\t\t\t\t\t\tid_komposisi: item.id_komposisi,\n\t\t\t\t\t\t\tid_bahan_baku: item.id_bahan_baku,\n\t\t\t\t\t\t\tkd_bahan_baku: item.kd_bahan_baku,\n\t\t\t\t\t\t\tnama_bahan_baku: item.nama_bahan_baku,\n\t\t\t\t\t\t\tsatuan_bahan_baku: item.satuan_bahan_baku,\n\t\t\t\t\t\t\tpenyusutan: item.penyusutan,\n\t\t\t\t\t\t\tjumlah_bahanBaku: item.jumlah_bahanBaku,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tlistJumlahBahanBaku.push(dataKomposisi);\n\t\t\t\t\t});\n\n\t\t\t\t\t$('#hasil_perencanaan').val(parseFloat(output.hasilPeramalan));\n\t\t\t\t\t$('.field-hasil-perencanaan').removeClass('has-error').addClass('has-success');\n\t\t\t\t\t$(\".field-hasil-perencanaan span.help-block\").text('');\n\t\t\t\t\tvar temp_nilai_d = parseFloat(output.hasilPeramalan) / 24;\n \t\t\t\t$('#nilai_d').val(temp_nilai_d.toFixed(2));\n\n\t\t\t\t\t// tabel jumlah bahan baku\n\t\t\t\t\t$.each(listJumlahBahanBaku, function(index, item){\n\t\t\t\t\t\t$(\"#tabel_jumlah_bahanBaku > tbody:last-child\").append(\n\t\t\t\t\t\t\t\"<tr>\"+\n\t\t\t\t\t\t\t\t\"<td></td>\"+ // nomor\n\t\t\t\t\t\t\t\t\"<td>\"+item.kd_bahan_baku+\"</td>\"+ // kode\n\t\t\t\t\t\t\t\t\"<td>\"+item.nama_bahan_baku+\"</td>\"+ // bahan baku\n\t\t\t\t\t\t\t\t\"<td>\"+item.jumlah_bahanBaku+\" \"+item.satuan_bahan_baku+\"</td>\"+ // jumlah\n\t\t\t\t\t\t\t\t// \"<td>\"+field_jumlah_bahanBaku(item.jumlah_bahanBaku.toFixed(2), item.satuan_bahan_baku, item.index)+\"</td>\"+ // jumlah\n\t\t\t\t\t\t\t\"</tr>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnumberingList_jumlah_bahanBaku();\n\t\t\t\t\t});\n\n\t\t\t\t\tconsole.log(listJumlahBahanBaku);\n\t\t\t\t}\t\n\t\t\t},\n\t\t\terror: function (jqXHR, textStatus, errorThrown){ // error handling\n\t setLoading(false);\n\t swal(\"Pesan Error\", \"Operasi Gagal, Silahkan Coba Lagi\", \"error\");\n\t console.log(jqXHR, textStatus, errorThrown);\n\t }\n\t\t})\n\t}", "title": "" }, { "docid": "7a955358468145ca08eeb0f6a7131d67", "score": "0.6569487", "text": "function verif_num3(nom,long_min)\r\n{\r\n\t\r\n\t// var code=document.getElementsByName(nom)[0].value;\r\n\t// console.log(code);\r\n // $.ajax(\"verif_num.php\", {\r\n\t// \t\"type\":\"POST\",\r\n\t// \t\"data\": { \"valeur\": code, \"longueur\": long_min },\r\n\t// \t\"dataType\":\"json\"\r\n\t// }).done(function(obj) {\r\n\t// \tif ( obj.success==true) {\r\n\t// \t\tconsole.log(\"VALIDE\");\r\n\t// \t\tdocument.forms[0].elements[nom].style.backgroundColor = \"white\"; \r\n\t// \t} else {\r\n\t// \t\talert(\"Veuillez entrer pour cette variable un nombre de \" + long_min + \" chiffres minimum.\");\r\n\t// \t\tdocument.forms[0].elements[nom].style.backgroundColor = \"red\";\r\n\t// \t}\r\n\t// }).fail( function(jqXHR,textStatus,errorThrown) {\r\n\t// \talert(\"Erreur\");\r\n\t// }).always(function(jqXHR,textStatus) {\r\n\t// \tconsole.log(\"fin du test\");\r\n\t\t\r\n\t// });\r\n \r\n \r\n}", "title": "" }, { "docid": "40d4b89529d7684d1dab7d39467100d2", "score": "0.6567635", "text": "function loadnumintegrantes(){\n\n\n\t\tvar clienteresponse = [\"Falla al cargar el número de integrantes\"];\n\n\t\tURL = now + \"index.php/api/cuentageneralrest/getnumintegrantescuenta/format/json/\"; \n\n\n\t\t$.get(URL).done(function(data){\n\t\t\t\n\t\t\tllenaelementoHTML(\"#numerointegrantes\" , data);\n\t\t}).fail(function(){\n\n\t\t\tllenaelementoHTML(\"#numerointegrantes\" , clienteresponse[0]);\n\n\t\t});\n\t\t/*Termina AJAX*/\n\n}", "title": "" }, { "docid": "4cf6ddf01751796e2ccf12a76ac93839", "score": "0.65648085", "text": "function modif(servicio)\n{\n //alert(servicio)\n var url=\"datos.php\"\n var formulario = $('modificacion')\n var pars = \"opcion=6&servicio=\"+servicio+\"&\"+Form.serialize(formulario)\n var myAjax = new Ajax.Request(url,\n {\n method: 'post',\n parameters: pars,\n onComplete: function gen(t)\n {\n precarga()\n $('debug').innerHTML = t.responseText\n \n }\n });\n \n}", "title": "" }, { "docid": "4f3b1a7ae12efcf4f0ade285f6988721", "score": "0.6562653", "text": "function datosClienteCaja ()\n{\n\tconsole.log(\"entro a datosClienteCaja\");\n\tvar id = $('#id_nota_remision').val();\n\tconsole.log('el de la orden de compra es ='+id);\n\t\n\tif (id != \"\")\n\t{\n\t $.ajax({\n\t\t\t\t\t type: 'POST',\n\t\t\t\t\t url: 'ventas/vi_clienteCaja.php',\n\t\t\t\t\t data: 'id='+id,\n\t\t\t\t\t cache:false,\n\t\t\t\t\t success:function(msj){\n\t\t\t\t\t\t //alert (\"el msj = \"+msj);\n\t\t\t\t\t\t console.log(\"el msj de datosClienteCaja es= \"+msj);\n\t\t\t\t\t\t var cadena = msj.split(\"|\");\n\t\t\t\t\t\t \n\t\t\t\t\t\t $('#nombre').html(cadena[0]);\n\t\t\t\t\t\t $('#cantidadp').html(cadena[1]);\n\t\t\t\t\t\t $('#totalg').val(cadena[2]);\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t \t\t\t\t\t\t \n\t\t\t\t\t },\n\t\t\t\t\t error:function(){\n\t\t\t\t\t\t console.log ('entro en error function');\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t });\n\t}//fin del if\n\t\n}", "title": "" }, { "docid": "dc0fcf49657430f9cd68b0441d9c0b96", "score": "0.6560971", "text": "function traerOfertas() {\n $.ajax({\n method: \"POST\",\n url: \"views/Recolector/viewOfertas.php\",\n type: 'json',\n data: {\n 'funcion': 'traerOfertas',\n 'idPersona': localStorage.getItem('idPersona')\n },\n beforeSend: function() {\n //$('#cargaMat' + idMat).removeClass('d-none');\n }\n }).done(function(msg) {\n if (msg != -1) {\n var info = JSON.parse(msg);\n if (!info.infoOfertas) {\n $('#cargaTablaOfertas').html('No hay ofertas para mostrar')\n } else {\n muestraOfertas(info);\n }\n }\n });\n}", "title": "" }, { "docid": "ce865158ea0beda1abcbb8d6f4f8a4e7", "score": "0.6559563", "text": "function getNodos(){\n $.ajax({\n type: 'GET',\n contentType: 'application/json',\n url:rootURLgetNodos ,\n dataType: \"json\",\n success: renderNodos\n });\n}", "title": "" }, { "docid": "040910d1283f6568330e9da6ca6835cd", "score": "0.6554152", "text": "function getModuloExtra() {\r\n\tvar idSeccion = $('idSeccion').value;\r\n\tvar precio = $('precio').value;\r\n\tvar estaDisponible = $('estaDisponible').value;\r\n\tnew Ajax.Request('/GetModuloExtraAction.do?param=' + Math.random()\r\n\t\t\t+ '&idSeccion=' + idSeccion + '&precio=' + precio + '&idArticulo='\r\n\t\t\t+ $('idArticulo').value + '&estaDisponible=' + estaDisponible, {\r\n\t\tmethod : 'get',\r\n\t\tonSuccess : function(transport) {\r\n\t\t\tif (transport.readyState == 4) {\r\n\t\t\t\t//alert(transport.responseText);\r\n\t\t\t\t$('divModuloExtra').innerHTML = '';\r\n\t\t\t\t$('divModuloExtra').innerHTML = transport.responseText;\r\n\t\t\t\t//agrego llamado para mostrar el div de las redes sociales\r\n\t\t\t\t//getDivRedesSociales();\r\n\t\t\t} else {\r\n\t\t\t\t$('divModuloExtra').innerHTML = 'Cargando comentarios!!!';\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "fd71489481ecd83b2193788cecf89a9c", "score": "0.65513545", "text": "function liste_suivant() {\r\n\t\t\r\n\t\tdernierDuel=$('last_duel').innerHTML;\r\n\t\tajax('get', 'pages/duel_ajax.php', 'act=liste&dernier='+escape(dernierDuel)+'&ordre=suivant', 'afficher_liste');\r\n\t\t\r\n\t}", "title": "" }, { "docid": "0a703651812c1410ff03fc0b27438037", "score": "0.654896", "text": "function selecteaza(){\n\n\tif (window.XMLHttpRequest){\n\t xmlhttp=new XMLHttpRequest();\n\t}\n\telse{\n\t xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\n\txmlhttp.onreadystatechange=function() {\n\t if (this.readyState==4 && this.status==200) {\n\t document.getElementById(\"raspunsPHP\").innerHTML=this.responseText;\n\t }\n\t }\n\n\tJSON.stringify(locuri_selectate);\n\tvar locuri=convert(locuri_selectate);\n\n\txmlhttp.open(\"GET\", \"api/bilete.php?locuri=\"+locuri, true);\n\txmlhttp.send();\n\tvar f_loc = document.getElementById(\"bilete\");\n\tf_loc.value = JSON.stringify(scaune_selectate);\n}", "title": "" }, { "docid": "8a00014530b5dc0d846f016e27ddf2d2", "score": "0.65455335", "text": "function carga_datos_tarjeta_by_num(num_tarjeta){\n var token = $(\"input[name='token']\").val();\n\n $.ajax({\n type: \"POST\",\n dataType: 'json',\n url: \"./API/tarjetas/get_tarjeta_by_num/\" + num_tarjeta,\n data: {\"token\":token},\n success: function(resp){\n // console.log(resp.data);\n if(resp.data.length > 0){\n $(\"small[name='msg_no_encontrado']\").css(\"display\",\"none\");\n // Obtiene los datos del servicio\n var id = resp.data['0'].Id;\n var num_tarjeta = resp.data['0'].Tarjeta;\n var propietario = resp.data['0'].Propietario;\n var saldo = resp.data['0'].Saldo;\n // Setea los datos en el formulario\n $(\"input[name='cliente_consulta']\").val(propietario);\n $(\"input[name='saldo_consulta']\").val(\"$ \" + saldo);\n }else{\n $(\"small[name='msg_no_encontrado']\").css(\"display\",\"block\");\n $(\"input[name='cliente_consulta']\").val(\"-------------\");\n $(\"input[name='saldo_consulta']\").val(\"$ 0.00\");\n }\n },\n error : function(xhr, status) {\n console.log(xhr);\n }\n });\n}", "title": "" }, { "docid": "dcf4f1c6132731068da2768699fb030d", "score": "0.654538", "text": "function traeDatos(idcodigo){\n\tvar pars = '?c='+idcodigo;\n\tvar url = serverRoot+'php/datos_codigo.php';\n\tvar myAjax = new Ajax.Request(\n\turl, \n\t{\n\t\tmethod: 'get', \n\t\tparameters: pars, \n\t\tonComplete: poneDatos,\n\t\tonFailure: ErrorFunc\n\t});\t\t\n}", "title": "" }, { "docid": "a9ee6faab392c54dcd3380ecc3b2ca88", "score": "0.6544711", "text": "function do_get_detail_barang()\r\n{\r\n\t$.ajax({\r\n\t\ttype: \"post\",\r\n\t\turl: \"url\",\r\n\t\tdata: \"data\",\r\n\t\tdataType: \"dataType\",\r\n\t\tsuccess: function (response) {\r\n\t\t\t\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "f6c44d9bde7d53ae4668b82cf96c8e15", "score": "0.65277886", "text": "function cantidad_pacientes_espera() {\n\n $.ajax({\n url: 'ver_citas/cantidad_pacientes_espera',\n type: 'POST',\n // data:{fecha:fecha,sucursal:sucursal},\n dataType: 'html',\n beforeSend: function() {\n $('#cantpacienteEspera').html('<div align=\"center\"><h3>CARGANDO LA INFORMACION</h3><img src=\"../assets/images/progress.gif\" width=\"75\" height=\"75\"></div></div>');\n },\n success: function(html) {\n $('#cantpacienteEspera').html(html);\n }\n });\n}", "title": "" }, { "docid": "c519424883507b1813e350c2b525d2af", "score": "0.65229374", "text": "function initGrilla() {\n var cod = $('#txt_codigo_buscar').val() == \"\" ? \"\" : $('#txt_codigo_buscar').val();\n var tra = $('#txt_nombre_apellido_buscar').val() == \"\" ? \"\" : $('#txt_nombre_apellido_buscar').val();\n var dni = $('#txt_dni_buscar').val() == \"\" ? \"\" : $('#txt_dni_buscar').val();\n $.ajax({\n url: '/Cliente/TotalRegistrosCliente',\n type: 'get',\n data: { 'bean.idCliente': cod, 'bean.nombres': tra, 'bean.dni': dni },\n contentType: \"application/json; charset=utf-8\",\n dataType: 'json',\n success: function (resultado) {\n var TotalRegistro = resultado.resultado;\n creaPaginador(TotalRegistro);\n },\n error: function (xhr, ajaxOptions, thrownError) {\n\n alert(\"Error status code: \" + xhr.status);\n alert(\"Error details: \" + thrownError);\n }\n });\n\n}", "title": "" }, { "docid": "3fd33575e23f6ebf029c3a2d744a9972", "score": "0.65149385", "text": "function _selectNapoje() {\r\n document.getElementById('result').innerHTML = '';\r\n request = getRequestObject();\r\n request.onreadystatechange = function() {\r\n if (request.readyState == 4) {\r\n objJSON = JSON.parse(request.response);\r\n var txt = `\r\n <table class=\"napojeTable\">\r\n <thead><tr>\r\n <td width=\"35%\">Nazwa</td>\r\n <td width=\"20%\">Cena</td>\r\n <td width=\"20%\">Kalorie</td>\r\n </tr></thead>\r\n `;\r\n for (var id in objJSON) {\r\n obj = objJSON[id];\r\n txt += `\r\n <tr>\r\n <td>`+obj['nazwa']+`</td>\r\n <td>`+obj['cena']+` zł</td>\r\n <td>`+obj['kalorie']+` kcal</td>\r\n\r\n </tr>\r\n `;\r\n }\r\n txt += `</table>`;\r\n document.getElementById('data').innerHTML = txt;\r\n }\r\n }\r\n request.open(\"GET\", baseURL+\"selectNapoje\");\r\n request.send(null);\r\n}", "title": "" }, { "docid": "fa55bfd4fe98d64b65668d8e88e2c3c9", "score": "0.65134954", "text": "function calendrier(mois, annee) {\n var id = document.getElementById('id_objet').value;\n console.log(id);\n var xhr = new getXMLHttpRequest();\n console.log('haha');\n xhr.onreadystatechange = function () {\n //console.log(xhr.readyState);\n if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {\n //document.getElementById(\"loader\").style.display = \"none\";\n read_dat(xhr.responseText);\n } else if (xhr.readyState < 4) {\n //document.getElementById(\"loader\").style.display = \"inline\";\n }\n };\n xhr.open(\"POST\", \"../fonctions/ajaxCalendrier.php\", true);\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n //console.log(recherche);\n if(mois<0 || annee<0)\n {\n xhr.send(\"id=\" + id);\n }else\n {\n xhr.send(\"id=\" + id + \"&year=\" + annee + \"&month=\" + mois);\n }\n}", "title": "" }, { "docid": "1e7dba8051d68f67936efef694616349", "score": "0.6508362", "text": "function marca(id_cliente)\n{\n var url = \"datos.php\";\n var pars = \"opcion=2&cliente=\"+id_cliente;\n var myAjax = new Ajax.Request(url,\n {\n method: 'post',\n parameters: pars,\n onComplete: \n function gen(respuesta) \n { \n var datos = new String(respuesta.responseText);\n var finale = datos.split(';');\n $('id_cliente').value = finale[0];\n $('cliente').value = finale[1];\n $('listado_clientes').innerHTML = \"\";\n },\n onSuccess: ver_servicios_contratados(id_cliente)\n });\n}", "title": "" }, { "docid": "67921d0bf18fc46296715cd04e9fe698", "score": "0.6504893", "text": "function proizvodi(){\r\n $.ajax({\r\n url : \"assets/log/proizvodi.json\",\r\n method : \"GET\",\r\n type : \"json\",\r\n success : function(tipP) {\r\n let select = \"<select id='proizvodDrop'><option value='0'>Sve kategorije</option>\";\r\n\r\n\r\n for(let m of tipP) {\r\n select += `<option value='${m.naziv}'>${m.naziv}</option>`;\r\n }\r\n select += \"</select>\";\r\n document.querySelector(\"#tipProizvoda\").innerHTML = select;\r\n document.getElementById(\"proizvodDrop\").addEventListener(\"change\", function(){\r\n filtrirajPoTipu(this.value);\r\n });\r\n\r\n document.getElementById(\"sortirajRastuce\").addEventListener(\"click\", sortirajSveRastuce);\r\n document.getElementById(\"sortirajOpadajuce\").addEventListener(\"click\", sortirajSveOpadajuce);\r\n document.getElementById(\"sortirajImeRastuce\").addEventListener(\"click\", sortirajImeRastuce);\r\n document.getElementById(\"sortirajImeOpadajuce\").addEventListener(\"click\", sortirajImeOpadajuce);\r\n },\r\n error : function(xhr, error, status) {\r\n alert(status);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "bedce6a0d305d8c628ae8158547fe8b1", "score": "0.65030265", "text": "function getDivRedesSociales() {\r\n\tvar urlPage = $('urlPage').value;\r\n\tvar titulo = $('titulParaRedSocial').value;\t\r\n\tnew Ajax.Request('/articulo/componentes/compartir.jsp?param=' + Math.random()\r\n\t\t\t+ '&urlPage=' + urlPage + '&titulo=' + titulo,{\r\n\t\tmethod : 'get',\r\n\t\tonSuccess : function(transport) {\r\n\t\t\tif (transport.readyState == 4) {\r\n\t\t\t\t$('compartir').innerHTML = transport.responseText;\r\n\t\t\t} \r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "682fe3c1493f81c665a8cb723d36aca9", "score": "0.650091", "text": "function adSolicitud () {\n\n var hoy = new Date();\n hoy = fchDATEaSQL(hoy);\n //console.log(\"adSolicitud(): hoy -> \"+hoy);\n\n //var adatos = [idselneg,5,4,8,6,0,9,6,8,3,0];\n var adatos = [idselneg,$('.user_sexo').attr('value'),$('.user_edad').attr('value'),$('.user_motivo').attr('value'),hoy,\n $('.client_1').attr('value'),$('.client_2').attr('value'),$('.client_3').attr('value'),\n $('.client_4').attr('value'),$('.client_5').attr('value'),$('.client_6').attr('value'),\n amulti1[0],amulti1[1],amulti1[2],amulti1[3],amulti1[4],amulti1[5],amulti1[6],amulti1[7],\n $('.client_7').attr('value'),$('.ubic_1').attr('value'),\n amulti2[0],amulti2[1],amulti2[2],amulti2[3],amulti2[4],amulti2[5],amulti2[6],\n $('.ubic_2').attr('value'),\n amulti3[0],amulti3[1],amulti3[2],amulti3[3],amulti3[4],amulti3[5],amulti3[6],amulti3[7],amulti3[8],amulti3[9],\n amulti4[0],amulti4[1],amulti4[2],amulti4[3],amulti4[4],\n $('.pers_1').attr('value'),$('.pers_2').attr('value'),$('.pers_3').attr('value'),0,0];\n \n //console.log(\"adSolicitud(): adatos2 -> \"+adatos2);\n //console.log(\"adSolicitud(): amulti1 -> \" + amulti1);\n\n //if ($(#idselneg).val() != 0) {\n $.ajax({\n url: '/adsolicitud', type: 'POST', contentType: 'application/json', \n data: JSON.stringify({a: adatos}),\n success: function (data) {\n location.href=\"#/resultados\";\n // $(\"#resultado1\").html(data[0].resultado1);\n // $(\"#resultado2\").html(data[0].resultado2);\n // $(\"#resultado3\").html(data[0].resultado3);\n // $(\"#resultado4\").html(data[0].resultado4);\n // $(\"#resultado5\").html(data[0].resultado5);\n // console.log(\"adSolicitud(): data.length: \"+data.length);\n // console.log(\"adSolicitud(): data[0].resultado1: \"+data[0].resultado1);\n // console.log(\"adSolicitud(): data[0]: \"+data[0]);\n // console.log(\"adSolicitud(): data: \"+data);\n rdatos = data;\n },\n error: function (xhr, status, error) {console.log('Error: ' + error.message); console.log(\"Error conexión Ajax\");\n //$('#lblResponse').html('Error connecting to the server.');\n }\n }); \n //};\n}", "title": "" }, { "docid": "67e08b568d663a2b3d76196fcb0227cf", "score": "0.65005976", "text": "function rechercherParcours(){\n var depart = document.getElementsByName(\"depart\")[0].value;\n var arrivee = document.getElementsByName(\"arrivee\")[0].value;\n var date = document.getElementsByName(\"date\")[0].value;\n\n if(init==true)\n init=false;\n else if (depart==\"\" & arrivee==\"\"){\n return;\n }\n\n $.ajax({\n url: \"/chercherParcours\",\n data: {depart:depart,\n arrivee:arrivee,\n date:date}\n })\n .done(function(data) {\n if(data.length<=0){\n $(\"#message_failed_search\").show().delay(5000).fadeOut();\n }\n else{\n $(\"#tabcontenu\").empty();\n $.each(data, function (key, value) {\n $(\"#tabcontenu\").append(\n \"<tr>\"+\n \"<td><strong class='titre_parcour_mobile'>Départ: &nbsp;&nbsp;&nbsp;&nbsp;</strong>\"+ value.depart.nom +\"</td>\"+\n \"<td><strong class='titre_parcour_mobile'>Arrivée: &nbsp;&nbsp;</strong>\"+ value.arrivee.nom +\"</td>\"+\n \"<td>\" +\n \"<div class='ui divided list'>\" +\n \"<div><strong class='titre_parcour_mobile'>Date: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>\"+value.dateParcours+\"</div>\"+\n \"<div><strong class='titre_parcour_mobile'>heure: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>\"+value.heure + \"h\" + value.min + \"</div>\" +\n \"</div>\" +\n \"</td>\"+\n \"<td><strong class='titre_parcour_mobile'>Place: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>\" + value.nbPlacesInitiales+\"</td>\"+\n \"<td><strong class='titre_parcour_mobile'>Prix: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>\"+ value.prix +\"</td>\"+\n \"<td><div class='ui small negative disabled button'>Réserver</div></td>\"+\n \"</tr>\"\n );\n });\n }\n })\n .fail(function(error) {\n console.log(\"error\");\n })\n}", "title": "" }, { "docid": "a967cab4a7a37b61bb3d632643f392c9", "score": "0.64965004", "text": "function tipo_funt_alimento (id){\n\n var tipo_alimento = id;\n var alimento = document.getElementById('alimento');\n var respuesta_aliento = \"\";\n \n //var medida_practica = document.getElementById('medida_practica');\n //var medida_practica_cant = document.getElementById('medida_practica_cant');\n\n $.ajax({\n\n url: base_url+\"index.php/dashboardnuevo/alimentos\",\n type: 'POST',\n global: false,\n data: {tipo_alimento: tipo_alimento},\n beforeSend: function (xhr) {\n xhr.overrideMimeType(\"text/plain; charset=utf-8\");\n\n //definicion de spinner de carga el cual sera sustituido por los alimentos a penas llegue la respuesta del ajax\n alimento.innerHTML = '<div class=\"text-center\"><div class=\"spinner-border text-success\" role=\"status\"><span class=\"sr-only\">Loading...</span></div></div>';\n },\n success: function (data) {\n\n var $Obj=$.parseJSON(data);\n //$Obj=$.parseJSON(data);\n\n respuesta_aliento = $Code=$Obj['alimentos'];\n\n if (respuesta_aliento == \"\") {\n\n alimento.innerHTML = '<div class=\"text-center\">Error al Cargar, Verifique su Conexión a Internet.</div>';\n\n }else{\n\n alimento.innerHTML = respuesta_aliento;\n \n }\n\n }\n });\n}", "title": "" }, { "docid": "2a6cabd15b7d4077baa11514b71d3f8a", "score": "0.64963454", "text": "function _selectSzklanki() {\r\n document.getElementById('result').innerHTML = '';\r\n request = getRequestObject();\r\n request.onreadystatechange = function() {\r\n if (request.readyState == 4) {\r\n objJSON = JSON.parse(request.response);\r\n var txt = `\r\n <table class=\"napojeTable\">\r\n <thead><tr>\r\n <td width=\"35%\">Nazwa</td>\r\n <td width=\"20%\">Pojemność</td>\r\n </tr></thead>\r\n `;\r\n for (var id in objJSON) {\r\n obj = objJSON[id];\r\n txt += `\r\n <tr>\r\n <td>`+obj['nazwa']+`</td>\r\n <td>`+obj['pojemnosc']+` ml</td>\r\n\r\n </tr>\r\n `;\r\n }\r\n txt += `</table>`;\r\n document.getElementById('data').innerHTML = txt;\r\n }\r\n }\r\n request.open(\"GET\", baseURL+\"selectSzklanki\");\r\n request.send(null);\r\n}", "title": "" }, { "docid": "7cea2c8da5c30df9d8df1a437ad7e56f", "score": "0.64963305", "text": "function prikaziPrijaveZaAdmina(idNatjecaj)\n{\n\tvar brojac = 0;\n\t$.ajax({\n\t\t\turl: 'XML_returic_prijavnice.php',\n\t\t\tdata: {natjecaj: idNatjecaj},\n\t\t\ttype: 'GET',\n\t\t\tdataType: 'xml',\n\t\t\tsuccess: function(xml) \n\t\t\t{\n\t\t\t\t$('#prijave').append('<table class=\"korisnici\"> <tr id=\"zaglavlje\" > <th>Identifikator Prijavljenog </th> <th>Vrijeme Prijave</th> <th>Priloženi Portfelj </th> <th>Odobreno</th> </tr> </table>');\n\t\t\t\t$(xml).find('prijavnica').each(function(){\n\t\t\t\t\tif($(this).attr('odobren') == \"0\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$('.korisnici').append('<tr id=\"p'+$(this).attr('idp')+'\"> <td> '+$(this).attr('prijavioKorisnik')+' </td> <td>'+$(this).attr('vrijeme')+'</td> <td> <button name=\"zaPregledP\" id=\"p'+$(this).attr('idPortfelja')+'\">'+$(this).attr('idPortfelja')+'</button></td> <td> <form id=\"f'+$(this).attr('idp')+'\"> <input type=\"hidden\" name=\"email\" value=\"'+$(this).attr('email')+'\" /> <input type=\"hidden\" name=\"odobri\" value=\"0\" /> <input type=\"hidden\" name=\"idp\" value=\"'+$(this).attr('idp')+'\" /> <input type=\"hidden\" name=\"naziv\" value=\"'+$(xml).find('prijavnice').attr('nazivNattjecaja')+'\" /> <input type=\"submit\" value=\"Odobri\"/></form> </td> </tr>').show();\t\n\t\t\t\t\t\todobriPrijavu($(this).attr('idp'));\n\t\t\t\t\t\tpregledPortfelja($(this).attr('idPortfelja'));\n\t\t\t\t\t}\n\t\t\t\tbrojac = 1;\n\t\t\t\t});\t\n\t\t\t\tif(brojac == 0)\n\t\t\t\t{\n\t\t\t\t\t$('.korisnici').remove();\n\t\t\t\t\t$('#prijave').append(\"<h2> Trenutno nema niti jedne nove prijave </h2>\");\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t});\n\n\n}", "title": "" }, { "docid": "48121adf2f1b555d0a7705355c4697cb", "score": "0.649384", "text": "function disegnaGrafici() {\r\n $.ajax({\r\n 'url': url ,\r\n 'method': 'GET',\r\n 'success': function(array) {\r\n //chiamo la funzione che gestisce i dati e somma le vendite totali di ogni mese\r\n var dati_vendite_totali = gestisciDati_mensili(array);\r\n var chiavi = Object.keys(dati_vendite_totali);\r\n var valori = Object.values(dati_vendite_totali);\r\n //chiamo la funzione che disegna il grafico\r\n disegnaGrafico_vendite_mensili(chiavi, valori);\r\n\r\n //chiamo la funzione che gestisce i dati delle vendite ripartite per venditore\r\n var dati_vendite_venditori = gestisciDati_venditori(array);\r\n var nome = Object.keys(dati_vendite_venditori);\r\n var importo = Object.values(dati_vendite_venditori);\r\n disegnaGrafico_vendite_venditori(nome, importo);\r\n },\r\n 'error': function() {\r\n alert('Impossibile raggiungere il sito')\r\n }\r\n }); //fine chiamata get\r\n}", "title": "" }, { "docid": "def763e3aeca9dfaf1bef98529b6b11a", "score": "0.6483671", "text": "function buscarEntrega()\n{\n\tconsole.log(\"Entro a buscarEntrega\");\n\t\n\tvar id = document.getElementById('id_nota_remision').value;\n\tconsole.log(\"el idnota de remision es = \"+id);\n\t\n\t\n\t$.ajax({\n\t\t\t\t\t type: 'POST',\n\t\t\t\t\t url: 'ventas/vi_datosEntrega.php',\t\t\t\t\t \n\t\t\t\t\t data:\"idnota_remision=\"+id,\n\t\t\t\t\t cache:false,\n\t\t\t\t\t error:function(XMLHttpRequest, textStatus, errorThrown){\n\t\t\t\t\t\t console.log(arguments);\n\t\t\t\t\t\t var error;\n\t\t\t\t\t\t if (XMLHttpRequest.status === 404) error=\"Pagina no existe\"+XMLHttpRequest.status;// display some page not found error \n\t\t\t\t\t\t if (XMLHttpRequest.status === 500) error=\"Error del Servidor\"+XMLHttpRequest.status; // display some server error \n\t\t\t\t\t\t $('#'+donde).html('<div class=\"alert_error\">'+error+'</div>');\t\t\t\t\t\t \n\t\t\t\t\t },\n\t\t\t\t\t success:function(msj){\n\t\t\t\t\t\t //alert(\"buscarEntrega = \"+msj)\n\t\t\t\t\t\t console.log(\"el msj es = \"+msj);\n\t\t\t\t\t\t \n\t\t\t\t\t\t var cadena = msj.split('|');\n\t\t\t\t\t\t \n\t\t\t\t\t\t $('#nombre').html(cadena[0]);\n\t\t\t\t\t\t $('#candidadP').html(cadena[1]);\n\t\t\t\t\t\t $('#idPedido').html(id);\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t }//fin success\n\t});//fin del ajax\n\t\n\t\n\t\n\t\n\tconsole.log (\"el otro ajax\");\n\tverTablaProductoEntrega()\n\t\n\t\n\t\n\t\n\t\n\t\n}", "title": "" }, { "docid": "518c6636529b3044db90005bba5f769d", "score": "0.64799947", "text": "function provjeriBroj()\n{\n\n\n\tvar n;\n\tvar ajax = new XMLHttpRequest();\n\tvar povratna;\n\tvar broj;\n\t\t\n\tajax.onreadystatechange = function() {\n\t\tif (ajax.readyState == 4 && ajax.status == 200)\n\t\t{\n\n\t\t\tn= JSON.parse(ajax.responseText);;\n\t\t\tpovratna=n[0]['callingCodes'];\n\t\t\tif(document.getElementById(\"Broj\").value.length!=0)\n\t\t\t{\t\n\t\t\t\tvar brojcic=document.getElementById(\"Broj\").value;\n\t\t\t\tvar re=new RegExp(\"\\\\+\"+povratna,\"g\");\n\t\t\t\t\tif(re.test(brojcic)==false)\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.getElementById(\"Drzava\").style.backgroundColor=\"red\";\n\t\t\t\t\t\tdocument.getElementById(\"Postavi\").innerHTML = \"Pogreska-pozivni broj i drzava nisu odgovarajuci!\";\n\t\t\t\t\t\tdocument.getElementById(\"Postavi\").style.color=\"red\";\n\t\t\t\t\t\n\n\t\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\tdocument.getElementById(\"Drzava\").style.backgroundColor=\"white\";\n\t\t\t\t\t\tdocument.getElementById(\"Broj\").style.backgroundColor=\"white\";\n\t\t\t\t\t\tdocument.getElementById(\"Postavi\").innerHTML =\"\";\n\t\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"Drzava\").style.backgroundColor=\"white\";\n\t\t\t\tdocument.getElementById(\"Broj\").style.backgroundColor=\"white\";\n\t\t\t\tdocument.getElementById(\"Postavi\").innerHTML =\"\";\n\t\t\t}\n\t\t}\n\t\tif (ajax.readyState == 4 && ajax.status == 404)\n\t\t\t{document.getElementById(\"Postavi\").innerHTML = \"Greska: pogresan unos!\";}\n\t}\n\tif(document.getElementById(\"Drzava\").value.length!=0)\n\t{\n\tajax.open(\"GET\", \"https://restcountries.eu/rest/v1/alpha?codes=\"+document.getElementById(\"Drzava\").value, true);\n\tajax.send();\n}\n\n\n\n\n\n}", "title": "" }, { "docid": "c032e5e4147ca275741c08913a0ac562", "score": "0.6476227", "text": "function listerFilmsCards()\n{\n\tvar action = 'action=listerCards';\t\n\n\t$.ajax({\n\t\tmethod: \"POST\", \n\t\turl:\"../../controller/filmController.php\",\n\t\tdata: action\t\n\n\t}).done((jsonString)=>{\n\t\t//alert(jsonString);\n\t\t$.ajax({\n\t\t\tmethod: \"POST\", \n\t\t\turl:\"../film/template/card-film.php\",\n\t\t\tdata: \"chaine=\"+jsonString\n\t\t}).done((template)=>{\n\t\t\t//alert(template);\n\t\t\t$(\"#contenu\").html(template);\n\t\t})\n\t});\n}", "title": "" }, { "docid": "af5a1b91c6ad3687b78a4774c5154ac2", "score": "0.64758945", "text": "function dnevnik()\n{\n\t$.ajax({\n\t\turl: 'XML_returic_dnevnik.php',\n\t\ttype: 'GET',\n\t\tdataType: 'xml',\n\t\tsuccess: function(xml) \n\t\t{\t\n\t\t\t$(\"#dogadaji\").append('<table class=\"korisnici\"><thead><tr id=\"zaglavlje\" ><th>Datum Događaja</th><th>Opis Događaja</th> </thead> </table>')\n\t\t\t$(xml).find('dogadaj').each(function(){\n\t\t\t\t\n\t\t\t\t$(\".korisnici\").append('<tr><td>' + $(this).attr('vrijeme')+' </td><td>'+$(this).attr('opisDogadaja') + '</td></tr>').show();\n\t\t\t\n\t\t\t});\n\t\t\t$('table').tableFilter();\n\t\t\t$(xml).find('stranicenje').each(function(){\n\t\t\t\t$(\"#stranicenje\").paginate({\n\t\t\t\t\tcount \t\t: parseInt($(this).attr('brojStranica')),\n\t\t\t\t\tstart \t\t: 1,\n\t\t\t\t\tdisplay : 5,\n\t\t\t\t\tborder\t\t\t\t\t: true,\n\t\t\t\t\tborder_color\t\t\t: 'yellow',\n\t\t\t\t\ttext_color \t\t\t: 'yellow',\n\t\t\t\t\tbackground_color \t: '#666666',\t\n\t\t\t\t\tborder_hover_color\t\t: '#666666',\n\t\t\t\t\ttext_hover_color \t\t: '#666666',\n\t\t\t\t\tbackground_hover_color\t: 'yellow', \n\t\t\t\t\timages\t\t\t\t\t: false,\n\t\t\t\t\tmouse\t\t\t\t\t: 'press',\n\t\t\t\t\tonChange \t\t\t: function(page){\n\n\t\t\t\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\t\t\t\turl: 'XML_returic_dnevnik.php',\n\t\t\t\t\t\t\t\t\t\t\t\tdata: {stranica: page},\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\t\t\t\t\t\tdataType: 'xml',\n\t\t\t\t\t\t\t\t\t\t\t\tsuccess: function(xml){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#dogadaji\").html('');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#dogadaji\").append('<table class=\"korisnici\"><thead><tr id=\"zaglavlje\" ><th>Datum Događaja</th><th>Opis Događaja</th> </thead> </table>')\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(xml).find('dogadaj').each(function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$(\".korisnici\").append('<tr><td>' + $(this).attr('vrijeme')+' </td><td>'+$(this).attr('opisDogadaja') + '</td></tr>').show();\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});\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$('table').tableFilter();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t});\n\t\t\t\n\t\t\t});\n\t\t\t\n\t\t}\n\t});\n\t\n\t\n\n}", "title": "" }, { "docid": "90d072b8d4188a7a07c40651d4498474", "score": "0.6463976", "text": "function getBiografia() {\r\n\tvar idArticulo = $('articulo').value;\r\n\tnew Ajax.Request('/GetBiografiaByIdArticulo.do?param=' + Math.random()\r\n\t\t\t+ '&idArticulo=' + idArticulo, {\r\n\t\tmethod : 'get',\r\n\t\tonSuccess : function(transport) {\r\n\t\t\tif (transport.readyState == 4) {\r\n\t\t\t\t$('divBiografia').innerHTML = '';\r\n\t\t\t\t$('divBiografia').innerHTML = '<br/>'+transport.responseText;\r\n\t\t\t} else {\r\n\t\t\t\t$('divBiografia').innerHTML = 'Cargando biografia!!!';\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "a6d043af4cba4b5611e10bdc103fd968", "score": "0.64603317", "text": "function dodajUporabnikeBranjeEHR() {\n $.ajax({\n url: baseUrl + \"vrni/vsi\",\n type: \"GET\",\n success: function (podatki) {\n var prikazUporabnikov = \"<select class='select-state form-control input-sm' id='preberiObstojeciEHR' placeholder='uporabnik'>\" +\n \"<option value='' selected disabled>Uporabnik</option>\" +\n \"<option value=\" + arthurDentEHRID + \" disabled>Arthur Dent</option>\" +\n \"<option value=\" + fordPerfectEHRID + \" disabled>Ford Perfect</option>\" +\n \"<option value=\" + zaphodBeeblebroxEHRID + \" disabled>Zaphod Beeblebrox</option>\";\n for (var key of Object.keys(podatki)) {\n var kljucEHRID = (key == undefined ? \"\" : key);\n var imeUporabnika = (podatki[key].ime == undefined ? \"\" : podatki[key].ime);\n var priimekUporabnika = (podatki[key].priimek == undefined ? \"\" : podatki[key].priimek);\n //console.log(kljucEHRID, imeUporabnika, priimekUporabnika);\n\n prikazUporabnikov += \"<option value='\" + kljucEHRID + \"'>\" + imeUporabnika + \" \" + priimekUporabnika + \"</option>\";\n }\n prikazUporabnikov += \"</select>\";\n //console.log(prikazUporabnikov);\n $(\"#mnozicaUporabnikov\").html(prikazUporabnikov);\n\n /**\n * Napolni testni EHR ID pri prebiranju EHR zapisa obstoječega bolnika,\n * ko uporabnik izbere vrednost iz padajočega menuja\n * (npr. Dejan Lavbič, Pujsa Pepa, Ata Smrk)\n */\n $('#preberiObstojeciEHR').change(function() {\n $(\"#preberiSporocilo\").html(\"\");\n $(\"#preberiEHRid\").val($(this).val());\n });\n },\n error: function(err) {\n console.log(\"Napaka \" + JSON.parse(err.responseText).opis + \"!\");\n }\n });\n}", "title": "" }, { "docid": "e3040bdeeacd6c73ef449f76e16a4d02", "score": "0.64559454", "text": "function getPostazioni(){\n\tvar xhr = new XMLHttpRequest();\n\txhr.onreadystatechange = function() {\n\t\tif (xhr.status == 200 && xhr.readyState == 4) {\n\t\t\tlet data = JSON.parse(xhr.responseText);\n\t\t\tconsole.log(data);\n\t\t\t\n\t\t\tfor(var i = 0; i <data.length; i++){\n\t\t\t\t//Giuseppe qui devi aggiungere il front end\n\t\t\t\t$('#postazioni').append(\n\t\t\t\t\"<table class='table product-dashboard-table' id='postazioni'>\"+\n\t\t\t\t\"<tr>\"+\n\t\t\t\t\t\t\t\t\"<td class='product-thumb'>\"+\n\t\t\t\t\t\t\t\t\t\"<img width='80px' height='auto' src=\"+data[i].immagine+\" alt='image description'></td>\"+\n\t\t\t\t\t\t\t\t\"<td class='product-details'>\"+\n\t\t\t\t\t\t\t\t\t\"<h3 class='title'>\"+data[i].nome+\"</h3>\"+\n\t\t\t\t\t\t\t\t\t\"<span class='location'><strong>\"+data[i].descrizione+\"</strong>Computer da Gaming</span>\"+\n\t\t\t\t\t\t\t\t\t\"<span class='location'><strong>Prezzo:</strong>€ \"+data[i].prezzo+\"</span>\"+\n\t\t\t\t\t\t\t\t\"</td>\"+\n\t\t\t\t\t\t\t\t\"<td class='product-category'><span class='categories'>\"+data[i].tipo+\"/span></td>\"+\n\t\t\t\t\t\t\t\t\"<td class='action' data-title='Action'>\"+\n\t\t\t\t\t\t\t\t\t\"<div class=''>\"+\n\t\t\t\t\t\t\t\t\t\t\"<ul class='list-inline justify-content-center'>\"+\n\t\t\t\t\t\t\t\t\t\t\t\"<li class='list-inline-item'>\"+\n\t\t\t\t\t\t\t\t\t\t\t\t\"<a data-toggle='tooltip' data-placement='top' title='Edit' class='edit' href=''>\"+\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"<i class='fa fa-pencil'></i>\"+\n\t\t\t\t\t\t\t\t\t\t\t\t\"</a>\"+\n\t\t\t\t\t\t\t\t\t\t\t\"</li>\"+\n\t\t\t\t\t\t\t\t\t\t\t\"<li class='list-inline-item'>\"+\n\t\t\t\t\t\t\t\t\t\t\t\t\"<a data-toggle='tooltip' data-placement='top' title='Delete' class='delete' href=''>\"+\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"<i class='fa fa-trash'></i>\"+\n\t\t\t\t\t\t\t\t\t\t\t\t\"</a>\"+\n\t\t\t\t\t\t\t\t\t\t\t\"</li>\"+\n\t\t\t\t\t\t\t\t\t\t\"</ul>\"+\n\t\t\t\t\t\t\t\t\t\"</div>\"+\n\t\t\t\t\t\t\t\t\"</td>\"+\n\t\t\t\t\t\t\t\"</tr>\"+\n\t\t\t\t\t\t\t\"</table>\");\n\n\t\t\t}\n\t\t}\n\t}\n\txhr.open('GET','../RestituisciListaPostazioni;jsessionid='+session, true);\n\txhr.send();\n}", "title": "" }, { "docid": "276aa08d3eba9b8a757e1bbd7ceb8cd3", "score": "0.6454419", "text": "function darBajaCues(){\n var id = $(this).attr('id'); \n if (id===\"\")\n return false;\n\n var datos = $.ajax({\n url: 'darBajaCues',\n data: {\n i: id,\n token: token.val()\n },\n type: 'post',\n dataType:'json',\n async:false\n }).error(function(e){\n alert('Ocurrio un error, intente de nuevo');\n }).responseText;\n\n var res;\n try{\n res = JSON.parse(datos);\n }catch(e){\n alert('Error JSON ' + e);\n }\n\n if ( res.status == 'OK' ){\n alert(res.message);\n getTodosCuestionarios();\n\n }\n else{\n alert(res.message);\n }\n}", "title": "" }, { "docid": "56220041acb7bcf1f253c03003bd2cbe", "score": "0.64497644", "text": "function refreshP(url)\n {\n $.ajax({\n type: 'POST',\n url: url,\n dataType: 'json',\n data: {},\n success: function(data)\n {\n if(!data.error && data.name != null)\n {\n $(\"#maxProduct\").show();\n for(var i=0;i<data.name.length;i++)\n {\n $(\"#maxProduct\").append(\"<p><i>Alerte</i> : Attention ! Il ne reste plus qu'<b>1 \"+data.name[i]+\"</b> en stock !</p>\");\n }\n }\n }\n })\n }", "title": "" }, { "docid": "438df3685018c21f7e24a815e052cd73", "score": "0.64496964", "text": "function mostrar_busqueda() {\n\n\tELIMINAR(\"cuerpo_presentacion\");\n\tvar busqueda = document.getElementById(\"txtvalidar\").value;\n $.ajax({\n type: \"GET\",\n url:'/cuenta/',\n async: true,\n dataType:\"Json\",\n contenType:\"application/Json; charset=utf-8\",\n success: function(user){\n \t$.ajax({\n \t type: \"GET\",\n \t url:'/usuarios/',\n \t async: true,\n \t dataType:\"Json\",\n \t contenType:\"application/Json; charset=utf-8\",\n \t success: function(usuarios){\n \t $.each(usuarios,function(i,usuario){\n\n \t if(usuario.username==busqueda && user.username==busqueda){\n datos1=user.first_name + \" \" + user.last_name;\n crear_presentancion_usuario_seguidores('#seccion_buscar', datos1,usuario.username);\n }\n else if(usuario.username==busqueda){\n \t datos2=usuario.first_name + \" \" + usuario.last_name;\n crear_presentancion_usuario('#seccion_buscar',datos2,usuario.username, 'primary', 'Seguir','btn_seguir');\n\n //Se busca en la lista de siguiendos para que colocar la etiqueta al boton que se lo esta siguiendo y con una bandera 'bandera siguiendo'\n //con la bandera '1' se indica que ya se ha colocado el usurio en la busqueda, caso contrario se coloca la etiqueta 'seguir'\n $.ajax({\n type: \"GET\",\n url:'/UsersSiguiendos',\n async: true,\n dataType:\"Json\",\n contenType:\"application/Json; charset=utf-8\",\n success: function(seguidores){\n $.each(seguidores,function(i,seg){\n if(seg.username==usuario.username){\n $( \".btn_seguir\" ).remove();\n user=seg.first_name + \" \" + seg.last_name;\n $(\".click_button\").append(\"<div class='btn_seguir'> <button id='button_seguir' class='btn btn-primary center-block' name='botones__seguir'>Siguiendo</button></div>\");\n //crear_presentancion_usuario('#seccion_buscar',user,seg.username, 'primary', 'Siguiendo','btn');\n //bandera_siguiendo =1;\n }\n\n });\n //eventos_presentacion('#seccion_buscar');\n },\n error: function(data){\n // console.log(data.responseText);\n swal({ title: 'Error!', text: 'Inicie sesion', timer: 2000 });\n }\n });\n \t }\n \t });\n eventos_presentacion('#seccion_buscar');\n\n \t },\n \t error: function(data){\n\n \t swal({ title: 'Error!!', text: 'No existe el usuario', timer: 2000 });\n \t }\n \t });\n }\n });\n}", "title": "" }, { "docid": "bcf1406ab04a35ff30da8dda1edf8209", "score": "0.6447938", "text": "function getEvaluacionDeArticulo() {\r\n\tvar idArticulo = $('articulo').value;\r\n\tnew Ajax.Request('/GetEvaluacionXArticuloAction.do?param=' + Math.random()\r\n\t\t\t+ '&idArticulo=' + idArticulo, {\r\n\t\tmethod : 'get',\r\n\t\tonSuccess : function(transport) {\r\n\t\t\tif (transport.readyState == 4) {\r\n\t\t\t\t$('divEvaluacion').innerHTML = '';\r\n\t\t\t\t$('divEvaluacion').innerHTML = transport.responseText;\r\n\t\t\t} else {\r\n\t\t\t\t$('divEvaluacion').innerHTML = 'Cargando evaluacion!!!';\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "97d118b6f7af2766d44698033019ce91", "score": "0.6445706", "text": "function solicitudesPendientes() {\n\n var pais = $('#pais').val();\n var ruta = $('#ruta').val();\n\n if( pais != '' && ruta != 0){\n\n $('#loader').show();\n window.tablaSolicitudes.clear().draw();\n\n $.ajax({\n type: 'GET',\n url: 'ws/gac/solicitudes',\n dataType: 'json',\n data: {pais:pais, ruta:ruta}\n })\n .done(function(data){\n if( data.result )\n {\n var contador = 0;\n $.each(data.records.TA_FORMULARIO.item, function(index,value){\n\n contador++;\n counter1 = contador;\n counter2 = value.CONSEC;\n counter3 = value.NOMBRE_PDV;\n counter4 = value.FCREADO;\n counter5 = value.DES_STATUS;\n\n if(value.STATUS == 'J'){\n counter6 = '<a class=\"btn-adjuntar btn btn-primary btn-xs\" title=\"Adjunto foto de pagaré\" data-toggle=\"modal\" data-consecutivo=\"'+value.CONSEC+'\">Adjuntar foto</a>';\n }\n else{\n counter6 = '';\n }\n\n window.tablaSolicitudes.row.add([counter1,counter2,counter3,counter4,counter5,counter6]).draw(false);\n });\n }\n else\n toastr['error'](data.message, 'Error');\n })\n .fail(function(err){\n console.log(err);\n })\n .always( function(){\n $('#loader').fadeOut();\n });\n }\n else{\n toastr['error']('Error al consultar las solicitudes, ingrese una ruta valida', 'Error');\n }\n\n }", "title": "" }, { "docid": "b5eafab0722e01c9084b5b301e0ef9fe", "score": "0.64450413", "text": "function verificar(){\n var codigo = document.getElementById('id_codigo_consecutivo').value;\n var precio = document.getElementById('id_precio_mensualidad_total').value;\n var representante = document.getElementById('id_ci_representante').value;\n var jugador = document.getElementById('id_id_jugador').value;\n \n\n if(codigo!=\"\" && precio!=\"\" && representante!=\"\" && jugador!=\"\"){\n $.ajax({\n type : \"GET\", \n url : \"api/mensualidad/verificar/\" + codigo + '/' + precio + '/' + representante + '/' + jugador ,\n success : function(json) {\n\n if(jQuery.isEmptyObject(json)){\n crear_mensualidad();\n }else{\n alert('Ya se pago');\n }\n \n },\n error : function(xhr, status) {\n error_toastr('Error');\n }\n });\n }\n\n\n }", "title": "" }, { "docid": "eb9afe672e5e6789a5a926610995f9e2", "score": "0.64446056", "text": "function getNumSolicitudes(){\n \t var url = \"app/service.php?tag=numeroSolicitudes\"; // El script a dónde se realizará la petición.\n //var usuarioLocal = $('#refYou').val();\n var usuarioLocal = $.cookie('lUser');\n\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\tdataType: 'json',\n\t\t\t\turl: url,\n\t\t\t\tdata: { usuarioLocal: usuarioLocal },\n\t\t\t\tcache: false,\n\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\n\t\t\t\t\t //if(data['success']==1){\n $('div#cabecera .misSd').html(data['nSolicitudes']);\n\t\t\t //}\n\t\t\t\t}\n\t\t});\n\n\t\treturn false;\n}", "title": "" }, { "docid": "39c6dce5af2639fdd83d1db47f8c8286", "score": "0.64436513", "text": "function verArticulosRecientes(){\n\t$.post('Controlador/inventario.php?op=verArticulosRecientes', {}, function() {}).done(function(data){\n\t// datos = JSON.parse(data);\n\t// valormsg = datos[0];\n\t$(\"#verArticulosRecientes\").html(data);\n}).fail(function(data){\n\tconsole.log(data.responseText);\n});\n}", "title": "" }, { "docid": "c630173a0925a102446484176f34dd7e", "score": "0.6438827", "text": "function payBills(id_wynajecia)\n{\n $.get($SCRIPT_ROOT + '/_requests',{req : 'payBills',\n id_wy : id_wynajecia});\n \n $.get($SCRIPT_ROOT + '/_requests',{\nreq: 'showBills'},\nfunction(data)\n{\n $('#billsDiv').html(data);\n});\n\n}", "title": "" }, { "docid": "bdb937c8413c2460af1618987406f517", "score": "0.6435091", "text": "function medecinAction(type,id) {\r\n\tnew Ajax.Request('../medecins/medecin_action.php',\r\n\t\t{\r\n\t\t\tmethod:'get',\r\n\t\t\tparameters: {type : type, id : id},\r\n\t\t\tasynchronous:false,\r\n\t\t\trequestHeaders: {Accept: 'application/json'},\r\n\t \t\tonSuccess: function(transport, json){\r\n\t \t\t\t$('formmodif').innerHTML=json.root.info;\r\n \t\t\t\tmedecinRechercheComplete($('pseudo').value);\r\n \t },\r\n\t\t onFailure: function(){ alert('failure');} \r\n\t\t});\r\n}", "title": "" }, { "docid": "638b2c945d5ad48cea16160c2ded8126", "score": "0.6431359", "text": "function ajaxAllLinks1(keym, idCar, idUsu) {\n // alert(\"YAY\");\n\n var cad= keym+\"-\"+idCar+\"-\"+ idUsu ;\n $.ajax({\n url: '/Index/Links',\n type: 'Get',\n data: {cad:cad},\n dataType:'text',\n async: true,\n cache: false,\n beforeSend: function () {\n\n $(\"#loadInfo\").html(\"\");\n $(\"#loadInfo\").html('<img src=\"/img/ajax-loader.gif\" style=\"position:relative;margin-left:50%;margin-top:20%;height:8%;width:8%;\">');\n },\n success: function succ(data) {\n //alert(data);\n if (data != 0) {\n $(\"#loadInfo\").html(\"\");\n $(\"#loadInfo\").html(data);\n }\n else {\n $(\"#loadInfo\").html(\"No se ha podido realizar esta operacion. Intentalo mas tarde o contacta al administrador.\");\n }\n }\n }).fail(function (da) {\n alert(\"No se pudo cargar la pagina.\");\n });\n}", "title": "" }, { "docid": "4603f7dfbc073c96225ccd7ea8b8f998", "score": "0.6428272", "text": "function getEmpleado(numero) {\n $.ajax({\n url: rootUrl + 'RL_EMPLEADO/getDatosEmpleado',\n dataType:'json',\n type:'POST',\n data:{NO_EMP: numero},\n success: function (response) {\n $(\".dispDatos\").show();\n if (response.length != 0) {\n $.each(response, function (index, emp) {\n $(\"#idEmp\").val(this.ID_EMPLEADO);\n $(\"#nombreE\").html(this.NOMBRE_EMPLEADO);\n $(\"#puestoE\").html(this.DESC_PUESTO);\n $(\"#corporativoE\").html(this.DESC_CORPORATIVO);\n }); \n //CARGA HORARIOS\n getChecadaEmpleado($(\"#idEmp\").val());\n }\n else {\n $(\"#aviso\").html(\"<i class='glyphicon glyphicon-info-sign'></i> El número de empleado ingresado no existe.\");\n $(\"#aviso\").show(\"slow\");\n return;\n } \n }\n });\n}", "title": "" }, { "docid": "d734da6fe46bdd7a052895b460ae00f4", "score": "0.64220095", "text": "function restPaises() {\n displayNuevoAnuncio2();\n var datos = {\n idSesion: idSesion\n };\n\n peticionActual = $.ajax({\n data: datos,\n url: url + 'paises.php',\n dataType: 'json',\n success: function (response) {\n restOk(response, \"paises\");\n },\n error: function (response) {\n restError(response, \"paises\");\n },\n });\n}", "title": "" }, { "docid": "82dd6bacfcd597685cdf888c2586d8e3", "score": "0.64219546", "text": "function semestar(dobaSemestra) {\r\n\t\r\n\tvar idStudija = document.getElementById(\"studij_id\").value;\r\n\tvar usmjerenje_id = document.getElementById(\"usmjerenje_id\").value;\r\n\t\r\n if (dobaSemestra == \"\" ) {\r\n document.getElementById(\"txtSemestar\").innerHTML = \"\";\r\n return;\r\n } else {\r\n if (window.XMLHttpRequest) {\r\n // code for IE7+, Firefox, Chrome, Opera, Safari\r\n xmlhttp = new XMLHttpRequest();\r\n } else {\r\n // code for IE6, IE5\r\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n }\r\n xmlhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n document.getElementById(\"txtSemestar\").innerHTML = this.responseText;\r\n }\r\n };\r\n xmlhttp.open(\"GET\",\"semestar.php?q=\"+dobaSemestra+\"&studij=\"+idStudija+\"&usmjerenje=\"+usmjerenje_id,true);\r\n xmlhttp.send();\r\n }\r\n\tponistiSve();\r\n\t//ukoliko se bira drugi semestar tokom izracuna neka se ponisti zbroj ects bodova\r\n}", "title": "" }, { "docid": "42e8a331c7b3435d292a3c15e367f56f", "score": "0.6415993", "text": "function datos(){\n\t var d = new Date();\n\t var n = 1 + d.getMonth();\n\t var mes = \"'0\" + n + \"'\";\n\t \n\t setMes(mes); \n\t \n$.ajax({\n xhr: function(){\n var xhr = new window.XMLHttpRequest();\n //Download progress\n xhr.addEventListener(\"progress\", function(evt){\n if (evt.lengthComputable) {\n pb.start(evt.total);\n pb.updateBar(evt.loaded);\n \tif(evt.loaded == evt.total){\n \tpb.hide();\n \t}\n }\n }, false);\n return xhr;\n },\n\n// url:\"/ARCA/UI/servicios.xsodata/CONSULTA?$format=json\",\nurl:\"/ARCA/UI/servicios.xsodata/NUEVO?$format=json&$select=LAT_CUS, LON_CUS&$filter=CUSTOMER ne '' and LAT_CUS ne 0 and LON_CUS ne 0 and MES eq \" + mes, \nsuccess:function(respuesta){\nvar response = respuesta.d.results;\ncapa_principal = gen_coord(response);\ncalor(capa_principal);\n\n\t\t\t\t \t \n},\nerror: function (xhr,respuesta) {\n alert(\"Error\" + xhr.responseText);\n}\n\n});\n}", "title": "" }, { "docid": "739b6610d06e4d304b8c7317119ec04c", "score": "0.6415183", "text": "function ajaxIss(){\n var ajax = new XMLHttpRequest();\n ajax.open(iss.methode, iss.url, true);\n // métadonnées de la requête AJAX\n ajax.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n ajax.addEventListener('readystatechange',function(){\n // si l'état est le numéro 4 et que la ressource est trouvée\n if(ajax.readyState == 4 && ajax.status == 200) {\n // le texte de la réponse\n var str=ajax.responseText;\n var jsonObj = JSON.parse(str);\n var result = iss.getInfos(jsonObj);\n //Création d'un objet LatLng\n point = new L.LatLng(result.lat,result.long);\n //Bouton suivre\n\t\t\tif (followISS.checked){\n\t\t\t\t//console.log(zoom[0].value);\n\t\t\t\tcenter(map,point,zoom);\n\t\t\t}\n\n //création de la ligne de déplacement de l'iss\n poly(result.long,point,pointList);\n //gestion des marqueurs\n mark(point);\n\n //affichage de la latitude et longitude\n document.getElementById(\"lat\").innerHTML = 'Latitude : ' +result.lat;\n document.getElementById(\"long\").innerHTML ='Longitude : '+result.long;\n\n //generation de l'url de la photo au cas où un user souhaite tweeter\n urlpicture=photo(result.long,result.lat,radio);\n\n //répétition de la fonction toutes les 5 secondes\n setTimeout(function() {ajaxIss ()},5000);\n\n }\n\t\t\t \n });\n ajax.send(\"\");\n\t\t}", "title": "" } ]
0ade84553429cec2b2e08c6b0f7972cb
Set the number of results to show Will trigger new search
[ { "docid": "3d8980badd11a4da4c84840b1c9516db", "score": "0.6336587", "text": "function setResultsPerPage(resultsPerPage) {\n var _console;\n\n if (this.debug) // eslint-disable-next-line no-console\n (_console = console).log.apply(_console, [\"Search UI: Action\", \"setResultsPerPage\"].concat(Array.prototype.slice.call(arguments)));\n\n this._updateSearchResults({\n current: 1,\n resultsPerPage: resultsPerPage\n });\n}", "title": "" } ]
[ { "docid": "cb097c063a36e3bfe7eaec7f9fb4e602", "score": "0.7254524", "text": "numberOfItemsToShowHasChanged() {\n this.currentSearchRequestParams.per_page = this.numberOfItemsToShow;\n this.doFinalRequest();\n }", "title": "" }, { "docid": "82a2f2b63f51edbdadde1c8ed8169ac5", "score": "0.7187344", "text": "showMoreResults() {\n const { numberOfValues } = getFacetSearch().options;\n dispatch(updateFacetSearch({\n facetId,\n numberOfValues: numberOfValues + initialNumberOfValues,\n }));\n dispatch(executeFacetSearch(facetId));\n }", "title": "" }, { "docid": "3c932bcd36dd58b7c61492747899f110", "score": "0.7157357", "text": "set(num) {\n dispatch(updateNumberOfResults(num));\n dispatch(executeSearch(logPagerResize()));\n }", "title": "" }, { "docid": "2e201e86c6718d9413731ed7e17c21ef", "score": "0.68348277", "text": "async nextResultsPage () {\n if (this.numHits > 10) {\n this.searchOffset += 10\n if (this.searchOffset + 10 > this.numHits) { this.searchOffset = this.numHits - 10}\n this.searchResults = await this.search()\n document.documentElement.scrollTop = 0\n }\n }", "title": "" }, { "docid": "646760c53867bd8d77e33dc913a8718a", "score": "0.6754675", "text": "function updateResultsPerPage(num) {\r\n\tvar newRequest = $(\"#main-col\").attr(\"queryURL\");\r\n\r\n\tif (newRequest.indexOf(\"&num=\") == -1) {\r\n\t\tnewRequest = newRequest + \"&num=\" + num;\r\n\t} else {\r\n\t\tnewRequest = newRequest.replace(\"&num=10\", \"&num=\"+num).replace(\"&num=25\", \"&num=\"+num);\r\n\t}\r\n\r\n\tperformSearch(newRequest+\"&start=0\");\r\n\t$(\"#main-col\").attr(\"queryURL\", newRequest);\r\n}", "title": "" }, { "docid": "8bc173eadfd22338828543b9a472f527", "score": "0.6587314", "text": "function updateNumberOfPages() {\n numberOfPages = Math.ceil(matchedSearchReservations.length / numberPerPage) || 1;\n}", "title": "" }, { "docid": "34ea3107abb7a810011e25d60fcc2258", "score": "0.65159965", "text": "function showSearchResults(results) {}", "title": "" }, { "docid": "a8889976f04a9cff36b6745e50eb5fdf", "score": "0.6372221", "text": "function updateHits() {\n var l = $(\"tbody > tr:not(.hidden)\").length;\n $(\"#num_results\").text(l != 1 ? l.toString() + \" results\" : l.toString() + \" result\");\n}", "title": "" }, { "docid": "730c57cafccca965989fcb0735ee092c", "score": "0.63416874", "text": "nextPageFilms(){\r\n if (this.pageFilms < this.totalPageFilms) {\r\n this.pageFilms++;\r\n this.functionSearch();\r\n }\r\n }", "title": "" }, { "docid": "b6c845aa7cfc844f4a6abd9d1e8eca27", "score": "0.6296096", "text": "function ShowResultCountForUser(sender, args) {\n $(\"#spnUserSearchWgResult\").html(searchlist + '&nbsp;(' + sender._totalRecordsCount + ')');\n if (sender._totalRecordsCount > 0) { $('#btnAddUserForWg').show(); $('#btnUserCancelForWg').show(); }\n}", "title": "" }, { "docid": "d5a35bbd2ca630106e65104864c98599", "score": "0.62788457", "text": "function displayResults(results, maxResults) {\n // if there are previous results, remove them\n console.log(results); //responseJson\n //display the results section \n $('#results').removeClass('hidden');\n }", "title": "" }, { "docid": "08d4dce59a7841e8e6493e8e7e9e04e4", "score": "0.62563705", "text": "function load_more_search_results()\r\n{\r\n\tif( current_offset < 50 ){ current_offset = 50 };\r\n\r\n\t// Ajax call\r\n\tloading();\r\n\t$.getJSON(\"json.php\", {'type':'search', 'n':50, 'offset':current_offset, 'search':most_recent_search },\r\n\tfunction(data){ \r\n \t$(\"<tr class='pagebreak'><td></td> <td>------------------------------</td> <td></td></tr>\").prependTo(\"#irc\");\r\n\t\tvar id = 0;\r\n\t\tif( data.length < 50 ) { $(\"#searchoptions\").hide(); }\t\r\n\t\tdata.reverse();\r\n\t\t$(data).each( function( i, item) {\r\n\t\t\t$(irc_render(item)).prependTo(\"#irc\");\r\n\t\t\tid = item.id;\r\n\t\t});\r\n\t\tscroll_to_id( id );\r\n\t\tdone_loading();\r\n\t\tcurrent_offset += 50;\r\n\t});\t\r\n\treturn false;\r\n}", "title": "" }, { "docid": "45ee9e6a6ada7772f1920a41423a7232", "score": "0.6244481", "text": "function newSearch() {\n\tvar q = $(\"#query\").val();\n\tif (q != mySearch.getQuery()) {\n\t\tmySearch.setQuery(q);\n\t\tmySearch.clearCollection();\n\t} else {\n\t\t//go to first page of current results.\n\t}\n\tsearch();\n}", "title": "" }, { "docid": "a5d9a39da6f80b9a3cf8daa5e689e087", "score": "0.62164766", "text": "function setResults(\n results\n ) {\n home.results = results;\n }", "title": "" }, { "docid": "eaf926950f92883362efd0d7d2dc756b", "score": "0.6188897", "text": "function updateResults() {\n\t\t\t//clear out search query to bring it out of focus \n\t\t\t$scope.search.query = null;\n\t\t\t$scope.search.state = {};\n\t\t\t$scope.search.type = {};\n\t\t\t$scope.search.state.beganSearch = true;\n\t\t\t$scope.search.cachedParam = {};\n\t\t\t$scope.search.cachedParam.dateRangeParam = $scope.search.days;\n\t\t\tgetResults($scope.search.param());\n\t\t}", "title": "" }, { "docid": "36cb3fa5bed8d95263145362a65a2df2", "score": "0.6173568", "text": "function initMore(data){\n\tvar numShown = $('ul.results li').length; \n\tvar currentPage = Math.ceil(numShown/10);\n\tvar nb=0;\n\tif ($.isNumeric(data)) {\n\t\tif (data > 0) {\n\t\t\tnb=data;\n\t\t} \n\t} else {\n\t\tnb = parseInt($(data).filter('#nb').text());\n\t}\n\tvar numPage = Math.floor(nb/10 +1) ;\n\t$('#more_result>a').unbind('click');\n\tif (numPage >= currentPage+1){\n\t\tcurrentPage++;\n\t\t$('#more_result').fadeIn(500);\n\t\t$('#more_result>a').bind('click',function(e){\n\t\t\te.preventDefault();\n\t\t\tvar complete_path = (window.urlMgmt == \"history\")?window.location.search.substring(1)+'&page='+currentPage:window.location.hash.substring(1)+'&page='+currentPage;\n\t\t\tif (! window.location.hash) {\n\t\t\t\tcomplete_path=window.location.search.substring(1)+'&page='+currentPage;\n\t\t\t}\n\t\t\tsubmitAjaxSearch(complete_path,true);\n\t\t})\n\t}\n\telse{\n\t\t$('#more_result').fadeOut(500);\n\t}\n}", "title": "" }, { "docid": "4e3f46f4b479d3692d3dccb94fc726e8", "score": "0.6119601", "text": "function setPerPage(num) {\r\n this.per_page = num;\r\n this.show(this.offset, this.per_page);\r\n}", "title": "" }, { "docid": "2e1d2b6909ce84d9debb29290bff7889", "score": "0.60758114", "text": "function refreshSearchResults(passedPage, passedPageSize) {\n if (results && results.length > 0) {\n // there seems to be an issue when paginationOptions in the pagination handler\n // then calling this function, the first time paginationOptions is undefined.\n // A circumvention is to pass the page and page size as parameters and use them if they are set.\n let pageSize;\n let page;\n if (passedPage) {\n page = passedPage;\n } else {\n page = paginationOptions.page;\n }\n if (passedPageSize) {\n pageSize = passedPageSize;\n } else {\n pageSize = paginationOptions.pageSize;\n }\n\n // if page = 1 and pageSize 10, currentPageStart = 1\n // if page = 2 and pageSize 10, currentPageStart = 11\n // if page = 2 and pageSize 10 and results.length = 15, currentPageStart = 11 , currentPageSize = 5\n const currentPageStart = (page - 1) * pageSize;\n let currentPageSize = pageSize;\n // if the last page is not complete ensure that we only specify up the end of the what is actually there in the results.\n if (currentPageStart + currentPageSize - 1 > results.length) {\n currentPageSize = results.length - currentPageStart;\n }\n const resultsToshow = results.slice(\n currentPageStart,\n currentPageStart + currentPageSize\n );\n console.log(\"resultsToshow\");\n console.log(resultsToshow);\n setCurrentPage(resultsToshow);\n } else {\n setCurrentPage([]);\n }\n }", "title": "" }, { "docid": "82c25f76acae7be072dbe13f864af2b8", "score": "0.6046088", "text": "function setObserverCountFeedview() {\n //observer of change select\n const observerSearch = Rx.Observable.fromEvent(dom.selectCountFeed, 'change')\n .map((e) => {\n return e.target.value\n })\n .debounce(300);\n\n observerSearch.subscribe((_countView) => {\n countView = parseInt(_countView);\n // if (countView === 10) {\n // dom.nextBtn.setAttribute('data-page-count', 0);\n // dom.nextBtn.style.display = 'block';\n // } else {\n // togglePaginationButton(false);\n // }\n\n //detach all child\n detachDom();\n\n setObserverData(textSearch, userLike, countView, 1);\n });\n }", "title": "" }, { "docid": "aebc1f84d6674e14d23ee2e9c083c7bd", "score": "0.6042886", "text": "function changeTotalRecords() {\n var new_records = document.getElementById(\"elements\").value;\n records_per_page = new_records;\n init(1);\n}", "title": "" }, { "docid": "8296fbed9e208e3fdbe43077348892ab", "score": "0.6037355", "text": "function setResults(results) {\n //TODO\n }", "title": "" }, { "docid": "c4c1f807320da9ea286bc1775e3219e3", "score": "0.6024837", "text": "function next_result() {\n if (counter >= 11 && Object.keys(info_data).length > 0 && counter <= Object.keys(info_data).length) {\n try {\n updateResultPage(\"next\");\n result_title.innerHTML = \"Anime Ranking by \" + search_t + \" <br> Showing results: \" + (counter - 1).toString() + \" / \" + Object.keys(info_data).length.toString();\n } catch (e) {\n console.log(\"Error when showing previous result:\" + e.toString());\n }\n }\n}", "title": "" }, { "docid": "8aa7f9bf1c14031d161fc564c7e37710", "score": "0.60163206", "text": "async prevResultsPage () {\n this.searchOffset -= 10\n if (this.searchOffset < 0) { this.searchOffset = 0 }\n this.searchResults = await this.search()\n document.documentElement.scrollTop = 0\n }", "title": "" }, { "docid": "b48c43a8bd3e35f1e9898d2bd5819ec4", "score": "0.6011945", "text": "function addSearchingParams() {\n if ($(\"#input-result-number\").length && $(\"#input-page\").length) {\n resultsInput = \"?number=\" + $(\"#input-result-number\").val();\n pageNumberInput = \"&offset=\" + ($(\"#input-page\").val() - 1);\n }\n }", "title": "" }, { "docid": "f372343b4bca637a25a5904862ea74f5", "score": "0.59749085", "text": "function updateSearchDisplay(newResults){\n Array.prototype.push.apply(currentResults, newResults); \n /* ^ takes Array's push function and applies it to \n currentResults with newResults as the list of arguments.\n This trick allows us to avoid repeating through all of \n new results and pushing them one by one to the currentResults.\n */\n\tvar listHtml = createResultsListHtml(currentResults); \t\t\t\t\t\t\n\tinsertHtml('search-results', listHtml);\n\ttoggleMoreResultsButton();\n\taddFavoriteButtonListeners(); \n\taddTitleClickListeners();\n}", "title": "" }, { "docid": "41d15f4e4c55c85b4d772adfd5678376", "score": "0.59718937", "text": "function displayResults() {\n console.log(\"new page\");\n $('.display-results').show();\n unanswered = (5 - (correctCount + wrongCount));\n $('#correct-score').text(\"Correct Answers:\" + \" \" + correctCount);\n $('#wrong-score').text(\"Wrong Answers:\" + \" \" + wrongCount);\n $('#unanswered').text(\"Unanswered:\" + \" \" + unanswered);\n }", "title": "" }, { "docid": "a452bdb7ba8b49e56a0debceac2bda7c", "score": "0.59710705", "text": "function SearchCompleted(response) {\n \t$(\"#search-results-grid\").show();\n if (response.error) {\n var errorMessage = response.error.message;\n $(\"#search-pagination-grid, #dataGrid, #resultsCount\").hide();\n $(\"#search-error-message\").show();\n $(\"#search-error-message\").html(\"Sorry, something went wrong, if issue persist, please contact AAA.\");\n searchPageNumber = 1;\n }\n else if (response.items == null || response.items.length === 0) {\n \t$(\"#search-pagination-grid, #resultsCount, #dataGrid\").hide();\n manageGrid();\n $(\"#search-error-message\").show();\n $(\"#search-error-message\").html(\"No search results found.\");\n searchPageNumber = 1;\n }\n else {\n \t$(\"#resultsCount, #search-result-box, #dataGrid\").show();\n \t$(\"#search-error-message\").hide();\n manageGrid();\n var html = \"\";\n $(\"#resultsCount\").html(response.searchInformation.formattedTotalResults + \" results\");\n /* Navigation Links handling */\n var totalItems = response.searchInformation.totalResults;\n searchTotalListPages = Math.ceil(totalItems / searchResultsPerPage);\n var indexCount = response.queries.request[0].startIndex;\n if (searchTotalListPages > 1) {\n $(\"#totalListPages\").html(\"of \" + searchTotalListPages);\n }\n // loop handling\n for (var i = 0; i < response.items.length; i++) {\n var item = response.items[i];\n var responseTitle = item.htmlTitle;\n var responseUrl = item.htmlFormattedUrl;\n var responseData = item.snippet;\n html += \"<div class='result-item'><a href='\" + item.link + \"' class='link-btn link-lg roboto-medium font-f'>\" + responseTitle + \"</a><a href='\" + item.link + \"' class='link-btn link-lg roboto-light font-h result-link'>\" + responseUrl + \"</a><p class='roboto-light font-h'>\" + responseData + \"</p></div>\";\n }\n /* pagination Logic start */\n searchPageNumber = parseInt(searchPageNumber);\n if (parseInt(searchPageNumber) < 5) {\n defaultPage = 1;\n if (searchTotalListPages < 5) {\n defaultTotalPages = searchTotalListPages + 1;\n }\n else {\n defaultTotalPages = 6;\n }\n }\n else if (parseInt(searchPageNumber) > 5) {\n defaultPage = parseInt(searchPageNumber) - 2;\n defaultTotalPages = parseInt(searchPageNumber) + 3;\n \n if(defaultTotalPages > parseInt(searchTotalListPages) + 1){\n \tdefaultTotalPages = searchTotalListPages + 1 ;\n \tdefaultPage = searchTotalListPages - 4;\n }\n }\n\n \n var navigation_html = '<ul class=\"row\"><li class=\"page-links col-xs-3\"><a href=\"#\" title=\"Solid button\" class=\"btn btn-style btn-sm btn-color-blue btn-reversed\" id=\"searchPrevPage\"><span aria-hidden=\"true\" class=\"prev-page glyphicon glyphicon-arrow-left\"></span>Prev</a></li><li class=\"page-links text-center col-xs-6\">';\n for (var i = defaultPage; i < defaultTotalPages; i++) {\n navigation_html += '<a href=\"javascript:void(0);\" class=\"search-page-nav navPage_click\" id=\"id' + i + '\">' + (i) + '</a>';\n }\n navigation_html += '</li><li class=\"page-links text-right col-xs-3\"> <a href=\"#\" title=\"Solid button\" class=\"btn btn-style btn-sm btn-color-blue btn-reversed\" id=\"searchNextPage\">Next <span aria-hidden=\"true\" class=\"next-page glyphicon glyphicon-arrow-right \"></span></a></li></ul>';\n $('#search-pagination-grid').html(navigation_html);\n $('#search-pagination-grid').show();\n if (totalItems <= 10)\n {\n \t$('#search-pagination-grid').hide();\n }\n $(\".page_link\").removeClass(\"active\");\n $(\"#id\" + searchPageNumber).addClass('active');\n $('#searchNextPage').click(function () {\n getResultData(searchkeyValue, 1, '');\n e.preventDefault();\n });\n $('#searchPrevPage').click(function () {\n getResultData(searchkeyValue, -1, '');\n e.preventDefault();\n });\n $(\".search-page-nav\").click(function () {\n var selectedPage = $(this).text();\n getResultData(searchkeyValue, '', selectedPage);\n e.preventDefault();\n });\n if (searchPageNumber === 1) {\n $(\"#searchPrevPage\").addClass('disabled');\n }\n else if (searchPageNumber === searchTotalListPages) {\n $(\"#searchNextPage\").addClass('disabled');\n }\n else {\n $(\"#searchNextPage\").removeClass('disabled');\n $(\"#searchPrevPage\").removeClass('disabled');\n }\n $(\"#search-resultContent\").html(html);\n }\n }", "title": "" }, { "docid": "c73d8ea05ed7836746d0f7c1d6decdb6", "score": "0.5968918", "text": "function executeSearch(searchText)\n{\n \n pageNumber = 1;\n\n assignMatchClassToNodes(searchText);\n\n const matchList = getMatchList();\n\n const nonMatchList = getNonMatchList();\n\n for (i = 0; i < nonMatchList.length; i++)\n {\n \n nonMatchList[i].style.display = \"none\";\n \n }\n\n //pass only the list of matches to the showPage function\n showPage(matchList, pageNumber);\n\n appendPageLinks(matchList);\n\n}", "title": "" }, { "docid": "e9e2967a36eef407f42b4dec8563330b", "score": "0.59579265", "text": "function showResultSearchActivity(rowsHtml, numResult) {\n $('.listActivity').html(rowsHtml);\n $('.resultSearchActivity').text(numResult);\n}", "title": "" }, { "docid": "39ed4a2275efed6f9b22f9196427dfaf", "score": "0.5931577", "text": "function pageOne() {\n pageOneResult += 1;\n questionCount += 1;\n if (questionCount >= 3) {\n updateResult();\n }\n}", "title": "" }, { "docid": "18b9a8d4ca13b3f06e0d447194089d07", "score": "0.5924476", "text": "search(queryString, numberOfResults, opts, callback) {\n const options = opts;\n options.query = queryString;\n if (numberOfResults < 100 && numberOfResults > 0) {\n options.count = numberOfResults;\n } else {\n options.count = 100;\n }\n if (numberOfResults === null) {\n numberOfResults = Number.MAX_SAFE_INTEGER;\n }\n\n this.request(options, (err, result) => {\n if (err) {\n callback(err);\n } else {\n const resultsNumber = parseInt(result['search-results']['opensearch:totalResults'], 10);\n if (numberOfResults < resultsNumber) {\n callback(null, result['search-results'].entry);\n } else {\n let queryResults = [];\n queryResults = queryResults.concat(result['search-results'].entry);\n // Continue retrieving results till numberOfResults is reached\n this.searchNextResults(options, queryResults, 100, resultsNumber, callback);\n }\n }\n });\n }", "title": "" }, { "docid": "0d6a2007f4118f082d4247a6217898a2", "score": "0.58954537", "text": "function doSearchAndShow() {\n\n if (settings.timeOut > 0) {\n if (settings.globalTimeout !== null) {\n clearTimeout(settings.globalTimeout);\n }\n settings.globalTimeout = setTimeout(function () {\n settings.globalTimeout = null;\n\n settings.onDataRequest.call(this, 'search', currentMention.keyword, onDataRequestCompleteCallback);\n\n }, settings.timeOut);\n\n } else {\n settings.onDataRequest.call(this, 'search', currentMention.keyword, onDataRequestCompleteCallback);\n }\n }", "title": "" }, { "docid": "f95ecfedf66b6c9267ad485ba26a5c85", "score": "0.58896035", "text": "function listPagination() {\n\n if ( nbItemsDisplayed == 0 ) {\n //consoleLog(nbItemsDisplayed);\n reInitFilter();\n } else {\n //Suppression du message d'erreur\n setTimeout( function(){\n //consoleLog('Out');\n $('#noResult').fadeOut()\n resultFrom == \"\";\n }, 4500);\n }\n $('.nbResult .nb').text(nbItemsDisplayed).animate({'opacity':1});\n\n var itemsPagination = $('.itemRanged'),\n nbResults = itemsPagination.length,\n btNext = $('#btPlusResults');\n\n items.hide();\n $('.itemRanged').not(':lt('+nbVisible+')').addClass('nextItem');\n $('.itemRanged:lt('+nbVisible+')').fadeIn();\n\n if ( nbResults > nbVisible ) {\n $('#btPlusResults').show();\n }else{\n btNext.hide();\n };\n}", "title": "" }, { "docid": "1fb7e53e49dc7412adea678c730d70fc", "score": "0.5876316", "text": "function showResults(){\n\t\tif (enable == false){\n\t\t\t$('#resultsText').html(lines); \t\t\t\t\n\t\t\t$('#search').css('display', 'none');\n\t\t\t$('#results').css('display', 'inline-block');\n\t\t\tenable = true;\n\t\t} else {\n\t\t\t$('#resultsText').html('');\n\t\t\t$('#results').css('display', 'none');\n\t\t\t$('#search').css('display', 'inline-block');\t\t\n\t\t\tenable = false;\n\t\t}\t\t\t\t\n\t} // end of function showResults", "title": "" }, { "docid": "2b384e99cb72aa98e15115de1941bd02", "score": "0.58661526", "text": "function toNext(n){\r\n counter = n;\r\n if(counter < maxCount){\r\n counter++;\r\n }else{\r\n counter = 0;\r\n }\r\n location.href=\"#hit\"+counter;\r\n $(\"#filter-count\").show().text(''+(counter+1)+'/'+(maxCount+1));\r\n $('#next').focus();\r\n\r\n// ////OOOOOOOOOO\r\n// $(\"#filter-count_xs\").show().text(''+(counter+1)+'/'+(maxCount+1));\r\n// $('#next_xs').focus();\r\n\r\n $('#hit'+counter).css('background-color', 'yellow');\r\n $('#hit'+(counter-1)).css('background-color', '#BFBFBF');\r\n }", "title": "" }, { "docid": "19ec843f9403c130678400e1395ad9d2", "score": "0.58461887", "text": "function navigateToResults() {\n if (addedItems && addedItems.length !== 0) {\n // Analytics.trackEvent(\"Stats\",\"Item Count\",currentMode.name.capitalize(),Selection.addedItems.length);\n window.location = \"../results/\" + removeAmpersandsFromString(Selection.buildHash(addedItems).substring(2));\n }\n }", "title": "" }, { "docid": "f1a7fe4ca7db77840b468f2aefb52736", "score": "0.58395946", "text": "changeResults(e){\n\t\tactions.getSearchResults(e.target.value);\n\n\t}", "title": "" }, { "docid": "7962e23fa26785708545acb2044f000c", "score": "0.5837334", "text": "function updateShowedResults () {\n\n // Merge results depending on 'order by' option\n if ( document.getElementById(\"Orderby_ranking\").checked ) {\n mergeResults (RANKING_ORDER);\n }\n else\n mergeResults (ALPHABETICAL_ORDER);\n\n applyFilters ();\n // Print results\n //showResults ( _sortedResults );\n}", "title": "" }, { "docid": "0ae9be362b4f9335b3d82179ce8258af", "score": "0.5820478", "text": "showMore() {\n const { s, page } = this.state;\n this.submitSearch(s, page + 1);\n }", "title": "" }, { "docid": "f652964894f7bd9dc260e892cf3b31da", "score": "0.58178574", "text": "function updateResults(newUrl) {\n // Prevent search from interfering with Museum Day finder\n if (window.location.href.indexOf('/museumday/') === -1) {\n // Remove any extra &\n newUrl = newUrl.replace(/\\&\\&\\&/g, '&');\n newUrl = newUrl.replace(/\\&\\&/g, '&');\n\n // Push new URL parameters\n history.pushState(null, null, newUrl);\n\n // Animate results opacity to convey that update is happening\n $('#searchResultsWrapper').animate({'opacity': 0.5}, fadeTime);\n $('#paginationWrapper').animate({'opacity': 0}, fadeTime);\n $('#searchRefreshWrapper').load(location.href + ' #searchRefresh', function() {\n $('#searchFiltersWrapper, .search-results, .search-filters').fadeIn();\n $('#searchResultsWrapper').animate({'opacity': 1}, fadeTime);\n\n // Show image thumbnails on results update\n var count = 1;\n $('#resultsList a.thumbnail span').each(function() {\n if ($(this).attr('data-src')) {\n var src = $(this).attr('data-src');\n $(this).prepend('<img src=\"' + src + '\" alt=\"search result thumbnail ' + count + '\"/>');\n }\n count++;\n });\n\n // Show thumbnails locally\n // if (window.location.href.indexOf('127.0.0.1') > -1 || window.location.href.indexOf('localhost') > -1) {\n // $('#resultsList a.thumbnail img').each(function() {\n // var src = $(this).attr('src');\n // $(this).attr('src', src.replace('http://127.0.0.1:8888', 'https://thumbs-staging.si-cdn.com'));\n // });\n // }\n\n // Remove duplicate thumbnails\n $('#resultsList a.thumbnail span.IE-article-overview-thumbnail-hide').hide();\n\n // Prevent page reload on pagination link click\n $('.pagination .pages .page').each(function(e) {\n $(this).removeAttr('href');\n });\n\n // Hide pagination if only one page of results\n if ($('.pagination .page-counter').prev('span').hasClass('disabled') && $('.pagination .page-counter').next('span').hasClass('disabled')) {\n $('.pagination').hide();\n }\n });\n }\n }", "title": "" }, { "docid": "216f781db8f0baebad2b6d96b4430107", "score": "0.58134115", "text": "function viewMore(){\n //clear the side bar to display new results\n $(\"ol li:lt(\"+listLength+1+\")\").css( \"display\", \"none\");\n //Display the notes from the current index up until 10 more\n $(\"ol li:gt(\"+listLength+\"):lt(10)\").css( \"display\", \"block\");\n listLength += 10;\n }", "title": "" }, { "docid": "a7bb10eecec67bc40f73502c7d525891", "score": "0.5800203", "text": "function getResults() {\n search();\n}", "title": "" }, { "docid": "3234cecb156d6d4ac146bc79a9b26ede", "score": "0.57929105", "text": "function reloadTmodelModal()\n{\n RenderTmodelListBySearch('%', offset, maxrecords, true);\n \n}", "title": "" }, { "docid": "35e795afae864140cc030eb94f2acaf9", "score": "0.57885283", "text": "function getCount(queryParams) {\n // get the #results-count div\n var div = document.getElementById('results-count');\n // fire GET request of the page\n $.get(resultsCount, function(data, status){\n // put the data obtained into #results-container\n div.innerHTML += `${data.count} records found`;\n });\n}", "title": "" }, { "docid": "bf4d96e46c1a526071193fde94f9b06c", "score": "0.57775426", "text": "onLoadMoreButtonClick() {\n this.search();\n }", "title": "" }, { "docid": "792db2ca69ad8c92623407b427ed8346", "score": "0.5772984", "text": "function previous_result() {\n if (counter > 11 && Object.keys(info_data).length > 0) {\n try {\n updateResultPage(\"previous\");\n result_title.innerHTML = \"Anime Ranking by \" + search_t + \" <br> Showing results: \" + (counter - 1).toString() + \" / \" + Object.keys(info_data).length.toString();\n } catch (e) {\n console.log(\"Error when showing previous result:\" + e.toString());\n }\n }\n}", "title": "" }, { "docid": "713c0d6976c63720401bc998b8cafff0", "score": "0.5770232", "text": "function setNewPageCount() {\n pageCount = Math.round(tableLength / countOfRows);\n // if (pageNumber > pageCount)\n // pageNumber = pageCount;\n }", "title": "" }, { "docid": "a9d27a23ee5a69078a9a1eb045c2c61a", "score": "0.57667726", "text": "function searchResultCounter(instance, row, col, value, result) {\n const DEFAULT_CALLBACK = function(instance, row, col, data, testResult) {\n instance.getCellMeta(row, col).isSearchResult = testResult;\n };\n\n DEFAULT_CALLBACK.apply(this, arguments);\n /*if (result) {\n searchResultCount++;\n }*/\n }", "title": "" }, { "docid": "597301a87f8f1b0f8d8e3cca3944562e", "score": "0.57654667", "text": "function showResults () {\n $pageDivs.all.hide();\n $pageDivs.results.show();\n // setTimeout(callback, 10000);\n \n}", "title": "" }, { "docid": "328570acde6d0d017bbcc6a4f620fbfb", "score": "0.5760758", "text": "function updateRowCount() {\n enqueueRequest(\n baseUrl + '/.row-count', query, [$('#row-counts'), $('#pagination')],\n function (_filteredRowCount) {\n filteredRowCount = _filteredRowCount;\n\n $('#row-counts').empty().append(\n '' + filteredRowCount + ' ' + dataSetName + ' ('\n + (Math.round(1000.0 * filteredRowCount / dataSetRowCount) / 10.0) + '%)');\n\n // reset pagination\n $('#pagination').empty().append('Rows <span id=\"pagination-from\">1</span> - <span id=\"pagination-to\">'\n + Math.min(pageSize, filteredRowCount) + '</span>');\n\n if (filteredRowCount > pageSize) {\n $('#pagination').append('&#160;&#160;').append(\n $('<a id=\"pagination-backward-button\" href=\"#\" style=\"display:none\" title=\"Previous page (Previous page (⇠ key))\"><span class=\"fa fa-angle-left\"> </span> Previous</a>').click(paginateBackward)\n );\n $('#pagination').append('&#160;&#160;').append(\n $('<a href=\"#\" id=\"pagination-forward-button\" title=\"Next page (⇢ key)\">Next <span class=\"fa fa-angle-right\"> </span></a>').click(paginateForward)\n );\n }\n\n }, false);\n }", "title": "" }, { "docid": "10eac33e7d240c9c14d3612ca0f1d914", "score": "0.5757991", "text": "function findit(){var e=$(\"#search-text\").val(),t=$(\".search-item\").length+1;if(e.length>=1){$(\".search-content\").show(),$(\".search-filter\").attr(\"data-query\",e),$(\".search-result span\").show().html(\"Searching ...\");var r=\"/feeds/posts/default?max-results=12&start-index=\"+t+\"&alt=json&q=\"+e;$.ajax({type:\"GET\",url:r,async:!0,contentType:\"application/json\",dataType:\"jsonp\",success:function(t){$(\".more-result\").hide(),doSearch(t,e)}})}else $(\".search-content\").hide()}", "title": "" }, { "docid": "7d3ccb0e8583c885fbe5b40b81429078", "score": "0.5757485", "text": "loadMore(providedInput) {\n // if new terms are provided by presentational component use them, else default to incrementing current limit once\n const newInput = providedInput || {\n ...paginationInput,\n limit: results.length + initialPaginationInput.limit,\n };\n setPaginationInput(newInput);\n }", "title": "" }, { "docid": "ea60bfedef2685d7abbb501860f9bcec", "score": "0.5752664", "text": "function search() {\n // Declare variables\n let input = document.getElementById('input-term');\n term = input.value.toLowerCase().replace(\" \", \"+\");\n\n let list = document.getElementById(\"result-list\");\n\n if (term.length < 3) {\n return;\n }\n\n list.innerHTML = '';\n\n page = 1;\n showResultsOfCurrentPage();\n\n}", "title": "" }, { "docid": "cfcc27a9ecb1209626359fa87991b93d", "score": "0.57435083", "text": "function initUI() {\n $results = $(\"#results\");\n $pager = $('.pager');\n\n $(\"#search\").keyup(function() {\n $results.empty();\n $pager.empty();\n\n // Only trigger a search when 2 chars. at least have been provided\n currentQuery = $(this).val();\n if (currentQuery.length < 2) {\n return;\n }\n\n results = search(currentQuery);\n console.log(results);\n goToPageIndex(0);\n });\n}", "title": "" }, { "docid": "5322485992a0e24c6bf45059ba1455f6", "score": "0.57404363", "text": "function flush(results) {\n $RESULTS.count = results.count;\n $RESULTS.pages = Math.ceil(results.count / $RESULTS.limit);\n }", "title": "" }, { "docid": "d48f47d3b261cd412d97abf9bdbb4080", "score": "0.57342035", "text": "function pageChanged() {\n console.log('Page changed to: ' + $scope.paginator.currentPage);\n\n /**\n * incase the user changes the page as we are fetching it should de reference the scope binding with the\n * view\n * @type {*}\n */\n var page = angular.copy($scope.paginator.currentPage);\n\n $scope.fetching = true;\n var offset = $scope.data.limit * page; //calculate pagination\n var search_query = $scope.data.search;\n\n Spotify.search([\"album\"], search_query, offset, $scope.data.limit).then(function (success) {\n $scope.fetching = false;\n console.log(success);\n\n $scope.data = success.data.albums;\n $scope.data.search = search_query;\n\n //update our paginate directive\n $scope.paginator.currentPage = page;\n\n //update our outer count of how many result fetched of total\n $scope.currentPage = success.data.albums.offset;\n\n }, function (failure) {\n console.error(failure);\n $scope.fetching = false;\n });\n\n }", "title": "" }, { "docid": "c638b10aadd5f357b5dc437a2b8f51b2", "score": "0.5729523", "text": "function updatePageNumber() {\n var currentPage = fvArticles.currentPage + 1;\n fvArticles.count().done(function (count) {\n divPageNumber.innerHTML = \"Page \" + currentPage\n + \" of \" + count;\n });\n }", "title": "" }, { "docid": "be5115b142d995832f928f5b775735d6", "score": "0.572916", "text": "function showSearchResult (courseCount, subjectCount) {\n\t\tif (courseCount > 0) {\n\t\t\tvar text = \"\";\n\n\t\t\tif (subjectCount > 1) {\n\t\t\t\ttext = \"Found \" + courseCount + \" results in \" + subjectCount + \" subjects:\";\n\t\t\t} else if (courseCount > 1) {\n\t\t\t\ttext = \"Found \" + courseCount + \" results:\";\n\t\t\t} else {\n\t\t\t\ttext = \"Found 1 result:\";\n\t\t\t}\n\n\t\t\t$resultCount.text(text);\n\t\t}\n\t}", "title": "" }, { "docid": "133d42a1ddd20f08cbdd5caaec066e50", "score": "0.5725495", "text": "function updateList() {\n selectWithSearchDatasource.getSelectOptions(selectWithSearchModalController.datasourceName, {\n query: selectWithSearchModalController.query,\n page: selectWithSearchModalController.page,\n params: selectWithSearchModalController.params,\n fullModel: selectWithSearchModalController.fullModel\n }).then(function (data) {\n selectWithSearchModalController.searchResults = data;\n setNonSelectedResults();\n });\n }", "title": "" }, { "docid": "175c579baa31c16a7c2e75d928572cfc", "score": "0.5720179", "text": "function initPagination() {\n\t\t\t$scope.totalItems = vm.results.length;\n\t\t\tvm.pageChanged();\n\t\t}", "title": "" }, { "docid": "49265df3c57c88f0f2c84c4144380eb8", "score": "0.57182366", "text": "function changePageResults(query, nextToken ){\n\n\n\t$('.js-next-button').on('click', function(event){\n\t\tevent.preventDefault();\n\n\t\tquery.pageToken = nextToken;\n\t\t//prevToken = nextToken;\n\n\t\t($.getJSON(YOUTUBE_SEARCH_URL, query, function(data){\n\t\t\n\t\t\tconst response = data;\n\t\t\tparseResults(query, response);\n\t\t\t\n\t\t}));\n\t});\n\n\t\n}", "title": "" }, { "docid": "d06c26731ef481e30128befad7d1ec0f", "score": "0.57112414", "text": "function SearcherDisplay() { }", "title": "" }, { "docid": "6ac103b5d12305d309903f24ddae70b7", "score": "0.5705865", "text": "showMoreValues() {\n const { facetId, numberOfValues: increment } = options;\n const { values } = this.state;\n const numberOfValues = values.length + increment;\n dispatch(updateCategoryFacetNumberOfValues({ facetId, numberOfValues }));\n dispatch(updateFacetOptions({ freezeFacetOrder: true }));\n dispatch(executeSearch(logFacetShowMore(facetId)));\n }", "title": "" }, { "docid": "12374fda4705eb316d1c0cb37914bd00", "score": "0.5698054", "text": "changeCountItemDisplaying(countTake) {\n //if NaN or null means he wants to display all the items\n if (!countTake)\n countTake = this.itemsCount;\n\n this.takeItemsCount = countTake;\n //change limit items\n this.pagingLimt.skip = 0;\n this.pagingLimt.take = countTake;\n\n //reset pages number\n this.pagination(this.itemsCount, countTake);\n\n //got page number 1\n this.gotoPage(1, true);\n }", "title": "" }, { "docid": "c8c642b7939b63e7a382c9c2ec1b2775", "score": "0.56926996", "text": "function getNatParks(term,resultNum) {\n console.log('fired getNatParks');\n //create the proper URL string to pass into the fetch\n const params = {\n limit: resultNum,\n stateCode: term,\n }\n const paramStr = formatQueryParams(params);\n const url = searchUrl + '?' + paramStr + '&sort=states';\n\n //fetch the data from the API\n fetch(url)\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .then(responseJson => {\n displayResults(responseJson)})\n .catch(err => {\n $('#js-error-message').text(`Something went terribly wrong: ${err.message}`);\n });\n\n \n}", "title": "" }, { "docid": "0910542f4c8f4b4529e54cc60f8ecae2", "score": "0.56902397", "text": "function update_selection_counter(selection_size) {\n $(\"#filtered-items\").text(selection_size);\n}", "title": "" }, { "docid": "75abfa1886f7af9c02739fdc9ecd8679", "score": "0.56859666", "text": "setResults(results) {\n if(!results || !results.length) {\n this.setMessage(\"No suggestions available\");\n return;\n }\n\n var htmlString = \"\";\n var url = \"./q/title\";\n var title = \"title\";\n\n results.forEach(result => {\n htmlString += `<li class=\"list-group-item\"><a href=\"/search?query=${result}\">${result}</a></li>`;\n });\n\n this._searchDropdown.innerHTML = htmlString;\n }", "title": "" }, { "docid": "bf9283736197cbf3370e6b18c9cd4ea3", "score": "0.56857806", "text": "function flush(results) {\n $RESULTS.count = results.count;\n $RESULTS.pages = Math.ceil(results.count / $RESULTS.limit);\n }", "title": "" }, { "docid": "0da421b6ed8cedec52da9a37f942af9c", "score": "0.56848377", "text": "async function getData(e, page) {\n e.preventDefault()\n const request = await fetch(requestConstructor(searchTerm, page))\n const data = await request.json()\n setResultsView(data.items)\n totalResults.push(...[data.items])\n console.log(totalResults)\n setPage(totalResults.length)\n setResultsFound(data.total_count)\n }", "title": "" }, { "docid": "e7817d367d5e7be39411b0b4c4d5cfb4", "score": "0.5677408", "text": "function searchResults(query, currentPageType, currentSelectedName) {\n // Global search results properties\n var newPage = 1;\n var maxPageNumber = 0;\n var numberPerPage = 10;\n var pageType = \"community_posts\";\n // If the user is on a community result or topic page, then pre-select the radio buttons.\n if (currentPageType === \"Community\") {\n // Ensure the Help Centre results are hidden.\n $(\"#sresults\").hide();\n $('.communitiesRespagination').show();\n $('.CommunityPagination').hide();\n $('#HelpCentreResults').hide();\n // Check which topic the user is viewing.\n switch (currentSelectedName.toLowerCase()) {\n case \"academies\":\n $('#HCAcademies').prop('checked', true);\n break;\n case \"maintained schools\":\n $('#HCMaintainedSchools').prop('checked', true);\n break;\n case \"local authorities\":\n $('#HCLocalAuthorities').prop('checked', true);\n break;\n case \"further education and training providers\":\n $('#HCFEselect').prop('checked', true);\n break;\n default:\n $('#hcALL').prop('checked', true);\n }\n } else {\n // Articles global variables.\n var pageType = \"articles\";\n var resultsTextType = '';\n var FEnews = window.location.href.indexOf('fenews=true') > 1;\n if (currentSelectedName === \"FE NEWS\" || FEnews) {\n var resultsTextType = \"News\";\n resultsCSS = \"esfaNews\";\n } else {\n var resultsTextType = \"ESFA HELP ARTICLES\";\n var resultsCSS = \"esfaHelpArticles\";\n }\n $('#HelpCentreResults').show();\n $('#CommunityFilterResults').hide();\n $('.communitypagination').hide();\n $(\"#fenews-select\").click(function() {\n resultsTextType = \"News\";\n $('.resultTypes').addClass('govuk-tag--esfaNews');\n $('.resultTypes').css('background-color', '#626A6E');\n $('#HelpCentreResults').hide();\n });\n }\n var noResultsFoundHTML = \"<div class='govuk-!-padding-bottom-4 govuk-!-padding-top-4'><p class='govuk-body'>No results found. Try searching another keyword.</p></div>\";\n var internalErrorHTML = \"<div class='govuk-!-padding-bottom-4 govuk-!-padding-top-4'><p class='govuk-body'>Due to an internal error, we are unable to show community posts at this time.</p><p class='govuk-body'>Try refreshing the page in a few moments.</p></div>\";\n var getData = function(pageType, query, sectionIDCS, sortBy, page, numberPerPage, clicked, posttopicID) {\n $(\"#sspinner\").show();\n $(\"#sresults\").hide();\n $('.CommunityPagination').hide();\n // Onpage Load.\n helpers.getSearchResultsPage(pageType, query, sectionIDCS, sortBy, newPage, numberPerPage, posttopicID).done(function(r, ts, xhr) {\n // Show the results if the 'Articles' option is selected\n $(\"#sresults\").show();\n $('.resultCommunities').hide();\n $('.communitypagination').hide();\n $('.CommunityPagination').show();\n // Clicked means 'does next page exist'\n if (!clicked) {\n // ON PAGE LOAD\n // On Page load hide the prev button (We always start at page 1 so prevous won't exist).\n $('.pagination-prev').hide();\n // Display next button if the number per page exceeds or is equal to the total count.\n if (numberPerPage >= r.count) {\n $('.pagination-next').hide();\n } else {\n $('.pagination-next').show();\n }\n maxPageNumber = r.page_count;\n } else {\n // ON CLICK\n // Display prevous if we are not on page one else show.\n if (r.page != 1) {\n $('.pagination-prev').show();\n } else {\n $('.pagination-prev').hide();\n }\n if (r.page >= r.page_count) {\n $('.pagination-next').hide();\n } else {\n $('.pagination-next').show();\n }\n }\n // Label Colours.\n var labelNames = \"\";\n $.each(r.results, function(key, value) {\n var labelNames = \"\";\n var resDetails = value.snippet;\n $.each(value.label_names, function(key, value) {\n labelNames += `<strong class=\"govuk-tag govuk-tag--small govuk-tag--${toCamelCase(value)} govuk-!-margin-bottom-2 govuk-!-margin-right-2\">${value}</strong>`;\n });\n // Show the help centre search results.\n $(\"#sresults\").append(`\n <div class='collapsible-nav-border govuk-!-padding-top-4 articleresultsitems'>\n <div class='search-results-box'>\n <div>\n <h3 class='govuk-heading-s govuk-!-margin-bottom-1 govuk-!-margin-right-1'>\n <a class='govuk-link' href='${value.html_url}'>${value.name}</a>\n </h3>\n <p class='govuk-body govuk-!-margin-bottom-2'>Last updated ${moment(value.updated_at).format('Do MMMM YYYY')}</p>\n </div>\n <div>\n <span class='search-result-votes govuk-!-margin-right-1'> <span aria-hidden='true'> <svg width='19' height='20' viewBox='0 0 19 20' fill='none' xmlns='http://www.w3.org/2000/svg'> <path d='M5.83366 18.3334H3.33366C2.89163 18.3334 2.46771 18.1578 2.15515 17.8452C1.84259 17.5326 1.66699 17.1087 1.66699 16.6667V10.8334C1.66699 10.3913 1.84259 9.9674 2.15515 9.65484C2.46771 9.34228 2.89163 9.16669 3.33366 9.16669H5.83366M11.667 7.50002V4.16669C11.667 3.50365 11.4036 2.86776 10.9348 2.39892C10.4659 1.93008 9.83003 1.66669 9.16699 1.66669L5.83366 9.16669V18.3334H15.2337C15.6356 18.3379 16.0256 18.197 16.3319 17.9367C16.6382 17.6764 16.8401 17.3141 16.9003 16.9167L18.0503 9.41669C18.0866 9.17782 18.0705 8.93392 18.0031 8.7019C17.9357 8.46987 17.8187 8.25527 17.6602 8.07295C17.5017 7.89063 17.3054 7.74496 17.085 7.64603C16.8645 7.54711 16.6252 7.49728 16.3837 7.50002H11.667Z' stroke='#0B0C0C' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/> </svg> <span class='govuk-body govuk-!-font-size-19 search-result-value'>0</span> </span> </span>\n </div>\n </div>\n <div class=\"govuk-tag-list\">\n \t<span class='resultTypes govuk-tag govuk-tag--small govuk-tag--${resultsCSS} govuk-!-margin-bottom-2 govuk-!-margin-right-2'>${resultsTextType}</span>${labelNames}\n </div>\n <article class='govukbodyoverwrite govuk-!-margin-top-1'>\n <p class='govuk-body search-result-text'>${resDetails}</p>\n </article>\n `);\n });\n // If no results are found display message.\n if (currentPageType === \"Articles\" || currentPageType === \"All types\") {\n if (r.count == 0) {\n $('#ShowingArticleCount').text(\"Showing page 0 of 0\");\n $(\"#sresults\").empty();\n $(\"#sresults\").append(noResultsFoundHTML);\n $('.CommunityPagination').hide();\n $('.communitiesResults').hide();\n }\n }\n if (xhr.status == 429) {\n $('#ShowingArticleCount').text(\"Showing page 0 of 0\");\n $(\"#sresults\").empty();\n $(\"#sresults\").append(internalErrorHTML);\n }\n }).fail(function() {\n $(\"#sresults\").empty();\n $(\"#sresults\").append(internalErrorHTML);\n });\n }\n // Get the selected checkbox ID's.\n var selected = [];\n $('.hcradiolabeloptions input[checked=\"checked\"]').each(function() {\n selected.push($(this).attr('value'));\n });\n // Convert to comma separated array.\n var sectionIDCS = selected.join(\",\");\n // When a radio button is pressed, load the results for it.\n $(\"input[type='radio']\").on('change', function() {\n $(\"#sresults\").empty();\n // Get the data\n var sectionIDCS = $(this).val();\n var posttopicID = $(this).attr(\"data-communitytopic\");\n // Set the pageType to articles.\n var pageType = \"articles\";\n // Set the colour of the labels here\n var resultsTextType = '';\n var FEnews = window.location.href.indexOf('fenews=true') > 1;\n if (currentSelectedName === \"FE NEWS\" || FEnews) {\n var resultsTextType = \"News\";\n resultsCSS = \"esfaNews\";\n $('.resultTypes').addClass('govuk-tag--esfaNews');\n $('.resultTypes').css('background-color', '#626A6E');\n } else {\n var resultsTextType = \"ESFA HELP ARTICLES\";\n var resultsCSS = \"esfaHelpArticles\";\n }\n if (currentPageType === \"Articles\" || currentPageType === \"All types\") {\n // Number per page = put this in the manifest file\n getData(pageType, query, sectionIDCS, \"desc\", 1, 10, false, posttopicID);\n $('.resultTypes').css('background-color', '#626A6E');\n }\n });\n if (currentPageType === \"Articles\" && window.location.href.indexOf('fenews=true') > 1) {\n $('#fenews-select').prop('checked', true);\n } else if (currentPageType === \"Community\") {\n console.log('conditionmet');\n $('#namefilteroptionsCommunity').prop('checked', true);\n } else {\n console.log('condition two met');\n $('#namefilteroptionsArticles').prop('checked', true);\n }\n if (currentPageType === \"Community\") {\n // Ensure the Help Centre results are hidden.\n $(\"#sresults\").hide();\n $('.communitiesRespagination').show();\n $('.CommunityPagination').hide();\n $('#HelpCentreResults').hide();\n // Check which topic the user is viewing.\n switch (currentSelectedName.toLowerCase()) {\n case \"academies\":\n $('#HCAcademies').prop('checked', true);\n break;\n case \"maintained schools\":\n $('#HCMaintainedSchools').prop('checked', true);\n break;\n case \"local authorities\":\n $('#HCLocalAuthorities').prop('checked', true);\n break;\n case \"further education and training providers\":\n $('#HCFEselect').prop('checked', true);\n break;\n default:\n $('#hcALL').prop('checked', true);\n }\n }\n $(\"[name=radioselectsearchpage2]\").removeAttr(\"checked\");\n // fe news\n var FEnews = window.location.href.indexOf('fenews=true') > 1;\n var FECategorie = window.location.href.indexOf('category=360003078239') > 1;\n // Perform a check to ensure that the page is not a community results page\n if (currentPageType === \"All types\" && currentSelectedName != \"FE NEWS\" && !FEnews || currentPageType === \"Articles\" && currentSelectedName != \"FE NEWS\" && !FEnews) {\n var pageType = \"articles\";\n var posttopicID = \"\";\n $('.communitypagination').hide();\n $('#sresults').show();\n $('#HelpCentreResults').show();\n getData(pageType, query, sectionIDCS, \"desc\", 1, 10, false, posttopicID);\n } else if (currentSelectedName === \"FE NEWS\" || FEnews) {\n $('#HelpCentreResults').hide();\n $(\"#sresults\").hide();\n $('.communitiesRespagination').show();\n $('.CommunityPagination').hide();\n getData(\"articles\", query, \"news\", \"desc\", 1, 10, false, posttopicID);\n $('.resultTypes').text('News');\n } else {\n $('#HelpCentreResults').hide();\n }\n // Next or previous button pressed\n // Radio buttons pressed\n $('.hcradiolabeloptions input').click(function(e) {\n newPage = 1;\n })\n $('.next,.prev').click(function(e) {\n // Empty the results before displaying the new\n $(\"#sresults\").empty();\n // Decrement for Previous Page.\n if ($(this).hasClass('prev')) {\n $(window).scrollTop(0);\n e.preventDefault();\n newPage--;\n }\n // Increment for Next Page.\n if ($(this).hasClass('next')) {\n $(window).scrollTop(0);\n e.preventDefault();\n newPage++;\n }\n // Clamp pagination lower limit.\n if (newPage < 1) {\n newPage = 1;\n }\n // Clamp pagination max limit.\n if (newPage > maxPageNumber) {\n newPage = maxPageNumber;\n }\n // Get the selected checkbox ID's.\n var selected = '';\n $('.hcradiolabeloptions input[checked=\"checked\"]').each(function() {\n alert('true');\n selected = ($(this).attr('value'));\n });\n // Convert to comma separated array.\n var sectionIDCS = selected;\n var query = \"{{query}}\";\n //Finish the code for the next page\n var posttopicID = \"\";\n if (currentPageType === \"All types\" || currentPageType === \"Articles\") {\n getData(pageType, query, sectionIDCS, \"desc\", newPage, numberPerPage, true, posttopicID);\n } else {\n $('#ShowingArticleCount').text(\"Showing page 0 of 0\");\n $(\"#sresults\").empty();\n $(\"#sresults\").append(noResultsFoundHTML);\n $('.pagination-prev').hide();\n $('.pagination-next').hide();\n }\n });\n}", "title": "" }, { "docid": "3b551bd4bc36c33e900afb1ebc912a5c", "score": "0.5675348", "text": "function changeRows(norows) {\r\n noOfrows = norows;\r\n $('#pagination').twbsPagination('destroy');\r\n showjobs(1);\r\n}", "title": "" }, { "docid": "6df7066eaf4f9f91f8e2705a8254df6a", "score": "0.566426", "text": "changePage(page) {\n // if not page is passed the it will move to the next page\n this._page = page || this._page + 1;\n\n // if page is out of limits return\n if (this._totalPages && this._page > this._totalPages) {\n return;\n }\n\n // get the new results\n this._getNewResults(this._input, page)\n .then((response) => response.json())\n .then((data) => {\n this._results = data.Search.map(\n (movie) =>\n new MovieItem(\n movie.imdbID,\n movie.Title,\n movie.Year,\n movie.Poster,\n movie.Director,\n movie.Writer\n )\n );\n this._totalResults = data.totalResults;\n this._totalPages =\n Math.trunc(data.totalResults / 10) + (data.totalResults % 10 ? 1 : 0);\n // emit results added event to refresh the results component\n const event = new Event(\"results-added\");\n this.dispatchEvent(event);\n })\n .catch((error) => {\n this._errorHandler(error);\n });\n }", "title": "" }, { "docid": "b7bad572ae1443b6827a460be6a76736", "score": "0.5662809", "text": "function formResultsUsingFilterList(resultArray, maxNumber){ \n $(\"ol\").each(function(){ \n let currentModel=$(this).attr(\"id\");\n let counter = 0;\n $(\"#\"+currentModel).children(\"li\").each(function(){\n if ($.inArray($(this).data(\"word\"), resultArray[currentModel]) > -1 && counter < maxNumber){\n $(this).fadeIn('slow');\n counter ++;\n } else {\n $(this).fadeOut('slow');\n };\n });\n });\n}", "title": "" }, { "docid": "55458310351c4d7189b5435c80db84d6", "score": "0.56516147", "text": "function onResult(data) {\n setSearchResult(data.items || data.suggestions || data.results.items);\n }", "title": "" }, { "docid": "14977e9bd48087bd8acafd7bf3192555", "score": "0.5650174", "text": "function handleResults(results) {\n ctrl.matches = results;\n ctrl.hidden = shouldHide();\n\n // If loading is in progress, then we'll end the progress. This is needed for example,\n // when the `clear` button was clicked, because there we always show the loading process, to prevent flashing.\n if (ctrl.loading) setLoading(false);\n\n if ($scope.selectOnMatch) selectItemOnMatch();\n\n positionDropdown();\n reportMessages(true, ReportType.Count);\n }", "title": "" }, { "docid": "14977e9bd48087bd8acafd7bf3192555", "score": "0.5650174", "text": "function handleResults(results) {\n ctrl.matches = results;\n ctrl.hidden = shouldHide();\n\n // If loading is in progress, then we'll end the progress. This is needed for example,\n // when the `clear` button was clicked, because there we always show the loading process, to prevent flashing.\n if (ctrl.loading) setLoading(false);\n\n if ($scope.selectOnMatch) selectItemOnMatch();\n\n positionDropdown();\n reportMessages(true, ReportType.Count);\n }", "title": "" }, { "docid": "14977e9bd48087bd8acafd7bf3192555", "score": "0.5650174", "text": "function handleResults(results) {\n ctrl.matches = results;\n ctrl.hidden = shouldHide();\n\n // If loading is in progress, then we'll end the progress. This is needed for example,\n // when the `clear` button was clicked, because there we always show the loading process, to prevent flashing.\n if (ctrl.loading) setLoading(false);\n\n if ($scope.selectOnMatch) selectItemOnMatch();\n\n positionDropdown();\n reportMessages(true, ReportType.Count);\n }", "title": "" }, { "docid": "c2dc8d014f1da2f9bc49d1db8ca4eafc", "score": "0.5643293", "text": "setSearchState(searchInfo) {\n this.searchBar.property('value', searchInfo.term);\n this.searchCount.html(searchInfo.matches);\n }", "title": "" }, { "docid": "2baf9039918041285341dac5ed34019b", "score": "0.5634496", "text": "addPagingQuery() {}", "title": "" }, { "docid": "342b15d1b56323241c2e634c0b6b90c9", "score": "0.5633971", "text": "function womUpdateKeywords(filter) {\n var andMoreText, $all, $shown, $hidden;\n\n filter = filter || '*';\n if (filter !== '*') {\n filter = '.tid-' + filter;\n }\n\n $viewKeywords.find('.search-and-more').remove();\n\n $shown = $viewKeywords.find('.view-content > ' + filter).not('.selected');\n $shown.removeClass('element-invisible');\n\n $hidden = $viewKeywords.find('.view-content > *').not(filter + ', .selected');\n $hidden.addClass('element-invisible');\n\n // Only show the defined number of items.\n if ($shown.size() > keywordsMax) {\n $shown.each(function(index) {\n if ((index + 1) > keywordsMax) {\n $(this).addClass('element-invisible');\n }\n });\n\n andMoreText = Drupal.t('and !number more', {\n '!number' : ($shown.size() - keywordsMax)\n });\n\n $('<a>').addClass('btn search-and-more')\n .html(andMoreText)\n .click(function(e) {\n keywordsMax = 1000000;\n womUpdateKeywords($categorySelect.val());\n e.preventDefault();\n })\n .appendTo($viewKeywords.find('.view-content'));\n }\n }", "title": "" }, { "docid": "311184be574f2f401a099f19ee63d43c", "score": "0.5630359", "text": "function offsetResults(offsetChange) {\n var oldOffset = global.currentOffset;\n if (global.currentOffset + offsetChange < global.currentSearchResults.totalMatchCount) global.currentOffset += offsetChange;\n if (global.currentOffset < 0) global.currentOffset = 0;\n if (oldOffset !== global.currentOffset) {\n recipe_search(global.currentQuery, global.currentOffset);\n }\n}", "title": "" }, { "docid": "028fe37033b3aa838cedb5ebf16bb2e3", "score": "0.56303024", "text": "function showResults(res) {\r\n console.log(\"Showing results...\");\r\n\r\n // Show results matching query and display in asc order by date\r\n db.collection(currentCollection).find({\r\n text: new RegExp(query)\r\n }).sort({date: 1}).toArray(function(err, items) {\r\n // Render page with list of results\r\n res.render('search', {\r\n // Pass HTML \r\n helpers: {\r\n message: function() {return pagelist(items);}\r\n },\r\n // Hide search form\r\n searching: false,\r\n // Display what the query was\r\n query: query\r\n });\r\n });\r\n}", "title": "" }, { "docid": "194ef53fec39deeadf6b3644528b7f69", "score": "0.5629869", "text": "limit() {\n\t\t\tif (this.has_fetched) {\n\t\t\t\tif (this.page == 1) {\n\t\t\t\t\tthis.fetch();\n\t\t\t\t} else {\n\t\t\t\t\tthis.page = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "765f45094db48efbc8f542c42436414b", "score": "0.562621", "text": "function searchGetResult(results, count) {\n // Make sure this is the latest request\n if(!results || count < window.search_request_num) return;\n \n var splitter = results.indexOf(\" \"),\n column = results.substr(0, splitter),\n books_raw = results.substr(splitter + 1),\n books;\n \n // Display the results as decoded by JSON\n books = JSON.parse(books_raw);\n books.splice(7, Infinity); // (but only the first 7)\n searchDisplayResults(column, books);\n}", "title": "" }, { "docid": "0893a1970d16dd1d79070257027e0fe6", "score": "0.5624004", "text": "function updatePreviewResultSize() {\n Entity.query(getCurrentQuery().toFlatObject(), function (response) {\n $scope.entityResultSize = response.size;\n });\n }", "title": "" }, { "docid": "0d4a9f7b57e802b5c7f9e27426843c02", "score": "0.56186956", "text": "function getMoreCarsPost() {\n $.post(\n '/index',\n {\n current: current\n },\n function(data) {\n if (data.length) {\n fillPreview(data);\n current += data.length;\n }\n else {\n $('.get-more-results').hide();\n }\n }\n );\n}", "title": "" }, { "docid": "e20d274b2b2987f0f3fad174a2c434ff", "score": "0.56148785", "text": "setSearchTopStories(result) {\n const { hits, page } = result;\n this.setState(updatedSearchTopStoriesState(hits, page));\n }", "title": "" }, { "docid": "62721f9c54dd21ae13424a7852743e67", "score": "0.56145537", "text": "setPageSize(pageSize){this._pageSize=pageSize;return this;}", "title": "" }, { "docid": "62721f9c54dd21ae13424a7852743e67", "score": "0.56145537", "text": "setPageSize(pageSize){this._pageSize=pageSize;return this;}", "title": "" }, { "docid": "ac6bf348e40afcd2a787d2908ddd2785", "score": "0.56138754", "text": "function toggleMoreResultsButton(){\n\tif(currentResults.length < totalResults){\n\t\tmoreResultsButton.style.visibility = 'visible';\n\t}else{\n\t\tmoreResultsButton.style.visibility = 'hidden';\n\t}\n}", "title": "" }, { "docid": "81a7532f706eff897252b51ddf3fb4c3", "score": "0.56129706", "text": "setPageSize(size){this.pageSize=size}", "title": "" }, { "docid": "92ab282e984ecd47d91ae4c42b312467", "score": "0.56128", "text": "function footballUpdateNumberOfPagesNeeded() {\n footballFilteredProducts = document.getElementsByClassName(footballDropdownValue);\n footballFilteredProductsAmount = footballFilteredProducts.length;\n footballNumberOfPagesNeeded = Math.ceil(footballFilteredProductsAmount / 12);\n console.log(\"Number of pages needed: \" + footballNumberOfPagesNeeded);\n}", "title": "" }, { "docid": "4da249867c1126d10dbda671e7e9d9bc", "score": "0.5611872", "text": "function loadMoreChores(){\n\t\t\tvmChore.paginator += 5;\n\t\t\tgetChores();\n\t\t}", "title": "" }, { "docid": "587f15bd0ad65666b677b757c88c4426", "score": "0.56059957", "text": "function updateSearchResultsDom(resultAlbums) {\n mainTextEl.innerHTML = \"Search results...\";\n updateDomFromDicogs(resultAlbums, 50, recommendationsEl);\n}", "title": "" }, { "docid": "89d639199f624a2ab332e1cde5a7b966", "score": "0.56047845", "text": "startSearch(){\r\n this.getMovies();\r\n this.getTvs();\r\n }", "title": "" }, { "docid": "c6694def03e4ac12d76488b51f2c94ed", "score": "0.5600639", "text": "function search()\n{\n firsttime = 0;\n orginialArtist = [];\n recommendedArtists = [];\n recommended_sw = 0;\n getrecommendedArtists($('#query').val()); \n getoriginalArtist($('#query').val());\n $('#next').html('<button>' + 'Next' + '</button>');\n \n}", "title": "" }, { "docid": "c4846516022e2239bd091f69433fddcd", "score": "0.55987763", "text": "function displayResults(searchResults) {\n searchResults.forEach(function(searchResult) {\n addView(searchResult);\n });\n}", "title": "" }, { "docid": "71748db979e86fd57ae759d7d272bfcf", "score": "0.5598117", "text": "getResults (URI, append = false) {\n fetch(URI)\n .then(res => res.json())\n .then(data => {\n if (data.Response === 'False') {\n this.setState({\n fulfilled: false,\n status: data.Error,\n totalResults: 0\n })\n } else {\n const currResultCount = 10 * (this.state.currentPage + this.state.showMorePageIterator)\n let canShowMore\n if (currResultCount < data.totalResults) {\n canShowMore = true\n } else {\n canShowMore = false\n }\n\n // handle how results are based on appending param\n let newResults\n let newShowMorePageIterator\n if (append === true) { // concat this.state.results\n newResults = this.state.results.concat(data.Search)\n newShowMorePageIterator = this.state.showMorePageIterator\n } else {\n newResults = data.Search\n newShowMorePageIterator = 0\n }\n\n // update state from results\n this.setState({\n fulfilled: true,\n status: 'Showing Results',\n results: newResults,\n totalResults: data.totalResults,\n resultsURI: URI,\n canLoadMore: canShowMore,\n showMorePageIterator: newShowMorePageIterator\n })\n this.getTotalVisibleCount(newResults)\n }\n },\n (error) => {\n console.error(error)\n }\n )\n }", "title": "" }, { "docid": "a8b3d8a404640128a51cefa1ff434836", "score": "0.5597794", "text": "set pageSize(pageSize){this._pageSize=pageSize;}", "title": "" }, { "docid": "a8b3d8a404640128a51cefa1ff434836", "score": "0.5597794", "text": "set pageSize(pageSize){this._pageSize=pageSize;}", "title": "" } ]
5b8bef4f40754e4428048cf0a209120b
TODO Remove this when we no longer support the legacy definitions and only support a superset of a native property definition.
[ { "docid": "5c6029a72beeb7dd720960d4e297b9e6", "score": "0.0", "text": "function ensurePropertyFunctions(opts) {\n var properties = opts.properties;\n var names = Object.keys(properties || {});\n return names.reduce(function (descriptors, descriptorName) {\n descriptors[descriptorName] = opts.properties[descriptorName];\n if (typeof descriptors[descriptorName] !== 'function') {\n descriptors[descriptorName] = (0, _propertiesInit2.default)(descriptors[descriptorName]);\n }\n return descriptors;\n }, {});\n }", "title": "" } ]
[ { "docid": "f2be360200fa36528471d6374d5ffbdb", "score": "0.6741733", "text": "function property(options){// tslint:disable-next-line:no-any decorator\nreturn function(protoOrDescriptor,name){return name!==void 0?legacyProperty(options,protoOrDescriptor,name):standardProperty(options,protoOrDescriptor)}}", "title": "" }, { "docid": "982e8f94aba9323233deacdf98c677a1", "score": "0.6098124", "text": "static createProperty(name,options=defaultPropertyDeclaration){// Note, since this can be called by the `@property` decorator which\n// is called before `finalize`, we ensure storage exists for property\n// metadata.\nthis._ensureClassProperties();this._classProperties.set(name,options);// Do not generate an accessor if the prototype already has one, since\n// it would be lost otherwise and that would never be the user's intention;\n// Instead, we expect users to call `requestUpdate` themselves from\n// user-defined accessors. Note that if the super has an accessor we will\n// still overwrite it\nif(options.noAccessor||this.prototype.hasOwnProperty(name)){return}const key=\"symbol\"===typeof name?Symbol():`__${name}`;Object.defineProperty(this.prototype,name,{// tslint:disable-next-line:no-any no symbol in index\nget(){return this[key]},set(value){// tslint:disable-next-line:no-any no symbol in index\nconst oldValue=this[name];// tslint:disable-next-line:no-any no symbol in index\nthis[key]=value;this._requestUpdate(name,oldValue)},configurable:!0,enumerable:!0})}", "title": "" }, { "docid": "339fc7c9fb5db0c8dc62c0f16de32775", "score": "0.59725094", "text": "static get properties() {\n return {\n ...super.properties,\n };\n }", "title": "" }, { "docid": "339fc7c9fb5db0c8dc62c0f16de32775", "score": "0.59725094", "text": "static get properties() {\n return {\n ...super.properties,\n };\n }", "title": "" }, { "docid": "578a07247146199631b901be70821dc6", "score": "0.5949194", "text": "function property$m(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$m(options, protoOrDescriptor, name) :\n standardProperty$m(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "7f3907bfd09ca64aed389c8660f18239", "score": "0.5943559", "text": "upgradeProperties() {\n this.constructor.observedAttributes.forEach(prop => {\n // eslint-disable-next-line no-prototype-builtins\n if (this.hasOwnProperty(prop)) {\n let value = this[prop];\n if (value) {\n this[prop] = value;\n }\n }\n });\n }", "title": "" }, { "docid": "030db3d24499971621abd1c777475fdd", "score": "0.58875954", "text": "static createProperty(a,b=defaultPropertyDeclaration){// Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if(this._ensureClassProperties(),this._classProperties.set(a,b),b.noAccessor||this.prototype.hasOwnProperty(a))return;const c=\"symbol\"==typeof a?Symbol():`__${a}`;Object.defineProperty(this.prototype,a,{// tslint:disable-next-line:no-any no symbol in index\n get(){return this[c]},set(b){const d=this[a];this[c]=b,this._requestUpdate(a,d);},configurable:!0,enumerable:!0});}", "title": "" }, { "docid": "30f141ecdefbd75b831f2ff4d63d3b89", "score": "0.587646", "text": "_findProperty(prop) {\n for (let desc = this; desc; desc = desc.getSuperType()) {\n const val = desc._options.props.get(prop);\n if (val !== undefined) {\n return val;\n }\n }\n\n return undefined;\n }", "title": "" }, { "docid": "8693c2c5e8753657a50dfb767572cbc2", "score": "0.58673507", "text": "set propWithSubtypingGetterAndSetterReordered(x: number) { }", "title": "" }, { "docid": "b687b75da5a8e2d5f089c30f782a7d3c", "score": "0.58644915", "text": "static get properties(){let props={};if(super.properties){props=Object.assign(props,super.properties)}return props}", "title": "" }, { "docid": "afc49d3bfe70ad9de6a2438059429836", "score": "0.58191806", "text": "function property$1(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$1(options, protoOrDescriptor, name) :\n standardProperty$1(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "801edaea9beeee71b59b6ae779f72ef3", "score": "0.5811172", "text": "function property$h(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$h(options, protoOrDescriptor, name) :\n standardProperty$h(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "506a9599fbefacc9f1f1412f5eeba736", "score": "0.5776047", "text": "_getRegularProperties() {\n if (!this || !Ember.get(this, 'feature') || !Ember.get(this, 'feature.properties')) {\n return null;\n }\n\n return Ember.get(this, 'feature.properties');\n }", "title": "" }, { "docid": "c49ed8de93af8b98956c53ad912ea03b", "score": "0.57722837", "text": "function property$9(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$9(options, protoOrDescriptor, name) :\n standardProperty$9(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "b13b0db1098eec2870a3a6be8ddc54f1", "score": "0.5753836", "text": "function property(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty(options, protoOrDescriptor, name) :\n standardProperty(options, protoOrDescriptor);\n}", "title": "" }, { "docid": "b13b0db1098eec2870a3a6be8ddc54f1", "score": "0.5753836", "text": "function property(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty(options, protoOrDescriptor, name) :\n standardProperty(options, protoOrDescriptor);\n}", "title": "" }, { "docid": "982076bb902a1e29854f954b38e76532", "score": "0.57533", "text": "_upgradeProperty(prop) {\n if (this.hasOwnProperty(prop)) {\n let value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }", "title": "" }, { "docid": "6ff59b309f78aece999ee4220f898376", "score": "0.57461864", "text": "function property$8(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$8(options, protoOrDescriptor, name) :\n standardProperty$8(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "5aff62919706278f7d818e59b6834423", "score": "0.5733475", "text": "static __mutateProperty(constructor, propertyMap, key, property) {\n property.key = key;\n property.attribute = !property.internal && XElement.__serializableTypes.has(property.type)\n ? property.attribute ?? XElement.__camelToKebab(key)\n : undefined;\n property.input = new Set((property.input ?? []).map(inputKey => propertyMap.get(inputKey)));\n property.output = property.output ?? new Set();\n for (const input of property.input) {\n input.output = input.output ?? new Set();\n input.output.add(property);\n }\n XElement.__addPropertyInitial(constructor, property);\n XElement.__addPropertyDefault(constructor, property);\n XElement.__addPropertySync(constructor, property);\n XElement.__addPropertyCompute(constructor, property);\n XElement.__addPropertyReflect(constructor, property);\n XElement.__addPropertyObserve(constructor, property);\n }", "title": "" }, { "docid": "e0eb49686e1e844b7aaccc0ed948c477", "score": "0.57245904", "text": "get( target, prop, receiver ) {\n let hasProp = true, \n device = null, \n upper = prop[0].toUpperCase() + prop.slice( 1 ), // convert lowercase to camelcase\n useUpper = false\n\n // if the property is undefined...\n if( target[ prop ] === undefined && target[ upper ] === undefined && prop !== 'markup' && prop !== 'seq' && prop !== 'sequences' ) {\n //target[ prop ] = Max.namespace( prop, target )\n //target[ prop ].address = addr + ' ' + prop\n for( let __device of target.devices ) {\n if( typeof __device !== 'object' ) continue\n\n if( __device[ prop ] !== undefined ) {\n device = __device\n break\n }else if( __device[ upper ] !== undefined ) {\n device = __device\n useUpper = true\n break\n }\n }\n\n hasProp = false\n }\n\n\n let propName = useUpper ? upper : prop\n\n let property = null\n if( hasProp ) {\n property = target[ prop ]\n }else{\n if( device !== null ) {\n property = device[ propName ]\n }\n }\n\n return property \n }", "title": "" }, { "docid": "25f8704f67a7ff71896698c7e91d2e3a", "score": "0.5722271", "text": "function isSuperProperty(node){var kind=node.kind;return(kind===179/* PropertyAccessExpression */||kind===180/* ElementAccessExpression */)&&node.expression.kind===97/* SuperKeyword */;}", "title": "" }, { "docid": "26cced25808377b39d9ac9dae43f5d3b", "score": "0.5709923", "text": "defineProperties() {\n\t\tObject.keys(this.properties()).forEach((prop) => {\n\t\t\t// when mixing shadow dom elements with light dom elements and nesting custom elements\n\t\t\t// it might occur that properties where set on an element before it was\n\t\t\t// registered or connected. To avoid such timing issues we check\n\t\t\t// if a value was set for that specific property on the\n\t\t\t// prototype before assigning a default value\n\t\t\tconst value = this[prop] || this.properties()[prop];\n\t\t\tthis.defineProperty(prop, value);\n\t\t});\n\t}", "title": "" }, { "docid": "410a7d8b4497597d610d26e5b2eee25c", "score": "0.57028157", "text": "__defineNonEnumerable(property) {\n this[property.name] = property.descriptor.value;\n }", "title": "" }, { "docid": "c41f170419eee4531c8eacbe8f72d46a", "score": "0.5700806", "text": "function property$2(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$2(options, protoOrDescriptor, name) :\n standardProperty$2(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "de81d643c41788cf27a591c9e116e2a0", "score": "0.5694113", "text": "function defineKey(prop, subprops, prototype, prefix, keys, options) {\n Document = Document || __webpack_require__(10);\n const path = (prefix ? prefix + '.' : '') + prop;\n prefix = prefix || '';\n\n if (subprops) {\n Object.defineProperty(prototype, prop, {\n enumerable: true,\n configurable: true,\n get: function() {\n const _this = this;\n if (!this.$__.getters) {\n this.$__.getters = {};\n }\n\n if (!this.$__.getters[path]) {\n const nested = Object.create(Document.prototype, getOwnPropertyDescriptors(this));\n\n // save scope for nested getters/setters\n if (!prefix) {\n nested.$__.scope = this;\n }\n nested.$__.nestedPath = path;\n\n Object.defineProperty(nested, 'schema', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: prototype.schema\n });\n\n Object.defineProperty(nested, 'toObject', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: function() {\n return utils.clone(_this.get(path, null, {\n virtuals: get(this, 'schema.options.toObject.virtuals', null)\n }));\n }\n });\n\n Object.defineProperty(nested, 'toJSON', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: function() {\n return _this.get(path, null, {\n virtuals: get(_this, 'schema.options.toJSON.virtuals', null)\n });\n }\n });\n\n Object.defineProperty(nested, '$__isNested', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: true\n });\n\n const _isEmptyOptions = Object.freeze({\n minimize: true,\n virtuals: false,\n getters: false,\n transform: false\n });\n Object.defineProperty(nested, '$isEmpty', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: function() {\n return Object.keys(this.get(path, null, _isEmptyOptions) || {}).length === 0;\n }\n });\n\n compile(subprops, nested, path, options);\n this.$__.getters[path] = nested;\n }\n\n return this.$__.getters[path];\n },\n set: function(v) {\n if (v instanceof Document) {\n v = v.toObject({ transform: false });\n }\n const doc = this.$__.scope || this;\n return doc.$set(path, v);\n }\n });\n } else {\n Object.defineProperty(prototype, prop, {\n enumerable: true,\n configurable: true,\n get: function() {\n return this[getSymbol].call(this.$__.scope || this, path);\n },\n set: function(v) {\n return this.$set.call(this.$__.scope || this, path, v);\n }\n });\n }\n}", "title": "" }, { "docid": "e4168e79a874cf5f91968dd179a0cef5", "score": "0.5688", "text": "static get properties() {\n let props = {\n /**\n * Tthe margin styles to offset the pointer\n */\n \"__pointerOffSetStyle\": {\n \"type\": Object,\n \"computed\": \"_getMargins(__positions)\"\n }\n}\n;\n if (super.properties) {\n props = Object.assign(props, super.properties);\n }\n return props;\n }", "title": "" }, { "docid": "7434e3de7fc56546a2da7fb9cb76ed14", "score": "0.566869", "text": "function property$c(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$c(options, protoOrDescriptor, name) :\n standardProperty$c(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "e9a7ea55f56c7cf257e240ca3408a7f2", "score": "0.56500244", "text": "function property$n(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$n(options, protoOrDescriptor, name) :\n standardProperty$n(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "2e133c7c091571a7b88dfdf8afaed8f2", "score": "0.56486547", "text": "function normalizePropertyShorthand(meta) {\n // New objects created based on property shorthands.\n var subObjs = [];\n\n // Create a new blank object with empty property list.\n function getSubObject() {\n var obj = {\n id: 'subobj_' + (subObjCounter++),\n properties: [],\n auto_generated: true\n }\n subObjs.push(obj);\n return obj;\n }\n\n // Convert the built-in function property shorthand into an actual object.\n function decodeFunctionShorthand(funProp) {\n assert(funProp.value.type === 'function');\n let val = funProp.value;\n let obj = getSubObject();\n let props = obj.properties;\n Object.assign(obj, {\n native: val.native,\n nargs: propDefault(val, 'nargs', val.length),\n varargs: propDefault(val, 'varargs', false),\n magic: propDefault(val, 'magic', 0),\n internal_prototype: 'bi_function_prototype',\n class: 'Function',\n callable: propDefault(val, 'callable', true),\n constructable: propDefault(val, 'constructable', false),\n special_call: propDefault(val, 'special_call', false)\n });\n let funName = (typeof val.name !== 'undefined' ? val.name : funProp.key);\n props.push({ key: 'length', value: val.length, attributes: 'c' }); // Configurable in ES2015\n props.push({ key: 'name', value: funName, attributes: 'c' }); // Configurable in ES2015\n return obj;\n }\n\n // Create a new accessor function object.\n function createAccessor(funProp, magic, nargs, length, name, nativeFunc) {\n assert(funProp.value.type === 'accessor');\n let val = funProp.value;\n let obj = getSubObject();\n let props = obj.properties;\n Object.assign(obj, {\n native: nativeFunc,\n nargs: nargs,\n varargs: false,\n magic: magic,\n internal_prototype: 'bi_function_prototype',\n class: 'Function',\n callable: propDefault(val, 'callable', true),\n constructable: propDefault(val, 'constructable', false)\n });\n assert(propDefault(obj, 'special_call', false) === false);\n\n // Shorthand accessors are minimal and have no .length or .name\n // right now. Use longhand if these matter.\n //props.push({ key: 'length', value: length, attributes: 'c' });\n //props.push({ key: 'name', value: name, attributes: 'c' });\n void props;\n\n return obj;\n }\n\n // Decode getter shorthand and return the function object.\n function decodeGetterShorthand(key, funProp) {\n assert(funProp.value.type === 'accessor');\n let val = funProp.value;\n if (typeof val.getter === 'undefined') {\n return;\n }\n return createAccessor(funProp, val.getter_magic, val.getter_nargs, propDefault(val, 'getter_length', 0), key, val.getter);\n }\n\n // Decode setter shorthand and return the function object.\n function decodeSetterShorthand(key, funProp) {\n assert(funProp.value.type === 'accessor');\n let val = funProp.value;\n if (typeof val.setter === 'undefined') {\n return;\n }\n return createAccessor(funProp, val.setter_magic, val.setter_nargs, propDefault(val, 'setter_length', 0), key, val.setter);\n }\n\n // Decode a plain structured value (JSON-like value) into objects.\n function decodeStructuredValue(val) {\n if (typeof val === 'number') {\n return val;\n } else if (typeof val === 'string') {\n return val;\n } else if (typeof val === 'object' && val !== null && Array.isArray(val)) {\n let obj = decodeStructuredArray(val);\n return { type: 'object', id: obj.id };\n } else if (typeof val === 'object' && val !== null) {\n let obj = decodeStructuredObject(val);\n return { type: 'object', id: obj.id };\n } else {\n throw new TypeError('unsupported value in structured shorthand');\n }\n }\n\n function decodeStructuredObject(val) {\n // Original Python implementation could not preserve dict order\n // from YAML source, so sorted order was used to make the result\n // deterministic. Keep this behavior for now. User can always\n // use longhand for exact property control.\n\n let obj = getSubObject();\n Object.assign(obj, {\n class: 'Object',\n internal_prototype: 'bi_object_prototype'\n });\n\n let props = obj.properties;\n for (let k of Object.keys(val).sort()) {\n let prop = { key: k, value: decodeStructuredValue(val[k]), attributes: 'wec' };\n props.push(prop);\n }\n\n return obj;\n }\n\n function decodeStructuredArray(val) {\n let obj = getSubObject();\n Object.assign(obj, {\n class: 'Object',\n internal_prototype: 'bi_array_prototype'\n });\n\n void val;\n throw new TypeError('shorthand arrays not supported'); // XXX: add structured array support\n }\n\n // Decode structured JSON-like values into objects.\n function decodeStructuredShorthand(structProp) {\n assert(structProp.value.type === 'structured');\n return decodeStructuredValue(structProp.value.value);\n }\n\n // Create a new property based on an existing one, copying common keys\n // but omitting e.g. value.\n function clonePropShared(prop) {\n let res = jsonDeepClone(prop);\n return res;\n }\n\n // Walk objects and properties, normalizing shorthands.\n walkObjects(meta, (obj) => {\n let replProps = [];\n\n for (let prop of obj.properties) {\n if (prop.value === void 0) {\n replProps.push(prop);\n } else if (prop.value === null) {\n replProps.push(prop);\n } else if (typeof prop.value === 'boolean') {\n replProps.push(prop);\n } else if (typeof prop.value === 'number') {\n replProps.push(prop);\n } else if (typeof prop.value === 'object' && prop.value !== null && prop.value.type === 'function') {\n let subFun = decodeFunctionShorthand(prop);\n let newProp = clonePropShared(prop);\n newProp.value = { type: 'object', id: subFun['id'] };\n replProps.push(newProp);\n } else if (typeof prop.value === 'object' && prop.value !== null && prop.value.type === 'accessor' &&\n ('getter' in prop.value || 'setter' in prop.value)) {\n // Accessor normal and shorthand forms both use the type 'accessor',\n // but are differentiated by properties.\n let subGetter = decodeGetterShorthand(prop.key, prop);\n let subSetter = decodeSetterShorthand(prop.key, prop);\n let newProp = clonePropShared(prop);\n newProp.value = { 'type': 'accessor' };\n if (subGetter) {\n newProp.value.getter_id = subGetter['id'];\n }\n if (subSetter) {\n newProp.value.setter_id = subSetter['id'];\n }\n assert(newProp.attributes.indexOf('a') >= 0); // If missing, weird things happen runtime.\n replProps.push(newProp);\n } else if (typeof prop.value === 'object' && prop.value !== null && prop.value.type === 'structured') {\n let subVal = decodeStructuredShorthand(prop);\n let newProp = clonePropShared(prop);\n newProp.value = subVal;\n replProps.push(newProp);\n } else if (typeof prop.value === 'object' && prop.value !== null && prop.value.type === 'buffer') {\n throw new TypeError('buffer type not yet supported for builtins');\n } else if (typeof prop.value === 'object' && prop.value !== null && prop.value.type === 'pointer') {\n throw new TypeError('pointer type not yet supported for builtins');\n } else {\n // Assume already in normalized form.\n replProps.push(prop);\n }\n }\n\n obj.properties = replProps;\n });\n\n let lenBefore = meta.objects.length;\n meta.objects = meta.objects.concat(subObjs);\n let lenAfter = meta.objects.length;\n\n console.debug('normalized metadata shorthand, ' + lenBefore + ' -> ' + lenAfter + ' final objects');\n}", "title": "" }, { "docid": "13a9ce686a57e2778b36c93dce592d75", "score": "0.5640196", "text": "function isASTPropImpl(node) {\n var anyNode = node;\n return anyNode && anyNode.isString && anyNode.isFromKey && anyNode.isEmbedded;\n}", "title": "" }, { "docid": "7fae236d3e7979479e8a462df02f191f", "score": "0.56357956", "text": "get propWithSubtypingGetterAndSetter(): ?number { return 4; }", "title": "" }, { "docid": "2620319d44216f4937accee81dec7afd", "score": "0.5632741", "text": "function property$e(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$e(options, protoOrDescriptor, name) :\n standardProperty$e(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "cb05c32225f6e9988b74bc19bde106dc", "score": "0.56282735", "text": "function isNativeProperty(name) {\n var names = ['__proto__', 'hasOwnProperty'];\n return names.indexOf(name) >= 0;\n}", "title": "" }, { "docid": "5a73a599382197ddacd25eb912bfd6df", "score": "0.5626419", "text": "prop(path, packflag=0, setter_path=undefined) { \n packflag = this._inherit_packflag(packflag);\n \n if (this.path_prefix.length > 0)\n path = this.path_prefix + \".\" + path\n \n if (setter_path == undefined)\n setter_path = path;\n\n var ctx = this.ctx;\n var prop = ctx.api.get_prop_meta(ctx, path)\n \n if (prop == undefined) {\n console.trace();\n console.log(\"couldn't find property: \" + path + \".\", this.path_prefix);\n return;\n }\n \n //if (prop.type == PropTypes.ENUM) {\n // console.log(\" ==>\", prop.type, packflag, path, prop, packflag & 4096);\n //}\n \n if (prop.type == PropTypes.INT || prop.type == PropTypes.FLOAT) {\n var range = prop.range;\n if (prop.range == undefined || (prop.range[0] == 0 && prop.range[1] == 0)) {\n range = [-2000, 2000];\n }\n \n var c = new UINumBox(ctx, prop.uiname, range, prop.data, [0,0], [0,0], path);\n c.packflag = packflag;\n c.unit = prop.unit;\n c.setter_path = setter_path;\n \n this.add(c);\n } else if (prop.type == PropTypes.ENUM && (packflag & PackFlags.ENUM_STRIP)) {\n var checkmap = {};\n var this2 = this;\n prop.ctx = ctx;\n \n function update_enum(chk, val) {\n //only allow check sets\n if (!val) {\n chk.set = true;\n return;\n }\n \n for (var k in checkmap) {\n var check = checkmap[k];\n \n if (check === chk) {\n //prop.ctx = this2.ctx;\n //prop.set_value(k);\n //prop.set_data(prop.data);\n \n this2.ctx.api.set_prop(this2.ctx, path, prop.keys[k]);\n continue;\n }\n \n check.set = false;\n check.do_recalc();\n }\n \n var val = prop.values[k];\n }\n \n var subframe;\n if (this instanceof ColumnFrame) {\n subframe = this.col();\n } else {\n subframe = this.row();\n }\n \n subframe.packflag |= packflag|PackFlags.NO_AUTO_SPACING\n | PackFlags.NO_LEAD_SPACING\n | PackFlags.NO_TRAIL_SPACING;\n \n var large_icon = packflag & PackFlags.USE_LARGE_ICON;\n \n subframe.pad[0] = large_icon ? -4 : -2;\n subframe.pad[1] = large_icon ? -4 : -3;\n \n function update_callback(chk) {\n var val = undefined;\n \n for (var k in checkmap) {\n var check = checkmap[k];\n if (check === chk) {\n val = k;\n break;\n }\n }\n \n if (val == undefined) {\n console.log(\"error with ui enum strip; path:\", path); \n return; //XXX\n }\n \n val = ctx.api.get_prop(ctx, path) == prop.keys[val];\n if (!!val != !!chk.set) {\n chk.set = val;\n chk.do_recalc();\n }\n }\n \n if (packflag & PackFlags.USE_ICON) {\n for (var k in prop.values) {\n var label = prop.ui_value_names != undefined ? prop.ui_value_names[k] : k;\n if (label == undefined) label = \"(error)\";\n \n var c = new UIIconCheck(ctx, \"\", prop.iconmap[prop.values[k]]);\n \n c.packflag |= packflag;\n c._enum_colors = true;\n \n c.setter_path = setter_path;\n c.callback = update_enum\n c.icon = prop.iconmap[k];\n c.draw_check = false;\n c.update_callback = update_callback;\n \n c.description = label + \"\\n\" + prop.description;\n \n if (prop.get_value() == prop.values[k])\n c.set = true;\n \n subframe.add(c);\n checkmap[prop.values[k]] = c;\n }\n } else {\n for (var k in prop.values) {\n var label = prop.ui_value_names != undefined ? prop.ui_value_names[k] : k;\n if (label == undefined) label = \"(error)\";\n \n var c = new UICheckBox(ctx, label);\n \n c.setter_path = setter_path;\n c.callback = update_enum\n c.draw_check = false;\n c.update_callback = update_callback;\n \n if (prop.get_value() == prop.values[k])\n c.set = true;\n \n subframe.add(c);\n checkmap[prop.values[k]] = c;\n }\n }\n \n return subframe;\n } else if (prop.type == PropTypes.ENUM) {\n var c = new UIMenuButton(ctx, undefined, [0,0], [0,0], path);\n \n c.setter_path = setter_path;\n c.packflag |= packflag;\n \n this.add(c);\n return c;\n } else if ((prop.type == PropTypes.VEC3 && prop.subtype == PropTypes.COLOR3) || \n (prop.type == PropTypes.VEC4 && prop.subtype == PropTypes.COLOR4))\n {\n if (packflag & PackFlags.COLOR_BUTTON_ONLY) {\n var colorb = new UIColorButton(ctx, packflag|this.default_packflag);\n \n colorb.state |= UIFlags.USE_PATH;\n colorb.data_path = path;\n colorb.setter_path = setter_path;\n \n this.add(colorb, packflag);\n return colorb;\n } else {\n var field = new UIColorPicker(ctx, undefined, prop.subtype == PropTypes.COLOR3 ? 3 : 4);\n \n field.state |= UIFlags.USE_PATH;\n field.data_path = path;\n field.setter_path = setter_path;\n \n this.add(field, packflag);\n return field;\n }\n } else if (prop.type == PropTypes.VEC2) {\n range = (prop.range != undefined && prop.range[0] != undefined) ? prop.range : [-2000, 2000];\n \n var row = this.row();\n row.packflag = packflag;\n \n row.label(prop.uiname);\n var c = new UINumBox(ctx, \"X\", range, prop.data, [0,0], [0,0], path + \"[0]\");\n \n c.unit = prop.unit;\n c.setter_path = setter_path+\"[0]\";\n c.packflag |= packflag;\n row.add(c);\n \n var c = new UINumBox(ctx, \"Y\", range, prop.data, [0,0], [0,0], path + \"[1]\");\n \n c.unit = prop.unit;\n c.setter_path = setter_path+\"[1]\";\n c.packflag |= packflag;\n row.add(c);\n \n return row;\n } else if (prop.type == PropTypes.VEC3) {\n range = (prop.range != undefined && prop.range[0] != undefined) ? prop.range : [-2000, 2000];\n \n var row = this.row();\n row.packflag = packflag;\n \n row.label(prop.uiname);\n var c = new UINumBox(ctx, \"X\", range, prop.data, [0,0], [0,0], path + \"[0]\");\n \n c.unit = prop.unit;\n c.setter_path = setter_path+\"[0]\";\n c.packflag |= packflag;\n row.add(c);\n \n var c = new UINumBox(ctx, \"Y\", range, prop.data, [0,0], [0,0], path + \"[1]\");\n \n c.unit = prop.unit;\n c.setter_path = setter_path+\"[1]\";\n c.packflag |= packflag;\n row.add(c);\n \n var c = new UINumBox(ctx, \"Z\", range, prop.data, [0,0], [0,0], path + \"[2]\");\n\n c.unit = prop.unit;\n c.setter_path = setter_path+\"[2]\";\n c.packflag |= packflag;\n row.add(c); //\n \n return row;\n } else if (prop.type == PropTypes.VEC4) {\n range = (prop.range != undefined && prop.range[0] != undefined) ? prop.range : [-2000, 2000];\n \n var row = this.row();\n \n row.label(prop.uiname);\n var c = new UINumBox(ctx, \"X\", range, prop.data, [0,0], [0,0], path + \"[0]\");\n\n c.setter_path = setter_path+\"[0]\";\n c.packflag |= packflag;\n c.unit = prop.unit;\n row.add(c);\n\n var c = new UINumBox(ctx, \"Y\", range, prop.data, [0,0], [0,0], path + \"[1]\");\n\n c.setter_path = setter_path+\"[1]\";\n c.packflag |= packflag;\n c.unit = prop.unit;\n row.add(c);\n\n var c = new UINumBox(ctx, \"Z\", range, prop.data, [0,0], [0,0], path + \"[2]\");\n\n c.setter_path = setter_path+\"[2]\";\n c.packflag |= packflag;\n c.unit = prop.unit;\n row.add(c);\n\n var c = new UINumBox(ctx, \"W\", range, prop.data, [0,0], [0,0], path + \"[3]\");\n\n c.setter_path = setter_path+\"[3]\";\n c.packflag |= packflag;\n c.unit = prop.unit;\n row.add(c);\n \n return row;\n } else if (prop.type == PropTypes.STRING && (prop.flag & TPropFlags.LABEL)) {\n var ret = this.label(path, true, packflag);\n ret.setter_path = setter_path;\n \n return ret;\n } else if (prop.type == PropTypes.BOOL) {\n var check;\n \n if (packflag & PackFlags.USE_ICON) {\n check = new UIIconCheck(ctx, \"\", prop.icon, undefined, undefined, path);\n } else {\n check = new UICheckBox(ctx, prop.uiname, undefined, undefined, path);\n }\n \n check.setter_path = setter_path;\n check.packflag |= packflag;\n \n this.add(check);\n return check;\n } else if (prop.type == PropTypes.FLAG) {\n var row = this.row();\n row.packflag |= packflag;\n \n //one flag only\n if (path.trim().endsWith(\"]\")) {\n var s = path.trim();\n var i = s.length - 1;\n \n while (i >= 0 && s[i-1] != \"[\") {\n i--;\n }\n \n var key = s.slice(i, s.length-1).trim();\n \n var uiname = prop.ui_key_names[key];\n if (uiname == undefined) {\n console.log(\"WARNING: possibly bad flag mask (will try interpreting it as integer)\", path);\n \n key = parseInt(key);\n uiname = prop.ui_key_names[key];\n }\n \n if (isNaN(parseInt(key)) && key in prop.keys) {\n key = prop.keys[key];\n }\n \n if (uiname == undefined) \n uiname = \"(corrupted)\";\n \n var check = new UICheckBox(ctx, uiname, undefined, undefined, path);\n this.add(check);\n \n if (key in prop.flag_descriptions) {\n check.description = prop.flag_descriptions[key];\n }\n \n check.packflag |= PackFlags.INHERIT_WIDTH;\n check.setter_path = setter_path;\n \n return check;\n } else {\n row.label(prop.uiname + \":\");\n for (var k in prop.keys) {\n var uiname = prop.ui_key_names[k];\n \n var path2 = path + \"[\"+k+\"]\"\n var check = new UICheckBox(ctx, uiname, undefined, undefined, path2);\n \n check.packflag |= PackFlags.INHERIT_WIDTH;\n check.setter_path = setter_path + \"[\"+k+\"]\";\n \n if (k in prop.flag_descriptions) {\n check.description = prop.flag_descriptions[k];\n }\n \n row.add(check);\n }\n \n return check;\n }\n } else if (prop.type == PropTypes.DATAREF) {\n var c = new UIMenuButton(ctx, undefined, [0,0], [0,0], path);\n \n c.setter_path = setter_path;\n c.packflag |= packflag;\n \n this.add(c);\n return c;\n } else {\n if (1||DEBUG.ui_datapaths)\n console.log(\"warning: unimplemented property type for path \" + path + \" in user interface code\");\n }\n }", "title": "" }, { "docid": "bcad82d2ac0dda717a45ee84fd55a1ba", "score": "0.5625315", "text": "supports(property) {\n return typeof property === 'string';\n }", "title": "" }, { "docid": "a97c040052156eeb5726ee69305503ad", "score": "0.5624654", "text": "GetUserExtendedProperty(string, string) {\n\n }", "title": "" }, { "docid": "b9f5ed47628aff66520f3df8794d284d", "score": "0.56162566", "text": "function property$g(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$g(options, protoOrDescriptor, name) :\n standardProperty$g(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "ddba7a9274f270e707c36678c0d74418", "score": "0.5608705", "text": "function property(target, propertyKey, descriptor) {\n var options = null;\n\n function normalized(target, propertyKey, descriptor) {\n var cache = getClassCache(target.constructor);\n\n if (cache) {\n var ccclassProto = getSubDict(cache, 'proto');\n var properties = getSubDict(ccclassProto, 'properties');\n genProperty(target.constructor, properties, propertyKey, options, descriptor, cache);\n }\n }\n\n if (target === undefined) {\n // @property() => LegacyPropertyDecorator\n return property({\n type: undefined\n });\n } else if (typeof propertyKey === 'undefined') {\n // @property(options) => LegacyPropertyDescriptor\n // @property(type) => LegacyPropertyDescriptor\n options = target;\n return normalized;\n } else {\n // @property\n normalized(target, propertyKey, descriptor);\n }\n }", "title": "" }, { "docid": "020a9d0791647019de7c898f143717a2", "score": "0.55961144", "text": "expandProperty() {\n var relationModelMeta = this.get('relationModelMeta');\n var propertiesSuggestions = getPropertiesSuggestion(relationModelMeta);\n this.get('properties').pushObject({name: '', suggestions: propertiesSuggestions});\n }", "title": "" }, { "docid": "ee2c5de5e7967179477ddf5c59111ee3", "score": "0.55960923", "text": "function property$l(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$l(options, protoOrDescriptor, name) :\n standardProperty$l(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "564cad726a2a5857d348f9613a4a3219", "score": "0.5593511", "text": "function property$o(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$o(options, protoOrDescriptor, name) :\n standardProperty$o(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "23c6727cb71f890a8ee641d018083f00", "score": "0.5591616", "text": "get( target, prop, receiver ) {\n // if the property is undefined...\n if( target[ prop ] === undefined && prop !== 'markup' && prop !== 'seq' && prop !== 'sequences' && prop !== '__client' ) {\n target[ prop ] = Max.namespace( prop, target )\n target[ prop ].address = addr + ' ' + prop \n }\n\n return target[ prop ]\n }", "title": "" }, { "docid": "cf423c02150fa1f6332fbe22b6d19727", "score": "0.5589657", "text": "function propertyMapping() {\n return {\n Comments : {\n allowed : [ 'title', 'className', 'streamId', 'streamTitle', 'streamUrl' ],\n required : [ 'streamId', 'streamTitle' ],\n usesChildren : false\n },\n EmailSubscriptions : {\n allowed : [ 'title', 'className' ],\n required : [ ],\n usesChildren : false\n },\n Inquiry : {\n allowed : [ 'title', 'description', 'modelType', 'modelIdentifier', 'className', 'notify', 'successRedirect' ],\n required : [ 'modelType', 'modelIdentifier' ],\n usesChildren : false\n },\n GatedDownload : {\n allowed : [ 'title', 'description', 'fileUrl', 'webhookUrl', 'className', 'notify' ],\n required : [ 'fileUrl' ],\n usesChildren : false\n },\n LinkLogout : {\n allowed : [ 'tagName', 'wrappingTag', 'wrappingClass', 'className', 'label', 'prefix', 'suffix' ],\n required : [ ],\n usesChildren : false\n },\n ModalLink : {\n allowed : [ 'tagName', 'wrappingTag', 'wrappingClass', 'className', 'label', 'prefix', 'suffix', 'showLoggedIn', 'showLoggedOut' ],\n required : [ ],\n usesChildren : true\n },\n ModalLinkLogin : {\n allowed : [ 'tagName', 'wrappingTag', 'wrappingClass', 'className', 'label', 'prefix', 'suffix', 'title' ],\n required : [ ],\n usesChildren : false\n },\n ModalLinkRegister : {\n allowed : [ 'tagName', 'wrappingTag', 'wrappingClass', 'className', 'label', 'prefix', 'suffix', 'title' ],\n required : [ ],\n usesChildren : false\n },\n ParseQueryString : {\n allowed : [ 'className', 'query' ],\n required : [ ],\n usesChildren : false\n },\n };\n }", "title": "" }, { "docid": "faaa225c3240fcf1c26b8b30a40e8546", "score": "0.5586604", "text": "function testProperty(m, x, o, r) {\n /**\n * If m.length is > 0, then an additional type descriptor\n * for a property was specified. [0] because a property\n * can only be characterized by one type descriptor.\n */\n return {\n result: m.length ? r && m[0](o[x]).result : r,\n param: x,\n obj: o\n };\n }", "title": "" }, { "docid": "acbc1916fe4ea24f21a12a0a476fcd26", "score": "0.55798763", "text": "function property(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty(options, protoOrDescriptor, name) :\n standardProperty(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "4a572265d11d61a61bdc5dcbfa2fb7d7", "score": "0.5579662", "text": "function property$7(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$7(options, protoOrDescriptor, name) :\n standardProperty$7(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "4cbdadeebdf894995ec76b49f9aac376", "score": "0.55670255", "text": "get property() {\n\treturn this._property;\n }", "title": "" }, { "docid": "3f238c4b4c8200fd579a6859b9109769", "score": "0.5564799", "text": "old(prop, prefix) {\n let spec\n ;[spec, prefix] = flexSpec(prefix);\n if (spec === 2009) {\n return [prefix + 'box-orient', prefix + 'box-direction']\n } else {\n return super.old(prop, prefix)\n }\n }", "title": "" }, { "docid": "c3a07c6cf9d0c33f569ed02bcca14740", "score": "0.556095", "text": "function polyfillElementPrototypeProperties(virtualReference) {\n var polyfills = {\n isVirtual: true,\n attributes: virtualReference.attributes || {},\n contains: function contains() {},\n setAttribute: function setAttribute(key, value) {\n virtualReference.attributes[key] = value;\n },\n getAttribute: function getAttribute(key) {\n return virtualReference.attributes[key];\n },\n removeAttribute: function removeAttribute(key) {\n delete virtualReference.attributes[key];\n },\n hasAttribute: function hasAttribute(key) {\n return key in virtualReference.attributes;\n },\n addEventListener: function addEventListener() {},\n removeEventListener: function removeEventListener() {},\n classList: {\n classNames: {},\n add: function add(key) {\n virtualReference.classList.classNames[key] = true;\n },\n remove: function remove(key) {\n delete virtualReference.classList.classNames[key];\n },\n contains: function contains(key) {\n return key in virtualReference.classList.classNames;\n }\n }\n };\n\n for (var key in polyfills) {\n virtualReference[key] = polyfills[key];\n }\n}", "title": "" }, { "docid": "66a0ff5c87a956a457c47b285011111a", "score": "0.55502945", "text": "function property$j(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$j(options, protoOrDescriptor, name) :\n standardProperty$j(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "d3c74b70e30fbb0de80996278ee9ddfd", "score": "0.5547839", "text": "function defineKey(prop, subprops, prototype, prefix, keys, options) {\n Document = Document || __webpack_require__(8);\n var path = (prefix ? prefix + '.' : '') + prop;\n prefix = prefix || '';\n\n if (subprops) {\n Object.defineProperty(prototype, prop, {\n enumerable: true,\n configurable: true,\n get: function() {\n var _this = this;\n if (!this.$__.getters) {\n this.$__.getters = {};\n }\n\n if (!this.$__.getters[path]) {\n var nested = Object.create(Document.prototype, getOwnPropertyDescriptors(this));\n\n // save scope for nested getters/setters\n if (!prefix) {\n nested.$__.scope = this;\n }\n\n Object.defineProperty(nested, 'schema', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: prototype.schema\n });\n\n Object.defineProperty(nested, 'toObject', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: function() {\n return utils.clone(_this.get(path), { retainKeyOrder: true });\n }\n });\n\n Object.defineProperty(nested, 'toJSON', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: function() {\n return _this.get(path);\n }\n });\n\n Object.defineProperty(nested, '$__isNested', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: true\n });\n\n compile(subprops, nested, path, options);\n this.$__.getters[path] = nested;\n }\n\n return this.$__.getters[path];\n },\n set: function(v) {\n if (v instanceof Document) {\n v = v.toObject({ transform: false });\n }\n return (this.$__.scope || this).set(path, v);\n }\n });\n } else {\n Object.defineProperty(prototype, prop, {\n enumerable: true,\n configurable: true,\n get: function() {\n return this.get.call(this.$__.scope || this, path);\n },\n set: function(v) {\n return this.set.call(this.$__.scope || this, path, v);\n }\n });\n }\n}", "title": "" }, { "docid": "12432e584341391b0343b79e4099296d", "score": "0.55273217", "text": "function e_prop(e, prop) {\n var overridden = e.override && e.override.hasOwnProperty(prop);\n return overridden ? e.override[prop] : e[prop];\n }", "title": "" }, { "docid": "12432e584341391b0343b79e4099296d", "score": "0.55273217", "text": "function e_prop(e, prop) {\n var overridden = e.override && e.override.hasOwnProperty(prop);\n return overridden ? e.override[prop] : e[prop];\n }", "title": "" }, { "docid": "12432e584341391b0343b79e4099296d", "score": "0.55273217", "text": "function e_prop(e, prop) {\n var overridden = e.override && e.override.hasOwnProperty(prop);\n return overridden ? e.override[prop] : e[prop];\n }", "title": "" }, { "docid": "920ff7dc0d09a39b481304c304078de6", "score": "0.55261827", "text": "get needsProperties() { return !!(this._flags & this.NeedsPropertiesBit);}", "title": "" }, { "docid": "d8327d100fed0478fd3ead1fbd5a0872", "score": "0.5516968", "text": "normalize(prop) {\n return prop\n }", "title": "" }, { "docid": "01f3e29cf40e514cd35879e36e8a78ff", "score": "0.5514756", "text": "function property$k(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$k(options, protoOrDescriptor, name) :\n standardProperty$k(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "73d33d3e2ea27ffb9366ba9ea8ced76e", "score": "0.5511715", "text": "function definePropInterceptor(propName, currentInstance) {\r\n\t // On first set for this instance, move the prop's previous value, if any, to the private property\r\n\t var hasBeenSetProp = propName + \"➤pntr:hasBeenSet\";\r\n\t if (!currentInstance[hasBeenSetProp]) {\r\n\t currentInstance[(propName + \"➤pntr:baseValue\")] = currentInstance[propName];\r\n\t delete currentInstance[propName]; //remove own prop so it doesn't override the prototype getter/setter\r\n\t currentInstance[hasBeenSetProp] = true;\r\n\t }\r\n\r\n\t if (!PointerStatesAware.prototype.hasOwnProperty(propName)) {\r\n\t propsWithInterceptors[propName] = 1;\r\n\t var baseValueProp = propName + \"➤pntr:baseValue\";\r\n\t var appliedValueProp = propName + \"➤pntr:appliedValue\";\r\n\r\n\t Object.defineProperty(PointerStatesAware.prototype, propName, {\r\n\t get: function get() {\r\n\t var superGetter = getSuperGetter(propName);\r\n\t return superGetter ? superGetter.call(this) :\r\n\t (appliedValueProp in this) ? this[appliedValueProp] :\r\n\t this[baseValueProp]\r\n\t },\r\n\r\n\t set: function set(value) {\r\n\t this[baseValueProp] = value;\r\n\t }\r\n\t });\r\n\t }\r\n\t }", "title": "" }, { "docid": "e37a57b72c5565160fdc12d940bb1bd9", "score": "0.55075675", "text": "function defineScaledProperty(o, newprop, baseprop, scale) {\n Object.defineProperty(o, newprop, {\n get : function() { return o[baseprop] * scale; },\n set : function(v) { o[baseprop] = v / scale; }\n });\n}", "title": "" }, { "docid": "b607482ec7731b5073b887edaf5d7085", "score": "0.5503247", "text": "SetUserExtendedProperty(string, string, string) {\n\n }", "title": "" }, { "docid": "b9f8b5746bdd783e08b62b48501fd7d5", "score": "0.55011964", "text": "static GetPropertyDescription() {}", "title": "" }, { "docid": "4a9326e62efca7172a2bc93195551ecc", "score": "0.54971784", "text": "static get properties() {\n return {\n ...super.properties,\n\n /**\n * Symbol types to include\n */\n symbolTypes: {\n name: \"symbolTypes\",\n type: Array,\n },\n };\n }", "title": "" }, { "docid": "955916ec5808d9a080502fa46078cf07", "score": "0.5490475", "text": "function isSuperProperty(node) {\n var kind = node.kind;\n return (kind === 179 /* PropertyAccessExpression */ || kind === 180 /* ElementAccessExpression */)\n && node.expression.kind === 97 /* SuperKeyword */;\n }", "title": "" }, { "docid": "2526b04395758206624255c83c520223", "score": "0.54900897", "text": "function define (prop, subprops, prototype, prefix, keys) {\n var prefix = prefix || ''\n , path = (prefix ? prefix + '.' : '') + prop;\n\n if (subprops) {\n\n Object.defineProperty(prototype, prop, {\n enumerable: true\n , configurable: true\n , get: function () {\n if (!this.$__.getters)\n this.$__.getters = {};\n\n if (!this.$__.getters[path]) {\n var nested = Object.create(Object.getPrototypeOf(this), getOwnPropertyDescriptors(this));\n\n // save scope for nested getters/setters\n if (!prefix) nested.$__.scope = this;\n\n // shadow inherited getters from sub-objects so\n // thing.nested.nested.nested... doesn't occur (gh-366)\n var i = 0\n , len = keys.length;\n\n for (; i < len; ++i) {\n // over-write the parents getter without triggering it\n Object.defineProperty(nested, keys[i], {\n enumerable: false // It doesn't show up.\n , writable: true // We can set it later.\n , configurable: true // We can Object.defineProperty again.\n , value: undefined // It shadows its parent.\n });\n }\n\n nested.toObject = function () {\n return this.get(path);\n };\n\n compile(subprops, nested, path);\n this.$__.getters[path] = nested;\n }\n\n return this.$__.getters[path];\n }\n , set: function (v) {\n if (v instanceof Document) v = v.toObject();\n return (this.$__.scope || this).set(path, v);\n }\n });\n\n } else {\n Object.defineProperty(prototype, prop, {\n enumerable: true\n , configurable: true\n , get: function ( ) { return this.get.call(this.$__.scope || this, path); }\n , set: function (v) { return this.set.call(this.$__.scope || this, path, v); }\n });\n }\n}", "title": "" }, { "docid": "9a8cd9d6886a7a014fb0041ba3f4a515", "score": "0.5486792", "text": "function property$f(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$f(options, protoOrDescriptor, name) :\n standardProperty$f(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "9dba16d3943297598cc3f1e70d54da9d", "score": "0.54852146", "text": "static createProperty(name, options = defaultPropertyDeclaration) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n // tslint:disable-next-line:no-any no symbol in index\n const oldValue = this[name];\n // tslint:disable-next-line:no-any no symbol in index\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "ec8b801d99f1507538f698052f7aa177", "score": "0.54789525", "text": "function molded(slotNames) {\n var Property = /** @class */ (function (_super) {\n __extends(Property, _super);\n function Property() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.gendName = null;\n _this.errors = [];\n _this.inputError = null;\n return _this;\n }\n Object.defineProperty(Property.prototype, \"moldRender\", {\n get: function () { return this.moldProp('render') || (function (x) { return x; }); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Property.prototype, \"moldInput\", {\n get: function () { return this.moldProp('input') || (function (x) { return x; }); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Property.prototype, \"moldOutput\", {\n get: function () { return this.moldProp('output') || (function (x) { return x; }); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Property.prototype, \"path\", {\n get: function () {\n var rv = js_object_ext_1.pathed(this.prop);\n console.assert(!!rv, 'Property path is defined');\n return rv.join('.');\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Property.prototype, \"name\", {\n get: function () {\n return this.prop || this.gendName || (this.gendName = genFieldName());\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Property.prototype, \"errorPath\", {\n get: function () {\n return this.path ? '.' + this.path : this.name;\n },\n enumerable: true,\n configurable: true\n });\n Property.prototype.errorsChanged = function (scope) {\n var _a;\n //validate & errors\n var errors;\n errors = scope.errScope.field;\n scope.errors.splice(0);\n for (var i = 0; i < errors.length;)\n if (this.errorPath == errors[i].dataPath)\n (_a = scope.errors).push.apply(_a, errors.splice(i, 1));\n else\n ++i;\n };\n Property.prototype.buildScope = function (model) {\n var _this = this;\n var scope = scope_1.propertyScope(this, model, this.modeled.scope(model));\n scope.unwatch = this.$watch(function () { return scope.errScope.total; }, function (errs) { return _this.errorsChanged(scope); }, { deep: true, immediate: true });\n return scope;\n };\n Property.prototype.destroyScope = function (scope) {\n scope.unwatch();\n };\n Object.defineProperty(Property.prototype, \"molds\", {\n get: function () {\n var _this = this;\n return this.modeled.molds.filter(function (mold) {\n return !mold.select ||\n ('function' === typeof mold.select && mold.select(_this)) ||\n mold.select === _this.type;\n });\n },\n enumerable: true,\n configurable: true\n });\n //@Watch('molds') moldsChanged() { this.$forceUpdate(); }\n Property.prototype.moldProp = function (name) {\n if (this[name])\n return this[name];\n for (var _i = 0, _a = this.molds; _i < _a.length; _i++) {\n var mold = _a[_i];\n if (mold[name])\n return mold[name];\n }\n };\n Property.prototype.initSlot = function (name) {\n var _this = this;\n var scoped = function (slot) { return (function (params) {\n var org = Object.create(_this.scope(params.model));\n if (Object === params.constructor)\n for (var i in params)\n if ('model' !== i)\n org[i] = params[i];\n return slot(org) || [];\n }); }; //we keep [] for empty vnodes\n var vnodeGiven = this.$options._parentVnode.data.scopedSlots;\n vnodeGiven = vnodeGiven && vnodeGiven[name];\n if (vnodeGiven)\n return scoped(vnodeGiven);\n for (var _i = 0, _a = this.molds; _i < _a.length; _i++) {\n var mold = _a[_i];\n var slot = mold.$scopedSlots[name];\n if (slot)\n //return this.$slots[name] = slot(this.scope(this.modeled.model))||[];\n return scoped(slot);\n }\n };\n Property.prototype.initSlots = function () {\n if (this.modeled) {\n var ss = {};\n for (var _i = 0, slotNames_1 = slotNames; _i < slotNames_1.length; _i++) {\n var name_1 = slotNames_1[_i];\n var thisSs = this.initSlot(name_1);\n if (thisSs)\n ss[name_1] = thisSs;\n }\n var data = this.$options._parentVnode.data;\n // $scopedSlots is defaulted [in Vue] to `emptyObject` that is a frozen empty object\n if (Object.isFrozen(this.$scopedSlots))\n this.$scopedSlots = {};\n data.scopedSlots = Object.assign(this.$scopedSlots, data.scopedSlots, ss);\n }\n };\n Object.defineProperty(Property.prototype, \"schema\", {\n get: function () {\n if (!this.modeled.schema)\n return {}; //this will be cached and can be modified outside\n var path = this.path.split('.'), rv = this.modeled.schema, prop;\n while (prop = path.shift()) {\n if ('object' === rv.type)\n rv = rv.properties[prop];\n else if ('array' === rv.type)\n rv = rv.items;\n else {\n console.error(\"Error reading schema, \" + prop + \" is expected to be \" + rv.type);\n }\n }\n return rv;\n },\n enumerable: true,\n configurable: true\n });\n __decorate([\n vue_property_decorator_1.Inject(),\n __metadata(\"design:type\", Object)\n ], Property.prototype, \"modeled\", void 0);\n __decorate([\n vue_property_decorator_1.Inject(),\n __metadata(\"design:type\", Object)\n ], Property.prototype, \"group\", void 0);\n __decorate([\n vue_property_decorator_1.Prop(),\n __metadata(\"design:type\", String)\n ], Property.prototype, \"prop\", void 0);\n __decorate([\n vue_property_decorator_1.Prop({ default: null }),\n __metadata(\"design:type\", String)\n ], Property.prototype, \"info\", void 0);\n __decorate([\n vue_property_decorator_1.Prop(),\n __metadata(\"design:type\", String)\n ], Property.prototype, \"type\", void 0);\n __decorate([\n vue_property_decorator_1.Prop({ type: Function }),\n __metadata(\"design:type\", Function)\n ], Property.prototype, \"render\", void 0);\n __decorate([\n vue_property_decorator_1.Prop({ type: Function }),\n __metadata(\"design:type\", Object)\n ], Property.prototype, \"input\", void 0);\n __decorate([\n vue_property_decorator_1.Prop({ type: Function }),\n __metadata(\"design:type\", Object)\n ], Property.prototype, \"output\", void 0);\n Property = __decorate([\n vue_property_decorator_1.Component({\n mixins: [render_1.renderWrap('initSlots'), scope_1.modelScoped.extendOptions]\n })\n ], Property);\n return Property;\n }(vue_1.default));\n return Property.extendOptions;\n}", "title": "" }, { "docid": "f3b9288f130b2c030e7d192e275288f7", "score": "0.54774356", "text": "function appendProperty(formattedSchema, property, _level) {\n let level = _level;\n const propertyKey = property[0];\n const propertyValue = property[1];\n\n //don't append deprecated or \"hidden\" properties\n if (propertyValue.meta && (propertyValue.meta.deprecated || propertyValue.meta.hidden)) {\n return;\n }\n\n //append passed-in property\n formattedSchema.push({\n //The ` backticks are for markdown highlighting, and #### is to apply anchor linking only on top-level properties\n name: level ? `\\`${propertyKey}\\`` : `#### \\`${propertyKey}\\``,\n type: propertyValue.enum ? 'enum' : propertyValue.type,\n description: createDescription(property),\n level: level,\n });\n\n //increase nesting level for sub-properties\n level++;\n\n //recursively apply appending logic for each sub-property (if any) -> Note: sub-props are sometimes nested within \"items\"\n if (propertyValue.properties) {\n Object.entries(propertyValue.properties).forEach(subproperty => {\n appendProperty(formattedSchema, subproperty, level);\n });\n } else if (propertyValue.items && propertyValue.items.properties) {\n Object.entries(propertyValue.items.properties).forEach(subproperty => {\n appendProperty(formattedSchema, subproperty, level);\n });\n }\n}", "title": "" }, { "docid": "fa1da0aad1bef6349dcccc64f2b293ba", "score": "0.54746157", "text": "function property$6(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$6(options, protoOrDescriptor, name) :\n standardProperty$6(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "46ba09fa7049812cb3c1e4d98f62200e", "score": "0.5470885", "text": "function defineKey(prop, subprops, prototype, prefix, keys, options) {\n\t var path = (prefix ? prefix + '.' : '') + prop;\n\t prefix = prefix || '';\n\n\t if (subprops) {\n\t Object.defineProperty(prototype, prop, {\n\t enumerable: true,\n\t configurable: true,\n\t get: function() {\n\t var _this = this;\n\t if (!this.$__.getters) {\n\t this.$__.getters = {};\n\t }\n\n\t if (!this.$__.getters[path]) {\n\t var nested = Object.create(Object.getPrototypeOf(this), getOwnPropertyDescriptors(this));\n\n\t // save scope for nested getters/setters\n\t if (!prefix) {\n\t nested.$__.scope = this;\n\t }\n\n\t // shadow inherited getters from sub-objects so\n\t // thing.nested.nested.nested... doesn't occur (gh-366)\n\t var i = 0,\n\t len = keys.length;\n\n\t for (; i < len; ++i) {\n\t // over-write the parents getter without triggering it\n\t Object.defineProperty(nested, keys[i], {\n\t enumerable: false, // It doesn't show up.\n\t writable: true, // We can set it later.\n\t configurable: true, // We can Object.defineProperty again.\n\t value: undefined // It shadows its parent.\n\t });\n\t }\n\n\t Object.defineProperty(nested, 'toObject', {\n\t enumerable: true,\n\t configurable: true,\n\t writable: false,\n\t value: function() {\n\t return _this.get(path);\n\t }\n\t });\n\n\t Object.defineProperty(nested, 'toJSON', {\n\t enumerable: true,\n\t configurable: true,\n\t writable: false,\n\t value: function() {\n\t return _this.get(path);\n\t }\n\t });\n\n\t Object.defineProperty(nested, '$__isNested', {\n\t enumerable: true,\n\t configurable: true,\n\t writable: false,\n\t value: true\n\t });\n\n\t compile(subprops, nested, path, options);\n\t this.$__.getters[path] = nested;\n\t }\n\n\t return this.$__.getters[path];\n\t },\n\t set: function(v) {\n\t if (v instanceof Document) {\n\t v = v.toObject();\n\t }\n\t return (this.$__.scope || this).set(path, v);\n\t }\n\t });\n\t } else {\n\t Object.defineProperty(prototype, prop, {\n\t enumerable: true,\n\t configurable: true,\n\t get: function() {\n\t return this.get.call(this.$__.scope || this, path);\n\t },\n\t set: function(v) {\n\t return this.set.call(this.$__.scope || this, path, v);\n\t }\n\t });\n\t }\n\t}", "title": "" }, { "docid": "6348b0837c07e89eb4e7be2f2b8c4a99", "score": "0.5468266", "text": "static get properties() { return {\n publicProperty: { type: Number },\n _privateProperty: { type: String } /* note the leading underscore */\n }}", "title": "" }, { "docid": "9bcb66bd5b6ac599366dbd0bbf9c5900", "score": "0.546323", "text": "function genPropertyShortcut(mtype, overwrite) {\n\t\t\tvar shortcutName = \"$\" + def.name;\n\t\t\tif (!(shortcutName in mtype._jstype) || overwrite) {\n\t\t\t\tmtype._jstype[shortcutName] = prop;\n\t\t\t}\n\n\t\t\tmtype.derivedTypes.forEach(function (t) {\n\t\t\t\tgenPropertyShortcut(t, false);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "9c43ae966de7901429d80db53d69375c", "score": "0.5460991", "text": "function defineKey(prop, subprops, prototype, prefix, keys, options) {\n var path = (prefix ? prefix + '.' : '') + prop;\n prefix = prefix || '';\n\n if (subprops) {\n\n Object.defineProperty(prototype, prop, {\n enumerable: true\n , configurable: true\n , get: function() {\n var _self = this;\n if (!this.$__.getters)\n this.$__.getters = {};\n\n if (!this.$__.getters[path]) {\n var nested = Object.create(Object.getPrototypeOf(this), getOwnPropertyDescriptors(this));\n\n // save scope for nested getters/setters\n if (!prefix) nested.$__.scope = this;\n\n // shadow inherited getters from sub-objects so\n // thing.nested.nested.nested... doesn't occur (gh-366)\n var i = 0\n , len = keys.length;\n\n for (; i < len; ++i) {\n // over-write the parents getter without triggering it\n Object.defineProperty(nested, keys[i], {\n enumerable: false // It doesn't show up.\n , writable: true // We can set it later.\n , configurable: true // We can Object.defineProperty again.\n , value: undefined // It shadows its parent.\n });\n }\n\n nested.toObject = function() {\n return _self.get(path);\n };\n\n nested.toJSON = nested.toObject;\n\n nested.$__isNested = true;\n\n compile(subprops, nested, path, options);\n this.$__.getters[path] = nested;\n }\n\n return this.$__.getters[path];\n }\n , set: function(v) {\n if (v instanceof Document) v = v.toObject();\n return (this.$__.scope || this).set(path, v);\n }\n });\n\n } else {\n Object.defineProperty(prototype, prop, {\n enumerable: true\n , configurable: true\n , get: function( ) { return this.get.call(this.$__.scope || this, path); }\n , set: function(v) { return this.set.call(this.$__.scope || this, path, v); }\n });\n }\n}", "title": "" }, { "docid": "a92354ba56d3374d46ee1743253ae2cb", "score": "0.5458147", "text": "static get properties(){return{}}", "title": "" }, { "docid": "a92354ba56d3374d46ee1743253ae2cb", "score": "0.5458147", "text": "static get properties(){return{}}", "title": "" }, { "docid": "a92354ba56d3374d46ee1743253ae2cb", "score": "0.5458147", "text": "static get properties(){return{}}", "title": "" }, { "docid": "fc20ceeefab17135434e53c2e1eb34c7", "score": "0.5450586", "text": "_overrideProp(prop, val) {\n this[prop] = val;\n }", "title": "" }, { "docid": "13c18fe840b1c660b3142e606063cf14", "score": "0.5444671", "text": "static createProperty(name, options = defaultPropertyDeclaration) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "fa4d225b32fce0c18fda5d8555e11e7e", "score": "0.5440726", "text": "get props() {\n\t\treturn { x: 'initial' };\n\t}", "title": "" }, { "docid": "a782bf56a8535674f43e97c579467d33", "score": "0.5434796", "text": "function buildPropertiesForEvent(property) {\n const name = property.key.name;\n const optional = property.optional || false;\n let typeAnnotation = property.typeAnnotation.typeAnnotation;\n return getPropertyType(name, optional, typeAnnotation);\n}", "title": "" }, { "docid": "9320a57d8beb970c2605e99fb20e90f0", "score": "0.54246527", "text": "static createProperty(name, options = defaultPropertyDeclaration) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "bc3279a4586800c055d9a81f3432279d", "score": "0.5417611", "text": "function isSuperProperty(node) {\n var kind = node.kind;\n return (kind === 205 /* PropertyAccessExpression */ || kind === 206 /* ElementAccessExpression */)\n && node.expression.kind === 106 /* SuperKeyword */;\n }", "title": "" }, { "docid": "bfe26c4de8b4a6107e9db26d8204b6a0", "score": "0.5416739", "text": "function property$a(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$a(options, protoOrDescriptor, name) :\n standardProperty$a(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "315f4b077e98958757cf0875fba2a99c", "score": "0.541228", "text": "static createProperty(name, options = defaultPropertyDeclaration$l) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "dc2c68113a353b3744cf868615e18231", "score": "0.54111165", "text": "function defineKey(prop, subprops, prototype, prefix, keys, options) {\r\n var path = (prefix ? prefix + '.' : '') + prop;\r\n prefix = prefix || '';\r\n\r\n if (subprops) {\r\n Object.defineProperty(prototype, prop, {\r\n enumerable: true,\r\n configurable: true,\r\n get: function() {\r\n var _this = this;\r\n if (!this.$__.getters) {\r\n this.$__.getters = {};\r\n }\r\n\r\n if (!this.$__.getters[path]) {\r\n var nested = Object.create(Object.getPrototypeOf(this), getOwnPropertyDescriptors(this));\r\n\r\n // save scope for nested getters/setters\r\n if (!prefix) {\r\n nested.$__.scope = this;\r\n }\r\n\r\n // shadow inherited getters from sub-objects so\r\n // thing.nested.nested.nested... doesn't occur (gh-366)\r\n var i = 0,\r\n len = keys.length;\r\n\r\n for (; i < len; ++i) {\r\n // over-write the parents getter without triggering it\r\n Object.defineProperty(nested, keys[i], {\r\n enumerable: false, // It doesn't show up.\r\n writable: true, // We can set it later.\r\n configurable: true, // We can Object.defineProperty again.\r\n value: undefined // It shadows its parent.\r\n });\r\n }\r\n\r\n Object.defineProperty(nested, 'toObject', {\r\n enumerable: false,\r\n configurable: true,\r\n writable: false,\r\n value: function() {\r\n return clone(_this.get(path), { retainKeyOrder: true });\r\n }\r\n });\r\n\r\n Object.defineProperty(nested, 'toJSON', {\r\n enumerable: false,\r\n configurable: true,\r\n writable: false,\r\n value: function() {\r\n return _this.get(path);\r\n }\r\n });\r\n\r\n Object.defineProperty(nested, '$__isNested', {\r\n enumerable: false,\r\n configurable: true,\r\n writable: false,\r\n value: true\r\n });\r\n\r\n compile(subprops, nested, path, options);\r\n this.$__.getters[path] = nested;\r\n }\r\n\r\n return this.$__.getters[path];\r\n },\r\n set: function(v) {\r\n if (v instanceof Document) {\r\n v = v.toObject({ transform: false });\r\n }\r\n return (this.$__.scope || this).set(path, v);\r\n }\r\n });\r\n } else {\r\n Object.defineProperty(prototype, prop, {\r\n enumerable: true,\r\n configurable: true,\r\n get: function() {\r\n return this.get.call(this.$__.scope || this, path);\r\n },\r\n set: function(v) {\r\n return this.set.call(this.$__.scope || this, path, v);\r\n }\r\n });\r\n }\r\n}", "title": "" }, { "docid": "9b4e08dc7a8c0f1564e564c729c820a1", "score": "0.5410579", "text": "static get properties() {\n return {\n ...super.properties,\n ...SimpleIconPicker.properties,\n };\n }", "title": "" }, { "docid": "d7ab7e2ec3a3c071988654185a4a64bc", "score": "0.54103607", "text": "static __createProperties(host) {\n const { propertyMap, propertiesTarget } = XElement.__constructors.get(host.constructor);\n // Everything but \"get\", \"set\", \"has\", and \"ownKeys\" are considered invalid.\n const invalid = () => { throw new Error('Invalid use of properties proxy.'); };\n const get = (target, key) => {\n if (propertyMap.has(key)) {\n return XElement.__getPropertyValue(host, propertyMap.get(key));\n } else {\n const path = `${host.constructor.name}.properties.${key}`;\n throw new Error(`Property \"${path}\" does not exist.`);\n }\n };\n const set = (target, key) => {\n const path = `${host.constructor.name}.properties.${key}`;\n if (propertyMap.has(key)) {\n throw new Error(`Cannot set \"${path}\" via \"properties\".`);\n } else {\n throw new Error(`Property \"${path}\" does not exist.`);\n }\n };\n const has = (target, key) => propertyMap.has(key);\n const ownKeys = () => [...propertyMap.keys()];\n const handler = {\n defineProperty: invalid, deleteProperty: invalid, get,\n getOwnPropertyDescriptor: invalid, getPrototypeOf: invalid, has,\n isExtensible: invalid, ownKeys, preventExtensions: invalid, set,\n setPrototypeOf: invalid,\n };\n return new Proxy(propertiesTarget, handler);\n }", "title": "" }, { "docid": "91c55d6d1a4eae01433cc38789ab52c6", "score": "0.54090595", "text": "get allProperties() {\n return _telemetry_js__WEBPACK_IMPORTED_MODULE_11__[\"tag\"].configure(this.clone(_sharepointqueryable_js__WEBPACK_IMPORTED_MODULE_3__[\"SharePointQueryableInstance\"], \"allproperties\"), \"w.allprops\");\n }", "title": "" }, { "docid": "89df188b9b7417cff1af80717bfbcfa1", "score": "0.5401885", "text": "function property$4(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty$4(options, protoOrDescriptor, name) :\n standardProperty$4(options, protoOrDescriptor);\n }", "title": "" }, { "docid": "4bb7111c9de23078534675d43ed2e3ee", "score": "0.53957176", "text": "function DefinePropertyItem(){\n // default constructor: call super.constructor\n return ASTBase.prototype.constructor.apply(this,arguments)\n }", "title": "" }, { "docid": "f93c1da5fb5f60806ff3eb1a4a6d23b2", "score": "0.5394256", "text": "function processSingleProp(_p0) {\n // console.log('processSingleProp')\n let pp = null\n\n if (_p0 != undefined) {\n // console.log('_p0', _p0)\n\n let _p1 = null;\n if (Array.isArray(_p0)) {\n _p1 = _p0[0]\n }\n else {\n _p1 = _p0\n };\n // console.log('_p1', _p1)\n\n let _p2 = null;\n if (_p1['@value']) {\n _p2 = _p1['@value']\n }\n else {\n _p2 = _p1\n };\n // console.log('_p2', _p2)\n\n pp = _p2;\n // console.log('pp', pp)\n }\n\n return pp\n }", "title": "" }, { "docid": "f877622822e6bdb9b68510c1a354c2f8", "score": "0.5393485", "text": "getProperty(obj, name) {\n if (typeof (name)) {\n name = name.toString();\n }\n if (obj === this.UNDEFINED || obj === this.NULL) {\n this.throwException(this.TYPE_ERROR, \"Cannot read property '\" + name + \"' of \" + obj);\n }\n // Special cases for magic length property.\n if (this.isa(obj, this.STRING)) {\n if (name === 'length') {\n return this.createPrimitive(obj.data.length);\n }\n let n = this.arrayIndex(name);\n if (!isNaN(n) && n < obj.data.length) {\n return this.createPrimitive(obj.data[n]);\n }\n } else if (this.isa(obj, this.ARRAY) && name === 'length') {\n return this.createPrimitive(obj.length);\n }\n while (true) {\n if (obj.properties && name in obj.properties) {\n let prop = obj.properties[name];\n if (prop.dynamic) {\n return prop.dynamic.apply(obj);\n }\n let getter = obj.getter[name];\n if (getter) {\n getter.isGetter = true;\n return getter;\n }\n return prop;\n }\n if (obj.parent && obj.parent.properties && obj.parent.properties.prototype) {\n obj = obj.parent.properties.prototype;\n } else {\n // No parent, reached the top.\n break;\n }\n }\n return this.UNDEFINED;\n }", "title": "" }, { "docid": "c8b09c8126d63f98838ff6d3f4a390a4", "score": "0.53928065", "text": "static createProperty(name, options = defaultPropertyDeclaration$k) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "342a91d8ac61bd6427ee6c72f81aa737", "score": "0.5392429", "text": "setupStyleProperties(){\n this.partProperties._properties.forEach((prop) => {\n if(prop.constructor.name === \"StyleProperty\"){\n // setting the value on itself ensures that the cssStyle\n // BasicProperty is updated with the appropriate styler\n // conversion css key-val\n prop.setValue(this, prop._value);\n }\n });\n }", "title": "" }, { "docid": "58ade0198c48c4e4eddc90fa204f14e1", "score": "0.5392142", "text": "static createProperty(name, options = defaultPropertyDeclaration$e) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "f386c8e74bf93b55fd1fc6e19226a473", "score": "0.5389317", "text": "_upgradeProperties(props) {\n props.forEach(prop => {\n if (this.hasOwnProperty(prop)) {\n let value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n });\n }", "title": "" }, { "docid": "4d5f2af37f2eccc0d60cc9689e948298", "score": "0.53891677", "text": "static createProperty(name, options = defaultPropertyDeclaration$a) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "9976ca79b4c164d826c2a9d24aecde32", "score": "0.5388154", "text": "function getPropertyType( parentObject, childObject )\r\n{\r\n return typeof Object.getOwnPropertyDescriptor( parentObject, childObject.toString() ).value;\r\n}", "title": "" }, { "docid": "07e0f0a136f92fba1bf1526f58235a23", "score": "0.5386965", "text": "static createProperty(name, options = defaultPropertyDeclaration$g) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "f146b7272c47802d721ceb5a857a4c0b", "score": "0.5386322", "text": "static createProperty(name, options = defaultPropertyDeclaration$f) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "title": "" }, { "docid": "7b677f74a2d8e2d443d33078af2b7380", "score": "0.5383688", "text": "function c(t) {\n var e = t.prop,\n c = t.subprops,\n l = t.prototype,\n d = t.prefix,\n p = t.options;\n i = i || r(14);\n var m = (d ? d + \".\" : \"\") + e;\n d = d || \"\", c ? Object.defineProperty(l, e, {\n enumerable: !0,\n configurable: !0,\n get: function get() {\n var t,\n e,\n r = this;\n\n if (this.$__.getters || (this.$__.getters = {}), !this.$__.getters[m]) {\n var s = Object.create(i.prototype, (t = this, e = {}, Object.getOwnPropertyNames(t).forEach(function (r) {\n -1 === [\"isNew\", \"$__\", \"$errors\", \"errors\", \"_doc\", \"$locals\", \"$op\", \"__parentArray\", \"__index\", \"$isDocumentArrayElement\"].indexOf(r) || (e[r] = Object.getOwnPropertyDescriptor(t, r), e[r].enumerable = !1);\n }), e));\n d || (s.$__[h] = this), s.$__.nestedPath = m, Object.defineProperty(s, \"schema\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: l.schema\n }), Object.defineProperty(s, \"$__schema\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: l.schema\n }), Object.defineProperty(s, n, {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: l.schema\n }), Object.defineProperty(s, \"toObject\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: function value() {\n return a.clone(r.get(m, null, {\n virtuals: o(this, \"schema.options.toObject.virtuals\", null)\n }));\n }\n }), Object.defineProperty(s, \"$__get\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: function value() {\n return r.get(m, null, {\n virtuals: o(this, \"schema.options.toObject.virtuals\", null)\n });\n }\n }), Object.defineProperty(s, \"toJSON\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: function value() {\n return r.get(m, null, {\n virtuals: o(r, \"schema.options.toJSON.virtuals\", null)\n });\n }\n }), Object.defineProperty(s, \"$__isNested\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: !0\n });\n var u = Object.freeze({\n minimize: !0,\n virtuals: !1,\n getters: !1,\n transform: !1\n });\n Object.defineProperty(s, \"$isEmpty\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: function value() {\n return 0 === Object.keys(this.get(m, null, u) || {}).length;\n }\n }), Object.defineProperty(s, \"$__parent\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: this\n }), f(c, s, m, p), this.$__.getters[m] = s;\n }\n\n return this.$__.getters[m];\n },\n set: function set(t) {\n null != t && t.$__isNested ? t = t.$__get() : t instanceof i && !t.$__isNested && (t = t.$toObject(s)), (this.$__[h] || this).$set(m, t);\n }\n }) : Object.defineProperty(l, e, {\n enumerable: !0,\n configurable: !0,\n get: function get() {\n return this[u].call(this.$__[h] || this, m);\n },\n set: function set(t) {\n this.$set.call(this.$__[h] || this, m, t);\n }\n });\n }", "title": "" } ]
e6af08b94ce6a10e2eaca3083ca8953b
make it so that this generates the like history
[ { "docid": "d9f12366f1ef9b439fc4ad8323278b65", "score": "0.0", "text": "async function userLiked (data) {\n //collect user info\n let token = localStorage.getItem('jwt');\n let name = localStorage.getItem('name');\n\n return await axios({\n method:'POST',\n url: \"http://localhost:3000/user/\"+name,\n headers: {\n //jwt is the jwt from logging in\n \"Authorization\": \"Bearer \" + token\n },\n data: { data,\n type: 'merge' } \n });\n\n}", "title": "" } ]
[ { "docid": "ab6e59bdc9a4e1a5b521783a6cc43705", "score": "0.68000287", "text": "function genHistory() {\n searchHistory.append(searchItem1);\n searchItem1.text(localStorage.getItem(x));\n searchHistory.append(searchItem2);\n searchItem2.text(localStorage.getItem(x-1));\n searchHistory.append(searchItem3);\n searchItem3.text(localStorage.getItem(x-2));\n searchHistory.append(searchItem4);\n searchItem4.text(localStorage.getItem(x-3));\n searchHistory.append(searchItem5);\n searchItem5.text(localStorage.getItem(x-4));\n}", "title": "" }, { "docid": "acaa81a4cd12e3de1c7bca19f8f3f6a3", "score": "0.6604864", "text": "redo_history() {\n //temos uma history e não estamos no começo dela\n if ((this.history_a.length) && (this.history_ptr < this.history_a.length)) {\n //ajusta ponteiro para proxima entrada do history\n this.history_ptr++;\n //copia history na canvas\n this._canvas_history_update();\n }\n }", "title": "" }, { "docid": "e21ede6bd62749e4c8c7b8ebb2742240", "score": "0.6465077", "text": "function betterHistory() {\n\tvar historyList = document.getElementById(\"pagehistory\");\n\tvar timeStr;\n\tvar timePos;\n\tvar time;\n\tvar name;\n\tvar timeBool = true;\n\tvar highlightBool = true;\n\t\n\tif (window.CustomUCPFeatures && window.CustomUCPFeatures.history12hTime === false) {\n\t\ttimeBool = false;\n\t}\n\tif (window.CustomUCPFeatures && window.CustomUCPFeatures.historyHighlight === false) {\n\t\thighlightBool = false;\n\t}\n\t\n\tif (historyList !== null) {\n\t\thistoryList = historyList.children;\n\t\tfor (i = 0; i < historyList.length; i++) {\n\t\t\tif (!historyList[i].classList.contains(\"fixed-history\")) {\n\t\t\t\ttimeStr = historyList[i].getElementsByClassName(\"mw-changeslist-date\")[0];\n\t\t\t\ttimePos = timeStr.innerText.search(\":\");\n\t\t\t\ttime = timeStr.innerText.substring(timePos - 2, timePos + 3);\n\t\t\t\ttimeStr.innerHTML = timeStr.innerHTML.replace(time, twelveHourTime(time, timeBool));\n\t\t\t\t\n\t\t\t\tname = historyList[i].getElementsByClassName(\"mw-userlink\")[0].innerText;\n\t\t\t\thighlightUser(historyList[i], name, highlightBool);\n\t\t\t\t\n\t\t\t\thistoryList[i].classList.add(\"fixed-history\");\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cab0d285554be3dee004a00df5422502", "score": "0.6423706", "text": "function makeHistory(limit) {\n let count = -1;\n let strStack = [];\n function printHistory(str) {\n if (str == \"undo\") {\n count--;\n if (count == -1) {\n return `Nothing to undo`;\n }\n return `${strStack.pop()} undone`;\n }\n strStack.push(str);\n count++;\n return `${strStack[count]} done`;\n }\n return printHistory;\n}", "title": "" }, { "docid": "300de78f3eae69d88d05fbd74f64d7d5", "score": "0.63845813", "text": "back_history() {\n //temos uma history e não estamos no começo dela\n if ((this.history_a.length) && (this.history_ptr > 0)) {\n //salva tela atual no history, para poder voltar pra ela, se estivermos nos final da lista\n if (this.history_a.length == this.history_ptr) {\n this.history_a[this.history_ptr] = (document.getElementById(this.user.sketch_canvas).toDataURL(\"image/png\"));\n }\n //ajusta ponteiro para entrada anterior do history\n this.history_ptr--;\n //copia history na canvas\n this._canvas_history_update();\n }\n }", "title": "" }, { "docid": "cc3c16f7e4bcf59c710687ef50df0177", "score": "0.6371287", "text": "function makeHistory() {\n let memoryStick = [];\n function storeHistory(string){\n if(memoryStick.length === 0 && string === 'undo') return 'nothing to undo';\n if(string === 'undo'){\n const remove = memoryStick.pop()\n remove\n return `${remove} - undone`\n }\n memoryStick.push(string)\n return `${string} - done`\n };\n return storeHistory;\n}", "title": "" }, { "docid": "94f40dce019b7f3edcf64abf7c51abe2", "score": "0.63326764", "text": "function makeHistory() {\n console.log(\"SAVING\")\n historyStep++;\n if (historyStep < historyLayer.length) {\n historyLayer.length = historyStep;\n }\n URL = explicitDrawImg.src;\n historyLayer.push(URL);\n }", "title": "" }, { "docid": "b9e024f0b6f48a4a1fd1c4bd82acaa09", "score": "0.63022345", "text": "function history(){\r\n var divHist = getId('divHist');\r\n try{\r\n if(divHist){\r\n killId(divHist);\r\n var hL = getId('historyLink');\r\n hL.innerHTML = 'History'; hL.className= 'gootransbutt gootranslink gtlPassive';\r\n hL.title = 'Translation history';\r\n GM_setValue('histShow',false);\r\n return;\r\n }\r\n if(!maxHT) return;\r\n GM_setValue('histShow',true);\r\n\tdivHist = buildEl('div', {id:'divHist'},['click', histLookup], null );\r\n//\t\r\n for(var i=0, l=ht.length; i<l; i++){\r\n var bkg = ht[i][0].indexOf(' ')>0 ? ' goohistlink' : '';\r\n addEl(divHist,'a', {href:HREF_NO, 'class': 'gootranslink'+bkg, 'titel': ht[i][1]+\r\n ((ht[i][3]>1) ? '\\u00A0'+ '['+ht[i][3]+']' : '')},\r\n null, ht[i][0]);\r\n if(i < l-1)\r\n divHist.appendChild(document.createTextNode(' '));\r\n }\r\n\t//addEl(divHist,'span',null,null,'<br>&nbsp;');\r\n if(getId('divSourceshow'))\r\n insAfter(divHist,getId('divSourceshow'));\r\n else\r\n insAfter(divHist,getId('divResult'));\r\n hL=getId('historyLink')\r\n// hl.textContent = 'X';\r\n hL.title= 'Hide history';\r\n hL.innerHTML = 'History'; hL.className = 'gootransbutt gootranslink gtlActive';\r\n }catch(e){console.log('hist problem\\n'+e)}\r\n}", "title": "" }, { "docid": "e4b70400f9db7a6ac0a7e23735e8edf8", "score": "0.62370074", "text": "function makeHistory(limit) {\nvar history=[];\nfunction work(str){\n if(str===\"undo\"){\n if(history.length>0){\n var p = history.pop();\n return p + \" undone\"\n }else return \"nothing to undo\"\n }else{\n if(history.length>=limit){\n history.shift();\n history.push(str);\n return str + \" done\";\n }else{\n history.push(str);\n return str + \" done\"\n }\n }\n}\nreturn work;\n}", "title": "" }, { "docid": "bf6c948fd9745cac74b8481b60d54c3f", "score": "0.61195225", "text": "onHistory(value) {\n this._history.length = 0;\n let last = '';\n let current = '';\n if (value.content.status === 'ok') {\n for (let i = 0; i < value.content.history.length; i++) {\n current = value.content.history[i][2];\n if (current !== last) {\n this._history.push((last = current));\n }\n }\n }\n // Reset the history navigation cursor back to the bottom.\n this._cursor = this._history.length;\n }", "title": "" }, { "docid": "8094f3ff154af2eb09ef011cd35c5d1b", "score": "0.605324", "text": "_save_history() {\n //adiciona modificações \n this.history_a[this.history_ptr] = (document.getElementById(this.user.sketch_canvas).toDataURL(\"image/png\"));\n //ajusta ponteiro para proxima entrada do history e passo atual vira o ultimo\n this.history_a.length = ++this.history_ptr;\n }", "title": "" }, { "docid": "f64fe8e2c37f2c71b938d3154644c839", "score": "0.6025058", "text": "function historyBtns() {\n // writing recent search to search history\n $(\"#myHistory\").empty();\n for (var i = 0; i < 5; i++) {\n var oldSearch = $(\"<a>\").addClass(\"hoverable detailsText\");\n oldSearch.on(\"click\", function(){\n\n city=$(this).text();\n runAPI(city);\n })\n oldSearch.text(cityHistory[i]);\n if (oldSearch.text()) {\n oldSearch.addClass(\"searchHistory\");\n $(\"#myHistory\").append(oldSearch)\n $(\"#myHistory\").append(\"<br>\");\n }}\n }", "title": "" }, { "docid": "0ede15dd9afc08f167322e4ff583bdcd", "score": "0.60028297", "text": "function drawHistory() {\n for (var i = 0; i < history.length; i++) {\n var pos = history[i];\n fill(pos.z);\n ellipse(pos.x, pos.y, 40);\n }\n}", "title": "" }, { "docid": "2b8ce428132a78f15e5d3be77b33aaec", "score": "0.599842", "text": "function saveGuessHistory(guess) {\n // *CODE GOES BELOW HERE *\n guessList.unshift(guess);\n}", "title": "" }, { "docid": "d2b0ff70987b45eea8b42602d96a4459", "score": "0.59919626", "text": "function history_undo() {\n if (history_past.length < 2) return;\n\n //add the currently displayed result to the redo stack\n redo_stack.push(history_past.pop());\n var previous = history_past[history_past.length - 1];\n writeEverything(previous);\n\n // enable redo_nappi\n document.getElementById(\"redo_nappi\").disabled = false;\n //history exists, enable undo_nappi\n if (history_past.length < 2)\n document.getElementById(\"undo_nappi\").disabled = true;\n}", "title": "" }, { "docid": "64be6a561a9c50e4b229d5880a083e8b", "score": "0.5989354", "text": "function RenderHistory()\n{\n var arrKeys=new Array();\n for(i=0;i<localStorage.length;i++) {\n var key=localStorage.key(i);\n var val=localStorage.getItem(key);\n if(key.startsWith('BPGID'))\n {\n key=key.replace('BPGID','');\n arrKeys.push(key);\n }\n }\n arrKeys= arrKeys.sort(function(a,b){return a-b;});//Sort the keys by time visited.\n for(var i=0;i<arrKeys.length;i++) {\n var key=arrKeys[i];\n var title=localStorage.getItem('Text'+key);\n var tip=GetTTFormat(title,key);\n\n if(title.length==0) {\n //In case of the page redirect get the title from the page itself.\n title=GetTitleFromFrame(window);\n //Update the storage also.\n localStorage.setItem('Text'+key,title);\n }\n CreateHistItem(key,title,tip);\n }\n}", "title": "" }, { "docid": "ef2d4f29404120f98df285e26dd99006", "score": "0.59865904", "text": "addHistory(editor, pos) {\n const page = this.editorTabView.getPageForEditor(editor);\n if ((this.lastEntry.hash === page.toHashCode()) && (this.lastEntry.pos === pos))\n return;\n var entry = {\n hash: page.toHashCode(),\n pos: pos\n };\n history.pushState(entry, page.getLabel());\n }", "title": "" }, { "docid": "39b07bc9cf929cc089a50f9b7baaabf7", "score": "0.5969314", "text": "get history() {\n return {\n about: \"history [-OPTIONS]<br>&nbsp;&nbsp;Display the list of recent commands.<br>&nbsp;&nbsp;-c clear the history list.\",\n exe: (args) => {\n if (args.length == 2 && args[1] == \"-c\") {\n localStorage.setItem(\"history\", []);\n this.terminal.history = [];\n }\n var history = this.terminal.history;\n var output = \"\";\n\n history.forEach(function (element, index) {\n output += index + \"&nbsp;&nbsp;\" + element + \"<br>\";\n });\n return output;\n }\n };\n }", "title": "" }, { "docid": "10e1f97b1a1f23d77df5628ea7cf43eb", "score": "0.5954365", "text": "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n }", "title": "" }, { "docid": "10e1f97b1a1f23d77df5628ea7cf43eb", "score": "0.5954365", "text": "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n }", "title": "" }, { "docid": "fee04988b4834bf1be47ae7dba9faffa", "score": "0.5919393", "text": "function getHistory() {\n const resultHistory = ['\"I Promise\" - Radiohead', '\"Gratisfaction\" - The Strokes', '\"Stay Home\" - American Football', '\"Institutionalized\" - Suicidal Tendencies'];\n\n let history = '';\n for (const result of resultHistory) {\n history += (result + '<br>');\n }\n\n const historyContainer = document.getElementById('history-container');\n historyContainer.innerHTML = history;\n}", "title": "" }, { "docid": "9a7cf139363741751012704666d6c396", "score": "0.58933187", "text": "function for_ttq_history() {\n\tvar win = $('ttq_history');\n\tif (win == null) {\n\t\tif (ttq_history_counter < 10 )\tsetTimeout(for_ttq_history, 500);\n\t\tttq_history_counter++;\n\t\treturn;\n\t}\n\t/*\n\tvar title = $('ttq_history').firstChild.innerHTML;\n\t$('ttq_history').setAttribute('style', '');\n\t$('ttq_history').firstChild.style.display = 'none';\n\tvar mywin3 = win_create('em_window_ttq_history',{title: 'TTQ ' + title, closable: 1, minimizable: 1, saving: 1, left: '710px', top: '400px'});\n\twin_appendChild(mywin3, $('ttq_history'), true);\n\twin_show(mywin3);\n\t*/\n\twin.style.zIndex = 999;\n\twin.addEventListener('mousedown', function(ev){ win_toFront(win);}, false);\n}", "title": "" }, { "docid": "8e81c1d390e43f239f96a32157cbc154", "score": "0.588074", "text": "function historyToHtml(){\n if(history.length>0){\n $(\"table\").empty(); \n for (let j=0; j<history.length; j++){\n $(\"table\").append(\"<tr class=\\\"history\\\"><td id=\\\"\"+history[j]+\"\\\">\"+history[j]+\"</td></tr>\")\n }\n }\n }", "title": "" }, { "docid": "4b5bd34420e5d1d129936949fb334fa1", "score": "0.5873543", "text": "function addToHistory(firstOperand,secondOperand,operator,result)\n{ \n const equation=firstOperand+operator+secondOperand+\"=\"+result;\n history.unshift(equation);\n\n const historyBlockHTML=updateHistoryBlock(history);\n history_block.innerHTML=historyBlockHTML;\n\n\n\n\n /* const historyBlockHTML=history.map((eq) => updateHistoryBlock(eq));\n \n history_block.innerHTML=history.join(\"\"); */\n console.log(history);\n}", "title": "" }, { "docid": "7c28075a6a152c9de472c3da4f568b56", "score": "0.5853933", "text": "function createHistoryFn(boolP) {\n createHistory = boolP;\n }", "title": "" }, { "docid": "98a14ed05472755e1f1a88d90389e014", "score": "0.584146", "text": "logHistory() {\n console.log(\"\" + this.history.length + \" moves in history.\")\n for (let move of this.history) {\n console.log(JSON.stringify(move))\n }\n }", "title": "" }, { "docid": "1e92997288ac74cfebd03e9e59606805", "score": "0.5839804", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n\t return histChange;\n\t }", "title": "" }, { "docid": "1e92997288ac74cfebd03e9e59606805", "score": "0.5839804", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n\t return histChange;\n\t }", "title": "" }, { "docid": "1e92997288ac74cfebd03e9e59606805", "score": "0.5839804", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n\t return histChange;\n\t }", "title": "" }, { "docid": "3e1e4f375c711f8b66173be0f4962c1c", "score": "0.58361", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n\t return histChange\n\t }", "title": "" }, { "docid": "4983fbb135a2a3fda825d5e6ea001e6c", "score": "0.5829175", "text": "function changeHistory(history) {\r\n $(\".history\").text(history);\r\n let maxScrollLeft = $(\".history\").get(0).scrollWidth - $(\".history\").get(0).clientWidth;\r\n $(\".history\").scrollLeft(maxScrollLeft);\r\n }", "title": "" }, { "docid": "af687aae8eb3be15009bf535285e9803", "score": "0.5828232", "text": "function msg_to_history(msg) {\n\tif (history.length == 200){\n\t\thistory.shift()\n\t}\n\thistory.push(msg);\n}", "title": "" }, { "docid": "6fa10534bc15b88d0f6b20650cafb0aa", "score": "0.58258235", "text": "function displayHistory(document) {\n vm.history.push({ _id: document._id, date: document.date, repo: document.repo });\n }", "title": "" }, { "docid": "3a9ea6bce5ae5217798e6e0c6bff1234", "score": "0.57972944", "text": "function addImageHistory()\n\t{\n\t\timageHistory = true;\n\t\tinitDisabledButtons(false);\n }", "title": "" }, { "docid": "df7cfdc4ceaec355ca37a75e0268a71f", "score": "0.57917637", "text": "function renderHistory(){\n hist = JSON.parse(localStorage.getItem(\"hist\"));\n if( hist === null){\n hist = [];\n localStorage.setItem(\"hist\", JSON.stringify(hist));\n } else { \n for( var i = 0; i < hist.length; i++){\n $(\"#history\").append(`<li><a href=\"#!\" class=\"histEl\">${hist[i]}</a></li>`);\n }\n // this sets place to most recent location in history then renders weather based on it\n place = hist[0];\n renderCurrentWeather();\n renderForcast();\n };\n}", "title": "" }, { "docid": "4c41f2f60c009814bfbaa39a67eb97dd", "score": "0.5755532", "text": "redoHistory() {\n this.regions_info.history.redoHistory();\n }", "title": "" }, { "docid": "c25854a98415edeeeb4bc61d40a2e62e", "score": "0.57544535", "text": "function showHistoryItems() {\n\t\tdb.allDocs({\n\t\t\tinclude_docs: true,\n\t\t\tdescending: true\n\t\t}).then(function(doc) {\n\t\t\tredrawHistoryUI(doc.rows);\n\t\t}).catch(function(err) {\n\t\t\tconsole.log(err);\n\t\t});\n\t}", "title": "" }, { "docid": "b8c4c57aa191be4a46cac3ef36038250", "score": "0.57535756", "text": "function historyChangeFromChange(doc, change) {\n\t\t\t\tvar histChange = { from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to) };\n\t\t\t\tattachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t\t\t\tlinkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n\t\t\t\treturn histChange\n\t\t\t}", "title": "" }, { "docid": "997c9aa7de1d09d1bffd808c3bd73628", "score": "0.5742942", "text": "function buildHistoryList() {\n let targetDiv = document.getElementById('historyList'),\n ul = document.createElement('ul'),\n tmpLi = null,\n tmpText = null,\n tmpLst = callHistory;\n\n tmpLst.push('end');\n \n console.log(tmpLst);\n \n tmpLst.forEach(e => {\n if (e !== 'end') {\n tmpLi = document.createElement('li');\n tmpText = document.createTextNode(e);\n tmpLi.appendChild(tmpText);\n ul.appendChild(tmpLi);\n } else {\n targetDiv.appendChild(tmpLi); \n }\n });\n}", "title": "" }, { "docid": "a77616a05d1b2790ff4c796f47cdb701", "score": "0.57324475", "text": "function getHistory() {\n if (currentIndex > 0 && cmdHistory.length > currentIndex + 1) {\n let textBox = document.getElementById(\"textBox\");\n currentIndex++;\n textBox.value = cmdHistory[currentIndex];\n } else if (currentIndex == 0 && cmdHistory.length > currentIndex) {\n let textBox = document.getElementById(\"textBox\");\n cmdHistory.unshift(textBox.value);\n currentIndex++;\n textBox.value = cmdHistory[currentIndex];\n }\n}", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.57252", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "0295c6546af055b9a25fbea9956e782d", "score": "0.571782", "text": "function historyChangeFromChange(doc, change) {\r\n var histChange = { from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to) };\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange;\r\n }", "title": "" }, { "docid": "3a04ae5d570c686c159ccf51be80459b", "score": "0.5717135", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n\t return histChange\n\t}", "title": "" }, { "docid": "3a04ae5d570c686c159ccf51be80459b", "score": "0.5717135", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n\t return histChange\n\t}", "title": "" }, { "docid": "3a04ae5d570c686c159ccf51be80459b", "score": "0.5717135", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n\t return histChange\n\t}", "title": "" }, { "docid": "08b59dca62054a43165840e017c88d10", "score": "0.57158995", "text": "function buildHistoricalDirections ( index ) {\n var history = getHistory();\n var routes = history.routes.reverse();\n var route = routes[index];\n routes.splice(index,1);\n history.routes = routes.reverse();\n updateHistory(history);\n buildDirections(route);\n $('#routehistory').popup( 'close' );\n}", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.57155764", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.57155764", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.57155764", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.57155764", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.57155764", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.57155764", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "db138ed677f32be9c20bc6578f55f102", "score": "0.57041353", "text": "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n this.compound = 0;\n this.closed = false;\n }", "title": "" }, { "docid": "db138ed677f32be9c20bc6578f55f102", "score": "0.57041353", "text": "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n this.compound = 0;\n this.closed = false;\n }", "title": "" }, { "docid": "54e7831f94570d5e9657fb05d3f111cd", "score": "0.56997824", "text": "function addToHistory(reText, reOptions, reTextTokenized) {\n //var stackIndex = history.length();\n var displayID = ++lastID;\n history.push({\n reText: reText,\n reOptions: reOptions,\n value: '<span class=\"handle\">' + (displayID) + ': </span>' + stylizeRe(reTextTokenized),\n id: displayID,\n displayID: displayID\n });\n }", "title": "" }, { "docid": "e663c1f293b1914a7bdddf3e376e7289", "score": "0.5694999", "text": "function setHistoryTips() {\n setTips('.author-pic', 'left'); \n setTips('.time-ago');\n setTips('.cut-content'); \n setTips('.cut-url', 'left'); \n setTimeAgo();\n}", "title": "" }, { "docid": "dbfabfa2a9dac64031358631f04c6839", "score": "0.5692599", "text": "function handHistory(target, action){\n var historyLine = document.createElement('li');\n if (action === 'bets'){\n historyLine.innerHTML = `${target} ${action} -${bet}`;\n } else if (action === 'wins' && target==='Dealer'){\n historyLine.innerHTML = `${target} ${action}`;\n } else if (action === 'wins'){\n historyLine.innerHTML = `${target} ${action} +${bet*2}`;\n } else if (action === 'pushes'){\n historyLine.innerHTML = `${target} ${action} +${bet}`;\n } else if (action === 'BlackJack!'){\n historyLine.innerHTML = `${action} +${bet*2.5}`;\n }\n historyTab.insertAdjacentElement('afterbegin', historyLine);\n}", "title": "" }, { "docid": "b834525ad99208691992388552c9714c", "score": "0.56755203", "text": "function addHistory(id,top,imgSrc,videoSrc){\n var id=parseInt(id)+1;\n// if(l > 1){\n// history.replaceState({\"id\":id,'top':top},\"\",window.location.href.split(\"?\")[0]+\"?page-\"+id);\n// }else{\n// history.pushState({\"id\":id,'top':top},\"\",window.location.href.split(\"?\")[0]+\"?page-\"+id);\n// l++;\n// }\n history.pushState({\"id\":id},\"\",window.location.href+\"?page=\"+id);\n// console.log(history.state);\n}", "title": "" }, { "docid": "2d3145819cfee06a994de1998ae52634", "score": "0.566927", "text": "function historyChangeFromChange(doc, change) {\n var histChange = { from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to) };\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) {\n return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n }, true);\n return histChange;\n }", "title": "" }, { "docid": "e57758b3f25fe1f17d023705b703f420", "score": "0.5666134", "text": "function History() {\n this.arrayOfChanges = [];\n this.histObj = {};\n}", "title": "" }, { "docid": "b33619096858ef9fddabe1da451e9104", "score": "0.56610304", "text": "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n this.compound = 0;\n this.closed = false;\n }", "title": "" }, { "docid": "8041e998f94e4b3d1b06d5790e9f1350", "score": "0.56566375", "text": "function printHistory() {\n if (!historyLock) {\n document.getElementById(\"historyList\").innerHTML = \"\";\n historyArr.forEach(function (his) {\n var li = document.createElement(\"li\");\n li.textContent = his;\n document.getElementById(\"historyList\").appendChild(li);\n });\n }\n}", "title": "" }, { "docid": "326891570f87f58f8ea512d886f56c1d", "score": "0.56538224", "text": "function renderHistory() {\n const historyData = showHistory();\n let historyList = document.querySelector(\"#historyList\");\n\n // selalu hapus konten HTML pada element supaya tidak ada tampilan data ganda\n historyList.innerHTML = \"\";\n\n for (let history of historyData) {\n // membuat element tr\n let row = document.createElement(\"tr\");\n row.innerHTML = \"<td>\" + history.skor + \"</td>\";\n\n historyList.appendChild(row);\n }\n}", "title": "" }, { "docid": "bab2ddb314a3271c62244dfb7b783653", "score": "0.56445676", "text": "function historyData()\n{\n\n}", "title": "" }, { "docid": "4443fd7ada418346f8fbcc3d0e23174f", "score": "0.56406593", "text": "function renderHistory() {\n const historyData = showHistory();\n let historyList = document.querySelector(\"#historyList\");\n\n // selalu hapus konter HTML pada elemen historyList agar tidak menampilkan data ganda\n historyList.innerHTML = \"\";\n\n for (let history of historyData) {\n let row = document.createElement(\"tr\");\n row.innerHTML = \"<td>\" + history.firstNumber + \"</td>\";\n row.innerHTML += \"<td>\" + history.operator + \"</td>\";\n row.innerHTML += \"<td>\" + history.secondNumber + \"</td>\";\n row.innerHTML += \"<td>\" + history.result + \"</td>\";\n\n historyList.appendChild(row);\n }\n}", "title": "" }, { "docid": "c587acb5d7e9b647ebff3f4f70ed582b", "score": "0.56390804", "text": "treeToHistory(step) {\n const snapshot = {\n nodes: [],\n edges: [],\n legend: [\n ...this.algoritmLegend,\n ],\n };\n\n this.algoritmLegend = [];\n\n this.initialPreorder(snapshot, null, this.root);\n\n if (!step) {\n this.history.push(snapshot);\n } else {\n this.history[step] = snapshot;\n }\n }", "title": "" }, { "docid": "fed151747f2b497fcaf42b6fb1f1bf12", "score": "0.5638147", "text": "function renderSearchHistory() {\n if (storedHistory != null) {\n//keep adding searched items until the number reaches 30 \n for (var i = 0; i < storedHistory.length; i++) {\n var listID = \"listItem\" + i;\n $('#' + listID + '').children('#link').text(storedHistory[i]);\n console.log($('#' + listID + '').children('#link'));\n }\n }\n }", "title": "" }, { "docid": "cdc972e3445f9e3a597b106d7a028def", "score": "0.56340563", "text": "getHistory() {\n return this.editor.history;\n }", "title": "" }, { "docid": "93e650302515fe1a61aec94914113be5", "score": "0.5624902", "text": "function pf_update_history() {\n // FIXME: g_runids is no longer available.\n // var url;\n // if (g_runids[1]) {\n // url = g_urls.comparison_template\n // .replace('<testid>', g_testid)\n // .replace('<run1id>', g_runids[0])\n // .replace('<run2id>', g_runids[1]);\n // } else {\n // url = g_urls.singlerun_template\n // .replace('<testid>', g_testid)\n // .replace('<run1id>', g_runids[0]);\n // }\n // history.pushState({}, document.title, url);\n}", "title": "" }, { "docid": "98f64b916d1e074fa199aee81e9a7481", "score": "0.5624787", "text": "function updateHistory() {\n \n // This number helps quicksearch target proper history item\n localStorage[\"num\"]++;\n\n // store stuff into chache history\n var store = info[0].hwi.hw.replace(/\\*/g, \"\") + \" \";\n localStorage[\"history\"] +=\n '<strong onclick=\"quickSearch()\" id=\"his' +\n localStorage[\"num\"] +\n '\">' +\n store +\n \"</strong>\";\n \n var u = localStorage[\"history\"].match(/ /gi).length/3;\n if (u > 20) {\n localStorage[\"history\"] = localStorage[\"history\"].split(/strong>(.+)/)[1];\n }\n\n // If there are too many entries in history, erase the earlier entries, but still keep their\n // Json in cache\n var u = (localStorage[\"history\"].match(/<strong>/g) || []).length;\n if (u > 20) {\n localStorage[\"history\"].split(/strong>(.+)/)[1];\n }\n\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.56214327", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.56214327", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.56214327", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.56214327", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.56214327", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.56214327", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "83e2e4356fb2f5911a9764b2d6d4e0d5", "score": "0.5618165", "text": "function BrothelLog(LogText) {\n var newText = LogText + \"<br>\";\n BrothelLogArray.unshift(newText);\n while (BrothelLogArray.length > Settings.LogLength) {\n LogArray.pop();\n }\n LogHistory = \"\";\n for (var e of BrothelLogArray) {\n LogHistory += e + \"<br>\";\n }\n //LogHistory = newText + LogHistory;\n document.getElementById(\"\").innerHTML = LogHistory;// Make a brothelTextLog\n} // This will be inside brothel at home.", "title": "" }, { "docid": "369156121919727caee87d922bf15035", "score": "0.5617819", "text": "function renderExistingHistory() {\n var cities = getLocal();\n for (i = 0; i < cities.length; i++) {\n addToHistory(cities[i]);\n }\n\n if (cities.length === 0) {\n currentWeather(\"Washington DC\");\n } else {\n currentWeather(cities[cities.length -1]);\n }\n }", "title": "" }, { "docid": "5c90984684e7b495b3bd8393364e00a6", "score": "0.55969775", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1)\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true)\n return histChange\n}", "title": "" }, { "docid": "5c90984684e7b495b3bd8393364e00a6", "score": "0.55969775", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1)\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true)\n return histChange\n}", "title": "" }, { "docid": "c54ecaf44cfdcfe79bd7d49806151ecd", "score": "0.55915034", "text": "function gnc_get_history() {\n // TODO: Shim history\n return history;\n}", "title": "" }, { "docid": "e5baaf1e628ecd1a49be162ebdd981fc", "score": "0.5578777", "text": "function _History() {\r\n\tvar me = this;\r\n\t\r\n\tvar pages = [];\r\n\tvar params = [];\r\n\r\n\t/* Guarda en la pila el id de la pagina y sus parametros*/\r\n\tme.push = function (page,param){\r\n\t\tpages[pages.length] = page;\r\n\t\tparams[params.length] = params;\r\n\t\tconsole.log('Push');\r\n\t\tdebug();\r\n\t}\r\n\r\n\t/* Desapila la pagina y sus parametros*/\r\n\tme.pop = function(){\r\n\t\tpages.splice(-1,1);\r\n\t\tparams.splice(-1,1);\r\n\t\tconsole.log('Pop');\r\n\t\tdebug();\r\n\t}\r\n\t\r\n\t/* Devuelve los parametros de la pagina en la pos de la pila*/\r\n\tme.getParams = function(pos){\r\n\t\treturn params[pos];\r\n\t}\r\n\t\r\n\t/* Fija los parametros de la pagina de la pos de la pila*/\r\n\tme.setParams = function(pos,data){\r\n\t\tparams[pos] = data;\r\n\t\tconsole.log('Set Params');\r\n\t\tdebug();\r\n\t}\r\n\t\r\n\t/* Devuelve la pagina que esta en top*/\r\n\tme.topPage = function(){\r\n\t\treturn pages[pages.length-1];\r\n\t}\r\n\t\r\n\t/* Devuelve los parametros de la pagina que esta en top*/\r\n\tme.topParams = function(){\r\n\t\treturn params[params.length-1];\r\n\t}\r\n\t\r\n\t/* Devuelve el tamaño de la pila*/\r\n\tme.size = function(){\r\n\t\treturn pages.length;\r\n\t}\r\n\t\r\n\t/* Vacia la pila*/\r\n\tme.clear = function(){\r\n\t\tpages.splice(0,pages.length);\r\n\t\tparams.splice(0,params.length);\r\n\t\tconsole.log('Clear');\r\n\t\tdebug();\r\n\t}\r\n\t\r\n\t/* Hace Debug, TODO: Borrar de produccion*/\r\n\tvar debug = function(){\r\n\t\tconsole.log('Debug');\r\n\t\tfor(var i=0;i<pages.length;i++){\r\n\t\t\tconsole.log('Page-'+i+': '+pages[i]);\r\n\t\t\tif(params[i]!=null){ \r\n\t\t\t\tconsole.log('Params-'+i+': '+params[i].toString());\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log('Params-'+i+': Sin params');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n}", "title": "" }, { "docid": "ed06c830a7fdfdb57fc240e1e0b2d06c", "score": "0.55761534", "text": "function historyPush(command) {\n\t\t\tcStep++;\n\n\t\t\tif (cStep < history.length) {\n\t\t\t\thistory.length = cStep;\n\t\t\t}\n\n\t\t\tif (command == 6) {\n\n\t\t\t\thistory.push('text' + textId);\n\n\t\t\t} else if (command == 8) {\n\t\t\t\thistory.push('pic' + cur_picture_id);\n\t\t\t} else {\n\t\t\t\tvar expandList = $(\"#container .expandingArea\");\n\t\t\t\tif (expandList[0]) {\n\t\t\t\t\tvar e_lst = [];\n\t\t\t\t\t// 对所有已展示的输入框进行隐藏\n\t\t\t\t\tfor (var ex in expandList) {\n\t\t\t\t\t\tif (intReg.test(ex) && expandList[ex].style.display !== \"none\") {\n\t\t\t\t\t\t\texpandList[ex].style.display = \"none\";\n\n\t\t\t\t\t\t\te_lst.push(ex);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\thistory.push($(\"#myCanvas\").get(0).toDataURL());\n\t\t\t\t\tfor (var el in e_lst) {\n\t\t\t\t\t\texpandList[e_lst[el]].style.display = \"block\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thistory.push($(\"#myCanvas\").get(0).toDataURL());\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "ccd72bc6d31493129d2528e041d31edb", "score": "0.55719024", "text": "__push_stack_history__(newHistoryData, idt){\n // equal with prev\n if(idt === _idt){\n historys.push(preHistoryData);\n preHistoryData = newHistoryData;\n }\n }", "title": "" }, { "docid": "ef4609a9d7865c3e247d7903d3cea828", "score": "0.55569834", "text": "function toggleHistory() {\n return isDisplaying ? toggleDisplay(false) : toggleDisplay(true);\n }", "title": "" }, { "docid": "7d875af41a2a7552c4df3fd367d5a00b", "score": "0.5556966", "text": "function renderHistory() {\n $(\"#history\").empty();\n $(\"#history\").append(`<li id=\"clear-history\" class=\"list-group-item bg-danger text-light\" role=\"button\">Clear History</li>`);\n for (const city of history) {\n const listItem = $(`<li class=\"list-group-item city\" role=\"button\">${city}</li>`);\n $(\"#history\").prepend(listItem);\n }\n}", "title": "" }, { "docid": "7914087759d2981ddf6b5811f8befe8e", "score": "0.55295783", "text": "function addHistory(search){\n\t\t//if there is no duplicate search history add recent search to history\n\t\tif(!checkDuplicate(search)){\n\t\t\taddSearchNum();\n\t\t\tvar sNum = JSON.parse(localStorage.getItem('searchNum'))\n\t\t\t//name of localStorage access\n\t\t\tkvName = String('historyObject'+sNum.num);\n\t\t\t//set most recent search in local storage as 'historyObject+NumSearch'\n\t\t\tlocalStorage.setItem(kvName, JSON.stringify(search));\n\t\t}\n\t}", "title": "" }, { "docid": "2d23750e4b02f975d40d9176be02df37", "score": "0.5529021", "text": "function renderSearchHistory() {\n historyContainer.innerHTML = \"\";\n // Show most recent searches at the top of the list.\n for (var i = searchHistory.length - 1; i >= 0; i--) {\n var btn = document.createElement('button');\n btn.setAttribute(\"type\", \"button\");\n btn.classList.add(\"history-btn\", \"btn-history\");\n\n btn.setAttribute(\"data-search\", searchHistory[i]);\n btn.textContent = searchHistory[i];\n historyContainer.append(btn);\n }\n}", "title": "" } ]
1e3e1bcc9353fb17ef2448c635477d97
! vuex v3.4.0 (c) 2020 Evan You
[ { "docid": "91dc1e373c285481f0eca4d62909a890", "score": "0.0", "text": "function applyMixin (Vue) {\n var version = Number(Vue.version.split('.')[0]);\n\n if (version >= 2) {\n Vue.mixin({ beforeCreate: vuexInit });\n } else {\n // override init and inject vuex init procedure\n // for 1.x backwards compatibility.\n var _init = Vue.prototype._init;\n Vue.prototype._init = function (options) {\n if ( options === void 0 ) options = {};\n\n options.init = options.init\n ? [vuexInit].concat(options.init)\n : vuexInit;\n _init.call(this, options);\n };\n }\n\n /**\n * Vuex init hook, injected into each instances init hooks list.\n */\n\n function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }\n}", "title": "" } ]
[ { "docid": "415edcacf350d609543bc0f8e9f17475", "score": "0.66898924", "text": "function vuexInit(){\nvar options=this.$options;\n// store injection\nif(options.store){\nthis.$store=typeof options.store==='function'?\noptions.store():\noptions.store;\n}else if(options.parent&&options.parent.$store){\nthis.$store=options.parent.$store;\n}\n}", "title": "" }, { "docid": "ac4a43dfa51ab9eb54684cde160f05bf", "score": "0.6591121", "text": "enableVuex() {\n // VUEX IS ENABLED BY DEFAULT\n // this.VUEX_STORE = true;\n }", "title": "" }, { "docid": "415ea3ff80591d74cbbe0cd3123206f2", "score": "0.63350046", "text": "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\t\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var actions = vuex.actions;\n\t var getters = vuex.getters;\n\t // handle deprecated state option\n\t\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "title": "" }, { "docid": "5f5603bc3520403229e63499e4e0e3bc", "score": "0.6330228", "text": "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\t\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var getters = vuex.getters;\n\t var actions = vuex.actions;\n\t // handle deprecated state option\n\t\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "title": "" }, { "docid": "d6b9507e66d66e2138da85f3ce1483ff", "score": "0.62462986", "text": "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "title": "" }, { "docid": "fe607fa191bd840c70c7b5862d53a074", "score": "0.62359226", "text": "function vuexInit () {\n\t var options = this.$options\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store\n\t }\n\t }", "title": "" }, { "docid": "73c0089ffd576a0489e0c575853865f7", "score": "0.61046267", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "acf9557527ca85c4cd486ee2e9e47b80", "score": "0.60986817", "text": "disableVuex() {\n // VUEX IS ENABLED BY DEFAULT\n // this.VUEX_STORE = false;\n }", "title": "" }, { "docid": "82d785f446747f6b47076441a813a2d0", "score": "0.6070403", "text": "initBooksArray({ commit }, jwtToken) {\n axios\n .get(\"/books/\", {\n headers: {\n \"auth-token\": jwtToken,\n },\n })\n .then((response) => {\n // initialize the books array in the vuex store with the books of the database.\n commit(\"initBooksArray\", response.data);\n })\n .catch(function (error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.60568154", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.60568154", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.60568154", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.60568154", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.60568154", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.60568154", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.60568154", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "c1e262fef05c5187db3d6e4aded1fe3b", "score": "0.60501724", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "514899756d62842d954b9b0d8943fa7b", "score": "0.6045738", "text": "function vuexInit () {\n var options = this.$options\n // store injection\n if (options.store) {\n this.$store = options.store\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store\n }\n }", "title": "" }, { "docid": "514899756d62842d954b9b0d8943fa7b", "score": "0.6045738", "text": "function vuexInit () {\n var options = this.$options\n // store injection\n if (options.store) {\n this.$store = options.store\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store\n }\n }", "title": "" }, { "docid": "9125140566f31aa9a7d4bb36ffae8ffb", "score": "0.6018866", "text": "function vuexInit() {\n var options = this.$options;\n var store = options.store;\n var vuex = options.vuex;\n // store injection\n\n if (store) {\n this.$store = store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n // vuex option handling\n if (vuex) {\n if (!this.$store) {\n console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n }\n var state = vuex.state;\n var actions = vuex.actions;\n var getters = vuex.getters;\n // handle deprecated state option\n\n if (state && !getters) {\n console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n getters = state;\n }\n // getters\n if (getters) {\n options.computed = options.computed || {};\n for (var key in getters) {\n defineVuexGetter(this, key, getters[key]);\n }\n }\n // actions\n if (actions) {\n options.methods = options.methods || {};\n for (var _key in actions) {\n options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n }\n }\n }\n }", "title": "" }, { "docid": "869a79142eba9edbb17bbda9ce099122", "score": "0.59858483", "text": "function applyMixin(Vue){var version;if(Number(Vue.version.split(\".\")[0])>=2)Vue.mixin({beforeCreate:vuexInit});else{var _init=Vue.prototype._init;Vue.prototype._init=function(options){void 0===options&&(options={}),options.init=options.init?[vuexInit].concat(options.init):vuexInit,_init.call(this,options)}}function vuexInit(){var options=this.$options;options.store?this.$store=\"function\"==typeof options.store?options.store():options.store:options.parent&&options.parent.$store&&(this.$store=options.parent.$store)}}", "title": "" }, { "docid": "e33a7681d6aa8e808b612d6b426699e5", "score": "0.59670293", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ?\n options.store() :\n options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "e33a7681d6aa8e808b612d6b426699e5", "score": "0.59670293", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ?\n options.store() :\n options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "e33a7681d6aa8e808b612d6b426699e5", "score": "0.59670293", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ?\n options.store() :\n options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "42982d79171a20cbf6788070af2a9ff5", "score": "0.5965776", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5939966", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" } ]
8fe0b0ac169cc686649cc0dc99f8a95f
t is between 0 and m_Meshes.Length 1. / 0 means the first mesh, m_Meshes.Length 1 means the last mesh. / 0.5 means half of the first mesh and half of the second mesh.
[ { "docid": "d2fe6bb65faa2e18a232d986a81cac40", "score": "0.6766758", "text": "function SetMorph (t : float) { \n var floor : int = t; \n floor = Mathf.Clamp(floor, 0, m_Meshes.Length - 2); \n var fraction : float = t - floor; \n fraction = Mathf.Clamp(t - floor, 0.0, 1.0); \n SetComplexMorph (floor, floor + 1, fraction); \n}", "title": "" } ]
[ { "docid": "4de0352f28e64e7ec6dec8173bb93276", "score": "0.59778273", "text": "function createMeshes(){\r\n\r\n // делаем траву\r\n createPlane(200, 150, 0, 0, 0, -0.5, 0, 'images/grass3.jpg');\r\n // основная башня\r\n createRectangle(30, 66, 30, 0, 33, 0, 'images/bricks.jpg');\r\n // боковые пристройки\r\n createRectangle(70, 26, 4, -50, 13, 0, 'images/bricks.jpg');\r\n createRectangle(70, 26, 4, 50, 13, 0, 'images/bricks.jpg');\r\n // передняя пристройка\r\n createRectangle(18, 26, 16, 0, 13, 23, 'images/bricks.jpg');\r\n // пристройка сверху\r\n createRectangle(20, 16, 20, 0, 74, 0, 'images/bricks.jpg');\r\n // еще сверху\r\n createRectangle(10, 28, 10, 0, 84, 0, 'images/bricks.jpg');\r\n // пристраиваем конус\r\n createCone(4.5, 18, 12, 0, 106, 0, 0x00693A);\r\n // делаем звезду-шар\r\n createSphere(2, 3, 2, 0, 116, 0, 0xE40000);\r\n // делаем часики\r\n createPlane(10, 10, 0, 74, 10.1, 0, 0, 'images/Clock_cut.PNG');\r\n createPlane(10, 10, 0, 74, -10.1, 1, 0, 'images/Clock_cut.PNG');\r\n createPlane(10, 10, 10.1, 74, 0, 0, 0.5, 'images/Clock_cut.PNG');\r\n createPlane(10, 10, -10.1, 74, 0, 0, -0.5, 'images/Clock_cut.PNG');\r\n // делаем двери\r\n createPlane(10, 20, 0, 10, 31.1, 0, 0, 'images/doors.PNG');\r\n // делаем заборчики\r\n // правый\r\n for (let i = 18; i < 85; i+=5) {\r\n createRectangle(3, 4, 2, i, 28, 1, 'images/bricks.jpg');\r\n }\r\n // левый\r\n for (let i = -18; i > -85; i-=5) {\r\n createRectangle(3, 4, 2, i, 28, 1, 'images/bricks.jpg');\r\n }\r\n // передний спереди\r\n for (let i = -7.5; i < 11; i+=5) {\r\n createRectangle(3, 4, 2, i, 28, 30, 'images/bricks.jpg');\r\n }\r\n // боковые спереди\r\n for (let i = 26; i > 15; i-=5) {\r\n createRectangle(2, 4, 3, -8, 28, i, 'images/bricks.jpg');\r\n }\r\n\r\n for (let i = 26; i > 15; i-=5) {\r\n createRectangle(2, 4, 3, 8, 28, i, 'images/bricks.jpg');\r\n }\r\n\r\n // а теперь верхние 4 заборчика\r\n for (let i = -9.5; i < 10; i+=2) {\r\n createRectangle(1, 2, 1, i, 83, 9.5, 'images/wbricks.jpg');\r\n }\r\n\r\n for (let i = -9.5; i < 10; i+=2) {\r\n createRectangle(1, 2, 1, i, 83, -9.5, 'images/wbricks.jpg');\r\n }\r\n\r\n for (let i = -9.5; i < 10; i+=2.5) {\r\n createRectangle(1, 2, 1, -9.5, 83, i, 'images/wbricks.jpg');\r\n }\r\n\r\n for (let i = -9.5; i < 10; i+=2) {\r\n createRectangle(1, 2, 1, 9.5, 83, i, 'images/wbricks.jpg');\r\n }\r\n // добавим конусов\r\n createCone(2, 10, 4, -13, 71, 13, 0xF6F3F3);\r\n createCone(2, 10, 4, 13, 71, 13, 0xF6F3F3);\r\n createCone(2, 10, 4, 13, 71, -13, 0xF6F3F3);\r\n createCone(2, 10, 4, -13, 71, -13, 0xF6F3F3);\r\n\r\n \r\n}", "title": "" }, { "docid": "c6fd4d790996f3c2809e69a6178a581e", "score": "0.5659722", "text": "buildDefaultMeshes()\n {\n let quad = new Mesh(this.renderer.context, \"quad\");\n\n quad.vertices.push(new Vertex(-0.5, -0.5, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, -1.0, 0.0, 0.0), \n new Vertex( 0.5, -0.5, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, -1.0, 1.0, 0.0), \n new Vertex( 0.5, 0.5, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, -1.0, 1.0, 1.0),\n new Vertex(-0.5, 0.5, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, -1.0, 0.0, 1.0));\n\n quad.indices.push(0, 1, 2, \n 2, 3, 0)\n\n quad.build();\n }", "title": "" }, { "docid": "7003bc08ef7cca2dbdcd74fffca15ed5", "score": "0.56518453", "text": "render({ playhead, time, width, height }) {\n anim.forEach((m, i) => {\n m.mesh.position.y =\n m.y +\n 0.9 * Math.sin(playhead * 2 * Math.PI + (2 * Math.PI * i) / num);\n });\n\n anim1.forEach((m, i) => {\n m.mesh.position.y =\n m.y -\n 0.9 * Math.sin(playhead * 2 * Math.PI + (2 * Math.PI * i) / num);\n });\n\n gr.rotation.y = Math.PI * 2 * playhead;\n gr1.rotation.y = Math.PI * 2 * playhead;\n // left part\n renderer.setViewport(0, 0, width / 2, height);\n renderer.setScissor(0, 0, width / 2, height);\n renderer.render(scene, camera);\n // right part\n renderer.setViewport(width / 2, 0, width / 2, height);\n renderer.setScissor(width / 2, 0, width / 2, height);\n renderer.render(scene1, camera);\n\n //mesh.rotation.y = time * (10 * Math.PI / 100);\n controls.update();\n }", "title": "" }, { "docid": "1ad5136134e5089bc7976625660911f6", "score": "0.55489415", "text": "function initMeshes() \n{\n\ttroll.initBuffers(\"assets/meshes/troll.obj\");\n\ttroll.setTextures(\"assets/textures/colors.jpg\", \"assets/textures/specular.jpg\", \"assets/textures/normals.jpg\", \"assets/textures/skin_mask.jpg\");\n\ttroll.move (0.0, -60.0, -200.0);\n\t\n\tball.initBuffers(\"assets/meshes/ball.obj\");\n\tball.setTextures(\"assets/textures/fireball-red-DIFF.png\");\n\tball.move (50.0, 30.0, -150.0);\n}", "title": "" }, { "docid": "6800f4b00091437f34dbe760f93007a0", "score": "0.55275553", "text": "function r(t){return r$4(t.geometry)&&\"mesh\"===t.geometry.type?o(t.geometry):n(t)}", "title": "" }, { "docid": "753cb5780f884bcb4c84db850769e89d", "score": "0.5456926", "text": "getMeshes() {\n return this.core.graphics.getMeshes();\n }", "title": "" }, { "docid": "8690e8ce705dc68a6b71dcfd1bb2890d", "score": "0.54497784", "text": "function SetComplexMorph (srcIndex : int, dstIndex : int, t : float) { \n if (m_SrcMesh == srcIndex && m_DstMesh == dstIndex && Mathf.Approximately(m_Weight, t)) \n return; \n var v0 = m_Meshes[srcIndex].vertices; \n var v1 = m_Meshes[dstIndex].vertices; \n var vdst = new Vector3[m_Mesh.vertexCount]; \n for (var i:int =0; i<vdst.Length; i++) \n vdst[i] = Vector3.Lerp(v0[i], v1[i], t); \n \n m_Mesh.vertices = vdst; \n m_Mesh.RecalculateBounds(); \n}", "title": "" }, { "docid": "3ae96ae7bf4610336ae245b9474f289b", "score": "0.5449212", "text": "function joinM(m) { //fonction recursive qui parcourt le tableau des mesh selectionnés, et les lie entre-eux par fusion (merge);\n\n if (m <= 2) {\n // var newObj = new BABYLON.Mesh.MergeMeshes([selectedmeshes[i],selectedmeshes[i-1]],true); // cas de base, on merge l'objet pointé avec celui qui le précède.\n\n var newObj = new BABYLON.Mesh.MergeMeshes([selectedmeshes[m - 1], selectedmeshes[m - 2]], true);\n newObj.name = \" objet : \" + selectedmeshes[m].name + \".\" + selectedmeshes[m - 1].name;\n console.log(\"name : \" + newObj.name);\n //On réapplique des propriétés graphiques au nouvel objet créé.\n newObj.material.emissiveColor = new BABYLON.Color3(0, 1, 0); //la couleur \"emissive\" (pas influencée par l'éclairage) de l'objet est définie sur verte.\n newObj.actionManager = new BABYLON.ActionManager(scene);\n newObj.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOutTrigger, newObj.material, \"emissiveColor\", newObj.material.emissiveColor));\n newObj.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOverTrigger, newObj.material, \"emissiveColor\", BABYLON.Color3.White()));\n newObj.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOutTrigger, newObj, \"scaling\", new BABYLON.Vector3(newObj.scaling.x, newObj.scaling.y, newObj.scaling.z), 150));\n newObj.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOverTrigger, newObj, \"scaling\", new BABYLON.Vector3(newObj.scaling.x + newObj.scaling.x * 0.1, newObj.scaling.y + newObj.scaling.y * 0.1, newObj.scaling.z + newObj.scaling.z * 0.1), 150));\n\n newObj.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, light, \"diffuse\", BABYLON.Color3.White(), 1))\n .then(new BABYLON.CombineAction(BABYLON.ActionManager.NothingTrigger, [ // Then is used to add a child action used alternatively with the root action.\n new BABYLON.SetValueAction(BABYLON.ActionManager.NothingTrigger, newObj.material, \"wireframe\", false)\n ]));\n newObj.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, newObj.material, \"wireframe\", true)).then(new BABYLON.DoNothingAction());\n\n\n shadowGenerator.getShadowMap().renderList.push(newObj);\n //shadowGenerator2.getShadowMap().renderList.push(newObj);\n\n\n return newObj;\n } else { //si on n'est pas dans le cas de base alors on appelle la fonction\n return new BABYLON.Mesh.MergeMeshes([selectedmeshes[m], joinM(m - 1), true]);\n console.log(\"tour de boucle - m vaut : \" + m);\n\n }\n }", "title": "" }, { "docid": "f790299c2678ec33c7eff436a5e6052d", "score": "0.5449212", "text": "function joinM(m) { //fonction recursive qui parcourt le tableau des mesh selectionnés, et les lie entre-eux par fusion (merge);\n\n if (m <= 2) {\n // var newObj = new BABYLON.Mesh.MergeMeshes([selectedmeshes[i],selectedmeshes[i-1]],true); // cas de base, on merge l'objet pointé avec celui qui le précède.\n\n var newObj = new BABYLON.Mesh.MergeMeshes([selectedmeshes[m - 1], selectedmeshes[m - 2]], true);\n newObj.name = \" objet : \" + selectedmeshes[m].name + \".\" + selectedmeshes[m - 1].name;\n console.log(\"name : \" + newObj.name);\n //On réapplique des propriétés graphiques au nouvel objet créé.\n newObj.material.emissiveColor = new BABYLON.Color3(0, 1, 0); //la couleur \"emissive\" (pas influencée par l'éclairage) de l'objet est définie sur verte.\n newObj.actionManager = new BABYLON.ActionManager(scene);\n newObj.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOutTrigger, newObj.material, \"emissiveColor\", newObj.material.emissiveColor));\n newObj.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOverTrigger, newObj.material, \"emissiveColor\", BABYLON.Color3.White()));\n newObj.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOutTrigger, newObj, \"scaling\", new BABYLON.Vector3(newObj.scaling.x, newObj.scaling.y, newObj.scaling.z), 150));\n newObj.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOverTrigger, newObj, \"scaling\", new BABYLON.Vector3(newObj.scaling.x + newObj.scaling.x * 0.1, newObj.scaling.y + newObj.scaling.y * 0.1, newObj.scaling.z + newObj.scaling.z * 0.1), 150));\n\n newObj.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, light, \"diffuse\", BABYLON.Color3.White(), 1))\n .then(new BABYLON.CombineAction(BABYLON.ActionManager.NothingTrigger, [ // Then is used to add a child action used alternatively with the root action.\n new BABYLON.SetValueAction(BABYLON.ActionManager.NothingTrigger, newObj.material, \"wireframe\", false)\n ]));\n newObj.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, newObj.material, \"wireframe\", true)).then(new BABYLON.DoNothingAction());\n\n\n shadowGenerator.getShadowMap().renderList.push(newObj); //ajoute l'objet à la liste des objets produisant des ombresss\n shadowGenerator2.getShadowMap().renderList.push(newObj);\n shadowGenerator3.getShadowMap().renderList.push(newObj);\n shadowGenerator4.getShadowMap().renderList.push(newObj);\n\n\n return newObj;\n } else { //si on n'est pas dans le cas de base alors on appelle la fonction\n return new BABYLON.Mesh.MergeMeshes([selectedmeshes[m], joinM(m - 1), true]);\n console.log(\"tour de boucle - m vaut : \" + m);\n\n }\n }", "title": "" }, { "docid": "bda3e8735f605b8a7e6fa2e19c03211e", "score": "0.54229426", "text": "interpolate(t) {\n t = Num_1.Num.clamp(t, 0, 1);\n let chunk = this.length - 1;\n let tc = 1 / (this.length - 1);\n let idx = Math.floor(t / tc);\n return Num_1.Geom.interpolate(this[idx], this[Math.min(this.length - 1, idx + 1)], (t - idx * tc) * chunk);\n }", "title": "" }, { "docid": "afe92905cefe29accad87981e4fe15de", "score": "0.5362352", "text": "function animate() {\n\t//mesh.rotation.set(0, t / 3, 0);\n\t//teapot.position.set(30, 0, 0);\n\t//teapot.rotation.set(0, t / 3, t / 2);\n\t//teapotLined.rotation.set(0, t / 3, t/2);\n\t//teapotPhonged.rotation.set(0, t / 3, t / 2);\n\t//normalTea.rotation.set(0, t / 3, 0);\n\t/*s.set( 150, 1.2*t+1, 2*Math.sin(t) );\n\t\t\t\tlight.position.setFromSpherical( s );\n\t\t\t\t\n\t\t\t\ts.set( 150, -1.5*t+2, Math.sin(t+1) );\n\t\t\t\tlight2.position.setFromSpherical( s );\n\t\t\t\t\n\t\t\t\ts.set( 150, 1.7*t+3, Math.sin(t-1) );\n\t\t\t\tlight3.position.setFromSpherical( s );*/\n\t//teapotA.rotation.set( 1.2*Math.sin(t), t, 1.2*Math.cos(t/2) );\n\t//teapotB.rotation.set( 1.2*Math.sin(t), -t, 1.2*Math.cos(t/2) );\n}", "title": "" }, { "docid": "62387c51470c3eaa42ae1c1e3b6af1b8", "score": "0.5300968", "text": "function createHaloTrajectories() {\n\n console.log(\"\\tcreateHaloTrajectories()\");\n var periodTracker = {};\n var material = new THREE.LineBasicMaterial({\n color: rgbToHex(255, 255, 255),\n linewidth: 1,\n vertexColors: THREE.VertexColors,\n transparent: true,\n opacity: 0.7\n });\n\n var id, period;\n //console.log(\"\\tMaterial is..\", material, sphereGroup);\n // We can use the sphereGroup to drive the line creation\n sphereGroup.children.forEach(function(mesh) {\n\n //console.log(\"mesh\", mesh.name);\n\n if (mesh) {\n id = +mesh.name;\n period = +mesh.period;\n\n // console.log(\"mesh\", mesh.name, id, mesh.period, period);\n\n if (!periodTracker.hasOwnProperty(period))\n periodTracker[period] = material.clone();\n\n material = periodTracker[period];\n\n if (!__traversed.hasOwnProperty(id)) {\n var points = intoTheVoid(+id, [], 0);\n // console.log(\"\\tnot been traversed\", id, points.length, material)\n // console.log(\"gonna create some lines now\")\n if (points.length > 1) {\n var lineMesh = createPathLine(points, id, period, material);\n if (lineMesh)\n linesGroup.add(lineMesh);\n }\n\n //var arrowMesh = createPathArrow(points, points[0],points[1], period );\n //if (arrowMesh)\n // mapGroup.add(arrowMesh);\n }\n }\n });\n\n linesGroup.visible = config.showPaths;\n}", "title": "" }, { "docid": "60fef12bd85215feb91db0b784c4ae70", "score": "0.52558273", "text": "function loadMeshes() {\n\tmeshes.push(loadBackground());\n\n\t//meshes.push(initCubeBuffers());\n\n\tloadObjFile(\"../assets/Mug.obj\", \"obj\")\n\t\t.then(result => {\n\t\t\t beerMugMesh = createBufferFromData(result);\n\t\t\t meshes.push(beerMugMesh);\n\t\t\t for (let i = 0; i < NB_MUGS; i++) {\n\t\t\t\t loadMug();\n\t\t\t }\n\n\n\t\t\t loadObjFile(\"../assets/beerglass.obj\", \"obj\")\n\t\t\t\t .then(result => {\n\t\t\t\t\t let beerGlassMesh = createBufferFromData(result);\n\t\t\t\t\t meshes.push(beerGlassMesh);\n\t\t\t\t\t beerGlass = {\n\t\t\t\t\t\t name: \"beerGlass\",\n\t\t\t\t\t\t mesh: beerGlassMesh,\n\t\t\t\t\t\t translation: [0, -4.5, 0],\n\t\t\t\t\t\t //rotation: [0, Math.PI, 0],\n\t\t\t\t\t\t rotation: [0, 0, 0],\n\t\t\t\t\t\t scale: [0.006, 0.006, 0.006],\n\t\t\t\t\t\t material: Object.assign({}, materials.reflect)\n\t\t\t\t\t };\n\t\t\t\t\t beerGlass.material.useTexture = false;\n\t\t\t\t\t beerGlass.material.texture = textures.cubemap;\n\t\t\t\t\t beerGlass.material.alpha = 0.7;\n\n\t\t\t\t\t scene.push(beerGlass);\n\t\t\t\t }, error => alert(error)\n\t\t\t\t );\n\t\t }, error => alert(error)\n\t\t);\n}", "title": "" }, { "docid": "ef29035d7fdd625e89239e0bfc4f010e", "score": "0.5254579", "text": "computeMesh(){\n\n\t\t// Number of point in width and height\n\t\tlet nW = Math.floor(window.innerWidth / config.bg.precision) + 1;\n\t\tlet nH = Math.floor(window.innerHeight / config.bg.precision) + 1;\n\n\t\t// Total width and height for faces\n\t\tlet calcW = nW * config.bg.precision; \n\t\tlet calcH = nH * config.bg.precision; \n\n\t\tthis.points = [];\n\t\t\t\n\t\t// Compute the scaled size of a particule and create geometry\n\t\tlet wParticule = 1/window.innerWidth*2\n\t\tlet hParticule = 1/window.innerHeight*2\n\t\tlet geometry = new Polygon(3, wParticule, hParticule).points;\n\n\t\t// Loop and compute each point position\n\t\tfor(var i=0; i<nW; i++)\n\t\tfor(var j=0; j<nH; j++)\n\t\t\tthis.points.push([ \n\t\t\t\ti*config.bg.precision/calcW * 2 - 1, \n\t\t\t\tj*config.bg.precision/calcH * 2 - 1 \n\t\t\t]);\n\n\n\t\t// The buffers\n\t\tvar bufferLocalPosition = [];\n\t\tvar bufferPosition = [];\n\t\tvar animationDelay = [];\n\t\tvar animationDuration = [];\n\t\tvar weights = [];\n\n\t\tvar delay, weight, duration; \n\n\t\t// Loop in each point and compute buffers\n\t\tfor(var i=0; i<this.points.length; i++){\n\t\t\t// The position of each vertex in instance geometry\n\t\t\tbufferLocalPosition.push(\n\t\t\t\t[geometry[0].x, geometry[0].y],\n\t\t\t\t[geometry[1].x, geometry[1].y],\n\t\t\t\t[geometry[2].x, geometry[2].y]\n\t\t\t);\n\n\t\t\tdelay = Math.random()*500 + 400;\n\t\t\tanimationDelay.push( delay, delay, delay)\n\t\t\n\t\t\tduration = Math.random()*300 + 200;\n\t\t\tanimationDuration.push(duration, duration, duration)\n\n\t\t\tweight = Math.random()*6+3;\n\t\t\tweights.push(weight, weight, weight)\n\n\t\t\t// The position of instance\n\t\t\tbufferPosition.push( this.points[i], this.points[i], this.points[i] );\n\t\t}\n\n\t\t// Store mesh info\n\t\tthis.meshInfo = {\n\t\t\tposition: bufferPosition,\n\t\t\tlocalPosition: bufferLocalPosition,\n\t\t\tdelays: animationDelay,\n\t\t\tdurations: animationDuration,\n\t\t\tweights : weights\n\t\t}\n\t\n\t}", "title": "" }, { "docid": "00a7d8021eb7dc54ef506cce1aff8cf6", "score": "0.52363575", "text": "updatePosition(t) {\n // Update the position of the satellite in the scene\n this.mesh.position.copy(this.position(t));\n\n // Compute the line of sight segment end points\n const points = [this.mesh.position, this.ground_station.mesh.position];\n\n // Update the line of sight segment\n this.los_geom.setFromPoints( points );\n\n // Compute dot product of ground station position and line of sight vector\n const dot_prod_result = this.ground_station.mesh.position.dot(\n this.mesh.position.clone().sub(this.ground_station.mesh.position));\n\n // Update line of sight segment visibility\n this.los.visible = dot_prod_result >= 0.0 ? true : false;\n }", "title": "" }, { "docid": "dfcb5dabbc97efd2d6f110d43396397e", "score": "0.52132076", "text": "getmesh() {\n\n return (this.animations.getanimation());\n\n }", "title": "" }, { "docid": "e44d3d4030464718017f0b7fb020341d", "score": "0.5192707", "text": "function addMesh(t) { // color, url, caption\n\n// continue only if the mesh is new\n var _mesh = new X.mesh();\n var _idx=meshs.length;\n//\n var _color= t['color'];\n if(_color == undefined) {\n _color=getDefaultColor(_idx);\n t['color']=_color;\n }\n _mesh.color = _color;\n//\n var _url=t['url'];\n if(_url == undefined) {\n throw new Error(\"mesh must have an url!\");\n }\n if(typeof _url == \"object\") { // this is a local file\n if( _url instanceof File) {\n _mesh.file = _url.name;\n readLocal2Mesh(_mesh,_url);\n // reset _url\n _url=_url.name;\n t['url']=_url;\n } else {\n throw new Error(\"local mesh must be a File object type!\");\n }\n } else {\n _mesh.file = safeEncodeURI(_url);\n }\n//\n var _label = getLabel(t);\n var _href = getHref(t);\n//\n var _caption = t['caption'];\n if(_caption == undefined) {\n _caption = { 'description':_label,'link':_href };\n t['caption']=_caption;\n }\n _mesh.caption=_caption;\n//\n var _opacity=t['opacity'];\n if(_opacity == undefined) {\n _opacity=1;\n t['opacity']=_opacity;\n }\n _mesh.opacity = _opacity;\n//\n var _id=t['id']; \n if(_id == undefined) {\n // reuse label\n _id=_label;\n t['id']=_id;\n }\n _mesh.id= _id;\n//\n\n// if the label already exists, then alter the name\n// still allow it in order for user to test 'alignment'\n var tmp=lookupMeshByID(_id);\n if(tmp) {\n var r=randomString(4);\n _id=_id+\"_\"+r;\n _label=_label+\" \"+r;\n t['id']=_id;\n t['label']=_label;\n }\n\n var loadingDiv = document.getElementById('loading');\n loadingDiv.style.display ='';\n ren3d.add(_mesh);\n\n// meshs[0] is the _mesh, meshs[1] is the original object\n var _cnt=meshs.push([_mesh,t]);\n var _name=_id.toString();\n \n addMeshListEntry(_label,_name,_idx,_color,_opacity,_href);\n}", "title": "" }, { "docid": "d80fc7f43955ef4f00d2b22d063b7955", "score": "0.51849884", "text": "updateTangentSpace() {\n // Clear the arrays and Start them at (0,0,0) so they can accumulate values\n this.tangents = [];\n this.binormals = [];\n for (let n of this.normals) {\n gl_matrix_11.vec3.normalize(n, n); // make sure normals are normalized\n this.tangents.push(gl_matrix_11.vec3.create());\n this.binormals.push(gl_matrix_11.vec3.create());\n }\n // Since the basis vectors will be unit length, just\n // keep adding them in. When we normalize at the end,\n // it will work the same way as averageing over the\n // face edges\n for (let t of this.triangles) {\n let v0 = this.vertices[t[0]];\n let v1 = this.vertices[t[1]];\n let v2 = this.vertices[t[2]];\n let uv0 = this.uvs[t[0]];\n let uv1 = this.uvs[t[1]];\n let uv2 = this.uvs[t[2]];\n // Compute intermediate values\n let q1 = gl_matrix_11.vec3.create();\n let q2 = gl_matrix_11.vec3.create();\n gl_matrix_11.vec3.subtract(q1, v1, v0);\n gl_matrix_11.vec3.subtract(q2, v2, v0);\n let s1 = uv1[0] - uv0[0];\n let s2 = uv2[0] - uv0[0];\n let t1 = uv1[1] - uv0[1];\n let t2 = uv2[1] - uv0[1];\n // Compute basis vectors for this triangle\n let tangent = gl_matrix_11.vec3.create();\n let binormal = gl_matrix_11.vec3.create();\n let temp1 = gl_matrix_11.vec3.create();\n let temp2 = gl_matrix_11.vec3.create();\n gl_matrix_11.vec3.scale(temp1, q1, t2);\n gl_matrix_11.vec3.scale(temp2, q2, t1);\n gl_matrix_11.vec3.subtract(tangent, temp1, temp2);\n gl_matrix_11.vec3.normalize(tangent, tangent);\n gl_matrix_11.vec3.scale(temp1, q1, -s2);\n gl_matrix_11.vec3.scale(temp2, q2, s1);\n gl_matrix_11.vec3.add(binormal, temp1, temp2);\n gl_matrix_11.vec3.normalize(binormal, binormal);\n // Accumulate them into the running sums\n for (let i = 0; i < 3; ++i) {\n let currentTangent = this.tangents[t[i]];\n let currentBinormal = this.binormals[t[i]];\n gl_matrix_11.vec3.add(temp1, currentTangent, tangent);\n gl_matrix_11.vec3.add(temp2, currentBinormal, binormal);\n // Avoid zeroing out the tangent/binormal\n if (gl_matrix_11.vec3.length(temp1) > 0.01) {\n gl_matrix_11.vec3.add(currentTangent, currentTangent, tangent);\n }\n if (gl_matrix_11.vec3.length(temp2) > 0.01) {\n gl_matrix_11.vec3.add(currentBinormal, currentBinormal, binormal);\n }\n }\n }\n // Finally, normalize all the vectors to average\n // across triangle boundaries\n // Also put the tangents and bitangents into the flat format OpenGL likes\n let glTangents = [];\n let glBinormals = [];\n let vertexCount = this.vertices.length;\n for (let i = 0; i < vertexCount; ++i) {\n let currentNormal = this.normals[i];\n let currentTangent = this.tangents[i];\n let currentBinormal = this.binormals[i];\n // Ensure tangent is perpendicular to the normal\n let temp = gl_matrix_11.vec3.create();\n gl_matrix_11.vec3.scale(temp, currentNormal, gl_matrix_11.vec3.dot(currentTangent, currentNormal));\n gl_matrix_11.vec3.subtract(currentTangent, currentTangent, temp);\n gl_matrix_11.vec3.normalize(currentTangent, currentTangent);\n // Ensure binormal is perpendicular to the normal\n gl_matrix_11.vec3.scale(temp, currentNormal, gl_matrix_11.vec3.dot(currentBinormal, currentNormal));\n gl_matrix_11.vec3.subtract(currentBinormal, currentBinormal, temp);\n gl_matrix_11.vec3.normalize(currentBinormal, currentBinormal);\n // Normalize both\n glTangents.push(currentTangent[0], currentTangent[1], currentTangent[2]);\n glBinormals.push(currentBinormal[0], currentBinormal[1], currentBinormal[2]);\n }\n // Feed the data into the WebGL buffers\n rasterize_13.gl.bindBuffer(rasterize_13.gl.ARRAY_BUFFER, this.tangentBuffer); // activate that buffer\n rasterize_13.gl.bufferData(rasterize_13.gl.ARRAY_BUFFER, new Float32Array(glTangents), rasterize_13.gl.STATIC_DRAW); // data in\n rasterize_13.gl.bindBuffer(rasterize_13.gl.ARRAY_BUFFER, this.binormalBuffer); // activate that buffer\n rasterize_13.gl.bufferData(rasterize_13.gl.ARRAY_BUFFER, new Float32Array(glBinormals), rasterize_13.gl.STATIC_DRAW); // data in\n }", "title": "" }, { "docid": "2f2ce86624eb4655ffcd1b176713c93c", "score": "0.5172112", "text": "removeMeshes () {\n this._meshes.forEach((mesh) => {\n this._scene.remove(mesh);\n });\n this._meshes = [];\n }", "title": "" }, { "docid": "8e9b379b85e720cf05d0d8208dfe4c18", "score": "0.5158986", "text": "update(t) {\r\n this.checkKeys();\r\n if(this.last_t_fish > 0){\r\n this.fish.update((t-this.last_t_fish)/1000.0);\r\n }\r\n this.last_t_fish = t;\r\n if(this.last_t_mvobj > 0){\r\n this.movingObject.update((t-this.last_t_mvobj)/1000.0);\r\n }\r\n this.last_t_mvobj = t;\r\n \r\n // Dividing the time by 100 \"slows down\" the variation (i.e. in 100 ms timeFactor increases 1 unit).\r\n // Doing the modulus (%) by 100 makes the timeFactor loop between 0 and 99\r\n // ( so the loop period of timeFactor is 100 times 100 ms = 10s ; the actual animation loop depends on how timeFactor is used in the shader )\r\n this.testShaders[1].setUniformsValues({ timeFactor: t / 100 % 100 });\r\n this.testShaders[2].setUniformsValues({ timeFactor: t / 100 % 100 });\r\n this.testShaders[4].setUniformsValues({ timeFactor: t / 100 % 100 });\r\n \r\n if(this.fish.pos[0] > 4 && this.fish.pos[0] < 8 && this.fish.pos[2] > 4 && this.fish.pos[2] < 8 )\r\n this.sea_elements.update(Math.PI/18);\r\n else \r\n this.sea_elements.reset();\r\n\r\n if(this.displayAnimatedFish)\r\n this.sea_elements.update_anim_fish(t);\r\n }", "title": "" }, { "docid": "a068bcabf22982a596db8f78c24ede8a", "score": "0.5136245", "text": "initTrainerMeshes(){\n\t\tthis.active.forEach(p =>this.mesh.add(p.mesh))\n\t}", "title": "" }, { "docid": "b95a18bfb45215c127c9e7534cfe3b1e", "score": "0.51351875", "text": "function updateStats(data) {\n\t if (!_.isUndefined(myThis.statsMeshes)) {\t \n\t\tscene.remove(myThis.statsMeshes[0]);\n\t\tscene.remove(myThis.statsMeshes[1]);\n\t\tscene.remove(myThis.statsMeshes[2]);\n\t\tscene.remove(myThis.statsMeshes[3]);\n\t\trenderer.render(scene, camera);\n\t }\n\n\t // data.stats.score\n\t var statsMaterial = new THREE.MeshPhongMaterial({color: 0x99FF00});\n\t var statsGeometry = new THREE.TextGeometry(data.stats.score, {\n\t\tsize: 0.6,\n\t\theight: 0.1,\n\t\tfont: 'libre baskerville'\n\t });\n\t var statsMesh = new THREE.Mesh(statsGeometry, statsMaterial);\n\t statsMesh.position.set(10, -4.7, 0);\n\t scene.add(statsMesh);\n\t myThis.statsMeshes[0] = statsMesh;\n\t // data.stats.highestWordStreak\n\t var statsMaterial = new THREE.MeshPhongMaterial({color: 0x99FF00});\n\t var statsGeometry = new THREE.TextGeometry(data.stats.highestWordStreak, {\n\t\tsize: 0.6,\n\t\theight: 0.1,\n\t\tfont: 'libre baskerville'\n\t });\n\t var statsMesh = new THREE.Mesh(statsGeometry, statsMaterial);\n\t statsMesh.position.set(10, -5.7, 0);\n\t scene.add(statsMesh);\n\t myThis.statsMeshes[1] = statsMesh;\n\t // data.stats.success\n\t var statsMaterial = new THREE.MeshPhongMaterial({color: 0x99FF00});\n\t var statsGeometry = new THREE.TextGeometry(data.stats.success, {\n\t\tsize: 0.6,\n\t\theight: 0.1,\n\t\tfont: 'libre baskerville'\n\t });\n\t var statsMesh = new THREE.Mesh(statsGeometry, statsMaterial);\n\t statsMesh.position.set(10, -6.7, 0);\n\t scene.add(statsMesh);\n\t myThis.statsMeshes[2] = statsMesh;\n\t // data.stats.errors\n\t var statsMaterial = new THREE.MeshPhongMaterial({color: 0x99FF00});\n\t var statsGeometry = new THREE.TextGeometry(data.stats.errors, {\n\t\tsize: 0.6,\n\t\theight: 0.1,\n\t\tfont: 'libre baskerville'\n\t });\n\t var statsMesh = new THREE.Mesh(statsGeometry, statsMaterial);\n\t statsMesh.position.set(10, -7.7, 0);\n\t scene.add(statsMesh);\n\t myThis.statsMeshes[3] = statsMesh;\n\t renderer.render(scene, camera);\n\t}", "title": "" }, { "docid": "3b0d08c6bc0fe39503cfe84d0225adb2", "score": "0.5130581", "text": "subdivideLinear() {\n let mesh = this.subdivideTopological();\n // TODO: Fill this in\n return mesh;\n }", "title": "" }, { "docid": "b650afc42539cd47b09fc0b7525653f3", "score": "0.51266", "text": "constructor(mesh, normals = false) {\n\n // Throw an error if mesh value is not a Mesh\n validate({ mesh }, 'Mesh');\n\n // Determine the name of the mesh\n const name = (mesh.label) ? mesh.label.replace(/( )/ig, '_') : `Mesh_${Date.now()}`;\n\n // Create a string for the output\n let content = `# Scale = meters\\ng ${name}\\no ${name}\\n`;\n\n // Iterate through each of the vertices\n for (const vertex of mesh.vertices) {\n\n // Extract the vertex components\n const [x, y, z] = vertex;\n\n // Add the vertex to the output (6dp)\n content += `v ${x} ${y} ${z}\\n`;\n\n // Check if normals are to be added\n if (normals) {\n\n // Extract the vertex normal components\n const [xn, yn, zn] = vertex.normal;\n\n // Add the vertex normals to the output (6dp)\n content += `vn ${xn} ${yn} ${zn}\\n`;\n }\n }\n\n // Iterate through each of the faces\n for (const face of mesh.faces) {\n\n // Extract each of the indices (+1)\n const [a, b, c] = face.map(i => (i + 1));\n\n // Check if normals are to be added\n if (normals) {\n\n // Add the face vertices with normals to the output\n content += `f ${a}//${a} ${b}//${b} ${c}//${c}\\n`;\n\n } else {\n\n // Add the face vertices to the output\n content += `f ${a} ${b} ${c}\\n`;\n }\n }\n \n // Return the name and content\n return {\n filename: `${name}.obj`,\n content\n };\n }", "title": "" }, { "docid": "bfabfe81fd38540bc9d4110ba78013a3", "score": "0.5115117", "text": "function dung1LoadedCallback(geometry){\r\n\tdungTexture = textureLoader.load('images/poop4.jpg');\r\n dungMaterial = new THREE.MeshBasicMaterial({map: dungTexture});\r\n var dungObject = new THREE.Mesh(geometry, dungMaterial);\r\n dungObject.scale.set(0.1, 0.1, 0.1);\r\n clone1 = dungObject.clone();\r\n clone2 = dungObject.clone();\r\n clone3 = dungObject.clone();\r\n clone4 = dungObject.clone();\r\n var dung = new GatherItem('points', 100, 'dung', false, true);\r\n dung.createBoxMesh(new THREE.Vector3(0.5, 0.5, 0.5), new THREE.Vector3(5.40,1,-22.80), null, 1, 1, 0.1);\r\n dung.mesh.add(clone1);\r\n dungs.push(dung);\r\n var dung = new GatherItem('points', 100, 'dung', false, true);\r\n dung.createBoxMesh(new THREE.Vector3(0.5, 0.5, 0.5), new THREE.Vector3(-23.20,1,18.20), null, 1, 1, 0.1);\r\n dung.mesh.add(clone2);\r\n dungs.push(dung);\r\n var dung = new GatherItem('points', 100, 'dung', false, true);\r\n dung.createBoxMesh(new THREE.Vector3(0.5, 0.5, 0.5), new THREE.Vector3(-16.20,1,18.20), null, 1, 1, 0.1);\r\n dung.mesh.add(clone3);\r\n dungs.push(dung);\r\n var dung = new GatherItem('points', 100, 'dung', false, true);\r\n dung.createBoxMesh(new THREE.Vector3(0.5, 0.5, 0.5), new THREE.Vector3(-5.40,1,12.60), null, 1, 1, 0.1);\r\n dung.mesh.add(clone4);\r\n dungs.push(dung);\r\n \r\n}", "title": "" }, { "docid": "c0be64c03236376712fbaa881d12a971", "score": "0.51096654", "text": "getAllMeshes() {\n return this.core.graphics.getMeshes();\n }", "title": "" }, { "docid": "e4a0d5d1607ae4cbb74ac7a8221e4daf", "score": "0.510603", "text": "function SpinTopMap3() { //Spintop enemy data for Map 3\n\n //Load SpinTop Enemy Model\n var spinToplist3 = [];\nvar loader = new THREE.GLTFLoader();\nloader.load('./3DObjects/Enemy/scene.gltf', function(gltf){\n var poison1 = gltf.scene.getObjectByName(\"mesh_1\");\n var poison2 = gltf.scene.getObjectByName(\"mesh_3\");\n var poison3 = gltf.scene.getObjectByName(\"mesh_0\");\n var poison4 = gltf.scene.getObjectByName(\"mesh_4\");\n\n var parent1 = poison4.parent;\n parent1.remove( poison1 );\n parent1.remove( poison2 );\n parent1.remove( poison3 );\n parent1.remove( poison4 );\n\n gltf.scene.scale.set(2.5,2.5,2.5);\n\n //Cast and receive a shadow on the model\n gltf.scene.traverse (function (node){\n if (node instanceof THREE.Mesh){\n node.castShadow = true;\n node.receiveShadow = true;\n node.material.metalness = 0;\n }\n });\n\n spinTop1 = gltf.scene;\n spinTop1.position.x = -1330;\n spinTop1.position.y = 259.9;\n spinTop1.position.z = 1000;\n\n scene.add(spinTop1);\n EnemyList.push(spinTop1);\n spinToplist3.push(spinTop1);\n\n spinTop2 = gltf.scene.clone();\n spinTop2.position.x = -1070;\n spinTop2.position.y = 259.9;\n spinTop2.position.z = 1000;\n\n scene.add(spinTop2);\n EnemyList.push(spinTop2);\n spinToplist3.push(spinTop2);\n\n spinTop3 = gltf.scene.clone();\n spinTop3.position.x = -420;\n spinTop3.position.y = 210;\n spinTop3.position.z = 950;\n\n scene.add(spinTop3);\n EnemyList.push(spinTop3);\n spinToplist3.push(spinTop3);\n\n spinTop4 = gltf.scene.clone();\n spinTop4.position.x = -420;\n spinTop4.position.y = 210;\n spinTop4.position.z = 1060;\n\n scene.add(spinTop4);\n EnemyList.push(spinTop4);\n spinToplist3.push(spinTop4);\n\n spinTop5 = gltf.scene.clone();\n spinTop5.position.x = -200;\n spinTop5.position.y = 210;\n spinTop5.position.z = 960;\n\n scene.add(spinTop5);\n EnemyList.push(spinTop5);\n spinToplist3.push(spinTop5);\n\n spinTop6 = gltf.scene.clone();\n spinTop6.position.x = -1170;\n spinTop6.position.y = 259.9;\n spinTop6.position.z = 980;\n\n scene.add(spinTop6);\n EnemyList.push(spinTop6);\n spinToplist3.push(spinTop6);\n\n spinTop7 = gltf.scene.clone();\n spinTop7.position.x = -1500;\n spinTop7.position.y = 259.9;\n spinTop7.position.z = 1070;\n\n scene.add(spinTop7);\n EnemyList.push(spinTop7);\n spinToplist3.push(spinTop7);\n\n spinTop8 = gltf.scene.clone();\n spinTop8.position.x = -1240;\n spinTop8.position.y = 259.9;\n spinTop8.position.z = 935;\n\n scene.add(spinTop8);\n EnemyList.push(spinTop8);\n spinToplist3.push(spinTop8);\n\n spinTop9 = gltf.scene.clone();\n spinTop9.position.x = -1130;\n spinTop9.position.y = 259.9;\n spinTop9.position.z = 1060;\n\n scene.add(spinTop9);\n EnemyList.push(spinTop9);\n spinToplist3.push(spinTop9);\n\n });\n\n}", "title": "" }, { "docid": "9072fd3b3d3597dd8ad0a1f381826dd9", "score": "0.509547", "text": "interpolate(other, t) {\n return new Vertex(this.pos.clone().lerp(other.pos, t), this.normal.clone().lerp(other.normal, t), this.uv.clone().lerp(other.uv, t), this.color && other.color && this.color.clone().lerp(other.color, t));\n }", "title": "" }, { "docid": "a55a88d7848f7b0610c8a4ab1e697c1f", "score": "0.507315", "text": "function createMeshes() {\r\n // MESHES\r\n let r = options.r, radius = options.r;\r\n \r\n // cube\r\n /*\r\n let cs = 0.5;\r\n const cubeGeometry = new THREE.BoxBufferGeometry( cs,cs,cs );\r\n //const material = new THREE.MeshStandardMaterial( { color: 0x800080 } ); \r\n let cubeMaterialArray = []; // order to add materials: x+,x-,y+,y-,z+,z-\t\r\n\tcubeMaterialArray.push( new THREE.MeshStandardMaterial( { color: 0xff3333 } ) );\r\n\tcubeMaterialArray.push( new THREE.MeshStandardMaterial( { color: 0xff8800 } ) );\r\n\tcubeMaterialArray.push( new THREE.MeshStandardMaterial( { color: 0xffff33 } ) );\r\n\tcubeMaterialArray.push( new THREE.MeshStandardMaterial( { color: 0x33ff33 } ) );\r\n\tcubeMaterialArray.push( new THREE.MeshStandardMaterial( { color: 0x3333ff } ) );\r\n\tcubeMaterialArray.push( new THREE.MeshStandardMaterial( { color: 0x8833ff } ) );\r\n \r\n let cube = new THREE.Mesh( cubeGeometry, cubeMaterialArray );\r\n cube.name = 'cube';\r\n //cube.translateX(-1);\r\n //cube.translateY(0.25);\r\n cube.position.set(0, 0, 0);\r\n //scene.add( cube );\r\n */ \r\n \r\n // CELESTIAL SPHERE \r\n\tlet sphereGeometry = new THREE.SphereGeometry( options.r, 32, 32 );\t\r\n\tlet sphereMaterial = new THREE.MeshLambertMaterial( {color: 0x000000, transparent: true, opacity: 0.1, reflectivity: 0 }); \r\n\tlet celSphere = new THREE.Mesh(sphereGeometry, sphereMaterial);\r\n\tcelSphere.position.set( 0, 0, 0 );\r\n\tscene.add( celSphere );\r\n celSphere.name = 'celestial sphere';\r\n celSphere.renderOrder = 1; // three.js handles transperency in a funny way for computational reasons ... this seems to help\r\n\r\n // GROUND \r\n let groundGeometry = new THREE.CylinderBufferGeometry( options.r, options.r, 0.03, 32 );\r\n let groundMeshMaterial_param = { color: 0x006600,transparent:true,opacity:1, reflectivity: 0 }; \r\n let groundMeshMaterial_param2 = { color: 0x002200,transparent:true,opacity:1, reflectivity: 0 };\r\n \t\r\n let groundMaterialArray = []; // order to add materials: side, top, bottom // BasicMaterial is the non-shiny version\r\n\tgroundMaterialArray.push( new THREE.MeshBasicMaterial( groundMeshMaterial_param ) );\r\n\tgroundMaterialArray.push( new THREE.MeshBasicMaterial( groundMeshMaterial_param ) );\r\n\tgroundMaterialArray.push( new THREE.MeshBasicMaterial( groundMeshMaterial_param2 ) );\r\n //let groundMaterial = new THREE.MeshBasicMaterial( { color: 0x00ff00 } ); \r\n let ground = new THREE.Mesh( groundGeometry, groundMaterialArray );\r\n ground.name = 'horizon';\r\n scene.add(ground); \r\n \r\n // HORIZON PERSON\r\n let person = new THREE.Group();\r\n let personMaterial = new THREE.MeshBasicMaterial( { color:'black' } );\r\n let personMaterial2 = new THREE.MeshBasicMaterial( { color:'white' } );\r\n let yVec = new THREE.Vector3(0,1,0);\r\n let xVec = new THREE.Vector3(1,0,0);\r\n let zVec = new THREE.Vector3(0,0,1);\r\n \r\n // body\r\n let bodyGeo = new THREE.CylinderBufferGeometry( 0.08, 0.1, 0.9, 32 ); \r\n let body = new THREE.Mesh( bodyGeo, personMaterial );\r\n \r\n // left leg\r\n let q1 = 15*Math.PI/180;\r\n let llegGeo = new THREE.CylinderBufferGeometry( 0.1,0.08,1,32 );\r\n let lleg = new THREE.Mesh( llegGeo, personMaterial );\r\n lleg.rotateZ(-q1);\r\n lleg.translateOnAxis(yVec,-0.8);\r\n lleg.translateOnAxis(xVec,0.055);\r\n \r\n // right leg\r\n let rlegGeo = new THREE.CylinderBufferGeometry( 0.1,0.08,1,32 );\r\n let rleg = new THREE.Mesh( rlegGeo, personMaterial );\r\n rleg.rotateZ(q1);\r\n rleg.translateOnAxis(yVec,-0.8);\r\n rleg.translateOnAxis(xVec,-0.055);\r\n \r\n // left arm\r\n let q2 = 65*Math.PI/180;\r\n let larmGeo = new THREE.CylinderBufferGeometry( 0.09,0.07,0.6,32 );\r\n let larm = new THREE.Mesh( larmGeo, personMaterial );\r\n larm.rotateZ(-q2);\r\n larm.translateOnAxis(xVec,-0.22);\r\n larm.translateOnAxis(yVec,-0.23);\r\n \r\n // right arm\r\n let rarmGeo = new THREE.CylinderBufferGeometry( 0.09,0.07,.5,32 );\r\n let rarm = new THREE.Mesh( rarmGeo, personMaterial );\r\n rarm.rotateZ(q2);\r\n rarm.translateOnAxis(xVec,0.22);\r\n rarm.translateOnAxis(yVec,-0.18);\r\n \r\n // head (2 parts )\r\n let headGeo1 = new THREE.TorusBufferGeometry( 0.225, 0.08, 32, 50 );\r\n let head1 = new THREE.Mesh( headGeo1, personMaterial );\r\n head1.translateOnAxis(yVec,0.65);\r\n \r\n // head (2 parts )\r\n let headGeo2 = new THREE.CylinderBufferGeometry( 0.225, 0.225, .03, 32 );\r\n let head2 = new THREE.Mesh( headGeo2, personMaterial2 );\r\n head2.rotateX(Math.PI/2);\r\n head2.translateOnAxis(zVec,-0.65);\r\n \r\n person.add( body );\r\n person.add( lleg );\r\n person.add( rleg );\r\n person.add( larm );\r\n person.add( rarm );\r\n person.add( head1 );\r\n person.add( head2 );\r\n person.translateY(1.38);\r\n scene.add( person );\r\n person.name = 'person'; \r\n \r\n // MERIDIAN and EW CIRCLE\r\n let geometry_mer = new THREE.TorusBufferGeometry( options.r, 0.04, 16, 100 );\r\n let material_mer = new THREE.MeshBasicMaterial( { color: 0x000000,transparent:true,opacity:0.5 } );\r\n let torus_mer = new THREE.Mesh( geometry_mer, material_mer ); \r\n torus_mer.rotateY(Math.PI/2); \r\n scene.add( torus_mer );\r\n torus_mer.name = 'meridian';\r\n \r\n // MERIDIAN and EW CIRCLE\r\n let geometry_mer2 = new THREE.TorusBufferGeometry( options.r, 0.04, 16, 100 );\r\n let material_mer2 = new THREE.MeshBasicMaterial( { color: 0x000000,transparent:true,opacity:0.15 } );\r\n let torus_mer2 = new THREE.Mesh( geometry_mer2, material_mer2 ); \r\n // torus is drawn the xy plane -- no need to rotate this time\r\n scene.add( torus_mer2 );\r\n torus_mer2.name = 'meridian2';\r\n \r\n // POLES\r\n let pole_Zenith = new THREE.Group();\r\n \r\n let poleMaterial = new THREE.MeshBasicMaterial( { color:'black',transparent:true,opacity:0.5,side: THREE.DoubleSide } );\r\n let poleGeometry = new THREE.CylinderBufferGeometry( 0.04, 0.04, 1.5, 32 ); \r\n let poleZenith = new THREE.Mesh( poleGeometry, poleMaterial );\r\n poleZenith.translateY(0.75);\r\n \r\n let poleGeometry2 = new THREE.CircleBufferGeometry( 0.25, 32 ); \r\n let poleCircle = new THREE.Mesh( poleGeometry2, poleMaterial );\r\n poleCircle.rotateX(Math.PI/2);\r\n \r\n pole_Zenith.add(poleZenith);\r\n pole_Zenith.add(poleCircle);\r\n pole_Zenith.name = 'zenith';\r\n \r\n pole_Zenith.translateY(options.r+0.05);\r\n scene.add( pole_Zenith );\r\n \r\n let pole_Nadir = new THREE.Group();\r\n let poleNadir = new THREE.Mesh( poleGeometry, poleMaterial );\r\n poleNadir.translateY(-0.75);\r\n \r\n let poleCircle2 = new THREE.Mesh( poleGeometry2, poleMaterial );\r\n poleCircle2.rotateX(Math.PI/2);\r\n \r\n pole_Nadir.add(poleNadir);\r\n pole_Nadir.add(poleCircle2);\r\n \r\n pole_Nadir.translateY(-options.r-0.05);\r\n scene.add( pole_Nadir );\r\n pole_Nadir.name = 'nadir';\r\n \r\n // CREATE STAR\r\n createStarMesh();\r\n \r\n // CREATE SPHERE TEXT\r\n createSphereText();\r\n}", "title": "" }, { "docid": "2c7ef073da9a27cf4df3190c892e01f1", "score": "0.5064485", "text": "function continueAddTubes() {\n var limit = 100;\n\n while (t < addParams.end && limit > 0) {\n t = t + addParams.step;\n if (t > addParams.end) { t = addParams.end; };\n\n var next = f(t);\n\n if (!isFinite(next.x) || !isFinite(next.y) || !isFinite(next.z)) {\n warnInfinityIgnored();\n last = next;\n lastt = t;\n continue;\n\n }\n\n boundingBox.expandByPoint(next);\n\n var curve = new THREE.LineCurve3(last, next);\n\n var innerGeometry = new THREE.TubeGeometry(curve, 1, innerThickness, 4, false);\n innerGeometry.dynamic = true;\n var innerMesh = new THREE.Mesh(innerGeometry, new THREE.MeshBasicMaterial({ color: innerColor, opacity: innerOpacity, transparent: true }));\n\n var outerGeometry = new THREE.TubeGeometry(curve, 1, outerThickness, 4, false);\n outerGeometry.dynamic = true;\n var outerMesh = new THREE.Mesh(outerGeometry, new THREE.MeshBasicMaterial({ color: outerColor, opacity: outerOpacity, transparent: true }));\n\n scene.add(innerMesh);\n scene.add(outerMesh);\n\n // register segments\n outerMesh.begin = lastt;\n outerMesh.end = t;\n outerMesh.step = addParams.step;\n outerMesh.inner = innerMesh;\n innerMesh.outer = outerMesh;\n tapSegments.push(outerMesh);\n\n last = next;\n lastt = t;\n limit--;\n }\n\n if (t >= addParams.end) { finishAddTubes(); }\n}", "title": "" }, { "docid": "241c7adf330610ae283ae496697f0039", "score": "0.5047783", "text": "constructor(mesh, options){\n this.mesh = mesh;\n this.options = options;\n this.tweens = [];\n this.delta = 0;\n }", "title": "" }, { "docid": "cc1f4e137d0f48508a09dc7a88fefbf9", "score": "0.5036232", "text": "function R() {\n var i = s*s,\n x, y, z,\n xx,yy,zz,\n cs = Math.cos(t),\n sn = Math.sin(t);\n \n t+=0.005;\n\n //resize our canvas back to normal\n //This also clears the canvas\n a.style.cssText=a.width=a.height=s;\n\n\n for (var i=0; i<mesh.length; i++) {\n x = mesh[i].x*1;\n y = mesh[i].y*1;\n z = mesh[i].z*1;\n\n t = 0.01;\n // cs = Math.cos(t);\n // sn = Math.sin(t);\n\n // // rotate X\n // mesh[i].x = y * cs - z * sn;\n // mesh[i].z = z * cs + y * sn;\n \n cs = Math.cos(t);\n sn = Math.sin(t);\n //rotate Y\n mesh[i].x = x * cs - z * sn;\n mesh[i].z = z * cs + x * sn; \n\n x = mesh[i].x; \n y = mesh[i].y;\n z = mesh[i].z;\n z += 1000;\n\n // console.log(mesh)\n // break;\n var scale = fl / (fl + z) * 100;\n x = s/2 + x * scale;\n y = s/2 + y * scale;\n \n c.lineTo(x,y);\n\n if ((i+1)%4==0) {\n if (i>0) {\n c.closePath();\n c.stroke();\n }\n c.beginPath();\n c.fillStyle = 'blue';\n } else\n c.fillStyle = 'red';\n\n c.fillRect(x, y, 4, 4);\n }\n\n // for (j=0; j<mesh.length; j+=4) {\n // c.beginPath();\n // for (var i=8; i>=0; i-=2)\n // c.lineTo(mesh[j+i], mesh[j+i+1]);\n // // c.lineTo(mesh[j], mesh[j+1]);\n // // c.lineTo(mesh[j+2], mesh[j+3]);\n // c.closePath();\n // c.fill();\n\n // // c.fillRect(mesh[j], mesh[j+1], 4, 4);\n // // c.fillRect(mesh[j+2], mesh[j+3], 4, 4);\n // }\n\n\n // for (var i=0; i<s*s; i++) {\n // var y = i%s,\n // x = ~~(i/s),\n // r = (RAND.charCodeAt(i%RAND.length)&255)/128;\n \n\n\n\n // // r = Math.random();\n // c.fillRect(x, y, r, r);\n // }\n \n requestAnimationFrame(R);\n }", "title": "" }, { "docid": "6174ca323a19ed6e3e915b987221efc6", "score": "0.50318795", "text": "meshPush(mesh,movePnt,rotateAng)\n {\n let lft,rgt,top,bot;\n \n // lifting\n \n if (movePnt.y<0) {\n if (this.standOnMeshIdx!==-1) {\n if (this.core.map.meshList.meshes[this.standOnMeshIdx]===mesh) {\n if (this.position.y<=mesh.yBound.min) {\n this.position.y=Math.trunc(mesh.yBound.min)+1;\n }\n }\n }\n }\n \n // shoving out of way\n\n if ((movePnt.x===0) && (movePnt.z===0) && (rotateAng.y===0)) return;\n \n // are we within the bounds\n \n lft=this.position.x-this.radius;\n rgt=this.position.x+this.radius;\n top=this.position.z-this.radius;\n bot=this.position.z+this.radius;\n \n if ((lft>=mesh.xBound.max) || (rgt<=mesh.xBound.min)) return;\n if ((top>=mesh.zBound.max) || (bot<=mesh.zBound.min)) return;\n \n // shove them to rough bounds of object\n // if a part is within the bounds, then push\n // out the smallest way\n \n if (((lft>mesh.xBound.min) && (lft<mesh.xBound.max)) || ((rgt>mesh.xBound.min) && (rgt<mesh.xBound.max))) {\n if (Math.abs(this.position.x-(mesh.xBound.max+this.radius))<Math.abs(this.position.x-(mesh.xBound.min-this.radius))) {\n this.position.x=mesh.xBound.max+this.radius;\n }\n else {\n this.position.x=mesh.xBound.min-this.radius;\n }\n }\n \n if (((top>mesh.zBound.min) && (top<mesh.zBound.max)) || ((bot>mesh.zBound.min) && (bot<mesh.zBound.max))) {\n if (Math.abs(this.position.z-(mesh.zBound.max+this.radius))<Math.abs(this.position.z-(mesh.zBound.min-this.radius))) {\n this.position.z=mesh.zBound.max+this.radius;\n }\n else {\n this.position.z=mesh.zBound.min-this.radius;\n }\n }\n }", "title": "" }, { "docid": "c972ce2222a8c1d905fc1850ec0aba01", "score": "0.5031404", "text": "function AWORLD_Terrain2Mesh(t,tile_size,tile_elevation) {\n\n if(!t) {\n return new THREE.BoxGeometry( tile_size, tile_size, tile_size/1000 );\n }\n\n var geo = new THREE.Geometry();\n for (var i = 0; i < t._uValues.length; i++) {\n let x = t._uValues[i];\n let y = t._vValues[i];\n let z = ((t._heightValues[i] * (t._maximumHeight - t._minimumHeight)) / 32767.0) + t._minimumHeight;\n\n x = x*tile_size/32767;\n y = y*tile_size/32767;\n z = z - 115; // + tile_elevation; TODO fix\n\n var v = new THREE.Vector3(x, y, z);\n geo.vertices.push(v);\n }\n for (var i = 0; i < t._indices.length - 1; i = i + 3) {\n geo.faces.push(new THREE.Face3(t._indices[i], t._indices[i+1], t._indices[i+2]));\n }\n geo.computeFaceNormals(); \n\n return geo;\n\n}", "title": "" }, { "docid": "f4e2307aa687571c6e9af0bfba651c4c", "score": "0.50206643", "text": "constructor(scene) {\n this.abducted = false;\n this.scene = scene;\n this.frame = 1;\n this.bgframe = 0;\n this.scene.background = new T.CubeTextureLoader()\n .load( [\n './Pictures/stars2.png',\n './Pictures/stars2.png',\n './Pictures/stars2.png',\n //'ground_plane.png',\n './Pictures/stars2.png',\n './Pictures/stars2.png',\n './Pictures/stars2.png'\n ] );\n\n let geo = new T.SphereBufferGeometry(.5, 30, 30);\n let mat = new T.MeshStandardMaterial({color: \"blue\"});\n \n // let botLeft = [];\n // for (let i = 0; i < 10; i++) {\n // let mesh = new T.Mesh(geo,mat);\n // scene.add(mesh);\n // }\n //split objects into 4 quadrants\n\n // build ground\n let groundGeo = new T.PlaneBufferGeometry(40,40);\n let groundMat = new T.MeshStandardMaterial( {color: \"silver\"});\n //groundMat.metalness = 1.0;\n //groundMat.roughness = 0.0;\n this.ground = new T.Mesh(groundGeo, groundMat);\n this.ground.receiveShadow = true;\n this.ground.rotateX(2*Math.PI - Math.PI / 2);\n scene.add(this.ground);\n this.worldSize = 20; // TODO make arena larger\n\n //create surroundings (space)\n\n let planetGeo = new T.SphereBufferGeometry(100, 32, 32);\n let pmap = new T.TextureLoader().load(\"./Pictures/mars.png\");\n let planetMat = new T.MeshStandardMaterial( {map: pmap});\n this.planet = new T.Mesh(planetGeo, planetMat);\n this.planet.position.z = -700;\n this.planet.position.y = -100;\n this.planet.position.x = 30;\n scene.add(this.planet);\n\n let moonGeo = new T.SphereBufferGeometry(20, 32, 32);\n let moonMat = new T.MeshStandardMaterial( {color: \"white\"});\n this.moon = new T.Mesh(moonGeo, moonMat);\n this.moon.position.z = -700;\n this.moon.position.y = -100;\n this.moon.position.x = 170;\n scene.add(this.moon);\n\n let spotLight = new T.SpotLight( 0xffffff);\n spotLight.position.set( 300, 100, 700 ); // to put back at original, take off negatives\n spotLight.castShadow = true;\n spotLight.target = this.planet;\n spotLight.angle = Math.PI / 2;\n scene.add(spotLight);\n\n // build objects\n this.objects = [];\n this.frames = [];\n let mesh1 = new T.Mesh(geo, mat);\n mesh1.position.x = 8;\n mesh1.position.y = 1;\n mesh1.position.z = 5;\n mesh1.castShadow = true;\n this.objects.push(mesh1);\n this.frames.push(1);\n\n let mesh2 = new T.Mesh(geo, mat);\n mesh2.position.x = -5;\n mesh2.position.y = 1;\n mesh2.position.z = 8;\n mesh2.castShadow = true;\n this.objects.push(mesh2);\n this.frames.push(0);\n\n let mesh3 = new T.Mesh(geo, mat);\n mesh3.position.x = -8;\n mesh3.position.y = 1;\n mesh3.position.z = -8;\n mesh3.castShadow = true;\n this.objects.push(mesh3);\n this.frames.push(2);\n\n let mesh4 = new T.Mesh(geo, mat);\n mesh4.position.x = 5;\n mesh4.position.y = 1;\n mesh4.position.z = -5;\n mesh4.castShadow = true;\n this.objects.push(mesh4);\n this.frames.push(3);\n\n //build defenders\n let defGeo = new T.ConeBufferGeometry(1,1,50);\n let defMat = new T.MeshStandardMaterial({color: \"yellow\"});\n\n this.def1 = new T.Mesh(defGeo, defMat);\n this.def1.position.x = 4;\n this.def1.position.y = .5;\n this.def1.position.z = 4;\n scene.add(this.def1);\n\n for (let i = 0; i < this.objects.length; i++) {\n this.scene.add(this.objects[i]);\n }\n\n this.def_wrapper = new defender(this.scene);\n\n // this.def2 = new T.Mesh(defGeo, defMat); // the following defender\n // this.def2.position.x = -15;\n // this.def2.position.z = -15;\n // this.def2.position.y = .5;\n // this.scene.add(this.def2);\n\n // this.def3 = new T.Mesh(defGeo, defMat); // another following defender\n // this.def3.position.x = 15;\n // this.def3.position.z = 15;\n // this.def3.position.y = .5;\n // this.scene.add(this.def3);\n \n this.def1Right = true;\n\n this.shooting = false; // whether or not there's a bullet flying through the screen rn\n this.shootDirect = \"\";\n\n this.score = 0;\n \n }", "title": "" }, { "docid": "37efd71d0042c24a0eb57a2203d35090", "score": "0.50009114", "text": "static createSphere(nDiv)\n {\n var result = new Mesh();\n result.vertices = [];\n result.normals = [];\n result.indices = [];\n\n var va = [0, 0, -1];\n var vb = [0.0, 0.942809, 0.333333];\n var vc = [-0.816497, -0.471405, 0.333333];\n var vd = [0.816497, -0.471405, 0.333333];\n\n function tetrahedron(a, b, c, d, n)\n {\n function triangle(a, b, c)\n {\n // Vertices\n result.indices.push(result.vertices.length/3);\n result.vertices = result.vertices.concat(a);\n result.indices.push(result.vertices.length/3);\n result.vertices = result.vertices.concat(b);\n result.indices.push(result.vertices.length/3);\n result.vertices = result.vertices.concat(c);\n\n // Normals\n result.normals = result.normals.concat(a);\n result.normals = result.normals.concat(b);\n result.normals = result.normals.concat(c);\n }\n function divideTriangle(a, b, c, count)\n {\n if (count > 0)\n {\n var ab = GLMathLib.normalize(GLMathLib.mid(a, b));\n var ac = GLMathLib.normalize(GLMathLib.mid(a, c));\n var bc = GLMathLib.normalize(GLMathLib.mid(b, c));\n divideTriangle(a, ab, ac, count - 1);\n divideTriangle(ab, b, bc, count - 1);\n divideTriangle(bc, c, ac, count - 1);\n divideTriangle(ab, bc, ac, count - 1);\n } else {\n triangle (a, b, c);\n }\n }\n divideTriangle(a, b, c, n);\n divideTriangle(d, c, b, n);\n divideTriangle(a, d, b, n);\n divideTriangle(a, c, d, n);\n }\n\n // Run the function that calls it all.\n tetrahedron(va, vb, vc, vd, nDiv);\n\n return result;\n }", "title": "" }, { "docid": "93b4b155cb68a593e8a3de93ccfd5ec3", "score": "0.49901766", "text": "function onResourcesLoaded(){\n\t\n /*\n // Clone models into meshes.\n meshes[\"tent1\"] = models.tent.mesh.clone();\n meshes[\"tent2\"] = models.tent.mesh.clone();\n meshes[\"campfire1\"] = models.campfire.mesh.clone();\n */\n\t//meshes[\"campfire2\"] = models.campfire.mesh.clone();\n \n meshes[\"tent1\"] = models.tent.mesh.clone();\n meshes[\"scene\"] = models.scene.mesh.clone();\n\n meshes[\"tent1\"].position.set(-10, 0, 5);\n collisionTargets.push(meshes[\"tent1\"]);\n scene.add(meshes[\"tent1\"]);\n \n meshes[\"tent2\"] = models.tent.mesh.clone();\n\n meshes[\"tent2\"].position.set(-25, 0, 20);\n collisionTargets.push(meshes[\"tent2\"]);\n scene.add(meshes[\"tent2\"]);\n\n meshes[\"tent3\"] = models.tent.mesh.clone();\n \n meshes[\"tent3\"].position.set(-16, 0, 10);\n collisionTargets.push(meshes[\"tent3\"]);\n scene.add(meshes[\"tent3\"]);\n\n meshes[\"tent4\"] = models.tent.mesh.clone();\n \n meshes[\"tent4\"].position.set(-18, 0, 30);\n collisionTargets.push(meshes[\"tent4\"]);\n scene.add(meshes[\"tent4\"]);\n\n meshes[\"tent5\"] = models.tent.mesh.clone();\n \n meshes[\"tent5\"].position.set(-30, 0, -22);\n collisionTargets.push(meshes[\"tent5\"]);\n scene.add(meshes[\"tent5\"]);\n \n meshes[\"tent6\"] = models.tent.mesh.clone();\n\n meshes[\"tent6\"].position.set(5, 0, -14);\n collisionTargets.push(meshes[\"tent6\"]);\n\tscene.add(meshes[\"tent6\"]);\n \n /*\n objects.push(meshes[\"tent1\"]);\n objects.push(meshes[\"tent2\"]);\n\t\n\t// Reposition individual meshes, then add meshes to scene\n\t\n\t\n\tmeshes[\"tent2\"].position.set(-8, 0, 4);\n\tscene.add(meshes[\"tent2\"]);\n\t\n\tmeshes[\"campfire1\"].position.set(-5, 0, 1);\n\tmeshes[\"campfire2\"].position.set(-8, 0, 1);\n\t\n\tscene.add(meshes[\"campfire1\"]);\n scene.add(meshes[\"campfire2\"]);\n */\n\t\n\tmeshes[\"scene\"].position.set(-11, -1, 1);\n meshes[\"scene\"].rotation.set(0, Math.PI, 0); // Rotate it to face the other way.\n meshes[\"scene\"].scale.set(3, 3, 3);\n objects.push(meshes[\"scene\"]);\n scene.add(meshes[\"scene\"]);\n}", "title": "" }, { "docid": "71cf5311235862e9f4fb112ff3807084", "score": "0.49890724", "text": "interpolate(other, t) {\n return new Vertex(this.position.lerp(other.position, t), this.normal.lerp(other.normal, t));\n }", "title": "" }, { "docid": "ea92a5f77600be0a1335c1d0a35556ce", "score": "0.4980577", "text": "loadMeshes(meshes) {\n for (const mesh in meshes) {\n this.group.add(meshes[mesh])\n }\n }", "title": "" }, { "docid": "2a30c8341c3705de421718bd5f911a3c", "score": "0.49787122", "text": "subdivideLoop() {\n let mesh = this.subdivideTopological();\n // TODO: Fill this in\n return mesh;\n }", "title": "" }, { "docid": "53141339267c6308c75f68876de653bd", "score": "0.49764514", "text": "getMesh() {\n return this.mesh;\n }", "title": "" }, { "docid": "92e3ebc2a1ac24633190f6b727e9fa8f", "score": "0.4973998", "text": "get mesh() {\n return this.m_mesh;\n }", "title": "" }, { "docid": "ef6d50d0d55c6c1a6064bdf45dd3eb99", "score": "0.49735636", "text": "generateTriangles() {\n var deltaX = (this.maxX - this.minX) / this.div;\n var deltaY = (this.maxY - this.minY) / this.div;\n\n for (var i = 0; i <= this.div; i++) {\n for (var j = 0; j <= this.div; j++) {\n this.vBuffer.push(this.minX+deltaX*j);\n this.vBuffer.push(this.minY+deltaY*i);\n this.vBuffer.push(0);\n\n this.nBuffer.push(0);\n this.nBuffer.push(0);\n this.nBuffer.push(0);\n }\n }\n\n for (var i = 0; i < this.div; i++) {\n for (var j = 0; j < this.div; j++) {\n var vid = i * (this.div + 1) + j;\n this.fBuffer.push(vid);\n this.fBuffer.push(vid+1);\n this.fBuffer.push(vid+this.div+1);\n\n this.fBuffer.push(vid+1);\n this.fBuffer.push(vid+1+this.div+1);\n this.fBuffer.push(vid+this.div+1);\n }\n }\n\n this.numVertices = this.vBuffer.length / 3;\n this.numFaces = this.fBuffer.length / 3;\n this.produceVertices(230, 0.0037);\n this.produceNormals();\n this.calculateZ();\n}", "title": "" }, { "docid": "b2eff91d0cd917d1737863ef977a4dbe", "score": "0.4972802", "text": "updatemesh() {\n\n this.animations.tickanimationframe();\n\n }", "title": "" }, { "docid": "d6457330698c8bcbc48b726fa584a7e9", "score": "0.49680132", "text": "render({ time }) {\n // mesh.rotation.y = time * ((10 * Math.PI) / 180)\n\n controls.update()\n composer.render()\n mesh.material.uniforms.time.value = time\n }", "title": "" }, { "docid": "a5239747eb267cdb0f67cb27d4860044", "score": "0.49658403", "text": "lerpBoxes () {\n if (this.isLerpingBoxes) {\n for (let b=0; b<this.span; b++) {\n for (let r=0; r<this.span; r++) {\n for (let c=0; c<this.span; c++) {\n\n if (b!=this.SPREAD && r!=this.SPREAD && c!=this.SPREAD\n && Math.abs(this.boxes[b][r][c].position.x - this.boxes[b][r][c].origPos.x * this.explodedMult) < 0.005) {\n\n this.isLerpingBoxes = false\n this.boxes[b][r][c].position.x = this.boxes[b][r][c].origPos.x * this.explodedMult\n this.boxes[b][r][c].position.y = this.boxes[b][r][c].origPos.y * this.explodedMult\n this.boxes[b][r][c].position.z = this.boxes[b][r][c].origPos.z * this.explodedMult\n\n if (this.spheres[b][r][c]) {\n this.spheres[b][r][c].position.x += this.spheres[b][r][c].origPos.x * this.explodedMult - this.spheres[b][r][c].position.x\n this.spheres[b][r][c].position.y += this.spheres[b][r][c].origPos.y * this.explodedMult - this.spheres[b][r][c].position.y\n this.spheres[b][r][c].position.z += this.spheres[b][r][c].origPos.z * this.explodedMult - this.spheres[b][r][c].position.z\n }\n\n } else {\n this.boxes[b][r][c].position.x += (this.boxes[b][r][c].origPos.x * this.explodedMult - this.boxes[b][r][c].position.x) / 10\n this.boxes[b][r][c].position.y += (this.boxes[b][r][c].origPos.y * this.explodedMult - this.boxes[b][r][c].position.y) / 10\n this.boxes[b][r][c].position.z += (this.boxes[b][r][c].origPos.z * this.explodedMult - this.boxes[b][r][c].position.z) / 10\n\n if (this.spheres[b][r][c]) {\n this.spheres[b][r][c].position.x += (this.spheres[b][r][c].origPos.x * this.explodedMult - this.spheres[b][r][c].position.x) / 10\n this.spheres[b][r][c].position.y += (this.spheres[b][r][c].origPos.y * this.explodedMult - this.spheres[b][r][c].position.y) / 10\n this.spheres[b][r][c].position.z += (this.spheres[b][r][c].origPos.z * this.explodedMult - this.spheres[b][r][c].position.z) / 10\n }\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "a5239747eb267cdb0f67cb27d4860044", "score": "0.49658403", "text": "lerpBoxes () {\n if (this.isLerpingBoxes) {\n for (let b=0; b<this.span; b++) {\n for (let r=0; r<this.span; r++) {\n for (let c=0; c<this.span; c++) {\n\n if (b!=this.SPREAD && r!=this.SPREAD && c!=this.SPREAD\n && Math.abs(this.boxes[b][r][c].position.x - this.boxes[b][r][c].origPos.x * this.explodedMult) < 0.005) {\n\n this.isLerpingBoxes = false\n this.boxes[b][r][c].position.x = this.boxes[b][r][c].origPos.x * this.explodedMult\n this.boxes[b][r][c].position.y = this.boxes[b][r][c].origPos.y * this.explodedMult\n this.boxes[b][r][c].position.z = this.boxes[b][r][c].origPos.z * this.explodedMult\n\n if (this.spheres[b][r][c]) {\n this.spheres[b][r][c].position.x += this.spheres[b][r][c].origPos.x * this.explodedMult - this.spheres[b][r][c].position.x\n this.spheres[b][r][c].position.y += this.spheres[b][r][c].origPos.y * this.explodedMult - this.spheres[b][r][c].position.y\n this.spheres[b][r][c].position.z += this.spheres[b][r][c].origPos.z * this.explodedMult - this.spheres[b][r][c].position.z\n }\n\n } else {\n this.boxes[b][r][c].position.x += (this.boxes[b][r][c].origPos.x * this.explodedMult - this.boxes[b][r][c].position.x) / 10\n this.boxes[b][r][c].position.y += (this.boxes[b][r][c].origPos.y * this.explodedMult - this.boxes[b][r][c].position.y) / 10\n this.boxes[b][r][c].position.z += (this.boxes[b][r][c].origPos.z * this.explodedMult - this.boxes[b][r][c].position.z) / 10\n\n if (this.spheres[b][r][c]) {\n this.spheres[b][r][c].position.x += (this.spheres[b][r][c].origPos.x * this.explodedMult - this.spheres[b][r][c].position.x) / 10\n this.spheres[b][r][c].position.y += (this.spheres[b][r][c].origPos.y * this.explodedMult - this.spheres[b][r][c].position.y) / 10\n this.spheres[b][r][c].position.z += (this.spheres[b][r][c].origPos.z * this.explodedMult - this.spheres[b][r][c].position.z) / 10\n }\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "ed0e8289193433991acd05043b1785ec", "score": "0.496389", "text": "function run(){\n //var interval = 500\n var interval = 300\n //camera movement\n createjs.Tween.get(camera.position, {loop:-1}).to({y:camera.position.y + 5}, interval/2).to({y:camera.position.y}, interval/2);\n createjs.Tween.get(camera.rotation, {loop:-1}).to({y: radians(0.1)}, interval).to({y:radians(-0.1)}, interval);\n \n\n\n createjs.Tween.get(camera2.position, {loop:-1}).to({y:camera2.position.y + 5}, interval/2).to({y:camera2.position.y}, interval/2);\n createjs.Tween.get(camera2.rotation, {loop:-1}).to({y: radians(0.1)}, interval).to({y:radians(-0.1)}, interval);\n \n createjs.Tween.get(hipsMesh.rotation, {loop:-1}).to({x:radians(-85)}, interval/2).to({x:radians(75)}, interval).to({x:radians(0)}, interval/2);\n createjs.Tween.get(hipsMesh2.rotation, {loop:-1}).to({x:radians(85)}, interval/2).to({x:radians(-75)},interval).to({x:radians(0)}, interval/2);\n createjs.Tween.get(waistMesh.position, {loop:-1}).to({y:20}, interval/2).to({y:0},interval/2);\n createjs.Tween.get(kneeMesh.rotation, {loop:-1}).to({x:radians(90)}, interval).to({x:radians(0)}, interval);\n createjs.Tween.get(kneeMesh2.rotation, {loop:-1}).to({x:radians(90)}, interval).to({x:radians(0)}, interval);\n createjs.Tween.get(ankleMesh.rotation, {loop:-1}).to({x:radians(-15)}, interval).to({x:radians(0)}, interval/2);\n createjs.Tween.get(ankleMesh2.rotation, {loop:-1}).to({x:radians(-15)}, interval).to({x:radians(0)}, interval/2);\n createjs.Tween.get(torso.rotation, {loop:-1}).to({y:radians(20)},interval/2).to({y:radians(-20)},interval).to({y:radians(0)},interval/2);\n \n createjs.Tween.get(shoulderMesh.rotation, {loop:-1}).to({x:radians(75)}, interval/2).to({x:radians(-75)}, interval).to({x:radians(0)}, interval/2);\n createjs.Tween.get(shoulderMesh2.rotation, {loop:-1}).to({x:radians(-75)}, interval/2).to({x:radians(75)}, interval).to({x:radians(0)}, interval/2);\n createjs.Tween.get(elbowMesh.rotation, {loop:-1}).to({x:radians(-120)}, interval).to({x:radians(-90)}, interval);\n createjs.Tween.get(elbowMesh2.rotation, {loop:-1}).to({x:radians(-120)}, interval).to({x:radians(-90)}, interval);\n //controls\n}", "title": "" }, { "docid": "8b896b9a34aa843f36b4f96f300344a1", "score": "0.4947377", "text": "easeInOutQuad(t) {\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n }", "title": "" }, { "docid": "f30e34afd0d4b4b15fee8eca0a3b8d38", "score": "0.49470007", "text": "function easeInOutQuad(t) {\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n }", "title": "" }, { "docid": "dcf765c4aefef3e93e9a18a673f67f53", "score": "0.4946019", "text": "function addPosts(group) {\n let post_material = new T.MeshStandardMaterial({\n color: \"red\",\n metalness: 0.6,\n roughness: 0.5\n });\n let post_geom = new T.CylinderGeometry(0.1, 0.1, 2, 16);\n let flPost = new T.Mesh(post_geom, post_material);\n group.add(flPost);\n flPost.position.set(0.4, 0.9, 0.9);\n flPost.rotateZ(Math.PI / 8);\n let blPost = new T.Mesh(post_geom, post_material);\n group.add(blPost);\n blPost.position.set(-0.4, 0.9, 0.9);\n blPost.rotateZ(-Math.PI / 8);\n let frPost = new T.Mesh(post_geom, post_material);\n group.add(frPost);\n frPost.position.set(0.4, 0.9, -0.9);\n frPost.rotateZ(Math.PI / 8);\n let brPost = new T.Mesh(post_geom, post_material);\n group.add(brPost);\n brPost.position.set(-0.4, 0.9, -0.9);\n brPost.rotateZ(-Math.PI / 8);\n let topPost = new T.Mesh(post_geom, post_material);\n group.add(topPost);\n topPost.position.set(0, 1.8, 0);\n topPost.rotateX(-Math.PI / 2);\n }", "title": "" }, { "docid": "161330efab7adbb619c1bf4aa4c66f9e", "score": "0.49328578", "text": "getMesh()\n {\n return this.m_Mesh;\n }", "title": "" }, { "docid": "9afa9fdd737a4ed0b5852a45ef4c952d", "score": "0.49293095", "text": "function gettg(mesh) {\n\tmesh.updateMatrixWorld();\n\tvar gt = mesh.geometry.clone();\n\tgt.applyMatrix(mesh.matrixWorld);\n\treturn gt;\n}", "title": "" }, { "docid": "6c3a45b1d772b5b85c55ae53f23f546c", "score": "0.49283752", "text": "function addMesh () {\n\n var geometry = new THREE.SphereGeometry(200, 40, 30);\n var material = new THREE.MeshPhongMaterial();\n material.map = THREE.ImageUtils.loadTexture('../images/earth_surface_2048.jpg');\n material.bumpMap = THREE.ImageUtils.loadTexture('../images/bump_earth.jpg');\n material.bumpScale = 4;\n material.specularMap = THREE.ImageUtils.loadTexture('../images/earth_specular_2048.jpg');\n var globe = new THREE.Mesh(geometry, material);\n globe.updateMatrix();\n globe.matrixAutoUpdate = false;\n var cloudGeometry = new THREE.SphereGeometry(205, 32, 32);\n //cloud material\n var material = new THREE.MeshPhongMaterial({\n map : THREE.ImageUtils.loadTexture('../images/earth_clouds_1024.png'),\n side : THREE.DoubleSide,\n opacity : 0.8,\n transparent : true,\n depthWrite : false\n\n });\n\n var cloudMesh = new THREE.Mesh(cloudGeometry, material);\n cloud = new THREE.Object3D();\n cloud.add(cloudMesh);\n earth = new THREE.Object3D();\n earth.rotation.z = 0.41;\n earth.add(globe);\n \n tweets = gt.utils.addPoints(data);\n earth.add(tweets);\n scene.add(cloud);\n scene.add(earth);\n\n }", "title": "" }, { "docid": "6a0fa5e86d76a2bfc6fac110a4787850", "score": "0.49175027", "text": "function plotSpheresFromDotLists(timestart, timeend, pList, univ){\n for (var i = timestart; i < timeend; i++){\n var spheres = Vector();\n for (var j = 0; j < pList.size(); j++) {\n var curdot = pList.get(j);\n if (curdot.frame -1 == i){\n var factor = Math.round(curdot.meanint/200 * 24);\n //var sphere = Mesh_Maker.createSphere(curdot.sx, curdot.sy, curdot.sz, 0.7, factor, factor);\n var sphere = Mesh_Maker.createSphere(curdot.sx, curdot.sy, curdot.sz, 0.7, 12, 12);\n\n spheres.addAll(sphere);\n IJ.log(\"index\"+j + \" frame\" + i + \" intfactor:\"+factor);\n }\n }\n var csp = CustomTriangleMesh(spheres, colw, 0.0);\n var ccs = ContentCreator.createContent(csp, \"dotstime\" + Integer.toString(i), i-timestart);\n univ.addContent(ccs);\n }\n}", "title": "" }, { "docid": "515384c789624930515f2b3c2ee66cbd", "score": "0.49154454", "text": "function makeBase(){\r\n var base = new THREE.Object3D();\r\n\r\n //make wire decal\r\n var wireGeom = new THREE.BoxGeometry(9, 0.75, 9);\r\n var wireframe = new THREE.WireframeGeometry( wireGeom );\r\n var wireSupport = new THREE.LineSegments( wireframe );\r\n wireSupport.material.color.setHex(hexColor);\r\n base.add(wireSupport);\r\n\r\n //make solid base decal\r\n var solidSupportGeom = new THREE.BoxGeometry(9, 0.75, 9);\r\n var solidSupportMaterial = new THREE.MeshBasicMaterial( {color: hexColor} );\r\n var solidSupport = new THREE.Mesh( solidSupportGeom, solidSupportMaterial );\r\n solidSupport.position.set(0,-0.5,0);\r\n base.add(solidSupport);\r\n\r\n //Making the bottom support legs\r\n var bodyPts = Array.prototype.concat(bottomLegs);\r\n var bodyPoints = makePoints(bodyPts);\r\n var spline = makeCurves(bodyPoints, 1);\r\n var firstLeg = makeLatheObj(spline);\r\n\r\n //position and rotate legs\r\n var secondLeg = firstLeg.clone();\r\n secondLeg.rotation.x = THREE.Math.degToRad(10);\r\n secondLeg.rotation.z = THREE.Math.degToRad(20);\r\n secondLeg.position.set(8, -15, -5);\r\n\r\n var thirdLeg = firstLeg.clone();\r\n thirdLeg.rotation.x = THREE.Math.degToRad(10);\r\n thirdLeg.rotation.z = THREE.Math.degToRad(-20);\r\n thirdLeg.position.set(-8, -15, -5);\r\n\r\n var fourthLeg = firstLeg.clone();\r\n fourthLeg.rotation.x = THREE.Math.degToRad(-10);\r\n fourthLeg.position.set(8,-15,5);\r\n fourthLeg.rotation.z = THREE.Math.degToRad(20);\r\n firstLeg.rotation.x = THREE.Math.degToRad(-10);\r\n firstLeg.rotation.z = THREE.Math.degToRad(-20);\r\n firstLeg.position.set(-8, -15, 5);\r\n\r\n //put the middle together\r\n base.add(firstLeg);\r\n base.add(secondLeg);\r\n base.add(thirdLeg);\r\n base.add(fourthLeg);\r\n\r\n //make trapezoid center\r\n var x = 0;\r\n var y = 0;\r\n var trapezoidShape = new THREE.Shape();\r\n trapezoidShape.moveTo( x, y );\r\n trapezoidShape.lineTo(x + 1, y + 3);\r\n trapezoidShape.lineTo( x + 5, y + 3);\r\n trapezoidShape.lineTo(x + 6, y);\r\n trapezoidShape.moveTo(x + 6, y);\r\n trapezoidShape.quadraticCurveTo(3, 3, x, y);\r\n\r\n var trapezoidGeom = new THREE.ShapeGeometry(trapezoidShape);\r\n var trapezoidMaterial = new THREE.MeshBasicMaterial( {color: hexColor} );\r\n var trapezoid = new THREE.Mesh( trapezoidGeom, trapezoidMaterial );\r\n\r\n var trap2 = trapezoid.clone();\r\n var trap3 = trapezoid.clone();\r\n var trap4 = trapezoid.clone();\r\n\r\n trapezoid.position.set(-3,-3,4);\r\n trap2.rotation.y = Math.PI\r\n trap2.position.set(3,-3, -4);\r\n trap3.rotation.y = Math.PI /2\r\n trap3.position.set(4.5, -3, 3)\r\n trap4.rotation.y = - Math.PI /2\r\n trap4.position.set(-4.5, -3, -3)\r\n\r\n base.add(trapezoid);\r\n base.add(trap2);\r\n base.add(trap3);\r\n base.add(trap4);\r\n\r\n return base\r\n }", "title": "" }, { "docid": "2c394f8dc25cf2846a6d1fd80531b08e", "score": "0.48970202", "text": "function UpdateMesh () {\n\t//count visible segments\n\tsegmentCount=0;\n\tfor(i=0;i<numMarks&&i<maxMarks;i++)\n\t\tif(skidmarks[i].lastIndex!=-1&&skidmarks[i].lastIndex>numMarks-maxMarks)\n\t\t\tsegmentCount++;\n\t\n\t//create skidmark mesh coordinates\n\tvertices=new Vector3[segmentCount*4];\n\tnormals=new Vector3[segmentCount*4];\n\tcolors=new Color[segmentCount*4];\n\tuvs = new Vector2[segmentCount*4];\n\ttriangles=new int[segmentCount*6];\n\tsegmentCount=0;\n\tfor(i=0;i<numMarks&&i<maxMarks;i++)\n\t\tif(skidmarks[i].lastIndex!=-1&&skidmarks[i].lastIndex>numMarks-maxMarks)\n\t\t{\n\t\t\tcurr=skidmarks[i];\n\t\t\tlast=skidmarks[curr.lastIndex%maxMarks];\n\t\t\t\t\t\t\n\t\t\tvertices[segmentCount*4+0]=last.posl;\n\t\t\tvertices[segmentCount*4+1]=last.posr;\n\t\t\tvertices[segmentCount*4+2]=curr.posl;\n\t\t\tvertices[segmentCount*4+3]=curr.posr;\n\t\t\t\n\t\t\tnormals[segmentCount*4+0]=last.normal;\n\t\t\tnormals[segmentCount*4+1]=last.normal;\n\t\t\tnormals[segmentCount*4+2]=curr.normal;\n\t\t\tnormals[segmentCount*4+3]=curr.normal;\n\n\t\t\tcolors[segmentCount*4+0]=new Color(1,1,1,last.intensity);\n\t\t\tcolors[segmentCount*4+1]=new Color(1,1,1,last.intensity);\n\t\t\tcolors[segmentCount*4+2]=new Color(1,1,1,curr.intensity);\n\t\t\tcolors[segmentCount*4+3]=new Color(1,1,1,curr.intensity);\n\n\t\t\tuvs[segmentCount*4+0]=new Vector2(0,0);\n\t\t\tuvs[segmentCount*4+1]=new Vector2(1,0);\n\t\t\tuvs[segmentCount*4+2]=new Vector2(0,0);\n\t\t\tuvs[segmentCount*4+3]=new Vector2(1,0);\n\t\t\t\n\t\t\ttriangles[segmentCount*6+0]=segmentCount*4+0;\n\t\t\ttriangles[segmentCount*6+1]=segmentCount*4+1;\n\t\t\ttriangles[segmentCount*6+2]=segmentCount*4+2;\n\t\t\t\n\t\t\ttriangles[segmentCount*6+3]=segmentCount*4+2;\n\t\t\ttriangles[segmentCount*6+4]=segmentCount*4+1;\n\t\t\ttriangles[segmentCount*6+5]=segmentCount*4+3;\n\t\t\tsegmentCount++;\t\t\t\n\t\t}\n\t\n\t//update mesh\n\tmesh = (GetComponent(MeshFilter) as MeshFilter).mesh;\n\t//mesh:Mesh = GetComponent(MeshFilter).mesh;\n\tmesh.Clear();\n\tmesh.vertices=vertices;\n\tmesh.normals=normals;\n\tmesh.triangles=triangles;\n\tmesh.colors=colors;\n\tmesh.uv=uvs;\n\tupdateMeshFlag=false;\n}", "title": "" }, { "docid": "2b2178a29763d47c603db71c154b0834", "score": "0.48926505", "text": "addMeshes() {\n\n for (let a of arguments) {\n\n this.loadMesh(a.src, a.name);\n }\n }", "title": "" }, { "docid": "82540ce76376b44ba238ed007bb24bb0", "score": "0.4889392", "text": "function update(){\n checkKeyboardPresses();\n moveMeshes.forEach((meshObj, originalIndex) =>{\n let mesh = meshObj.mesh;\n mesh.rotation.x += 0.01;\n mesh.rotation.y += 0.01;\n //working under the assumption that originalIndex < index\n //as this is firing synchronously it is a safe assumption\n moveMeshes.forEach((checkMeshObj,index) =>{\n let checkMesh = checkMeshObj.mesh;\n // let box = new THREE.Box3().setFromObject(checkMesh);\n if(!(checkMesh === mesh) && checkMesh.position.distanceTo(mesh.position) <2){\n let newPositionVector = (checkMesh.position.add(mesh.position));\n const newMeshSize = (meshObj.size + checkMeshObj.size);\n const newMesh = new THREE.Mesh(\n new THREE.BoxBufferGeometry(newMeshSize,newMeshSize,newMeshSize),\n new THREE.MeshPhongMaterial({color:0xff4432})\n )\n \n newPositionVector = newPositionVector.divideScalar(2);\n newMesh.position.set(newPositionVector.x, newMeshSize, newPositionVector.z);\n const newMeshObj = {\n mesh: newMesh,\n size: newMeshSize,\n childMeshObjs: [checkMeshObj, meshObj]\n }\n moveMeshes.splice(index,1);\n moveMeshes.splice(originalIndex,1);\n \n mesh.geometry.dispose();\n mesh.material.dispose();\n scene.remove(mesh);\n\n checkMesh.geometry.dispose();\n checkMesh.material.dispose();\n scene.remove(checkMesh);\n\n scene.add(newMeshObj.mesh);\n moveMeshes.push(newMeshObj);\n controls = new THREE.DragControls(moveMeshes.map(meshObj => meshObj.mesh), camera, renderer.domElement);\n }\n })\n })\n}", "title": "" }, { "docid": "34508964d6aeecc49701525af0146f68", "score": "0.48777866", "text": "function createLegs()\n{\n var legs = new THREE.Group\n\n //Creating the left leg\n var left_leg = new THREE.Group();\n\n var lleg = new THREE.Mesh(leg_geo, pant_material);\n lleg.position.y = -10;\n lleg.position.x = -3;\n lleg.rotation.z = -0.3;\n\n var lfoot = new THREE.Mesh(foot_geo, pant_material);\n lfoot.position.x = -4;\n lfoot.position.y = -13;\n lfoot.position.z = 1;\n lfoot.rotation.y = 1.4;\n\n left_leg.add(lleg);\n left_leg.add(lfoot);\n\n //Creating the right leg\n var right_leg = new THREE.Group();\n\n var rleg = new THREE.Mesh(leg_geo, pant_material);\n rleg.position.y = -10;\n rleg.position.x = 3;\n rleg.rotation.z = 0.3;\n\n var rfoot = new THREE.Mesh(foot_geo, pant_material);\n rfoot.position.x = 4;\n rfoot.position.y = -13;\n rfoot.position.z = 1;\n rfoot.rotation.y = 2;\n\n right_leg.add(rleg);\n right_leg.add(rfoot);\n\n legs.add(left_leg);\n legs.add(right_leg);\n\n return legs;\n}", "title": "" }, { "docid": "8e99d1e3c6574031c7175cd49fef2f20", "score": "0.48765272", "text": "function createMeshGLTF(){\n sim.table_width = 0.447675, //width was 1\n sim.table_length = 0.6985, //length was 2\n sim.table_height = 0.01905 //height (thickness of Dexcell surface). This is 3/4 of an inch. was: 0.1)\n sim.table = draw_table(sim.scene, sim.table_width, sim.table_length, sim.table_height)\n\n \n\n sim.J0 = new THREE.Object3D(); //0,0,0 //does not move w.r.t table.\n sim.J0.rotation.y = Math.PI //radians for 180 degrees\n sim.J0.name = \"J0\"\n sim.J0.position.y = (sim.table_height / 2) //+ (leg_height / 2) //0.06 //for orig boxes model, leg)height was positive, but for legless dexter mounted on table, its probably 0\n sim.J0.position.x = (sim.table_length / 2) //the edge of the table\n - 0.12425 //the distance from the edge of the table that Dexter is placed\n sim.table.add(sim.J0)\n\n let loader = new THREE_GLTFLoader()\n\n loader.load(__dirname + \"/HDIMeterModel.gltf\", //select_val,\n fix_up_gltf_and_add,\n undefined,\n function (err) {\n console.error( err );\n }\n )\n\n}", "title": "" }, { "docid": "e0c7b36ba47af484eabb75a60b2d30fc", "score": "0.48752743", "text": "addModels() {\r\n\t\tconst geometry = new THREE.SphereGeometry(1, 30, 30, 0, Math.PI, 0); //, Math.PI /2 add to make cut in half\r\n\t\tconst material = new THREE.MeshPhongMaterial({ side: THREE.DoubleSide });\r\n\t\tthis.mesh = new THREE.Mesh(geometry, material);\r\n\r\n\t\tthis.scene.add(this.mesh);\r\n\r\n\t\t//LOAD texture from Web and on completion apply it on SPHERE\r\n\t\tnew THREE.TextureLoader().load(\r\n\t\t\t\"https://images.unsplash.com/photo-1529256082460-40d68ec500da?ixid=MXwxMjA3fDB8MHxzZWFyY2h8ODF8fHB1cnBsZSUyMGdyZWVuJTIwY29sb3J8ZW58MHwwfDB8&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60\",\r\n\r\n\t\t\t(texture) => {\r\n\t\t\t\t//Update Texture\r\n\t\t\t\tthis.mesh.material.map = texture;\r\n\t\t\t\tthis.mesh.material.needsUpdate = true;\r\n\t\t\t},\r\n\t\t\t(xhr) => {\r\n\t\t\t\t//Download Progress\r\n\t\t\t\tconsole.log((xhr.loaded / xhr.total) * 100 + \"% loaded\");\r\n\t\t\t},\r\n\t\t\t(error) => {\r\n\t\t\t\t//Error CallBack\r\n\t\t\t\tconsole.log(\"An error happened\" + error);\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\t// -----Step 4--------\r\n\t\t//Loading 3d Models\r\n\t\t//Load Material First // not working MTL\r\n\t\t// const mtlLoader = new MTLLoader();\r\n\t\t// mtlLoader.setTexturePath(\"./3Dobj/\");\r\n\t\t// mtlLoader.load(\"./3Dobj/Bug.mtl\", materials => {\r\n\t\t// materials.preload();\r\n\t\t// console.log(\"Material loaded\");\r\n\r\n\t\t//Load Object Now and Set Material\r\n\t\tconst objLoader = new OBJLoader();\r\n\t\t//objLoader.setMaterials(material);\r\n\t\tobjLoader.load(\"./3Dobj/Bug.obj\", (object) => {\r\n\t\t\tthis.backMesh = object;\r\n\t\t\tthis.backMesh.position.setY(0); //or this\r\n\t\t\tthis.backMesh.scale.set(0.02, 0.02, 0.02);\r\n\t\t\tthis.scene.add(this.backMesh);\r\n\t\t});\r\n\t // });\r\n\t \r\n\t}", "title": "" }, { "docid": "6853265e64ca2895c8cefc179deb66e3", "score": "0.48676056", "text": "function CreateMesh () {\n\t// update size of newVertices and newTriangles\n\tnewVertices = new Vector3[(resolutionX + 1) * (resolutionZ + 1)];\n\tnewTriangles = new int[resolutionX * resolutionZ * 6];\n\tnewUvs = new Vector2[newVertices.Length];\n\n\t// int i sert juste à accéder aux éléments des tableaux simplement\n\tvar i : int = 0;\n\t\n\t// create vertices\n\tfor (var z : int = 0; z <= resolutionZ; z++) {\n\t\tfor (var x : int = 0; x <= resolutionX; x++) {\n\t\t\tnewVertices[i] = Vector3 (x * size.x / resolutionX, 0, z * size.y / resolutionZ);\n\t\t\tif (center) {\n\t\t\t\tnewVertices[i] -= Vector3 (size.x / 2, 0, size.y / 2);\n\t\t\t}\n\t\t\t// le cast en float sert à éviter la division entière de 2 int\n\t\t\tnewUvs[i] = Vector2 ((x*1.0) / resolutionX, (z*1.0) / resolutionZ);\n\t\t\ti++;\n\t\t}\n\t}\n\t\n\ti = 0;\n\t// create triangles\n\tfor (z = 0; z < resolutionZ; z++) {\n\t\tfor (x = 0; x < resolutionX; x++) {\n\t\t\tnewTriangles[i + 5] =\n\t\t\tnewTriangles[i ] = z * (resolutionX + 1) + x;\n\t\t\tnewTriangles[i + 1] = (z + 1) * (resolutionX + 1) + x;\n\t\t\tnewTriangles[i + 2] =\n\t\t\tnewTriangles[i + 3] = (z + 1) * (resolutionX + 1) + x + 1;\n\t\t\tnewTriangles[i + 4] = z * (resolutionX + 1) + x + 1;\n\t\t\ti += 6;\n\t\t}\n\t}\n\t\n\t//create a new mesh, assign the vertices and triangles\n var newMesh : Mesh = new Mesh ();\n newMesh.name = \"Procedural Plane\"; \n\tnewMesh.Clear ();\n\t// cette ligne sert à nettoyer les données du mesh\n\t// Unity vérifie si les indices des tris ne sont pas en dehors du tableau\n\t// de vertices, ce qui peut facilement se produire si on en assigne de\n\t// nouveaux alors que le mesh contient toujours les anciens tris\n\t// (vous obtiendrez une jolie exception dans ce cas !)\n\tnewMesh.vertices = newVertices;\n\tnewMesh.uv = newUvs;\n\t//newMesh.colors = colors;\n\tnewMesh.triangles = newTriangles;\n\tnewMesh.RecalculateNormals(); \t//recalculate normals, bounds and optimize\n newMesh.RecalculateBounds();\n newMesh.Optimize();\n \n (Plan.GetComponent(MeshFilter) as MeshFilter).mesh = newMesh; \t//assign the created mesh as the used mesh \n Plan.GetComponent(MeshCollider).sharedMesh = null;\n Plan.GetComponent(MeshCollider).sharedMesh = newMesh; \n}", "title": "" }, { "docid": "b9ebbee6390e02930d20e4728e11f350", "score": "0.48667836", "text": "function uniformTriangleGroup(mesh, splitTriangles) {\n if (splitTriangles === void 0) { splitTriangles = true; }\n var indexBuffer = mesh.indexBuffer, vertexBuffer = mesh.vertexBuffer, groupBuffer = mesh.groupBuffer, normalBuffer = mesh.normalBuffer, triangleCount = mesh.triangleCount, vertexCount = mesh.vertexCount;\n var ib = indexBuffer.ref.value;\n var vb = vertexBuffer.ref.value;\n var gb = groupBuffer.ref.value;\n var nb = normalBuffer.ref.value;\n // new\n var index = _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].create(Uint32Array, 3, 1024, triangleCount);\n // re-use\n var vertex = _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].create(Float32Array, 3, 1024, vb);\n vertex.currentIndex = vertexCount * 3;\n vertex.elementCount = vertexCount;\n var normal = _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].create(Float32Array, 3, 1024, nb);\n normal.currentIndex = vertexCount * 3;\n normal.elementCount = vertexCount;\n var group = _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].create(Float32Array, 1, 1024, gb);\n group.currentIndex = vertexCount;\n group.elementCount = vertexCount;\n var vi = Object(_mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"])();\n var vj = Object(_mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"])();\n var vk = Object(_mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"])();\n var ni = Object(_mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"])();\n var nj = Object(_mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"])();\n var nk = Object(_mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"])();\n function add(i) {\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].fromArray(vi, vb, i * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].fromArray(ni, nb, i * 3);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(vertex, vi[0], vi[1], vi[2]);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(normal, ni[0], ni[1], ni[2]);\n }\n function addMid(i, j) {\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].fromArray(vi, vb, i * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].fromArray(vj, vb, j * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].scale(vi, _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].add(vi, vi, vj), 0.5);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].fromArray(ni, nb, i * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].fromArray(nj, nb, j * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].scale(ni, _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].add(ni, ni, nj), 0.5);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(vertex, vi[0], vi[1], vi[2]);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(normal, ni[0], ni[1], ni[2]);\n }\n function addCenter(i, j, k) {\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].fromArray(vi, vb, i * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].fromArray(vj, vb, j * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].fromArray(vk, vb, k * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].scale(vi, _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].add(vi, _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].add(vi, vi, vj), vk), 1 / 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].fromArray(ni, nb, i * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].fromArray(nj, nb, j * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].fromArray(nk, nb, k * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].scale(ni, _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].add(ni, _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_2__[\"Vec3\"].add(ni, ni, nj), nk), 1 / 3);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(vertex, vi[0], vi[1], vi[2]);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(normal, ni[0], ni[1], ni[2]);\n }\n function split2(i0, i1, i2, g0, g1) {\n ++newTriangleCount;\n add(i0);\n addMid(i0, i1);\n addMid(i0, i2);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(index, newVertexCount, newVertexCount + 1, newVertexCount + 2);\n for (var j = 0; j < 3; ++j)\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add(group, g0);\n newVertexCount += 3;\n newTriangleCount += 2;\n add(i1);\n add(i2);\n addMid(i0, i1);\n addMid(i0, i2);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(index, newVertexCount, newVertexCount + 1, newVertexCount + 3);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(index, newVertexCount, newVertexCount + 3, newVertexCount + 2);\n for (var j = 0; j < 4; ++j)\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add(group, g1);\n newVertexCount += 4;\n }\n var newVertexCount = vertexCount;\n var newTriangleCount = 0;\n if (splitTriangles) {\n for (var i = 0, il = triangleCount; i < il; ++i) {\n var i0 = ib[i * 3], i1 = ib[i * 3 + 1], i2 = ib[i * 3 + 2];\n var g0 = gb[i0], g1 = gb[i1], g2 = gb[i2];\n if (g0 === g1 && g0 === g2) {\n ++newTriangleCount;\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(index, i0, i1, i2);\n }\n else if (g0 === g1) {\n split2(i2, i0, i1, g2, g0);\n }\n else if (g0 === g2) {\n split2(i1, i2, i0, g1, g2);\n }\n else if (g1 === g2) {\n split2(i0, i1, i2, g0, g1);\n }\n else {\n newTriangleCount += 2;\n add(i0);\n addMid(i0, i1);\n addMid(i0, i2);\n addCenter(i0, i1, i2);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(index, newVertexCount, newVertexCount + 1, newVertexCount + 3);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(index, newVertexCount, newVertexCount + 3, newVertexCount + 2);\n for (var j = 0; j < 4; ++j)\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add(group, g0);\n newVertexCount += 4;\n newTriangleCount += 2;\n add(i1);\n addMid(i1, i2);\n addMid(i1, i0);\n addCenter(i0, i1, i2);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(index, newVertexCount, newVertexCount + 1, newVertexCount + 3);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(index, newVertexCount, newVertexCount + 3, newVertexCount + 2);\n for (var j = 0; j < 4; ++j)\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add(group, g1);\n newVertexCount += 4;\n newTriangleCount += 2;\n add(i2);\n addMid(i2, i1);\n addMid(i2, i0);\n addCenter(i0, i1, i2);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(index, newVertexCount + 3, newVertexCount + 1, newVertexCount);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(index, newVertexCount + 2, newVertexCount + 3, newVertexCount);\n for (var j = 0; j < 4; ++j)\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add(group, g2);\n newVertexCount += 4;\n }\n }\n }\n else {\n for (var i = 0, il = triangleCount; i < il; ++i) {\n var i0 = ib[i * 3], i1 = ib[i * 3 + 1], i2 = ib[i * 3 + 2];\n var g0 = gb[i0], g1 = gb[i1], g2 = gb[i2];\n if (g0 !== g1 || g0 !== g2) {\n ++newTriangleCount;\n add(i0);\n add(i1);\n add(i2);\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(index, newVertexCount, newVertexCount + 1, newVertexCount + 2);\n var g = g1 === g2 ? g1 : g0;\n for (var j = 0; j < 3; ++j)\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add(group, g);\n newVertexCount += 3;\n }\n else {\n ++newTriangleCount;\n _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].add3(index, i0, i1, i2);\n }\n }\n }\n var newIb = _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].compact(index);\n var newVb = _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].compact(vertex);\n var newNb = _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].compact(normal);\n var newGb = _mol_data_util__WEBPACK_IMPORTED_MODULE_7__[\"ChunkedArray\"].compact(group);\n mesh.vertexCount = newVertexCount;\n mesh.triangleCount = newTriangleCount;\n _mol_util__WEBPACK_IMPORTED_MODULE_1__[\"ValueCell\"].update(vertexBuffer, newVb);\n _mol_util__WEBPACK_IMPORTED_MODULE_1__[\"ValueCell\"].update(groupBuffer, newGb);\n _mol_util__WEBPACK_IMPORTED_MODULE_1__[\"ValueCell\"].update(indexBuffer, newIb);\n _mol_util__WEBPACK_IMPORTED_MODULE_1__[\"ValueCell\"].update(normalBuffer, newNb);\n return mesh;\n }", "title": "" }, { "docid": "355a6d2ca06dd0c567586e4a246052ab", "score": "0.4861221", "text": "importMesh() {\n // The first parameter can be used to specify which mesh to import. Here we import all meshes\n BABYLON.SceneLoader.ImportMesh(\"\", src_1.MfgSettings.PATH_3DS, \"rabbit.babylon\", src_1.MfgScene.scene, function (newMeshes) {\n var rabbit = newMeshes[0];\n //transform the rabbit\n rabbit.position.y -= 4.0;\n rabbit.position.z += 60.0;\n rabbit.rotate(new BABYLON.Vector3(0.0, 1.0, 0.0), 135.0, BABYLON.Space.LOCAL);\n //rabbit.checkCollisions = true;\n src_1.MfgInit.onInitCompleted();\n });\n }", "title": "" }, { "docid": "50ddd47d09f8c07c53bbcb86271b9307", "score": "0.4856656", "text": "createBottomLevel(geometry, material, width, heigth, size){\n let step = new THREE.Mesh(geometry, material );\n step.scale.x = width;\n step.scale.y = heigth;\n step.scale.z = size;\n return step;\n }", "title": "" }, { "docid": "ab4bf6e124822870573a2fbcf197b23e", "score": "0.4855165", "text": "function tweenBetweenGeometries( mesh, from, to, amount ) {\n\n var tmp = new THREE.Vector3(),\n len = from.vertices.length,\n i;\n\n for( i = 0; i < len; i ++ ) {\n\n tmp.copy( to.vertices[i] )\n .sub( from.vertices[i] )\n .multiplyScalar( amount )\n .add( from.vertices[i] );\n\n mesh.geometry.vertices[i].copy(tmp);\n\n }\n\n mesh.geometry.verticesNeedUpdate = true;\n\n }", "title": "" }, { "docid": "b6edb75a2ab7565435eb69cc5f8244ba", "score": "0.48406878", "text": "lerpSpheres () {\n\n this.someSphereIsLerping = false\n\n for (let b=0; b<this.span; b++) {\n for (let r=0; r<this.span; r++) {\n for (let c=0; c<this.span; c++) {\n\n if (this.spheres[b][r][c] && this.spheres[b][r][c].isLerping) {\n\n this.someSphereIsLerping = true\n\n const sphere = this.spheres[b][r][c]\n const {axis} = sphere.newPos\n\n if (Math.abs(sphere.position[axis] - sphere.newPos[axis] * this.explodedMult) > 0.01) {\n sphere.position[axis] += (sphere.newPos[axis] * this.explodedMult - sphere.position[axis]) / 10\n } else {\n sphere.isLerping = false\n sphere.position[axis] = sphere.newPos[axis] * this.explodedMult\n sphere.origPos[axis] = sphere.newPos[axis]\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "b6edb75a2ab7565435eb69cc5f8244ba", "score": "0.48406878", "text": "lerpSpheres () {\n\n this.someSphereIsLerping = false\n\n for (let b=0; b<this.span; b++) {\n for (let r=0; r<this.span; r++) {\n for (let c=0; c<this.span; c++) {\n\n if (this.spheres[b][r][c] && this.spheres[b][r][c].isLerping) {\n\n this.someSphereIsLerping = true\n\n const sphere = this.spheres[b][r][c]\n const {axis} = sphere.newPos\n\n if (Math.abs(sphere.position[axis] - sphere.newPos[axis] * this.explodedMult) > 0.01) {\n sphere.position[axis] += (sphere.newPos[axis] * this.explodedMult - sphere.position[axis]) / 10\n } else {\n sphere.isLerping = false\n sphere.position[axis] = sphere.newPos[axis] * this.explodedMult\n sphere.origPos[axis] = sphere.newPos[axis]\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "ef1f5514988aeca38ff2a53f20ac809e", "score": "0.48386475", "text": "render({ time }) {\n mesh.rotation.y = 0.3*time; //time is a const, so as number goes up the y follows\n controls.update();\n renderer.render(scene, camera);\n }", "title": "" }, { "docid": "e56de08b05a394dd38261e0f80e6882a", "score": "0.48377275", "text": "update(t) {\n this.current.interpolate(this.start, this.end, t);\n }", "title": "" }, { "docid": "66a16189fe5bac45e24be5cc94808379", "score": "0.48358336", "text": "function createSceneMeshes() {\n makeMats( makeStaticMeshes );\n}", "title": "" }, { "docid": "b3697700e5e1f7937aa91556b5a1147e", "score": "0.48276016", "text": "function Submesh(mesh) {\n this.mesh = mesh;\n this.diffuse = [1, 1, 1, 1];\n this.ambient = [1, 1, 1, 1];\n this.specular = [.3, .3, .3, 1];\n this.gloss = .5;\n this.emission = [0, 0, 0, 1];\n this.normalMultiplier = 1;\n this.diffuse2D = mesh.viewer.defaultDiffuse2D;\n this.occlusion2D = mesh.viewer.defaultOcclusion2D;\n this.normal2D = mesh.viewer.defaultNormal2D;\n this.specular2D = mesh.viewer.defaultSpecular2D;\n this.gloss2D = mesh.viewer.defaultGloss2D;\n this.emission2D = mesh.viewer.defaultEmission2D;\n this.faces = [];\n mesh.submeshes.push(this);\n}", "title": "" }, { "docid": "0fae45ff04235c7b91e706e4f7bc19ae", "score": "0.48041728", "text": "function createSingleTriangleMesh(a, b, c, twosided=true) {\n\t// TODO add texture coordinates, bounding square\n\tvar omesh = new Mesh();\n\t\n\tvar va = new Vertex(), vb = new Vertex(), vc = new Vertex();\n\t\n\tva.position = $V(a);\n\tvb.position = $V(b);\n\tvc.position = $V(c);\n\t\n\tvar faceNorm = vb.position.subtract(va.position).cross(vc.position.subtract(va.position)).normalize();\n\tva.normal = vb.normal = vc.normal = faceNorm;\n\t\n\tomesh.vertices.push(va);\n\tomesh.vertices.push(vb);\n\tomesh.vertices.push(vc);\n\t\n\tvar f1 = new Face(), f2 = new Face();\n\tf1.indices.elements = [0, 1, 2];\n\tf1.normal = faceNorm; \n\tomesh.faces.push(f1);\n\t\n\tif (twosided) {\n\t\t// need a second set of verts for a double sided tri with normals pointing the opposite way\n\t\tvar vd = new Vertex(), ve = new Vertex(), vf = new Vertex();\n\t\tvd.normal = ve.normal = vf.normal = faceNorm.multiply(-1);\n\t\tvd.position = $V(a);\n\t\tvf.position = $V(c);\n\t\tve.position = $V(b);\n\t\t\n\t\tomesh.vertices.push(vd);\n\t\tomesh.vertices.push(ve);\n\t\tomesh.vertices.push(vf);\n\t\t\n\t\tvar f2 = new Face();\n\t\tf2.indices.elements = [3, 4, 5];\n\t\tf2.normal = faceNorm.multiply(-1);\n\t\tomesh.faces.push(f2);\n\t}\n\t\n\tomesh._packArrays();\n\tomesh.initBuffers;\n\t\n\treturn omesh;\n}", "title": "" }, { "docid": "2a71f573195d58a066e255182cb6bd67", "score": "0.48030066", "text": "computeNormalsFromFlatTriangles() {\n if (!this.normals)\n this.addVertexBuffer(\"normals\", \"ts_Normal\");\n // tslint:disable:no-string-literal\n //this.vertexBuffers['ts_Normal'].data = arrayFromFunction(this.vertices.length, i => V3.O)\n const TRIANGLES = this.TRIANGLES, vertices = this.vertices, normals = this.normals;\n normals.length = vertices.length;\n for (let i = 0; i < TRIANGLES.length; i += 3) {\n const ai = TRIANGLES[i], bi = TRIANGLES[i + 1], ci = TRIANGLES[i + 2];\n const a = vertices[ai];\n const b = vertices[bi];\n const c = vertices[ci];\n const normal = b.minus(a).cross(c.minus(a));\n const normal1 = normal.likeO() ? V3.O : normal.unit();\n normals[ai] = normals[ai] ? normals[ai].plus(normal1) : normal1;\n normals[bi] = normals[bi] ? normals[bi].plus(normal1) : normal1;\n normals[ci] = normals[ci] ? normals[ci].plus(normal1) : normal1;\n }\n for (let i = 0; i < vertices.length; i++) {\n normals[i] = normals[i].unit();\n }\n this.hasBeenCompiled = false;\n return this;\n }", "title": "" }, { "docid": "c4729fb07bc4910c33414d77e94cce1f", "score": "0.48003656", "text": "function drawEntireMesh() {\n clearLayer('meshLayer');\n\n var num_triangles = mesh_triangles.getSize();\n var triangle_index = 0;\n\n while (triangle_index < num_triangles) {\n var current_triangle = mesh_triangles.getTriangleByIndex(triangle_index);\n\n var vertex_index = 0;\n while (vertex_index < current_triangle.length) {\n drawVertex(current_triangle[vertex_index], current_triangle[vertex_index + 1]);\n drawLine(current_triangle[vertex_index], current_triangle[vertex_index + 1], current_triangle[(vertex_index + 2) % 6], current_triangle[(vertex_index + 3) % 6], edge_color, 'meshLayer');\n vertex_index += 2;\n }\n triangle_index++;\n }\n}", "title": "" }, { "docid": "605101d015d2cdc912c127dc0bcafb88", "score": "0.4797068", "text": "function Awake()\r\n{\r\n\t// - Initialize Arrays -\r\n\t\r\n\tvertices = new Vector3[ maxFootprints * 4 ];\r\n\tnormals = new Vector3[ maxFootprints * 4 ];\r\n\tuvs = new Vector2[ maxFootprints * 4 ];\r\n\ttriangles = new int[ maxFootprints * 6 ];\r\n\t\r\n\t// - Initialize Mesh -\r\n\t\r\n\tif ( GetComponent( MeshFilter ).mesh == null )\r\n\t{\r\n\t\tGetComponent( MeshFilter ).mesh = new Mesh();\r\n\t}\r\n\t\r\n\tmesh = GetComponent( MeshFilter ).mesh;\r\n\t\r\n\tmesh.name = \"Footprints_Mesh\";\r\n}", "title": "" }, { "docid": "8200fd7b9d63f0968fd6b41afef176c2", "score": "0.47966743", "text": "mesh() {\n return this._mesh;\n }", "title": "" }, { "docid": "8200fd7b9d63f0968fd6b41afef176c2", "score": "0.47966743", "text": "mesh() {\n return this._mesh;\n }", "title": "" }, { "docid": "0f6ee61b10b10f0288510a64e7f9460b", "score": "0.47954205", "text": "function loadTeapot(){\n\n // loading model\n // teapot model loading aided by THREE.js\n var manager = new THREE.LoadingManager();\n manager.onProgress = function (item, loaded, total) {\n console.log(item, loaded, total);\n };\n var onProgress = function (xhr) {\n if (xhr.lengthComputable) {\n var percentComplete = xhr.loaded / xhr.total * 100;\n console.log(Math.round(percentComplete, 2) + '% downloaded');\n }\n };\n var onError = function ( xhr ) {};\n\n // loading shaders\n var vertShader = document.getElementById('vertexshader').innerHTML;\n var fragShader = document.getElementById('fragmentshader').innerHTML;\n uniforms = {\n amplitude: {\n type: 'f',\n value: 0\n }\n };\n teapotMaterial = new THREE.ShaderMaterial({\n uniforms: uniforms,\n vertexShader: vertShader,\n fragmentShader: fragShader\n });\n\n\n var tpLoader = new THREE.OBJLoader(manager);\n tpLoader.load('/public/obj/teapot.obj', function(object) {\n var mesh;\n object.traverse(function(child){\n if (child instanceof THREE.Mesh) {\n child.material = teapotMaterial;\n mesh = child;\n }\n });\n\n // teapot model is refined first\n var rawTeapotGeometry = mesh.geometry;\n teapotGeometry = new THREE.Geometry().fromBufferGeometry(mesh.geometry);\n teapotGeometry.mergeVertices();\n var modifier = new THREE.SubdivisionModifier(0);\n modifier.modify( teapotGeometry );\n currentTeapotGeometry = new THREE.BufferGeometry().fromGeometry(teapotGeometry)\n\n // adding attributes to geometry of teapot\n verts = currentTeapotGeometry.attributes.position.count;\n distance = new Float32Array( verts );\n surfaceNormal = new Float32Array( verts * 3 );\n currentTeapotGeometry.addAttribute('distance', new THREE.BufferAttribute(distance, 1));\n currentTeapotGeometry.addAttribute('surfaceNormal', new THREE.BufferAttribute(surfaceNormal, 3));\n\n // insert the teapot object into scene\n var teapot = new THREE.Mesh(currentTeapotGeometry, teapotMaterial);\n teapot.name = 'teapot';\n scene.add(teapot);\n }, onProgress, onError);\n}", "title": "" }, { "docid": "6d4afc131f29408f06a4ea3557ad685a", "score": "0.47925463", "text": "createSlice (a = 1, b = 0, c = 0, d = 0) {\n this.a = a;\n this.b = b;\n this.c = c;\n this.d = d;\n\n // Compute new posMin new posMax\n let norm;\n norm = Math.sqrt(\n Math.pow(this.a, 2.0) +\n Math.pow(this.b, 2.0) +\n Math.pow(this.c, 2.0)\n );\n if (norm == 0) {\n throw new Error('Can\\t create Slice if normal vector have a ' +\n 'magnitude equal to 0');\n }\n this.a /= norm;\n this.b /= norm;\n this.c /= norm;\n\n this._posMin =\n this.a * this._min[0] +\n this.b * this._min[1] +\n this.c * this._min[2];\n\n this._posMax =\n this.a * this._max[0] +\n this.b * this._max[1] +\n this.c * this._max[2];\n\n if (this._posMin > this._posMax) {\n [this._posMin, this._posMax] = [this._posMax, this._posMin];\n }\n\n if (this._enableSlice) {\n // Compute slice\n let res = this._tetraMesh.makeSlice(\n this.a,\n this.b,\n this.c,\n -this.d\n );\n\n let planeCoordArray = new Float32Array(res['vertex']);\n let planeDataArrays = res['data'];\n\n // Create list of indices: [0, 1, 2, 3, 4, ..., i, i+1, ..., len-1]\n let len = planeCoordArray.length/3;\n let planeIndexArray = Array.from(Array(len).keys());\n\n let plane_coordAttributes = new THREE.BufferAttribute(\n planeCoordArray,\n 3\n );\n\n let sliceBF = new THREE.BufferGeometry();\n sliceBF.addAttribute('position', plane_coordAttributes);\n\n // One buffer per data respecting data names\n let dataIndex = 0;\n\n let dataDesc = {};\n Object.keys(this._inputData).forEach((dataName) => {\n dataDesc[dataName] = {};\n Object.keys(this._inputData[dataName]).forEach((componentName) => {\n let component = this._inputData[dataName][componentName];\n\n // Create new data description\n dataDesc[dataName][componentName] = {};\n dataDesc[dataName][componentName].min = component.min;\n dataDesc[dataName][componentName].max = component.max;\n dataDesc[dataName][componentName].shaderName =\n component.shaderName;\n dataDesc[dataName][componentName].node = component.node;\n\n if (!component.shaderName.endsWith('Magnitude')) {\n dataDesc[dataName][componentName].initialArray =\n component.initialArray;\n dataDesc[dataName][componentName].array =\n planeDataArrays[dataIndex];\n dataDesc[dataName][componentName].path = component.path;\n\n // Create buffers for shaders\n let bufferArray = new Float32Array(\n planeDataArrays[dataIndex]);\n let dataAttribute = new THREE.BufferAttribute(\n bufferArray,\n 1\n );\n sliceBF.addAttribute(component.shaderName, dataAttribute);\n\n dataIndex++;\n }\n });\n });\n\n let sliceMesh = new THREE.Mesh(sliceBF, this._sliceMaterial);\n\n return {\n mesh: sliceMesh,\n data: dataDesc,\n coordArray: planeCoordArray,\n facesArray: planeIndexArray\n };\n } else {\n return 0;\n }\n }", "title": "" }, { "docid": "0d09bbac577d880f24e3ac34c1c9677e", "score": "0.4786993", "text": "generateTriangles() {\n // MP2: Implement the rest of this function!\n\n // Generate the vertex positions\n var deltaX = (this.maxX - this.minX) / this.div;\n var deltaY = (this.maxY - this.minY) / this.div;\n \n for(var i = 0; i <= this.div; i++){\n for(var j = 0; j <= this.div; j++) { \n this.positionData.push(this.minX + deltaX * j);\n this.positionData.push(this.minY + deltaY * i);\n this.positionData.push(0);\n }\n } \n\n // Generate the triangle faces (with indexed vertices)\n var verticesPerSide = this.div + 1;\n\n for(var i = 0; i < this.div; i++){\n for(var j = 0; j < this.div; j++) { \n // we first generate the indices of the lower left, lower right, upper right, upper left vertices of current \"box\"\n var ul = (i + 1) * verticesPerSide + j;\n var ll = i * verticesPerSide + j;\n var lr = ll + 1;\n var ur = ul + 1;\n\n // upper triangle\n var upperTriangle = [ll, ur, ul];\n this.faceData = this.faceData.concat(upperTriangle);\n\n // lower triangle\n var lowerTriangle = [ll, lr, ur];\n this.faceData = this.faceData.concat(lowerTriangle);\n }\n } \n\n // We'll need these to set up the WebGL buffers.\n this.numVertices = this.positionData.length/3;\n this.numFaces = this.faceData.length/3;\n }", "title": "" }, { "docid": "c03f49512247ec8506a16a82a6a34e60", "score": "0.4780647", "text": "function drawIt()\n{\n for (var x = 0; x < mesh.length; x += 3)\n {\n var pulsingTranslateMatrix = translate(vecNormals[x / 3][0] * pulseEffect, vecNormals[x / 3][1] * pulseEffect, vecNormals[x / 3][2] * pulseEffect);\n stack.push(combine); // store the old matrix\n combine = mult(combine, pulsingTranslateMatrix);\n\n var ctMatrixLoc = gl.getUniformLocation(program, \"modelMatrix\");\n gl.uniformMatrix4fv(ctMatrixLoc, false, flatten(combine));\n\n gl.drawArrays(gl.LINE_LOOP, x, 3); // this draws for every 3 vertices\n\n combine = stack.pop(combine); //restore\n }\n}", "title": "" }, { "docid": "983dcca5c57b431585de8f6d48c70cf9", "score": "0.47744766", "text": "function buildGeometry(){\n\tvar gotaGeometry = new THREE.Geometry();\n\tvar vcnt = 0;\n\tvar layer = -1;\n\thslColors = [];\n\tfor(it=0; it<=options.numVertices; it++){\n\t\tvar i = it*Math.PI/options.numVertices;\n\t\tvar z = Math.cos(i);\n\t\tlayer++;\n\t\tfor(it2 = 0; it2<=options.numVertices; it2++){\n\t\t\tif(it == 0) vcnt++;\n\t\t\tvar j = (it2%options.numVertices)*2*Math.PI/options.numVertices;\n\t\t\tvar x = 0.5*(1 - Math.cos(i))*Math.sin(i)*Math.cos(j);\t\n\t\t\tvar y = 0.5*(1 - Math.cos(i))*Math.sin(i)*Math.sin(j);\n\t\t \tgotaGeometry.vertices.push(new THREE.Vector3(x,y,z));\n\t\t \thslColors.push(new THREE.Color().setHSL(i/Math.PI, 1.0, j/(2*Math.PI)));\n\t\t}\n\t\tif(it == 0) continue;\n\t\tfor(p1 = (layer-1)*vcnt, p2 = layer*vcnt; p2 < (layer+1)*vcnt-1; p1++, p2++){\n\t\t\tgotaGeometry.faces.push(new THREE.Face3(p2, p2+1, p1));\n\t\t\tgotaGeometry.faces.push(new THREE.Face3(p2+1, p1+1, p1));\n\t\t}\n\t}\n\tgotaMesh.geometry = gotaGeometry;\n}", "title": "" }, { "docid": "db842b9a486dd18447758081266848b5", "score": "0.47722104", "text": "computeNormals() {\n\n // Create an empty list of normals and fill with 0, 0, 0\n const normals = new Array(this.length).fill([0, 0, 0]);\n\n // Iterate through each of the faces in the mesh\n for (const face of this.mesh.faces) {\n\n // Add the face normal to the vertex normal\n face.map(index => normals[index] = add(normals[index], face.normal));\n }\n \n // Iterate through each of the vertices\n for (let i = 0; i < this.length; i++) {\n\n // Add the normal to the vertex\n this[i].updateNormal(unit(normals[i]));\n }\n }", "title": "" }, { "docid": "bebd752d01bcbe3f59d541c3b58190ec", "score": "0.47712418", "text": "getMesh() {\n return this.surface.build();\n }", "title": "" }, { "docid": "11f94cbdd6cb73e0d9f76e1ccf644707", "score": "0.4759384", "text": "function easeOutQuad(t) {\n return t * (2 - t);\n }", "title": "" }, { "docid": "d805ca695ffdb0ddbfdb11cba93387bc", "score": "0.4756696", "text": "function interpolateNormals(state, controls) {\n var curvePoints = state.curvePoints, tangentVectors = state.tangentVectors, normalVectors = state.normalVectors, binormalVectors = state.binormalVectors;\n var firstDirection = controls.d12, lastDirection = controls.d23;\n var n = curvePoints.length / 3;\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].fromArray(firstTangentVec, tangentVectors, 0);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].fromArray(lastTangentVec, tangentVectors, (n - 1) * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].orthogonalize(firstNormalVec, firstTangentVec, firstDirection);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].orthogonalize(lastNormalVec, lastTangentVec, lastDirection);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].matchDirection(lastNormalVec, lastNormalVec, firstNormalVec);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].copy(prevNormal, firstNormalVec);\n for (var i = 0; i < n; ++i) {\n var t = i === 0 ? 0 : 1 / (n - i);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].fromArray(tangentVec, tangentVectors, i * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].orthogonalize(normalVec, tangentVec, _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].slerp(tmpNormal, prevNormal, lastNormalVec, t));\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].toArray(normalVec, normalVectors, i * 3);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].copy(prevNormal, normalVec);\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].normalize(binormalVec, _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].cross(binormalVec, tangentVec, normalVec));\n _mol_math_linear_algebra__WEBPACK_IMPORTED_MODULE_0__[\"Vec3\"].toArray(binormalVec, binormalVectors, i * 3);\n }\n}", "title": "" }, { "docid": "cb5a7b208f4a5bd838b3d07edce0d7b8", "score": "0.475017", "text": "function createBoxe (data) {\n var box = new THREE.BoxGeometry (data['lineWidth'] * 4, 5, data['lineWidth'] * 4);\n var cyl = new THREE.CylinderGeometry (data['lineWidth'], data['lineWidth'], data['depth'], 10, 10, false, 0, 6.3);\n var sphere = new THREE.SphereGeometry (data['sphereRadius'], 10, 10);\n var cyl_mat = new THREE.MeshLambertMaterial ({color : data['lineColor']}); \n var sph_mat = new THREE.MeshLambertMaterial ({color : data['sphereColor']});\n\n var cyl_mesh = new THREE.Mesh (cyl, cyl_mat);\n cyl_mesh.position.x = data ['x'];\n cyl_mesh.position.y = (data ['z'] - data['depth'] / 2);\n cyl_mesh.position.z = data ['y'];\n cyl_mesh.castShadow = true;\n cyl_mesh.idPuit = data['idPuit'];\n \n var box_mesh = new THREE.Mesh (box, cyl_mat);\n box_mesh.position.x = data['x'];\n box_mesh.position.z = data['y'];\n box_mesh.position.y = data ['z'];\n box_mesh.castShadow = true;\n box_mesh.name = data['labelTop'];\n box_mesh.idPuit = data['idPuit'];\n \n var sph_mesh = new THREE.Mesh (sphere, sph_mat);\n sph_mesh.position.x = data['x'];\n sph_mesh.position.y = data['z'] - data['depth'];\n sph_mesh.position.z = data['y'];\n sph_mesh.castShadow = true;\n sph_mesh.name = data['labelBot'];\n sph_mesh.idPuit = data['idPuit'];\n \n return [sph_mesh, cyl_mesh, box_mesh];\n}", "title": "" }, { "docid": "daf4b488886aae11a604f505c63530bc", "score": "0.47469917", "text": "function onResourcesLoaded(){\n\n // Clone models into meshes; [Michiel: AFAIK this makes a \"shallow\" copy of the model,\n // i.e., creates references to the geometry, and not full copies ]\n meshes[\"armadillo1\"] = models.armadillo.mesh.clone();\n meshes1.push(meshes[\"armadillo1\"]);\n meshes[\"bunny1\"] = models.bunny.mesh.clone();\n meshes1.push(meshes[\"bunny1\"]);\n meshes[\"teapot1\"] = models.teapot.mesh.clone();\n meshes1.push(meshes[\"teapot1\"]);\n meshes[\"minicooper1\"] = models.minicooper.mesh.clone();\n meshes[\"minicooper2\"] = models.minicooper.mesh.clone();\n meshes1.push(meshes[\"minicooper2\"]);\n meshes[\"trex1\"] = models.trex.mesh.clone();\n meshes1.push(meshes[\"trex1\"]);\n meshes[\"trex2\"] = models.trex.mesh.clone();\n meshes1.push(meshes[\"trex2\"]);\n\n // Reposition individual meshes, then add meshes to scene\n\n meshes[\"armadillo1\"].position.set(-7, 1.5, 2);\n meshes[\"armadillo1\"].rotation.set(0,-Math.PI/2,0);\n meshes[\"armadillo1\"].scale.set(1.5,1.5,1.5);\n scene.add(meshes[\"armadillo1\"]);\n\n //meshes[\"bunny1\"].position.set(-5, 0.2, 8);\n meshes[\"bunny1\"].rotation.set(0, Math.PI, 0);\n meshes[\"bunny1\"].scale.set(0.8,0.8,0.8);\n scene.add(meshes[\"bunny1\"]);\n scene.remove(meshes[\"bunny1\"]);\n\n //meshes[\"teapot1\"].position.set(3, 0, -6);\n meshes[\"teapot1\"].scale.set(0.5, 0.5, 0.5);\n scene.add(meshes[\"teapot1\"]);\n scene.remove(meshes[\"teapot1\"]);\n\n //meshes[\"minicooper1\"].position.set(-2, 0, 3);\n meshes[\"minicooper1\"].scale.set(0.025, 0.025, 0.025);\n meshes[\"minicooper1\"].rotation.set(-Math.PI/2, 0, Math.PI/2);\n scene.add(meshes[\"minicooper1\"]);\n scene.remove(meshes[\"minicooper1\"]);\n\n //meshes[\"minicooper2\"].position.set(6, 0, 6);\n meshes[\"minicooper2\"].scale.set(0.025, 0.025, 0.025);\n meshes[\"minicooper2\"].rotation.set(-Math.PI/2, 0, Math.PI/2);\n scene.add(meshes[\"minicooper2\"]);\n scene.remove(meshes[\"minicooper2\"]);\n\n //meshes[\"trex1\"].position.set(-4, 1.90, -2);\n meshes[\"trex1\"].scale.set(1.5,1.5,1.5);\n meshes[\"trex1\"].rotation.set(0,-Math.PI/2, 0);\n scene.add(meshes[\"trex1\"]);\n scene.remove(meshes[\"trex1\"]);\n\n // note: we will be animating trex2, so these transformations will be overwritten anyhow\n //meshes[\"trex2\"].position.set(0, 1.9, 3);\n meshes[\"trex2\"].scale.set(1.5,1.5,1.5);\n meshes[\"trex2\"].rotation.set(0,-Math.PI/2, 0);\n scene.add(meshes[\"trex2\"]);\n scene.remove(meshes[\"trex2\"]);\n}", "title": "" }, { "docid": "549dc2a7b57add0145ebb9643226c6ae", "score": "0.4744822", "text": "function loadTriangles() {\n if (inputTriangles != String.null) {\n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n\n for (var whichSet = 0; whichSet < inputTriangles.length; whichSet++) {\n var coordArray = []; // 1D array of vertex coords for WebGL\n var indexArray = []; // 1D array of vertex indices for WebGL\n var vtxBufferSize = 0; // the number of vertices in the vertex buffer\n var vtxToAdd = []; // vtx coords to add to the coord array\n var indexOffset = vec3.create(); // the index offset for the current set\n var triToAdd = vec3.create(); // tri indices to add to the index array\n\n var tri_amb = [];\n var tri_diff = [];\n var tri_spec = [];\n var nArray = [];\n var diffToAdd = [];\n var specToAdd = [];\n var ambToAdd = [];\n\n\n var normalArray = [];\n var normToAdd = [];\n\n var Center = vec3.create();\n\n vec3.set(indexOffset, vtxBufferSize, vtxBufferSize, vtxBufferSize); // update vertex offset\n triBufferSize = 0;\n\n\n // set up the vertex coord array\n for (whichSetVert = 0; whichSetVert < inputTriangles[whichSet].vertices.length; whichSetVert++) {\n \n\n nArray.push(inputTriangles[whichSet].material.n);\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert];\n diffToAdd = inputTriangles[whichSet].material.diffuse;\n specToAdd = inputTriangles[whichSet].material.specular;\n ambToAdd = inputTriangles[whichSet].material.ambient;\n normToAdd = inputTriangles[whichSet].normals[whichSetVert];\n for (var i=0; i<3; i++) \n {\n coordArray.push(vtxToAdd[i]);\n tri_diff.push(diffToAdd[i]);\n tri_spec.push(specToAdd[i]);\n tri_amb.push(ambToAdd[i]);\n normalArray.push(normToAdd[i]);\n }\n vec3.add(Center, Center, vtxToAdd);\n } // end for vertices in set\n vec3.scale(Center, Center, 1.0 / inputTriangles[whichSet].vertices.length);\n\n // set up the triangle index array, adjusting indices across sets\n for (whichSetTri = 0; whichSetTri < inputTriangles[whichSet].triangles.length; whichSetTri++) {\n vec3.add(triToAdd, indexOffset, inputTriangles[whichSet].triangles[whichSetTri]);\n indexArray.push(triToAdd[0], triToAdd[1], triToAdd[2]);\n } // end for triangles in set\n\n vtxBufferSize += inputTriangles[whichSet].vertices.length; // total number of vertices\n triBufferSize += inputTriangles[whichSet].triangles.length; // total number of tris\n\n triBufferSize *= 3; // now total number of indices\n\n // send the vertex coords to webGL\n vertexBuffer = gl.createBuffer(); // init empty vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(coordArray), gl.STATIC_DRAW); // coords to that buffer\n // send the triangle indices to webGL\n triangleBuffer = gl.createBuffer(); // init empty triangle index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffer); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indexArray), gl.STATIC_DRAW); // indices to that buffer\n\n \n nBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, nBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(nArray), gl.STATIC_DRAW);\n normBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, normBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(normalArray), gl.STATIC_DRAW);\n\n diffBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, diffBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(tri_diff), gl.STATIC_DRAW);\n specBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, specBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(tri_spec), gl.STATIC_DRAW);\n ambiBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, ambiBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(tri_amb), gl.STATIC_DRAW);\n\n // console.log(\"coordinates: \"+coordArray.toString());\n // console.log(\"numverts: \"+vtxBufferSize);\n // console.log(\"indices: \"+indexArray.toString());\n // console.log(\"numindices: \"+triBufferSize);\n \n mdMatrix = mat4.create();\n\n if (sel_tri == whichSet) {\n mdMatrix = mat4.multiply(mat4.create(),\n mat4.fromTranslation(mat4.create(), vec3.scale(vec3.create(), Center, -1)),\n mdMatrix);\n mdMatrix = mat4.multiply(mat4.create(),\n mat4.scale(mat4.create(), mat4.create(), [1.2, 1.2, 1.2]),\n mdMatrix);\n mdMatrix = mat4.multiply(mat4.create(),\n mat4.fromTranslation(mat4.create(), Center),\n mdMatrix);\n }\n mdMatrix = mat4.multiply(mat4.create(),\n mat4.fromTranslation(mat4.create(), vec3.scale(vec3.create(), Center, -1)),\n mdMatrix);\n mat4.multiply(mdMatrix, triRMatrix[whichSet], mdMatrix);\n mdMatrix = mat4.multiply(mat4.create(),\n mat4.fromTranslation(mat4.create(), Center),\n mdMatrix);\n\n mat4.multiply(mdMatrix, triMatrix[whichSet], mdMatrix);\n gl.uniform1i(shaderProgram.lightModelUniform, inputTriangles[whichSet].lightModel);\n\n renderTriangles();\n } // end for each triangle set\n\n } // end if triangles found\n} // end load triangles", "title": "" }, { "docid": "bcb38c21afde2858d84399630377a9c6", "score": "0.47393155", "text": "function createTopbar() {\n\n \tvar elements = [];\n \tvar len = 0;\n \tfor (var i = 0; i < faces.length; i++) {\n \n var text = faces[i];\n \t\t \t\t\t\t\n\t\tvar textGeo = new THREE.TextGeometry( text, {\n\n\t\t\tsize: 12,\n\t\t\theight: 2,\n\t\t\tcurveSegments: 4,\n\n\t\t\tfont: \"helvetiker\",\n\t\t\t// weight: \"bold\",\n\t\t\tstyle: \"normal\",\n\n\t\t\tbevelThickness: 1,\n\t\t\tbevelSize: 0.9,\n\t\t\tbevelEnabled: true,\n\n\t\t\tmaterial: 0,\n\t\t\textrudeMaterial: 1\n\n\t\t});\n\n var key = Object.keys(faceColors)[i];\n var col = faceColors[key];\n\n\t var uniforms =\n\t\t{ \n\t\t\t\"c\": { type: \"f\", value: 1.0 },\n\t\t\t\"p\": { type: \"f\", value: 1.4 },\n\t\t\tglowColor: { type: \"c\", value: new THREE.Color( col ) },\n\t\t\tviewVector: { type: \"v3\", value: camera.position }\n\t\t}\n\t\tvar glowMaterial = new newMaterial ( \"glowvert\", \"glowfrag\", uniforms );\n\n\t\tvar textGlowMesh = new THREE.Mesh( textGeo, glowMaterial );\n textGlowMesh.applyMatrix( new THREE.Matrix4().makeTranslation( i*14+len*15 - 290, 320, 20 )); \n textGlowMesh.scale.multiplyScalar(1.5);\n\t\telements.push( textGlowMesh );\n\n\t\tlen += text.length;\n\n \t}\n\n \treturn elements;\n\n}", "title": "" }, { "docid": "a731834948833523f5c6776eb904b394", "score": "0.47340232", "text": "function plotTrajectorySpheres(timestart, timeend, tList, univ){\n\tfor (var i = timestart; i < timeend; i++){\n\t\tvar spheres = Vector();\n\t\tfor (var j = 0; j < tList.size(); j++) {\n\t\t\tvar curtraj = tList.get(j);\n\t\t\tif (CheckTimePointExists(i, curtraj.timepoints)){\n\t\t\t\tIJ.log(curtraj.id);\n\t\t\t\tvar ind = curtraj.timepoints.indexOf(i);\n\t\t\t\tvar p3f = curtraj.dotList.get(ind);\n\t\t\t\tvar curtime = curtraj.timepoints.get(ind);\n\t\t\t\tvar sphere = Mesh_Maker.createSphere(p3f.x, p3f.y, p3f.z, 2.0, 24.0, 24.0);\n\t\t\t\tspheres.addAll(sphere);\n\t\t\t}\n\t\t}\n\t\tvar csp = CustomTriangleMesh(spheres, colw, 0.0);\n\t\tvar ccs = ContentCreator.createContent(csp, \"dotstime\" + Integer.toString(i), i-timestart);\n\t\tuniv.addContent(ccs);\n\t}\n}", "title": "" }, { "docid": "38e8fbc4a6398f33735856ffe0f9435e", "score": "0.4733007", "text": "constructor(position) {\n //Construct the superclass.\n super(position);\n\n //[ Base].\n let Base1= new THREE.BoxGeometry(35, 10, 10);\n let Base2 = new THREE.MeshBasicMaterial({ \n map: ENGINE.TextureLoader().loadTexture( 'dartsGame/stripes.jpeg' ) \n });\n \n let Base = new THREE.Mesh(Base1, Base2);\n Base.castShadow = true;\n Base.receiveShadow = true;\n \n //[ tabletop].\n let tabletop1= new THREE.BoxGeometry(35, 1.5, 11);\n let tabletop2= new THREE.MeshPhongMaterial( { color: 0x654321 } );\n let tabletop = new THREE.Mesh(tabletop1, tabletop2);\n tabletop.castShadow = true;\n tabletop.receiveShadow = true;\n tabletop.position.y = 5.7;\n tabletop.position.z = 0.2;\n \n //back pane\n let backPane1 = new THREE.PlaneGeometry( 35, 18 );\n let backPane2= new THREE.MeshBasicMaterial({ \n map: ENGINE.TextureLoader().loadTexture( 'dartsGame/sign.jpg' ),\n side: THREE.FrontSide,\n flatShading: THREE.FlatShading\n });\n let backPane = new THREE.Mesh(backPane1, backPane2);\n backPane.castShadow = true;\n backPane.receiveShadow = true;\n backPane.position.z = -4.8;\n backPane.position.y = 15;\n\n //backBorder\n let backBorder1 = new THREE.BoxGeometry( 38, 30, 0.5 );\n let backBorder2 = new THREE.MeshPhongMaterial( { color: 0x654321} );\n let backBorder = new THREE.Mesh(backBorder1, backBorder2);\n backBorder.castShadow = true;\n backBorder.receiveShadow = true;\n backBorder.position.z = -5.2;\n backBorder.position.y = 10;\n\n //[balloon1].\n let balloon11= new THREE.TorusBufferGeometry(0.2, 1, 20, 100);\n let balloon12= new THREE.MeshPhongMaterial( { color: 0xffff00 } );\n let balloon1 = new THREE.Mesh(balloon11, balloon12);\n balloon1.castShadow = true;\n balloon1.receiveShadow = true;\n balloon1.position.y = 21.5;\n balloon1.position.z = -4.2;\n balloon1.position.x = -5; \n\n //[balloon2].\n let balloon21= new THREE.TorusBufferGeometry(0.2, 1, 20, 100);\n let balloon22= new THREE.MeshPhongMaterial( { color: 0xffff00 } );\n let balloon2 = new THREE.Mesh(balloon21, balloon22);\n balloon2.castShadow = true;\n balloon2.receiveShadow = true;\n balloon2.position.y = 21.5;\n balloon2.position.z = -4.2;\n balloon2.position.x = 5; \n \n //[balloon3].\n let balloon31= new THREE.TorusBufferGeometry(0.2, 1, 20, 100);\n let balloon32= new THREE.MeshPhongMaterial( { color: 0xffff00 } );\n let balloon3 = new THREE.Mesh(balloon31, balloon32);\n balloon3.castShadow = true;\n balloon3.receiveShadow = true;\n balloon3.position.y = 19;\n balloon3.position.z = -4.2;\n balloon3.position.x = 12; \n \n //[balloon4].\n let balloon41= new THREE.TorusBufferGeometry(0.2, 1, 20, 100);\n let balloon42= new THREE.MeshPhongMaterial( { color: 0xffff00 } );\n let balloon4 = new THREE.Mesh(balloon41, balloon42);\n balloon4.castShadow = true;\n balloon4.receiveShadow = true;\n balloon4.position.y = 11;\n balloon4.position.z = -4.2;\n balloon4.position.x = 12; \n \n //[balloon5].\n let balloon51= new THREE.TorusBufferGeometry(0.2, 1, 20, 100);\n let balloon52= new THREE.MeshPhongMaterial( { color: 0xffff00 } );\n let balloon5 = new THREE.Mesh(balloon51, balloon52);\n balloon5.castShadow = true;\n balloon5.receiveShadow = true;\n balloon5.position.y = 9;\n balloon5.position.z = -4.2;\n balloon5.position.x = 5; \n \n //[balloon6].\n let balloon61= new THREE.TorusBufferGeometry(0.2, 1, 20, 100);\n let balloon62= new THREE.MeshPhongMaterial( { color: 0xffff00 } );\n let balloon6 = new THREE.Mesh(balloon61, balloon62);\n balloon6.castShadow = true;\n balloon6.receiveShadow = true;\n balloon6.position.y = 9;\n balloon6.position.z = -4.2;\n balloon6.position.x = -5; \n \n //[balloon7].\n let balloon71= new THREE.TorusBufferGeometry(0.2, 1, 20, 100);\n let balloon72= new THREE.MeshPhongMaterial( { color: 0xffff00 } );\n let balloon7 = new THREE.Mesh(balloon71, balloon72);\n balloon7.castShadow = true;\n balloon7.receiveShadow = true;\n balloon7.position.y = 11;\n balloon7.position.z = -4.2;\n balloon7.position.x = -12; \n \n //[balloon8].\n let balloon81= new THREE.TorusBufferGeometry(0.2, 1, 20, 100);\n let balloon82= new THREE.MeshPhongMaterial( { color: 0xffff00 } );\n let balloon8 = new THREE.Mesh(balloon81, balloon82);\n balloon8.castShadow = true;\n balloon8.receiveShadow = true;\n balloon8.position.y = 19;\n balloon8.position.z = -4.2;\n balloon8.position.x = -12;\n\n //Add to the object group.\n this.addObjectToGroup(Base);\n this.addObjectToGroup(tabletop);\n this.addObjectToGroup(backPane);\n this.addObjectToGroup(backBorder);\n this.addObjectToGroup(balloon1);\n this.addObjectToGroup(balloon2);\n this.addObjectToGroup(balloon3);\n this.addObjectToGroup(balloon4);\n this.addObjectToGroup(balloon5);\n this.addObjectToGroup(balloon6);\n this.addObjectToGroup(balloon7);\n this.addObjectToGroup(balloon8);\n\n //Scale and position the game.\n this.getInstance().scale.set(0.75, 0.75, 0.75);\n this.getInstance().position.set(-20, 2.8, -350);\n this.getInstance().rotation.set(0,Math.PI/2,0);\n\n\n /**\n * Updates once every frame.\n * (Abstract class which must be overridden from the superclass.)\n * @param {number} frameTime - The time taken to compute the previous\n * frame of animation. \n */\n this.update = function(frameTime) { }\n }", "title": "" }, { "docid": "c61fe831768368f0e385d868f8a47071", "score": "0.472155", "text": "createGeometries(object) {\n object.traverse(child=>{\n\n //Not a mesh we care about\n if(!child.geometry || !child.geometry.faces || !child.geometry.faces.length) {\n return;\n }\n\n //A mesh we care about!\n this.createGeometry(child);\n });\n\n ThreeHub.scene.addAll(this.parts);\n }", "title": "" }, { "docid": "93f2f74fc43a56bd8bcad607628b09a0", "score": "0.47176623", "text": "constructor(meshData){\n this.walls = [];\n this.walltorches = [];\n this.floors = [];\n this.corners = [];\n\n meshData.submeshes.forEach((m, i) => {\n if(m.name.indexOf('floor') >= 0){\n this.floors.push(i);\n }else if(m.name.indexOf('walltorch') >= 0){\n this.walltorches.push(i);\n }else if(m.name.indexOf('wall') >= 0){\n this.walls.push(i);\n }else if(m.name.indexOf('corner') >= 0){\n this.corners.push(i);\n }\n });\n }", "title": "" }, { "docid": "e9b742ea87a2df1a6ae8087fb6ccf0bd", "score": "0.47122255", "text": "split() {\n const x = this.bounds.x;\n const y = this.bounds.y;\n const halfWidth = this.bounds.width/2;\n const halfHeight = this.bounds.height/2;\n \n this.nodes[0] = new Quadtree(this.level+1, new Rect(x, y+halfHeight, halfWidth, halfHeight));\n this.nodes[1] = new Quadtree(this.level+1, new Rect(x, y, halfWidth, halfHeight));\n this.nodes[2] = new Quadtree(this.level+1, new Rect(x+halfWidth, y, halfWidth, halfHeight));\n this.nodes[3] = new Quadtree(this.level+1, new Rect(x+halfWidth, y+halfHeight, halfWidth, halfHeight));\n }", "title": "" }, { "docid": "5d4569ebe74c4971f424165a9993568f", "score": "0.4703086", "text": "static slerp(a, b, t){\n \n\t\tlet ax = a[0],\n\t\t\tay = a[1],\n\t\t\taz = a[2],\n\t\t\taw = a[3],\n\t\t\tbx = b[0],\n\t\t\tby = b[1],\n\t\t\tbz = b[2],\n\t\t\tbw = b[3],\n\t\t\tomega, cosom, sinom, scale0, scale1; // calculate cosine\n\n\t\t\tcosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n\t\tif (cosom < 0.0) \n\t\t{\n\t\t\tcosom = -cosom;\n\t\t\tbx = -bx;\n\t\t\tby = -by;\n\t\t\tbz = -bz;\n\t\t\tbw = -bw;\n\t\t} // calculate coefficients\n\n\t\tif (1.0 - cosom > EPSILON)\n\t\t{\n\n\t\t // standard case (slerp)\n\t\t omega = Math.acos(cosom);\n\t\t sinom = Math.sin(omega);\n\t\t scale0 = Math.sin((1.0 - t) * omega) / sinom;\n\t\t scale1 = Math.sin(t * omega) / sinom;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t// 'from' and 'to' quaternions are very close\n\t\t\t// ... so we can do a linear interpolation\n\t\t\tscale0 = 1.0 - t;\n\t\t\tscale1 = t;\n\t\t} // calculate final values\n\n\t\tthis[0] = scale0 * ax + scale1 * bx;\n\t\tthis[1] = scale0 * ay + scale1 * by;\n\t\tthis[2] = scale0 * az + scale1 * bz;\n\t\tthis[3] = scale0 * aw + scale1 * bw;\n\t\treturn this;\n\t}", "title": "" }, { "docid": "e58b15f2344cb4266dc4547f792de80e", "score": "0.47028527", "text": "function traverseMeshes(cb) {\n object.traverse(function (child) {\n if (child.isMesh === true) {\n var mesh = child;\n var geometry = mesh.geometry;\n\n if (geometry.isGeometry === true) {\n geometry = geomToBufferGeom.get(geometry);\n }\n\n if (geometry.isBufferGeometry === true) {\n if (geometry.getAttribute('position') !== undefined) {\n cb(mesh, geometry);\n }\n }\n }\n });\n } // Default options", "title": "" }, { "docid": "5d41e70fdae785dc6f2b974cd98a16bf", "score": "0.46939328", "text": "th(t, e, s) {\n return e.pe() ? this.Mh(t, e.path) : e.He() ? this.xh(t, e, s) : this.qh(t, e, s);\n }", "title": "" } ]
e6768f1a0164f4261d4b8a0ee71d3a24
unhide elements for pumpkin
[ { "docid": "4452f726827ce320cfa3876d4b04aaf8", "score": "0.78563285", "text": "function unhide()\r\n{\r\n if (document.querySelector('.pumpkin').style.visibility == \"visible\")\r\n {\r\n document.querySelector('.pumpkin').style.visibility = \"hidden\";\r\n }\r\n else\r\n {\r\ndocument.querySelector('.pumpkin').style.visibility = \"visible\";\r\n }\r\n}", "title": "" } ]
[ { "docid": "d73ab768ecdb8c3b99ed5123954c6d5d", "score": "0.7126898", "text": "function hideElements(flag) {\n for (var i = 0; i < buttons.length; i++) {\n setProperty(buttons[i], \"hidden\", flag);\n // Disable amount slider on fixed sample size graphs\n if (buttons[i] == \"bubbleAmtSlider\" && (graph == \"color wheel\" || graph == \"color palette\")) {\n setProperty(buttons[i], \"hidden\", true);\n }\n }\n }", "title": "" }, { "docid": "9fe8dcca7c29c945d4b549c7126b1126", "score": "0.7075256", "text": "hide() {\n gsap.to(this.DOM.el, {duration: 0.8, opacity: 0});\n }", "title": "" }, { "docid": "bcb2a2a5d3b4d5e464e726d528673c72", "score": "0.6985533", "text": "unhide() {\n this.nh.style.opacity = '1';\n }", "title": "" }, { "docid": "3295d0b8a69734e4e29387c4101b28dc", "score": "0.69600576", "text": "unHide() {\n this.setState({ isHidden: false });\n this.setState({\n printerProperty: \"Printer list-group-item active\"\n })\n }", "title": "" }, { "docid": "2ec93cf142e5ba8c5d35b82a904621ea", "score": "0.6907589", "text": "hide() {}", "title": "" }, { "docid": "8da01f675fa3db4ab620781839b9ae90", "score": "0.68786407", "text": "hide () {\n this.visible = false;\n }", "title": "" }, { "docid": "6fa99e33b28e7bbb0bef7c902c5875ef", "score": "0.68494457", "text": "hide(element) {\n element.attr('visibility', 'hidden');\n }", "title": "" }, { "docid": "efa608afd82b56724f9797685eebbf15", "score": "0.6818868", "text": "function hide(ninja) {\n ninja.visibility = false;\n}", "title": "" }, { "docid": "efa608afd82b56724f9797685eebbf15", "score": "0.6818868", "text": "function hide(ninja) {\n ninja.visibility = false;\n}", "title": "" }, { "docid": "f647fd156cf4b15c38abb59db5d369a3", "score": "0.68060815", "text": "doHidden( element ) {\n element.style.display = 'none';\n }", "title": "" }, { "docid": "220bf1e8c7357a37f2b82530190d2578", "score": "0.6800458", "text": "hide() {\n if (this.displayed) {\n var dom = this.dom;\n if (dom.box.parentNode) {\n dom.box.parentNode.removeChild(dom.box);\n }\n\n if (this.options.showStipes) {\n if (dom.line.parentNode) {\n dom.line.parentNode.removeChild(dom.line);\n }\n if (dom.dot.parentNode) {\n dom.dot.parentNode.removeChild(dom.dot);\n }\n }\n this.displayed = false;\n }\n }", "title": "" }, { "docid": "13833ec8a1b63686e911d7cfbf3313e7", "score": "0.6799176", "text": "invisible()\n {\n for (let container of this.containers)\n {\n container.children.forEach(object => object[this.visible] = false)\n }\n }", "title": "" }, { "docid": "eef72d42726fb9ca59b80de4fbb23d4c", "score": "0.6761417", "text": "hide() {\n\t\tthis.element.style.visibility = 'hidden';\n\t}", "title": "" }, { "docid": "fdb80f09220310443414badee598b246", "score": "0.6755681", "text": "function hideElements() {\n\t\tconst elementsArr = [\n\t\t\t$submitForm,\n\t\t\t$allStoriesList,\n\t\t\t$filteredArticles,\n\t\t\t$ownStories,\n\t\t\t$loginForm,\n\t\t\t$createAccountForm,\n\t\t\t$userProfile,\n\t\t\t$favoritedStories\n\t\t];\n\t\telementsArr.forEach(($elem) => $elem.hide());\n\t}", "title": "" }, { "docid": "f723c2fb88adf6c66d10b924a3990081", "score": "0.6755091", "text": "hide() {\n this.visible = false;\n }", "title": "" }, { "docid": "248a6da618849146ed64c74314266eb9", "score": "0.6754651", "text": "hide() {\r\n this.node.node.setAttribute(\"visibility\", \"hidden\");\r\n this.isVisible = false;\r\n }", "title": "" }, { "docid": "0e3a375ec2d9a3f9243b8839f4ab4dfc", "score": "0.6719375", "text": "function hideElements() {\n imageClear();\n\n // hides the canvas drawing\n $('#drawing').hide();\n\n // hides all divs\n $('div').hide();\n\n // hides all buttons\n $(':button').hide();\n\n // unbinds all buttons\n $(':button').unbind();\n}", "title": "" }, { "docid": "04dc3fd62e390f9a193f332c64ef4edd", "score": "0.6718926", "text": "function unhideElement(element) {\n element.classList.remove(\"hidden\");\n}", "title": "" }, { "docid": "455bcd25e58c3a72b2d537f31ff9f907", "score": "0.6691779", "text": "hide() {\n this.container.classList.remove('bitski-visible', 'bitski-loaded');\n }", "title": "" }, { "docid": "1a67725912b3cc0de1e7ec477b8875bc", "score": "0.6683759", "text": "function turnOffTV() {\n $(\".space\").css(\"visibility\", \"hidden\");\n $(\".mountains\").css(\"visibility\", \"hidden\");\n $(\".football\").css(\"visibility\", \"hidden\");\n $(\".beach\").css(\"visibility\", \"hidden\");\n }", "title": "" }, { "docid": "8d4c87cc10cd7cf4cfe7bcddc6defecd", "score": "0.6665908", "text": "hide() {\n this.el.html(\"\");\n }", "title": "" }, { "docid": "516b4ae35d26d6882e6f256ccc5cb176", "score": "0.66475636", "text": "function displayOff(me){\n\t\t\tvar elem = getElement(me);\n\t\t\tif(elem){\n\t\t\t\telem.style.display=\"none\";\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "9447417606f9150fd6b54d0a5eafefd5", "score": "0.6613281", "text": "hideAll() {\n this.hide();\n }", "title": "" }, { "docid": "5836821a43502b0c604330c39281c987", "score": "0.66122127", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $favoritedArticlesList,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $userProfile\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "9247104703800159aaf084d84502497b", "score": "0.66083366", "text": "function setVisible(elem) {\n elem.removeClass('invisible');\n}", "title": "" }, { "docid": "2eb1d57298ea0c4516b5430125a54a8d", "score": "0.66018933", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $userProfile,\n $favoriteArticles,\n $userStories,\n ];\n elementsArr.forEach(($elem) => $elem.hide());\n }", "title": "" }, { "docid": "c495a582bc56be0c17addf25da66d795", "score": "0.65995216", "text": "hide(){\n this._plane.visible = false;\n }", "title": "" }, { "docid": "3b506a11adb7e534ffca67f54ffc4f20", "score": "0.65893674", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "f664e072863a3f83cf122b055262c0f7", "score": "0.6589348", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $favoritedStories\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "3ac5e8a51cec454e703b5a6e9fce0e11", "score": "0.6587956", "text": "function unhide(steg) {\n const result = steg.unhide();\n if (result.error) {\n console.error(result.error);\n }\n else {\n console.log(result.msg);\n }\n}", "title": "" }, { "docid": "1d9872824ab4f40babcbd4c56d9fab88", "score": "0.65851355", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredStories,\n $ownStories,\n $userProfile,\n $favoritedStories,\n $loginForm,\n $createAccountForm,\n ];\n elementsArr.forEach(($elem) => $elem.hide());\n }", "title": "" }, { "docid": "88e3e47bfa7d8312308c25e2d5f0db9a", "score": "0.6582993", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach(val => val.hide());\n }", "title": "" }, { "docid": "c6a5769bd87a1898882fc0524cf1d74f", "score": "0.6575048", "text": "function hideTiles() {\r\n btn_english_state = false;\r\n document.getElementById(\"english-translation\").className = \"invisible\";\r\n btn_conjugate_state = false;\r\n document.getElementById(\"imperfectum\").className = \"invisible\";\r\n document.getElementById(\"perfectum\").className = \"invisible\";\r\n}", "title": "" }, { "docid": "87e8fb6eef46b490d4dc347ef0f9a821", "score": "0.6566537", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $loginForm,\n $createAccountForm,\n $myArticles,\n $favoritedArticles,\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "d97deb29c5ddb09070d4fbeccb7719c1", "score": "0.65618587", "text": "function untriggerInfo() {\n Array.from(document.getElementById('blurb').children).forEach( (node) => {\n node.classList.add('hidden')\n })\n}", "title": "" }, { "docid": "8ae06070ab4160ab43201238ac547bb5", "score": "0.6557717", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $allFavoritesList\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "1a32c83daaac608e71b6221cec9e938b", "score": "0.65564096", "text": "function unHide(el) {\n el.classList.add(\"show\")\n el.classList.remove(\"hide\")\n}", "title": "" }, { "docid": "8d35812c4a873a1a08b066796473564e", "score": "0.6548365", "text": "hide() {\n this.$el.css('display', 'none');\n }", "title": "" }, { "docid": "7a9b2e8ea5bb44d40150adb01f14d776", "score": "0.6544476", "text": "function hideNonExportableElements() {\n\t\t\td3.selectAll(\".hidden-in-export\").style(\"display\", \"none\");\n\t\t}", "title": "" }, { "docid": "f6f66b16e2360c3628898a727a3769d7", "score": "0.6541488", "text": "hide()\n {\n this.isVisible = false;\n }", "title": "" }, { "docid": "16982d89973bbded4916159960dfa8a8", "score": "0.65286094", "text": "function hideFetchPokemonsButton() {\n changeElementVisibility(buttonFetchElement, false);\n changeElementVisibility(buttonFetchErrorElement, false);\n}", "title": "" }, { "docid": "1c96383099d9ffb32f2abef13331e340", "score": "0.6522175", "text": "function hide() {\n //el(\"btnSubmit\").visible=\"false\" ;\n}", "title": "" }, { "docid": "181a41e1ec929a0a0fcced55a188b109", "score": "0.6513626", "text": "function hideNonExportableElements() {\n\t\td3.selectAll(\".hidden-in-export\").style(\"display\", \"none\");\n\t}", "title": "" }, { "docid": "45343019577d211f96c64d2e3e7a6fc5", "score": "0.6510688", "text": "unhide(e) {\n \n const el = document.querySelector(\".hideBox#\"+ e.target.textContent);\n const list = this.state.minbuttons;\n\n if (el) {\n let class_name = el.getAttribute(\"class\").replace(\" hideBox\",\"\");\n el.setAttribute(\"class\",class_name); \n \n const newlist = list.filter(item => item.key !== e.target.textContent);\n\n this.setState({ \n minbuttons: newlist, \n });\n }\n\n }", "title": "" }, { "docid": "0fd4e4db0c4380bac7d510da453eeae7", "score": "0.65098614", "text": "function unhideVisibility(element) {\n element.style.visibility = null;\n element.style.display = null;\n}", "title": "" }, { "docid": "9f71678fe4d488c07d314e31afd19932", "score": "0.65021676", "text": "function hideViz() {\n viz.hide();\n}", "title": "" }, { "docid": "264a1e0ef8107cb210612128f5327ea6", "score": "0.6449462", "text": "removeVisibleAttribute_() {\n this.mutateElement(() => {\n if (this.visibleAdPage_) {\n this.visibleAdPage_.toggleVisibility();\n this.visibleAdPage_ = null;\n }\n });\n }", "title": "" }, { "docid": "7152104f888717fb537f081d8f5d70e3", "score": "0.6438724", "text": "hide() {\n\t\tif (this.el) this.el.style.display = \"none\";\n\t}", "title": "" }, { "docid": "6a937deec2686ae0f8d470c3defa3d2a", "score": "0.6432297", "text": "function show(element) { element.removeClass(\"hidden\"); }", "title": "" }, { "docid": "b26329ba12d709730a647ba5068449e6", "score": "0.64301586", "text": "hide() {\n\tif (this.visible) {\n\t this.visible = false;\n\t this.gutterContainer.scheduleComponentUpdate();\n\t this.emitter.emit('did-change-visible', this);\n\t}\n }", "title": "" }, { "docid": "10ebe13202325f5fcc974d916a8ce884", "score": "0.6421927", "text": "function hideAll() {\n \n }//end of hideAll", "title": "" }, { "docid": "b7a8f993b97e2812d83f1cbb8fb076a6", "score": "0.64179015", "text": "hide () {\n foreach(arrow => arrow.hide(), this.arrows)\n }", "title": "" }, { "docid": "39f5fcff803e901d995c65e978c53b73", "score": "0.6407151", "text": "function unHide(){\n let i = data.totalCurrent\n let t = data.totalTech\n if (i > 1){\n $(\".voices\").css(\"visibility\", \"visible\");\n }if (i > 3){\n $(\".tech\").css(\"visibility\", \"visible\");\n }if (i > 5){\n $(\".button\").css(\"visibility\", \"visible\");\n }if (i > 5){\n $(\".status\").css(\"visibility\", \"visible\");\n }if (t >= 1){\n $(\".pew\").css(\"visibility\", \"visible\");\n }\n}", "title": "" }, { "docid": "aa0a0e1f965a9fd677836dda9c627a18", "score": "0.6396929", "text": "hide(){\n this.panel.classed(\"show\", false);\n this.panel.classed(\"hide\", true);\n }", "title": "" }, { "docid": "1d3686a367d6d43b6b7c90108ff3ba07", "score": "0.63967425", "text": "hide() {\n\n }", "title": "" }, { "docid": "da90d8e16aba00717763df3d2ad4ca2e", "score": "0.6393744", "text": "function hideInterfaceElements()\n{\n controls.hide();\n caption.hide();\n}", "title": "" }, { "docid": "963b9745f810e0c16c6d764f81455709", "score": "0.63864416", "text": "_visuallyHide(element){\n $(element).css({'opacity':'0', 'position':'absolute', 'left':0, 'right':0, 'top':0, 'bottom':0, 'z-index':'-1' });\n }", "title": "" }, { "docid": "efcb4deeb1daf89864e8e1cd2ef3b8cc", "score": "0.6383149", "text": "hide(){\r\n ///hiding the greeting, button, input and title\r\n this.greeting.hide();\r\n this.button.hide();\r\n this.input.hide();\r\n this.title.hide();\r\n }", "title": "" }, { "docid": "6a3247c61b41318a50280b13afec93fa", "score": "0.6380693", "text": "function unHideElements(theArray, iLength){\n\tfor(var i=0; i < theArray.length; i++){\n\t\ttheArray[i].style.display = \"block\";\n\t\ttheArray[i].style.position = \"relative\";\n }\t\n}", "title": "" }, { "docid": "a756e4aa7fc1f9ffb2be91996a29c04e", "score": "0.6369401", "text": "function hideElements(elementArray) {\n for (var x in elementArray) {\n elementArray[x].setAttribute(\"style\", \"visibility:hidden\");\n }; \n}", "title": "" }, { "docid": "48e93e2dba24fc57bec61199cc7d4203", "score": "0.636272", "text": "hide() { document.getElementById(this.obj).style.visibility = \"hidden\"; }", "title": "" }, { "docid": "dc8c3496701be589e6044ccc6842ccec", "score": "0.63623834", "text": "hideAll(cy) {\n cy.elements().each(function (element) {\n var tempElement = element.scratch('_tooltip');\n if (tempElement && tempElement.isVisible()) { tempElement.hide(); }\n });\n }", "title": "" }, { "docid": "05ef3035c4bf2956aae0a180835f2c82", "score": "0.6346694", "text": "function unHide() {\n\t// Remove the hidden tag attribute from the title and task input\n\ttitleInput.removeAttribute(\"hidden\");\n\tnewTaskInput.removeAttribute(\"hidden\");\n\n\t// Remove the hidden attribute from the tell me what to do button\n\ttellMeButton.removeAttribute(\"hidden\");\n\n\t// Remove the hidden attribute from the todoTasks\n\tdocument.getElementById(\"toDoTasks\").removeAttribute(\"hidden\");\n\n\t// Remove the hidden attribute from the completedTasks\n\tdocument.getElementById(\"completedTasks\").removeAttribute(\"hidden\");\n\n\t// Remove the hidden attribute from the button that deletes the current list\n\tdocument.getElementById(\"deleteList\").removeAttribute(\"hidden\");\n}", "title": "" }, { "docid": "69e93ebae582dafcf9f6114360cedaf3", "score": "0.6328132", "text": "hide()\n\t{\n\t\tthis.container.style.display = \"none\";\n\t\tthis.visibility = false;\n\t}", "title": "" }, { "docid": "5f0c97d4a2e85c0761dca32f503ec30c", "score": "0.6328095", "text": "show() {\n this.element.classList.remove(\"invisible\");\n return this;\n }", "title": "" }, { "docid": "3f0e835c85fc7531607765c36d16fac9", "score": "0.6326453", "text": "function hideBuddyUpdates()\r\n{\r\n\tshowWindowShade('buddyUpdatesWindowShade','none');\r\n\ttoggleDisplayOff('buddyUpdatesPopup');\r\n\ttoggleVisibilityOff('tbBuText');\r\n}", "title": "" }, { "docid": "4eba93c69dfff85cabe6c077876f6b54", "score": "0.632601", "text": "hide() {\n this.rendered = false;\n }", "title": "" }, { "docid": "26259432fd7221eafb028f2ff734d6fc", "score": "0.63254154", "text": "function hideSettings() {\n showElements([\"view-settings-link\"])\n hideElements([\"group-settings-chart\", \"hide-settings-link\"])\n}", "title": "" }, { "docid": "b1391aee4e168bcfc5ab7ed0eb413c5e", "score": "0.63251084", "text": "setAllVisibilityToFalse() {\n for (const f of fikaSpots) {\n f.visible = false\n }\n }", "title": "" }, { "docid": "d4864141b5b8373b05fa26709bd66212", "score": "0.6317981", "text": "function hideReaderLabelsSelection() {\r\n getNode('FeedsDiv').style.display = 'none';\r\n getNode('LabelsDiv').style.display = 'none';\r\n getNode('BottomDiv').style.display = 'none';\r\n}", "title": "" }, { "docid": "8b3e6e8705371f43299e6ee070f36692", "score": "0.63078433", "text": "hide() {\r\n this.isOpened = false;\r\n gsap.to(this, { pixi: { alpha: 0 }, duration: 0.01 });\r\n }", "title": "" }, { "docid": "14f9729e11832596ad542726503c9c90", "score": "0.63044626", "text": "hide() {\n let wasVisible = this.visible;\n this.visible = false;\n if (this.element) this.element.style.display = 'none';\n if (wasVisible) this.emitter.emit('did-change-visible', this.visible);\n }", "title": "" }, { "docid": "521cca94e3cc2433de3f8ddb62e80a6c", "score": "0.62969244", "text": "function hide() {\n document.querySelector('.sika').style.display = 'none';\n document.getElementById('sika-points').textContent = '';\n}", "title": "" }, { "docid": "c137ab9e97727b830f198435eccaec70", "score": "0.62923145", "text": "hide() {\n this.element.classList.add(\"invisible\");\n return this;\n }", "title": "" }, { "docid": "e05ee24b4ad2608b05b7e7b281e4f421", "score": "0.629076", "text": "function hideEle()\n{\n myIncidentRay1.visible=false;\n myIncidentRay1Arrow11.visible=false;\n myIncidentRay1Arrow12.visible=false;\n myIncidentRay2.visible=false;\n myIncidentRay2Arrow11.visible=false;\n myIncidentRay2Arrow12.visible=false;\n myIncidentRay3.visible=false;\n myIncidentRay3Arrow11.visible=false;\n myIncidentRay3Arrow12.visible=false;\n\n myReflectedRay1.visible=false;\n myReflectedRay1Arrow11.visible=false;\n myReflectedRay1Arrow12.visible=false;\n myReflectedRay2.visible=false;\n myReflectedRay2Arrow11.visible=false;\n myReflectedRay2Arrow12.visible=false;\n myReflectedRay3.visible=false;\n myReflectedRay3Arrow11.visible=false;\n myReflectedRay3Arrow12.visible=false;\n\n myPIncidentRay1.visible=false;\n myPIncidentRay1Arrow11.visible=false;\n myPIncidentRay1Arrow12.visible=false;\n myPIncidentRay2.visible=false;\n myPIncidentRay2Arrow11.visible=false;\n myPIncidentRay2Arrow12.visible=false;\n myPIncidentRay3.visible=false;\n myPIncidentRay3Arrow11.visible=false;\n myPIncidentRay3Arrow12.visible=false;\n\n myPReflectedRay1.visible=false;\n myPReflectedRay1Arrow11.visible=false;\n myPReflectedRay1Arrow12.visible=false;\n myPReflectedRay2.visible=false;\n myPReflectedRay2Arrow11.visible=false;\n myPReflectedRay2Arrow12.visible=false;\n myPReflectedRay3.visible=false;\n myPReflectedRay3Arrow11.visible=false;\n myPReflectedRay3Arrow12.visible=false;\n\n con=1;\n}", "title": "" }, { "docid": "3406a95127766671319e90779e9b49d9", "score": "0.628913", "text": "hide (){\n this.visible = 0.0 ;\n this.line.setUniform('visible',0.0) ;\n }", "title": "" }, { "docid": "7f1252c3b467ec3bf1ce6a4aaddf42d7", "score": "0.6282476", "text": "function hideAll() {\n var listMols = biovizWidget.bioviz(\"getMoleculesFromStructure\", identifier).forEach(function(elem) {\n hideElem(elem);\n });\n }", "title": "" }, { "docid": "ab86fb482030cc029e2c9aa1078fa46c", "score": "0.6281809", "text": "function removeElements() {\n $('#canvas_panel>*, #tool_blur, #menu_bar>a, #tool_text').remove();\n $('#tool_snap, #view_grid, #rect_panel label, #path_panel label').remove();\n $('#g_panel label, #ellipse_panel label, #line label').remove();\n $('#text_panel label').remove();\n $('#tool_export').remove();\n $('#palette').hide();\n}", "title": "" }, { "docid": "7b255ebe1484ac94e33a532a443ae697", "score": "0.6279492", "text": "_hide(self) {\n if (self.visible) {\n if (self.sticky && self.stuck) { return; }\n try { self._c_.removeChild(self._t_); }\n catch (e) {}\n self.visible = false;\n }\n }", "title": "" }, { "docid": "b1fad9076a1c7c10d19aa03045d4e582", "score": "0.6278643", "text": "hide(){\n this.visible = 0.0 ;\n this.line.setUniform('visible',0.0) ;\n }", "title": "" }, { "docid": "7f7b4b1148735b2894be2f79020a2436", "score": "0.6273511", "text": "hide() {\n\t\tthis.element.classList.remove('display-block');\n\t}", "title": "" }, { "docid": "3b46764793866355761a0d88150256c7", "score": "0.6273399", "text": "function hideElement(elm) {\n elm.style.display = \"none\";\n}", "title": "" }, { "docid": "d036a33a9b8d68f8aa3fcd679a229d4d", "score": "0.62674963", "text": "_hideSections() {\n var sections = this.shadowRoot.querySelectorAll('section');\n var toggleButton = this.shadowRoot.querySelector('.advance-toggle');\n\n for(let i = 0; i < sections.length; i++){\n sections[i].removeAttribute('active');\n }\n toggleButton.innerHTML = \"\";\n }", "title": "" }, { "docid": "a7ae335411f64dd1408ddbb717956270", "score": "0.6265657", "text": "function hideElements() {\n \n $('div').hide(); // hides all divs\n $(':button').hide(); // hides all buttons\n $(':button').unbind(); // unbinds all buttons\n}", "title": "" }, { "docid": "726d0772ce3b7c846189d6f3b8569177", "score": "0.626556", "text": "function hideAndShowElements() {\n // Hide in desktop and show in mobile trending topics\n hideTrendingText();\n\n // Clean grid search results\n searchResultsGifs.innerHTML = \"\";\n\n // Show grid\n showSearchActive();\n}", "title": "" }, { "docid": "834dc414f099b8cd5b12379a16bdd551", "score": "0.6259533", "text": "reverseVisibility(){\n for(let i = 0; i < this.children[2].children.length; i++){\n this.children[2].children[i].visible = !this.children[2].children[i].visible;\n }\n }", "title": "" }, { "docid": "c8c9c363e15a80653fa5b4f030d21986", "score": "0.6259137", "text": "function hideElements(collctElem){\n for(item of collctElem){\n item.style.setProperty('visibility','hidden');\n }\n}", "title": "" }, { "docid": "d844d6bce720539375cffb4fb280c07e", "score": "0.6258085", "text": "function hideHelper(event, element) {\n element.removeAttribute(\"visible\");\n element.style.visibility = \"hidden\";\n }", "title": "" }, { "docid": "9f7164ec607472dc7d802aec93af5e8e", "score": "0.62548375", "text": "function hideElements() {\n asanaStatusRadioDiv.hide();\n asanaFilterRadioDiv.hide();\n searchDiv.hide();\n}", "title": "" }, { "docid": "7b54e1b990dbc27c64bd007458c272e3", "score": "0.62536687", "text": "function setInvisible(elem) {\n elem.addClass('invisible');\n}", "title": "" }, { "docid": "1b47147d5d53bef7a2d3970bdc115eff", "score": "0.6253636", "text": "hide() {\n this.off();\n super.hide();\n }", "title": "" }, { "docid": "a1557a838180430b5bd71b64d2b429df", "score": "0.6245934", "text": "applyUnlayoutUI() {\n this.baseInstance_.mutateElement(() => {\n this.baseInstance_.toggleFallback(false);\n });\n }", "title": "" }, { "docid": "9a5cce34c6e3e2172951c21ee8674c0c", "score": "0.6244685", "text": "function hide() {\n pixi.view.style.display = \"none\";\n}", "title": "" }, { "docid": "35db2bdc9ccad79b0b23a47ee154364c", "score": "0.6230646", "text": "hide() {\n\n this.isVisible = false;\n\n $('#nuts3ProfileVM').addClass('collapse');\n\n Spatial.sidebar.open('map-controls');\n\n $('#sidebar').removeClass('invisible');\n $('#sidebar').addClass('visible');\n\n }", "title": "" }, { "docid": "7dc140900317d235b2cbb312646a9f1a", "score": "0.6227211", "text": "function hidden() {\n $(\"#player1choices\").attr(\"style\", \"visibility:hidden\");\n $(\"#player2choices\").attr(\"style\", \"visibility:hidden\");\n $(\"#group2message\").attr(\"style\", \"visibility:hidden\");\n $(\"#group1message\").attr(\"style\", \"visibility:hidden\");\n }", "title": "" }, { "docid": "04a807eed0de9c03e6bb1a47488e5d5b", "score": "0.6218997", "text": "hide() {\n return this.css(\"display\", \"none\");\n }", "title": "" }, { "docid": "9eb7579e2c4e29d713e25415165cb89a", "score": "0.62087864", "text": "function juga() {\n document.getElementById(\"maPC\").hidden = false;\n}", "title": "" }, { "docid": "b5c430453e5ac049a4cb24635c94bafd", "score": "0.62068945", "text": "hide () {\n this.visible = false\n Doc.hide(this.canvas)\n }", "title": "" }, { "docid": "d6ba14906f8a5a784da2fa2fb81779d6", "score": "0.6201704", "text": "hide(){\n this.greeting.hide();\n this.button.hide();\n this.input.hide();\n this.title.hide();\n }", "title": "" }, { "docid": "bf6f96a6243c7e51fa052a60d647f57d", "score": "0.6200758", "text": "hide() {\n\t\t\tfor(let i = 0; i < this.container.length; i++) {\n\t\t\t\tthis.container[i].style.opacity = 0;\n\t\t\t}\n\t\t}", "title": "" } ]
02bf48b3ed8f4fc20fb642faeb322b7f
renders the total time spend in this category for the given time period
[ { "docid": "69b50d45b7691b353f4c017ec3bb031f", "score": "0.0", "text": "function render_time(time){\n html = '<h2> Time: ' + time + '</h2>'\n $(\".time\").html(html);\n}", "title": "" } ]
[ { "docid": "88bbd6e89c4b57f9f5105a33f4ba530d", "score": "0.5542204", "text": "function renderTime() {\n secondsLeft = totalSeconds - secondsElapsed;\n timeCount.textContent = secondsLeft;\n // If secondsElapsed equals totalSeconds, the quizTimer stops\n if (secondsElapsed >= totalSeconds) {\n stopTimer();\n }\n}", "title": "" }, { "docid": "1825d154fce53d03020cc12d1d1944bd", "score": "0.55391353", "text": "function updateTotalTime(timeentries) {\n vm.totalTime = time.getTotalTime(timeentries);\n }", "title": "" }, { "docid": "9d7cf8b254cc850ac5e7a6d9f59d9dde", "score": "0.549347", "text": "renderTimeAxis() {\n // this.selections.timeAxis\n const endTime = this.timeScale.domain()[1];\n const nBlocks = Math.floor(endTime / 5);\n const timeBlocks = [...Array(nBlocks)].map(() => 5);\n const remainder = endTime % 5;\n if (remainder > 0) timeBlocks.push(remainder);\n\n const getCumuTime = (d, i) => {\n let time = 0;\n for (let j = 0; j < i; j++) {\n time += timeBlocks[j];\n }\n\n // TODO less hacky, move somewhere else\n if (time < 10) return `00:0${time}`;\n return `00:${time}`;\n };\n\n this.selections.timeAxis\n .selectAll('li')\n .data(timeBlocks)\n .join('li')\n .attr('class', 'time-block')\n .style('width', d => {\n const percentage = `${100 * d / endTime}%`;\n // leave space for margins between blocks\n return `calc(${percentage} - 4px)`;\n })\n .text(getCumuTime);\n }", "title": "" }, { "docid": "1edb28934d1b0be2a773fbd1ea51a119", "score": "0.5485803", "text": "calcTime() {\n // ## Assuming that we need 15 min for each 3 ingredients\n const numIng = this.results.ingredients.length;\n const periods = Math.ceil(numIng / 3)\n this.results.time = periods * 15\n }", "title": "" }, { "docid": "4a5251ce921d57df84927252509d05ae", "score": "0.54493195", "text": "calcTime() {\n const numberingredients = this.ingredients.length;\n const periods = Math.ceil(numberingredients / 3);\n this.mealTime = 15 * periods;\n\n return this.mealTime;\n }", "title": "" }, { "docid": "ea4195e5353d6a3fb5a92d8a58269ddd", "score": "0.5441831", "text": "function getTotalTime(prof) {\n return d3.max(prof, function(d) { return d.endTime; }) -\n d3.min(prof, function(d) { return d.startTime; });\n }", "title": "" }, { "docid": "e68b43e4df8e4dc9c800a364c612a8d6", "score": "0.5426575", "text": "function render() {\n\t\tif (measuredTime != null) {\n\t\t\t_measuredTimeValue.innerHTML = measuredTime / 1000;\n\t\t\t_resultsTimeValue.innerHTML = (measuredTime - targetTime) / 1000;\n\t\t} else {\n\t\t\t_measuredTimeValue.innerHTML = 0;\n\t\t\t_resultsTimeValue.innerHTML = 0;\n\t\t}\n\t}", "title": "" }, { "docid": "e5a1f23b46a42fa8d46c9c0f6ad489c7", "score": "0.53881234", "text": "calcTime() {\n\t\tconst numIng = this.ingredients.length;\n\t\tconst periods = Math.ceil(numIng / 3);\n\t\tthis.time = periods*15;\n\t}", "title": "" }, { "docid": "db999ea26b84add0fbd533e3f8944ec0", "score": "0.5383439", "text": "function computeTotalTime(measures, componentTotalTime) {\n let total = 0\n\n {\n total = total || 0\n total += getTotalTime(getCommitChangesTime(measures))\n total += getTotalTime(getCommitHostEffectsTime(measures))\n total += getTotalTime(getLifecycleTime(measures))\n total += Number(componentTotalTime)\n }\n\n return total\n}", "title": "" }, { "docid": "c78ec00bf932de51b295ef100d6edb0c", "score": "0.5344103", "text": "function showTBTotalRuntime(){\r\n\t\tvar aDiv = find(\"//div[@id='ltime']/br\", XPFirst);\r\n\t\tif (aDiv) {\r\n\t\t\tTB3O.TBEndTime = new Date().getTime();\r\n\t var timeval = TB3O.TBTotalRunTime();\r\n\t var tbtime = elem('span', ' | ' + TB3O.shN + ' (v<b>' + TB3O.version + '</b>) time: <b>' + timeval + '</b> ms');\r\n\t\t\taddAttributes(tbtime, [['style', 'z-index:2000; color:#FFFFFF; width:450px']]);\r\n\t\t\t//tbtime.setAttribute(\"style\", \"z-index: 2; color: #FFFFFF;\");\r\n\t\t\taDiv.parentNode.style.width = \"500px\";\r\n\t\t\taDiv.parentNode.insertBefore(tbtime, aDiv);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "dda2a160a1e2973904593abb222296b4", "score": "0.53377753", "text": "totalTime() {\n let tt = 0\n for (var i = 0; i < this.courses.length; i++) {\n // se deben parsear para que no concatene si no que sume\n tt = parseInt(tt) + parseInt(this.courses[i].time)\n }\n // retornamos el arreglo con los dos valores requeridos\n return { time: tt, count: i }\n }", "title": "" }, { "docid": "242e02baa526fd7929cada5ff0a7ef64", "score": "0.5321437", "text": "function showTime(){\n\tvar dur = chart.duration;\n\tif(dur >= 172800){\n\t\t// Days\n\t\tdur = Math.floor(dur/86400) + \" days\";\n\t}else{ \n\t\tif(dur >= 7200){\n\t\t\tdur = Math.floor(dur/3600) + \" hours\";\n\t\t}else{\n\t\t\tdur = Math.floor(dur/60) + \" minutes\";\n\t\t}\n\t}\n\tdisplayStatus(\"Start: \" + startTimeString(), \"\", \"Duration: \" + dur, \"\");\n}", "title": "" }, { "docid": "f9c5ec30858ee3ae281113912ab5da29", "score": "0.5305546", "text": "calcTime(){\n //Assuming that we need 15 min for each 3 ingredients \n const numIng = this.ingredients.length;\n const periods = Math.ceil(numIng/3);\n this.time = periods*15;\n }", "title": "" }, { "docid": "8cd2b2bb26cc03c69de896aab916098f", "score": "0.52902573", "text": "getCost() {\n if (this.state.startDateTime !== null && this.state.endDateTime !== null) {\n const price = this.props.vehicleData.price;\n const cost =\n ((new Date(this.state.endDateTime) -\n new Date(this.state.startDateTime)) /\n 3600000) *\n price; // convert into hours\n return cost.toFixed(3) + \" eth\";\n }\n }", "title": "" }, { "docid": "7544fafdb071ac483587a5970addf74f", "score": "0.52689093", "text": "function calculateDuration() {\n return endTime - startTime;\n }", "title": "" }, { "docid": "7544fafdb071ac483587a5970addf74f", "score": "0.52689093", "text": "function calculateDuration() {\n return endTime - startTime;\n }", "title": "" }, { "docid": "6d7852728cb966687765663a0d512b7b", "score": "0.5266293", "text": "function getTotalTime(timeentries) {\n var totalMilliseconds = 0;\n\n angular.forEach(timeentries, function(key) {\n totalMilliseconds += key.loggedTime.duration._milliseconds;\n });\n\n // After 24 hours, the Moment.js duration object\n // reports the next unit up, which is days.\n // Using the asHours method and rounding down with\n // Math.floor instead gives us the total hours\n return {\n hours: Math.floor(moment.duration(totalMilliseconds).asHours()),\n minutes: moment.duration(totalMilliseconds).minutes()\n }\n }", "title": "" }, { "docid": "dcdf32e8617716a1dda46acb316ce18a", "score": "0.5261846", "text": "function tallyCategory(transactions, category) {\n var emissions = 0.0;\n var cost = 0.0;\n transactions.forEach(x => {\n if (x.amount > 0) {\n emissions += CATEGORIES[category].conversionFunction(\n x.amount,\n x.date\n );\n cost += x.amount;\n }\n });\n return {\n cost: cost,\n emissions: emissions,\n transactions: transactions\n };\n}", "title": "" }, { "docid": "472bca7df89fee681eda453ccfc5b641", "score": "0.5258871", "text": "function addTimeSpent() {\n\t\t\tvm.task.totalTime += vm.day.time;\n\t\t\tvar dateIndex = ifDateExists(vm.day.date);\n\t\t\tvar dateObj=vm.day.date;\n\t\t\tvm.day.date=convertToDateString(vm.day.date);\n\t\t\tif (dateIndex >= 0) {\n\t\t\t\tvm.task.timings[dateIndex].time += vm.day.time;\n\t\t\t\tallTimings[dateIndex].time = vm.task.timings[dateIndex].time;\n\t\t\t} else if(vm.lastWeek){\n\t\t\t\tif(isDay_lastWeek(dateObj)){\n\t\t\t\t\tvm.task.timings.push(vm.day);\n\t\t\t\t}\n\t\t\t\tallTimings.push(vm.day);\n\t\t\t} else {\n\t\t\t\tvm.task.timings.push(vm.day);\n\t\t\t\tallTimings.push(vm.day);\n\t\t\t}\n\t\t\temptySelectedDateFileds();\n\t\t}", "title": "" }, { "docid": "d3068cd9eabd85d5a766c6142c8984ea", "score": "0.525083", "text": "calcTime() {\n // Assume that we need 15 minut for each 3 ingredients\n const numIng = this.ingredients.length; // array of ingredients\n const periods = Math.ceil(numIng / 3);\n this.time = periods * 15;\n }", "title": "" }, { "docid": "17249534c51918b98948533ffafe1839", "score": "0.5237914", "text": "function calculateDuration() {\n return endTime - startTime;\n }", "title": "" }, { "docid": "17249534c51918b98948533ffafe1839", "score": "0.5237914", "text": "function calculateDuration() {\n return endTime - startTime;\n }", "title": "" }, { "docid": "17249534c51918b98948533ffafe1839", "score": "0.5237914", "text": "function calculateDuration() {\n return endTime - startTime;\n }", "title": "" }, { "docid": "de7d6e80063ec262704137741ac5ec67", "score": "0.52201116", "text": "function displayCount() {\n if (remainingTime > 0) {\n remainingTime--;\n $(\".displayTime\").html(remainingTime + \" Seconds.\");\n }\n }", "title": "" }, { "docid": "ae9cde18e3e02485ad955d799b24ab79", "score": "0.52011734", "text": "getTotalHours(){\n const total = this.state.data.reduce((prevValue, currentValue) => prevValue + currentValue.task_hour,0);\n return total; \n }", "title": "" }, { "docid": "a3cd5edbe1ba6f218565441338e0858f", "score": "0.5199191", "text": "function showTBTotalRuntime(){\r\n\t\tvar div = find(\"//div[@id='ltime']/br\", XPFirst);\r\n\t\tif (div) {\r\n\t\t\tTB3O.TBEndTime = new Date().getTime();\r\n\t var timeval = TB3O.TBTotalRunTime();\r\n\t var tbtime = elem(\"span\", \" | Travian Beyond time: \" + timeval + \" ms\");\r\n\t tbtime.setAttribute(\"class\",\"b\");\r\n\t\t\ttbtime.setAttribute(\"style\", \"z-index: 2; color: #FFFFFF;\");\r\n\t\t\tdiv.parentNode.style.width = \"400px\";\r\n\t\t\tdiv.parentNode.insertBefore(tbtime, div);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "3038305db728785545ff25929f5a7671", "score": "0.5193464", "text": "getTimeSpent(data) {\n if (data.includes(\"NaN\"))\n return <Text style={styles.cardContents}>Time Spent: None</Text>\n else {\n return (\n <Text style={styles.cardContents}>\n <Text style={{ fontSize: 28 }}>{data[0]}</Text> hrs\n <Text style={{ fontSize: 28 }}> {data[1]}</Text> mins\n <Text style={{ fontSize: 28 }}> {data[2]}</Text> secs spent\n </Text>\n );\n }\n }", "title": "" }, { "docid": "601075e761542d6e96eb294d494e2e9f", "score": "0.5191253", "text": "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "title": "" }, { "docid": "662d94fa1d0364e1d8fb6ac11f56ac6b", "score": "0.51755923", "text": "function timeCalc(d, p, f){//Parameters - Stores reusable information. D=Design, P=Programming and F=Flash\n\tvar firstTotal = d + p + f//Calculating the time spent on each project in minutes.\n\treturn firstTotal;//Spits out information out of function.\n}", "title": "" }, { "docid": "bbfe84467f0e473c5db967d45cd2ae62", "score": "0.51679254", "text": "function travel() {\n let sum = 0;\n user.transactionsMonthToDate.forEach((i) => {\n if (i.category.split(\" \")[0] == \"Travel\") {\n sum += i.amount;\n return;\n }\n });\n console.log(\"total spent on travel: \" + sum);\n}", "title": "" }, { "docid": "78edffcbc2d5af7726de6a1b2dbb4813", "score": "0.51611143", "text": "function displayTime(items){\n return $(items).text().length*speed+speed;\n}", "title": "" }, { "docid": "a41720bac59635262f67449a11f76fab", "score": "0.5157152", "text": "getTimeCounter() {\r\n const currentTime = formatTime(Math.max(this.currentTime, 0));\r\n const duration = formatTime(this.duration);\r\n return `${currentTime} / ${duration}`;\r\n }", "title": "" }, { "docid": "802c36e5912120375424df860ba6f890", "score": "0.5153352", "text": "render() {\n return (\n <TableRow>\n <TableCell align=\"left\">\n {this.props.summary.category}\n </TableCell>\n <TableCell align=\"center\">\n ${this.props.summary.budgetedAmount}\n </TableCell>\n <TableCell align=\"center\">\n ${this.props.summary.categoryAmount}\n </TableCell>\n <TableCell align=\"center\">\n {/* takes categoryAmount and budgetAmount and adds them together */}\n ${Number(this.props.summary.categoryAmount) +\n Number(this.props.summary.budgetedAmount)}\n </TableCell>\n </TableRow>\n );\n }", "title": "" }, { "docid": "8fbac381cc815fe41817d862ef22de5a", "score": "0.5141872", "text": "function getTotalTime(timeentries) {\n var totalMilliseconds = 0;\n\n angular.forEach(timeentries, function (key) {\n totalMilliseconds += key.loggedTime.duration._milliseconds;\n });\n\n // After 24 hours, the Moment.js duration object\n // reports the next unit up, which is days.\n // Using the asHours method and rounding down with\n // Math.floor instead gives us the total hours\n return {\n hours: Math.floor(moment.duration(totalMilliseconds).asHours()),\n minutes: moment.duration(totalMilliseconds).minutes()\n }\n }", "title": "" }, { "docid": "d2352bf429dac6cfe98515d820e6d540", "score": "0.51262283", "text": "render() {\n let practiceAmount;\n let time;\n practiceAmount = this.state.practices.length;\n if (practiceAmount === 1) {\n time = 'time';\n } else {\n time = 'times';\n }\n\n const minutesTotal = this.state.practices.reduce(\n (totalMinutes, minute) => totalMinutes + minute.timePracticed,\n 0\n );\n\n var num = minutesTotal;\n var hours = num / 60;\n var rhours = Math.floor(hours);\n var minutes = (hours - rhours) * 60;\n var rminutes = Math.round(minutes);\n\n const totalTime = rhours + ' hours and ' + rminutes + ' minutes';\n\n return (\n <div>\n <Header />\n <Container fluid>\n <Row className='p-4'>\n <Col sm={7} className='p-3'>\n <h4>Welcome back, {this.props.name}</h4>\n <p>\n You have practiced {practiceAmount} {time} so far! Keep it up!\n </p>\n <Button\n onClick={this.handleOpen}\n style={{ backgroundColor: '#181159' }}\n >\n Add a new practice\n </Button>\n </Col>\n <Col sm={5} className='p-3 welcome'>\n <Row>\n <Col>\n <h4>Practice makes perfect!</h4>\n <p>So far, you have practiced:</p>\n </Col>\n <Col className='text-center headline minutes p-3 mr-4 ml-4'>\n <span className='minutes-text'>\n <b>{totalTime}</b>\n </span>\n </Col>\n </Row>\n </Col>\n </Row>\n <Row className='p-4'>\n <Table responsive className='table-hover table-striped the-table'>\n <thead>\n <tr>\n <th>#</th>\n <th>DATE</th>\n <th>MINUTES PRACTICED</th>\n <th>SCALES PRACTICED</th>\n <th>OTHER MUSIC PRACTICED</th>\n </tr>\n </thead>\n {this.state.practices.map((practice, index) => (\n <tbody>\n <tr>\n <td>{index + 1}</td>\n <td>{practice.date}</td>\n <td>{practice.timePracticed}</td>\n <td>{practice.scales}</td>\n <td>{practice.otherMusic}</td>\n </tr>\n </tbody>\n ))}\n </Table>\n </Row>\n <Modal show={this.state.setShow} onHide={this.handleClose}>\n <Modal.Header closeButton>\n <Modal.Title>Enter a practice</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <PracticeForm\n handleClose={this.handleClose}\n getPractice={this.getPractice}\n />\n </Modal.Body>\n </Modal>\n </Container>\n </div>\n );\n }", "title": "" }, { "docid": "78c8af61b3ad0274559968edfa6d4a44", "score": "0.5124748", "text": "function updateClock() {\n const t = getTimeRemaining(reformat);\n daysSpan.innerHTML = t.days + ' D';\n hoursSpan.innerHTML = ('0' + t.hours).slice(-2) + ' H';\n minutesSpan.innerHTML = ('0' + t.minutes).slice(-2) + ' M';\n //secondsSpan.innerHTML = ('0' + t.seconds).slice(-2);\n if (t.total <= 0) {\n $(`#${id}`).empty();\n $(`#${id}`).append('PAST DUE');\n // add an 'overdue' property to the object when/if it is overdue\n task.overdue = true;\n // re-color the task as soon it's overdue\n taskPainter(task);\n //clearInterval(timeinterval);\n }\n }", "title": "" }, { "docid": "e2d8a76d5a3d6074ead6cb3dbb6ae38c", "score": "0.51227784", "text": "get totalSumDuration() {\n if (!this.isIndependentLearning) {\n return this.totalSumOfferingsDuration;\n }\n\n if (!this._ilmSessionData.isResolved) {\n return 0;\n }\n\n return (\n parseFloat(this._ilmSessionData.value.hours) + parseFloat(this.totalSumOfferingsDuration)\n );\n }", "title": "" }, { "docid": "5cd6bf419576ab23d4111404c2515b5e", "score": "0.51215017", "text": "function refreshWebPage() {\n clearWebPageContainer(time_slice_container)\n setUpTimeList()\n let Total_t = 0\n storage_list.forEach(item => {\n Total_t += item.time_slice\n })\n\n const total_time_formated = secondFormat(Total_t)\n // console.log(Total_t)\n total_time.textContent = `Total: ${total_time_formated}`\n}", "title": "" }, { "docid": "0cb0771a869a735bf3aeebebca568483", "score": "0.5117994", "text": "function getTotalTimeMS() {\n return (cstyle.word_count * ms_per_word);\n }", "title": "" }, { "docid": "0445b93ab680a29ee224f27a026b35e9", "score": "0.5110108", "text": "function showTotalRegularTime() {\n var url = location.origin + '/issues/' + issueID + '/time_entries?utf8=✓&f[]=spent_on&op' +\n '[spent_on]=*&f[]=cf_12&op[cf_12]=%3D&v[cf_12][]=Regular';\n $.get(url).done( function( data ) {\n $( \"td.spent-time\" ).append(' (R: <a href=\"' + url + '\">' + _parseRedmineHours(data) + '</a>)' );\n });\n}", "title": "" }, { "docid": "65f838e47122fdb5f9357d3a93003a6b", "score": "0.5107537", "text": "function formatDuration() {\n const { duration } = props;\n if (duration == 0) {\n return 'No duration';\n } else {\n //const duration = date.obj.setMinutes(date.minute+props.duration) -date.obj\n //console.log(duration,\"duration\")\n\n if (duration < 60) return 'For ' + duration + ' minutes ';\n if (duration == 60) return 'For ' + duration / 60 + ' hour ';\n return 'For ' + duration / 60 + ' hours ';\n }\n }", "title": "" }, { "docid": "1862e30d5ffcbfe29660522f17d4aad8", "score": "0.5099145", "text": "function assoc_timeRenderFunction(data, type, full, meta) {\n if (typeof data === 'undefined' || !data) {\n return '0m';\n }\n\n if (type === \"display\" || type === 'filter') {\n var delta = moment().format(\"X\") - data;\n return moment.duration(delta, \"seconds\").format(\"d[d] h[u] m[m]\");\n }\n\n return moment().format(\"X\") - data;\n }", "title": "" }, { "docid": "52891ab0870dc12e52c0693062288609", "score": "0.50955826", "text": "function createDailySleepTotalsGraph(){\n $.get(\"/sleep/data\", function(data){\n data.sort(function(a,b){ return new Date(b.createdAt) - new Date(a.createdAt); });\n var dataArray = ['Hours of Sleep', 0, 0, 0, 0, 0, 0, 0];\n var dateArray = [];\n var currentDate = new Date();\n for(var i = 0; i < days.length; i++){\n dateArray.unshift(days[currentDate.getDay()]);\n currentDate.setDate(currentDate.getDate()-1);\n }\n if(data.length > 7) data = data.slice(0, 7);\n for(var i = 0; i < data.length; i++){\n var date = new Date(data[i].createdAt);\n dataArray[dateArray.indexOf(days[date.getUTCDay()])+1] = data[i].totalSleep;\n }\n var chart = c3.generate({\n bindto: '#sleep_chart',\n data: {\n columns: [\n dataArray\n ]\n },\n axis: {\n x: {\n type: 'categorized',\n categories: dateArray\n }\n }\n });\n });\n}", "title": "" }, { "docid": "b9829d91c948175f0210b32d85dca8ff", "score": "0.50780004", "text": "function timeTaken(){\n var totalTime = parseInt(_fn('.mock-header').dataset.mocktime)*60 || 3600;\n var m = parseInt(_fn('.timer-content .min').innerText)*60;\n var s = parseInt(_fn('.timer-content .sec').innerText);\n var ms = totalTime - (m+s);\n m = Math.floor(ms/60);\n s = ms%60;\n return `${m}m : ${s}s`;\n }", "title": "" }, { "docid": "d110526c764fbd1c2a6f1fd53fcf98b8", "score": "0.5071264", "text": "calcTime() {\n //we will estimate that for exery 3 ingredients we need aprox 15 min\n //ingredients is an array\n const numIng = this.ingredients.length;\n //every periode is 15 minutes\n const periods = Math.ceil(numIng / 3, 10);\n this.time = periods * 15;\n }", "title": "" }, { "docid": "9190a6bd136229e55c1e5b1df1e01bfa", "score": "0.5055623", "text": "time() {\n if (this.isRunning) {\n return this._getRunningTotal();\n }\n\n return this.totalTime;\n }", "title": "" }, { "docid": "0a9d24ef7f6d1793f8dee68f2db9c168", "score": "0.505262", "text": "calcTime() {\n this.time = Math.ceil(this.ingredients.length / 3) * 15;\n }", "title": "" }, { "docid": "d9b6b2a352869ddab63d1db521656d0e", "score": "0.50482345", "text": "function renderCounter() {\n // Clears the quizTimer & sets the totalSeconds\n setTime();\n\n // Increases secondsElapsed by 1 second which gets subtracted from the totalSeconds set in setTime()\n quizTimer = setInterval(function () {\n secondsElapsed++;\n\n renderTime();\n }, 1000);\n}", "title": "" }, { "docid": "367bdeff0572ce5a35e5c8b5f933ee3a", "score": "0.5044321", "text": "categoryBreakdown(finalisedTaskArr) {\n let workMins = 0;\n let miscellaneousMins = 0;\n let exerciseMins = 0;\n\n if (dayCount == 7) {\n let workPortion = ((workMins / ProductivityStatistics.prototype.totalMinsForWeek) * 100);\n let miscellaneousPortion = ((miscellaneousMins / ProductivityStatistics.prototype.totalMinsForWeek) * 100);\n let exercisePortion = ((exerciseMins / ProductivityStatistics.prototype.totalMinsForWeek) * 100);\n return [workPortion, miscellaneousPortion, exercisePortion];\n }\n let i;\n //TODO: Need to use counter timing here right?\n for(i = 0; i < counterArr.length; i++) {\n //TODO: Check if getTaskCategory exists. If not create it. \n if (finalisedTaskArr[i].getTaskCategory() == \"Work\" || finalisedTaskArr[i].getTaskCategory() == \"Partially Work\" || finalisedTaskArr[i].getTaskCategory() == \"Fully Work\") {\n workMins += counterArr[i]; //TODO: what is the format of the durations stored in counterArr\n } else if (finalisedTaskArr[i].getTaskCategory() == \"Miscellaneous\") {\n miscellaneousMins += counterArr[i];\n } else if (finalisedTaskArr[i].getTaskCategory() == \"Exercise\") {\n exerciseMins += counterArr[i];\n }\n\n }\n }", "title": "" }, { "docid": "0c39d6a09c4db26f25fba8ed6a2c7729", "score": "0.5043125", "text": "renderCrateStats() {\n\t\t//data not loaded yet\n\t\tif (this.state.crateDistDataAll == null || this.state.crateDistDataWeek == null || this.state.crateDistDataToday == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<span>Mean Dist (24H): {this.state.crateDistDataToday.meandist.toFixed(2)} ft</span>\n\t\t\t\t<br/>\n\t\t\t\t<span>Mean Dist (Week): {this.state.crateDistDataWeek.meandist.toFixed(2)} ft</span>\n\t\t\t\t<br/>\n\t\t\t\t<span>Mean Dist (All): {this.state.crateDistDataAll.meandist.toFixed(2)} ft</span>\n\t\t\t</div>\n\t\t\t\n\t\t);\n\t}", "title": "" }, { "docid": "bbca9bd001519e53126b36249191b117", "score": "0.5037995", "text": "function up_timeRenderFunction(data, type, full, meta) {\n if (type === \"display\") {\n return moment.duration(data, \"seconds\").format(\"d[d] h[h] m[m]\");\n }\n\n return data;\n }", "title": "" }, { "docid": "fd8be341cc98b08243ee6797e5be8cb9", "score": "0.503511", "text": "function displayTimeUsed() {\n timeOnWebsite = timeOnWebsite + datajson.displayclockInterval;\n ////console.log(secondsToHms(timeOnWebsite));\n document.getElementsByClassName(\n \"consumedTimerDisplayer\"\n )[0].innerHTML = `You are here for\n <br>\n ${secondsToHms(timeOnWebsite)}`;\n }", "title": "" }, { "docid": "4a7411fcaefc3a5f72ab543a79c09efa", "score": "0.50153935", "text": "calculateClockDisplay(referenceTime, targetTime, totalPausedDuration) {\n let diff = targetTime - referenceTime;\n if(totalPausedDuration > 0) {\n diff = diff + totalPausedDuration;\n }\n\n let overflow = false;\n let hours, minutes, seconds, millis;\n if(diff < 0) {\n overflow = true;\n diff = -1 * diff;\n }\n hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\n minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));\n seconds = Math.floor((diff % (1000 * 60)) / 1000);\n millis = Math.floor(((diff % 1000) * 10 ) / 1000);\n\n let display = twoDigits(hours) + \":\" + twoDigits(minutes) + \":\" + twoDigits(seconds) + \".\" + (millis);\n if(overflow) {\n display = \"- \" + display;\n }\n return display;\n }", "title": "" }, { "docid": "7b853e8aceb9ff7b9f3c15c224e1c307", "score": "0.5013753", "text": "function totalTime() {\n let mins = span.innerHTML;\n mins = (mins / 35) * 60;\n const hours = Math.floor(mins / 60);\n const minsLeft = mins % 60;\n const totalTimeSpan = document.querySelector('#totalTime span');\n totalTimeSpan.innerHTML = hours.toFixed(0) + ' hour(s) <br />' + minsLeft.toFixed(0) + ' min(s)';\n}", "title": "" }, { "docid": "604cdde848cd32c2dddff7a6b03fbc3d", "score": "0.5009712", "text": "function renderTime() {\n\n // When renderTime is called it sets the textContent for the timer html\n minutesDisplay.textContent = getFormattedMinutes();\n secondsDisplay.textContent = getFormattedSeconds();\n}", "title": "" }, { "docid": "485524a8be80d090e21095b4d076c331", "score": "0.50055194", "text": "render() {\n return <div className=\"Timer\">{this.state.timeLeft}</div>;\n }", "title": "" }, { "docid": "59ad9d61d92bfca3413aa100a576a3cf", "score": "0.49988598", "text": "function updateClock() {\n var t = getTimeRemaining(endtime);\n\n daysSpan.innerHTML = t.days;\n //hoursSpan.innerHTML = ('0' + t.hours).slice(-2);\n\n if (t.total <= 0) {\n clearInterval(timeinterval);\n }\n }", "title": "" }, { "docid": "40a6dd7808ac2ef9ddc5b1d0d6196489", "score": "0.49916068", "text": "displayTimerCanvas() {\n\t\tthis.elapsedTotalTime = Date.now() - oTimer.timeGameStart;\n\t\tthis.timeElapsedSec = Math.floor(this.elapsedTotalTime / 1000);\n\t\tthis.elapsedSec = this.timeElapsedSec - (Math.floor(this.timeElapsedSec / 60) * 60);\n\t\t/*to be easy to read putting the results in two strings:*/\n\t\tlet string_min = \"Elapsed Time: \" + Math.floor(this.timeElapsedSec / 60) + \" min \";\n\t\tlet string_sec = this.timeElapsedSec - (Math.floor(this.timeElapsedSec / 60) * 60) + \" sec\";\n\t\treturn string_min + string_sec;\n\t}", "title": "" }, { "docid": "9434ae303bd16c12385768c6800b750f", "score": "0.49817893", "text": "function entertainment() {\n let sum = 0;\n user.transactionsMonthToDate.forEach((i) => {\n if (i.category == \"Entertainment\") {\n sum += i.amount;\n return;\n }\n });\n console.log(\"total spent on entertainment: \" + sum);\n}", "title": "" }, { "docid": "d0c0668481fca4708eb18892ca18e35c", "score": "0.49795112", "text": "totalHoursSpent() {\n let i;\n let totalMins = 0; //in mins\n for (i = 0; i < counterArr.length; i++) {\n totalMins += counterArr[i] //assuming the durations recorded in mins\n }\n ProductivityStatistics.prototype.totalMinsForWeek += totalMins;\n let newHours = Math.trunc(totalMins / 60);\n let newMins = totalMins - (newHours * 60);\n return [newHours, newMins];\n }", "title": "" }, { "docid": "b950748cf91a48248d6ec653a8f5d87f", "score": "0.497845", "text": "function secondsInTotal(h, m, s){ return (h * 3600) + (m * 60) + s; }", "title": "" }, { "docid": "145eaad69d80dd3fdbbefbaf75079d0f", "score": "0.49780482", "text": "function updateClock() {\n var t = getTimeRemaining(endtime);\n\n daysSpan.innerHTML = t.days;\n hoursSpan.innerHTML = ('0' + t.hours).slice(-2);\n minutesSpan.innerHTML = ('0' + t.minutes).slice(-2);\n // secondsSpan.innerHTML = ('0' + t.seconds).slice(-2);\n\n if (t.total <= 0) {\n clearInterval(timeinterval);\n }\n }", "title": "" }, { "docid": "ec6c0acef05ec5b2ed1e39a456271735", "score": "0.49770784", "text": "addDurationLabel(selection) {\n selection.append('span')\n .attr('class', 'step-duration')\n .text(d => `${d.duration} minutes`);\n }", "title": "" }, { "docid": "2eee667f0da050eb70aa7f927ba33178", "score": "0.49743038", "text": "function renderTime() \n{\n // When renderTime is called it sets the textContent for the timer html...\n secondsDisplay.textContent = getFormattedSeconds();\n\n // ..and then checks to see if the time has run out\n if (secondsElapsed >= totalSeconds) \n {\n stopTimer();\n }\n}", "title": "" }, { "docid": "00a03c07c61cf1475655659b6fe1679d", "score": "0.4958076", "text": "function calcTotalDayAgain() {\n var eventCount = $this.find('.this-month .event-single').length;\n $this.find('.total-bar b').text(eventCount);\n $this.find('.events h3 span b').text($this.find('.events .event-single').length)\n }", "title": "" }, { "docid": "03b09db8a6153ff0feaad15a46c888d3", "score": "0.49475184", "text": "render() {\n //var activeWord = Utils.pluralize(this.props.count, 'schedule');\n\n var nowShowing = this.props.nowShowing;\n\n return (\n <div className=\"footer row\">\n <span className=\"count\"><strong>{this.props.count}</strong> schedules found</span>\n </div>\n );\n }", "title": "" }, { "docid": "2da7b986a899fa5a41d08c8109570001", "score": "0.4946309", "text": "displayTimer() {\n this.final_timer = `${this.year}-${this.month}-${this.date} Time : ${this.hours}:${this.mins}:${this.seconds}`;\n }", "title": "" }, { "docid": "a9c317db9305fa13d4ce1f0ef7ec1828", "score": "0.49337602", "text": "displayTimer() {\n\t\tthis.elapsedTotalTime = Date.now() - oTimer.timeGameStart;\n\t\tthis.timeElapsedSec = Math.floor(this.elapsedTotalTime / 1000);\n\t\tthis.elapsedSec = this.timeElapsedSec - (Math.floor(this.timeElapsedSec / 60) * 60);\n\t\tdocument.querySelectorAll(\".span-timer-m\").forEach(function(val) {\n\t\t\tval.textContent = Math.floor(oTimer.timeElapsedSec / 60);\n\t\t});\n\t\tdocument.querySelectorAll(\".span-timer-s\").forEach(function(val) {\n\t\t\tval.textContent = oTimer.timeElapsedSec - (Math.floor(oTimer.timeElapsedSec / 60) * 60);\n\t\t});\n\t}", "title": "" }, { "docid": "1bbfcb9b6efd5ca832d5bb5cdc12c178", "score": "0.49227157", "text": "function countDownTimer() {\r\n $('.kitgreen-timer').each(function() {\r\n $(this).countdown($(this).data('end-date'), function(event) {\r\n $(this).html(event.strftime('' +\r\n '<h4 class=\"countdown-days\">%-D <span>days</span></h4> ' +\r\n '<h4 class=\"countdown-hours\">%H <span>hours</span></h4> ' +\r\n '<h4 class=\"countdown-min\">%M <span>minutes</span></h4> ' +\r\n '<h4 class=\"countdown-sec\">%S <span>seconds</span></h4>'));\r\n });\r\n });\r\n\r\n }", "title": "" }, { "docid": "2cb88a8a99eba9ce25959a5e589a67e6", "score": "0.49226734", "text": "function showTotal(){\n const total = userData.reduce((acc,user)=> (acc += user.money),0)\n const wealthEl = document.createElement('div');\n wealthEl.innerHTML = `<h3><strong>Total Wealth</strong>${formatMoney(total)} </h3>`;\n main.appendChild(wealthEl);\n}", "title": "" }, { "docid": "60a4607de3cef4a0c5cab3869fe2ab48", "score": "0.49222556", "text": "function renderTimer() {\n var secondsLeft = totalTime - timeElapsed;\n var secondsLeftFormatted = (totalTime - timeElapsed) % 60;\n var minutesLeft = Math.floor(secondsLeft/60);\n \n if (secondsLeftFormatted < 10) {\n $(\"#timer\").text(\"Time Left: \" + minutesLeft + \":0\" + secondsLeftFormatted);\n } else {\n $(\"#timer\").text(\"Time Left: \" + minutesLeft + \":\" + secondsLeftFormatted);\n };\n}", "title": "" }, { "docid": "622e72af8e458550a69365b6efc9dc8f", "score": "0.4920738", "text": "function totalOfTotal() {\n var temp = 0;\n for (var t = 0; t < hours.length; t++) {\n for (var o = 0; o < obj.length; o++) {\n temp += obj[o].cookies[t]\n }\n coloumnTotal.push(temp);\n totalOfTotals += temp;\n temp = 0;\n }\n}", "title": "" }, { "docid": "c1944db29186090c98ee534827fa40a2", "score": "0.49201286", "text": "_getRunningTotal() {\n return this.totalTime + this._getElapsed();\n }", "title": "" }, { "docid": "351b2513780b7dd0a33d7db2f5fea95f", "score": "0.4919164", "text": "render() {\n return (\n <div className=\"panel1\">\n <header className='title-container'>\n { this.props.children }\n </header>\n <div className='statistic-label'> Address </div>\n <header className='title-container'>\n { this.calcTime() }\n </header>\n <div className='statistic-label'> TimeStamp </div>\n </div>\n );\n }", "title": "" }, { "docid": "a38e394197abdebdc62bf2f1e3977044", "score": "0.49141937", "text": "render() {\n const { days, seconds, hours, minutes, time_up } = this.state\n return (\n <div>\n\n <h1>Countdown Clock</h1>\n <div id=\"clockdiv\">\n <div>\n <span className=\"days\" id=\"day\">{days}</span>\n <div className=\"smalltext\">Days</div>\n\n </div>\n <div>\n <span className=\"hours\" id=\"hour\">{hours}</span>\n <div className=\"smalltext\">Hours</div>\n\n </div>\n <div>\n <span className=\"minutes\" id=\"minute\">{minutes}</span>\n <div className=\"smalltext\">Minutes</div>\n\n </div>\n <div>\n <span className=\"seconds\" id=\"second\">{seconds}</span>\n <div className=\"smalltext\">Seconds</div>\n\n </div>\n </div>\n\n <p id=\"demo\">{time_up}</p>\n </div>\n )\n }", "title": "" }, { "docid": "8078166f2218f1699675b66651370d09", "score": "0.49123323", "text": "costOfRun(periodInHours){\r\n \tconst cost = this.wattage/1000 * periodInHours * 12;\r\n \tconsole.log(\"Energy consumed in \" + periodInHours + \" hours costs \" + cost + \" cents\");\r\n }", "title": "" }, { "docid": "c4dedcb1cddf0a21b44d22ed5b3d29bb", "score": "0.49058953", "text": "function calcTotalDayAgain() {\n var eventCount = $this.find('.this-month .event-single').length;\n $this.find('.total-bar b').text(eventCount);\n $this.find('.events h3 span b.num-view').text($this.find('.events .event-single').length);\n $this.find('.events h3 span b.date-view').text($this.find('.add-event').attr('data-date'));\n }", "title": "" }, { "docid": "c209883fed040a61c835cd734a71235b", "score": "0.4905731", "text": "function showFragmentTimespan() {\n eventService.getEventsByFragment(eventVm.event.applicationId, eventVm.event.fragment)\n .then(function(response) {\n eventVm.fragmentEvents = response.data;\n var timespanData = [];\n _.forEach(eventVm.fragmentEvents, function(value) {\n var d = new Date(value.time);\n var just_day = new Date(d.getFullYear(), d.getMonth(), d.getDate());\n var timestamp_key = just_day.getTime();\n if (timespanData[timestamp_key] == null) {\n timespanData[timestamp_key] = 1;\n } else {\n var newValue = timespanData[timestamp_key] + 1;\n timespanData[timestamp_key] = newValue;\n };\n });\n eventVm.timespan = timespanData;\n drawChart();\n })\n .catch(function(error) {\n $log.warn(error);\n });\n }", "title": "" }, { "docid": "2e808f749666350b2df61cbc699045ac", "score": "0.48968628", "text": "function viewTotalBudget() {\n const departmentBudget = `SELECT department_id, SUM(salary) salary, department.department_name FROM employee_role LEFT JOIN department ON employee_role.department_id = department.id GROUP BY department_id`;\n connection.query(departmentBudget, (error, result) => {\n if (error) throw error;\n console.log(chalk.bgMagenta(\" Total Budget Per Department \"));\n console.log(chalk.cyanBright(`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`));\n console.table(result);\n console.log(chalk.cyanBright(\"~~~~~~~~~~~ Employee Tracker Menu ~~~~~~~~~~~\"));\n openingMenu();\n })\n}", "title": "" }, { "docid": "021ad1664608f792dd0180edf000ccad", "score": "0.48896855", "text": "function TooltipAmountDay(props) {\n return (\n <div className=\"hover-total-amount-day\" style={props.style}>\n {props.amount.toLocaleString(props.locale, { ...Constants.DEFAULT_CURRENCY_OPTIONS, ...{ currency: props.currency }})}\n </div>\n ); \n}", "title": "" }, { "docid": "e9755dd3942b9658f719fad0dc5cf589", "score": "0.48821777", "text": "render(){\n\t\tlet taskCount = {\n\t\t\t'DONE': this.countType(TaskTypes.DONE).calc,\n\t\t\t'DOING': this.countType(TaskTypes.DOING).calc,\n\t\t\t'BLOCKED': this.countType(TaskTypes.BLOCKED).calc,\n\t\t\t'UNASSIGNED': this.countType(TaskTypes.UNASSIGNED).calc\n\t\t};\n\n\t\treturn (\n\t\t\t<div style={this.props.style}>\n\t\t\t\t{(!this.props.compact) ? \n\t\t\t\t\t<div className=\"row left-right-align progress-bar-details\">\n\t\t\t\t\t <div className=\"col-md-6\"><span className=\"detailNum\">{this.countType(TaskTypes.DONE).count + '/' + this.countType(TaskTypes.DONE).total}</span> Tasks Complete</div>\n\t\t\t\t\t <div className=\"col-md-6\"><span className=\"detailNum\">{this.daysLeft()}</span> Days Left of Sprint</div>\n\t\t\t\t\t</div>:null\n\t\t\t\t}\n\t\t\t\t<ProgressBar className={(this.props.compact) ? 'compact':null}>\n\t\t\t\t\t<ProgressBar bsStyle=\"success\" now={this.countType(TaskTypes.DONE).calc} key={1} />\n\t\t\t\t\t<ProgressBar bsStyle=\"warning\"now={this.countType(TaskTypes.DOING).calc} key={2} /> \n\t\t\t\t\t<ProgressBar bsStyle=\"danger\" now={this.countType(TaskTypes.BLOCKED).calc}key={3} />\n\t\t\t\t\t<ProgressBar bsStyle=\"info\" now={this.countType(TaskTypes.UNASSIGNED).calc} key={4} />\n\t\t\t\t</ProgressBar>\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "c76ad4f9d0f3fa47f8fb8737852d0f4f", "score": "0.4874354", "text": "getDuration() {\n if (this.state.isEditable) {\n return (<input type=\"number\" value={this.state.timeleft} min=\"0\" onChange={this.handleChangeTimeleft} onKeyDown={this.handleKeyDown} />)\n } else {\n return (\"Time left: \" + this.state.timeleft)\n }\n }", "title": "" }, { "docid": "62a814c10daa20e47bd4d1551d778296", "score": "0.48737434", "text": "function createTotalTimeString(testCases) {\n let totalTime = testCases.reduce(\n (accum, testCase) => {\n let executionTime = testCase.result.executionTime;\n if (executionTime === null) excecutionTime = 0;\n return accum + executionTime;\n }, 0\n );\n\n return `Total Execution time: ${totalTime}ms`;\n}", "title": "" }, { "docid": "9d91a275520f364e4d888778fc0643a8", "score": "0.48659045", "text": "templateResultTotal() {\n return `<span>${this.countTotal}</span> streams found`\n }", "title": "" }, { "docid": "afa1aea8e7d7071b02b6d833153cf837", "score": "0.48615834", "text": "function render() {\n MIN_DISPLAY_EL.textContent = padZeros(PLAYING_TIME.mins);\n SEC_DISPLAY_EL.textContent = padZeros(PLAYING_TIME.seconds);\n ROUND_DISPLAY_EL.innerHTML = itemCounterTime;\n SCORE_EL.textContent = score;\n }", "title": "" }, { "docid": "79d43c4efb4f1bce49f65cfefdfbc7a1", "score": "0.4858333", "text": "render() {\r\n let mailCountChart = (\r\n <MailCountChart\r\n state={this.props.state}\r\n chartTimeframe={this.state.chart_choice}\r\n type='mail-count'\r\n />\r\n );\r\n return (\r\n <div className='main-header'>\r\n <div id='graph-picker' className='time-picker'>\r\n <button onClick={this.weekSelected}>Last week</button>\r\n <button onClick={this.monthSelected}>Last month</button>\r\n <button onClick={this.yearSelected}>Last year</button>\r\n <button onClick={this.lifetimeSelected}>Lifetime</button>\r\n {/* Lets not include custom for now */}\r\n {/* <button>Custom Timeframe</button> */}\r\n </div>\r\n {mailCountChart}\r\n </div>\r\n );\r\n }", "title": "" }, { "docid": "4424f051ebbdd2d71de1746437e030c4", "score": "0.4854994", "text": "function timer() {\n if (minutes == 0 && secondes == 0) {\n $(\".fill\").addClass(\"circleOut\");\n $(\".bar\").addClass(\"circleOut\");\n $(\"#timer\").addClass(\"timerOut\");\n }\n\n if (isTimerActive) {\n participantsTimer[sortableParticipants[currentId]]++;\n \n if (minutes >= 0 && secondes >= 0)\n {\n secondes = secondes - 1;\n } \n timerTotal++;\n if(pourcent < 100){\n $(\"#timerPourcent\").removeClass(\"p\" + pourcent);\n pourcent = Math.round((timerTotal / dailyTotalSecondes) * 100);\n $(\"#timerPourcent\").addClass(\"p\" + pourcent);\n }\n\n if (secondes < 0 && minutes >= 0) {\n secondes = 59;\n minutes = minutes - 1;\n }\n }\n\n if (minutes >= 0) {\n showTimer();\n }\n\n var showMinutes = 0;\n var showSecondes = participantsTimer[sortableParticipants[currentId]];\n\n while (showSecondes >= 60) {\n showMinutes++;\n showSecondes = showSecondes - 60;\n };\n $(\".active span\").text(getTimer(showMinutes, showSecondes));\n if (personTotalSecondes < participantsTimer[sortableParticipants[currentId]]) {\n $(\".active\").addClass(\"personOut\");\n }\n\n if (isStart == false) {\n setTimeout(timer, 1000);\n }\n}", "title": "" }, { "docid": "3ae363fe98b2afe7400272c10fc20972", "score": "0.48516524", "text": "function calcuCarbon(){\n count = 0;\n var totalCarbon = 0;\n \n //get user input from dropdown menu\n var ingredient = document.getElementById(\"set_ingredient\").value;\n //get corresponding number value\n var carbonEmissionPerKg = co2Data[ingredient][1];\n \n //get user input from type in\n var ingredientMass = document.getElementById(\"mass\").value;\n //calculate carbon emission from one ingredient\n var carbonEmissionItem = carbonEmissionPerKg/1000 * ingredientMass;\n //display the numerical value on html\n document.getElementById(\"carbonItem\").innerHTML = carbonEmissionItem.toFixed(2);\n \n if (ingredientMass>0){\n count++;\n }\n \n totalCarbon = totalCarbon + carbonEmissionItem;\n \n for(var i = 2; i<sectionsCount;i++){\n var ingredient = document.getElementById(\"set_ingredient\" + i).value;\n var carbonEmissionPerKg = co2Data[ingredient][1];\n var ingredientMass = document.getElementById(\"mass\" + i).value;\n var carbonEmissionItem = carbonEmissionPerKg/1000 * ingredientMass;\n document.getElementById(\"carbonItem\" + i).innerHTML = carbonEmissionItem.toFixed(2);\n totalCarbon = totalCarbon + carbonEmissionItem;\n if (ingredientMass>0){\n count++;\n }\n }\n document.getElementById(\"carbonTotal\").innerHTML = totalCarbon.toFixed(2);\n return totalCarbon;\n \n \n}", "title": "" }, { "docid": "69c6eac5ab750f1b012460e134475d38", "score": "0.48480517", "text": "function timeTaken() {\r\n var currentTimeDiff = getTimeDifference();\r\n var totalSec = currentTimeDiff;\r\n var tmp;\r\n\r\n var eMinutes = Math.floor(parseInt(totalSec) / 60);\r\n var eHours = Math.floor(parseInt(eMinutes) / 60);\r\n\r\n eMinutes = Math.floor(parseInt(eMinutes) % 60);\r\n tmp = parseInt(totalSec) % 60;\r\n\r\n if (parseInt(tmp) < 10) {tmp = \"0\" + tmp;}\r\n if (parseInt(eMinutes) < 10) {eMinutes = \"0\" + eMinutes;}\r\n if (parseInt(eHours) < 10) {eHours = \"0\" + eHours;}\r\n\r\n var totalTime = \"\";\r\n if(scormType == \"1.2\")\r\n totalTime = eHours + \":\" + eMinutes + \":\" + tmp;\r\n else\r\n totalTime = 'PT'+(eHours+'H')+''+(eMinutes+'M')+''+(tmp+'S');\r\n\r\n return totalTime;\r\n}", "title": "" }, { "docid": "ad58ebf3cbb152932004976a57c90a13", "score": "0.48366717", "text": "function updateClock() {\n\t\t\tvar t = getTimeRemaining(endtime);\n\t\t\tdaysSpan.innerHTML = t.days;\n\t\t\thoursSpan.innerHTML = ('0' + t.hours).slice(-2);\n\t\t\tminutesSpan.innerHTML = ('0' + t.minutes).slice(-2);\n\t\t\t//secondsSpan.innerHTML = ('0' + t.seconds).slice(-2);\n\t\t\tif (t.total <= 0) {\n\t\t\t\tclearInterval(timeinterval);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "190847e93b021b8036edf6197fbc9d13", "score": "0.483288", "text": "CalculateTotalUtilization(resource, nextDate, total) {\n for (var task in this.props.new_data[resource]) {\n var taskstartdate = new Date(this.props.new_data[resource][task].start);\n var taskenddate = new Date(this.props.new_data[resource][task].end);\n if (nextDate >= taskstartdate && nextDate <= taskenddate) {\n total = total + this.props.new_data[resource][task].utilization;\n } else {\n total = total + 0;\n }\n }\n return total;\n }", "title": "" }, { "docid": "5b3f44e42d8f4cf1e803b3974b8d0528", "score": "0.48287988", "text": "function showLength(startTime, endTime) {\n var lastHalfHour = Math.floor(new Date().getTime() / (1000 * 60 * 30));\n lastHalfHour = lastHalfHour * 1000 * 60 * 30;\n startTime = new Date(startTime).getTime();\n endTime = new Date(endTime).getTime();\n if (startTime < lastHalfHour) {\n return (endTime - lastHalfHour) / 1000 / 60;\n } else {\n return (endTime - startTime) / 1000 / 60;\n }\n }", "title": "" }, { "docid": "c3d19f81ea52783676acccbc91b17ec0", "score": "0.482753", "text": "function calc_total_time(points)\n{\n\tvar total_count_time1 = 0;\n\tvar total_count_time2 = 0;\n\tfor(i = 0; i < points.length; i++)\n\t{\n\t\ttotal_count_time1 += points[i].tD1;\n\t\ttotal_count_time2 += points[i].tD2;\n\t}\n\n\tvar dir1 = ((parseFloat(total_count_time1)) / 3600).toFixed(2);\n\tvar dir2 = ((parseFloat(total_count_time2)) / 3600).toFixed(2);\n\tvar time_array = [dir1, dir2];\n\t//create_table(time_array);\n\treturn time_array;\n}", "title": "" }, { "docid": "7389b574af6e836489a5b0e363862001", "score": "0.48178405", "text": "function load_execution_times(results){\n $('#execution-time').show();\n $('#requests-total').html(results.total_requests);\n $('#mst-time').html((results.graph_time *1000).toFixed(3) + 'ms');\n\n var total = 0.0;\n for (i in results.requests_time){\n total += results.requests_time[i];\n }\n\n $('#requests-time').html( total.toFixed(3) + 's / ' + (total/results.requests_time.length).toFixed(3) + 's');\n\n}", "title": "" }, { "docid": "10fb4440488892cf39acc9a9fbaba199", "score": "0.48154402", "text": "function countTime() {\n\n\t\t//获取当前时间 \n\t\tvar octoberDate = new Date();\n\t\tvar octoberNow = octoberDate.getTime();\n\t\t//设置截止时间 \n\t\t//var str = \"2019/5/20 11:11:00\";\n\t\tvar str = timeOut;\n\t\tvar endDate = new Date(str);\n\t\tvar end = endDate.getTime();\n\t\t//时间差 \n\t\tvar leftTime = end - octoberNow;\n\t\tleftTime = Math.abs(leftTime);\n\t\t//var leftTime = timeOut;\n\t\t//定义变量 d,h,m,s保存倒计时的时间 \n\t\tvar d, h, m, s;\n\t\tif(leftTime >= 0) {\n\t\t\td = Math.floor(leftTime / 1000 / 60 / 60 / 24);\n\t\t\th = Math.floor(leftTime / 1000 / 60 / 60 % 24);\n\t\t\tm = Math.floor(leftTime / 1000 / 60 % 60);\n\t\t\ts = Math.floor(leftTime / 1000 % 60);\n\t\t}\n\t\t//console.log(h+\"-\"+m+\"-\"+s)\n\t\tif(h == 0 && m == 0 && s == 0) {\n\t\t\tsetTimeout(function() {\n\t\t\t\tlocation.reload();\n\t\t\t}, 1000);\n\t\t\treturn;\n\t\t}\n\t\t//var datatime = \"<p>开始倒计时:<span>\" + h + \"</span>&nbsp;:&nbsp;<span>\" + m + \"</span>&nbsp;:&nbsp;<span>\" + s + \"</span></p>\";\n\t\t//将倒计时赋值到div中 \n\t\tif(h < 10) {\n\t\t\th = \"0\" + h;\n\t\t}\n\t\tif(m < 10) {\n\t\t\tm = \"0\" + m;\n\t\t}\n\t\tif(s < 10) {\n\t\t\ts = \"0\" + s;\n\t\t}\n\t\t$(\".flopH\").html(h);\n\t\t$(\".flopM\").html(m);\n\t\t$(\".flopS\").html(s);\n\t\t//timeOut = timeOut - 1000;\n\t\t//console.log(timeOut)\n\t\t//递归每秒调用countTime方法,显示动态时间效果 \n\t\tsetTimeout(countTime, 1000);\n\t}", "title": "" }, { "docid": "c8676778adc316c1f99eb8bbf344cba4", "score": "0.48144808", "text": "countDown() {\n $(\".sigma_countdown-timer\").each(function() {\n var $this = $(this);\n $this.countdown($this.data('countdown'), function(event) {\n $(this).html(\n event.strftime('<li><div class=\"calender-input-box\"><div class=\"calender-input-inner\"> <span>Days</span><h3>%D</h3></div></div></li><li><div class=\"calender-input-box\"><div class=\"calender-input-inner\"> <span>Hours</span><h3>%H</h3></div></div></li><li><div class=\"calender-input-box\"><div class=\"calender-input-inner\"> <span>Minutes</span><h3>%M</h3></div></div></li><li><div class=\"calender-input-box\"><div class=\"calender-input-inner\"> <span>Seconds</span><h3>%S</h3></div></div></li>')\n );\n });\n });\n }", "title": "" }, { "docid": "26700d080a181c1b716437e7d2b8e0bb", "score": "0.48107788", "text": "function update() {\n $('#current').text(duration(task_length));\n}", "title": "" }, { "docid": "8e8309fb49ec7755e3d3e7ce94f7c855", "score": "0.480781", "text": "function renderGlobalSalesTotals() {\n let totalTable1 = document.getElementById('daily-total');\n let totalTableRow = document.createElement('tr');\n let totalTableName = document.createElement('td');\n totalTableName.textContent = 'Totals';\n totalTableRow.appendChild(totalTableName);\n let globalTotal = 0;\n for (let i = 0; i < salesHours.length; i++) {\n var hourlyTotal = 0;\n for (let j = 0; j < cityArray.length; j++) {\n hourlyTotal += cityArray[j].cookiesEachHour[i];\n }\n let totalTableData = document.createElement('td');\n totalTableData.textContent = hourlyTotal;\n totalTableRow.appendChild(totalTableData);\n globalTotal += hourlyTotal;\n }\n let grandTotalTableData = document.createElement('td');\n grandTotalTableData.textContent = globalTotal;\n totalTableRow.appendChild(grandTotalTableData);\n totalTable1.appendChild(totalTableRow);\n}", "title": "" }, { "docid": "a529b2b85b2ac41d84be000e972bb446", "score": "0.47997192", "text": "function render(hrs,mns,scs){\n \n \n hours.innerHTML = \"<h1>\" + hrs + \"</h1>\"\n mins.innerHTML = \"<h1>\" + mns + \"</h1>\"\n secs.innerHTML = \"<h1>\" + scs + \"</h1>\"\n \n //console.log(hours)\n \n \n }", "title": "" }, { "docid": "65aa8be08269fc4ccc49a5c26651e9c5", "score": "0.47994572", "text": "getTotals(calendar, selector, rule) {\n\n // Check if the selector is plural\n var selectorIsPlural = selector.parameters.length > 1 || selector.parameters.includes(\"all\")\n\n var total = 0\n var totalEach = {}\n selector.parameters.forEach((parameter) => {\n if (selector.select == \"day\") {\n\n // Iterate through each type on the calendar\n Object.keys(calendar).forEach((type) => {\n\n if (this.state.days[parameter] && calendar[type] && calendar[type][parameter] && Object.keys(calendar[type][parameter]).length > 2) { // Check if their is an actual meal there\n if (calendar[type][parameter].category.includes(rule.parameters.category)) { // Check if the meal has the category that rule is matching for\n if (selectorIsPlural) { \n if (rule.parameters.for == \"all\") { // Check if the rule is checking total for all parameters\n total++\n } else { // Check if the rule is checking total for each of the parameters\n if (totalEach[parameter]) { \n totalEach[parameter]++\n } else {\n totalEach[parameter] = 1\n } \n }\n } else {\n total++\n }\n }\n }\n\n })\n } else {\n if (calendar[parameter]) {\n // Iterate through each day on the calendar given the type in the selector\n Object.keys(calendar[parameter]).forEach((day) => {\n if (this.state.days[day] && calendar[parameter] && calendar[parameter][day] && Object.keys(calendar[parameter][day]).length != 1) { // Check if their is an actual meal there\n if (calendar[parameter][day].category.includes(rule.parameters.category)) { // Check if the meal has the category that the rule is matching for\n if (selectorIsPlural) { \n if (rule.parameters.for == \"all\") { // Check if the rule is checking total for all parameters\n total++\n } else { // Check if the rule is checking total for each of the parameters\n if (totalEach[parameter]) { \n totalEach[parameter]++\n } else {\n totalEach[parameter] = 1\n } \n }\n } else {\n total++\n }\n }\n }\n })\n }\n \n }\n })\n\n return [total, totalEach]\n }", "title": "" }, { "docid": "5daceae47a9019347faa907688f202a8", "score": "0.47935462", "text": "function duration2(adults, kids, duration) {\n let total = Number(adults) + Number(kids);\n let totalPlural = total > 1 ? `<span>${total}</span> pessoas` : `<span>${total}</span> pessoa`;\n if (duration > 1) {\n return `<p>Para <span>${duration}</span> horas de Churrasco com ${totalPlural}.</p>`;\n } else if (duration < 1) {\n return `<p>Para o seu Churrasco com ${totalPlural}.</p>`;\n } else {\n return `<p>Para <span>${duration}</span> hora de Churrasco com ${totalPlural}.</p>`;\n }\n}", "title": "" } ]
b727d491753e6ad0f183e5fc22e30e59
Watch for changes to static assets, pages, Sass, and JavaScript
[ { "docid": "563bd067ccc3d5b69ff17d76bfa936c4", "score": "0.76676255", "text": "function watch() {\n gulp.watch( PATHS.assets,copy );\n gulp.watch( 'src/assets/scss/**/*.scss', compileCSS )\n .on( 'change',path => log( 'File ' + colors.bold( colors.magenta( path ) ) + ' changed.' ) )\n .on( 'unlink',path => log( 'File ' + colors.bold( colors.magenta( path ) ) + ' was removed.' ) );\n gulp.watch( '**/*.php', reload )\n .on( 'change',path => log( 'File ' + colors.bold( colors.magenta( path ) ) + ' changed.' ) )\n .on( 'unlink',path => log( 'File ' + colors.bold( colors.magenta( path ) ) + ' was removed.' ) );\n gulp.watch( 'src/assets/images/**/*',gulp.series( images, reload ) );\n}", "title": "" } ]
[ { "docid": "4997037a6a9858a9c79998037431983a", "score": "0.79558843", "text": "function watcher() {\n watch(\"*.html\").on(\"change\", pageReload);\n watch(\"./src/js/*.js\").on(\"change\", parallel(scripts));\n watch(\"./src/scss/*.scss\").on(\"change\", parallel(styles));\n watch(\"./src/img/**/*.{jpg,jpeg,png,gif,tiff,svg}\").on(\n \"change\",\n parallel(images)\n );\n}", "title": "" }, { "docid": "2817de70c75ed708d61b879eb5ff7492", "score": "0.7753848", "text": "function watch() {\n gulp.watch(PATHS.assets, copy);\n gulp.watch('src/{layouts,partials,pages}/**/*.html', gulp.series(resetPages, pages, browser.reload));\n gulp.watch('src/assets/scss/**/*.scss', gulp.series(sass, browser.reload));\n gulp.watch('src/assets/js/**/*.js', gulp.series(javascript, browser.reload));\n gulp.watch('src/assets/img/**/*', gulp.series(images, browser.reload));\n}", "title": "" }, { "docid": "bd238f3ae0ed971c450dd7b37ed0af72", "score": "0.7699634", "text": "function watchFiles() {\n // Watch all-things jekyll related (i.e. *.yml, *.md, *.html, files and jekyll underscored _dir's)\n watch(\n config.watch.pages,\n series(\n build,\n browserSyncReload\n )\n );\n // Watch for SASS changes in main.scss\n watch(\n config.watch.sass,\n series(\n mainScss,\n translateScss,\n browserSyncReload\n )\n );\n // Watchin' for static asset changes (e.g. new images)\n watch(\n config.watch.images,\n series(\n copy,\n browserSyncReload\n )\n );\n}", "title": "" }, { "docid": "cea9cffc94a8cf8d7736ea7dcc6c033e", "score": "0.76452065", "text": "function watch() {\n //live reloader\n livereload.listen();\n //watch for changes in js\n gulp.watch(paths.scripts, scriptsDevelopment);\n //watch for changes in sass\n gulp.watch(paths.sass, sassDevelopment);\n}", "title": "" }, { "docid": "381ab14d1cccf7727cb39a920b43ee75", "score": "0.75694597", "text": "function watch() {\n\n gulp.watch('src/pages/**/*.html')\n .on('change', gulp.series(pages, decode, inline, browser.reload));\n\n gulp.watch(['src/layouts/**/*', 'src/partials/**/*'])\n .on('change', gulp.series(resetPages, pages, decode, inline, browser.reload));\n\n gulp.watch(['../scss/**/*.scss', 'src/assets/scss/**/*.scss'])\n .on('change', gulp.series(resetPages, sass, pages, decode, inline, browser.reload));\n\n gulp.watch('src/assets/img/**/*')\n .on('change', gulp.series(images, browser.reload));\n\n}", "title": "" }, { "docid": "c1f614c53fdaf3203f14fcbdfedf87ab", "score": "0.7560636", "text": "function watch() {\n gulp.watch(JS_SRCS, {}, buildScripts);\n gulp.watch(TEMPLATE_SRCS, {}, buildTemplates);\n gulp.watch(STATIC_FILES, {}, copyStaticFiles);\n}", "title": "" }, { "docid": "a521cbd9a1f42440d9cc198edda2d012", "score": "0.7533296", "text": "function watchAndReload() {\n watch();\n\n gulp.watch(config.publicPath + '**/*.{css,eot,html,ico,js,json,jpg,otf,png,svg,ttf,woff,woff2}', browserSyncReload);\n}", "title": "" }, { "docid": "0a2ff38e01251ad8372feba56b518f74", "score": "0.7504187", "text": "function watch() {\n // gulp.watch(config.patternsBasePath + \"/**/*.twig\", ['pl:generate']);\n gulp.watch(config.patternsBasePath + \"/**/*.scss\", css);\n gulp.watch(config.patternsBasePath + \"/**/*.js\", js);\n gulp.watch(\n [\n config.patternsBasePath + \"/**/*.twig\",\n config.drupalTemplates + \"/**/*.twig\",\n config.themeRoot + \"prc_theme.theme\"\n ],\n clearcache);\n gulp.watch(config.patternsBasePath + \"/10-atoms/15-icon/config.json\", importJson);\n gulp.watch(config.patternsDistPath + \"/fonts\", copyFonts);\n}", "title": "" }, { "docid": "63d0cccf61c5a2509914aae6a20be1da", "score": "0.75039387", "text": "function watchStatic() {\n STATIC_FILES.forEach( ( v ) => {\n let path;\n if ( fs.existsSync( `${SOURCE_PATH}${v}` ) && fs.lstatSync( `${SOURCE_PATH}${v}` ).isDirectory() ) {\n path = `${SOURCE_PATH}${v}`;\n path += \"/*.*\";\n } else {\n let file = v;\n if ( v[0] !== \"/\" ) {\n file = `/${file}`;\n }\n\n path = `${SOURCE_PATH}${file}`;\n }\n\n STATIC_FILES_TO_WATCH.push( path );\n } );\n}", "title": "" }, { "docid": "7915e599d30a1bfb014a048d3dc7ef52", "score": "0.75031173", "text": "function watch () {\n gulp.watch(config.paths.src + '**/*.html', gulp.series(copy, reload))\n gulp.watch(config.paths.src + '**/*.scss', gulp.series(sass, reload))\n}", "title": "" }, { "docid": "ac9075672ad213ab4dc1dab7a44963f5", "score": "0.74993175", "text": "function watchFiles() {\n watch(\"src/js/*.js\", buildJavascriptDev);\n watch(\"src/scss/*.scss\", buildScssDev);\n watch(\"src/css/*.css\", buildCssDev);\n watch(\"src/pages/*.html\", series(copyHTML, injection));\n watch(\"src/images/*\", copyImages);\n watch(\"src/fonts/*\", copyFonts);\n}", "title": "" }, { "docid": "6b7aa1968dbc933452fcbf7e20f584b8", "score": "0.74393916", "text": "function watch() {\n\t\t// PAGES\n\t\tgulp.watch('src/pages/**/*.html').on('all', gulp.series(pages, inline, browser.reload));\n\t\t\n\t\t// LAYOUT\n\t\tgulp.watch(['src/layouts/**/*', 'src/partials/**/*']).on('all', gulp.series(resetPages, pages, inline, browser.reload));\n\n\t\t// SCSS\n\t\tgulp.watch(['../scss/**/*.scss', 'src/assets/scss/**/*.scss']).on('all', gulp.series(resetPages, sass, pages, inline, browser.reload));\n\n\t\t// SCRIPTS\n\t\tgulp.watch('src/assets/js/**/*').on('all', gulp.series(scripts, browser.reload));\n\n\t\t// IMAGES\n\t\tgulp.watch('src/assets/img/**/*').on('all', gulp.series(images, browser.reload));\n\t}", "title": "" }, { "docid": "37d3bbff51c42a977179e159ee33f4de", "score": "0.74346703", "text": "function watch() {\n gulp.watch(paths.html, gulp.series(htmlDev, browsersyncReload));\n gulp.watch(paths.scssPattern, gulp.series(sassLint, sassDev));\n gulp.watch(paths.jsMain, gulp.series(jsLint, jsDev, browsersyncReload));\n gulp.watch(paths.images, gulp.series(images, browsersyncReload));\n}", "title": "" }, { "docid": "50b72a3e7be1b21d68c044e8191c570d", "score": "0.7419703", "text": "function watch() {\r\n\tbrowserSync.init({\r\n\t\tport: process.env.PORT || 3000,\r\n\t\tproxy: process.env.WP_URL,\r\n\t\topen: false\r\n\t})\r\n\r\n\tgulp.watch(sassFiles, sassy)\r\n\tgulp.watch([\r\n\t\t'./*.php',\r\n\t\t'./layouts/**/*.php',\r\n\t\t'./partials/**/*.php',\r\n\t\t'./woocommerce/**/*.php',\r\n\t\t'./src/scss/**/*.scss',\r\n\t]).on('change', reload)\r\n}", "title": "" }, { "docid": "9fa5c6d0fa7d77672e0ddb577b652895", "score": "0.7380759", "text": "function watch() {\n gulp.watch(path.src.sass, style);\n gulp.watch(path.src.template, copyHtml);\n gulp.watch(path.src.js, copyJs);\n}", "title": "" }, { "docid": "fee5fdd9f8c544fd578dd2ed16daf58a", "score": "0.7375557", "text": "function watch() {\n browserSync.init({\n server: {\n baseDir: './src'\n }\n });\n gulp.watch(['src/sass/*.sass', 'src/sass/page/*.sass', 'src/sass/pages/*.sass', 'src/sass/components/*.sass', 'src/sass/responsive/*.sass'], style);\n gulp.watch(['src/*.html', 'src/*/*/*.html']).on('change', browserSync.reload);\n gulp.watch('src/js/*.js').on('change', browserSync.reload);\n}", "title": "" }, { "docid": "603c3b0c649ff0e38e285cb650b8d908", "score": "0.73408693", "text": "function watch(){\n //update css files\n gulp.watch(paths.scssf.src, gulp.series(style,reload1));\n //update html files\n gulp.watch('./*.html').on('change',browserSync.reload);\n //pdate js files\n gulp.watch(paths.scripts.src,gulp.series(scripts, reload1));\n}", "title": "" }, { "docid": "3420419e039bf17ef5b11b17952bd7ae", "score": "0.7339913", "text": "function watch() {\n gulp.watch(paths.pugWatch, html);\n gulp.watch(paths.stylusWatch, css);\n}", "title": "" }, { "docid": "ee20502f0ef2ed0efdc42e1ff7d3c1c4", "score": "0.73350495", "text": "function watch() {\n\tgulp.watch('app/pages/**/*.html').on('all', gulp.series(pages, browser.reload));\n\tgulp.watch('app/**/*.scss', gulp.series(sass));\n\tgulp.watch('bower.json').on('all', gulp.series(libs, browser.reload));\n\tgulp.watch('app/**/*.js').on('all', gulp.series(js, browser.reload));\n\tgulp.watch(['app/**/*.{jpg,png,svg}', '!app/**/*-s.png'], gulp.series(images));\n\tgulp.watch('app/**/*-s.png', gulp.series(spritePng, images));\n}", "title": "" }, { "docid": "e5d5aaefb92087b6b51e26f49fea8c84", "score": "0.73295236", "text": "function watch() {\n gulp.watch(paths.styles.src, gulp.series(styles, reload));\n gulp.watch(paths.scripts.src, gulp.series(scripts, reload));\n gulp.watch(paths.images.src, gulp.series(images, reload));\n gulp.watch(paths.static.src, gulp.series(static, reload));\n gulp.watch(paths.fonts.src, gulp.series(fonts, reload));\n}", "title": "" }, { "docid": "5355567a8a2cadb87ff89cc602f25782", "score": "0.7323874", "text": "function watchFiles() {\n // copy files on init to run server\n\n watch('assets/sass/*.scss',// { events: 'all', ignoreInitial: false },\n { ignoreInitial: false },\n series(buildStyles, copyCSSToTmp) // before buildStyles {add sassLint,} if you want them compressed\n );\n watch( ['./assets/js/*.js', './components/*.js'],\n { ignoreInitial: false },\n series( copyJSToTmp, copyJSComponentsToTmp) //lintJS\n );\n watch( './*.html', \n { ignoreInitial: false },\n series(copyHTMLToTmp)\n );\n\n}", "title": "" }, { "docid": "84f20247ebfb9a7eb0afe19446f26a17", "score": "0.73136216", "text": "function watch() {\n gulp.watch(PATHS.media, media);\n gulp.watch(PATHS.favicons, favicons);\n gulp.watch('src/assets/scss/**/*.scss').on('all', gulp.series(sass));\n gulp.watch('src/assets/js/app/**/*.js').on('all', gulp.series(javascript));\n gulp.watch('src/assets/js/vendor/**/*.js').on('all', gulp.series(vendorJavascript));\n gulp.watch('src/assets/js/head/**/*.js').on('all', gulp.series(headJavascript));\n gulp.watch('src/assets/img/**/*').on('all', gulp.series(images));\n}", "title": "" }, { "docid": "f9ddc371d5be300353d9040c8c219ed3", "score": "0.73011917", "text": "watch() {\n // Update HTML on each markdown change\n helper.watch('./src/*.md', filepath => {\n this.compile(filepath);\n });\n // Rebuild everything when a layout, include or config changes\n helper.watch(\n [\n './src/_layouts/*.pug',\n './src/_includes/*.pug',\n './src/_mixins/*.pug',\n './config.json',\n ],\n () => {\n this.run();\n }\n );\n }", "title": "" }, { "docid": "15c48359e9a2fdaa53bbc87daa3b610c", "score": "0.72954357", "text": "function watch(done) {\n gulp.watch(dirs.sass.src + \"**/*.?(s)css\", build_sass);\n gulp.watch(['_site/**/*.html']).on('change', bsync_jekyll.reload);\n done();\n}", "title": "" }, { "docid": "49d3124d5781c0095805c9cc899578bd", "score": "0.7295354", "text": "function watch() {\n\tlivereload.listen(35729);\n\tgulp.watch(config.paths.files).on('change', function(file) {\n\t\tlivereload.changed(file);\n\t});\n\tgulp.watch(config.paths.styles.input, styles);\n\tgulp.watch(config.paths.scripts.input, scripts);\n}", "title": "" }, { "docid": "e8afe9d70f21795cc3b29a8e46ef826c", "score": "0.72712183", "text": "function watcher() {\n gulp.watch(path.vendor.styles, vendorCSS);\n gulp.watch(path.vendor.scripts, vendorJS);\n gulp.watch(path.components.styles, componentsCSS);\n gulp.watch(path.components.scripts, componentsJS);\n gulp.watch(path.watch, browserSyncReload);\n}", "title": "" }, { "docid": "fdef06babc26124fa432cec6a1b6fe5f", "score": "0.7269476", "text": "function do_watch_all(cb) {\n watch(css_src + '**/*.scss', exports.css);\n watch(js_src + 'js/**/*.js', exports.js);\n}", "title": "" }, { "docid": "1e382fa58f63a5272acaad3340e47127", "score": "0.72536373", "text": "function watch() {\n browserSync.init({\n // You can tell browserSync to use this directory and serve it as a mini-server\n server: {\n baseDir: \"./dist\"\n }\n // If you are already serving your website locally using something like apache\n // You can use the proxy setting to proxy that instead\n // proxy: \"yourlocal.dev\"\n });\n gulp.watch(paths.scss.in, assets);\n gulp.watch(paths.pugs.in, html);\n gulp.watch(paths.coffee.in, assets);\n gulp.watch(paths.html, reload);\n}", "title": "" }, { "docid": "b13bc7c8de8bb7cfdebd7b6049a36fa1", "score": "0.72341454", "text": "function watching(){\n watch([\n 'app/blocks/**/*.pug'\n ], pugCompiler)\n watch([\n 'app/blocks/**/*.scss'\n ], styles)\n watch([\n 'app/scripts/**/*.js', '!app/**/*.min.js'\n ], scripts);\n watch('app/images/**/*', images);\n}", "title": "" }, { "docid": "e7668d1a4aa99d656b9562b49c066a7a", "score": "0.7210207", "text": "function watch() {\n browserSync.init({\n server: {\n baseDir: './dist/'\n }\n });\n\n gulp.watch('./src/**/*.html', html);\n gulp.watch('./src/**/*.html').on('change', reload);\n gulp.watch('./src/images/**/*.+(png|jpg|gif|svg|ico|xml|txt|json)', images);\n gulp.watch('./src/images/**/*.+(png|jpg|gif|svg|ico|xml|txt|json)').on('change', reload);\n gulp.watch('./src/**/*.js', js);\n gulp.watch('./src/**/*.js').on('change', reload);\n gulp.watch('./src/styles/**/*.scss', style);\n gulp.watch('./src/js/**/*.js').on('change', reload);\n\n}", "title": "" }, { "docid": "acf7d36fb60fba771bad8052332770c3", "score": "0.7208507", "text": "function watch() {\n\tgulp.watch([files.scss.path, files.js.path], gulp.parallel(sass, javascript));\n}", "title": "" }, { "docid": "bf61a96940ea2e9e2b6a98f3556942bb", "score": "0.72083604", "text": "function watch() {\n gulp.watch(paths.src + '**/*.less', ['build:css']);\n watchJs(); // use watchify instead of gulp.watch for faster rebundling\n}", "title": "" }, { "docid": "44c745dfd69ffebcd66287b25ad65f62", "score": "0.7203649", "text": "function watchFiles() {\n gulp.watch(paths.scripts.src, scripts);\n gulp.watch(paths.styles.src, styles);\n}", "title": "" }, { "docid": "7f8daf5df62d132d68b66c6fa04d4543", "score": "0.7198966", "text": "function gulpWatch() {\n\n //Gulp will update every change in bellow files\n gulp.watch('sass/**/*.scss', gulpStyle);\n gulp.watch('./*.html').on('change', browserSync.reload);\n gulp.watch('js/**/*.js').on('change', browserSync.reload);\n gulp.watch('js/**/*.js', gulpLint);\n gulp.watch('./index.html', gulpCopyHtml);\n}", "title": "" }, { "docid": "09f33db6947d2d3ff97b4da685be302d", "score": "0.7195515", "text": "function watch() {\n browserSync.init({\n server: {\n baseDir: './app/dist'\n }\n });\n\n // BrowserSync reloads whenever css, javascript or html files are saved.\n gulp.watch(paths.css.src, styles);\n gulp.watch(paths.js.src, scripts);\n gulp.watch(paths.html.src, html).on('change', browserSync.reload);\n gulp.watch(paths.img.src, images);\n}", "title": "" }, { "docid": "e6b6d9052d4d026c5d3c8388428e2886", "score": "0.7168182", "text": "function watch() {\n gulp.watch(PATHS.assets, gulp.series('copy', reload));\n gulp.watch(['content/pages/*.html', 'content/pages/**/*.html']).on('all', gulp.series('kit-index', pages, kitIndex, reload));\n gulp.watch('content/websites/meta-patterns/*.html').on('all', gulp.series('meta-patterns', metaPatternsPages, reload));\n gulp.watch(['content/sections/*.html', 'assets_site/{layouts,partials}/**/*.html']).on('all', gulp.series(pages, metaPatternsPages, kitIndex, 'dynamic-pages', reload));\n gulp.watch('content/websites/patterns/**/*.html').on('all', gulp.series( 'building-block-pages', 'building-block-indices', reload));\n gulp.watch('content/websites/patterns/**/*.scss').on('all', gulp.series(buildingBlockSass, 'building-block-pages',reload));\n gulp.watch('content/websites/patterns/**/*.js').on('all', gulp.series(buildingBlockJS, 'building-block-pages', reload));\n gulp.watch('content/websites/patterns/**/*.ts').on('all', gulp.series(buildingBlockTS, 'building-block-pages', reload));\n gulp.watch(['content/websites/patterns/**/*.png', 'content/kits/**/*.png']).on('all', gulp.series('copy', reload));\n gulp.watch('content/websites/patterns/**/*.yml').on('all', gulp.series('building-block-meta', 'dynamic-pages', reload));\n gulp.watch('content/kits/**/*.yml').on('all', gulp.series('building-block-meta', 'dynamic-pages', reload));\n gulp.watch('assets_site/scss/**/*.scss').on('all', gulp.series(sass, buildingBlockSass, reload));\n gulp.watch('assets_site/js/**/*.js').on('all', gulp.series(javascript, reload));\n gulp.watch('assets_site/libraries/**/*').on('all', gulp.series(libraries, reload));\n gulp.watch('content/assets/img/**/*').on('all', gulp.series(images, reload));\n gulp.watch('content/styleguide/**').on('all', gulp.series(styleGuide, reload));\n}", "title": "" }, { "docid": "136d4352009b1723d3173cb13d18ea60", "score": "0.7164667", "text": "function watchFiles (){\n browserSync.init({\n proxy:{\n target:process.env.WP_HOME_HTTPS\n },\n open: false,\n notify: false,\n reloadDelay: 100\n\n })\n gulp.watch(['./web/app/themes/axrat/_src/scss/*','./web/app/themes/axrat/_src/scss/**/*','./web/app/themes/axrat/_src/scss/**/**/*'], scss).on('change', browserSync.reload);\n}", "title": "" }, { "docid": "cd4bb0d6ddfcf8e4c50210af7c8fd5cf", "score": "0.71539515", "text": "function watch() {\n\tgulp.watch(['src/js/*.js'], scripts);\n}", "title": "" }, { "docid": "687fb512cadec666d47c76c3d0537800", "score": "0.7150273", "text": "function watchFiles() {\n gulp.watch(watchDirs.html, gulp.series('html'));\n gulp.watch(watchDirs.css, gulp.series('sass'));\n gulp.watch(watchDirs.js, gulp.series(['js:concat', 'js:compress']));\n}", "title": "" }, { "docid": "e7f31be12f2c49342030b4213a0f3d61", "score": "0.7146693", "text": "function watchFiles(done) {\n watch(paths.pages.watch, series(pages, reload));\n watch(paths.styles.src, styles);\n watch(paths.scripts.src, scripts);\n watch(paths.images.src, images);\n done();\n}", "title": "" }, { "docid": "c2088057f5bce9dc71ed0ab472e41c9e", "score": "0.71277857", "text": "function watchFiles() {\r\n browserSync.init({\r\n server: {\r\n baseDir: './dist'\r\n },\r\n notify: false\r\n });\r\n\r\n gulp.watch(paths.styles.src, styles);\r\n gulp.watch(paths.vendors.src, vendors).on('change', browserSync.reload);\r\n gulp.watch(paths.favicon.src, favicon).on('change', browserSync.reload);\r\n gulp.watch(paths.scripts.src, scripts).on('change', browserSync.reload);\r\n gulp.watch(paths.images.src, images).on('change', browserSync.reload);\r\n \r\n // gulp.watch(paths.html.src, fileincludeHtml).on('change', browserSync.reload);\r\n // gulp.watch(paths.pug.src, pugg).on('change', browserSync.reload);\r\n // gulp.watch(paths.pug.tmp, templatesWatch).on('change', browserSync.reload);\r\n gulp.watch([paths.twig.tmp, paths.twig.data], {cwd:'./'}, twigs);\r\n gulp.watch(paths.html.dest, rebuild).on('change', browserSync.reload);\r\n}", "title": "" }, { "docid": "7c1077d22f14cb6561370cc23b5fa562", "score": "0.7126211", "text": "function watch(){\n return gulp.watch(\"./src/sass/*/*.sass\" , gulp.series([css, concatCSS])),\n gulp.watch(\"./src/templates/*.twig\" , gulp.series([twigHtml, html])),\n gulp.watch(\"./src/templates/includes/*/*.twig\" , gulp.series([twigHtml, html])),\n gulp.watch(\"./src/templates/layouts/*.twig\" , gulp.series([twigHtml, html]));\n}", "title": "" }, { "docid": "c0bd11c2af1df069c5cadde8d8a5921b", "score": "0.71192086", "text": "function watch() {\n // Watch for changes in scss, then compile and minify\n gulp.watch('scss/*.scss', gulp.series(style, minify));\n // Reloads the browser whenever HTML files change\n gulp.watch('*.html', reload);\n gulp.watch('js/*.js', reload);\n}", "title": "" }, { "docid": "202c090c7d4c6f97e25da872356951ab", "score": "0.7114099", "text": "function _watch() {\n const watchImages = [\n src_assets_folder + 'images/**/*.+(png|jpg|jpeg|gif|svg|ico)'\n ];\n\n const watchVendor = [];\n\n node_dependencies.forEach(dependency => {\n watchVendor.push(node_modules_folder + dependency + '/**/*.*');\n });\n\n const watchList = [\n src_folder + '**/*.html',\n src_folder + 'pug/**/*.pug',\n src_assets_folder + 'sass/**/*.sass',\n src_assets_folder + 'scss/**/*.scss',\n src_assets_folder + 'less/**/*.less',\n src_assets_folder + 'stylus/**/*.styl',\n src_assets_folder + 'js/**/*.js'\n ];\n\n watch(watchList, series(dev)).on('change', browserSync.reload);\n watch(watchImages, series(gulpImage)).on('change', browserSync.reload);\n watch(watchVendor, series(gulpVendor)).on('change', browserSync.reload);\n}", "title": "" }, { "docid": "2240622f4abfbefa097be70e4f511141", "score": "0.71126115", "text": "function watchFiles() {\r\n gulp.watch(phpDir, gulp.series(php, browserSyncReload));\r\n gulp.watch(htmlDir, gulp.series(browserSyncReload));\r\n gulp.watch(sassDir, gulp.series(scssTask, browserSyncReload));\r\n}", "title": "" }, { "docid": "c01da714e9ff36476a48b68dfc1c7c0f", "score": "0.7096282", "text": "function watch() {\n gulp.watch('src/scss/**/*.scss').on('all', gulp.series(sass));\n gulp.watch('src/js/**/*.js').on('all', gulp.series(javascript));\n}", "title": "" }, { "docid": "cc5056023b12a8d400f46d29375df7d5", "score": "0.7085889", "text": "function watch() {\n browserSync.init({\n proxy: \"http://shittysite.test/\"\n });\n gulp.watch(paths.styles.src, style);\n gulp.watch(paths.scripts.src, series(lint, scripts));\n // We should tell gulp which files to watch to trigger the reload\n // This can be html or whatever you're using to develop your website\n // Note -- you can obviously add the path to the Paths object\n // gulp.watch(\"path/to/html/*.html\", reload);\n log('Watch function completed');\n}", "title": "" }, { "docid": "f6293f10b9f30a136c96ecc235f48c47", "score": "0.7076664", "text": "function html() {\n watch(\"*.html\").on(\"change\", browserSync.reload);\n // You can use a single task\n watch(\"build/**/**/*\", css).on(\"change\", browserSync.reload);\n watch(\"build/js/*.js\", js).on(\"change\", browserSync.reload);\n}", "title": "" }, { "docid": "4d3cd2bf2ef960a1922c36f31af396d7", "score": "0.7068716", "text": "async #watch() {\n const { default: chokidar } = await import(\"chokidar\");\n this.#watcher = chokidar.watch(\n join(fileURLToPath(this.#settings.config.root), ASTRO_GLOB_PATTERN),\n {\n ignored: [\"**/node_modules/**\"],\n ignoreInitial: true\n }\n );\n this.#watcher.on(\"add\", (file) => {\n this.#addDocument(file);\n this.#filesCount += 1;\n this.#checkForDiagnostics();\n });\n this.#watcher.on(\"change\", (file) => {\n this.#addDocument(file);\n this.#checkForDiagnostics();\n });\n this.#watcher.on(\"unlink\", (file) => {\n this.#diagnosticsChecker.removeDocument(file);\n this.#filesCount -= 1;\n this.#checkForDiagnostics();\n });\n }", "title": "" }, { "docid": "9dd5b95bf70d453db70a88a2f1361518", "score": "0.7047364", "text": "function watch() {\n browserSync.init({\n server: {\n baseDir: \"./\"\n\n },\n //tunnel: true // creates a temporary address that the customer can see\n });\n\n gulp.watch('./src/scss/**/*.scss', styles);\n gulp.watch('./src/css/**/*.css', styles); //all files with this extension + in the attached files looks\n gulp.watch('./src/js/**/*.js', scripts);\n gulp.watch('./*.html', browserSync.reload);\n}", "title": "" }, { "docid": "bf3600708462ee7ac2da127f059f7690", "score": "0.7026192", "text": "function watchDev() {\n console.log('watching for changes');\n watch(\n ['./src/content/**/*', './src/styles/**/*', './src/scripts/**/*'],\n series('styles', 'scripts', browsersyncReload)\n );\n}", "title": "" }, { "docid": "c3c86fe3c98c4e8753f740a406fbd174", "score": "0.7022366", "text": "function watch() {\n\tgulp.watch('./test/*.jade', buildHTML);\n\tgulp.watch([\n\t\t'./utilus/*',\n\t\t'./lib/*',\n\t\t'./plugin/*',\n\t\t'./test/*.styl'\n\t], buildStyles);\n}", "title": "" }, { "docid": "05da5036ea0d911b6b4eafdf0227731f", "score": "0.69992024", "text": "function watchTask() {\n watch(\"src/*.html\", series(copyHtml, browsersyncReload));\n watch([\"src/scss/*.scss\", \"src/js/*.js\"],\n series(\n copyHtml,\n parallel(compileSass, bundle),\n postCssPrefixer,\n browsersyncReload\n )\n )\n}", "title": "" }, { "docid": "6de3853b8d88f2ad29607320bfe05124", "score": "0.69938874", "text": "function watch() {\n browserSync.init({\n proxy: \"http://localhost/arbel/web/index.php\"\n });\n gulp.watch(\"web/scss/**/*.scss\", style);\n gulp.watch(\"web/css/**/*.css\").on(\"change\", browserSync.reload);\n gulp.watch(\"web/js/**/*.js\").on(\"change\", browserSync.reload);\n}", "title": "" }, { "docid": "ba27cc15cc46591cc2dba9795f76321d", "score": "0.69688815", "text": "function watchFiles() {\n var config = getConfigData();\n\n // sass\n var sassWatch = config.sass.includePaths.slice(0);\n\n for (var i = 0; i < sassWatch.length; i++) {\n if (sassWatch[i].slice(-1) === '/') {\n sassWatch[i] += \"*\";\n }\n }\n\n sassWatch.push(config.sass.main);\n //watch(sassWatch, [\"build:css\"]);\n\n // config\n //gulp.watch(configFile, [\"init:config\", \"default\"]);\n\n // custom\n var customWatches = config.directories.watch || [];\n\n for (var j = 0; i < customWatches.length; i++) {\n gulp.watch(customWatches[j].src, customWatches[j].tasks || [\"default\"]);\n }\n}", "title": "" }, { "docid": "564bf85b90c956064e50b94ddd4d1757", "score": "0.69502074", "text": "function watch() {\n\tbsync.init({\n\t\tproxy: process.env.DEV_HOST || 'https://wp.devenv/',\n\t});\n\tgulp.watch(['src/sass/*.scss'], styles);\n\tgulp.watch(['src/js/*.js'], scripts);\n}", "title": "" }, { "docid": "09470f0514dd7e39dbcad00d8057f42c", "score": "0.6949814", "text": "function watch () {\n gulp.watch('src/panini/pages/**/*.html').on('all', gulp.series(pages));\n gulp.watch('src/panini/{layouts,partials}/**/*.html').on('all', gulp.series(resetPages, pages));\n gulp.watch('src/styleguide/*.*').on('all', gulp.series(styleGuide));\n gulp.watch('src/app/img/**/*').on('all', gulp.series(images, resetPages, pages));\n}", "title": "" }, { "docid": "398aa8de47f709b7f822d8e005d4ee8a", "score": "0.6931968", "text": "function watch() {\n gulp.watch('src/*', openpixel);\n gulp.watch('src/*', snippet);\n}", "title": "" }, { "docid": "24c7aa7fffdc356bee255a6a404f69b4", "score": "0.6927066", "text": "function watchMan() {\n watch(['sassItUp/**/*.scss', '*.html'],buildStyles)\n}", "title": "" }, { "docid": "f98bbd4a8cb96ddcfcb4b04253f15b18", "score": "0.6913752", "text": "function watchTask() {\n\twatch('dist/*.html', reload);\n\twatch('src/**/*.scss', series(scssTask, reload));\n\twatch('src/**/*.js', series(jsTask, reload));\n}", "title": "" }, { "docid": "2529841b937740fd31e52bc3df63f5eb", "score": "0.6895612", "text": "function watchProduction() {\n //watch assets\n //gulp.watch('src/pages/**/*.html').on('all', gulp.series(pages, rsyncTemplates)); \n gulp.watch(PATHS.media, media);\n gulp.watch('src/assets/scss/**/*.scss').on('all', gulp.series(sass, rsyncAssets));\n gulp.watch('src/assets/js/app/**/*.js').on('all', gulp.series(javascript, rsyncAssets));\n gulp.watch('src/assets/js/vendor/**/*.js').on('all', gulp.series(vendorJavascript, rsyncAssets));\n gulp.watch('src/assets/js/head/**/*.js').on('all', gulp.series(headJavascript, rsyncAssets));\n gulp.watch('src/assets/img/**/*').on('all', gulp.series(images, rsyncAssets));\n}", "title": "" }, { "docid": "0eb1ffb442412d42492e070f75b3c978", "score": "0.68648845", "text": "function watchArchivos(){\n //Toma el archivo y pide que especifiquemos qué tarea debe ejecutar\n watch('desarrollo/scss/**/*.scss' , generadorCSS);\n watch('desarrollo/js/**/*.js', javascript);\n}", "title": "" }, { "docid": "2f69bfa22c9e08e49d98875f482793d4", "score": "0.6847431", "text": "function watch() {\n browserSync.init({\n server: {\n baseDir: \"./\",\n },\n browser: \"firefox developer edition\"\n });\n\n gulp.watch('./src/less/**/*.less', styles);\n gulp.watch('./src/js/**/*.js', scripts);\n gulp.watch('./*.html').on('change', browserSync.reload);\n}", "title": "" }, { "docid": "14afb271f4667bc9fb216514219afffb", "score": "0.68382484", "text": "function watch() {\n $.livereload.listen();\n gulp.watch(watchFiles, ['build']);\n // gulp.watch(watchFiles, ['test']);\n}", "title": "" }, { "docid": "3eff81057837e5ba3598797bd2f020ce", "score": "0.6832806", "text": "function watchTask(){\n watch([\n files.twigPath,\n files.scssPath,\n files.jsAppPath,\n files.jsPluginPath,\n files.fontPath,\n files.imgPath\n ],\n parallel(twigSite, twigStyleguide, style, scriptApp, scriptPlugin, assets));\n}", "title": "" }, { "docid": "3ec19b1e223a2d909fda7047de6624f3", "score": "0.6806567", "text": "function do_watch_css(cb) {\n watch(css_src + '**/*.scss', exports.css);\n}", "title": "" }, { "docid": "13719188b0dcc828634abf04c80d5d6d", "score": "0.67727953", "text": "function watch(done) {\n gulp.watch(paths.html.src, templates);\n gulp.watch(paths.images.svg, sprite);\n gulp.watch(paths.scripts.src, scripts);\n gulp.watch(paths.styles.src, styles);\n\n done();\n}", "title": "" }, { "docid": "dbff76044e3d822b7b7f2a5a9d267ac3", "score": "0.6767404", "text": "watch(done) {\n gulp.watch(path.join(config.paths.sass.src, '/**/*.scss'), gulp.series(this.styles, this.reload)); // SCSS recompile & reload\n gulp.watch(path.join(config.paths.server, '**/*.html'), gulp.series(this.reload)); // Express templates\n gulp.watch([\n path.join(config.paths.vue.src, '**/*.vue'),\n path.join(config.paths.vue.src, '**/*.js'),\n ], gulp.series(this.rollup, this.reload)); // Vue + frontend JS\n done();\n }", "title": "" }, { "docid": "8e7b161ecd249b3fefb2f77a09c40967", "score": "0.6728809", "text": "function assets (reload) {\n log(\"Starting '\"+ cyan('watch:assets') +\"'...\")\n\n gulp.watch([\n 'app/**/*.{jade,html}',\n '!app/{packages,*/packages}/**'], ['assets:jade/html', reload]);\n\n gulp.watch([\n 'app/**/*.{scss,css}',\n '!app/{packages,*/packages}/**'], ['assets:scss/css', reload]);\n\n gulp.watch([\n 'app/**/*.{dart,js}',\n '!app/{packages,*/packages}/**'], reload);\n}", "title": "" }, { "docid": "7f9a7f4ffe2d34d07c397c91d4734a71", "score": "0.6724043", "text": "function serve(){\n\n gulp.watch(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss'], css);\n gulp.watch(\"src/*html\", browserSyncReload);\n}", "title": "" }, { "docid": "fe252e37bc1e70c6d5bd73293d722ce9", "score": "0.6696891", "text": "function watchTask() {\n watch(\"*.html\", browserSyncReload);\n watch([\"app/scss/**/*.scss\"], series(scssTask, browserSyncReload));\n}", "title": "" }, { "docid": "c56c01e880f551790184135cd2db4cdf", "score": "0.66954976", "text": "function devWatch() {\n console.log( taskHeader(\n '1/1',\n 'Watch',\n 'Compile',\n 'JS & SCSS'\n ) );\n\n watch( sources.scss, series( compile ) );\n watch( sources.js, series( compile ) );\n}", "title": "" }, { "docid": "699b220ab5479830fe8e254122618efa", "score": "0.6692594", "text": "function watchTask() {\n watch(\"./assets/public/js/*.js\", injectFiles);\n watch(\"./assets/public/css/*.css\", injectFiles);\n watch(\n [files.scssPath, files.jsPath],\n { interval: 1000, usePolling: true }, //Makes docker work\n series(parallel(scssTask, scssLibTask, jsTask, jsLibTask))\n );\n}", "title": "" }, { "docid": "527d0e0dbcca1e77e459f8a4fcf2a230", "score": "0.66836095", "text": "function watch() {\n gulp.watch(paths.styles.src, style);\n}", "title": "" }, { "docid": "d2ad3db7ccfc6c8a8e0cd135d21ffd3b", "score": "0.66790456", "text": "function watcher(cb) {\n\n watch( ['content/sass/*.scss', 'content/sass/*/*.scss'], \n series(sassCompile))\n\n watch( 'content/css/*.css', \n series(minifyRtlCss,minifyLtrCss) )\n\n watch( 'content/js/*.js', \n series(minifyLtrJs, minifyRtlJs) )\n\n cb();\n}", "title": "" }, { "docid": "a39f29705da96260ee49d614a93b6b00", "score": "0.6666386", "text": "function watchTask() {\n\twatch(['shinobi/**/*.scss'], buildStyles) \n}", "title": "" }, { "docid": "6c51e663036c942e1f44f74387ebcdca", "score": "0.6641014", "text": "function watchTask() {\n watch(appPaths.jsPath, series(() => js(environment), reload));\n watch(appPaths.jsPluginsPath, series(() => jsPlugins(environment), reload));\n watch(appPaths.php, reload);\n watch(appPaths.sass, css);\n}", "title": "" }, { "docid": "9c8f3a0e6d43f81e8831637e21a7f6e5", "score": "0.66249365", "text": "function watch() {\n // start watchers\n gulp.watch(paths.entry.src, gulp.series(startWatchTask, entry, reload))\n gulp.watch(paths.assets.src, gulp.series(startWatchTask, assets, reload))\n gulp.watch(paths.scripts.src, gulp.series(startWatchTask, scripts, reload))\n gulp.watch(\n paths.appStyles.src,\n gulp.series(startWatchTask, ui5AppStyles, reload)\n )\n gulp.watch(\n paths.libStyles.src,\n gulp.series(startWatchTask, ui5LibStyles, reload)\n )\n gulp.watch(\n paths.themeStyles.src,\n gulp.series(startWatchTask, ui5ThemeStyles, reload)\n )\n\n // start HTTP server\n if (options.local) {\n startHttpServer()\n }\n}", "title": "" }, { "docid": "04daf0493f5b191bf28c22f0be7a8708", "score": "0.6623566", "text": "function watchTask() {\n var filess = [\n '**/*.html',\n 'src/css/**/*.css',\n 'src/js/*.js',\n 'src/scss/**/*.scss'\n ];\n browserSync.init(filess, {\n server: {\n baseDir: \"dist\",\n index: \"index.html\"\n },\n notify: true,\n injectChanges: true\n }\n );\n /* watch([files.scssPath, files.jsPath], { interval: 1000, usePolling: true }, //Makes docker work\n series(\n parallel(scssTask, jsTask)\n )\n ); */\n watch([files.scssPath], series(scssTask))\n watch([files.jsPath], series(jsTask));\n watch([files.imagesPath], series(imagesTask));\n watch([files.fontPath], series(fontTask));\n watch([files.indexHtmlPath], series(indexHtmlTask));\n watch(\"**/*.html\").on(\"change\", reload);\n // watch([files.htmlPath], series(pugHTMLTask));\n // watch([files.jsPath], series(jsBabelTask));;\n}", "title": "" }, { "docid": "775f323aa4773c189e11b9e989bdfcfa", "score": "0.65995014", "text": "function watchTask() {\n browserSync.init({\n server: './'\n });\n //html & css changes\n watch(files.htmlPath).on('change', browserSync.reload);\n watch(files.cssPath).on('change', browserSync.reload);\n watch([files.lessPath, files.jsPath],\n parallel(lessTask, jsTask, imgTask));\n}", "title": "" }, { "docid": "2e8d176da3889e462edb9d720da2325f", "score": "0.65812904", "text": "function watchAll() {\n\t// Browser Sync Server runing on port 3030\n\tbrowserSync.init({\n\t\tserver: './client',\n\t\tport: 3030\n\t});\n\t// Watch the JS and the Sass files\n\tgulp.watch( './app/**/*.scss', ['sass'] );\n\tgulp.watch( './app/**/*.js', ['scripts'] );\n\tgulp.watch( ['./app/**/*.js', './tests/*.spec.js'], ['test'] );\n}", "title": "" }, { "docid": "7639099fbdff50e4688988569e2bb766", "score": "0.65657115", "text": "function watch_task() {\n watch('src/sass/**/*.sass', sass_task);\n watch('src/img/**/*', image_task);\n\n // Delete this if you don't use the pug_task or copy_task from the docs.\n //watch('src/pug/**/**/*.pug', pug_task);\n //watch('src/js/**/*.js', copy_task);\n //watch('src/css/**/*.css', copy_task);\n}", "title": "" }, { "docid": "df2330241624c0206b4dce357b581fa7", "score": "0.656272", "text": "function watcher(cb) {\n watch([options.src + '/sass/**/*.scss'])\n .on('change', styles);\n cb();\n}", "title": "" }, { "docid": "00301f5510b41164a5b5fc845300642b", "score": "0.65432245", "text": "function watch() {\n browserSync.init({\n server: {\n baseDir: \"./\"\n },\n browser: \"google chrome\"\n });\n\n // gulp\n // .watch(\n // [\n // filesPath.sass,\n // filesPath.html,\n // filesPath.less,\n // filesPath.js,\n // filesPath.images\n // ],\n // parallel(sassTask, lessTask, jsTask, imagesTask, kitTask)\n // )\n // .on(\"change\", browserSync.reload);\n\n gulp.watch(filesPath.sass, sassTask).on(\"change\", browserSync.reload);\n gulp.watch(filesPath.less, lessTask).on(\"change\", browserSync.reload);\n gulp.watch(filesPath.js, jsTask).on(\"change\", browserSync.reload);\n gulp.watch(filesPath.html, kitTask).on(\"change\", browserSync.reload);\n gulp.watch(filesPath.images, imagesTask).on(\"change\", browserSync.reload);\n}", "title": "" }, { "docid": "240277ebd3aadc703cd77742c93fd15c", "score": "0.6530503", "text": "function watch() {\n gulp.watch(watchFiles);\n}", "title": "" }, { "docid": "576ac3b47751b2908c5630b175fb1856", "score": "0.6490306", "text": "function watcher(next) {\n state.isDevMode = true;\n if (livereload !== null) {\n livereload.listen();\n }\n\n gulp.watch(config.app_files.less_files, appCss);\n log('Watching', color.yellow('LESS'), 'files');\n\n var appFiles = config.app_files.js\n .concat(config.app_files.templates);\n gulp.watch(appFiles, appJs);\n log('Watching', color.yellow('JavaScript'), 'files');\n\n gulp.watch(config.app_files.html, indexHtml);\n log('Watching', color.yellow('HTML'), 'files');\n\n gulp.watch(config.app_files.json, dashboardConfigJson);\n log('Watching', color.blue('JSON'), 'files');\n\n gulp.watch(config.app_files.i18n, {interval: 3000}, i18n);\n log('Watching', color.blue('I18N'), 'files');\n\n gulp.watch(config.shared_files.less, buildShared);\n log('Watching', color.yellow('LESS'), 'shared_files');\n\n var appFilesShared = config.shared_files.js\n .concat(config.shared_files.templates);\n gulp.watch(appFilesShared, buildShared);\n log('Watching', color.yellow('JavaScript'), 'shared_files');\n\n gulp.watch(config.shared_files.i18n, {interval: 3000}, buildShared);\n log('Watching', color.blue('I18N'), 'shared_files');\n\n next();\n}", "title": "" }, { "docid": "2e3da271c96c583e4c30c2e61f1cbb5a", "score": "0.64839053", "text": "function watchChange(cb) {\n watch(\n [\n '*.js',\n '*.json',\n './**/*.marko',\n './**/*.scss',\n './**/*.json',\n './**/*.js'\n ],\n {\n ignored: [\n './**/*.marko.js',\n './public/min/*.*'\n ]\n },\n series(build, reStartServer));\n cb();\n}", "title": "" }, { "docid": "9865954c88b7327d7333987afaf2e821", "score": "0.6415997", "text": "function sassWatch() {\n return gulp\n // ... and compile if necessary\n .watch(sassSrcFiles, ['sass-compile'])\n .on('change', (event) => {\n gutil.log(`File ${event.path} was ${event.type}, running tasks...`);\n });\n}", "title": "" }, { "docid": "92716f39ca5c093fef79353262b971cd", "score": "0.6410274", "text": "function watchFiles() {\n\treturn gulp.watch(paths.stylus, gulp.series('build-stylus'));\n}", "title": "" }, { "docid": "6bcbabf7d7a6314176aed470d7cdbcc4", "score": "0.6374299", "text": "function serve() {\n\n browserSync.init({\n server: \"./src\"\n });\n\n watch(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss'], sassConv);\n watch(\"src/*.html\").on('change', browserSync.reload);\n}", "title": "" }, { "docid": "f118523327330f3c965d7c61a8fd7e0f", "score": "0.6360421", "text": "function watchTask() {\n watch(\n [files.scssPath, files.htmlPath, files.jsPath],\n series(parallel(scssTask, copyHtml, jsTask), repHtmlUrl, repJsUrl, repCssUrl)\n );\n}", "title": "" }, { "docid": "b3af56d9682910a8369de309626b69d4", "score": "0.6333034", "text": "function watch() {\n watchDefinitions.forEach(({ files, task }) => gulp.watch(files, task));\n}", "title": "" }, { "docid": "a550f01d8dd1648b971a8d2e70753740", "score": "0.633093", "text": "function buildWatch() {\n\tgulp.watch('src/**/*.less', { ignoreInitial: false }, buildLess);\n\tgulp.watch(\n\t\t['src/fonts', 'src/lang', 'src/templates', 'src/*.json', 'src/**/*.js'],\n\t\t{ ignoreInitial: false },\n\t\tcopyFiles\n\t);\n}", "title": "" }, { "docid": "b3d1231a802670e7cc6c816eaebe25fa", "score": "0.6325976", "text": "function watchTask(){\n watch([files.scssPath, files.jsPath],\n {interval: 1000, usePolling: true}, //Makes docker work\n parallel(scssTask, jsTask),\n );\n}", "title": "" }, { "docid": "cedbfa0662d3c00602661bdf66b9fe91", "score": "0.63207364", "text": "function buildWatch() {\n\tgulp.watch('src/**/*.less', { ignoreInitial: false }, buildLess);\n\tgulp.watch(\n\t\t['src/fonts', 'src/templates', 'src/lang', 'src/*.json', 'src/**/*.js'],\n\t\t{ ignoreInitial: false },\n\t\tcopyWatchFiles\n\t);\n}", "title": "" }, { "docid": "58adb7c97448908b6d8f8b9bb5d6fcf0", "score": "0.63095933", "text": "function work() {\n browserSync.init({\n proxy: config.server.urlProject\n\n });\n gulp.watch(config.paths.html.src, html);\n gulp.watch(config.paths.scripts.src, js);\n gulp.watch(config.paths.css.src, css);\n gulp.watch(config.paths.image.src, img);\n gulp.watch(config.paths.html.dest).on('change', browserSync.reload);\n\n}", "title": "" }, { "docid": "4f5b8a156b1ed5557b7f89470a2ac80f", "score": "0.629391", "text": "function watchTask() {\n browserSync.init({\n notify: false, //prevents showing the message of browser sync\n open: true, //prevents openning the browser tab\n server: {\n baseDir: './',\n },\n });\n watch(\n [files.scssPath, files.jsPath],\n {\n interval: 1000,\n usePolling: true,\n }, //Makes docker work\n series(parallel(scssTask, jsTask), cacheBustTask)\n );\n watch(files.htmlPath).on('change', browserSync.reload);\n}", "title": "" }, { "docid": "de0c629cc07a45066e4b9efb09cac7d8", "score": "0.6291234", "text": "function start(cb) {\r\n // build();\r\n // bs();\r\n watch([assetsPaths.src]).on('change', function(path, stats) {\r\n assets();\r\n console.log(`File ${path} was changed`);\r\n browserSync.reload();\r\n });\r\n watch([fontPaths.src]).on('change', function(path, stats) {\r\n font();\r\n console.log(`File ${path} was changed`);\r\n browserSync.reload();\r\n });\r\n watch([sassPaths.fullSrc]).on('change', function(path, stats) {\r\n style();\r\n console.log(`File ${path} was changed`);\r\n browserSync.reload();\r\n });\r\n watch([jsPaths.src]).on('change', function(path, stats) {\r\n script();\r\n console.log(`File ${path} was changed`);\r\n browserSync.reload();\r\n });\r\n watch([htmlPaths.src]).on('change', function(path, stats) {\r\n template();\r\n console.log(`File ${path} was changed`);\r\n browserSync.reload();\r\n });\r\n cb();\r\n}", "title": "" }, { "docid": "b3389b3909d72d93092f94f4213a50a8", "score": "0.62834084", "text": "function WatchSiteLess() {\n gulp.watch(\"./public/content/**/*.less\", gulp.series(siteLess));\n}", "title": "" }, { "docid": "519e60b69a12ad033866432d9bee6825", "score": "0.6281215", "text": "function browserSync() {\n // Run serveSass when starting the dev server to make sure the SCSS & dev CSS are the same\n //css();\n\n bs.init({\n // Dev server will run at localhost:8080\n server: {\n baseDir: paths.input,\n },\n });\n\n watch(paths.devHTML).on('change', bs.reload);\n watch(paths.devCSS, css).on('change', bs.reload);\n watch(paths.devJS).on('change', bs.reload);\n watch(paths.devImages).on('change', bs.reload);\n}", "title": "" } ]
937c41088cae7b8f794553a6d4b871d1
Remove class from element
[ { "docid": "b72598e2215a678dbc8849e37a80d36b", "score": "0.7309458", "text": "function removeClass(element, className){\n if(element.classList){\n // console.log('remove class classList');\n element.classList.remove(className);\n }else{\n //Polyfill\n // console.log('remove class polyfill');\n var reg = new RegExp('(?:^|\\\\s)' + className + '(?!\\\\S)');\n element.className = element.className.replace(reg, '');\n }\n }", "title": "" } ]
[ { "docid": "0b8d370cc3b243e6b0dd4e933a6ca3f5", "score": "0.779937", "text": "function removeClass(element, className) {\n $('.' + className, element).each(function(){\n unwrap(this);\n });\n }", "title": "" }, { "docid": "bdaf13a6ae71b6299f8e46273c954eea", "score": "0.77425325", "text": "function removeClass( classname, element ) {\n var cln = element.className;\n var rxp = new RegExp('(?:^|\\\\s)'+classname+'(?!\\\\S)');\n cln = cln.replace( rxp, '' );\n element.className = cln;\n}", "title": "" }, { "docid": "495c6bae6f41205b05af73da31431bdb", "score": "0.7709295", "text": "function $removeClass(element, className)\n{\n if (element.classList.contains(className))\n element.classList.remove(className);\n}", "title": "" }, { "docid": "82fec92d0f3824735de9af10f0fa2aea", "score": "0.7614671", "text": "function removeClass(className, element) {\n if (element.classList)\n element.classList.remove(className);\n else\n element.className = element.className.replace(new RegExp('(^|\\\\b)' +\n className.split(' ').join('|') + '(\\\\b|$)', 'gi'), ' ');\n }", "title": "" }, { "docid": "908495d25d14e114a189d6bd1ba3cc43", "score": "0.7608723", "text": "function removeClass(element, nameOfClass){\n\t \n\t if ( hasClass(element, nameOfClass) ){\n\t \n\t var reg = new RegExp('(\\\\s|^)'+nameOfClass+'(\\\\s|$)');\n\t element.className=element.className.replace(reg,' ');\n\t }\n\t }", "title": "" }, { "docid": "f52854eb1a1a4bb0be8266fdcbc708b5", "score": "0.75976294", "text": "function removeClass(e,t){if(hasClass(e,t)){var n=' '+e.className.replace(/[\\t\\r\\n]/g,' ')+' ';while(n.indexOf(t)>=0){n=n.replace(' '+t+' ',' ')}e.className=n.trim()}}", "title": "" }, { "docid": "91315d2c6ce26c3abdb50467403093a7", "score": "0.75163317", "text": "function removeClass(el, classes) {\n return _frameworkProto.removeClass.call(el, classes);\n }", "title": "" }, { "docid": "91315d2c6ce26c3abdb50467403093a7", "score": "0.75163317", "text": "function removeClass(el, classes) {\n return _frameworkProto.removeClass.call(el, classes);\n }", "title": "" }, { "docid": "43645e3c7e01d6f110c77b12b726f5eb", "score": "0.7469328", "text": "function removeClass(e, className) {\n e.className = trim(e.className.replace(className, ''));\n}", "title": "" }, { "docid": "602483cb243624e9f7d0b587bfc88ed3", "score": "0.7467072", "text": "removeClasses(element, classes){\n this.cycleItems(classes,classItem => element.classList.remove(classItem));\n }", "title": "" }, { "docid": "cee151959cf2f00db9b27d87e7bd649e", "score": "0.7458123", "text": "function removeClass(className) {\n if (hasClass(className)) {\n documentElement.className = documentElement.className.replace(' ' + className, '');\n }\n}", "title": "" }, { "docid": "ff676d4eacce990cc4e33c216fa0e4e8", "score": "0.7456638", "text": "function removeClass(elem, cls) {\n var classes = elem.className,\n present = elem.className.indexOf(cls) !== -1 ? true : false;\n if (present) {\n if (classes === cls) elem.className = '';\n else elem.className = elem.className.replace(' ' + cls, '');\n }\n }", "title": "" }, { "docid": "51146c894ad96d77b809d15055158fa5", "score": "0.7443891", "text": "function removeActiveClass(element) {\n element.classList.remove('active');\n}", "title": "" }, { "docid": "d2e6800758abc000e183c2c952ad82a9", "score": "0.7401099", "text": "_removeClass(node, className) {\n node.classList.remove(className);\n }", "title": "" }, { "docid": "b6898bf510022497c7931155e348177f", "score": "0.73901284", "text": "removeClass(className) {\n this.els.forEach(el => {\n el.classList.remove(className)\n })\n return this;\n }", "title": "" }, { "docid": "9383e603010144447583e581997fa544", "score": "0.73743474", "text": "function remClass(element, name) {\n\tif (hasClassList(element) && chkClass(element, name)) {\n\t\telement.classList.remove(name);\n\t}\n}", "title": "" }, { "docid": "090fbed7ec771954bcbb81eb46b9a069", "score": "0.7348669", "text": "function removeClass(element, className) {\n var classNames = element.className.split( ' ' );\n \n var index = classNames.length;\n while ( index-- ) {\n if ( className == classNames[ index ] ) {\n classNames.splice( index, 1 );\n }\n }\n\n element.className = classNames.join( ' ' );\n}", "title": "" }, { "docid": "973f36bb1078d9ce786ccd279028823d", "score": "0.73451114", "text": "function removeClass(el,cls){/* istanbul ignore if */if(!cls||!(cls=cls.trim())){return;}/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(/\\s+/).forEach(function(c){return el.classList.remove(c);});}else{el.classList.remove(cls);}if(!el.classList.length){el.removeAttribute('class');}}else{var cur=\" \"+(el.getAttribute('class')||'')+\" \";var tar=' '+cls+' ';while(cur.indexOf(tar)>=0){cur=cur.replace(tar,' ');}cur=cur.trim();if(cur){el.setAttribute('class',cur);}else{el.removeAttribute('class');}}}", "title": "" }, { "docid": "bee25b2b9ea43ba6e78c9d2b5c06c704", "score": "0.73449236", "text": "function removeClasses() {\n\t$('#vp').removeClass();\n\t}", "title": "" }, { "docid": "b385171e351b40186677ff144dfe4f43", "score": "0.73363924", "text": "function removeClass(element, name) {\n\t var oldList = classList(element),\n\t newList;\n\n\t if (!hasClass(element, name)) return;\n\n\t // Replace the class name.\n\t newList = oldList.replace(' ' + name + ' ', ' ');\n\n\t // Trim the opening and closing spaces.\n\t element.className = newList.substring(1, newList.length - 1);\n\t }", "title": "" }, { "docid": "b385d918b202ece3a3f70ea9690624a2", "score": "0.7334582", "text": "function removeClass(elem, className) {\n var newClass = ' ' + elem.className.replace( /[\\t\\r\\n]/g, ' ') + ' ';\n if (hasClass(elem, className)) {\n while (newClass.indexOf(' ' + className + ' ') >= 0 ) {\n newClass = newClass.replace(' ' + className + ' ', ' ');\n }\n elem.className = newClass.replace(/^\\s+|\\s+$/g, '');\n }\n}", "title": "" }, { "docid": "cd34456e77e84b8e13c4039401c297c6", "score": "0.73224556", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n \n if (!hasClass(element, name)) return;\n \n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n \n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "60bccfa70e579b799742c1e042972a5f", "score": "0.73182625", "text": "function removeClass( ref, cls ){\n var classes = ref.className.split(' ');\n var list = \"\";\n for( var i = 0; i < classes.length; i++ ){\n if( classes[i] != cls ){\n list += \" \" + classes[i];\n }\n }\n list = list.substr(1);\n ref.className = list;\n}", "title": "" }, { "docid": "dcccf85d455a7deab45887d42706d278", "score": "0.73124266", "text": "function removeClass(element, name) {\n\t var oldList = classList(element),\n\t newList;\n\t\n\t if (!hasClass(element, name)) return;\n\t\n\t // Replace the class name.\n\t newList = oldList.replace(' ' + name + ' ', ' ');\n\t\n\t // Trim the opening and closing spaces.\n\t element.className = newList.substring(1, newList.length - 1);\n\t }", "title": "" }, { "docid": "dcccf85d455a7deab45887d42706d278", "score": "0.73124266", "text": "function removeClass(element, name) {\n\t var oldList = classList(element),\n\t newList;\n\t\n\t if (!hasClass(element, name)) return;\n\t\n\t // Replace the class name.\n\t newList = oldList.replace(' ' + name + ' ', ' ');\n\t\n\t // Trim the opening and closing spaces.\n\t element.className = newList.substring(1, newList.length - 1);\n\t }", "title": "" }, { "docid": "9c344d2ad724a36ebaaaf87459b8a92b", "score": "0.73099416", "text": "function removeClass(element, className) {\n\tif(typeof element != 'object') element = document.getElementById(element);\n\tvar classString = element.className;\n\tvar newClassString = '';\n\tvar indexPos = classString.indexOf(className);\n\tif(indexPos == -1) {\n\t\treturn;\n\t} else if (indexPos == 0) {\n\t\tnewClassString = classString.substring(0, indexPos) + classString.substr(indexPos+className.length);\n\t} else {\n\t\tnewClassString = classString.substring(0, indexPos-1) + classString.substr(indexPos+className.length);\n\t}\n\n\telement.className = newClassString;\n}", "title": "" }, { "docid": "7fa7cba8aae5102e2f8b58e2a43cc75e", "score": "0.7296935", "text": "function removeClass(el,cls){ /* istanbul ignore if */if(!cls || !(cls = cls.trim())){return;} /* istanbul ignore else */if(el.classList){if(cls.indexOf(' ') > -1){cls.split(/\\s+/).forEach(function(c){return el.classList.remove(c);});}else {el.classList.remove(cls);}if(!el.classList.length){el.removeAttribute('class');}}else {var cur=\" \" + (el.getAttribute('class') || '') + \" \";var tar=' ' + cls + ' ';while(cur.indexOf(tar) >= 0) {cur = cur.replace(tar,' ');}cur = cur.trim();if(cur){el.setAttribute('class',cur);}else {el.removeAttribute('class');}}}", "title": "" }, { "docid": "7fa7cba8aae5102e2f8b58e2a43cc75e", "score": "0.7296935", "text": "function removeClass(el,cls){ /* istanbul ignore if */if(!cls || !(cls = cls.trim())){return;} /* istanbul ignore else */if(el.classList){if(cls.indexOf(' ') > -1){cls.split(/\\s+/).forEach(function(c){return el.classList.remove(c);});}else {el.classList.remove(cls);}if(!el.classList.length){el.removeAttribute('class');}}else {var cur=\" \" + (el.getAttribute('class') || '') + \" \";var tar=' ' + cls + ' ';while(cur.indexOf(tar) >= 0) {cur = cur.replace(tar,' ');}cur = cur.trim();if(cur){el.setAttribute('class',cur);}else {el.removeAttribute('class');}}}", "title": "" }, { "docid": "2865abc253f6245a4be6f8cc8eddcafe", "score": "0.7292566", "text": "function w3RemoveClass(element, name) {\n\tvar i, arr1, arr2;\n\tarr1 = element.className.split(\" \");\n\tarr2 = name.split(\" \");\n\tfor (i = 0; i < arr2.length; i++) {\n\t\twhile (arr1.indexOf(arr2[i]) > -1) {\n\t\t\tarr1.splice(arr1.indexOf(arr2[i]), 1);\n\t\t}\n\t}\n\telement.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "21c398ef3b43c089648b5e6b9853bc1d", "score": "0.728863", "text": "function w3RemoveClass(element, name) {\n\tvar i, arr1, arr2;\n\tarr1 = element.className.split(' ');\n\tarr2 = name.split(' ');\n\tfor (i = 0; i < arr2.length; i++) {\n\t\twhile (arr1.indexOf(arr2[i]) > -1) {\n\t\t\tarr1.splice(arr1.indexOf(arr2[i]), 1);\n\t\t}\n\t}\n\telement.className = arr1.join(' ');\n}", "title": "" }, { "docid": "c3bb32b1275d9872a24d7eab77eda415", "score": "0.7282036", "text": "function removeClass(el,className) {\n\t\tif(!el || !className){return;}\n\t el.className = el.className.replace(new RegExp('(?:^|\\\\s)'+className+'(?!\\\\S)'),'' );\n\t return el;\n\t}", "title": "" }, { "docid": "e1f532b165740f571cf91ed31a5028a2", "score": "0.7274038", "text": "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "e1f532b165740f571cf91ed31a5028a2", "score": "0.7274038", "text": "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "e1f532b165740f571cf91ed31a5028a2", "score": "0.7274038", "text": "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.72705525", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.72705525", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.72705525", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.72705525", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.7268453", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.7268453", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.7268453", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.7268453", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.7268453", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.7268453", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "c9dad1dbdd4e5aeab2e6fdf17b937ffa", "score": "0.7237235", "text": "function rmClass$1(el, className) {\n var c = ' ' + el.className + ' ', cnp = ' ' + className + ' ';\n if (c.indexOf(cnp) === -1)\n { return false; }\n el.className = c.replace(cnp, '').trim();\n return true;\n }", "title": "" }, { "docid": "a37dca1162e07edb4143f066244c8f7b", "score": "0.7234698", "text": "function clearStatusClass(element) {\r\n element.classList.remove('correct')\r\n element.classList.remove('wrong')\r\n}", "title": "" }, { "docid": "50058826b6753651f86d00fd776b5f23", "score": "0.7224918", "text": "function removeClass(element, someClass) {\n var patternStr = '(^|\\\\s)*' + someClass + '(\\\\s|$)*';\n var pattern = new RegExp(patternStr);\n if (pattern.test(element.className)) {\n element.className = element.className.replace(pattern, ' ');\n }\n return element;\n}", "title": "" }, { "docid": "4c6c03993de2924ca0e7dbaed49cb38e", "score": "0.722166", "text": "function RemoveClass(element, name) {\n\tlet classes;\n\tclasses = element.className.split(\" \");//delar className i elementet på \" \"\n\twhile (classes.indexOf(name) > -1) {//så länge name finns i arrayen\n\t\tclasses.splice(classes.indexOf(name), 1); //plockar bort name\n\t}\n\telement.className = classes.join(\" \");// slår ihop alla element och uppdaterar elementets className\n}", "title": "" }, { "docid": "68b204d21db3bbb183d61cdb63e91cf1", "score": "0.7221101", "text": "function removeClass(element,name){\nvar oldList=classList(element),\nnewList;\n\nif(!hasClass(element,name))return;\n\n// Replace the class name.\nnewList=oldList.replace(' '+name+' ',' ');\n\n// Trim the opening and closing spaces.\nelement.className=newList.substring(1,newList.length-1);\n}", "title": "" }, { "docid": "4dd71120b465121e52abcd54f9eed890", "score": "0.7220119", "text": "function removeClass(el){\r\n\tel.classList.remove(\"pats-silver\");\r\n}", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "1c234857f5c3340d0907e029c2dbe48f", "score": "0.72133493", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "8a9ce706eb6049c24498a7744f069366", "score": "0.72098345", "text": "function clearStatusClass(element) {\n element.classList.remove(\"correct\")\n element.classList.remove(\"wrong\")\n}", "title": "" }, { "docid": "4fb9aa996bb03075bc56a94a2a6d3ba1", "score": "0.72049695", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "4fb9aa996bb03075bc56a94a2a6d3ba1", "score": "0.72049695", "text": "function removeClass(element, name) {\n var oldList = classList(element),\n newList;\n\n if (!hasClass(element, name)) return;\n\n // Replace the class name.\n newList = oldList.replace(' ' + name + ' ', ' ');\n\n // Trim the opening and closing spaces.\n element.className = newList.substring(1, newList.length - 1);\n }", "title": "" }, { "docid": "ba0a5b84a85c38ce016b25bcaec5ce7b", "score": "0.7204844", "text": "static remove(className) {\n let elementsToRemove = document.getElementsByClassName(className);\n\n if (elementsToRemove.length > 0) {\n for (let i = 0; i < elementsToRemove.length; i++) {\n elementsToRemove[i].remove();\n }\n }\n }", "title": "" }, { "docid": "cd8ca88b7521d732d9c0353faf6d1949", "score": "0.718664", "text": "function clearStatusClass(element) {\n element.classList.remove('correct')\n element.classList.remove('wrong')\n}", "title": "" }, { "docid": "cd8ca88b7521d732d9c0353faf6d1949", "score": "0.718664", "text": "function clearStatusClass(element) {\n element.classList.remove('correct')\n element.classList.remove('wrong')\n}", "title": "" }, { "docid": "cd8ca88b7521d732d9c0353faf6d1949", "score": "0.718664", "text": "function clearStatusClass(element) {\n element.classList.remove('correct')\n element.classList.remove('wrong')\n}", "title": "" }, { "docid": "96b5825698f7e39f117b317e3d7aca72", "score": "0.71760017", "text": "function removeClass(className){\r\n var el = document.querySelectorAll('.'+className);\r\n for(item of el){\r\n item.classList.remove(className);\r\n }\r\n}", "title": "" }, { "docid": "69e4691f25ddab805b468ba8c67571b0", "score": "0.71732324", "text": "function clearStatusClass(element) {\n element.classList.remove('correct')\n element.classList.remove('wrong')\n\n}", "title": "" }, { "docid": "51534415b28d121bb65d9cacae67a0c0", "score": "0.7169506", "text": "function clearStatusClass(element) {\n element.classList.remove('correct')\n element.classList.remove('wrong')\n}", "title": "" }, { "docid": "711b1a3a4acd7493a93701b24b654d3b", "score": "0.71616334", "text": "function w3RemoveClass(element, name) {\n let i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n\n}", "title": "" }, { "docid": "96e927fcb1d7ff2256f42227fb6fc8ca", "score": "0.7158041", "text": "function WebForm_RemoveClassName(element, className) {\n var currentClassName = ' ' + WebForm_TrimString(element.className) + ' ';\n className = WebForm_TrimString(className);\n var index = currentClassName.indexOf(' ' + className + ' ');\n if (index >= 0) {\n element.className = WebForm_TrimString(currentClassName.substring(0, index) + ' ' +\n currentClassName.substring(index + className.length + 1, currentClassName.length));\n }\n}", "title": "" }, { "docid": "e0609cb7163d15bec502862f5a74a5bc", "score": "0.71546286", "text": "function RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" } ]
c1f78d8bccff7ae4b09616116ead5d02
This file is automatically included by javascript_include_tag :defaults
[ { "docid": "963915a71408f43d3cefa7d73bb31f17", "score": "0.0", "text": "function updateTotal() {\n\tvar total = 0;\n\t$(\".dayinput\").map(function() {\n\t\ttotal += $(this).val() * 8;\n\t});\n\t$(\".hourinput\").map(function() {\n\t\ttotal += $(this).val() * 1;\n\t});\n\t$(\"#total\").val(total);\n\tif(total >= 40) {\n\t\t$(\"#total\").removeClass(\"total_low\");\n\t\t$(\"#total\").addClass(\"total_ok\");\n\t} else {\n\t\t$(\"#total\").removeClass(\"total_ok\");\n\t\t$(\"#total\").addClass(\"total_low\");\n\t}\n}", "title": "" } ]
[ { "docid": "32f55514a24a11fdbabf8ee1f86e4b9f", "score": "0.5883033", "text": "function maingear_addRelatedJSFiles() {\n //Only load if its not already loaded by the parent page\n maingear_addJSFile(\"widget_jqueryui\", \"js/jquery-ui.js\", (typeof(jQuery.ui) != 'undefined'));\n maingear_addJSFile(\"widget_bootstrap\", \"js/bootstrap.js\", (typeof $().modal == 'function'));\n maingear_addJSFile(\"widget_jTemplate\", \"js/jtemplates.js\");\n maingear_addJSFile(\"widget_script\", \"js/script.js\");\n maingear_addJSFile(\"widget_utility\", \"js/utility.js\");\n maingear_addJSFile(\"widget_notify\", \"js/bootstrap-notify.min.js\");\n\n}", "title": "" }, { "docid": "1ef44b9fa93b814564cb04dcf6368da4", "score": "0.5742984", "text": "function Welcome_elementsExtraJS() {\n // screen (Welcome) extra code\n\n }", "title": "" }, { "docid": "59ea28d0b952020f54b55160ff8aa3be", "score": "0.5680056", "text": "function initialize() {\n //Call this from ribbon\n console.log(\"This function is used to include this js in ribbons\");\n }", "title": "" }, { "docid": "4334fa358fe0f5500351e2b8222ed817", "score": "0.56346977", "text": "function js() {\n}", "title": "" }, { "docid": "4334fa358fe0f5500351e2b8222ed817", "score": "0.56346977", "text": "function js() {\n}", "title": "" }, { "docid": "4334fa358fe0f5500351e2b8222ed817", "score": "0.56346977", "text": "function js() {\n}", "title": "" }, { "docid": "740cfb74ff3c422569aef709bf11ec2f", "score": "0.55590963", "text": "function js_setup()\n\t\t{\n\t\t\t//\tload scripts\n\t\t\t\tvar scripts = new Array();\n\t\t\t\t\tscripts.push('/toximeter/jquery/jquery.transit.min.js');\n\t\t\t\t\tscripts.push('/toximeter/jquery/PapaParse-4.6.0/papaparse.min.js');\n\t\t\t\t\tscripts.push('/toximeter/settings/settings.js');\n\t\t\t\t\tscripts.push('/toximeter/settings/dictionary.js');\n\t\t\t\t\tscripts.push('/toximeter/js/global.js');\n\t\t\t\t\tscripts.push('/toximeter/js/ajax.js');\n\t\t\t\t\tscripts.push('/toximeter/js/click.js');\n\t\t\t\t\tscripts.push('/toximeter/js/data.js');\n\t\t\t\t\tscripts.push('/toximeter/js/visualize.js');\n\t\t\t\t\tscripts.push('/toximeter/js/timeline.js');\n\t\t\t\t\tscripts.push('/toximeter/js/trend.js');\n\n\t\t\t\t$.each(scripts, function(key,file)\n\t\t\t\t{\n\t\t\t\t\t$('body').append('<script type=\"text/javascript\" src=\"'+file+'\"></script>');\n\t\t\t\t});\n\n\t\t\t//\t------------\n\t\t\t//\tsettings\n\n\t\t\t\tglobal.settings = js_settings();\n\n\t\t\t\tif ( global.settings.speed > global.settings.delay ) { global.settings.speed = global.settings.delay; }\n\t\t\t\t\n\t\t\t//\t------------\n\t\t\t//\tlanguage and dictionary\n\n\t\t\t\tif ( window.location.hash )\n\t\t\t\t{\n\t\t\t\t\tvar hash = window.location.hash.substring(1);\n\t\t\t\t\t\n\t\t\t\t\tif ( hash == 'en' ) { global.settings.language = 'en'; }\n\t\t\t\t\telse { global.settings.language = 'sv'; }\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar language = window.navigator.userLanguage || window.navigator.language;\n\t\t\t\t\tvar language = language.substring(0,2);\n\t\n\t\t\t\t\tif ( language == 'en' ) { global.settings.language = 'en'; }\n\t\t\t\t\telse { global.settings.language = 'sv'; }\n\t\t\t\t}\n\n\t\t\t\tglobal.area.attr('language',global.settings.language);\n\n\t\t\t\tglobal.dictionary = js_dictionary(global.settings.language);\n\n\t\t\t//\t------------\n\n\t\t\t//\tbuild\n\t\t\t\tvar html =\n\t\t\t\t\t'<div class=\"area_tag\"><p></p></div>'+\n\t\t\t\t\t'<div class=\"width\">'+\n\t\t\t\t\t\n\t\t\t\t\t\t'<div class=\"area_images\">'+\n\t\t\t\t\t\t\t'<div class=\"image\" style=\"background-image: url(/toximeter/graphics/species/'+global.dictionary.species[1].image+');\"><p class=\"label\">'+global.dictionary.species[1].name+'</p></div>'+\n\t\t\t\t\t\t\t'<div class=\"image\" style=\"background-image: url(/toximeter/graphics/species/'+global.dictionary.species[2].image+');\"><p class=\"label\">'+global.dictionary.species[2].name+'</p></div>'+\n\t\t\t\t\t\t\t'<div class=\"image\" style=\"background-image: url(/toximeter/graphics/species/'+global.dictionary.species[3].image+');\"><p class=\"label\">'+global.dictionary.species[3].name+'</p></div>'+\n\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\n\t\t\t\t\t\t'<div class=\"area_editorial area\">'+\n\n\t\t\t\t\t\t\t'<div class=\"intro\">'+\n\t\t\t\t\t\t\t\t'<div class=\"logo\"></div>'+\n\t\t\t\t\t\t\t\t'<h1>'+global.dictionary.information.title+'</h1>'+\n\t\t\t\t\t\t\t\t'<h2>'+global.dictionary.information.intro+'</h2>'+\n\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t'<div class=\"columns\">'+\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t'<div class=\"column editorial\">'+\n\t\t\t\t\t\t\t\t\t'<h1>'+global.dictionary.information.column_1_title+'</h1>'+\n\t\t\t\t\t\t\t\t\t'<p>'+global.dictionary.information.column_1_text+'</p>'+\n\t\t\t\t\t\t\t\t'</div> <!-- column -->'+\n\t\t\n\t\t\t\t\t\t\t\t'<div class=\"column editorial\">'+\n\t\t\t\t\t\t\t\t\t'<h1>'+global.dictionary.information.column_2_title+'</h1>'+\n\t\t\t\t\t\t\t\t\t'<p>'+global.dictionary.information.column_2_text+'</p>'+\n\t\t\t\t\t\t\t\t'</div> <!-- column -->'+\n\t\t\n\t\t\t\t\t\t\t\t'<div class=\"column editorial\">'+\n\t\t\t\t\t\t\t\t\t'<h1>'+global.dictionary.information.column_3_title+'</h1>'+\n\t\t\t\t\t\t\t\t\t'<p>'+global.dictionary.information.column_3_text+'</p>'+\n\t\t\t\t\t\t\t\t'</div> <!-- column -->'+\n\t\t\n\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t'</div> <!-- columns -->'+\n\n\t\t\t\t\t\t'</div>'+\n\n\t\t\t\t\t//\t[area] timeline\n\t\t\t\t\t\n\t\t\t\t\t\t'<div class=\"area_timeline area\" data-events=\"'+( global.settings.events == true ? 'true' : 'false' )+'\">'+\n\t\t\n\t\t\t\t\t\t\t'<div class=\"timeline\">'+\n\t\t\t\t\t\t\t\t'<div class=\"years\"></div>'+\n\t\t\t\t\t\t\t'</div>'+\n\t\t\n\t\t\t\t\t\t\t'<div class=\"labels\">'+\n\t\t\t\t\t//\t\t\t'<div class=\"year start\"><p class=\"label\" data-info=\"year\">&nbsp;</p></div>'+\n\t\t\t\t\t\t\t\t'<div class=\"year start\"><p class=\"label\">&nbsp;</p></div>'+\n\t\t\t\t\t\t\t\t'<div class=\"year end\"><p class=\"label\">&nbsp;</p></div>'+\n\t\t\t\t\t\t\t\t'<div class=\"switch\"><a class=\"selected\" onclick=\"js_click_timeline_events(event,this);\" href=\"javascript:void(0);\"><p class=\"label\">'+( global.settings.events == true ? global.dictionary.misc.events_hide : global.dictionary.misc.events_show )+'</p></a></div>'+\n\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t'</div> <!-- labels -->'+\n\t\t\n\t\t\t\t\t\t'</div>'+\n\n\t\t\t\t\t//\t[area] dashboard\n\t\t\t\t\t\n\t\t\t\t\t\t'<div class=\"area_dashboard area\">'+\n\t\t\n\t\t\t\t\t\t\t'<div class=\"section\" data-section=\"left\">'+\n\t\t\n\t\t\t\t\t\t\t\t'<div class=\"group left\" data-group=\"species\">'+\n\t\t\t\t\t\t\t\t\t'<div class=\"buttons large left\"></div>'+\n\t\t\t\t\t\t\t\t'</div> <!-- group -->'+\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t'<div class=\"info\">'+\n\t\t\t\t\t\t\t\t\t'<p class=\"right\" data-info=\"year\">&nbsp;</p>'+\n\t\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t\t'</div> <!-- info -->'+\n\t\t\n\t\t\t\t\t\t\t'</div>'+\n\t\t\n\t\t\t\t\t\t\t'<div class=\"section\" data-section=\"right\">'+\n\t\t\n\t\t\t\t\t\t\t\t'<div class=\"group left\" data-group=\"toxins\">'+\n\t\t\t\t\t\t\t\t\t'<div class=\"buttons large left\"></div>'+\n\t\t\t\t\t\t\t\t'</div> <!-- group -->'+\n\t\t\n\t\t\t\t\t\t\t\t'<div class=\"group right\" data-group=\"controls\">'+\n\t\t\t\t\t\t\t\t\t'<div class=\"buttons large right\">'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"button\" data-button=\"rewind\"><a class=\"normal general\" onclick=\"js_click_dashboard(event,this);\" href=\"javascript:void(0);\"><p class=\"icon\"></p></a></div>'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"button\" data-button=\"pause\"><a class=\"selected\" onclick=\"js_click_dashboard(event,this);\" href=\"javascript:void(0);\">'+( global.settings.keys == true ? '<p class=\"key\">8</p>' : '')+'<p class=\"icon\"></p></a></div>'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"button\" data-button=\"play\"><a class=\"normal\" onclick=\"js_click_dashboard(event,this);\" href=\"javascript:void(0);\">'+( global.settings.keys == true ? '<p class=\"key\">9</p>' : '')+'<p class=\"icon\"></p></a></div>'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t\t\t'</div> <!-- buttons -->'+\n\t\t\t\t\t\t\t\t'</div> <!-- group -->'+\n\t\t\n\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\n\t\t\t\t\t\t\t\t'<div class=\"info\">'+\n\t\t\t\t\t\t\t\t\t'<p class=\"left\" data-info=\"value\">&nbsp;</p>'+\n\t\t\t\t\t\t\t\t\t'<p class=\"right\" data-info=\"pause\">'+global.dictionary.misc.pause+'</p>'+\n\t\t\t\t\t\t\t\t\t'<p class=\"right\" data-info=\"year\">&nbsp;</p>'+\n\t\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t\t'</div> <!-- info -->'+\n\t\t\n\t\t\t\t\t\t\t'</div>'+\n\t\t\n\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\n\t\t\t\t\t\t'</div>'+\n\n\t\t\t\t\t//\t[area] visual\n\n\t\t\t\t\t\t'<div class=\"area_visual area\" data-blur=\"false\">'+\n\n\t\t\t\t\t\t\t'<div class=\"trend\">'+\n\t\t\t\t\t\t\t\t'<div class=\"bars\">'+\n\t\t\t\t\t\t\t\t\t'<div class=\"years\"></div>'+\n\t\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t\t'<div class=\"labels\">'+\n\t\t\t\t\t\t\t\t\t'<div class=\"year start\"><p class=\"label\">&nbsp;</p></div>'+\n\t\t\t\t\t\t\t\t\t'<div class=\"year end\"><p class=\"label\">&nbsp;</p></div>'+\n\t\t\t\t\t\t\t\t\t'<div class=\"switch\"><a class=\"selected\" onclick=\"js_click_trend(event,this);\" href=\"javascript:void(0);\"><p class=\"label\">'+( global.settings.trend == true ? global.dictionary.misc.trend_hide : global.dictionary.misc.trend_show )+'</p></a></div>'+\n\t\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t\t'</div> <!-- labels -->'+\n\t\t\t\t\t\t\t'</div>'+\n\t\t\t\n\t\t\t\t\t\t\t'<div class=\"container\">'+\n\t\t\n\t\t\t\t\t\t\t\t'<div class=\"alert\">'+\n\t\t\t\t\t\t\t\t\t'<div class=\"content\">'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"editorial\">'+\n\t\t\t\t\t\t\t\t\t\t\t'<h1>'+global.dictionary.information.welcome_title+'</h1>'+\n\t\t\t\t\t\t\t\t\t\t\t'<p>'+global.dictionary.information.welcome_text+'</p>'+\n\t\t\t\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"buttons small left\">'+\n\t\t\t\t\t\t\t\t\t\t\t'<div class=\"button\"><a class=\"normal\" onclick=\"js_click_alert(event,this);\" href=\"javascript:void(0);\">'+( global.settings.keys == true ? '<p class=\"key\">9</p>' : '')+'<p class=\"label\">'+global.dictionary.information.welcome_button+'</p></a></div>'+\n\t\t\t\t\t\t\t\t\t\t\t'<div class=\"button\"><a class=\"normal general\" onclick=\"js_visualize_alert_close();\" href=\"javascript:void(0);\">'+( global.settings.keys == true ? '<p class=\"key\"></p>' : '')+'<p class=\"label\">'+global.dictionary.misc.close+'</p></a></div>'+\n\t\t\t\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t\t\t\t'</div> <!-- buttons -->'+\n\t\t\t\t\t\t\t\t\t'</div> <!-- content -->'+\n\t\t\t\t\t\t\t\t'</div> <!-- alert -->'+\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t'<div class=\"layers\">'+\n\t\t\t\t\t\t\t\t\t'<div class=\"layer\" data-layer=\"small\"></div>'+\n\t\t\t\t\t\t\t\t\t'<div class=\"layer\" data-layer=\"medium\"></div>'+\n\t\t\t\t\t\t\t\t\t'<div class=\"layer\" data-layer=\"large\"></div>'+\n\t\t\t\t\t\t\t\t'</div> <!-- layers -->'+\n\t\t\n\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t'</div>'+\n\n\t\t\t\t\t//\t[area] researcher\n\n\t\t\t\t\t\t'<div class=\"area_researcher area\">'+\n\t\t\t\t\t\t\t'<div class=\"headline\"><p>'+global.dictionary.information.research_headline+'</p></div>'+\n\t\t\t\t\t\t\t'<div class=\"form\">'+\n\t\t\t\t\t\t\t\t'<div class=\"photo\"><span></span></div>'+\n\t\t\t\t\t\t\t\t'<div class=\"content\">'+\n\t\t\t\t\t\t\t\t\t'<div class=\"field left\">'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"label\"><p>'+global.dictionary.information.research_name_title+'</p></div>'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"value\"><p>'+global.dictionary.information.research_name_text+'</p></div>'+\n\t\t\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t\t\t'<div class=\"field\">'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"label\"><p>'+global.dictionary.information.research_dept_title+'</p></div>'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"value\"><p><a href=\"'+global.dictionary.information.research_dept_link+'\" target=\"_blank\">'+global.dictionary.information.research_dept_text+'</a></p></div>'+\n\t\t\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t\t\t'<div class=\"field long\">'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"label\"><p>'+global.dictionary.information.research_tasks_title+'</p></div>'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"value\"><p>'+global.dictionary.information.research_tasks_text+'</p></div>'+\n\t\t\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t\t\t'<div class=\"field long\">'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"label\"><p>'+global.dictionary.information.research_area_title+'</p></div>'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"value\"><p>'+global.dictionary.information.research_area_text+'</p></div>'+\n\t\t\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t\t\t'<div class=\"field long\">'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"label\"><p>'+global.dictionary.information.research_source_title+'</p></div>'+\n\t\t\t\t\t\t\t\t\t\t'<div class=\"value\"><p>'+global.dictionary.information.research_source_text+'<br /><a href=\"'+global.dictionary.information.research_source_link+'\" target=\"_blank\">'+global.dictionary.information.research_source_link+'</a></p></div>'+\n\t\t\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t'</div>'+\n\n\t\t\t\t\t//\t[area] foot\n\n\t\t\t\t\t\t'<div class=\"area_foot area\">'+\n\t\t\t\t\t\t\t'<div class=\"badges\">'+\n\t\t\t\t\t\t\t\t'<div class=\"badge ocean\"><a href=\"https://www.un.org/sustainabledevelopment/oceans\" target=\"_blank\"></a></div>'+\n\t\t\t\t\t\t\t\t'<div class=\"badge echosystem\"><a href=\"https://www.un.org/sustainabledevelopment/biodiversity\" target=\"_blank\"></a></div>'+\n\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t'<div class=\"logos\">'+\n\t\t\t\t\t\t\t\t'<div class=\"logo bouvet\"><a href=\"https://www.bouvet.se\" target=\"_blank\"></a></div>'+\n\t\t\t\t\t\t\t\t'<div class=\"logo nrm\"><a href=\"http://www.nrm.se\" target=\"_blank\"></a></div>'+\n\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t'<div class=\"notes\">'+\n\t\t\t\t\t\t\t\t'<p>* '+global.dictionary.information.foot_toxins+'</p>'+\n\t\t\t\t\t\t\t\t'<p>'+global.dictionary.information.foot_admin+': <a href=\"mailto:'+global.dictionary.information.foot_admin_email+'\">'+global.dictionary.information.foot_admin_name+'</a></p>'+\n\t\t\t\t\t\t\t\t'<div class=\"break\"></div>'+\n\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t'</div>'+\n\n\t\t\t\t\t'</div>';\n\t\t\t\t\t\n\t\t\t//\tpublish\n\t\t\t\tglobal.area.html('').append(html);\n\t\t\t\t\n\t\t\t//\t------------\n\t\t\t//\tcontrols, species\n\n\t\t\t\tvar area = global.area.find('.area_dashboard .section[data-section=\"left\"] .group[data-group=\"species\"] .buttons');\n\n\t\t\t\tfor ( var x = 1; x <= global.settings.species; x++)\n\t\t\t\t{\n\t\t\t\t\t//\tkeyboard shortcut\n\t\t\t\t\t\tvar shortcut = x;\n\n\t\t\t\t\t//\tbuild\n\t\t\t\t\t\tvar html = '<div class=\"button\" data-button=\"'+x+'\"><a class=\"'+( x == 1 ? 'selected' : 'normal' )+'\" onclick=\"js_click_dashboard(event,this);\" href=\"javascript:void(0);\">'+( global.settings.keys == true ? '<p class=\"key\">'+shortcut+'</p>' : '')+'<p class=\"label\">'+global.dictionary.species[x].name+'</p></a></div>';\n\n\t\t\t\t\t//\tpublish\n\t\t\t\t\t\tarea.append(html);\n\t\t\t\t}\n\n\t\t\t\tarea.append('<div class=\"break\"></div>');\n\n\t\t\t//\t------------\n\t\t\t//\tcontrols, toxins\n\n\t\t\t\tvar area = global.area.find('.area_dashboard .section[data-section=\"right\"] .group[data-group=\"toxins\"] .buttons');\n\n\t\t\t\tfor ( var x = 1; x <= global.settings.toxins; x++)\n\t\t\t\t{\n\t\t\t\t\t//\tbuild\n\t\t\t\t\t\tvar html = '<div class=\"button\" data-button=\"'+x+'\"><a class=\"'+( x == 1 ? 'selected' : 'normal' )+'\" onclick=\"js_click_dashboard(event,this);\" href=\"javascript:void(0);\"><p class=\"key\">'+( global.settings.keys == true ? '<p class=\"key\">'+(shortcut+x)+'</p>' : '')+'</p><p class=\"label\">'+global.dictionary.toxins[x].name+'</p></a></div>';\n\n\t\t\t\t\t//\tpublish\n\t\t\t\t\t\tarea.append(html);\n\t\t\t\t}\n\n\t\t\t\tarea.append('<div class=\"break\"></div>');\n\n\t\t\t//\t------------\n\n\t\t\t//\tinital dots\n\t\t\t\tjs_visualize_data(32);\n\t\t\t\t\n\t\t\t//\tload data\n\t\t\t\tjs_setup_data();\n\t\t}", "title": "" }, { "docid": "1ea1345d2b66409091169d21ddd9714b", "score": "0.5538222", "text": "function GitHub_Search_elementsExtraJS() {\n // screen (GitHub_Search) extra code\n\n }", "title": "" }, { "docid": "a7c1007bbc0e6d6c2d3cc0cc241fd89d", "score": "0.5483985", "text": "function loadJavascriptfile() {\n /// <summary>\n /// loads the JavaScript file and attaches it to the DOM object\n /// </summary>\n var fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", this._filename);\n\n if (typeof fileref != \"undefined\")\n document.getElementById(this._tagId).appendChild(fileref);\n }", "title": "" }, { "docid": "5329f5fad66bae689cfe88c52441b9b4", "score": "0.537561", "text": "function dashboard_elementsExtraJS() {\n // screen (dashboard) extra code\n\n }", "title": "" }, { "docid": "01e1296cc1070a5099e30a4fc7976dc2", "score": "0.53602463", "text": "function IncludeJavaScript(jsFile)\r\n{\r\n document.write('<script type=\"text/javascript\" src=\"'\r\n + jsFile + '\"></script>'); \r\n}", "title": "" }, { "docid": "71a3e28a180db93e91fde8a0951a99f3", "score": "0.5357457", "text": "function jCanvasDefaults() {\n\textendObject( this, jCanvasDefaults.baseDefaults );\n}", "title": "" }, { "docid": "314385144cf7fdc63e2af67006986fe8", "score": "0.5356137", "text": "function scriptLoadHandler() {\n\t\t\tspringSpace.jq = window.jQuery.noConflict(true);\n\t\t\tloadChatVars();\n\t\t}", "title": "" }, { "docid": "8257f859077038d621d704d58354d7a5", "score": "0.5342105", "text": "function DefaultValuesInit(){\n jQuery(document).ready(function() {\n SetDefaultValues();\n });\n}", "title": "" }, { "docid": "2178652e942dc80e4b32a2b90513ff19", "score": "0.5337438", "text": "function include (nomDuFichier) {\r\n\tvar header = document.createElement('script');\r\n\theader.type = 'text/javascript';\r\n\theader.src = nomDuFichier;\r\n\tdocument.head.appendChild(header);\r\n\r\n}", "title": "" }, { "docid": "530b5dd8c4131c5e4392fa95d808260b", "score": "0.53162086", "text": "function Login_elementsExtraJS() {\n // screen (Login) extra code\n\n }", "title": "" }, { "docid": "020856298d29bf1ebb8cf48b95f9ca2b", "score": "0.53025806", "text": "function include(fileName)\n{ \n\t// On insere une balise script avec le nom du fichier a inclure.\n\tdocument.write(\"<script type='text/javascript' src='\"+fileName+\"'></script>\");\n}", "title": "" }, { "docid": "809155b4720a2e6e4ec247a183a334c8", "score": "0.53005016", "text": "importScripts() {\n var DEV_local = true; // import local file \n\n // If the scripts doesn't exists import them, otherwise skip this part.\n if(document.getElementById(this.IDS.jquery) == null &&\n document.getElementById(this.IDS.css) == null &&\n document.getElementById(this.IDS.plugin) == null) {\n var script_jquery = document.createElement(\"script\"),\n script_core = document.createElement(\"script\"),\n stylesheet = document.createElement(\"link\");\n\n // id\n script_jquery.id = this.IDS.jquery;\n script_core.id = this.IDS.plugin;\n stylesheet.id = this.IDS.theme;\n\n // src\n script_core.src = this.URLS.plugin;\n script_jquery.src = this.URLS.jquery;\n stylesheet.href = `data:text/css,` + escape(`@import url(\"${this.URLS.theme}\");`);\n stylesheet.rel = `stylesheet`;\n\n // append to head\n document.head.appendChild(stylesheet);\n document.head.appendChild(script_jquery);\n document.head.appendChild(script_core);\n }\n }", "title": "" }, { "docid": "6166c461509c56b1962e872c51930f66", "score": "0.52987444", "text": "function Sendemail_elementsExtraJS() {\n // screen (Sendemail) extra code\n\n }", "title": "" }, { "docid": "b3a6d0426aeb4770b210a34b27645781", "score": "0.52938217", "text": "function BugReport_elementsExtraJS() {\n // screen (BugReport) extra code\n\n }", "title": "" }, { "docid": "524ce485b1a2e83c88c78e85fe4476fb", "score": "0.5259381", "text": "function loadLoginJS(){\r\n\tpushFile(\"libs/jquery.sha256.min.js\");\r\n\tpushFile(\"login/login.js\");\r\n\tloadJSFiles();\r\n}", "title": "" }, { "docid": "4f0ff5963674e63bf4b4b987376b6969", "score": "0.5251908", "text": "function addJSFiles() {\r\n\t//Adds the mask plugin\r\n\tvar masks = document.createElement(\"script\");\r\n\tmasks.type = \"text/javascript\";\r\n\tmasks.src = \"../form-controls/jquery.mask.min.js\";\r\n\t$(\"head\").append(masks);\r\n}", "title": "" }, { "docid": "aa4dff95620e9fba5577811e597b3496", "score": "0.52496713", "text": "function includeJS(filename) {\r\n\tvar jsFile = document.createElement('script');\r\n\tjsFile.setAttribute(\"src\", filename);\r\n\tjsFile.setAttribute(\"type\", \"text/javascript\");\r\n\tdocument.getElementsByTagName(\"head\")[0].appendChild(jsFile);\r\n}", "title": "" }, { "docid": "dbd48779b95443761415d06d8260b5da", "score": "0.5236777", "text": "function Account_elementsExtraJS() {\n // screen (Account) extra code\n }", "title": "" }, { "docid": "81c7e97925489f4a9d2695e9cfdcb387", "score": "0.51785976", "text": "function jCanvasDefaults() {\n extendObject(this, jCanvasDefaults.baseDefaults);\n }", "title": "" }, { "docid": "b98c392e0f9fa15ae47e90d1146ca946", "score": "0.5159229", "text": "function extensionJS(){\n\t\t\tvar jsFiles = ['markerclusterer_compiled.js','markerwithlabel_packed.js']; //(3) If you have a new file, just copy it to the extension's /lib/js folder and add it's filename to the jsFiles Array.\n\t\t\tvar jsFilesPath = [];\n\t\t\t\n\t\t\tfor (var i=0; i<jsFiles.length; i++)\n\t\t\t\tjsFilesPath[i] = _this.ExtSettings.JSFolder+'/'+jsFiles[i];\n\n\t\t\t// jsFilesPath.push('https://datejs.googlecode.com/files/date.js');//(3.1) use this alternative to include JavaScript files external to the /lib/js folder\n\t\t\t\n\t\t\t//Console log \n\t\t\t// console.group('Set up JS file(s) for loading');\n\t\t\t// for(var i=0; i<jsFilesPath.length; i++)\n\t\t\t// \tconsole.log('%d: %s', i, jsFilesPath[i]);\n\t\t\t// console.groupEnd();\n\t\t\t\n\t\t\treturn jsFilesPath;\n\t\t}", "title": "" }, { "docid": "26bc064f45ec6d6cd5879875eedd473c", "score": "0.51591253", "text": "function dealersreg_elementsExtraJS() {\n // screen (dealersreg) extra code\n\n }", "title": "" }, { "docid": "18915d2ecfd3cc80a00d8d0855469a6d", "score": "0.5154017", "text": "function jsOnload()\n {\n // -- Generate ToolTips HTML Object\n jsToolTip_Init();\n }", "title": "" }, { "docid": "68f595df0e4b14769eabd8d6b42e6e39", "score": "0.51458156", "text": "function loadBrandJS(){\r\n\tpushFile(\"product_management/brand.js\");\r\n\tloadJSFiles();\r\n}", "title": "" }, { "docid": "e030540de6aa458e6d8d360c2f057f09", "score": "0.5142998", "text": "function PhantomLandingPage_elementsExtraJS() {\n // screen (PhantomLandingPage) extra code\n\n }", "title": "" }, { "docid": "5d950d9781bc1e94aa92619df34b2b5c", "score": "0.5132714", "text": "constructor(options) {\n super(options);\n this.addClass('jp-RenderedJavaScript');\n }", "title": "" }, { "docid": "62e1a59b0082804dda3382fecd762db6", "score": "0.50992155", "text": "onReady() { }", "title": "" }, { "docid": "63ba768ce82efd7a68d993e77390171f", "score": "0.5086003", "text": "function Info_elementsExtraJS() {\n // screen (Info) extra code\n\n }", "title": "" }, { "docid": "cd921e2fe57fd35c0fcbd3140d5360ac", "score": "0.5080661", "text": "function loadPickerJS(){\n var pickerJS = document.createElement(\"script\");\n pickerJS.src = baseURL + \"/smartsed/picker.js\";\n pickerJS.type=\"text/javascript\";\n document.getElementsByTagName('head')[0].appendChild(pickerJS);\n}", "title": "" }, { "docid": "5024816e3b362fd41452c5e2c660a0a4", "score": "0.5079848", "text": "function admin_ready() {\n Turbolinks.enableProgressBar();\n window.WedCity.feedback.init();\n}", "title": "" }, { "docid": "df911c5c71f3bb808a1e7223aaee98c8", "score": "0.5064529", "text": "function maingear_addJSFile(fileRef, filePath, doNotInclude) {\n\n //Do not load if notInclude flag is passed.\n if (!doNotInclude) {\n if (!document.getElementById(fileRef)) {\n var head = document.getElementsByTagName('head')[0];\n var scriptTag = document.createElement('script');\n scriptTag.id = fileRef;\n scriptTag.type = 'text/javascript';\n scriptTag.src = (WIDGET_ROOT_URL + filePath).replace(\"http://\", \"//\").replace(\"https://\", \"//\");\n head.appendChild(scriptTag);\n }\n }\n}", "title": "" }, { "docid": "6b20d1fb35c0df02c96d9988e512e82d", "score": "0.506173", "text": "function scriptPreSettings()\r\n\t{\r\n\t\tvar scripts\t\t= $(\"script\");\r\n\t\tvar parameters\t= [];\r\n\t\t\r\n\t\tscripts.each(function(index, item){\r\n\t\t\tvar param\t= item.src.match(/\\w+=\\w+/g);\r\n\t\t\t\r\n\t\t\tif(param != null)\r\n\t\t\t\t$.merge(parameters, param);\r\n\t\t});\r\n\t\t\r\n\t\tvar toExtend\t= {};\r\n\t\t\r\n\t\t$(parameters).each(function(index, item){\r\n\t\t\tvar exploded\t= item.split(\"=\");\r\n\t\t\t\r\n\t\t\ttoExtend[exploded[0]] = eval(exploded[1]);\r\n\t\t});\r\n\t\t\r\n\t\t$.extend(initialSettings, toExtend);\r\n\t}", "title": "" }, { "docid": "acdfa57e975600d72c716134814c148f", "score": "0.5057325", "text": "function IncludeJavaScript(jsFile)\n{\n document.write('<script type=\"text/javascript\" src=\"'\n + jsFile + '\"></scr' + 'ipt>'); \n}", "title": "" }, { "docid": "6393fb6641df460319b2675c0b383020", "score": "0.50564057", "text": "function Preload() {\n // empty\n}", "title": "" }, { "docid": "09f76582511f17acc54832185f19292c", "score": "0.5011953", "text": "function init() {\n var js = document.createElement('script');\n js.setAttribute('type', 'text/javascript');\n js.setAttribute('src', url);\n document.getElementsByTagName('head').item(0).appendChild(js);\n }", "title": "" }, { "docid": "c700f45fdfcca9494cfdf936d9c10f9f", "score": "0.5002072", "text": "function Home_elementsExtraJS() {\n // screen (Home) extra code\n\n /* infinite_list */\n\n listView = $(\"#Home_infinite_list\");\n theme = listView.attr(\"data-theme\");\n if (typeof theme !== 'undefined') {\n var themeClass = \"ui-btn-up-\" + theme;\n listItem = $(\"#Home_infinite_list .ui-li-static\");\n $.each(listItem, function(index, value) {\n $(this).addClass(themeClass);\n });\n }\n\n /* infinite_list_item */\n\n }", "title": "" }, { "docid": "e2e2a37cfaca3646808ec459160bae2a", "score": "0.4999713", "text": "function AddSell_elementsExtraJS() {\n // screen (AddSell) extra code\n }", "title": "" }, { "docid": "cf73c5b536bb0e927fc234eaf5fd2ce8", "score": "0.49980077", "text": "function updateJavaScriptOptions()\n {\n arrJavaScriptOptions = options.javaScriptOptions.concat();\n var $xmlWidgets = iad.config.getComponents();\n $.each($xmlWidgets, function (i, xmlWidget)\n {\n var $xmlWidget = $(xmlWidget);\n var id = $xmlWidget.attr('id');\n var name = $xmlWidget.attr('name');\n var vis = $xmlWidget.attr('visible');\n if (vis == 'true') arrJavaScriptOptions[arrJavaScriptOptions.length] = { 'label': 'Toggle ' + name, 'value': 'javascript:iaToggle(' + id + ')' };\n });\n }", "title": "" }, { "docid": "a783748d600fa255978f1f4580d840af", "score": "0.49954203", "text": "function prepareJSVersion() {\r\n // Change the text on the submit button\r\n $(\"#gis_editor input[name='gis_data[save]']\")\r\n .val(PMA_messages['strCopy'])\r\n .insertAfter($('#gis_data_textarea'))\r\n .before('<br/><br/>');\r\n\r\n // Add close and cancel links\r\n $('#gis_data_editor').prepend('<a class=\"close_gis_editor\" href=\"#\">' + PMA_messages['strClose'] + '</a>');\r\n $('<a class=\"cancel_gis_editor\" href=\"#\"> ' + PMA_messages['strCancel'] + '</a>')\r\n .insertAfter($(\"input[name='gis_data[save]']\"));\r\n\r\n // Remove the unnecessary text\r\n $('div#gis_data_output p').remove();\r\n\r\n // Remove 'add' buttons and add links\r\n $('#gis_editor input.add').each(function(e) {\r\n var $button = $(this);\r\n $button.addClass('addJs').removeClass('add');\r\n var classes = $button.attr('class');\r\n $button.replaceWith(\r\n '<a class=\"' + classes + '\" name=\"' + $button.attr('name')\r\n + '\" href=\"#\">+ ' + $button.val() + '</a>'\r\n );\r\n });\r\n}", "title": "" }, { "docid": "5bde96bb8962b88270bedbf90179a7ab", "score": "0.49934718", "text": "function scriptLoadHandler() {\n // Restore jQuery and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n PlannTo.jQuery = jQuery;\n\n // Call our main function\n\n main();\n }", "title": "" }, { "docid": "11eee2188e4a9120029301f7b6239b58", "score": "0.4988903", "text": "function IncludeDocReadyScripts() {\r\n\tvar arrScripts = [\r\n\t\tstaticURL + '/GlobalAssets/Scripts/min/external-combined.min.js',\r\n\t\tstaticURL + '/GlobalAssets/Scripts/Utilities.js'\r\n\t\t\r\n\t];\r\n\t\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n\r\n $.each(arrScripts, function() {\r\n\t\t//script.src = this;\r\n\t\t//$('head').append(script);\r\n\t\t$.ajax({\r\n\t url: this,\r\n\t async: true,\r\n\t cache: true,\r\n\t success: function(msg) {\r\n\t var result = msg.d;\r\n\t script.text = result;\r\n\r\n $('head').append(script);\r\n\t }\r\n });\r\n });\r\n \r\n}", "title": "" }, { "docid": "304c43b837ced119e5c66fdf0bc0cb06", "score": "0.49836448", "text": "function JavascriptKradVariables () {\r\n}", "title": "" }, { "docid": "c8bfdab72a3df6172b22a72d725ac6d2", "score": "0.4977828", "text": "function onReady() {\n //\n // Put your code that requires being placed in on-ready event in here\n //\n}", "title": "" }, { "docid": "c8170486f77a824acb8d3f3f9da54e05", "score": "0.49773827", "text": "function load_scripts() {\n var head = document.getElementsByTagName('head')[0];\n var script = document.createElement('script');\n\n script.src = '/1_starting_projects/4_invoice/js/jquery.min.js';\n head.appendChild(script);\n\n script = document.createElement('script');\n script.src = '/1_starting_projects/4_invoice/js/bootstrap.min.js';\n head.appendChild(script);\n\n script = document.createElement('script');\n script.src = '/1_starting_projects/3_learn_with_us/js/min.js/bootstrap.min.js';\n head.appendChild(script);\n\n\n script = document.createElement('script');\n script.src = '/1_starting_projects/3_learn_with_us/js/min.js/popper.min.js';\n head.appendChild(script);\n\n script = document.createElement('script');\n script.src = '/1_starting_projects/3_learn_with_us/js/min.js/modernizr-2.6.2.min.js';\n head.appendChild(script);\n\n script = document.createElement('script');\n script.src = '/1_starting_projects/3_learn_with_us/js/min.js/jquery.isotope.min.js';\n head.appendChild(script);\n\n\n script = document.createElement('script');\n script.src = '/1_starting_projects/4_invoice/js/invoice.js';\n head.appendChild(script);\n\n}", "title": "" }, { "docid": "20834015f208eb3a9e41b31a1e7288b0", "score": "0.49743387", "text": "onReady() {\n\n }", "title": "" }, { "docid": "66bcfc4967e7884e5b59f16656128c6f", "score": "0.49569455", "text": "function BootstrapOptions() { }", "title": "" }, { "docid": "66bcfc4967e7884e5b59f16656128c6f", "score": "0.49569455", "text": "function BootstrapOptions() { }", "title": "" }, { "docid": "66bcfc4967e7884e5b59f16656128c6f", "score": "0.49569455", "text": "function BootstrapOptions() { }", "title": "" }, { "docid": "66bcfc4967e7884e5b59f16656128c6f", "score": "0.49569455", "text": "function BootstrapOptions() { }", "title": "" }, { "docid": "66bcfc4967e7884e5b59f16656128c6f", "score": "0.49569455", "text": "function BootstrapOptions() { }", "title": "" }, { "docid": "2d29eb07c1b987535e4c6a278506831a", "score": "0.49478328", "text": "function Screen1_elementsExtraJS() {\n // screen (Screen1) extra code\n\n }", "title": "" }, { "docid": "414d474a88840667f7d5444c32f6cf37", "score": "0.49478215", "text": "onReady() {/* For override */}", "title": "" }, { "docid": "bfbd2102b52a1d1268dd515530619d76", "score": "0.49446595", "text": "function loadJsFile(filename)\r\n{\r\n var file_include = document.createElement('script');\r\n file_include.setAttribute(\"type\",\"text/javascript\");\r\n file_include.setAttribute(\"src\", filename);\r\n\r\n document.getElementsByTagName(\"head\")[0].appendChild(file_include);\r\n}", "title": "" }, { "docid": "f47e8153fa5463546bd5b79c21e7ea1d", "score": "0.49223253", "text": "static useHelperJS(field) {\n return true;\n }", "title": "" }, { "docid": "397738eaf31a44d0f83f5c3b3140a6b8", "score": "0.4920176", "text": "isJavaScriptEnabled() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "73d934ea255f3bfb261d8b352b44468e", "score": "0.4919298", "text": "onLoad() { }", "title": "" }, { "docid": "0c212cf9649e7ad293bafd9d31c505dc", "score": "0.49142513", "text": "function loadProductCategoryJS(){\r\n\tpushFile(\"product_management/product_category.js\");\r\n\tloadJSFiles();\r\n}", "title": "" }, { "docid": "a4011450e83d42390284b3d675a3e562", "score": "0.49139145", "text": "_declareDefaults () {\n super._declareDefaults();\n this._defaults.icon1 = 'pause';\n this._defaults.icon2 = 'play';\n this._defaults.title = 'play/pause (alt + p)';\n }", "title": "" }, { "docid": "b60c783c04419fdcb3151117dc9d7108", "score": "0.49107468", "text": "function includeBootstrap () {\n\treturn false;\n}", "title": "" }, { "docid": "ac79479d8f3432ede98eb418e79f5fb0", "score": "0.49076542", "text": "function init() {\n ensureJquery(libreTranslationFeedback);\n }", "title": "" }, { "docid": "c204f900006a39241c245ee9e360855f", "score": "0.48995006", "text": "function includePage(name) {\n document.write('<script type=\"text/javascript\" src=\"' + wgScript + '?title='\n + name + '&action=raw&ctype=text/javascript&dontcountme=s\"><\\/script>'); // smaxage=3600\n}", "title": "" }, { "docid": "6138b17adbf90ca674ef3e2e5e889092", "score": "0.48974282", "text": "function init() {\n\t\tvar head = document.getElementsByTagName('head').item(0);\n\t\n\t\tvar videosJs = document.createElement('script');\n\t\tvideosJs.setAttribute('type', 'text/javascript');\n\t\tvideosJs.setAttribute('src', videosUrl);\n\t\thead.appendChild(videosJs);\n\n\t}", "title": "" }, { "docid": "8a7aa795d637cb02b5a5adc579545235", "score": "0.48970056", "text": "function startScreen_elementsExtraJS() {\n // screen (startScreen) extra code\n\n }", "title": "" }, { "docid": "8a7aa795d637cb02b5a5adc579545235", "score": "0.48970056", "text": "function startScreen_elementsExtraJS() {\n // screen (startScreen) extra code\n\n }", "title": "" }, { "docid": "fe126606663ab3db52ad0291e41b0cb5", "score": "0.48916972", "text": "function Profile_elementsExtraJS() {\n // screen (Profile) extra code\n\n }", "title": "" }, { "docid": "3c6be15ceeb55a72153f718e9d9fc04b", "score": "0.4888993", "text": "function Groups_elementsExtraJS() {\n // screen (Groups) extra code\n\n }", "title": "" }, { "docid": "75cd3b812cde6717da4a7db714023356", "score": "0.48855245", "text": "_declareDefaults () {\n this._defaults = {\n className: '',\n parent: document.body,\n isBound: false,\n isInversed: false,\n isRipple: true,\n isProgress: true,\n onProgress: null,\n onSeekStart: null,\n onSeekEnd: null,\n direction: 'x',\n snapPoint: 0,\n snapStrength: 0\n }\n }", "title": "" }, { "docid": "db49c82473aa384b3be58f1d73e90158", "score": "0.487165", "text": "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "title": "" }, { "docid": "22e344d9881a69d3d6199786cc9d3a7a", "score": "0.48691154", "text": "function includeJS(jsPath) {\r\n\tvar script = document.createElement(\"script\");\r\n\tscript.setAttribute(\"type\", \"text/javascript\");\r\n\tscript.setAttribute(\"src\", jsPath);\r\n\tdocument.getElementsByTagName(\"head\")[0].appendChild(script);\r\n}", "title": "" }, { "docid": "131693749ac29b245cbf2540bafa50fa", "score": "0.4863378", "text": "function onLoad() {\n\n}", "title": "" }, { "docid": "325538382cc216e8425749868186079a", "score": "0.48631704", "text": "function include(file) {\n if (document.createElement && document.getElementsByTagName) {\n var head = document.getElementsByTagName('head')[0];\n\n var script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', file);\n\n head.appendChild(script);\n } \n }", "title": "" }, { "docid": "96057c79fc55df46b2f8b7e734448d37", "score": "0.4863129", "text": "function onLoad()\n{\n}", "title": "" }, { "docid": "9a0cbffb0968616c80280db8981e28e0", "score": "0.4861407", "text": "constructor() {\n super(jsDocConfig);\n this.addDefaultTask();\n }", "title": "" }, { "docid": "61e20e7fa3e90386b914c150813e8397", "score": "0.48596647", "text": "function profilePage_elementsExtraJS() {\n // screen (profilePage) extra code\n\n }", "title": "" }, { "docid": "3c13ea45d0c5949503160030330cf4ff", "score": "0.4852804", "text": "static get defaultOptions() {\n\t\treturn {\n\t\t\tbaseApplication: null,\n\t\t\twidth: null,\n\t\t\theight: null,\n\t\t\ttop: null,\n\t\t\tleft: null,\n\t\t\tpopOut: true,\n\t\t\tminimizable: true,\n\t\t\tresizable: false,\n\t\t\tid: \"\",\n\t\t\tclasses: [],\n\t\t\tdragDrop: [],\n\t\t\ttabs: [],\n\t\t\tfilters: [],\n\t\t\ttitle: \"\",\n\t\t\ttemplate: null,\n\t\t\tscrollY: []\n\t\t};\n\t}", "title": "" }, { "docid": "00eeaa6b277ac8661c3e7ed6f457aae2", "score": "0.48495707", "text": "function resetJavaScriptMenu()\n {\n //Reset the JavaScript Off/On menu to JavaScript Off\n $(\".perc-dropdown-option-DisableJavaScript\").text(I18N.message( \"perc.ui.menu@JavaScript Off\" ));\n }", "title": "" }, { "docid": "1c4f4976e8e1e0936fe673ec23190006", "score": "0.48477244", "text": "function letsJQuery() {\r\n\t//make sure there is no conflict between jQuery and other libraries\r\n\t$.noConflict()\r\n\t//start custom jQuery scripting\r\n\tmain();\r\n}", "title": "" }, { "docid": "69b7002a1d312e5ecf2d6b90848cce9a", "score": "0.4846692", "text": "function defaultSettings() {\n Settings.Highlight1 = '#CCCC00';\n Settings.Highlight2 = '#AA00CC';\n Settings.Highlight3 = '#00CCBB';\n Settings.Menu = 'Open';\n Settings.Theme = 'Light';\n Settings.Zoom = 'Fit';\n}", "title": "" }, { "docid": "d6fb749a497678fde9622a98495f3ebc", "score": "0.4845787", "text": "function loadJsFile(c,d){var a=$(\"<script type='text/javascript' src='\"+c+\"'/>\");$(d).parent().find(\"head\").append(a)}", "title": "" }, { "docid": "9e5dfd281f5d8f9fba8f134d7770dc14", "score": "0.48420522", "text": "function loadLandingJS() {\n\t\t$(\"#featured_projects>.featured_bar>div.cta\").click(function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tvar nav_node = $('#header_nav').children('.projects_view');\n\t\t\t$(nav_node).addClass(\"active\");\n\t\t\t$(nav_node).siblings().removeClass('active');\n\t\t\tloadProjectsPage();\n\t\t});\n\n\t\t$(\"#featured_articles>.articles_bar>div.cta\").click(function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tvar nav_node = $('#header_nav').children('.news_view');\n\t\t\t$(nav_node).addClass(\"active\");\n\t\t\t$(nav_node).siblings().removeClass('active');\n\t\t\tloadNewsPage();\n\t\t});\n\n\t\t$(\"#featured_news>.news_bar>div.cta\").click(function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tvar nav_node = $('#header_nav').children('.thought_view');\n\t\t\t$(nav_node).addClass(\"active\");\n\t\t\t$(nav_node).siblings().removeClass('active');\n\t\t\tloadThoughtPage();\n\t\t});\n\t}", "title": "" }, { "docid": "17be8bfdcc9c86a0ed1260c65890da0f", "score": "0.48395497", "text": "function importJQueryUI() {\n\t$.getScript(\"http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.js\", function() {\n\t\tinitPhysicalComponents();\n\t});\n}", "title": "" }, { "docid": "4be3969fe75b4d67438f404037a17d4d", "score": "0.48381385", "text": "function downloadJSAtOnload() {\n // List of files to import\n var javascriptFiles = [\n '../../common/js/jquery-ui-1.11.2.custom.min.js',\n '../../common/js/jquery-ui-1.11.2.min.js',\n '../../common/js/jquery.blockUI-2.66.js',\n '../../common/js/owl.carousel.custom.js',\n 'jquery.ddslick.min.js',\n 'jquery.autosuggest.js',\n '../../common/js/bootstrap.min.js',\n '../../common/js/affix-custom.js',\n 'jquery.seat-charts.js',\n 'jquery.validate.min.js',\n 'acc.appmodel.js',\n 'acc.travelcommon.js',\n 'acc.services.js',\n 'acc.ancillary.js',\n 'acc.farefinder.js',\n 'acc.fareselection.js',\n 'acc.itinerary.js',\n 'acc.reservation.js',\n 'acc.farefinder.js',\n 'acc.accommodationfinder.js',\n 'acc.travelfinder.js',\n 'acc.accommodationselection.js',\n 'acc.langcurrencyselector.js',\n 'acc.managebookings.js',\n 'acc.myaccount.js',\n 'acc.mycompany.js',\n 'acc.payment.js',\n 'acc.travellerdetails.js',\n 'acc.transportofferingstatus.js',\n 'acc.hotelgallery.js',\n 'acc.accommodationdetails.js',\n 'acc.dealselection.js',\n '_autoloadtracc.js'\n ];\n\n // Get the URL path from the current Javascript file\n var scripts = document.getElementsByTagName(\"script\"),\n srcCurrent = scripts[scripts.length-1].src,\n pathCurrent = srcCurrent.substring(0, srcCurrent.lastIndexOf('/') + 1);\n\n // Load all the files\n javascriptFiles.forEach(function(src) {\n var script = document.createElement('script');\n script.src = pathCurrent+src;\n script.async = false;\n document.body.appendChild(script);\n });\n }", "title": "" }, { "docid": "8071480edd17abfa6f91287ad46a4faf", "score": "0.483705", "text": "function onLoadDefaults(){\n\n jogadoresDefault();\n clubesDefault();\n tacasDefault();\n ligasDefault();\n \n}", "title": "" }, { "docid": "bf7814ab4c6059a81684de84409cf243", "score": "0.48357394", "text": "function init() {\n\n\t// 初始化导航\n\tCommon.initSideBar();\n\n\t$('.hiSlider').hiSlider();\n\n BaiduMap(); // baidu map api\n}", "title": "" }, { "docid": "b198dcf23428d6c5f029a41dd6165fcc", "score": "0.4834478", "text": "defaults(){\n\n }", "title": "" }, { "docid": "84b07c61480e66cb845e56479dff80eb", "score": "0.4832212", "text": "function ChatScreen_elementsExtraJS() {\n // screen (ChatScreen) extra code\n\n }", "title": "" }, { "docid": "327c7b6c16d50909892dacb2f8c4a14f", "score": "0.4830838", "text": "function NewRequest_elementsExtraJS() {\n // screen (NewRequest) extra code\n\n }", "title": "" }, { "docid": "5959469deed4eb24d731ad4d69fcdd88", "score": "0.48285308", "text": "function VendedorViejo_elementsExtraJS() {\n // screen (VendedorViejo) extra code\n /* mobilelist_11 */\n listView = $(\"#VendedorViejo_mobilelist_11\");\n theme = listView.attr(\"data-theme\");\n if (typeof theme !== 'undefined') {\n var themeClass = \"ui-btn-up-\" + theme;\n listItem = $(\"#VendedorViejo_mobilelist_11 .ui-li-static\");\n $.each(listItem, function(index, value) {\n $(this).addClass(themeClass);\n });\n }\n /* mobilelistitem_12 */\n /* mobilelistitem_14 */\n /* mobilelistitem_16 */\n }", "title": "" }, { "docid": "1e61a1399733c52e3518e101026c511d", "score": "0.4805459", "text": "function init() {\n var js = document.createElement('script');\n js.setAttribute('type', 'text/javascript');\n js.setAttribute('src', url);\n document.getElementsByTagName('head').item(0).appendChild(js);\n}", "title": "" }, { "docid": "126c5a2f034b81c46acfc61e2ed24ba3", "score": "0.48043394", "text": "function qodefOnDocumentReady() {\n\t qodefIconWithHover().init();\n\t qodefDisableSmoothScrollForMac();\n\t qodefInitAnchor().init();\n\t qodefInitBackToTop();\n\t qodefBackButtonShowHide();\n\t qodefInitSelfHostedVideoPlayer();\n\t qodefSelfHostedVideoSize();\n\t qodefFluidVideo();\n\t qodefOwlSlider();\n\t qodefPreloadBackgrounds();\n\t qodefPrettyPhoto();\n\t qodefSearchPostTypeWidget();\n }", "title": "" }, { "docid": "18db71e6b71245b03319caca7d470ef2", "score": "0.47986782", "text": "static bhTooltipsInit() {\n PageScriptService.runFile(\"loadbhtooltips.js\");\n }", "title": "" }, { "docid": "fc1372a62ebda351a3c8c0752f055914", "score": "0.47954515", "text": "function qodefOnDocumentReady() {\n\t\tqodefInitTabs();\n\t}", "title": "" }, { "docid": "6c4209d7b1bd72e63c4fb533f1f8c188", "score": "0.4789632", "text": "function init()\n{\n}", "title": "" }, { "docid": "c9a1c0c9f17585f0689b820d9524caa9", "score": "0.47886035", "text": "function Plugin( element, options ) {\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = currentjs;\n this.init();\n }", "title": "" }, { "docid": "d0c04fe0191cf0d7f80aef8d9ed14f79", "score": "0.4780733", "text": "function scriptLoadHandler() {\n // Restore jQuery and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n PlannTo.jQuery = jQuery;\n // Call our main function\n\n main();\n}", "title": "" }, { "docid": "b84c0b98c82bd5dd316e412bce74745a", "score": "0.47798645", "text": "function javascript() {\n\treturn gulp.src(files.js.libs, {sourcemaps: true, strict: true})\n\t\t.pipe(concat(\"script.js\"))\n\t\t.pipe(uglify())\n\t\t.pipe(gulp.dest(\"dist\", {sourcemaps: \".\"}));\n}", "title": "" } ]
157a3651e731091793f2e0f7dfa6e3f3
Remove all eventListeners by replacing element with clone code copied from
[ { "docid": "8ec3a0feb01a2114a4a6a8b193c20785", "score": "0.67468077", "text": "function removeEventListeners(elementId){\n var old_element = document.getElementById(elementId);\n var new_element = old_element.cloneNode(true);\n old_element.parentNode.replaceChild(new_element, old_element);\n}", "title": "" } ]
[ { "docid": "a687296ecdea8e283d7efdbca93067cf", "score": "0.71989703", "text": "function removeListeners() {\n elements.forEach((target) => {\n document.querySelector(`[data-sq=\"${target}\"]`).removeEventListener('click', placePieceOnClick);\n });\n}", "title": "" }, { "docid": "3d90b8f8edd3280a370a7f7e6b2c10f7", "score": "0.70091385", "text": "removeEventListeners() {}", "title": "" }, { "docid": "68aa71a713ebf92f08155cd78abf6a92", "score": "0.6973821", "text": "function clearEventListeners() {\n let gridItems = document.querySelectorAll(\".grid-item\");\n gridItems.forEach((gridItem) => {\n gridItem.replaceWith(gridItem.cloneNode(true));\n });\n}", "title": "" }, { "docid": "4a97d88adf54433d74105b0cf8f865f0", "score": "0.6823048", "text": "undelegateEvents() {\n ////console.log(\"undelegateEvents\");\n if (this._el) {\n ////console.log(\"undelegateEvents el\", this._el);\n let el = this._el;\n if (isString(this._el)) {\n el = document.querySelector(this._el);\n }\n if (el) {\n ////console.log(\"undelegateEvents selected el\", el);\n const new_el = el.cloneNode(true); //true means a deep copy\n\n //console.log(\"undelegateEvents cloned el\", new_el);\n if (new_el && new_el.parentNode) {\n //console.log(\"undelegateEvents parent el\", new_el.parentNode);\n el.parentNode.replaceChild(new_el, el);\n //console.log(\"undelegateEvents replaced el\");\n }\n }\n //this._el.removeEventListener(`.delegateEvents${this.cid}`);\n }\n return this;\n }", "title": "" }, { "docid": "52347b2d96190561e7b8872d2c841cd5", "score": "0.6707455", "text": "function RemoveListeners ()\r\n{\r\n for(i in Root)\r\n {\r\n i.name=i;\r\n if(i.charAt(0) == \"A\" || i.charAt(0) == \"Q\")\r\n {\r\n Root[i].removeEventListener(\"click\", OnClickDot);\r\n Root[i].mouseEnabled = false;\r\n Root[i].cursor=\"auto\";\r\n Root[i].HasLine=false;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "1c6bfa37b106951d7d1dcff5a820ee9c", "score": "0.6582915", "text": "function removeAllListeners(container,opt) {\n\t\t\tcontainer.children().each(function() {\n\t\t\t try{ jQuery(this).die('click'); } catch(e) {}\n\t\t\t try{ jQuery(this).die('mouseenter');} catch(e) {}\n\t\t\t try{ jQuery(this).die('mouseleave');} catch(e) {}\n\t\t\t try{ jQuery(this).unbind('hover');} catch(e) {}\n\t\t\t})\n\t\t\ttry{ container.die('click','mouseenter','mouseleave');} catch(e) {}\n\t\t\tclearInterval(opt.cdint);\n\t\t\tcontainer=null;\n\n\n\n\t\t}", "title": "" }, { "docid": "c61266cac58c7e7a068a5362cd078d2d", "score": "0.6527954", "text": "function removeMovementListeners () {\n\tallPossibleLocations.forEach(function(element) {\n\t\tvar room = document.getElementById(element);\n\t\troom.removeEventListener(\"click\", moveMyPiece);\n\n\t})\n}", "title": "" }, { "docid": "c6a9d75ff54fcff8acd5def32bf8195a", "score": "0.6518098", "text": "function removeAllListeners(container,opt) {\r\n\t\t\tcontainer.children().each(function() {\r\n\t\t\t try{ jQuery(this).die('click'); } catch(e) {}\r\n\t\t\t try{ jQuery(this).die('mouseenter');} catch(e) {}\r\n\t\t\t try{ jQuery(this).die('mouseleave');} catch(e) {}\r\n\t\t\t try{ jQuery(this).unbind('hover');} catch(e) {}\r\n\t\t\t})\r\n\t\t\ttry{ container.die('click','mouseenter','mouseleave');} catch(e) {}\r\n\t\t\tclearInterval(opt.cdint);\r\n\t\t\tcontainer=null;\r\n\r\n\r\n\r\n\t\t}", "title": "" }, { "docid": "54b37b9d72661b2c5b56a7c1d7b1afec", "score": "0.65079516", "text": "function removeXandOListeners() {\n\t\t\tfor (var i = $boxes.length - 1; i >= 0; i--) {\n\t\t\t\tvar $box = $($boxes[i])\n\t\t\t\t$box.off(\"click\", addXorO);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "43fceeac7c6cc2cb6c809275287a565c", "score": "0.6476664", "text": "removeAllEventListeners () {\n this.eventListeners = []\n }", "title": "" }, { "docid": "3c44f60f57eec37e49112dca9e508504", "score": "0.64577305", "text": "function removeCustomizedEventListeners() {\n $(\".project_header\").off(\"click\");\n $(\".new-model\").off(\"click\");\n $(\".model\").off(\"click\");\n $(\".rename-project\").off(\"click\");\n $(\".delete-project\").off(\"click\");\n $(\".more\").off(\"click\");\n $(\".rename-model\").off(\"click\");\n $(\".delete-model\").off(\"click\")\n $(\".dropdown\").off(\"click\");\n $(\".model\").off(\"dblclick\");\n $(\".template\").off(\"dbclick\");\n $(\".template\").off(\"click\");\n $(\".rename-template\").off(\"click\");\n $(\".delete-template\").off(\"click\");\n}", "title": "" }, { "docid": "8facf44971519378301736b9f016fdbe", "score": "0.6446226", "text": "function removeSquareEventListener() {\n var allSquares = document.getElementById('gameBoard').children;\n for (let i = 0; i < allSquares.length; i++) {\n var newSquare = allSquares[i].cloneNode(true);\n allSquares[i].parentNode.replaceChild(newSquare, allSquares[i]);\n }\n}", "title": "" }, { "docid": "f71d151ac78ca6314cfa80cb866d55ef", "score": "0.644555", "text": "function removeXandOListeners(){\n\t\tfor(var i = $boxes.length -1; i >= 0; i--){\n\t\t\tvar $box = $($boxes[i]);\n\t\t\t$box.off('click',addXorO); // turns the box 'off'.\n\n\t\t}\n\t}", "title": "" }, { "docid": "f1b10f64e77aa6845e13291e50286246", "score": "0.64189273", "text": "removeEventListeners() {\n // Empty in base class.\n }", "title": "" }, { "docid": "50a376db6be2482549975293e643f256", "score": "0.6405891", "text": "function resetEventListener()\n{\n\tfor(var i = cases_index; i < cases_index + 4; i++)\n\t{\t\n\t\tcases[i].removeEventListener('click', duplicateColor);\n\t}\n\n\tcases_index += 4;\n\n\tselectCombination();\n}", "title": "" }, { "docid": "30039c7204f03e019b5bf7305c0e1db1", "score": "0.63843673", "text": "function detachAndRemoveHandlers() {\n $('.popover').detach();\n $('#calendar-container').off('click');\n $('.fc-day-grid-event').off('click');\n }", "title": "" }, { "docid": "c204147681c3d90ed90dce09ccacced8", "score": "0.6344721", "text": "removeEventListeners() {\n d3Select(this.svgEl.current).on('click', null);\n }", "title": "" }, { "docid": "e698813d654fcf479e370d6bbfc689d1", "score": "0.62874895", "text": "function removeEventListeners() {\n currentDeck.removeEventListener(\"click\", onCardClicked);\n RESTART_BUTTON.removeEventListener(\"click\", onRestartGameClicked);\n MODAL_CLOSE_BUTTON.removeEventListener(\"click\", onModalCloseClicked);\n}", "title": "" }, { "docid": "22a5423010f789aec8d59647b598e0cb", "score": "0.62555456", "text": "function removeCellListeners(){\n let cells = document.querySelectorAll('.cell')\n\n let cellsArray = [...cells]\n\n cellsArray = cellsArray.filter(cell => cell.hasChildNodes())\n\n for (const cell of cells){\n //removeEventListener just does the opposite of addEventListener \n //this is why we needed the variable -- just putting the name of the function doesn't work for some reason \n cell.removeEventListener('click',checkHandler)\n }\n}", "title": "" }, { "docid": "f909e7ad98ec00d943fece9210a05a5d", "score": "0.62505585", "text": "function removeClickHandlers() {\n var boxes = document.getElementsByClassName(\"box\");\n for (var idx = 0; idx < boxes.length; idx++) {\n boxes[idx].removeEventListener('click', onBoxClick, false);\n }\n}", "title": "" }, { "docid": "7f3698594cadf80934a05ab7dbca31e3", "score": "0.62432337", "text": "function removeEventListeners () {\n Dom.removeListener(closeButton, 'click', destroy);\n Dom.removeListener(titleInput, 'focus', function () {if (titleInput.value == titleDefaultValue) activateInput(titleInput);});\n Dom.removeListener(minPriceInput, 'focus', function () {if (minPriceInput.value == minPriceDefaultValue) activateInput(minPriceInput);});\n Dom.removeListener(maxPriceInput, 'focus', function () {if (maxPriceInput.value == maxPriceDefaultValue) activateInput(maxPriceInput);});\n Dom.removeListener(sendButton, 'click', function (e) { e = e || window.event; if (e.preventDefault) e.preventDefault(); addItemToList(); return false;});\n }", "title": "" }, { "docid": "c6ffcd3586f35fae6121dcdda13fccdf", "score": "0.6242808", "text": "function unwireEvents() {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'keydown', maskInputKeyDownHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'keypress', maskInputKeyPressHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'keyup', maskInputKeyUpHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'input', maskInputHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'focus', maskInputFocusHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'blur', maskInputBlurHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'paste', maskInputPasteHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'cut', maskInputCutHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'mousedown', maskInputMouseDownHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'mouseup', maskInputMouseUpHandler);\n if (this.formElement) {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.formElement, 'reset', resetFormHandler);\n }\n}", "title": "" }, { "docid": "382f25692e44edc5ec8a369c6492f0be", "score": "0.6229115", "text": "removeListen() {\n this.element.onclick = null;\n this.element.classList.remove(\"canBeClicked\");\n }", "title": "" }, { "docid": "8b7f29b5f29284132dd7e1a3830abf20", "score": "0.61967206", "text": "function remove_kaizou_editor_listeners(doc){\r\n // Remove events handlers set on document\r\n doc.removeEventListener(\"mouseover\", kaizou_handle_mouseover, false);\r\n// doc.removeEventListener(\"keypress\", kaizou_handle_keypress, false);\r\n// doc.removeEventListener(\"click\", kaizou_handle_click, false);\r\n}", "title": "" }, { "docid": "7e0c262bf6f91feb6b85c5cecdd2e205", "score": "0.6182418", "text": "function detachEvents() {\n if (browser.addEventListener) {\n // remove current event listeners\n element.removeEventListener('touchstart', events, false);\n element.removeEventListener('mousedown', events, false);\n element.removeEventListener('webkitTransitionEnd', events, false);\n element.removeEventListener('msTransitionEnd', events, false);\n element.removeEventListener('oTransitionEnd', events, false);\n element.removeEventListener('otransitionend', events, false);\n element.removeEventListener('transitionend', events, false);\n root.removeEventListener('resize', events, false);\n } else {\n root.onresize = null;\n }\n }", "title": "" }, { "docid": "7ef82e43a35638785498fd33834eaae7", "score": "0.6180005", "text": "removeAllEventListeners() {\n const events = Array.from(this.m_listeners.keys());\n for (const event of events) {\n this.removeEventListener(event);\n }\n }", "title": "" }, { "docid": "91765ef14067b66bf99eb8263d7ca24a", "score": "0.6168046", "text": "function removeSourceAndTargetListeners() {\n let sNode = grabSourceNode()[0];\n let tNode = grabTargetNode()[0];\n sNode.removeEventListener(\"mousedown\", NodeMouseDown, true);\n tNode.removeEventListener(\"mousedown\", NodeMouseDown, true);\n}", "title": "" }, { "docid": "427d1d2dd930616d6677b9f98abc3bd3", "score": "0.61593664", "text": "_removeEventListeners() {\n this.el.removeEventListener('keydown', this._onKeydownBound);\n this.el.removeEventListener('keyup', this._onKeyupBound);\n }", "title": "" }, { "docid": "5c7dbea6eafbdc64955d2591bc591812", "score": "0.6155561", "text": "#removeEventListener(){\n //loop of rows\n for(let row = 0; row < this.#rows; row++){\n //loop of cols\n for(let col = 0; col < this.#cols; col++){\n this.cells[row][col].cell.removeEventListener('click', this.clickOnCell);//remove event with showing what is under cell\n this.cells[row][col].cell.removeEventListener('contextmenu', this.setFlag);//remove event with settings flags\n }\n }\n }", "title": "" }, { "docid": "6d34bede336fafdd46a6e92d47a9935b", "score": "0.6151948", "text": "_removeEventListeners() {\n this.domElement.removeEventListener('focusin', this._onFocusInFunc, false);\n this.domElement.removeEventListener('focus', this._onFocusInAndMouseEnterFunc, false);\n this.domElement.removeEventListener('focus', this._onFocusFunc, false);\n this.domElement.removeEventListener('mouseenter', this._onFocusInAndMouseEnterFunc, false);\n this.domElement.removeEventListener('blur', this._onFocusOutAndMouseLeaveFunc, false);\n this.domElement.removeEventListener('mouseleave', this._onFocusOutAndMouseLeaveFunc, false);\n this.domElement.removeEventListener('keydown', this._onKeydownFunc, false);\n this.domElement.removeEventListener('keypress', this._onKeypressFunc, false);\n this.domElement.removeEventListener('keyup', this._onKeyupFunc, false);\n this.domElement.removeEventListener('paste', this._onPasteFunc, false);\n this.domElement.removeEventListener('wheel', this._onWheelFunc, false);\n this.domElement.removeEventListener('drop', this._onDropFunc, false);\n this._removeFormListener();\n\n // Keep track if the event listeners have been initialized on this object\n this.hasEventListeners = false;\n\n document.removeEventListener('keydown', this._onKeydownGlobalFunc, false);\n document.removeEventListener('keyup', this._onKeyupGlobalFunc, false);\n }", "title": "" }, { "docid": "6e6ef57411302cf892e139d8676a8c3b", "score": "0.61147356", "text": "function addRemoveListeners(action){\n\n if(action){\n document.addEventListener( 'mousemove', onDocumentMouseMove, false );\n document.addEventListener( 'touchstart', onDocumentTouchStart, false );\n document.addEventListener( 'touchmove', onDocumentTouchMove, false );\n window.addEventListener( 'resize', onWindowResize, false );\n }\n else{\n document.removeEventListener( 'mousemove', onDocumentMouseMove, false );\n document.removeEventListener( 'touchstart', onDocumentTouchStart, false );\n document.removeEventListener( 'touchmove', onDocumentTouchMove, false );\n window.removeEventListener( 'resize', onWindowResize, false );\n }\n}", "title": "" }, { "docid": "c433f22572480460cc16dfb81d1d1660", "score": "0.6105015", "text": "function removeActionListener() {\n cells.forEach((cell) => {\n cell.removeEventListener(\"mouseenter\", actionMouseHoverIn);\n cell.removeEventListener(\"mouseleave\", actionMouseHoverOut);\n cell.removeEventListener(\"click\", actionClickBoard);\n cell.style.cursor = \"not-allowed\";\n });\n}", "title": "" }, { "docid": "74c8b50619cdab6d764bd8a7775f74e2", "score": "0.61047256", "text": "setupRemoveFromDOMEvents() {\n this.currentFormDOM.forEach((item) => {\n $(item).find('button')[0].addEventListener(\"click\", () => {\n $(item).remove();\n })\n })\n }", "title": "" }, { "docid": "a7cd59dfc3b902eedf6efe865e43edf2", "score": "0.6092115", "text": "function resetListeners() {\n let hourInputs = document.querySelectorAll(\".hour\");\n hourInputs.forEach((element) => {\n element.removeEventListener(\"mouseover\", toggleActive);\n element.removeEventListener(\"mouseover\", addSlots);\n element.removeEventListener(\"mouseover\", removeSlots);\n });\n getActiveCells();\n }", "title": "" }, { "docid": "87ad3d0d5d073828a454aaec4f1b1713", "score": "0.60903496", "text": "removeAllListeners() {\n Object.keys(this.events).forEach(eventName => {\n return this.events[eventName].splice(0, this.events[eventName].length);\n \t});\n }", "title": "" }, { "docid": "e3cf700160a0603227a3677c870b797a", "score": "0.60821056", "text": "undelegateEvents() {\n if (this.el) {\n for (let i = 0, len = this._domEvents.length; i < len; i++) {\n let item = this._domEvents[i];\n item.el.removeEventListener(item.eventName, item.handler, item.options);\n }\n\n this._domEvents.length = 0;\n }\n\n return this;\n }", "title": "" }, { "docid": "1fdb646ab540da8b94ca8a8d19f5a856", "score": "0.60687536", "text": "function removeListeners() {\n listeners.forEach(listener => {\n listener.event.removeListener(listener.listener)\n })\n listeners.clear()\n }", "title": "" }, { "docid": "bcc618a38962df6cb53f64b6ae4f4e8c", "score": "0.6061617", "text": "function removeEvent(){\n for (var i = 0; i < clickedTiles.length; i++){\n clickedTiles[i].classList.add('match');\n clickedTiles[i].removeChild(clickedTiles[i].childNodes[1])\n console.log(clickedTiles[0].classList)\n }\n clickedTiles[0].removeEventListener(\"click\", compare);\n clickedTiles[1].removeEventListener(\"click\", compare);\n clickedTiles = [];\n }", "title": "" }, { "docid": "8c8a001dd1fcc73ad194edc72c993dea", "score": "0.6061048", "text": "unWireEvents(element) {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(element, _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"Browser\"].touchStartEvent, this.scrollMouseDown);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(element, _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"Browser\"].touchMoveEvent, this.scrollMouseMove);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(element, _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"Browser\"].touchEndEvent, this.scrollMouseUp);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(element, 'mousewheel', this.scrollMouseWheel);\n window.removeEventListener('mousemove', this.mouseMoveListener, false);\n window.removeEventListener('mouseup', this.mouseUpListener, false);\n }", "title": "" }, { "docid": "deddb70d42a705377dab5358098b4e16", "score": "0.6059906", "text": "function cleanupOldMouseListeners() {\n document.body.removeEventListener('mouseleave', prepareHide);\n document.removeEventListener('mousemove', debouncedOnMouseMove);\n }", "title": "" }, { "docid": "9a66f4a3a683daaccd1ef8e194c32768", "score": "0.6047874", "text": "removeDiv(){\n\t\tfor( var object in this.elements ){\n\t\t\t//console.log(this.elements[object]);\n\t\t\tvar j = this.elements[object];\n\t\t\tj.hammer.off(\"pan\",j.clazz.resize.bind(j.clazz));\n\t\t\tj.element.removeEventListener(\"pointerdown\",j.eventListener.bind(j.clazz));\n\t\t\t//console.log(j.element);\n\t\t}\n\t}", "title": "" }, { "docid": "f7ef24e879247dbe7917cd576e4865d2", "score": "0.60453475", "text": "unwireEvents() {\n EventHandler.remove(this.element, 'click', this.mouseClickHandler);\n EventHandler.remove(this.element, getStartEvent(), this.mouseDownHandler);\n EventHandler.remove(this.element, 'keyup', this.keyUpHandler);\n EventHandler.remove(this.element, 'keydown', this.keyDownHandler);\n EventHandler.remove(this.element, 'noderefresh', this.refreshNode);\n }", "title": "" }, { "docid": "da38dc3b33bef0010544c15789a199ed", "score": "0.6036035", "text": "function removeClickEvents(){\n console.log('removing click events');\n var displayedImageElements = document.getElementsByClassName('image');\n for(var i = 0; i < displayedImageElements.length; i++){\n var imageElement = displayedImageElements[i];\n imageElement.removeEventListener('click', handleClick);\n }\n}", "title": "" }, { "docid": "915fca148ff5a149faf2dc51a514114e", "score": "0.60144544", "text": "function agregarEventosBotones(){\n let botonesRemover = document.getElementsByClassName(\"boton-remover\")\n let boton;\n for(let i = 0; i < botonesRemover.length; i++){\n boton = botonesRemover[i];\n boton.addEventListener(\"click\", function(e){\n removerItem(this);\n })\n }\n}", "title": "" }, { "docid": "44032106901dcf05383c8d01e868fb1c", "score": "0.60105485", "text": "function _remove() {\n rootElement.removeEventListener('dragstart', _handleDragStart, true);\n rootElement.removeEventListener(\"drag\", _handleDndEvent, true);\n rootElement.removeEventListener(\"dragover\", _handleDndEvent, true);\n rootElement.removeEventListener(\"dragend\", _handleDndEvent, true);\n rootElement.removeEventListener(\"dragenter\", _handleDndEvent, true);\n rootElement.removeEventListener(\"dragleave\", _handleDndEvent, true);\n rootElement.removeEventListener(\"drop\", _handleDndEvent, true);\n rootElement.removeEventListener('pointerdown', _handlePointerDown, true);\n }", "title": "" }, { "docid": "de5c0e3662d5ca662c582b09cf8a2835", "score": "0.60075366", "text": "function removeEventListeners() {\n window.removeEventListener('resize', onWindowResize, true);\n $(containerId).unbind('mousedown', onMouseDown);\n $(containerId).unbind('mousewheel', onMouseWheel);\n $(containerId).unbind('mousemove', onMouseBrowse);\n $(containerId).unbind('mouseover', onMouseInContainer);\n $(containerId).unbind('mouseout', onMouseOutContainer);\n\n $(document).unbind('country:focus', eventCountryFocus);\n $(document).unbind('country:hover', eventCountryHover);\n $(document).unbind('country:unhover', eventCountryUnhover);\n\n $(document).unbind('country:color:set', eventSetCountryColor);\n $(document).unbind('country:color:unset', eventUnsetCountryColor);\n\n $(document).unbind('navigation:zoom:in', eventNavigationZoomIn);\n $(document).unbind('navigation:zoom:out', eventNavigationZoomOut);\n\n\t\t$(document).unbind('keydown', onKeyDown);\n }", "title": "" }, { "docid": "834996e07f8179b58dbe5f7d7fcb6f3a", "score": "0.60030025", "text": "function cleanupOldMouseListeners() {\n document.body.removeEventListener('mouseleave', scheduleHide);\n document.removeEventListener('mousemove', debouncedOnMouseMove);\n }", "title": "" }, { "docid": "2726417c2be2cc9461758777fa860f7b", "score": "0.60029197", "text": "removeAllListeners() {\n this.__events = new Map();\n }", "title": "" }, { "docid": "2726417c2be2cc9461758777fa860f7b", "score": "0.60029197", "text": "removeAllListeners() {\n this.__events = new Map();\n }", "title": "" }, { "docid": "d941ebf833a149b56cbac94b3f12ea52", "score": "0.5999592", "text": "function removeListeners() {\n\n // right filter sidebar toggle\n if (sidebar()) {\n sidebar().removeEventListener('click', sidebarToggle)\n }\n\n // left menu sidebar toggle with menu button\n menuButton().removeEventListener('click', menuToggle)\n\n // left menu sidebar close on any click outside\n document.body.removeEventListener('click', menuClose)\n\n // nested menu items toggle\n if (nestedMenuItem()) {\n nestedMenuItem().removeEventListener('click', nestedMenuToggle)\n }\n\n}", "title": "" }, { "docid": "5ba757e8e56220009e64183f227b7f53", "score": "0.59980804", "text": "static applyRemoveListener() {\n const self = Form_Creator;\n let remove_btns = form.querySelectorAll('.removeBtn');\n if(remove_btns.length > 0) {\n let last_remove_btn = remove_btns[remove_btns.length - 1];\n last_remove_btn.onclick = self.removeStepDiv;\n }\n }", "title": "" }, { "docid": "6eaec120d4d8b47716b23e780d065853", "score": "0.599282", "text": "function removeBoardEvent(){\n // get all the elements and set the blank block\n let list = __r.el('.cell');\n\n // iterate over elements and output their HTML content\n for (let i = 0; i < list.length; i++) {\n __r.emove(list[i],'click',pick);\n }\n}", "title": "" }, { "docid": "494ad2216c9cf0cb164383bf3a656a4c", "score": "0.5986044", "text": "function removeExtensionListeners(){\n let buttons = document.getElementsByClassName(\"toggleCartButton\");\n for(let i = buttons.length-1; i>0; i--){\n let parent = buttons[i].parentNode;\n parent.classList.remove(\"salvage-extension-selected\");\n parent.removeChild(buttons[i]);\n }\n }", "title": "" }, { "docid": "19418e63f49a37ac9d79a467366a4daf", "score": "0.5983978", "text": "function removeWhenStart() {\n minusMin.removeEventListener('click', lessMin)\n addMin.removeEventListener('click', moreMin)\n minusBrk.removeEventListener('click', lessBrk)\n addBrk.removeEventListener('click', moreBrk)\n}", "title": "" }, { "docid": "32b17bdc461a03d6cdc5afef24cc4cda", "score": "0.5977331", "text": "removeEventListeners() {\n for (const event of this.events) {\n if (!isValidEvent(event)) {\n continue\n }\n\n const eventHandler = this[event]\n\n if (!eventHandler) {\n continue\n }\n\n this.client.removeListener(event, eventHandler)\n }\n }", "title": "" }, { "docid": "b7559befffcb367953207cdafd7ed46f", "score": "0.5966077", "text": "unWireEVents() {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'click', this.smithchartOnClick);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"Browser\"].touchMoveEvent, this.mouseMove);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"Browser\"].touchEndEvent, this.mouseEnd);\n window.removeEventListener((_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"Browser\"].isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.smithchartOnResize);\n }", "title": "" }, { "docid": "13ce427b0651ca4f3b2bcd3b54482f72", "score": "0.5965268", "text": "unsubscribeToBugsEvents() {\n this.bugElements.forEach(element => {\n element.onmousedown = null;\n element.onmouseup = null;\n element.ondblclick = null;\n });\n }", "title": "" }, { "docid": "30862058fda1a2307e15b1eac1fb4ef7", "score": "0.59526294", "text": "removeAllListeners() {\n this.listeners = [];\n }", "title": "" }, { "docid": "cb737eca95c009d0d9e9a309ddda3123", "score": "0.5942804", "text": "function removeEventListeners(listener) {\n document.querySelectorAll('.button').forEach(buttons => { buttons.removeEventListener(\"click\", listener) });\n return;\n }", "title": "" }, { "docid": "e0fd2421d2a25e4837da73bbf25b2955", "score": "0.59389096", "text": "function unsubcrible() {\n const index = listeners.indexOf(fn);\n listeners.splice(index, 1);\n }", "title": "" }, { "docid": "cd34c95cf8fb4bb16ebe1eb38f034eaf", "score": "0.5938749", "text": "_patchRemoveAllListeners (ee, original) {\n const contextManager = this\n return function (event) {\n const map = contextManager._getPatchMap(ee)\n if (map !== undefined) {\n if (arguments.length === 0) {\n contextManager._createPatchMap(ee)\n } else if (map[event] !== undefined) {\n delete map[event]\n }\n }\n return original.apply(this, arguments)\n }\n }", "title": "" }, { "docid": "3345bdca62ba11029300c93595ec7ff7", "score": "0.5924673", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if(LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "276836eae1779ed8af4043d05a6800ba", "score": "0.5920259", "text": "eliminarEventosClick() {\n this.colores.celeste.removeEventListener('click', this.elegirColor)\n this.colores.verde.removeEventListener('click', this.elegirColor)\n this.colores.violeta.removeEventListener('click', this.elegirColor)\n this.colores.naranja.removeEventListener('click', this.elegirColor)\n }", "title": "" }, { "docid": "931e096d37a2695fa0d92c2eb8bd29f3", "score": "0.59062475", "text": "unbindListeners() {\n this.textInput.onkeyup = null;\n this.popupCloser.onclick = null;\n }", "title": "" }, { "docid": "81cfdb9fbf29390276ccbf3ccdfac8b1", "score": "0.5898954", "text": "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) {\n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\n\t\t\tsetTouchInProgress(false);\n\t\t}", "title": "" }, { "docid": "78a1c301f8bbbc430b91f4e65ff2a474", "score": "0.5880315", "text": "unsetListeners() {\n throw new NotImplementedException();\n }", "title": "" }, { "docid": "bbda8c344b80be54b953b13badc70b3f", "score": "0.5878853", "text": "removeAllListener() {\n this._listeners = {};\n }", "title": "" }, { "docid": "026d6d0ee2f03f2ea670117c6b3856bb", "score": "0.5867365", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "83eaff1f6ac02fa4b5a2fe528906b1fb", "score": "0.5863552", "text": "unbindEvents() {}", "title": "" }, { "docid": "c7c592219974232e4758c9a64c5230e7", "score": "0.5858583", "text": "function _disposeAddTagListeners(listener) {\n\t\t_editor.off(\"cursorActivity\");\n\t\tKeyBindingManager.removeGlobalKeydownHook(listener);\n\t\t_lng = 0;\n\t\t_currentDoc = null;\n\t\t_currentPos = null;\n\t\t_editor = null;\n\t}", "title": "" }, { "docid": "bd98a203393501478df1ce7806d87f09", "score": "0.5855113", "text": "unwireEvents() {\n for (const input of (this.inputElements)) {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].clearEvents(input);\n }\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'submit', this.submitHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'reset', this.resetHandler);\n }", "title": "" }, { "docid": "c4a7d71f13674cb50f5e57771d6d4674", "score": "0.58544505", "text": "function deletereminder(){\n for(let span of spans){\n span.addEventListener (\"click\",function (){\n span.parentElement.remove();\n event.stopPropagation();\n });\n }\n}", "title": "" }, { "docid": "d7e55fb2ee158f2c26accdf42f3a49a5", "score": "0.5847289", "text": "static _removeContainer() {\n\t\t\t// Add event handler\n\t\t\tdocument.removeEventListener('mousemove', Toast._onDragMove);\n\t\t\tdocument.removeEventListener('mouseup', Toast._onDragEnd);\n\t\t\tToast._container.parentNode.removeChild(Toast._container);\n\t\t\tToast._container = null;\n\t\t}", "title": "" }, { "docid": "6d2924ff753f43bf543c9bd2748ab196", "score": "0.58446723", "text": "function removeEventListeners() {\n\n eventsAreBound = false;\n\n document.removeEventListener( 'keydown', onDocumentKeyDown, false );\n window.removeEventListener( 'hashchange', onWindowHashChange, false );\n window.removeEventListener( 'resize', onWindowResize, false );\n\n dom.wrapper.removeEventListener( 'touchstart', onTouchStart, false );\n dom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );\n dom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );\n\n if( window.navigator.msPointerEnabled ) {\n dom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );\n dom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );\n dom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );\n }\n\n if ( config.progress && dom.progress ) {\n dom.progress.removeEventListener( 'click', onProgressClicked, false );\n }\n\n [ 'touchstart', 'click' ].forEach( function( eventName ) {\n dom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } );\n dom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } );\n dom.controlsUp.forEach( function( el ) { el.removeEventListener( eventName, onNavigateUpClicked, false ); } );\n dom.controlsDown.forEach( function( el ) { el.removeEventListener( eventName, onNavigateDownClicked, false ); } );\n dom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } );\n dom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } );\n } );\n\n }", "title": "" }, { "docid": "0b41333afe3a1331689b006c16f80b0b", "score": "0.58438146", "text": "function unsetControlsListeners() {}", "title": "" }, { "docid": "20808e398b2198f785b6bb74ba42b2ff", "score": "0.58355325", "text": "unwireEvents() {\n for (let input of (this.inputElements)) {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].clearEvents(input);\n }\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'submit', this.submitHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'reset', this.resetHandler);\n }", "title": "" }, { "docid": "6a1f30378184c46a764e52b515c7f9af", "score": "0.58251715", "text": "function removeRunListeners() {\n runButton.prop(\"onclick\", null);\n runButton.unbind();\n}", "title": "" }, { "docid": "b84c00fc1336ee8f72ad84a238516654", "score": "0.5823839", "text": "function addDuplicatesButtonListener() {\n var duplicatesButton = document.getElementById(\"duplicatesButtonRegexAddon\");\n duplicatesButton.addEventListener('click', unduplicateAndExecute, true);\n}", "title": "" }, { "docid": "82d6044abb1c4a628a8e92be55f265f1", "score": "0.58131534", "text": "function attachHtmlWatcher()\n {\n var q = __querySelectorAll;\n \n function htmlCopyBubbled(parent,el,ext,listeners,isUpdate)\n {\n var __listener = (!isUpdate ? 'parentAttrListeners' : 'parentAttrUpdateListeners'),\n __keys = Object.keys(listeners),\n __extListeners = ext[__listener],\n __len = __keys.length,\n __key,\n __keyInline,\n __cssSpecial,\n __x,\n __lenKey,\n __i;\n\n for(__x = 0;__x<__len;__x++)\n {\n __key = __keys[__x];\n __keyInline = getInlineKey(__key);\n __cssSpecial = __keyInline.match(/(webkit|moz|ms)/);\n \n /* check specials styles */\n if(__CSSList__.indexOf(__keyInline) !== -1 || (__cssSpecial && !__cssSpecial.index))\n {\n if(listeners[__keyInline].length)\n {\n if(el.style[__keyInline] === undefined) processNewStyle(el,__keyInline);\n attachStyleListeners(el,__keyInline,getStyleKey(__key)); \n }\n }\n /* check inputs */\n else if(['value','checked','selectedIndex'].indexOf(__key) !== -1 && ['INPUT','TEXTAREA','SELECT'].indexOf(el.nodeName) !== -1)\n {\n if(listeners[__key].length)\n {\n attachInputListeners(el);\n }\n }\n /* check attributes */\n else if(el.getAttribute(__key) === null)\n {\n if(el[__key] === undefined)\n {\n if(__NonTraditional__.indexOf(__key) === -1)\n {\n processNewAttr(el,__key);\n }\n }\n }\n \n if(listeners[__key].length)\n {\n if(listeners[__key][0].parent)\n {\n __extListeners[__key] = listeners[__key].slice(); \n }\n else\n {\n __extListeners[__key] = [];\n __lenKey = listeners[__key].length;\n for(__i =0;__i<__lenKey;__i++)\n {\n __extListeners[__key][__i] = {parent:parent,func:listeners[__key][__i]};\n }\n }\n }\n else\n {\n __extListeners[__key] = [];\n __lenKey = listeners[__key].length;\n for(__i =0;__i<__lenKey;__i++)\n {\n __extListeners[__key][__i] = {parent:parent,func:listeners[__key][__i]};\n }\n }\n }\n }\n \n /* remember to propogate bubbled events onto new html nodes (do it gently) */\n /* add html listener to remove bubbled listeners properly */\n document.documentElement.addEventListener('htmlupdate',function(e){\n if(e.srcElement.nodeType !== 3 && e.srcElement.nodeType !== 8)\n {\n /* fetch current target listeners and parent bubbled listeners */\n var __element = e.srcElement,\n __extensions = (__element.__pikantnyExtensions__ || attachLocalBinders(__element, __element.__pikantnyExtensionsPass__)),\n __children = q.call(__element,'*'),\n __child,\n __childExtensions,\n __len = __children.length,\n __x;\n\n for(__x=0;__x<__len;__x++)\n {\n __child = __children[__x];\n if(!__child.__pikantnyExtensions__)\n {\n __childExtensions = attachLocalBinders(__child);\n /* copy listeners over */\n htmlCopyBubbled(__element,__child,__childExtensions,__extensions.attrListeners);\n /* copy update listeners over */\n htmlCopyBubbled(__element,__child,__childExtensions,__extensions.attrUpdateListeners,true);\n /* copy parent listeners over */\n htmlCopyBubbled(__element,__child,__childExtensions,__extensions.parentAttrListeners);\n /* copy parent update listeners over */\n htmlCopyBubbled(__element,__child,__childExtensions,__extensions.parentAttrUpdateListeners,true);\n }\n }\n }\n });\n }", "title": "" }, { "docid": "b242acb703a7c5a3c3784d2016adec3f", "score": "0.5808492", "text": "disconnect(element){window.removeEventListener(\"haxcms-active-item-changed\",this._activeItemUpdate.bind(element));window.removeEventListener(\"haxcms-edit-mode-changed\",this._globalEditChanged.bind(element));window.removeEventListener(\"haxcms-trigger-update\",this._triggerUpdate.bind(element))}", "title": "" }, { "docid": "497924376639163574a26b24190a0275", "score": "0.580786", "text": "function selectTileAndRemove(){\r\n let tiles = qsa(\".tile\");\r\n let choices = qsa(\".choice-user\");\r\n for (let i=0; i<36; i++){\r\n choices[i].addEventListener(\"click\", function(){\r\n //console.log(choices[i]);\r\n choices[i].remove();\r\n clearRedo();\r\n choices = \"\";\r\n });\r\n }\r\n}", "title": "" }, { "docid": "985f46a52db4e0f459213368350cd185", "score": "0.5805494", "text": "function removeAllListeners () {\n emitEventPairs.forEach(function (p) {\n p[0].removeAllListeners(p[1])\n })\n }", "title": "" }, { "docid": "6063d3cffa97dc9b6fc01471bc54a365", "score": "0.58019125", "text": "function removeEventVanilla(target, type, insideFunction, array) {\n for (let e of array) {\n e.addEventListener(\"click\", function () {\n target.removeEventListener(type, insideFunction);\n });\n }\n console.log(\"Removed event listener \" + type + \" in \" + target);\n}", "title": "" }, { "docid": "b28d317c7901dd400648222efc871226", "score": "0.57922804", "text": "function updateEventListeners() {\n\tliElements = ul.children;\n\tfor (var i = 0 ; i <= liElements.length-1; i ++) {\n\n\t\tliElements[i].removeEventListener(\"click\", listenerOnClick);\n\t\tliElements[i].addEventListener(\"click\", listenerOnClick);\n\t} \n\n}", "title": "" }, { "docid": "61311b690c0c9978549792fe29eb7f4e", "score": "0.578774", "text": "function removeEventListeners() {\n\n\t\teventsAreBound = false;\n\n\t\ttouch.unbind();\n\t\tfocus.unbind();\n\t\tkeyboard.unbind();\n\t\tcontrols.unbind();\n\t\tprogress.unbind();\n\t\tlocation.unbind();\n\n\t\twindow.removeEventListener( 'resize', onWindowResize, false );\n\n\t\tdom.slides.removeEventListener( 'click', onSlidesClicked, false );\n\t\tdom.slides.removeEventListener( 'transitionend', onTransitionEnd, false );\n\t\tdom.pauseOverlay.removeEventListener( 'click', resume, false );\n\n\t}", "title": "" }, { "docid": "9d723f6a3703986116c994c6cbcc8ac3", "score": "0.5784841", "text": "bindRemoveRecepients () {\n\t\tconst proto = Object.assign({ __proto__: this.__proto__ }, this)\n\t\tdocument.querySelectorAll('.remove-receipients-modal').forEach((val, index) => {\n\t\t\tval.addEventListener('click',this.loadRemoveRecepients.bind(proto))\n\t\t})\n\t}", "title": "" }, { "docid": "db9c08b38f173a24338e1f9bf32609bc", "score": "0.5783653", "text": "detach() {\n for (const container of this.containers) {\n container.removeEventListener('webkitmouseforcewillbegin', this[onMouseForceWillBegin], false);\n container.removeEventListener('webkitmouseforcedown', this[onMouseForceDown], false);\n container.removeEventListener('mousedown', this[onMouseDown], true);\n container.removeEventListener('webkitmouseforcechanged', this[onMouseForceChange], false);\n }\n\n document.removeEventListener('mousemove', this[onMouseMove]);\n document.removeEventListener('mouseup', this[onMouseUp]);\n }", "title": "" }, { "docid": "db9c08b38f173a24338e1f9bf32609bc", "score": "0.5783653", "text": "detach() {\n for (const container of this.containers) {\n container.removeEventListener('webkitmouseforcewillbegin', this[onMouseForceWillBegin], false);\n container.removeEventListener('webkitmouseforcedown', this[onMouseForceDown], false);\n container.removeEventListener('mousedown', this[onMouseDown], true);\n container.removeEventListener('webkitmouseforcechanged', this[onMouseForceChange], false);\n }\n\n document.removeEventListener('mousemove', this[onMouseMove]);\n document.removeEventListener('mouseup', this[onMouseUp]);\n }", "title": "" }, { "docid": "db9c08b38f173a24338e1f9bf32609bc", "score": "0.5783653", "text": "detach() {\n for (const container of this.containers) {\n container.removeEventListener('webkitmouseforcewillbegin', this[onMouseForceWillBegin], false);\n container.removeEventListener('webkitmouseforcedown', this[onMouseForceDown], false);\n container.removeEventListener('mousedown', this[onMouseDown], true);\n container.removeEventListener('webkitmouseforcechanged', this[onMouseForceChange], false);\n }\n\n document.removeEventListener('mousemove', this[onMouseMove]);\n document.removeEventListener('mouseup', this[onMouseUp]);\n }", "title": "" }, { "docid": "db9c08b38f173a24338e1f9bf32609bc", "score": "0.5783653", "text": "detach() {\n for (const container of this.containers) {\n container.removeEventListener('webkitmouseforcewillbegin', this[onMouseForceWillBegin], false);\n container.removeEventListener('webkitmouseforcedown', this[onMouseForceDown], false);\n container.removeEventListener('mousedown', this[onMouseDown], true);\n container.removeEventListener('webkitmouseforcechanged', this[onMouseForceChange], false);\n }\n\n document.removeEventListener('mousemove', this[onMouseMove]);\n document.removeEventListener('mouseup', this[onMouseUp]);\n }", "title": "" }, { "docid": "db9c08b38f173a24338e1f9bf32609bc", "score": "0.5783653", "text": "detach() {\n for (const container of this.containers) {\n container.removeEventListener('webkitmouseforcewillbegin', this[onMouseForceWillBegin], false);\n container.removeEventListener('webkitmouseforcedown', this[onMouseForceDown], false);\n container.removeEventListener('mousedown', this[onMouseDown], true);\n container.removeEventListener('webkitmouseforcechanged', this[onMouseForceChange], false);\n }\n\n document.removeEventListener('mousemove', this[onMouseMove]);\n document.removeEventListener('mouseup', this[onMouseUp]);\n }", "title": "" }, { "docid": "db9c08b38f173a24338e1f9bf32609bc", "score": "0.5783653", "text": "detach() {\n for (const container of this.containers) {\n container.removeEventListener('webkitmouseforcewillbegin', this[onMouseForceWillBegin], false);\n container.removeEventListener('webkitmouseforcedown', this[onMouseForceDown], false);\n container.removeEventListener('mousedown', this[onMouseDown], true);\n container.removeEventListener('webkitmouseforcechanged', this[onMouseForceChange], false);\n }\n\n document.removeEventListener('mousemove', this[onMouseMove]);\n document.removeEventListener('mouseup', this[onMouseUp]);\n }", "title": "" }, { "docid": "db9c08b38f173a24338e1f9bf32609bc", "score": "0.5783653", "text": "detach() {\n for (const container of this.containers) {\n container.removeEventListener('webkitmouseforcewillbegin', this[onMouseForceWillBegin], false);\n container.removeEventListener('webkitmouseforcedown', this[onMouseForceDown], false);\n container.removeEventListener('mousedown', this[onMouseDown], true);\n container.removeEventListener('webkitmouseforcechanged', this[onMouseForceChange], false);\n }\n\n document.removeEventListener('mousemove', this[onMouseMove]);\n document.removeEventListener('mouseup', this[onMouseUp]);\n }", "title": "" }, { "docid": "db9c08b38f173a24338e1f9bf32609bc", "score": "0.5783653", "text": "detach() {\n for (const container of this.containers) {\n container.removeEventListener('webkitmouseforcewillbegin', this[onMouseForceWillBegin], false);\n container.removeEventListener('webkitmouseforcedown', this[onMouseForceDown], false);\n container.removeEventListener('mousedown', this[onMouseDown], true);\n container.removeEventListener('webkitmouseforcechanged', this[onMouseForceChange], false);\n }\n\n document.removeEventListener('mousemove', this[onMouseMove]);\n document.removeEventListener('mouseup', this[onMouseUp]);\n }", "title": "" }, { "docid": "db9c08b38f173a24338e1f9bf32609bc", "score": "0.5783653", "text": "detach() {\n for (const container of this.containers) {\n container.removeEventListener('webkitmouseforcewillbegin', this[onMouseForceWillBegin], false);\n container.removeEventListener('webkitmouseforcedown', this[onMouseForceDown], false);\n container.removeEventListener('mousedown', this[onMouseDown], true);\n container.removeEventListener('webkitmouseforcechanged', this[onMouseForceChange], false);\n }\n\n document.removeEventListener('mousemove', this[onMouseMove]);\n document.removeEventListener('mouseup', this[onMouseUp]);\n }", "title": "" }, { "docid": "1b0089fca303ef58fa1ede5bbc4202e1", "score": "0.5782095", "text": "function disposeGameBoardEventListeners() {\r\n // Remove all DOM event listeners\r\n $(\"#gameBoard img\").off(\"dragstart\");\r\n $(\".gameOverlayMenu .downloadGameButton\").off(\"click\");\r\n $(\"#pauseMenu #resumeGameButton\").off(\"click\");\r\n $(\"#gameOverMenu .exitButton\").off(\"click\");\r\n $(\"#nextRoundMenu #nextRoundButton\").off(\"click\");\r\n $(\"#gameBoard\").off(\"mouseenter\");\r\n $(\"#gameBoard\").off(\"mouseleave\");\r\n $(\"#gameBoard\").off(\"mousedown\");\r\n }", "title": "" }, { "docid": "98ad589f08da6382a819c7fea488b988", "score": "0.57810175", "text": "function unlisten(el) {\n var hashkey = getOrGenElHashkey(el);\n var listeners = listenersHash[hashkey];\n if (!el || !listeners) return;\n var listenersClone = listeners.concat();\n var i, len = listenersClone.length;\n for (i = 0; i < len; i++) {\n unlistenOne(el, listenersClone[i]);\n }\n }", "title": "" }, { "docid": "238ff06061e4845234f7359a04d67e01", "score": "0.5780178", "text": "function clearEvents()\r\n\t\t{\r\n\t\t\twhile(elementsToClean.length > 0)\r\n\t\t\t{\r\n\t\t\t\tvar elementToClean = elementsToClean.pop();\r\n\t\t\t\tvar htmlElement = elementToClean.htmlElement;\r\n\t\t\t\tvar eventName = elementToClean.eventName;\r\n\t\t\t\tvar eventCollection = eventName + 'Events';\r\n\r\n\t\t\t\t// Remove all event handlers for this element.\r\n\t\t\t\twhile(htmlElement[eventCollection].length > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\thtmlElement[eventCollection].pop();\r\n\t\t\t\t}\r\n\r\n\t\t\t\thtmlElement[eventName] = null;\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "6301068504c5eeabce946242dc8b69e7", "score": "0.57800114", "text": "unwireEvents() {\n this.element.removeEventListener(this.eventName, this.keyPressHandler);\n }", "title": "" }, { "docid": "6301068504c5eeabce946242dc8b69e7", "score": "0.57800114", "text": "unwireEvents() {\n this.element.removeEventListener(this.eventName, this.keyPressHandler);\n }", "title": "" } ]
0c41750a4013a61d9c20dae8523fdeff
Attempt to create an observer instance for a value, returns the new observer if successfully observed, or the existing observer if the value already has one.
[ { "docid": "ecdb6aaf0dc80d3c63493e5a920922f3", "score": "0.0", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n shouldObserve &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" } ]
[ { "docid": "201ecfa8188f62cc295cf9b8394ce1b6", "score": "0.652136", "text": "function observe(value) {\n if (!isObject(value)) {\n return;\n }\n var ob = void 0;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (observerState.shouldConvert && !config._isServer && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {\n ob = new Observer(value);\n }\n return ob;\n}", "title": "" }, { "docid": "201ecfa8188f62cc295cf9b8394ce1b6", "score": "0.652136", "text": "function observe(value) {\n if (!isObject(value)) {\n return;\n }\n var ob = void 0;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (observerState.shouldConvert && !config._isServer && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {\n ob = new Observer(value);\n }\n return ob;\n}", "title": "" }, { "docid": "fdb3fee318369e9fca698b30f8be1881", "score": "0.64440536", "text": "function observe (value) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !config._isServer &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n return ob\n}", "title": "" }, { "docid": "52b95bf83696fabeeb4b946284492386", "score": "0.64167416", "text": "function observe (value) {\n if (!isObject(value)) {\n return\n }\n var ob\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__\n } else if (\n observerState.shouldConvert &&\n !config._isServer &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value)\n }\n return ob\n}", "title": "" }, { "docid": "8963ac49001e667a1ab2d0a3cace15f6", "score": "0.6102343", "text": "async notifyFirst(value) {\n const observer = this.observers.shift();\n if (observer) {\n await observer(value);\n }\n return this;\n }", "title": "" }, { "docid": "22596a7b457e500ff4c9d26460bbf2b6", "score": "0.5939217", "text": "static holder(value) {\n const obs = new Observable(value);\n obs._owned = value;\n return obs;\n }", "title": "" }, { "docid": "bc7df1b6f2a92a933f5169a10323d6ff", "score": "0.59205604", "text": "function observe(value, shallow, ssrMockReactivity) {\n if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n return value.__ob__;\n }\n if (shouldObserve &&\n (ssrMockReactivity || !isServerRendering()) &&\n (isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value.__v_skip /* ReactiveFlags.SKIP */ &&\n !isRef(value) &&\n !(value instanceof VNode)) {\n return new Observer(value, shallow, ssrMockReactivity);\n }\n }", "title": "" }, { "docid": "7ec99dd2753f51233976ad3b04bf5b77", "score": "0.5901867", "text": "function obsHolder(value) {\n return Observable.holder(value);\n}", "title": "" }, { "docid": "ff37be83ede05e5061b75f886d541db0", "score": "0.5901569", "text": "function observe(value, shallow, ssrMockReactivity) {\n if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n return value.__ob__;\n }\n if (shouldObserve &&\n (ssrMockReactivity || !isServerRendering()) &&\n (isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value.__v_skip /* ReactiveFlags.SKIP */ &&\n !isRef(value) &&\n !(value instanceof VNode)) {\n return new Observer(value, shallow, ssrMockReactivity);\n }\n }", "title": "" }, { "docid": "a9fe547c07ab5abd3aa9c007575a16a7", "score": "0.5882785", "text": "function Observer(value) {\n this.value = value;\n this.dep = new Dep();\n this.vmCount = 0;\n def(value, '__ob__', this);\n if (Array.isArray(value)) {\n var augment = hasProto ? protoAugment : copyAugment;\n augment(value, arrayMethods, arrayKeys);\n this.observeArray(value);\n } else {\n this.walk(value);\n }\n }", "title": "" }, { "docid": "a9fe547c07ab5abd3aa9c007575a16a7", "score": "0.5882785", "text": "function Observer(value) {\n this.value = value;\n this.dep = new Dep();\n this.vmCount = 0;\n def(value, '__ob__', this);\n if (Array.isArray(value)) {\n var augment = hasProto ? protoAugment : copyAugment;\n augment(value, arrayMethods, arrayKeys);\n this.observeArray(value);\n } else {\n this.walk(value);\n }\n }", "title": "" }, { "docid": "0c19fddf0d2c7520a2fc84cbacd6af9d", "score": "0.5858439", "text": "function observe(value, shallow, ssrMockReactivity) {\n if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n return value.__ob__;\n }\n if (shouldObserve &&\n (ssrMockReactivity || !isServerRendering()) &&\n (isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value.__v_skip /* ReactiveFlags.SKIP */ &&\n !isRef(value) &&\n !(value instanceof VNode)) {\n return new Observer(value, shallow, ssrMockReactivity);\n }\n}", "title": "" }, { "docid": "0c19fddf0d2c7520a2fc84cbacd6af9d", "score": "0.5858439", "text": "function observe(value, shallow, ssrMockReactivity) {\n if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n return value.__ob__;\n }\n if (shouldObserve &&\n (ssrMockReactivity || !isServerRendering()) &&\n (isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value.__v_skip /* ReactiveFlags.SKIP */ &&\n !isRef(value) &&\n !(value instanceof VNode)) {\n return new Observer(value, shallow, ssrMockReactivity);\n }\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "ea9fe3ca1bcca8b2d63a68853b9594db", "score": "0.5797386", "text": "function observe (value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "f0414b7adfa4665f28d316b5d276962e", "score": "0.576921", "text": "function observe(value, asRootData) {\n if (!isObject(value)) {\n return;\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (observerState.shouldConvert && !isServerRendering() && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob;\n }", "title": "" }, { "docid": "f0414b7adfa4665f28d316b5d276962e", "score": "0.576921", "text": "function observe(value, asRootData) {\n if (!isObject(value)) {\n return;\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (observerState.shouldConvert && !isServerRendering() && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob;\n }", "title": "" }, { "docid": "f0414b7adfa4665f28d316b5d276962e", "score": "0.576921", "text": "function observe(value, asRootData) {\n if (!isObject(value)) {\n return;\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (observerState.shouldConvert && !isServerRendering() && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob;\n }", "title": "" }, { "docid": "e5c96251d3901bef7ec2c77a1bc62069", "score": "0.57495874", "text": "function observe (value, asRootData) {\n\t if (!isObject(value)) {\n\t return\n\t }\n\t var ob;\n\t if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n\t ob = value.__ob__;\n\t } else if (\n\t observerState.shouldConvert &&\n\t !isServerRendering() &&\n\t (Array.isArray(value) || isPlainObject(value)) &&\n\t Object.isExtensible(value) &&\n\t !value._isVue\n\t ) {\n\t ob = new Observer(value);\n\t }\n\t if (asRootData && ob) {\n\t ob.vmCount++;\n\t }\n\t return ob\n\t}", "title": "" }, { "docid": "e5c96251d3901bef7ec2c77a1bc62069", "score": "0.57495874", "text": "function observe (value, asRootData) {\n\t if (!isObject(value)) {\n\t return\n\t }\n\t var ob;\n\t if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n\t ob = value.__ob__;\n\t } else if (\n\t observerState.shouldConvert &&\n\t !isServerRendering() &&\n\t (Array.isArray(value) || isPlainObject(value)) &&\n\t Object.isExtensible(value) &&\n\t !value._isVue\n\t ) {\n\t ob = new Observer(value);\n\t }\n\t if (asRootData && ob) {\n\t ob.vmCount++;\n\t }\n\t return ob\n\t}", "title": "" }, { "docid": "e5c96251d3901bef7ec2c77a1bc62069", "score": "0.57495874", "text": "function observe (value, asRootData) {\n\t if (!isObject(value)) {\n\t return\n\t }\n\t var ob;\n\t if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n\t ob = value.__ob__;\n\t } else if (\n\t observerState.shouldConvert &&\n\t !isServerRendering() &&\n\t (Array.isArray(value) || isPlainObject(value)) &&\n\t Object.isExtensible(value) &&\n\t !value._isVue\n\t ) {\n\t ob = new Observer(value);\n\t }\n\t if (asRootData && ob) {\n\t ob.vmCount++;\n\t }\n\t return ob\n\t}", "title": "" }, { "docid": "598c4637f65ff19d02fe57cfe125eb37", "score": "0.5749562", "text": "observe(obj, keypath) {\n return new Observer(obj, keypath, this)\n }", "title": "" }, { "docid": "4200f66af58c6ea9ddd90b2abc874b2d", "score": "0.57491857", "text": "function observe(value, asRootData) {\n if (!isObject(value)) {\n return;\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (observerState.shouldConvert && !isServerRendering() && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob;\n}", "title": "" }, { "docid": "4200f66af58c6ea9ddd90b2abc874b2d", "score": "0.57491857", "text": "function observe(value, asRootData) {\n if (!isObject(value)) {\n return;\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (observerState.shouldConvert && !isServerRendering() && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob;\n}", "title": "" }, { "docid": "c7d95162f4e2b2b411601a7e899130b5", "score": "0.5735591", "text": "function observe(value, asRootData) {\n if (!isObject(value)) {\n return\n }\n var ob\n if (hasOwn(value, \"__ob__\") && value.__ob__ instanceof Observer) {\n ob = value.__ob__\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value)\n }\n if (asRootData && ob) {\n ob.vmCount++\n }\n return ob\n }", "title": "" }, { "docid": "4569e39f96fe4a0d2eac2a577fddd20c", "score": "0.5719488", "text": "function observe (value, asRootData, key) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value, key);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "853165c1e6d121a744fb3d3ba77e492e", "score": "0.564879", "text": "function observe(value, shallow, ssrMockReactivity) {\r\n if (!isObject(value) || isRef(value) || value instanceof VNode) {\r\n return;\r\n }\r\n var ob;\r\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\r\n ob = value.__ob__;\r\n }\r\n else if (shouldObserve &&\r\n (ssrMockReactivity || !isServerRendering()) &&\r\n (isArray(value) || isPlainObject(value)) &&\r\n Object.isExtensible(value) &&\r\n !value.__v_skip /* ReactiveFlags.SKIP */) {\r\n ob = new Observer(value, shallow, ssrMockReactivity);\r\n }\r\n return ob;\r\n}", "title": "" }, { "docid": "bf06d805f5707c8b1737f287e0713e9f", "score": "0.5602372", "text": "notifyFirstSync(value) {\n const observer = this.observers.shift();\n if (observer) {\n observer(value);\n }\n return this;\n }", "title": "" }, { "docid": "ec691d60e6a4a3d65e50452eb084e655", "score": "0.559832", "text": "async notifyLast(value) {\n const observer = this.observers.pop();\n if (observer) {\n await observer(value);\n }\n return this;\n }", "title": "" }, { "docid": "d894540e6be5c99782362c6df06fde21", "score": "0.5590747", "text": "function observe(value, asRootData) {\n if (!isObject(value)) {\n return\n }\n let ob\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value)\n }\n if (asRootData && ob) {\n ob.vmCount++\n }\n return ob\n}", "title": "" }, { "docid": "cfcf3f879373bcae4119605275c3407c", "score": "0.5547178", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer$1) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer$1(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "d88ec0237e9ca791ea45fa7153f95691", "score": "0.55404496", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n shouldObserve &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n }", "title": "" }, { "docid": "d88ec0237e9ca791ea45fa7153f95691", "score": "0.55404496", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n shouldObserve &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n }", "title": "" }, { "docid": "d88ec0237e9ca791ea45fa7153f95691", "score": "0.55404496", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n shouldObserve &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n }", "title": "" }, { "docid": "d88ec0237e9ca791ea45fa7153f95691", "score": "0.55404496", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n shouldObserve &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n }", "title": "" }, { "docid": "d88ec0237e9ca791ea45fa7153f95691", "score": "0.55404496", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n shouldObserve &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n }", "title": "" }, { "docid": "d88ec0237e9ca791ea45fa7153f95691", "score": "0.55404496", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n shouldObserve &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n }", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "fbfdbf8e8220e67cd7562c69a263e92d", "score": "0.5518204", "text": "function observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}", "title": "" }, { "docid": "9adb8f5200604c8af560f526836d841d", "score": "0.5514713", "text": "function observe(value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return;\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (observerState.shouldConvert && !isServerRendering() && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob;\n }", "title": "" }, { "docid": "7aae6f21c1221f7783ef1be72b060e60", "score": "0.5483466", "text": "function observe (value, asRootData) {\r\n if (!isObject(value) || value instanceof VNode) {\r\n return\r\n }\r\n var ob;\r\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\r\n ob = value.__ob__;\r\n } else if (\r\n shouldObserve &&\r\n !isServerRendering() &&\r\n (Array.isArray(value) || isPlainObject(value)) &&\r\n Object.isExtensible(value) &&\r\n !value._isVue\r\n ) {\r\n ob = new Observer(value);\r\n }\r\n if (asRootData && ob) {\r\n ob.vmCount++;\r\n }\r\n return ob\r\n}", "title": "" }, { "docid": "7aae6f21c1221f7783ef1be72b060e60", "score": "0.5483466", "text": "function observe (value, asRootData) {\r\n if (!isObject(value) || value instanceof VNode) {\r\n return\r\n }\r\n var ob;\r\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\r\n ob = value.__ob__;\r\n } else if (\r\n shouldObserve &&\r\n !isServerRendering() &&\r\n (Array.isArray(value) || isPlainObject(value)) &&\r\n Object.isExtensible(value) &&\r\n !value._isVue\r\n ) {\r\n ob = new Observer(value);\r\n }\r\n if (asRootData && ob) {\r\n ob.vmCount++;\r\n }\r\n return ob\r\n}", "title": "" } ]
0f4452fba4d60d8533bbd322db7c0282
set class name for stars for new board
[ { "docid": "7f9bd15f032dbbe301a47e46ec0c8d03", "score": "0.63120246", "text": "function createStars() {\n for (let i = 0; i < 3; i++) {\n let star = document.getElementsByClassName('stars')[0].getElementsByTagName('i')[i];\n star.className = 'fa fa-star';\n }\n}", "title": "" } ]
[ { "docid": "e80b501b6141c6fe53224a09c73aa08f", "score": "0.67352957", "text": "function displayStars(star){\n star.setAttribute(\"class\", \"stars\");\n global.starsDiv.appendChild(star);\n}", "title": "" }, { "docid": "4fd2cb12634ac0b5e3ae208190637a04", "score": "0.6662225", "text": "function stars() {\n const starSelector = document.querySelector('.stars');\n switch (true) {\n case (moveCounter >= 15):\n starSelector.children[1].firstElementChild.setAttribute('class', 'fa fa-star-o');\n break;\n case (moveCounter >= 9):\n starSelector.children[2].firstElementChild.setAttribute('class', 'fa fa-star-o');\n break;\n default:\n starSelector.children[0].firstElementChild.setAttribute('class', 'fa fa-star');\n starSelector.children[1].firstElementChild.setAttribute('class', 'fa fa-star');\n starSelector.children[2].firstElementChild.setAttribute('class', 'fa fa-star');\n }\n}", "title": "" }, { "docid": "4c30de1268aa218292f60624557d5894", "score": "0.6556021", "text": "function GenerateStar(name, stellarClass) {\n}", "title": "" }, { "docid": "f1bd7e734c1415c82333b0b182610bd0", "score": "0.6444204", "text": "function updateStars() {\n if (moves > 10 && moves < 20) {\n starsList[4].setAttribute('class', 'fa fa-star-o');\n stars = 4;\n }\n if (moves >= 20 && moves < 30) {\n starsList[3].setAttribute('class', 'fa fa-star-o');\n stars = 3;\n }\n if (moves >= 30 && moves < 40) {\n starsList[2].setAttribute('class', 'fa fa-star-o');\n stars = 2;\n }\n if (moves >= 40) {\n starsList[1].setAttribute('class', 'fa fa-star-o');\n stars = 1;\n }\n }", "title": "" }, { "docid": "8a43daf3bea3475aecb5bccf90db83be", "score": "0.6438089", "text": "function starSetter() {\n // moves less than or equal 9 -> 3 stars\n // moves between 10 and 15 -> 2.5 stars\n if (moves >= 10 && moves <= 15) {\n starsList[2].className = halfStar;\n stars = 2.5;\n }\n // moves between 16 and 20 -> 2 stars\n else if (moves >= 16 && moves <= 20) {\n starsList[2].className = emptyStar;\n stars = 2;\n }\n // moves between 21 and 24 -> 1.5 stars\n else if (moves >= 21 && moves <= 24) {\n starsList[1].className = halfStar;\n stars = 1.5;\n }\n // moves between 25 and 28 -> 1 star\n else if (moves >= 25 && moves <= 28) {\n starsList[1].className = emptyStar;\n stars = 1;\n }\n // moves between 29 and more -> 0.5 stars\n else if (moves >= 29) {\n starsList[0].className = halfStar;\n stars = 0.5;\n }\n}", "title": "" }, { "docid": "e460e4ffff7061be8f567bf2aa60615d", "score": "0.6374622", "text": "function setStars() {\n let starList = $stars;\n\n // determine whether stars need to be added or reset\n if (starList.childNodes.length == 0) {\n\n // add the stars to the board\n for(let i=0; i<stars; i++) {\n let starItem = document.createElement('li');\n starItem.innerHTML = '<i class=\"fa fa-star\"></i>';\n starList.appendChild(starItem);\n }\n } else {\n // reset stars that alredy exist\n for(let i=0;i<stars; i++){\n starList.childNodes[i].innerHTML = '<i class=\"fa fa-star\"></i>';\n }\n }\n}", "title": "" }, { "docid": "b27bf54b8bd05bc3d8e5f976683ceb56", "score": "0.63621175", "text": "function rating () {\n if (moves < maxStars) {\n ratingStar = \"<i class= 'star fas fa-star'></i><i class= 'star fas fa-star'></i><i class='star fas fa-star'></i>\";\n } else if (moves < minStars) {\n stars[2].style.color = \"#444\";\n ratingStar = \"<i class='star fas fa-star'></i><i class= 'star fas fa-star'></i>\";\n } else {\n stars[1].style.color = \"#444\";\n ratingStar = \"<i class='star fas fa-star'></i>\";\n }\n}", "title": "" }, { "docid": "92decc2ecc3a831d0428bd0474eeb5a5", "score": "0.62698966", "text": "function getClassName() {\n if (isMine(row, col) && isGameOver()) { return \"square-mined\" }\n if (isRevealed(row, col)) { return \"square-clicked\"; }\n return \"square\";\n }", "title": "" }, { "docid": "453785e9c37d55386dccaadea0b68263", "score": "0.6260661", "text": "function initStars() {\n stars = 3;\n $('.stars i').removeClass(\"fa-star-o\");\n $('.stars i').addClass(\"fa-star\");\n updateStars();\n}", "title": "" }, { "docid": "f4488f2432b2cdfc07190e29135c964f", "score": "0.6251872", "text": "function star() {\r\n $('#channel-star').toggleClass(\"fas far\");\r\n \r\n}", "title": "" }, { "docid": "40fdd5ac72d8c541781c9196e1445fa0", "score": "0.6212644", "text": "function ratePlayer() {\n let starsChilds = stars.children('li');\n let starsClasses = 'fa-star fa-star-o';\n let rateNumber = moves === 16 ? 2 : moves === 20 ? 1 : null;\n $(starsChilds[rateNumber]).children('i').toggleClass(starsClasses);\n}", "title": "" }, { "docid": "7b2e9e2725cea55ddddf1bd9d914bed0", "score": "0.6193288", "text": "function stars() {\n starsNumber = 3;\n if (moves >= 10 && moves < 18) {\n thirdStar.classList.remove('fa-star', 'starColor');\n thirdStar.classList.add('fa-star-o');\n starsNumber = 2;\n } else if (moves >= 18) {\n secondStar.classList.remove('fa-star', 'starColor');\n secondStar.classList.add('fa-star-o');\n starsNumber = 1;\n }\n}", "title": "" }, { "docid": "978d2f3c4f8bbfcee5a90efb9e47ff14", "score": "0.61849976", "text": "function stars() {\n\tconst starar = star.getElementsByTagName('i');\n\tfor (i = 0; i < starar.length; i++) {\n\t\tif (moves > 14 && moves <= 19) {\n\t\t\tstarar[2].className = 'fa fa-star-o';\n\t\t\tstarnum = 2;\n\t\t} else if (moves > 19) {\n\t\t\tstarar[1].className = 'fa fa-star-o';\n\t\t\tstarnum = 1;\n//\t\t} else if (moves > 24) {\n//\t\t\tstarar[0].className = 'fa fa-star-o';\n//\t\t\tstarnum = 0;\n\t\t} else {\n\t\t\tstarar[0].className = 'fa fa-star';\n\t\t\tstarar[1].className = 'fa fa-star';\n\t\t\tstarar[2].className = 'fa fa-star';\n\t\t\tstarnum = 3;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "23612a04be6c72afc92c767f2979dac0", "score": "0.61688536", "text": "function starColor(){\n\tif(numOfMoves === 8){\n\t\t--numOfStars;\n\t\tstars[2].classList.remove(\"staryellow\");\n\t}\n\telse if(numOfMoves === 12){\n\t\t--numOfStars;\n\t\tstars[1].classList.remove(\"staryellow\");\n\t}\n\telse if(counterMacth === 18){\n\t\tstars[0].classList.remove(\"staryellow\");\n\t}\n}", "title": "" }, { "docid": "8b67ab072fa3e385302056cd855d2c34", "score": "0.6144562", "text": "function starColors(numStars){\n let starsClasses = document.getElementsByClassName(\"fa fa-star\");\n let sArray = Array.from(starsClasses);\n\n if (numStars>0){\n for (let i=5-numStars; i>0; i--){\n sArray[i-1].classList.replace(\"on\",\"off\");\n }\n }\n}", "title": "" }, { "docid": "a67f17359947441c7ccb079eaa15e045", "score": "0.6129152", "text": "function newStar () {\n\n\tlet body = document.getElementById('Body');\n\tlet star = document.createElement('div');\n\tstar.setAttribute('class', 'star');\n\tstar.setAttribute('oldL', 0);\n\tstar.setAttribute('oldT', 0);\n\tstar.setAttribute('lifetime', 0);\n\n\tsetStar (star, 0);\n\n\tallStars.push(star);\n\n\tbody.appendChild(star);\n}", "title": "" }, { "docid": "d94fdcb1b6165f18f98bbb7abfe03ddc", "score": "0.61265576", "text": "function star() {\r\n $('#channel-star').toggleClass('fas fa-star far fa-star');\r\n\r\n // #7 writing new Status of Star in the refering object\r\n currentChannel.starred = !currentChannel.starred\r\n\r\n $('#channels li:contains(' + currentChannel.name + ') .fa-star').toggleClass(\"fas far\");\r\n}", "title": "" }, { "docid": "6e0465986dd1837af76984f90448e45e", "score": "0.6123746", "text": "function hoverStarYellowToBlue(){\r\n for(var i = 0; i < star.length;i++){\r\n star[i].classList.replace(\"yellow\",\"blue\");\r\n }\r\n}", "title": "" }, { "docid": "4a58cda656d29b5d0bafc7bd2a2ccbb1", "score": "0.61165285", "text": "function createStar() {\n\tvar littleStar = new Star();\n\n\tvar left = littleStar.coordinates.x + 'px';\n\tvar top = littleStar.coordinates.y + 'px';\n\tvar width = littleStar.size.w + 'px';\n\tvar height = littleStar.size.h + 'px';\n\n\tvar $div = $('<div class=\"color star\"></div>');\n\n\t$($div).css(\"background-color\", \"white\");\n\t$($div).css(\"height\", height);\n\t$($div).css(\"width\", width);\n\t$($div).css(\"left\", left);\n\t$($div).css(\"top\", top);\n\n\t$('.night-sky').append($div);\n}", "title": "" }, { "docid": "372b7d43bc6d64a9ba62a6d596dc9f10", "score": "0.61151576", "text": "function createStars(starsCS) {\n for (let total = 5, current = starsCS; total > 0; --total) {\n if (current) {\n starsDis.push(\"fas fa-star\");\n --current;\n } else {\n starsDis.push(\"far fa-star\");\n }\n }\n }", "title": "" }, { "docid": "4a6d262eaf9b796ec216e49f4ef339e6", "score": "0.6114495", "text": "function starChange(star, flag){\n stars[star].classList.remove('fa-star', 'fa-star-half-o', 'fa-star-o');\n stars[star].classList.add(flag === 'h' ? 'fa-star-half-o' :\n flag === 'e' ? 'fa-star-o' : 'fa-star');\n}", "title": "" }, { "docid": "ea9c668b21bde670a3eca9915664724b", "score": "0.6114248", "text": "function reset_stars_select_classes() {\n grid_stars_select_stars_0_anchor.removeClass(\"stars_selected_star\");\n grid_stars_select_stars_1_anchor.removeClass(\"stars_selected_star\");\n grid_stars_select_stars_2_anchor.removeClass(\"stars_selected_star\");\n grid_stars_select_stars_3_anchor.removeClass(\"stars_selected_star\");\n grid_stars_select_stars_4_anchor.removeClass(\"stars_selected_star\");\n grid_stars_select_stars_5_anchor.removeClass(\"stars_selected_star\");\n \n grid_stars_select_stars_0_anchor.removeClass(\"stars_unselected_star\");\n grid_stars_select_stars_1_anchor.removeClass(\"stars_unselected_star\");\n grid_stars_select_stars_2_anchor.removeClass(\"stars_unselected_star\");\n grid_stars_select_stars_3_anchor.removeClass(\"stars_unselected_star\");\n grid_stars_select_stars_4_anchor.removeClass(\"stars_unselected_star\");\n grid_stars_select_stars_5_anchor.removeClass(\"stars_unselected_star\");\n \n if(meal.rating >= 1) {\n grid_stars_select_stars_1_anchor.attr('class', 'stars_selected_star');\n }\n else {\n grid_stars_select_stars_1_anchor.attr('class', 'stars_unselected_star');\n }\n \n if(meal.rating >= 2) {\n grid_stars_select_stars_2_anchor.attr('class', 'stars_selected_star');\n }\n else {\n grid_stars_select_stars_2_anchor.attr('class', 'stars_unselected_star');\n }\n \n if(meal.rating >= 3) {\n grid_stars_select_stars_3_anchor.attr('class', 'stars_selected_star');\n }\n else {\n grid_stars_select_stars_3_anchor.attr('class', 'stars_unselected_star');\n }\n if(meal.rating >= 4) {\n grid_stars_select_stars_4_anchor.attr('class', 'stars_selected_star');\n }\n else {\n grid_stars_select_stars_4_anchor.attr('class', 'stars_unselected_star');\n }\n if(meal.rating >= 5) {\n grid_stars_select_stars_5_anchor.attr('class', 'stars_selected_star');\n }\n else {\n grid_stars_select_stars_5_anchor.attr('class', 'stars_unselected_star');\n }\n }", "title": "" }, { "docid": "345e27e024c37577f2662524c98c802e", "score": "0.60946935", "text": "function setTileByClass(row, col, tile) {\n var rowStr = \".row\" + row;\n $(rowStr + \" .maze-square\").eq(col - 1).addClass(tile);\n}", "title": "" }, { "docid": "19988b7f960679d8bd560a90ea6adc76", "score": "0.60906696", "text": "function resetStars() {\n for (let i = 1; i < 3; i++) {\n starsChildren[i].firstElementChild.className = 'fa fa-star';\n }\n}", "title": "" }, { "docid": "244a72a276912765f032a2caf7ee5771", "score": "0.6069541", "text": "function setBoardHoverClass() {\n TheBoard.classList.remove(X_CLASS);\n TheBoard.classList.remove(CIRCLE_CLASS);\n if (circleTurn) {\n TheBoard.classList.add(CIRCLE_CLASS);\n } else {\n TheBoard.classList.add(X_CLASS);\n }\n}", "title": "" }, { "docid": "4f57e398c54c2c8fac41f9c7802083fe", "score": "0.6063143", "text": "function setBoard(player) {\n // set board\n board.classList.remove(X_CLASS);\n board.classList.remove(O_CLASS);\n board.classList.add(player);\n}", "title": "" }, { "docid": "7b935ca3615498aa0e4cabe98fa9d921", "score": "0.60631144", "text": "function starRating() {\n if (moves === 15) {\n starChanger[0].classList.add('hide');\n starChanger[3].classList.add('hide');\n starChanger[1].classList.add('silver');\n starChanger[4].classList.add('silver');\n starChanger[2].classList.add('silver');\n starChanger[5].classList.add('silver');\n\n } if (moves === 20) {\n starChanger[1].classList.add('hide');\n starChanger[4].classList.add('hide');\n starChanger[2].classList.add('bronze');\n starChanger[5].classList.add('bronze');\n }\n}", "title": "" }, { "docid": "81871e31e756c7afe4dfc953196a91f7", "score": "0.60544884", "text": "function updateStars(){\n for(let star in stars){\n if(counter > 8 && counter < 15){\n stars[2].classList.add('star-colour');\n totalStars = 2;\n }\n if(counter > 16){\n stars[1].classList.add('star-colour');\n totalStars = 1;\n }\n }\n}", "title": "" }, { "docid": "1682fee0ab7c4b6acf78e9532cccb5e7", "score": "0.6040432", "text": "function setStarRating(starsNumber) {\n if (starsNumber === 2) {\n stars[2].firstChild.classList.remove('fa-star');\n stars[2].firstChild.classList.add('fa-star-o');\n } else if (starsNumber === 1) {\n stars[1].firstChild.classList.remove('fa-star');\n stars[1].firstChild.classList.add('fa-star-o');\n } else if (starsNumber === 0) {\n stars[0].firstChild.classList.remove('fa-star');\n stars[0].firstChild.classList.add('fa-star-o');\n }\n}", "title": "" }, { "docid": "d94d125f912a1911c37ff2690f08f3a9", "score": "0.60329175", "text": "function setRating() {\r\n // Assigning Stars according to number of moves\r\n if (moves <= 12) {\r\n var stars = '<i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star\" aria-hidden=\"true\"></i>';\r\n } else if (moves <= 14) {\r\n var stars = '<i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-half-o\" aria-hidden=\"true\"></i>';\r\n } else if (moves <= 16) {\r\n var stars = '<i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i>';\r\n } else if (moves <= 18) {\r\n var stars = '<i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-half-o\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i>';\r\n } else if (moves <= 20) {\r\n var stars = '<i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i>';\r\n } else {\r\n var stars = '<i class=\"fa fa-star-half-o\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i>';\r\n }\r\n // Appending Stars\r\n $('.starsB').html(stars);\r\n }", "title": "" }, { "docid": "bca62ee160907070ca20bcfb64c32b95", "score": "0.60318255", "text": "function createStars() {\n debug(\"createStars\");\n\n for (let j = 0; j < 3; j++) {\n newLi = document.createElement('li');\n newIcon = document.createElement('i');\n stars = document.querySelector('.stars');\n\n newIcon.setAttribute(\"class\", \"fa fa-star\");\n stars.appendChild(newLi);\n stars.lastChild.appendChild(newIcon); \n }\n }", "title": "" }, { "docid": "252ae6c091cae55eb48c4a5e8dc0c377", "score": "0.6023705", "text": "function addStars(numStar){\r\n let div = document.createElement(\"div\");\r\n\r\n for(let i = 0; i < numStar; i++){\r\n\r\n let star = document.createElement(\"span\");\r\n star.className = \"fa fa-star checked\";\r\n console.log(star.class);\r\n div.appendChild(star);\r\n }\r\n\r\n let noStar = 5 -numStar;\r\n for(let i = 0; i < noStar; i++){\r\n let xStar = document.createElement(\"span\");\r\n xStar.className = \"fa fa-star\";\r\n div.appendChild(xStar);\r\n }\r\n return div;\r\n}", "title": "" }, { "docid": "45a87a4ac755c11f43c17a4a19741aab", "score": "0.6012566", "text": "addCardClasses(ind) {\n const\n name = [\"prev\", \"curr\", \"next\", \"nex2\"], // the placeholder names\n curr = this.state.current, // current\n clNa = name.map((n, i) => ind === curr + i - 1 ? n : \"\"), // get the name for the index \n clss = \"run-test__\" + clNa.join(\"\") + \"-card-div\"; // create className \n\n return clss + (this.state.animationIsOn ? \" \" + clss + \"--animation\" : \"\");\n }", "title": "" }, { "docid": "56d16360670db727f81d7ee95dd6f41e", "score": "0.6007053", "text": "function reviewStar(star){\n\tstarObject = document.getElementsByClassName('post-review-stars');\n\tdocument.getElementById('reviewStars').value = star;\n\n\tfor (var i = 5; star < i; i--){\n\t\tstarObject[i - 1].style.backgroundImage = \"url('../CAB230-Project/images/starempty.png')\";\n\t}\n\n\tfor (var i = 0; i < star; i++){\n\t\tstarObject[i].style.backgroundImage = \"url('../CAB230-Project/images/starfull.png')\";\t\n\t}\n}", "title": "" }, { "docid": "a681ab822a6c843a24f9f4f70b58e804", "score": "0.59916186", "text": "function setHoverClass() {\n const board = document.getElementById('board');\n board.classList.remove(X);\n board.classList.remove(CIRCLE);\n if (circleTurn) {\n board.classList.add(CIRCLE);\n } else {\n board.classList.add(X);\n }\n}", "title": "" }, { "docid": "4bbf3265b9f55fcc97eda615ede56e9f", "score": "0.59908617", "text": "function copyStars() {\n let starList = document.querySelector('.stars').childNodes;\n\n starList.forEach(function(i) {\n let content = document.querySelectorAll('.message')[2];\n let newSpan = document.createElement('span');\n let newIcon = document.createElement('i');\n \n newIcon.setAttribute(\"class\", i.lastChild.className);\n content.appendChild(newSpan);\n content.lastChild.appendChild(newIcon); \n })\n }", "title": "" }, { "docid": "36de606dc50a6ad2a2d842440d32be1e", "score": "0.59837615", "text": "addObject(pos, classes) {\n this.grid[pos].classList.add(...classes);\n }", "title": "" }, { "docid": "ca56b7b5947ea4d74b99beb09839de2c", "score": "0.5983702", "text": "function outputStars(newRating) {\n\tlet intRating = parseInt(newRating)\n\t\n\t$('#rating-stars i').each(function(i) {\n\t\tlet $this = $(this)\n\t\t$this.removeClass('user-rating')\n\t\tif (i < intRating) {\n\t\t\t$this.removeClass('far').addClass('fas')\n\t\t} else {\n\t\t\t$this.removeClass('fas').addClass('far')\n\t\t}\n\t})\n}", "title": "" }, { "docid": "97f5d3aa19ac7e67666d07d08d81fe21", "score": "0.5976377", "text": "function updateStars(numberOfStars) {\n\n // Creating the stars container object\n let stars = document.querySelector('.stars');\n\n stars.innerHTML = '';\n\n for (let i = 1; i <= numberOfStars; i++) {\n let starItem = document.createElement('li');\n let starContent = document.createElement('i');\n starContent.classList.add('fa', 'fa-star');\n starItem.appendChild(starContent);\n stars.appendChild(starItem);\n }\n}", "title": "" }, { "docid": "fdeecd4a481ade8309b8039dfdda2f18", "score": "0.59699166", "text": "function updateStars() {\n // if moves <=12 with 3 starts\n if (moves <= 12) {\n $('.stars .fa').addClass(\"fa-star\");\n stars = 3;\n } else if(moves >= 13 && moves <= 14){\n $('.stars li:last-child .fa').removeClass(\"fa-star\");\n $('.stars li:last-child .fa').addClass(\"fa-star-o\");\n stars = 2;\n } else if (moves >= 15 && moves <20){\n $('.stars li:nth-child(2) .fa').removeClass(\"fa-star\");\n $('.stars li:nth-child(2) .fa').addClass(\"fa-star-o\");\n stars = 1;\n } else if (moves >=20){\n $('.stars li .fa').removeClass(\"fa-star\");\n $('.stars li .fa').addClass(\"fa-star-o\");\n stars = 0;\n }\n $('.win-container .stars-number').text(stars);\n\n}", "title": "" }, { "docid": "b08f921190f8470abe651d088a8aa5fd", "score": "0.5961461", "text": "function stars ( number ) {\n var starList = $(\".fa.fa-star\");\n var firstStar = 18;\n var secondStar = 24;\n if (number === firstStar || number === secondStar){\n starList.last().attr(\"class\",\"fa fa-star-o\")\n }\n}", "title": "" }, { "docid": "0fb6829b002e8fe82a79965459f8489a", "score": "0.5956631", "text": "function classAdd(me, strin) {\n me.className += \" \" + strin;\n }", "title": "" }, { "docid": "679d0125df9e34d919ce5577d0737a3c", "score": "0.5953886", "text": "function setBoardHoverClass() {\n board.classList.remove(X_CLASS);\n board.classList.remove(CIRCLE_CLASS);\n if (circleTurn) {\n board.classList.add(CIRCLE_CLASS);\n } else {\n board.classList.add(X_CLASS);\n }\n}", "title": "" }, { "docid": "f3667314d50d9cf10110ccba2371ff70", "score": "0.59537566", "text": "function star() {\r\n /* use the font awesome class to replace the image for star icon*/\r\n $('#chat h1 i').toggleClass(\"fa-star-o\");\r\n $('#chat h1 i').toggleClass('fa-star');\r\n /* toggle the star status behind the apperance*/\r\n currentChannel.starred = !currentChannel.starred;\r\n /*find out where the currentChannel is in channel list and toggle the star status for apperance. */\r\n $('#channels li:contains(' + currentChannel.name + ') .fa').removeClass('fa-star fa-star-o');\r\n $('#channels li:contains(' + currentChannel.name + ') .fa').addClass(currentChannel.starred ? 'fa-star' : 'fa-star-o');\r\n}", "title": "" }, { "docid": "93d2b873351e67ddef72147fe379a896", "score": "0.594286", "text": "function setClassOver() {\r\n\tthis.className+=\" over\";\r\n}", "title": "" }, { "docid": "e3c179bc7762ee3330c1d5101116c3ff", "score": "0.59412825", "text": "setClass(el, classname) {\n el.className += ' ' + classname;\n }", "title": "" }, { "docid": "347f9569da49297170daf6c59b15a851", "score": "0.593747", "text": "function addClass(className, classColor = _via_color_array[_via_class_names.size % 6]){\n \n //checks for duplicates of class name, will not create class if class name already exists\n if (_via_class_names.has(className)){\n return;\n }\n if (className == \"\"){\n return;\n }\n else{\n _via_class_names.set(className,[0, classColor]);\n \n\n }\n\n //Create DOM elements for the class for buttons to edit the class\n document.getElementById(\"classes_label\").innerHTML = \"Classes \" + \" (\" + _via_class_names.size + \")\";\n var button = document.createElement(\"input\");\n var count = document.createElement(\"p\");\n var trash = document.createElementNS ('http://www.w3.org/2000/svg', \"svg\");\n var edit = document.createElementNS ('http://www.w3.org/2000/svg', \"svg\");\n var name_input = document.createElement(\"input\");\n var name_submit = document.createElement(\"input\");\n var dummy = document.createElement(\"p\");\n\n var colorswitch = document.createElement(\"div\");\n var colorpicker = document.createElement(\"div\");\n var colorwrapper = document.createElement(\"div\");\n colorwrapper.className = \"color-wrapper\";\n\n\n /*dummy to make sure every class starts on a separate line*/\n dummy.className = \"dummy\";\n colorswitch.className = \"class-color-holder\";\n colorswitch.id = className + \"_colorswitch\";\n colorpicker.id = className + \"_colorpicker\";\n colorpicker.className = \"color-picker\";\n\n colorswitch.style.background = _via_class_names.get(className)[1];\n\n var colorList = [ '#000000', '#993300', '#333300', '#003300', '#003366', '#000066', '#333399', '#333333', \n'#660000', '#FF6633', '#666633', '#336633', '#336666', '#0066FF', '#666699', '#666666', '#CC3333', '#FF9933', '#99CC33', \n'#669966', '#66CCCC', '#3366FF', '#663366', '#999999', '#CC66FF', '#FFCC33', '#FFFF66', '#99FF66', '#99CCCC', '#66CCFF', \n'#993366', '#CCCCCC', '#FF99CC', '#FFCC99', '#FFFF99', '#CCffCC', '#CCFFff', '#99CCFF', '#CC99FF', '#FFFFFF' ];\n\n var div_array = [];\n\n for (var i = 0; i < colorList.length; i++ ) {\n var li = document.createElement(\"li\");\n div_array.push(li);\n li.className = \"color-item\";\n li.style.backgroundColor = colorList[i];\n colorpicker.appendChild(li);\n\n //we have to make another array of objects now\n }\n\n for (var j = 0; j < div_array.length; j++){\n div_array[j].addEventListener(\"click\",function(){\n var click_count = _via_class_names.get(className)[0];\n var click_color = _via_class_names.get(className)[1];\n _via_class_names.set(className, [click_count, this.style.backgroundColor]);\n //change up the metadata now\n //iterate through image metadata of current image and see where the region has an id that matches w the selected class\n colorswitch.style.fill = this.style.backgroundColor;\n colorswitch.style.background = this.style.backgroundColor;\n colorpicker.style.display = \"none\";\n draw_all_regions();\n\n });\n }\n\n\n colorswitch.addEventListener(\"click\", function(){\n if (colorpicker.style.display == \"inline-block\"){\n colorpicker.style.display = \"none\";\n }\n else{\n colorpicker.style.display = \"inline-block\";\n }\n });\n colorpicker.style.display = \"none\";\n\n button.type = \"textbox\";\n button.readOnly = true;\n button.value = className;\n button.id = className + \"_via_btn\";\n button.className = \"bx--link _via_btn\";\n\n //eventually have it so class names can't include underscores so this can be unique and there are on conflicts\n count.id = className + \"_num\";\n count.value=0;\n count.innerHTML = \"(0)\";\n count.className = \"bx--link count_button\";\n\n trash.setAttribute('width','12');\n trash.setAttribute('height','16');\n trash.id = className + \"_del\";\n\n edit.setAttribute('width','40');\n edit.setAttribute('height','16');\n edit.id = className + \"_edit\";\n\n\n name_input.type = \"text\";\n name_input.id = className + \"_text\";\n name_input.className = \"name_changer\";\n\n name_submit.type = \"button\";\n name_submit.value = \"confirm change\";\n name_submit.id = className + \"_submit\";\n name_submit.className = \"name_changer\";\n\n var leftDiv = document.createElement(\"div\");\n\n\n var rightDiv = document.createElement(\"div\");\n leftDiv.className = \"left_labels\";\n rightDiv.className = \"right_labels\";\n var mainDiv = document.createElement(\"div\");\n mainDiv.className = \"mainDivs\";\n document.getElementById(\"classes_info\").appendChild(mainDiv);\n mainDiv.appendChild(leftDiv);\n mainDiv.appendChild(rightDiv);\n\n\n colorwrapper.appendChild(colorswitch);\n colorwrapper.appendChild(colorpicker);\n leftDiv.appendChild(colorwrapper);\n leftDiv.appendChild(button);\n rightDiv.appendChild(count);\n\n rightDiv.appendChild(edit);\n var path1 = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n\n path1.setAttribute('d','M2.032 10.924l7.99-7.99 2.97 2.97-7.99 7.99zm9.014-8.91l1.98-1.98 2.97 2.97-1.98 1.98zM0 16l3-1-2-2z');\n path1.setAttribute('fill','#3D6FB1');\n edit.appendChild(path1);\n\n rightDiv.appendChild(trash);\n path1 = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n var path2 = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n\n path1.setAttribute('d','M11 4v11c0 .6-.4 1-1 1H2c-.6 0-1-.4-1-1V4H0V3h12v1h-1zM2 4v11h8V4H2z');\n path1.setAttribute('fill','#3D6FB1');\n trash.appendChild(path1);\n\n path2.setAttribute('d','M4 6h1v7H4zm3 0h1v7H7zM3 1V0h6v1z');\n path2.setAttribute('fill','#3D6FB1');\n trash.appendChild(path2);\n\n\n rightDiv.appendChild(name_input);\n rightDiv.appendChild(name_submit);\n rightDiv.appendChild(dummy);\n mainDiv.style.zIndex = 1;\n colorpicker.style.zIndex = 1000;\n\n document.getElementById(\"draw_path_1\").style.fill = \"#3D70B2\";\n document.getElementById(\"draw_path_2\").style.stroke = \"#3D70B2\";\n document.getElementById(\"toolbar_draw\").style.backgroundColor = \"#e5e5e5\";\n\n\n attr_input_focus(className);\n if (_via_class_names.has(className)){\n _via_current_update_attribute_name = className;\n _via_current_shape = VIA_REGION_SHAPE.RECT;\n }\n else{\n _via_current_update_attribute_name = '';\n }\n var active_div = document.querySelector('.mainDivs.active');\n var active_btn = document.querySelector('._via_btn.active');\n //if any active btn\n if(active_div){\n //remove active class from it \n\n active_div.classList.remove('active');\n active_btn.classList.remove('active');\n active_div.style.backgroundColor = \"transparent\";\n active_btn.style.backgroundColor = \"transparent\";\n\n }\n\n mainDiv.classList.add('active');\n button.classList.add('active');\n mainDiv.style.backgroundColor = \"#dbe4f0\";\n button.style.backgroundColor = \"#dbe4f0\";\n turnOnShortcuts();\n\n mainDiv.addEventListener(\"mouseover\", function(){\n if (mainDiv.classList.contains('active')){\n return; \n }\n mainDiv.style.backgroundColor = \"#ECF1F7\";\n button.style.backgroundColor = \"#ECF1F7\";\n\n });\n\n mainDiv.addEventListener(\"mouseout\", function(){\n if (mainDiv.classList.contains('active')){\n return; \n }\n mainDiv.style.backgroundColor = \"transparent\";\n button.style.backgroundColor = \"transparent\";\n });\n \n mainDiv.addEventListener(\"click\", function(){\n attr_input_focus(className);\n if (_via_class_names.has(className)){\n _via_current_update_attribute_name = className;\n _via_current_shape = VIA_REGION_SHAPE.RECT;\n }\n else{\n _via_current_update_attribute_name = '';\n }\n var active_div = document.querySelector('.mainDivs.active');\n var active_btn = document.querySelector('._via_btn.active');\n if(active_div){\n //remove active class from it \n active_div.classList.remove('active');\n active_btn.classList.remove('active');\n active_div.style.backgroundColor = \"transparent\";\n active_btn.style.backgroundColor = \"transparent\";\n }\n\n mainDiv.classList.add('active');\n button.classList.add('active');\n mainDiv.style.backgroundColor = \"#dbe4f0\";\n button.style.backgroundColor = \"#dbe4f0\";\n document.getElementById(\"draw_path_1\").style.fill = \"#3D70B2\";\n document.getElementById(\"draw_path_2\").style.stroke = \"#3D70B2\";\n turnOnShortcuts();\n });\n\n //removal of class\n trash.addEventListener(\"click\", function(){\n var isActive = false;\n if (mainDiv.classList.contains('active')){\n mainDiv.classList.remove('active');\n isActive = true;\n _via_current_update_attribute_name = '';\n document.getElementById(\"draw_path_1\").style.fill = \"#9EB7D8\";\n document.getElementById(\"draw_path_2\").style.stroke = \"#9EB7D8\";\n\n }\n //go through the metadata and delete all of that as well as w the classes\n select_regions(className);\n del_sel_regions();\n //we have to make sure we account for the metadata too and the images in other pictures\n for (var x in _via_img_metadata){\n for (var i = 0; i < _via_img_metadata[x].regions.length; i++){\n if(_via_img_metadata[x].regions[i].region_attributes[\"name\"] == className){\n _via_img_metadata[x].regions.splice(i,1);\n i--;\n }\n\n }\n }\n\n trash.remove();\n button.remove();\n count.remove();\n edit.remove();\n name_input.remove();\n name_submit.remove();\n leftDiv.remove();\n rightDiv.remove();\n mainDiv.remove();\n\n _via_class_names.delete(className);\n document.getElementById(\"classes_label\").innerHTML = \"Classes \" + \" (\" + _via_class_names.size + \")\";\n\n if (isActive){\n _via_current_update_attribute_name = '';\n document.getElementById(\"draw_path_1\").style.fill = \"#9EB7D8\";\n document.getElementById(\"draw_path_2\").style.stroke = \"#9EB7D8\";\n }\n\n });\n\n edit.addEventListener(\"click\", function(){\n button.readOnly = false;\n button.focus();\n _via_changing_class = true;\n });\n\n button.addEventListener(\"focus\", function(){\n _via_is_user_adding_attribute_name = true;\n _via_is_user_updating_attribute_value = true;\n _via_is_user_updating_attribute_name = true;\n });\n\n button.addEventListener(\"blur\", function(){\n turnOnShortcuts();\n });\n button.addEventListener(\"change\", function(){\n\n\n if (_via_class_names.has(button.value)){\n show_message(\"name already exists\");\n button.value = className;\n return;\n }\n var classCount = _via_class_names.get(className)[0];\n var oldClassName = className;\n _via_class_names.set(button.value, [classCount, _via_class_names.get(className)[1]]);\n _via_class_names.delete(className);\n\n className = button.value;\n //next lets change up the metadata and the canvas region data and update the canvas\n //canvas region\n for (var i = 0; i < _via_canvas_regions.length; i++){\n \n if (_via_canvas_regions[i].region_attributes[\"name\"] == oldClassName){\n _via_canvas_regions[i].region_attributes[\"name\"] = className;\n }\n }\n for (var i = 0; i < _via_img_metadata[\"cars.png62201\"].regions.length; i++){\n \n if (_via_img_metadata[\"cars.png62201\"].regions[i].region_attributes[\"name\"] == oldClassName){\n _via_img_metadata[\"cars.png62201\"].regions[i].region_attributes[\"name\"] = className;\n }\n }\n\n for (var i = 0; i < _via_img_metadata[\"lot.jpeg71862\"].regions.length; i++){\n \n if (_via_img_metadata[\"lot.jpeg71862\"].regions[i].region_attributes[\"name\"] == oldClassName){\n _via_img_metadata[\"lot.jpeg71862\"].regions[i].region_attributes[\"name\"] = className;\n }\n }\n\n for (var i = 0; i < _via_img_metadata[\"outside.jpeg21513\"].regions.length; i++){\n \n if (_via_img_metadata[\"outside.jpeg21513\"].regions[i].region_attributes[\"name\"] == oldClassName){\n _via_img_metadata[\"outside.jpeg21513\"].regions[i].region_attributes[\"name\"] = className;\n }\n }\n //we have to update labels as well as the canvas\n button.value = className;\n button.id = className + \"_via_btn\";\n count.id = className + \"_num\";\n trash.id = className + \"_del\";\n edit.id = className + \"_edit\";\n name_input.id = className + \"_text\";\n name_submit.id = className + \"_submit\";\n button.readOnly = true;\n var active_btn = document.querySelector('.class_button.active');\n \n //if any active btn\n if(active_btn){\n //remove active class from it \n active_btn.classList.remove('active');\n }\n\n button.classList.add('active');\n attr_input_focus(className);\n _via_changing_class = false;\n\n\n turnOnShortcuts();\n\n });\n\n}", "title": "" }, { "docid": "07ade52eb17b51a8c13f6d2eb9a8e1e9", "score": "0.59317315", "text": "function updateStars() {\n\t{\n\t\t$(\".fa-star\").last().attr(\"class\", \"fa fa-star-o\");\n\t\tif (numStars > 0)\n\t\t{\n\t\t\tnumStars--;\n\t\t}\n\t\t$(\".numStars\").text(numStars);\n\t}\n}", "title": "" }, { "docid": "d3b886f6578d62bfb26b708b020a7522", "score": "0.59302497", "text": "function star() {\r\n //$('#channel-star').attr('src', 'http://ip.lfe.mw.tum.de/sections/star.png');\r\n $('#channel-star').toggleClass('fas far');\r\n\r\n}", "title": "" }, { "docid": "722bb18a2df3826c977760e349227cf5", "score": "0.5929267", "text": "function initStars(){\n let stars = document.getElementById(\"stars\");\n for (let i=1; i<6; i++){\n let li = document.createElement(\"li\");\n let i = document.createElement(\"i\");\n stars.appendChild(li);\n i.className=\"fa fa-star on\";\n li.appendChild(i);\n }\n}", "title": "" }, { "docid": "23b5ef7bcfb3a091ae027c883fff2950", "score": "0.59254456", "text": "function rating() {\n\tconst star1 = document.getElementById(\"one-star\");\n\tconst star2 = document.getElementById(\"two-star\");\n\tconst star3 = document.getElementById(\"three-star\");\n\t// change stars style depending on number of moves\n\tif (moveCounter == 18) {\n\t\tstar1.classList.remove(\"fas\");\n\t\tstar1.classList.add(\"far\");\n\t} else if (moveCounter == 16){\n\t\tstar2.classList.remove(\"fas\");\n\t\tstar2.classList.add(\"far\");\n\t} else if (moveCounter == 14) {\n\t\tstar3.classList.remove(\"fas\");\n\t\tstar3.classList.add(\"far\");\n\t} else {\n\t\t\n\t}\n}", "title": "" }, { "docid": "82e1cc77bc66b75fbf1c259fb02c7b8a", "score": "0.59251535", "text": "function starRating() {\n let lastStar;\n let lastModalStar;\n const deckStars = document.querySelectorAll('.stars .fa-star')\n const modalStars = document.querySelectorAll('.winStars .fa-star')\n if (moves === 33) {\n lastStar = deckStars[2];\n lastModalStar = modalStars[2];\n } else if (moves === 45) {\n lastStar = deckStars[1];\n lastModalStar = modalStars[1];\n } else if (moves === 52) {\n lastStar = deckStars[0];\n lastModalStar = modalStars[0];\n }\n if (lastStar !== undefined) {\n lastStar.classList.replace('fa-star', 'fa-star-o');\n lastModalStar.classList.replace('fa-star', 'fa-star-o');\n }\n}", "title": "" }, { "docid": "4208f1c56a142e43ab5dea89de6a827f", "score": "0.59210587", "text": "function starRemoval(){\n\tstars = document.querySelectorAll('.fa-star');\n\tstarCount = countMoves;\n\tswitch (starCount) {\n\t\tcase 10:\n\t\t\tstars[stars.length-1].className='fa fa-star-o';\n\t\t\tbreak;\n\t\tcase 13:\n\t\t\tstars[stars.length-1].className='fa fa-star-o';\n\t\t\tbreak;\n\t\tcase 16:\n\t\t\tstars[stars.length-1].className='fa fa-star-o';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "106df88d5149ad5681f70792be0f56bf", "score": "0.5919041", "text": "function resetStars(){\n\tmanipulateStarClassesFromBackToFront(0, 'fa fa-star', panelStars, modalStars);\n}", "title": "" }, { "docid": "096ab373b4606862c3e180f8b7f4d75a", "score": "0.5910016", "text": "_setClassNames() {\n const classNames = ['osjs-window', ...this.attributes.classNames];\n if (this.id) {\n classNames.push(`Window_${this.id}`);\n }\n\n classNames.filter(val => !!val)\n .forEach((val) => this.$element.classList.add(val));\n }", "title": "" }, { "docid": "cd9114d5d90c851d3c809db23554b790", "score": "0.5906664", "text": "function resetStarRating() {\n stars[1].classList.remove(\"fa-star-o\");\n stars[1].classList.add(\"fa-star\");\n stars[2].classList.remove(\"fa-star-o\");\n stars[2].classList.add(\"fa-star\");\n rating = 3;\n}", "title": "" }, { "docid": "7e3bc8b8bdd4faff6137292a691fdfb6", "score": "0.59054554", "text": "function rating(){\n if (moves.innerHTML > 7 && moves.innerHTML <= 10){\n uls[0].children[0].firstChild.className = \"fa fa-star-o\";\n } else if ( moves.innerHTML > 10 && moves.innerHTML <=20) {\n uls[0].children[1].firstChild.className = \"fa fa-star-o\";\n }\n else {\n checLose();\n }\n }", "title": "" }, { "docid": "7a0d47a1c8bc9deccde390d1d739931f", "score": "0.5904995", "text": "function addSwatchColorClassName(el, color) {\n el.className += ' hss-x-' + color.toLowerCase().replace(/\\s+/g, '-');\n}", "title": "" }, { "docid": "a0061383ddd49995a8af229ab62defe9", "score": "0.5897065", "text": "function setBoardHoverClass(){\n board.classList.remove(X_CLASS);\n board.classList.remove(CIRCLE_CLASS);\n\n if (circleTurn) {\n board.classList.add(CIRCLE_CLASS);\n } else {\n board.classList.add(X_CLASS);\n }\n}", "title": "" }, { "docid": "ee358b0551def6c6f9c4b153618b8080", "score": "0.58959645", "text": "function starRating(moves) {\n if (moves >= 12 && moves < 18) {\n starCount.childNodes[5].childNodes[0].className = 'fa fa-star-o';\n } else if (moves >= 18) {\n starCount.childNodes[3].childNodes[0].className = 'fa fa-star-o';\n }\n return starCount;\n}", "title": "" }, { "docid": "b3745cb2601dcd8dea7a5cd20d600f2d", "score": "0.58813095", "text": "function finalRating(){\n let stars = $(\".fa-star\");\n $(stars[stars.length-1]).toggleClass(\"fa-star fa-star-o\");\n}", "title": "" }, { "docid": "3942ca5bba22f37e0ae43959d48326cb", "score": "0.5876599", "text": "function starRating() {\n var starsTracker = starsPanel.getElementsByTagName('i');\n\n // If game finished in 11 moves or less, return and star rating remains at 3\n if (moves <= 11) {\n return;\n // If finished between 11 to 16 moves, 3rd colored star is replaced with empty star class\n } else if (moves > 11 && moves <= 16) {\n starsTracker.item(2).className = 'fa fa-star-o';\n // If finished with more than 16 moves, 2nd colored star is replaced with empty star class\n } else {\n starsTracker.item(1).className = 'fa fa-star-o';\n }\n\n // Update stars variable by counting length of remaining colored star elements\n stars = document.querySelectorAll('.fa-star').length;\n}", "title": "" }, { "docid": "3cb49204cc7a58988a9ee1489367b59f", "score": "0.5875964", "text": "function starChange(star){\n\tstarNumber = star;\n\tvar starButtons = document.getElementsByClassName(\"stars\");\n\t\n\tfor (var i = 0; i < starNumber ; i++){\n\t\tstarButtons[i].style.backgroundImage = \"url('../CAB230-Project/images/starfull.png')\";\n\t\tif (starNumber == 1){\n\t\t\tstarratingValue.innerHTML = \"ANY RATING\";\n\t\t\tstarValue.value = 0;\n\t\t\tstarButtons[i].style.backgroundImage = \"url('../CAB230-Project/images/starempty.png')\";\n\t\t}\n\t\t\n\t\telse if(starNumber == 5)\n\t\t{\n\t\t\tstarratingValue.innerHTML = (starNumber) + \" STARS\";\n\t\t\tstarValue.value = 5;\n\t\t}\n\t\t\n\t\telse{\n\t\t\tstarratingValue.innerHTML = (starNumber) + \"+ STARS\";\n\t\t\tstarValue.value = starNumber;\n\t\t}\n\t}\n\tfor (var j = starNumber; j < 5; j++){\n\t\tstarButtons[j].style.backgroundImage = \"url('../CAB230-Project/images/starempty.png')\";\n\t}\t\n}", "title": "" }, { "docid": "b3c6cdc70968f4a1e0339284cfc95a49", "score": "0.5872368", "text": "function createStars(number){\n\tif (number === 3){\n\t\t// Create 3 stars\n\t\tstars.innerHTML = \"<li><i class='fa fa-star'></i></li><li><i class='fa fa-star'></i></li><li><i class='fa fa-star'></i></li>\";\n\t} else if (number === 2){\n\t\t// Create 2 stars\n\t\tstars.innerHTML = \"<li><i class='fa fa-star'></i></li><li><i class='fa fa-star'></i></li>\";\n\t} else {\n\t\t// Create 1star\n\t\tstars.innerHTML = \"<li><i class='fa fa-star'></i></li>\";\n\t}\n}", "title": "" }, { "docid": "d0bfad8ed950c204e5c0b71d8a858bc8", "score": "0.5861628", "text": "function add(ths, sno) {\n\n\n for (var i = 1; i <= 5; i++) {\n var cur = document.getElementById(\"star\" + i)\n cur.className = \"fa fa-star\"\n }\n\n for (var i = 1; i <= sno; i++) {\n var cur = document.getElementById(\"star\" + i)\n if (cur.className == \"fa fa-star\") {\n cur.className = \"fa fa-star checked\"\n }\n }\n\n}", "title": "" }, { "docid": "5df5495473505453dcc53dd815b3f62b", "score": "0.58576155", "text": "function starClicked(starId) {\n setStarCount(starId)\n\n for (let j = starId; j < 6; j++) {\n let starIcon = $('#star_' + (j + 1))\n starIcon.addClass('disabled')\n starIcon.removeClass('active')\n }\n for (let j = 1; j <= starId; j++) {\n let starIcon = $('#star_' + j)\n starIcon.addClass('active')\n starIcon.removeClass('disabled')\n }\n }", "title": "" }, { "docid": "71c12ad5c28b10d8926177dcca552c74", "score": "0.5854182", "text": "function changeClass(currentClassName, newClassName){\n let cardsToChange = document.getElementsByClassName(currentClassName);\n cardsToChange[0].parentElement.className = newClassName;\n cardsToChange[1].parentElement.className = newClassName;\n\n if (newClassName === \"card\") {\n //enable mouse events for cards that are not open / matched yet\n var allCards = document.getElementsByClassName(\"card\");\n for (var i = 0; i < allCards.length; i++) {\n if (openCards.indexOf(allCards[i].firstElementChild.className) === -1) {\n allCards[i].style.pointerEvents = \"auto\";\n }\n }\n }\n}", "title": "" }, { "docid": "de60d88ffc109fa72b7c333bdaec4925", "score": "0.5851372", "text": "function setBoardHoverClass(){\n board.classList.remove(X_CLASS)\n board.classList.remove(CIRCLE_CLASS)\n if(circleTurn){\n board.classList.add(CIRCLE_CLASS)\n }\n else{\n board.classList.add(X_CLASS)\n }\n}", "title": "" }, { "docid": "f14e4ef2893de859e3f0657e15b8039f", "score": "0.5845983", "text": "function removeStar() {\n $('.fa-star').last().attr('class', 'fa fa-star-o');\n numStars--;\n}", "title": "" }, { "docid": "26bf84bec5e45e60bb36b60e6f3719aa", "score": "0.5838466", "text": "function resetStarRating() {\n //loop through all the stars and set the icon\n for (let i = 0; i < stars.length; i++) {\n let s = stars[i].firstChild;\n s.classList.remove('fa-star-o');\n s.classList.add('fa-star');\n }\n}", "title": "" }, { "docid": "fd1c373812ba56d5c7ca97e21ee05812", "score": "0.5836826", "text": "function svgChangeClass() {\n for (c of classes) {\n if (classesSelection.value == c) { \n classIcon.setAttribute(\"src\", `./img/classes/${c}.svg`);\n }\n }\n }", "title": "" }, { "docid": "09d2a2e96309999a9b0487e0bb680f45", "score": "0.5832367", "text": "function setStars() {\n /*Grabs the section in the html that has the moves count and updates it based on moves variable. */\n document.getElementById(\"moves\").textContent = moves;\n /*Conditional used to determine what stars to display depending on the number of moves/2clicks occur. */\n if (moves <= 10){\n starsRating = 3;\n return;\n } \n /*Grabs stars elements so that later the classes can be manipulated to display clear starts instead of full stars. */\n let stars = document.getElementById(\"stars\").children;\n /*If the user has taken over 10 moves/2 clicks, then one star is replaced with a star outline. */\n stars[2].firstElementChild.classList.remove(\"fa-star\");\n stars[2].firstElementChild.classList.add(\"fa-star-o\");\n if (moves <= 20){\n starsRating = 2;\n return;\n } \n /*If the user has taken over 20 moves/2 clicks, then an addional star is repalced with a star outline. */\n stars[1].firstElementChild.classList.remove(\"fa-star\");\n stars[1].firstElementChild.classList.add(\"fa-star-o\");\n if (moves <= 30) {\n starsRating = 1;\n return;\n } \n}", "title": "" }, { "docid": "c9a11d156d92b232a9f29705180ec28d", "score": "0.5831931", "text": "function updateRating() {\n //Rating game based on move count\n if (numMoves == (moves_to_two_stars)) {\n stars[2].classList.remove(\"fa-star\");\n stars[2].classList.add(\"fa-star-o\");\n rating = 2;\n }\n else if (numMoves == (moves_to_one_star)) {\n stars[1].classList.remove(\"fa-star\");\n stars[1].classList.add(\"fa-star-o\");\n rating = 1;\n }\n}", "title": "" }, { "docid": "2b10e8acd77fd65bbc8bd8bcba4d772e", "score": "0.58298224", "text": "ReplaceClass(node, className) {\n node.className = className;\n }", "title": "" }, { "docid": "7f4d78e9386fadc946998e6d90dc18e6", "score": "0.58278054", "text": "function setInfoTandR()\r\n{\r\n\tif(movecount < 31){\r\n\t\tstarcount = 3;\r\n\t}\r\n\telse if(movecount > 30 && movecount < 51){\r\n\t\tstarcount = 2;\r\n\t}\r\n\telse{\r\n\t\tstarcount = 1;\r\n\t}\r\n\tge = document.getElementById(\"stars\");\r\n\tge.innerHTML=\"\";\r\n\t\r\n\tfor (var j = 0; j < this.starcount; j++){\r\n\t\tvar a = document.createElement('span');\r\n\t\ta.innerHTML=star_img_tag;\r\n\t\tge.appendChild(a);\r\n\t}\r\n\t++totalsecscount;\r\n game_secs = format_time(totalsecscount%60);\r\n game_mins = format_time(parseInt(totalsecscount/60));\r\n\tgametime.innerHTML= game_mins+\":\"+game_secs;\r\n}", "title": "" }, { "docid": "15d2c5f743fd06b348c3bbe361f0aaf2", "score": "0.5823147", "text": "function resetBoard() {\n $(\".card\").attr(\"class\",\"card\");\n $(\".card\").removeAttr(\"style\")\n $(\".moves\").text(0);\n $(\".stars li i\").attr(\"class\",\"fa fa-star\");\n $(\".container\").removeAttr(\"style\");\n}", "title": "" }, { "docid": "8ad7b62ad9bb59fa9a1e2dba6dd71315", "score": "0.5822963", "text": "function handdrawn() {\n\tdocument.getElementById('custom').className = 'handdrawn';\n}", "title": "" }, { "docid": "745d1fc45af082891fc72b51da7f6e03", "score": "0.581453", "text": "function displayColorPopcorn(classname, num) {\n var pop = document.getElementsByClassName(classname);\n resetPop(classname);\n var classTarget = \".\" + classname;\n changePopcornImage(num, classTarget);\n}", "title": "" }, { "docid": "515a944a34f7b8c92ab6baf8bc926248", "score": "0.5814339", "text": "function clearAllStars(){\n\tdocument.getElementById(\"1\").className = \"glyphicon glyphicon-star-empty\";\n\tdocument.getElementById(\"2\").className = \"glyphicon glyphicon-star-empty\";\n\tdocument.getElementById(\"3\").className = \"glyphicon glyphicon-star-empty\";\n\tdocument.getElementById(\"4\").className = \"glyphicon glyphicon-star-empty\";\n\tdocument.getElementById(\"5\").className = \"glyphicon glyphicon-star-empty\";\n\t\n\tdocument.getElementById(\"1\").style.color = \"black\";\n\tdocument.getElementById(\"2\").style.color = \"black\";\n\tdocument.getElementById(\"3\").style.color = \"black\";\n\tdocument.getElementById(\"4\").style.color = \"black\";\n\tdocument.getElementById(\"5\").style.color = \"black\";\n\t\n}", "title": "" }, { "docid": "5ed6bc5f8e7288e439ed46dac506476d", "score": "0.5812486", "text": "function placeMark(cell, currentClass) {\n\tcell.classList.add(currentClass)\n}", "title": "" }, { "docid": "91df9852d0467895e3a442f4a7bb77e9", "score": "0.5804992", "text": "function Hover() {\n const i = this.getAttribute(\"val\");\n if (i != -1)\n for (let x = i - 1; x >= 0; --x)\n stars[x].classList.add(\"goldc\");\n}", "title": "" }, { "docid": "8239b6114d019c5419fc6b0048c4306f", "score": "0.58030367", "text": "function star() {\r\n $('#channel-staro').toggleClass('fa fa-star');\r\n $('#channel-staro').toggleClass('fa fa-star-o');\r\n \r\n CurrentChannel.starred = !CurrentChannel.starred; \r\n}", "title": "" }, { "docid": "3350c21a444f1ddb0d653e6dab4cb1a1", "score": "0.57805127", "text": "function createNewStar() {\n if (stars_player1.length < settings.numberOfStars) {\n stars_player1.push(new Star('player1'));\n }\n if (stars_player2.length < settings.numberOfStars) {\n stars_player2.push(new Star('player2'));\n }\n }", "title": "" }, { "docid": "5ab172d36e2f9b226ca57d35617082ab", "score": "0.57789457", "text": "function placeMark( cell, currentClass){\n cell.classList.add(currentClass)\n}", "title": "" }, { "docid": "306c7ea09cdf77a011e37a2f05f07293", "score": "0.5755957", "text": "function star(numOfMove){\n\t noMoves = numOfMove; \n\t let stars = document.querySelector(\".stars\");\n\t if(numOfMove>50){\n\t \tnoStar=1;\n stars.innerHTML = `<li><i class=\"fa fa-star\"></i></li>`;\n\t }\n\t else if (numOfMove>30){\n\t \tnoStar=2;\n\t \tstars.innerHTML = `<li><i class=\"fa fa-star\"></i></li><li><i class=\"fa fa-star\"></i></li>`;\n\t }\n\t else{\n\t \tnoStar=3;\n\t\tstars.innerHTML = `<li><i class=\"fa fa-star\"></i></li><li><i class=\"fa fa-star\"></i></li><li><i class=\"fa fa-star\"></i></li>`;\n\t }\n}", "title": "" }, { "docid": "907c8967a4de2b394ea5dc6b25ed9359", "score": "0.57557315", "text": "createStars(space){\n for(var x = 100; x < space.starFieldWidth; x+= 150 )\n for(var y = 100; y < space.starFieldHeight; y += 150)\n space.stars.push(new Star(x, y));\n }", "title": "" }, { "docid": "54a1efdee42c25162202610e33cb1e5a", "score": "0.5748083", "text": "function test_board() {\n var list = ['water','miss','hit','boat']\n for (var r=1;r<11;r++) {\n for (var c=1;c<11;c++) {\n var coord = 'you_c'+c+'r'+r\n var el = document.getElementById(coord)\n var num = (c*10+r)%list.length\n el.className = list[num]\n }\n }\n}", "title": "" }, { "docid": "123412ad08a1083b16e257d4f58f2ab2", "score": "0.5746485", "text": "function starRating() {\n if (moves > 13 && moves < 16) {\n starCounter = 3;\n } else if (moves > 17 && moves < 27) {\n starCounter = 2;\n } else if (moves > 28) {\n starCounter = 1;\n }\n showStars(starCounter);\n }", "title": "" }, { "docid": "91acd560787b09b376ccb7ca7404ae0f", "score": "0.57351995", "text": "function assignClasses(array) {\n for(let i = 0; i <= squares.length-1; i++) {\n squares[i].classList.add(array[i])\n }\n}", "title": "" }, { "docid": "4a609d5508833c82a523407fb9092aa9", "score": "0.5724816", "text": "function displayStars(num) {\n var starLevelTemplate = '<li><i class=\"fa fa-star fa-3x animated bounceIn\"></i></li>';\n var starTemplate = '<li><i class=\"fa fa-star \"></i></li>';\n $(\"#starLevel\").empty();\n $(\".stars\").empty();\n for (var i = 0; i < num; i++) {\n $(\".stars\").append(starTemplate);\n $(\"#starLevel\").append(starLevelTemplate)\n }\n }", "title": "" }, { "docid": "7b1ba578ba728cfbe90116e2902478f8", "score": "0.57135504", "text": "function rating() {\n 'use strict'; // turn on Strict Mode\n if (moves > 10 && moves < 19) {\n stars[2].classList.remove('fa-star');\n stars[2].classList.add('fa-star-o');\n starsRating = 2;\n } else if (moves > 20) {\n stars[1].classList.remove('fa-star');\n stars[1].classList.add('fa-star-o');\n starsRating = 1;\n }\n}", "title": "" }, { "docid": "eeaa76e7423fb79baa2d101bf383ebdc", "score": "0.570948", "text": "function switchScreensClasses(requestedScreenName) {\n if (requestedScreenName === \"newMsg\") {\n setNewMsgClass(\"row\")\n setCurrentMsgClass(\"row hide\")\n } else {\n setNewMsgClass(\"row hide\")\n setCurrentMsgClass(\"row\")\n }\n }", "title": "" }, { "docid": "bb924349da0f7eb6d4bc814aa907369a", "score": "0.57028127", "text": "function displayIcon(card){\n card.className +=\" \"+\"show open\"; \n}", "title": "" }, { "docid": "550317396289d280c27370dea0111dd2", "score": "0.56973326", "text": "function stars() {\n if (numberOfMoves === 14) {\n star[2].style.color = '#ccc';\n }\n if (numberOfMoves === 22) {\n star[1].style.color = '#ccc';\n }\n}", "title": "" }, { "docid": "550317396289d280c27370dea0111dd2", "score": "0.56973326", "text": "function stars() {\n if (numberOfMoves === 14) {\n star[2].style.color = '#ccc';\n }\n if (numberOfMoves === 22) {\n star[1].style.color = '#ccc';\n }\n}", "title": "" }, { "docid": "3233c2595a6bf1b4c6ac40b34b13459a", "score": "0.5696315", "text": "function draw() {\n current.forEach(index => {\n squares[currentPosition + index].classList.add('tetromino');\n })\n}", "title": "" }, { "docid": "f283e05a98615f20e686e8af9e3880a2", "score": "0.5691607", "text": "function fillStarsTill(starNo){\n\tclearAllStars();\n\t\n\tif(starNo == 1){\n\t\tdocument.getElementById(\"1\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"1\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"starRating\").value = \"1\";\n\t}\n\t\n\tif(starNo == 2){\n\t\tdocument.getElementById(\"1\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"1\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"2\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"2\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"starRating\").value = \"2\";\n\t}\n\t\n\tif(starNo == 3){\n\t\tdocument.getElementById(\"1\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"1\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"2\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"2\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"3\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"3\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"starRating\").value = \"3\";\n\t}\n\t\n\tif(starNo == 4){\n\t\tdocument.getElementById(\"1\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"1\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"2\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"2\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"3\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"3\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"4\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"4\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"starRating\").value = \"4\";\n\t}\n\t\n\tif(starNo == 5){\n\t\tdocument.getElementById(\"1\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"1\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"2\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"2\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"3\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"3\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"4\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"4\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"5\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"5\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"starRating\").value = \"5\";\n\t}\n}", "title": "" }, { "docid": "7415d41a5fb25a5d7bfafcc1d1c48932", "score": "0.56847847", "text": "function rating(){\n //// TODO: Bug has been fixed\n if (!cardCouple[0].classList.contains('match') && !cardCouple[1].classList.contains('match')){\n moves.innerText++;\n }\n if (moves.innerText > 14){\n document.querySelector('.stars li:nth-child(1)').classList.add('starDown');\n }\n else if (moves.innerText > 20){\n document.querySelector('.stars li:nth-child(2)').classList.add('starDown');\n }\n}", "title": "" }, { "docid": "cf767facb4b3e33170cc3f28f26cf465", "score": "0.5674593", "text": "function addStars(name, vote){\r\n var outputArea = document.getElementsByClassName('star-box-rating-widget');\r\n var pos = outputArea[0].parentNode; \r\n \r\n var starWidget = c('div');\r\n starWidget.class = 'star-box-rating-widget';\r\n pos.appendChild(starWidget);\r\n \r\n var html = '';\r\n html += '<span class=\"star-box-rating-label\" style=\"margin-left: 70px\">'+name+': </span>';\r\n html += '<div class=\"rating rating-list\" style=\"float: right\">';\r\n html += '<span class=\"rating-bg\">&nbsp;</span>';\r\n html += '<span class=\"rating-imdb rating-your\" style=\"width: 0px\">&nbsp;</span>';\r\n html += '<span class=\"rating-stars\">';\r\n html += '<div class=\"rating-your\" style=\"width: '+(vote*14)+'px\"></div>';\r\n html += '</span>';\r\n html += '<span class=\"rating-rating rating-your\">';\r\n html += '<span class=\"value\">'+vote+'</span>';\r\n html += '<span class=\"grey\">/</span>';\r\n html += '<span class=\"grey\">10</span>';\r\n html += '</span>';\r\n html += '&nbsp;';\r\n html += '</div>';\r\n html += '<div style=\"clear: right\">';\r\n \r\n starWidget.innerHTML = html;\r\n}", "title": "" }, { "docid": "941321e1c720e5a5825bdeac233cca51", "score": "0.5668057", "text": "function reset_stars_select_classes_hover() {\n grid_stars_select_stars_0_anchor.removeClass(\"stars_unselected_star_hover\");\n grid_stars_select_stars_1_anchor.removeClass(\"stars_unselected_star_hover\");\n grid_stars_select_stars_2_anchor.removeClass(\"stars_unselected_star_hover\");\n grid_stars_select_stars_3_anchor.removeClass(\"stars_unselected_star_hover\");\n grid_stars_select_stars_4_anchor.removeClass(\"stars_unselected_star_hover\");\n grid_stars_select_stars_5_anchor.removeClass(\"stars_unselected_star_hover\");\n \n grid_stars_select_stars_0_anchor.removeClass(\"stars_selected_star_hover\");\n grid_stars_select_stars_1_anchor.removeClass(\"stars_selected_star_hover\");\n grid_stars_select_stars_2_anchor.removeClass(\"stars_selected_star_hover\");\n grid_stars_select_stars_3_anchor.removeClass(\"stars_selected_star_hover\");\n grid_stars_select_stars_4_anchor.removeClass(\"stars_selected_star_hover\");\n grid_stars_select_stars_5_anchor.removeClass(\"stars_selected_star_hover\");\n }", "title": "" } ]
d487a5184884f9f61b2f32a5b7ec4d85
Makes the text file
[ { "docid": "fd165248f4c60462def3f86b1a2f1efa", "score": "0.0", "text": "function checkIt(){\nvar textFile = null,\n makeTextFile = function (text) {\n var data = new Blob([text], {type: 'text/plain'});\n\n // If we are replacing a previously generated file we need to\n // manually revoke the object URL to avoid memory leaks.\n if (textFile !== null) {\n window.URL.revokeObjectURL(textFile);\n }\n\n textFile = window.URL.createObjectURL(data);\n\n return textFile;\n };\n var create = document.getElementById(\"create\");\n\n create.addEventListener('click', function () {\n var link = document.getElementById('downloadlink');\n link.href = makeTextFile(getCurrentState());\n link.style.display = 'block';\n }, false);\n}", "title": "" } ]
[ { "docid": "23accfa8ef34dd823f50856121cf5341", "score": "0.68684024", "text": "function writeToText(filename, data) {\n fs.writeFile('License.txt', filename(data), (err) => {\n if (err) throw err;\n console.log('License text successfully created!')\n });\n}", "title": "" }, { "docid": "758079af43cd5ec5365a9b2f4601a30c", "score": "0.6729158", "text": "function file(filename, text){\n\tfs.writeFileSync( filename, text, function(err){\n\t\tif(err){\n\t\t\treturn print(err);\n\t\t}\n\t} );\n}", "title": "" }, { "docid": "0cbdebc3fe9350e1faa4023efd7f4622", "score": "0.66247755", "text": "function makeText(path) {\n fs.readFile(path, \"utf8\", function cb(err, data) {\n if (err) {\n console.error(`Cannot read file: ${path}: ${err}`);\n process.exit(1);\n } else {\n markovText(data);\n }\n });\n \n }", "title": "" }, { "docid": "91f5b319bc76071d05edc52b2625ff9f", "score": "0.64597356", "text": "function createNewFile(filename) {\n fs.writeFile(filename + '.txt', 'You are awesome', function (err) {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "73689128a269d8f1602e4144d9acee03", "score": "0.63823414", "text": "function writeTextDataToFile(text) {\n var textFile = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];\n\n\n var data = new Blob([text], { type: 'text/plain' });\n\n // If we are replacing a previously generated file we need to\n // manually revoke the object URL to avoid memory leaks.\n if (textFile !== null) {\n window.URL.revokeObjectURL(textFile);\n }\n\n textFile = window.URL.createObjectURL(data);\n\n // returns a URL you can use as a href\n return textFile;\n}", "title": "" }, { "docid": "7e5afd6b42bf3cf9297d31cb3342ae12", "score": "0.6369868", "text": "function generate_text_file(total){\n\t//console.log('tes total = ' + total);\n\n}", "title": "" }, { "docid": "1625ac19f8703b8c472a2d519f44699a", "score": "0.63327163", "text": "function writeToFile() {\nFS.root.getFile(filename,{create : true},gotFileEntryforWriter,failed);\n \n}", "title": "" }, { "docid": "18b8556bf1ada11255163bbeb8d99642", "score": "0.6283092", "text": "function writeToFile(fileName, data) {\n data.badge = badgeArray[data.licence];\n //make the text to go into the readme\n let markdown = generateMarkdown(data);\n //create readme file\n fs.writeFile(fileName, markdown, (err) =>\n err ? console.log(err) : console.log('Success!'));\n \n}", "title": "" }, { "docid": "eb0cc08053fb3649343c1aa965d88041", "score": "0.626531", "text": "function createFile(header, lines, name){\n\tvar data = \"\";\n\t\n\tfor (var x = 0; x < header.length; x++){\n\t\tdata += header[x] + \"\\r\\n\";\n\t}\n\t\n\tfor (var x = 0; x < lines.length; x++){\n\t\tdata += lines[x] + \"\\r\\n\";\n\t}\n\t\n\tvar blob = new Blob([data],{type: \"text/plain\"});\n \n\t// download the file:\n\tdownload(blob, \"Planilla Corregida v2 - \" + name);\n}", "title": "" }, { "docid": "187305ab8df3b71f782f6012f680d92a", "score": "0.62283987", "text": "function writingToFile(textToWrite_param){\n\n fs.appendFile('./result.txt', textToWrite_param , (err) => {\n if (err) throw err;\n });\n\n}", "title": "" }, { "docid": "7735216ee9713b077ff9c975bb105412", "score": "0.6209613", "text": "function writeToFile(fileName, data) {\n let text = generate(data);\n fs.writeFile(fileName, text, (err) => {\n if (err) throw err;\n console.log(\"Saved!\");\n });\n}", "title": "" }, { "docid": "7b600660b6240ee70b02cf50cfeeb6d7", "score": "0.6193893", "text": "function createTxt(){\n const readStream = fs.createReadStream('./in-out/output.json', 'utf-8');\n const writeStream =\n fs.createWriteStream('./in-out/output.txt','utf-8');\n\n readStream.on('data', (chunk)=>{\n let arr = []\n chunk = JSON.parse(chunk);\n for( key in chunk){\n arr.push( [chunk[key]['name'],' | ',chunk[key]['age'],' | ',chunk[key]['company'],' |',chunk[key]['gender expression'],' | ',chunk[key]['race'],' ||'] )\n }\n for (let i = 0; i < arr.length; i ++){\n arr[i][0] = \" \"+arr[i][0]\n arr[i] = arr[i].join('')\n }\n chunk = arr.join('')\n writeStream.write(chunk.toString())\n });\n console.log('output.txt updated with output.json...');\n}", "title": "" }, { "docid": "71f374e56ff609acd5a171d299bdb7a6", "score": "0.6168214", "text": "function writeTextFile(folder, filename, text)\r\n{\r\n var path = Host.Url(\"local://$USERCONTENT/\" + folder + \"/\" + filename + \".txt\");\r\n let textFile = Host.IO.createTextFile(path);\r\n if (textFile)\r\n {\r\n textFile.writeLine(text);\r\n textFile.close();\r\n }\r\n}", "title": "" }, { "docid": "33ef259b09230aa64f6eedd96f94dc1a", "score": "0.6134365", "text": "function createNewFile() {\n\n}", "title": "" }, { "docid": "e3391b26e783c6b90bfc40d15e91e195", "score": "0.6133884", "text": "function createFileName() {}", "title": "" }, { "docid": "bb002f4b44aa55a6810c7032da485a81", "score": "0.61276233", "text": "function fsTextSuccess(fs){\n\t\t\t\tfs.root.getFile($.texts_storage_file, {create: true},\n\t\t\t\t\tfunction(fileEntry) { // callback: file created/opened successfully\n\t\t\t\t\t\tfileEntry.createWriter(function(fileWriter) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tfileWriter.onwriteend = function(e) {/**/};\n\t\t\t\t\t\t\tfileWriter.onerror = function(e) {/**/};\n\n\t\t\t\t\t\t\tif ($.last_title!=\"\" && $.last_post!=\"\"){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t // Create a new Blob obj (raw data) and write it to file\n\t\t\t\t\t\t\t var blob = new Blob([$.last_title.trim() + \"|\" + $.last_post.trim() + \"+\"], {type: 'text/plain'});\n\t\t\t\t\t\t\t // write (APPEND) to file\n\t\t\t\t\t\t\t fileWriter.seek(fileWriter.length);\n\t\t\t\t\t\t\t fileWriter.write(blob);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t loadAssociationProjectPage(); // show project diary\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\t},function(){ /*error callback*/});\n\n\t\t\t\t\t}, function(fileEntry) { /*callback: file creation error*/}\n\t\t\t\t);\n\t\t\t}", "title": "" }, { "docid": "a16f07bc9483fd80059a2896f065e340", "score": "0.6126091", "text": "function writeFile(info) {\n try {\n var f = new File(FPath + \"/\" + documentName + \".txt\");\n f.open('w');\n f.lineFeed = fileLineFeed;\n f.write(info);\n f.close();\n }\n catch(e){}\n}", "title": "" }, { "docid": "e7c2ab0b9ddfce22a2f05d248b576f11", "score": "0.6092463", "text": "function saveTextAsFile(edited_info)\n{\n\tvar textToWrite = edited_info;\n\tvar textFileAsBlob = new Blob([textToWrite], {type:'text/plain'});\n\tvar fileNameToSaveAs = \"contractor_info.js\";\n\n\tvar downloadLink = document.createElement(\"a\");\n\tdownloadLink.download = fileNameToSaveAs;\n\tdownloadLink.innerHTML = \"Download File\";\n\tif (window.webkitURL != null)\n\t{\n\t\t// Chrome allows the link to be clicked\n\t\t// without actually adding it to the DOM.\n\t\tdownloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob);\n\t}\n\telse\n\t{\n\t\t// Firefox requires the link to be added to the DOM\n\t\t// before it can be clicked.\n\t\tdownloadLink.href = window.URL.createObjectURL(textFileAsBlob);\n\t\tdownloadLink.onclick = destroyClickedElement;\n\t\tdownloadLink.style.display = \"none\";\n\t\tdocument.body.appendChild(downloadLink);\n\t}\n\n\tdownloadLink.click();\n}", "title": "" }, { "docid": "19896bddb6c47f305e71f88368bf16a5", "score": "0.605851", "text": "createFile(file, content){\n var path = RNFS.DocumentDirectoryPath + file;\n RNFS.writeFile(path, content, 'utf8')\n .then((success) => {\n // console.log('FILE WRITTEN!');\n })\n .catch((err) => {\n console.log(err.message);\n });\n\n }", "title": "" }, { "docid": "9780deb7cdf0f347fe7fdf701b285f56", "score": "0.6051144", "text": "function Createfile() {\n const renderhtml = render(employees);\n fs.writeFile(outputPath, renderhtml, (err) => {\n if (err) throw err;\n }); \n}", "title": "" }, { "docid": "7d070830f1566d6084506ce586c4a9bf", "score": "0.6009241", "text": "function write_to_file(){\n var fs = require('fs');\n var input = fs.writeFileSync('input_chapter.txt', data,'utf-8');\n console.log(\"Done!!\");\n}", "title": "" }, { "docid": "3d80c7433a075a48caafa324378ce4af", "score": "0.6004536", "text": "function writeTofile(fileName, data) {}", "title": "" }, { "docid": "a7e1346c5e404d7beed03f2b7408650b", "score": "0.6001345", "text": "function createFile (name) {\n\n\t\tvar filename = name + '.md';\n\t\tfilepath = path.join(project.path(), filename);\n\n\t\tsave();\n\n\t\tproject.addFile(name, filename);\n\t\tsidebar.addFile(name, switchFile);\n\t\tstylebar.loadStyles({});\n\n\t}", "title": "" }, { "docid": "6df3b90d39823318b3f621476dbff79e", "score": "0.59979236", "text": "function createFile(filename,data) {\n fs.open(filename,'w+',function(err, fd){\n\n fs.writeFile(fd,data, function(err) {\n if(err) {\n console.log(err);\n }\n console.log(\"The file was saved!\");\n });\n\n });\n}", "title": "" }, { "docid": "3674a4827ee0ff229d7b75ee3d8c51e0", "score": "0.59951854", "text": "function saveToDisk(filename,text){\n\tvar element = document.createElement('a');\n\tif(!text.startsWith(\"//Program for Turing machine\\n//By Pasquale Silvestri\\n\")){\n\t\ttext = \"//Program for Turing machine\\n//By Pasquale Silvestri\\n\" + text;\n\t}\n\telement.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));\n\telement.setAttribute('download', filename);\n\n\telement.style.display = 'none';\n\tdocument.body.appendChild(element);\n\n\telement.click();\n\n\tdocument.body.removeChild(element);\n\tconsole.log(filename+\" saved to disk!\");\n}", "title": "" }, { "docid": "38c2e8850f48178b753c6d6a96019198", "score": "0.59936666", "text": "function writeFile() {\n\n readFile();\n\n contentGlobal = contentGlobal + \"Date: \"+ date + \", Country:\" + country + \", City: \"+ city + \", Weather: \"+ summary + \", Temperature: \" + temperature +\"°C<br/>\";\n\n var dataObj = new Blob([contentGlobal], { type: 'text/plain' });\n\n // Create a FileWriter object for our FileEntry (log.txt).\n fileEntryGlobal.createWriter(function (fileWriter) {\n\n // If data object is not passed in,\n // create a new Blob instead.\n if (!dataObj) {\n dataObj = new Blob(['Hello'], { type: 'text/plain' });\n }\n\n fileWriter.write(dataObj);\n\n fileWriter.onwriteend = function() {\n console.log(\"Successful file write...\");\n };\n\n fileWriter.onerror = function (e) {\n console.log(\"Failed file write: \" + e.toString());\n };\n\n });\n}", "title": "" }, { "docid": "2fdf2b186afaa0b530c53f39f9647acb", "score": "0.5986979", "text": "function createAnkiTextFile(sentenceObjects, fields) {\n\n var fields = {\n kanjiOne: \"\",\n kanjiTwo: \"\",\n furigana: \"\", // furigana for the kanji\n expression: \"\", // sentence in japanese without furigana\n reading: \"\", // sentence in japanese with furigana\n meaning: \"\", // meaning of this individual kanji\n sentenceEnglish: \"\" // the english translation of the sentence\n };\n\n // Blank the file\n fs.writeFile(\"anki-sentences.txt\", \"\", function(err) {\n if (err) {\n console.error(err)\n return;\n }\n });\n\n _.map(sentenceObjects, function(sentenceObject) {\n\n fields.kanjiOne = sentenceObject.character;\n fields.meaning = sentenceObject.meaning;\n fields.furigana = sentenceObject.furigana || \"\";\n\n _.each(sentenceObject.sentences, function(sentence) {\n\n fields.expression = stripFurigana(sentence.jp);\n fields.reading = sentence.jp;\n fields.sentenceEnglish = sentence.en;\n writeLineToAnkiFile(\"anki-sentences.txt\", fields);\n });\n });\n}", "title": "" }, { "docid": "6ae472d3081f1da155bf883cfe42f014", "score": "0.5986926", "text": "function regular_writeToFile() {\nregular_FS.root.getFile(general_filename,{create : true},r_gotFileEntryforWriter,failed);\n \n}", "title": "" }, { "docid": "71e65253427cf9bb2a14864fb854b9d9", "score": "0.59711903", "text": "function generateFile(data) {\n fs.writeFile(\"README.md\", data, (err) =>\n err ? console.error(\"error\") : console.log(\"Your ReadMe is complete!\")\n );\n}", "title": "" }, { "docid": "5e06bae80450b46c17ee1a46a97f0461", "score": "0.5970943", "text": "function writeToFile(fileName, data) { \n fs.makefile(fileName, data)\n}", "title": "" }, { "docid": "ac14264344d5c3c15762e61ae4545bb2", "score": "0.5960652", "text": "[_fileCreator](path, text, callback){\n\t\tif(this._error != null){\n\t\t\tcallback(this._error);\n\t\t\tthis._error = null;\n\t\t}else{\n\n\t\t\tconsole.log(\"FileCreator ----------> \" + path);\n\n\t\t\tif(fileSys.existsSync(path)){\n\t\t\t\tconsole.log(\"Exist ! :(\");\n\t\t\t\tfileSys.unlink(path, function (err) {\n\t\t\t\t\tif(err)\n\t\t\t\t\t\tcallback(err);\n\t\t\t\t\telse\n\t\t\t\t\t\tfileSys.appendFile(path, text, function (err) {\n\t\t\t\t\t\t\tif(err)\n\t\t\t\t\t\t\t\tcallback(err);\n\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tconsole.log(\"New file ! :)\");\n\t\t\t\tfileSys.appendFile(path, text, function (err) {\n\t\t\t\t\tif(err)\n\t\t\t\t\t\tcallback(err);\n\t\t\t\t\tcallback();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "00162c97e72a8e5c045c4f04aa018a7a", "score": "0.5954672", "text": "function createFile() {\n\tfs.writeFile(`profile ${this.dataProfile.alias}.json`, JSON.stringify(this.dataProfile, null, 2), 'utf-8', (err) => {\n\t\tif (err) {\n\t\t\treturn spinnerCrawl.fail(chalk.red(`Error : ${err.message}`));\n\t\t}\n\t\treturn spinnerCrawl.succeed(chalk.green('File created with success!'));\n\t});\n}", "title": "" }, { "docid": "34f1b29d55b26d9640cd070686172e6c", "score": "0.59513396", "text": "_exportToText() {\n fs.writeFileSync(this.pathTemplate, '', 'utf-8');\n this.records.forEach(submitTime => fs.appendFileSync(this.pathTemplate, `${submitTime}\\n`));\n }", "title": "" }, { "docid": "36738afe00efa6100ca4138a7faa1e56", "score": "0.5933287", "text": "function writeFile() {\n // root file system entry\n var root = getFileSystemRoot(),\n \n // writes a file\n write_file = function(writer) {\n var lineCount = 1;\n \n // set the callbacks\n writer.onwritestart = onFileEvent;\n writer.onprogress = onFileEvent;\n writer.onwrite = onFileWrite;\n writer.onabort = onFileEvent;\n writer.onerror = onFileError;\n writer.onwriteend = function(event) {\n onFileEvent(event);\n lineCount += 1;\n if (lineCount <= 3) {\n // append a new line \n writer.write('Line ' + lineCount + '.\\r\\n'); \n } \n else {\n alert(writer.fileName + \n ' length=' + writer.length + \n ', position=' + writer.position);\n }\n }\n \n // append\n writer.seek(writer.length);\n \n // write to file\n writer.write('Line ' + lineCount + '.\\r\\n'); \n },\n \n // creates a FileWriter object\n create_writer = function(fileEntry) {\n fileEntry.createWriter(write_file, onFileSystemError);\n };\n \n // create a file and write to it\n root.getFile('bbgap.txt', {create: true}, create_writer, onFileSystemError);\n }", "title": "" }, { "docid": "0c341efc44feebba9753df18959eba7f", "score": "0.59207344", "text": "function saveData(filename, text) {\r\n var element = document.createElement('a');\r\n element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(workSpace.innerHTML));\r\n element.setAttribute('download', 'data.txt');\r\n\r\n element.style.display = 'none';\r\n document.body.appendChild(element);\r\n\r\n element.click();\r\n\r\n document.body.removeChild(element);\r\n}", "title": "" }, { "docid": "7b2088d28afa68e575be06497b70e042", "score": "0.59204", "text": "function createFile(file, data) {\r\n fs.writeFileSync(path.join(process.cwd(), file), data);\r\n console.log(\"Success!\");\r\n}", "title": "" }, { "docid": "4cc6413ae98f45a3e6cf87594140f869", "score": "0.5911109", "text": "function writeToFile(data) {\n let descriptionData = `## Description:\\n![GitHub license](https://img.shields.io/badge/license-${data.license}-blue.svg \"License Badge\")\\n\\n ${data.description}\\n\\n\\n` \n let tableofConents = `## Table of Content:\\n\\n* [Installation](*installation)\\n* [Usage](#usage)\\n* [License](#license)\\n* [Contributing](#contributing)\\n* [Tests](#tests)\\n* [Questions](#questions)\\n\\n\\n`\n let installData = `## Installation:\\n\\n To install necessary dependencies, run the following command:\\n\\n\\n\n ${data.install}\\n\\n\\n`\n \n let usageData = `## Usage:\\n\\n${data.repo1}\\n\\n\\n`\n \n let contributingData = `## Contributing:\\n\\n${data.repo2}\\n\\n\\n`\n let licenseData = `## License:\\n\\nThis project is licensed under the ${data.license} license.\\n\\n\\n`\n \n let testData = `## Tests:\\n\\nTo run tests, run the following command:\\n\\n\\n \n ${data.test}\n\n \\n\\n\\n`\n \n let questionData = `## Questions:\\n\\nIf you have any questions about the repo, open an issue or contact me directly at ${data.email}. You can find more of my work at [${data.userName}](https://github.com/${data.userName}).`\n \n \n \n fs.writeFileSync('README.md',`# ${data.title}\\nby: ${data.name}\\n\\n\\n![GitHub license](https://img.shields.io/badge/javascript-100%25-blue)\\n\\n\\n`, 'utf8')\n fs.appendFileSync('README.md',descriptionData )\n fs.appendFileSync('README.md', tableofConents)\n fs.appendFileSync('README.md',installData) \n fs.appendFileSync('README.md',usageData) \n fs.appendFileSync('README.md',licenseData)\n fs.appendFileSync('README.md', contributingData) \n fs.appendFileSync('README.md',testData) \n fs.appendFileSync('README.md',questionData) \n \n\n}", "title": "" }, { "docid": "9ce78f7242d7b47fd414f8b92b855884", "score": "0.5886275", "text": "function File_WriteToFile(folderPath, fileName, content, textCodingType, overWriteOrCreate)\r\n{\r\n var filePath;\r\n var exitResult;\r\n\r\n if (folderPath == null || fileName == null || content == null)\r\n CommonReporting.Log_StepError(\"[CommonFiles: File_WriteToFile] Incorrect parameter folderPath <\" + folderPath + \">, fileName <\" + fileName + \"> content <\" + content + \">\");\r\n\r\n if (textCodingType == null)\r\n textCodingType = aqFile.ctUTF8;\r\n if (overWriteOrCreate == null)\r\n overWriteOrCreate = false;\r\n\r\n try\r\n {\r\n File_CreateFolder(folderPath);\r\n filePath = folderPath + \"\\\\\" + fileName;\r\n\r\n exitResult = aqFile.WriteToTextFile(filePath, content, textCodingType, overWriteOrCreate);\r\n if (!exitResult)\r\n CommonReporting.Log_StepError(\"[CommonFiles: File_WriteToFile] Unable to write in the file <\" + filePath + \">\");\r\n CommonReporting.Log_Debug(\"[CommonFiles: File_WriteToFile] File was successfully written\");\r\n }\r\n catch(e)\r\n {\r\n CommonReporting.Log_StepError(\"[CommonFiles: File_WriteToFile] Exception caught: \" + e.message + \"; stacktrace: \" + e.stack);\r\n }\r\n}", "title": "" }, { "docid": "9972a9537bccafe9f12ab7813fd7d434", "score": "0.58820957", "text": "function fileWriter(fileName, text) {\n\tfs.appendFileSync(fileName, text);\n}", "title": "" }, { "docid": "f2f545e8d4c6546ee5b7a3bd0c20165f", "score": "0.5858466", "text": "function createFiles(fileName, content){\n\t// Query the entry\n\t\n\tif(!fs.existsSync(fileName)){\n\t\t\n\t\tconsole.log('creating file '+ fileName);\n\t\ttry {\n\t\t\tfs.writeFileSync(fileName, content);\n\t\t\tconsole.log(\"The file was created! \"+e);\n\t\t}catch(e){\n\t\t\tconsole.log(\"The file was NOT created! \"+e);\n\t\t}\n\t}else{\n\t\t\n\t}\n\t\n \t\n}", "title": "" }, { "docid": "a7bd3fedc2007c78c5f392f615d1a03d", "score": "0.5831123", "text": "function addToFile(data){\n data.map(datum => {\n text+= datum+\" - \"\n });\n text = text.substring(0, text.lastIndexOf(\" - \")) + \" \\r\\n\"\n }", "title": "" }, { "docid": "76fe88be560847e4f50954fa46792357", "score": "0.58163035", "text": "function generateTextEpisodeList(data) {\n // Checks to see if file already exists and if it does, deltes it.\n try {\n if (fs.existsSync(filePath + 'episode-list.txt')) {\n //file exists\n try {\n fs.unlinkSync(filePath + 'episode-list.txt')\n //file removed\n } catch (err) {\n console.error(err)\n }\n }\n } catch (err) {\n console.error(err)\n }\n\n var text = fs.createWriteStream(filePath + 'episode-list.txt', {\n flags: 'a' // 'a' means appending (old data will be preserved)\n })\n\n text.write(data.seriesName + '\\n') // append string to your file\n text.write('' + '\\n') // Blank Space\n text.write(data.overview + '\\n') // again\n text.write('' + '\\n') // Blank Space\n\n function n(n) {\n return n > 9 ? \"\" + n : \"0\" + n;\n };\n for (let i = 0; i < episodes.length; i++) { // Seasons\n if (i === 0) {\n text.write('Specials' + '\\n')\n } else {\n text.write('Season ' + n(i) + '\\n')\n }\n for (let j = 0; j < episodes[i].length; j++) { // Episodes\n text.write(episodes[i][j] + '\\n')\n }\n text.write('' + '\\n') // Blank Space\n }\n text.end() // close string\n}", "title": "" }, { "docid": "a0646400544c2ecc04ed091d14784a90", "score": "0.580496", "text": "function registrar(file,text){\n fs.appendFile(file, Date() + ' ---> ' + text + '\\n', function (err) {\n if (err) throw err;\n });\n console.log(Date() + ' ---> ' +text);\n}", "title": "" }, { "docid": "50dfa6f56409b0c1bf7ca4362cc150a6", "score": "0.5772816", "text": "function saveFile (srcPath, destPath, text) {\n let outputPath = destPath || path.dirname(srcPath)\n let filename = path.basename(srcPath)\n let newFilePath = path.join(outputPath, filename)\n if (!fs.existsSync(outputPath)) {\n fs.mkdirSync(outputPath, { recursive: true })\n }\n fs.writeFileSync(newFilePath, text, { encoding: 'utf8' })\n console.log('[Success]: ' + newFilePath)\n}", "title": "" }, { "docid": "3382fef2e24274be3837a657c2a3bb83", "score": "0.5770671", "text": "function wrapOutputAndWriteFile(filename, text) {\n console.log(filename)\n if (filename.substr(-5) !== '.json') { filename += '.json'; }\n self.writeFile(filename, text);\n }", "title": "" }, { "docid": "f9eb5fa14ab62eab578588fbb06c5a4a", "score": "0.5768794", "text": "function writeToFile(fileName, data) \n{\n // Make sure folder exists first\n if (!FS.existsSync(\"./output\")) {\n FS.mkdirSync(\"./output\")\n }\n\n // Write to file, console if there is an error\n FS.writeFile(fileName, MARKDOWN(data), function(error) \n {\n if(error) console.log(error);\n });\n}", "title": "" }, { "docid": "06306628dc73ba0fa45df8a864217c89", "score": "0.57675594", "text": "function writeTextFile(path, output) { \n\tvar fs = require('fs');\n\n\tfs.ensureFile(path, function(err) {\n\t\tif (!err) {\n\t\t\tfs.writeFile(path, output);\n\t\t} else {\n\t\t\tconsole.log(\"error writing to file\" + output);\n\t\t}\n\t});\n }", "title": "" }, { "docid": "7ef8d470546f9056763bfb8e366a9dc7", "score": "0.57655823", "text": "function guardarTxt(req, res) {\n var factura = req.body.factura;\n var nameTxt = req.body.nameTxt;\n console.log(\"Guardar -> \" + nameTxt);\n if (!factura)\n res.status(200).send({message: \"no hay facturas por guardar\"});\n\n writeFile(factura, nameTxt, dirFacturas)\n res.status(200).send({message: \"success\"});\n}", "title": "" }, { "docid": "a74f3b9999ad56de6b9f546e3af78d87", "score": "0.57651114", "text": "function writeToFile(data) {\n const fileName = `${data.name.toLowerCase().split(' ').join('')}.md`;\n fs.writeFile(fileName, generateMarkdown(data) , (err) =>\n err ? console.log(err) : console.log('Your README has been generated successfully!'))\n}", "title": "" }, { "docid": "3b15d0f75875fefb2e97edfa85fb54cb", "score": "0.5763699", "text": "function LogCreateTextFile(fsobj, filename, overwrite, unicode)\r\n{\r\n try\r\n {\r\n var obj = new Object;\r\n obj.hFile = fsobj.CreateTextFile(filename, overwrite, unicode);\r\n\r\n obj.strFileName = filename;\r\n obj.fFailed = false;\r\n obj.fsobj = fsobj;\r\n obj.WriteLine = CreateTextFile_WriteLine;\r\n obj.Close = CreateTextFile_Close;\r\n }\r\n catch(ex)\r\n {\r\n LogMsg(\"Exception occurred calling CreateTextFile(\" + [filename, overwrite, unicode].toString() + \")\" + ex);\r\n CreateFileOpenErrorDialog(\"An error occurred creating a file\", \"File: \" + filename, ex);\r\n throw ex;\r\n }\r\n return obj;\r\n}", "title": "" }, { "docid": "0d68fa6b74a50effd8cb4e27d7cc8c16", "score": "0.57636786", "text": "function doTextFile() {\n var arg = fs.readFile(\"./random.txt\", 'utf8', (error, text) => {\n if (!error) {\n command = text.split(',')[0];\n name = text.split(\",\")[1];\n run(command, name);\n } else {\n log(error);\n }\n });\n}", "title": "" }, { "docid": "8731347695140bd0dce40fdb29376505", "score": "0.57403123", "text": "function appendToFile(filePath, text) {\r\n if (!fso.fileExists(filePath)) {\r\n // abort\r\n echo(\"ABORT\\n\\n\"\r\n + \"the following file does NOT already exist.\\n\"\r\n + filePath);\r\n destroyObjects();\r\n WScript.quit();\r\n }\r\n\r\n // iomode\r\n var ForReading = 1;\r\n var ForWriting = 2;\r\n var ForAppending = 8;\r\n\r\n // format\r\n var TristateTrue = -1; // Unicode\r\n var TristateFalse = 0; // ASCII\r\n var TristateUseDefault = -2; // System Default\r\n\r\n var file = fso.openTextFile(filePath, ForAppending, create = false, TristateUseDefault);\r\n file.writeLine(text);\r\n\r\n file.close();\r\n}", "title": "" }, { "docid": "5b1e3a4a3b3bc6692b6fedd2d234b2a1", "score": "0.5736742", "text": "function writeToFile (name, desc, summ, from, to) {\n let writeStream = fs.createWriteStream (`${options.name}.md`);\n\n /* ------------------------------- frontmatter ------------------------------ */\n writeStream.write ('---\\n', 'ascii');\n writeStream.write (`title: ${name}\\n`, 'ascii');\n writeStream.write (`description: ${desc}\\n`, 'ascii');\n writeStream.write (`summary: ${summ}\\n`, 'ascii');\n writeStream.write ('cover: cover.jpg\\n', 'ascii');\n writeStream.write ('---\\n', 'ascii');\n\n let title = Humanize (`${name}`);\n let summary = Humanize (`${summ}`);\n writeStream.write (`\\n# ${title}\\n`, 'ascii');\n writeStream.write (`${summary}\\n`, 'ascii');\n writeStream.write ('\\n<!--more-->\\n\\n');\n\n /* ------------ finish the stream and write the data to the file ------------ */\n writeStream.on ('finish', () => {\n console.log ('wrote all data to file');\n });\n\n // close the stream\n writeStream.end ();\n}", "title": "" }, { "docid": "ad565ea68061974000ff7fa5fbfab95f", "score": "0.5727473", "text": "function generateOutputFile () {\n this.clearOutputFile();\n if(!this.hasValidCurrentObject)\n return;\n var blob = this.currentObjectToBlob();\n\n var format = this.selectedFormat();\n\n var formatInfo = this.formatInfo (format);\n\n /*displayName: \"STL\",\n extension: \"stl\",\n mimetype: \"application/sla\",*/\n\n var fileName = atom.showSaveDialogSync ({\n defaultPath: path.join (path.dirname (this.filename), path.basename (this.filename, path.extname (this.filename)) + '.' + formatInfo.extension),\n filters: [\n {name: formatInfo.displayName, extensions: [formatInfo.extension]}\n ]\n });\n\n var fileExt = path.extname (fileName).substr (1);\n\n console.log (\"saving into\", fileName, fileExt);\n\n var reader = new FileReader();\n reader.addEventListener(\"loadend\", function() {\n // TODO: find a way to pass ArrayBuffer into node\n // TODO: show progress bar\n // var resultStr = String.fromCharCode.apply(null, new Uint8Array(reader.result));\n // var resultStr = String.fromCharCode.apply(null, reader.result);\n var resultStr = reader.result;\n var firstComma = resultStr.indexOf(',');\n var data = unescape(resultStr.substring(firstComma + 1));\n\n var buffer = new Buffer(data, 'base64');\n\n fs.writeFile (fileName, buffer);\n });\n reader.readAsDataURL (blob);\n\n\n return;\n\n var windowURL=OpenJsCad.getWindowURL();\n this.outputFileBlobUrl = windowURL.createObjectURL(blob)\n if(!this.outputFileBlobUrl) throw new Error(\"createObjectURL() failed\");\n this.hasOutputFile = true;\n this.downloadOutputFileLink.href = this.outputFileBlobUrl;\n this.downloadOutputFileLink.innerHTML = this.downloadLinkTextForCurrentObject();\n var ext = this.selectedFormatInfo().extension;\n this.downloadOutputFileLink.setAttribute(\"download\", \"openjscad.\"+ext);\n this.enableItems();\n if(this.onchange) this.onchange();\n }", "title": "" }, { "docid": "73bb766246240638b10971722a39ee20", "score": "0.57251275", "text": "function writeToFile(fileEntry, text) {\n fileEntry.createWriter(function(fileWriter) {\n\n fileWriter.onerror = function(e) {\n console.log(\"Can't write to disk.\");\n };\n\n if (text.length > currentQuota - storageDelta) {\n increaseCurrentQuota();\n appGetFileEntry(function (newFileEntry) {\n console.log(\"Expanding storage\");\n writeToFile(newFileEntry, text);\n });\n }\n\n var blob = new Blob([text], {type: 'text/plain'});\n fileWriter.write(blob);\n\n }, fsErrorHandler);\n}", "title": "" }, { "docid": "0f1c483a3d837246303769590e8caece", "score": "0.5723451", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, markdownGenerate(data), function(err){\n if (err){\n return console.log(err);\n };\n console.log(\"Success! New ReadMe file was created!\");\n });\n}", "title": "" }, { "docid": "dcb68f7dce24059b4bfd66c055df6829", "score": "0.5721067", "text": "function writeToFile(fileName, template) {\n fs.writeFile(fileName, template, function(err){\n if (err) {\n return console.log(err);\n }\n console.log('Your README is complete!')\n })\n}", "title": "" }, { "docid": "c7b045e26cfda43d75ca9fca30d98ac9", "score": "0.57199425", "text": "function write(filename, content){\n if (typeof content === \"undefined\") content = \"\";\n mkdir(path.dirname(filename));\n fs.writeFileSync(filename, content);\n}", "title": "" }, { "docid": "11c65a474f5b8960dcc976f90f0286d2", "score": "0.5701418", "text": "function createFile(name, content) {\n try {\n fs.writeFileSync(name, JSON.stringify(content, null, 2));\n console.log('File created: ', name);\n } catch (e) {\n console.log('Error Writing Results To File.');\n }\n}", "title": "" }, { "docid": "fa3205df8006b38adbd3e8ca8d4dd9a1", "score": "0.569351", "text": "setUp() {\n super.setUp()\n let file_texts = [\n ['hello', 'hello world!\\n'],\n ]\n for (let [ path, text ] of file_texts) {\n fs.writeFileSync(path, text)\n }\n }", "title": "" }, { "docid": "32e254d13aa2ee34117d33d8d5fa036c", "score": "0.56873536", "text": "function writeToFile(data) {\nfs.writeFile('README.md', data, function (err) {\nif (err) throw err;\nconsole.log('README.md has been generated');\n});\n}", "title": "" }, { "docid": "65b0e4defa6cbbce7b2aa23bd916275d", "score": "0.5676386", "text": "function writeFile(fileName,content){\nreturn fs.writeFileSync(path.join(__dirname, \"fileName.txt\"), content);}", "title": "" }, { "docid": "48352be10c381536cea16b0deb70dffc", "score": "0.56736064", "text": "function writetxt(storyArray) {\n let txt = JSON.stringify(storyArray, null, 2);\n fs.writeFileSync('./txt/barthelmealltxt.txt', txt, finished);\n fs.writeFileSync('./txt/barthelmetxt.json', txt, finished);\n\n function finished(err) {\n console.log('json is ready');\n }\n}", "title": "" }, { "docid": "a11e8023a1a1c409d71e434b1046632a", "score": "0.5668956", "text": "function recordFile(rawText) {\n if ($('button#toggle-record').text() === \"Stop\") {\n if (typeof savePath === 'undefined' || savePath === null) {\n savePath = \"\";\n dialog.showSaveDialog(null, {}, name => {\n savePath = name;\n if (typeof savePath === \"undefined\" ||\n savePath === null ||\n savePath === \"\") {\n $('#errorModal').modal('show');\n $('button#toggle-record').text('Record');\n startTime = undefined;\n savePath = null;\n return;\n }\n\n wstream = fs.createWriteStream(savePath);\n wstream.on('error', function (e) {\n logOnScreen('error', e);\n $('#errorModal').modal('show');\n $('button#toggle-record').text('Record');\n startTime = undefined;\n savePath = null;\n return;\n }); \n });\n } else {\n if (fs.existsSync(savePath)) {\n uptime = process.uptime().toFixed(3);\n if (startTime === undefined) startTime = uptime;\n uptime = (uptime - startTime) * 1000;\n\n // [, ] appeared just one time.\n saveText = rawText.replace('[', '').replace(']', '');\n saveArr = transformStrToInt(rawText);\n\n // Calculate Angle to Torque value.\n var radian = (Number(saveArr[ANGLE_INDEX]) - Number($('input#encoderdegree').val())) * PI / 180;\n var torque = Number($('input#armlength').val()) * Number($('input#dumbbellweight').val()) * G * Math.sin(radian);\n\n if (ANGLE_INDEX + 1 < saveArr.length) {\n saveArr[saveArr.length] = torque;\n } else {\n saveArr[ANGLE_INDEX + 1] = torque;\n }\n saveText = saveArr.join(', ');\n\n wstream.write(`${uptime}, ${saveText}\\r\\n`);\n }\n }\n } else {\n try {\n startTime = undefined;\n savePath = null;\n wstream.end();\n wstream.destroy();\n } catch (e) {}\n }\n }", "title": "" }, { "docid": "f757e7618d5127b7b7f33163e2f5d3c4", "score": "0.56643826", "text": "function writeToFile(fileName, data) {\n // console.log(data);\n fs.writeFile(fileName, data, (err) => {\n if (err) throw err;\n console.log('README Generated!');\n });\n}", "title": "" }, { "docid": "f1115d63718ad98a65333bb13d7169cd", "score": "0.5650973", "text": "async function createFile() {\n //package.json\n var content;\n var data;\n var listLinkFiles = [\n \"./template/package.json\",\n \"./template/app.js\",\n \"./template/.gitignore\",\n \"./template/bin/www\",\n \"./template/src/app/routes/index.js\",\n \"./template/src/app/routes/homepage/index.js\",\n \"./template/src/app/routes/adminpage/index.js\",\n \"./template/src/app/views/homepage/index.ejs\",\n \"./template/src/app/views/adminpage/index.ejs\",\n \"./template/src/app/views/error/index.ejs\",\n \"./template/src/config/index.js\",\n \"./template/src/config/passport.js\",\n \"./template/src/model/connect.js\",\n \"./template/src/model/schema.js\",\n \"./template/src/model/schema/index.js\",\n \"./template/src/model/schema/users.js\",\n \"./template/src/services/checkPermission.js\",\n \"./template/src/services/convert.js\",\n \"./template/src/services/returnToUser.js\",\n \"./template/src/services/uploadFile.js\",\n ];\n\n for (let i = 0; i < listLinkFiles.length; i++) {\n content = await fs.readFileSync(listLinkFiles[i]);\n // console.log(content);\n data = content.toString().replace(new RegExp(\"</project_name>\", 'g'), projectName);\n await fs.writeFileSync(`${linkToProject}/${projectName}/${listLinkFiles[i].slice(11)}`, data);\n };\n}", "title": "" }, { "docid": "16562a9baa955766cc07f55b93955a73", "score": "0.564795", "text": "saveText( sFilename, sText )\r\n {\r\n let Data = new Blob( [sText], { type: 'text/plain' } );\r\n this.saveBlob( sFilename, Data );\r\n }", "title": "" }, { "docid": "92ffe0093cf516dbeae3e6e72dbe4ff9", "score": "0.56476086", "text": "function writeToTextFile(){\n\tconsole.log('retrievedObject: ', expertJSON);\n\tvar jsonString = JSON.stringify(expertToEngineJson(expertJSON));\n\tvar MIME_TYPE = \"text/plain\";\n\tvar blob = new Blob([jsonString], {type: MIME_TYPE});\n\tsaveAs(blob, \"expert.json\");\n\tconsole.log('retrievedObjectAfter: ', expertJSON);\n\t\n\t// if(dontFinishCascade){\n\t// \talert(\"There are rules that need to be modified!!\")\n\t// } else {\n\t// \tvar jsonString = JSON.stringify(expertToEngineJson(expertJSON));\n\t// \tconst MIME_TYPE = 'text/plain';\n\t// \tvar blob = new Blob([jsonString], {type: MIME_TYPE});\n\t// \tsaveAs(blob, \"expert.json\");\n\t// }\n\t// window.location.href = 'app.html';\n}", "title": "" }, { "docid": "67f107e3d9eaa608fa7816ff9f0723c0", "score": "0.56465375", "text": "function writeToFile(file, data) {\n fs.writeFile(file, data, err => {\n if (err) {\n reject(err);\n return;\n }\n console.log('Readme generated')\n });\n}", "title": "" }, { "docid": "efe28be8c8fcfdcbdd69b03f0f90161b", "score": "0.5645686", "text": "function writePython() {\n fs.appendFileSync(\"textfile.txt\", document.getElementById(\"name-of-student\").value);\n fs.appendFileSync(\"textfile.txt\", \"\\n\");\n\n fs.appendFileSync(\"textfile.txt\", document.getElementById(\"assessment-id\").value);\n fs.appendFileSync(\"textfile.txt\", \"\\n\");\n\n for (i = 0; i < Answers.length; i++){\n fs.appendFileSync(\"textfile.txt\", Answers[i], \"utf-8\");\n fs.appendFileSync(\"textfile.txt\", \"\\n\");\n }\n \n // executes the python code\n triggerPythonCode();\n}", "title": "" }, { "docid": "5e8ec05bb9f3e8e5fd622eea04738d80", "score": "0.564229", "text": "function saveResume(fileName,text){\n var blob = new Blob([text], {type: \"text/plain;charset=utf-8\"});\n saveAs(blob, fileName+\".txt\");\n}", "title": "" }, { "docid": "e9427da7f56a9c61e79f73de27eef5b2", "score": "0.56363404", "text": "function writetoFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err) throw err;\n console.log('Generating README File...');\n });\n}", "title": "" }, { "docid": "1fcc13270c2cd2e4457ef5683343fa7f", "score": "0.5635075", "text": "function writeFile() {\n var type = window.TEMPORARY;\n var size = 5*1024*1024;\n window.requestFileSystem(type, size, successCallback, errorCallback)\n var textArea = document.getElementById(\"text\").value + \"\\n\";\n \n function successCallback(fs) {\n fs.root.getFile(\"log.txt\", {create: true}, function(fileEntry) {\n \n fileEntry.createWriter(function(fileWriter) {\n fileWriter.onwriteend = function(e) {\n alert(\"Address Saved\");\n };\n fileWriter.onerror = function(e) {\n alert(\"Address failed to save: \");\n };\n\n var blob = new Blob([textArea], {type: \"text/plain\"});\n fileWriter.write(blob);\n }, errorCallback);\n }, errorCallback);\n }\n \n function errorCallback(error) {\n alert(\"Error while trying to save the address\");\n }\n}", "title": "" }, { "docid": "df7598b00e220add3da748c296312680", "score": "0.56158197", "text": "function saveTextToFile(textstr, filename) {\r\n var blobToSave = new Blob([textstr], {\r\n type: 'text/plain'\r\n });\r\n var blobURL = \"\";\r\n if (typeof window.webkitURL !== 'undefined') {\r\n blobURL = window.webkitURL.createObjectURL(blobToSave);\r\n } else {\r\n blobURL = window.URL.createObjectURL(blobToSave);\r\n }\r\n\r\n var display_element = jsPsych.getDisplayElement();\r\n\r\n display_element.insertAdjacentHTML('beforeend','<a id=\"jspsych-download-as-text-link\" style=\"display:none;\" download=\"'+filename+'\" href=\"'+blobURL+'\">click to download</a>');\r\n document.getElementById('jspsych-download-as-text-link').click();\r\n }", "title": "" }, { "docid": "04189690b9786b7d53fb6844d9ab250a", "score": "0.56126225", "text": "function writeToFile(filename, content) {\n fs.writeFile(filename, content, (err)=> {\n if (err) throw err;\n console.log('Readme File Successfully Created!');\n });\n}", "title": "" }, { "docid": "d939a5efdfb88c2d8e190000beeea580", "score": "0.56126076", "text": "function writeToFile(fileName, data) {\n var content = generateMarkdown(data)\n fs.writeFile(fileName,content, function(error){\n if(error){\n console.log(error)\n }\n console.log(\"Success!\")\n })\n}", "title": "" }, { "docid": "95d8cab9699bd89ff48e22be147b5a5e", "score": "0.5612027", "text": "function doWhatItSays() {\n\n fs.writeFile(\"random.txt\", 'spotify-this-song,\"The Sign Ace of Base\" ', function (error) {\n var song = \"spotify-this-song 'The Sign Ace of Base'\"\n \n // If the code experiences any errors it will log the error to the console.\n if (error) {\n return console.log(error);\n };\n\n // Otherwise, it will print:\n console.log(song);\n \n });\n}", "title": "" }, { "docid": "d2b65d0fb1ab6f5b6093fa1323abce44", "score": "0.5600713", "text": "function writeToFile (fileName, data,) {\n fs.writeFile(fileName, data, function(err){\n if(err) {\n console.log(err);\n }\n console.log(\"Successfully wrote to a Generated README.md!\");\n });\n}", "title": "" }, { "docid": "15c9c12f387942f28ced96021ffcaf18", "score": "0.56004304", "text": "function writeToFile(fileName, data) {\n chosenBadge = badges[licenseChoices.indexOf(data.projectLicensing)];\n \n console.log(data)\n\n fs.writeFile(fileName, createREADME(data), (error) =>\n error ? console.error(error) : console.log(\"success\")\n )\n\n}", "title": "" }, { "docid": "930285037019f06db7b25d5f4b39477c", "score": "0.55997866", "text": "function downloadTextFile(text, name) {\n\tconst a = document.createElement('a')\n\tconst type = name.split(\".\").pop()\n\ta.href = URL.createObjectURL( new Blob([text], { type:`text/${type === \"txt\" ? \"plain\" : type}` }) )\n\ta.download = name\n\ta.click()\n}", "title": "" }, { "docid": "1d86ad36be176a41a7039f2c8f19c7db", "score": "0.559882", "text": "function writeToFile(fileName, data) {\n let licenseData = render(data);\n let readmeData = \n`# ${data.projectName}\n\n${licenseData.badge}\n\n## Table of Contents\n \n1. [Description](##description)\n2. [Installation Instructions](##installation-instructions)\n3. [Usage Information](##usage-information)\n4. [Contribution Guidelines](##contribution-guidelines)\n5. [Test Instructions](##test-instructions)\n6. [Questions](##questions)\n${licenseData.link}\n8. [Screenshot](##screenshot)\n \n \n## Description\n${data.description}\n \n## Installation Instructions\n${data.install}\n \n## Usage Information\n${data.usage}\n \n## Contribution Guidelines\n${data.contributions}\n \n## Test Instructions\n${data.testing}\n \n## Questions\nIf you have further questions about the functionality of this application or need clarification regarding certain areas the creator can be contacted at:<br>\nEmail: ${data.email} <br>\nGithub: https://github.com/${data.username}/\n \n${licenseData.section}\n\n## Screenshot\nA live version of the application is deployed at: ${data.link}\n\n![${data.screenshotalt}](${data.screenshot})\n\nThis readme was generated using the ReadME Generator : https://github.com/trev-eck/readme-generator\n`;\n fs.appendFile(fileName, readmeData, (error) => \n error? console.error(error) : console.log(\"Readme Created!\")\n );\n}", "title": "" }, { "docid": "da7bee4d4de5efb2eba07ff92cf85566", "score": "0.5598789", "text": "function writeToFile(filename, data) {}", "title": "" }, { "docid": "8195afc4711e215b1420d904910d3409", "score": "0.5591631", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, function (err) {\n if (err) return console.log(err);\n console.log('Your readme has been created.');\n });\n}", "title": "" }, { "docid": "07993a61cec0cbd22254574f6d3fcf60", "score": "0.5591045", "text": "function writeToFile(fileName, data) {\n let content = generator(data)\n writeFile(`./dist/${fileName.trim()}.md`, content, () => console.log(`${fileName.trim()} generated!`))\n}", "title": "" }, { "docid": "c6e327e91c13325e9c175b8977fa78fc", "score": "0.5589153", "text": "function saveData(filename, txt) {\n var l = txt.length;\n if (file.offset + l > FILESIZE) {\n // need a new file...\n file.name = filename;\n // write data to file - this will overwrite the last one\n storage.write(file.name, txt, 0, FILESIZE);\n file.offset = l;\n } else {\n // just append\n storage.write(file.name, txt, file.offset);\n file.offset += l;\n }\n}", "title": "" }, { "docid": "e94ebbd2d2c2afb174e2b4698d3879e8", "score": "0.5585869", "text": "setUp() {\n super.setUp()\n let file_texts = [\n ['hello', 'hello world!\\n'],\n ['recursive', '-a\\n' +\n 'A\\n' +\n '@hello'],\n ['invalid', '@no-such-path\\n'],\n ]\n for (let [ path, text ] of file_texts) {\n fs.writeFileSync(path, text)\n }\n }", "title": "" }, { "docid": "97b806b9038b4f70b2a2162747ec73f8", "score": "0.5576323", "text": "function saveTextAsFile() {\n var textToWrite = document.getElementById(\"food_log\").value;\n var textFileAsBlob = new Blob([textToWrite], {\n type: 'text/plain'\n });\n var fileNameToSaveAs = document.getElementById(\"inputFileNameToSaveAs\").value;\n\n var downloadLink = document.createElement(\"a\");\n downloadLink.download = fileNameToSaveAs;\n downloadLink.innerHTML = \"Download File\";\n if (window.webkitURL != null) {\n // Chrome allows the link to be clicked\n // without actually adding it to the DOM.\n downloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob);\n } else {\n // Firefox requires the link to be added to the DOM\n // before it can be clicked.\n downloadLink.href = window.URL.createObjectURL(textFileAsBlob);\n downloadLink.onclick = destroyClickedElement;\n downloadLink.style.display = \"none\";\n document.body.appendChild(downloadLink);\n }\n\n downloadLink.click();\n}", "title": "" }, { "docid": "3a9efcbf874c10f6d38322750e7a58f8", "score": "0.55650395", "text": "function writeToFile(fileName, data) {\n \n}", "title": "" }, { "docid": "3a9efcbf874c10f6d38322750e7a58f8", "score": "0.55650395", "text": "function writeToFile(fileName, data) {\n \n}", "title": "" }, { "docid": "167388533afbc1f6c03755d841e73058", "score": "0.5563795", "text": "function store(text, name, local=false, type=\"text/plain\") {\r\n var a = document.createElement(\"a\");\r\n if(Array.isArray(text)){text = text.filter(function(e){return e}).join(\"\\n\")}\r\n var file = new Blob([text], {type: type});\r\n a.href = URL.createObjectURL(file);\r\n if(local){\r\n\ta.download = name;\r\n\ta.click();\r\n }\t\t\r\n else{window.open(a.href,'_blank');}\r\n}", "title": "" }, { "docid": "a7da59a375791ee259826602c75ecb33", "score": "0.5563731", "text": "function saveTextToFile(textstr, filename) {\n var blobToSave = new Blob([textstr], {\n type: 'text/plain'\n });\n var blobURL = \"\";\n if (typeof window.webkitURL !== 'undefined') {\n blobURL = window.webkitURL.createObjectURL(blobToSave);\n }\n else {\n blobURL = window.URL.createObjectURL(blobToSave);\n }\n \n var display_element = jsPsych.getDisplayElement();\n \n display_element.append($('<a>', {\n id: 'jspsych-download-as-text-link',\n href: blobURL,\n css: {\n display: 'none'\n },\n download: filename,\n html: 'download file'\n }));\n $('#jspsych-download-as-text-link')[0].click();\n }", "title": "" }, { "docid": "0c622435bfdfe151d740f897e4d07758", "score": "0.5561181", "text": "function makeFusionFile(str) {\n fs.writeFile(\"./public/data/fusion.json\", str, function(err) {\n if(err) {\n return console.log(err)\n }\n console.log('The Fusion file saved successfully')\n });\n }", "title": "" }, { "docid": "68127eacc4f29048d10636ee8c399a81", "score": "0.5554119", "text": "function writeToFile(fileName, data) {\n // this passes the data object (the answers from the inquirer prompt) to the function to generate the markdown file\n fs.writeFile(`./results/${fileName}.md`, generateMarkdown(data), (err) =>\n err ? console.error(err) : console.log(\"README File has been generated.\")\n );\n}", "title": "" }, { "docid": "1219701f694d3566ff230800dacd2073", "score": "0.55537885", "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": "0c53e3475c1a6aee08f400f3081ca32b", "score": "0.5550483", "text": "function writeToFile(fileName, data) {\n\n}", "title": "" }, { "docid": "1c3ff5407995b777fbf8923017540136", "score": "0.5542089", "text": "function CreateNewFile(){\n isNewFile = true;\n var newFile = DefaultSavePath+CreateRandomFileName();\n //Clear current window \n if(EditorManager.editableCodeMirror.getValue() != null || EditorManager.editableCodeMirror.getValue() != \" \"){\n EditorManager.editableCodeMirror.setValue(\"\");\n }\n //Create the tmp file \n fs.writeFile(newFile,\"\",function(err){\n if(err){\n console.log(err);\n }else{\n fs.readFile(newFile,'utf-8',function(err,data){\n if(err){\n console.log(err);\n }else{\n CurrentFile = newFile;\n //Writing the data to the window\n EditorManager.editableCodeMirror.setValue(data);\n //Add to sidebar\n InterfaceManager.ExplorerManagement(CurrentFile); \n //Display notification\n NotificationManager.displayNotification(\"info\",\"New file created, press Ctrl+S to save/rename\",\"bottomCenter\",3000,\"fa fa-info-circle\",false,\"light\",12); \n }\n })\n }\n })\n /*\n \n */\n}", "title": "" }, { "docid": "5948da5da15b5bb904ae14845ec84e81", "score": "0.55382174", "text": "function makeJnuFile(str) {\n fs.writeFile(\"./public/data/jnu_hem_r.json\", str, function(err) {\n if(err) {\n return console.log(err)\n }\n\n console.log('The jnu_hem_r file is saved successfully')\n });\n }", "title": "" }, { "docid": "bea9a9289a8c0a1a1e6dfb79c0ef258d", "score": "0.5537916", "text": "function writeFile(strPath, strText) {\n $.NSString.alloc.initWithUTF8String(strText)\n .writeToFileAtomicallyEncodingError(\n $(strPath)\n .stringByStandardizingPath, false,\n $.NSUTF8StringEncoding, null\n );\n }", "title": "" }, { "docid": "bc9dd72cf07f39e4c4c3ded6d2a33813", "score": "0.5536868", "text": "function createFile() {\n version = document.getElementById('version').value;\n const data = `BEGIN:VCALENDAR\\r\\nVERSION:${version}\\r\\nCALSCALE:GREGORIAN\\r\\n${createVevent()}END:VCALENDAR`;\n if (version == '1.0') {\n const file = new Blob([data], { type: 'text/plain;charset=utf-8' });\n saveAs(file, `${document.getElementById('summary').value}.vcs`);\n }\n else {\n const file = new Blob([data], { type: 'text/plain;charset=utf-8' });\n saveAs(file, `${document.getElementById('summary').value}.ics`);\n }\n}", "title": "" }, { "docid": "58a3a9712029431a4942db89b8d17d22", "score": "0.55359495", "text": "function writeToFile(data) {\n fs.writeFile('README.md', data, function (err) {\n if (err) throw err;\n console.log('README.md has been generated :)');\n });\n}", "title": "" }, { "docid": "028d756abf9ee470372a8f47350f3e5b", "score": "0.55352175", "text": "function writeToFile(fileName, data) {}", "title": "" } ]
778e7982839871a5f0fe5b3f2316fd79
Function can generate dependencies internally.
[ { "docid": "fa68d6fd232c557e82b0305a2bba5c4f", "score": "0.0", "text": "function getTestProject({\n projectId = '11112222-3333-4444-5555-666677778888',\n name = 'test project name',\n dependenciesConfig = [],\n issues = [],\n commits = [],\n} = {}) {\n const dependencies = [];\n for (let dependencyIx = 0; dependencyIx < dependenciesConfig.length; dependencyIx += 1) {\n dependencies.push(\n getTestProject(dependenciesConfig[dependencyIx]),\n );\n }\n\n const project = {\n id: projectId,\n type: 'Project',\n name,\n dependencies,\n issues,\n commits,\n };\n\n return project;\n}", "title": "" } ]
[ { "docid": "ba34e58eff8b38faa510870dfeced786", "score": "0.70258313", "text": "depend() {\n this.deps.forEach(dep => dep.depend())\n }", "title": "" }, { "docid": "7ab623c8e1cf4062eb569ba0cadc44f1", "score": "0.7003761", "text": "depend () {\n let i = this.deps.length;\n while (i--) {\n this.deps[i].depend();\n }\n }", "title": "" }, { "docid": "b9cb8899f4ca483381b9fd597f99a633", "score": "0.68072534", "text": "[_loadDeps] () {}", "title": "" }, { "docid": "9a6cafaf5d31b1c82e906dc24cb9c5c2", "score": "0.64255995", "text": "function collectAsynchronousDependencies(node, includeNonAmdDependencies) {\n // names of modules with corresponding parameter in the factory function\n var aliasedModuleNames = [];\n // names of modules with no corresponding parameters in factory function\n var unaliasedModuleNames = [];\n // names of the parameters in the factory function; these\n // parameters need to match the indexes of the corresponding\n // module names in aliasedModuleNames.\n var importAliasNames = [];\n // Fill in amd-dependency tags\n for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) {\n var amdDependency = _a[_i];\n if (amdDependency.name) {\n aliasedModuleNames.push(ts.createLiteral(amdDependency.path));\n importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, amdDependency.name));\n }\n else {\n unaliasedModuleNames.push(ts.createLiteral(amdDependency.path));\n }\n }\n for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) {\n var importNode = _c[_b];\n // Find the name of the external module\n var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions);\n // Find the name of the module alias, if there is one\n var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile);\n // It is possible that externalModuleName is undefined if it is not string literal.\n // This can happen in the invalid import syntax.\n // E.g : \"import * from alias from 'someLib';\"\n if (externalModuleName) {\n if (includeNonAmdDependencies && importAliasName) {\n // Set emitFlags on the name of the classDeclaration\n // This is so that when printer will not substitute the identifier\n ts.setEmitFlags(importAliasName, 4 /* NoSubstitution */);\n aliasedModuleNames.push(externalModuleName);\n importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, importAliasName));\n }\n else {\n unaliasedModuleNames.push(externalModuleName);\n }\n }\n }\n return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames };\n }", "title": "" }, { "docid": "db534399a12830386eb87f645adc5648", "score": "0.64162815", "text": "function collectAsynchronousDependencies(node, includeNonAmdDependencies) {\n // names of modules with corresponding parameter in the factory function\n var aliasedModuleNames = [];\n // names of modules with no corresponding parameters in factory function\n var unaliasedModuleNames = [];\n // names of the parameters in the factory function; these\n // parameters need to match the indexes of the corresponding\n // module names in aliasedModuleNames.\n var importAliasNames = [];\n // Fill in amd-dependency tags\n for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) {\n var amdDependency = _a[_i];\n if (amdDependency.name) {\n aliasedModuleNames.push(ts.createLiteral(amdDependency.path));\n importAliasNames.push(ts.createParameter( /*decorators*/undefined, /*modifiers*/undefined, /*dotDotDotToken*/undefined, amdDependency.name));\n } else {\n unaliasedModuleNames.push(ts.createLiteral(amdDependency.path));\n }\n }\n for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) {\n var importNode = _c[_b];\n // Find the name of the external module\n var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions);\n // Find the name of the module alias, if there is one\n var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile);\n // It is possible that externalModuleName is undefined if it is not string literal.\n // This can happen in the invalid import syntax.\n // E.g : \"import * from alias from 'someLib';\"\n if (externalModuleName) {\n if (includeNonAmdDependencies && importAliasName) {\n // Set emitFlags on the name of the classDeclaration\n // This is so that when printer will not substitute the identifier\n ts.setEmitFlags(importAliasName, 4 /* NoSubstitution */);\n aliasedModuleNames.push(externalModuleName);\n importAliasNames.push(ts.createParameter( /*decorators*/undefined, /*modifiers*/undefined, /*dotDotDotToken*/undefined, importAliasName));\n } else {\n unaliasedModuleNames.push(externalModuleName);\n }\n }\n }\n return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames };\n }", "title": "" }, { "docid": "84e6205a0a5e16a7d947e43382d9f285", "score": "0.6307419", "text": "function collectAsynchronousDependencies(node, includeNonAmdDependencies) {\n // names of modules with corresponding parameter in the factory function\n var aliasedModuleNames = [];\n // names of modules with no corresponding parameters in factory function\n var unaliasedModuleNames = [];\n // names of the parameters in the factory function; these\n // parameters need to match the indexes of the corresponding\n // module names in aliasedModuleNames.\n var importAliasNames = [];\n // Fill in amd-dependency tags\n for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) {\n var amdDependency = _a[_i];\n if (amdDependency.name) {\n aliasedModuleNames.push(ts.createLiteral(amdDependency.path));\n importAliasNames.push(ts.createParameter( /*decorators*/undefined, /*modifiers*/undefined, /*dotDotDotToken*/undefined, amdDependency.name));\n } else {\n unaliasedModuleNames.push(ts.createLiteral(amdDependency.path));\n }\n }\n for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) {\n var importNode = _c[_b];\n // Find the name of the external module\n var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions);\n // Find the name of the module alias, if there is one\n var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile);\n if (includeNonAmdDependencies && importAliasName) {\n // Set emitFlags on the name of the classDeclaration\n // This is so that when printer will not substitute the identifier\n ts.setEmitFlags(importAliasName, 4 /* NoSubstitution */);\n aliasedModuleNames.push(externalModuleName);\n importAliasNames.push(ts.createParameter( /*decorators*/undefined, /*modifiers*/undefined, /*dotDotDotToken*/undefined, importAliasName));\n } else {\n unaliasedModuleNames.push(externalModuleName);\n }\n }\n return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames };\n }", "title": "" }, { "docid": "1450285e99ec404c5819f8402e731088", "score": "0.6161755", "text": "setPersistDependencies () {\n const dependencies = []\n\n this.objectAtrrs.forEach((attr) => {\n const modelResource = new Dependence(attr.type)\n modelResource.resolved = false\n modelResource.addChild(attr.type)\n if (attr.type !== this.name) dependencies.push(modelResource)\n })\n\n this.arrayAtrrs.forEach((attr) => {\n const modelResource = new Dependence(attr.type)\n modelResource.resolved = false\n modelResource.addChild(attr.type)\n if (attr.type !== this.name) dependencies.push(modelResource)\n })\n\n this.persistDependencies = uniqBy(dependencies, 'module') || []\n }", "title": "" }, { "docid": "e4dc257bb9b5fb33d522e35502c0414d", "score": "0.61414015", "text": "function getComponentsDependenciesLinks(componentDependencies, consumer, createNpmLinkFiles, bitMap) {\n const componentsDependenciesLinks = new (_dataToPersist().default)();\n const linkedComponents = new (_bitId().BitIds)();\n const componentsToLink = getComponentsToLink();\n addLinksForComponents();\n addLinksForDependencies();\n return componentsDependenciesLinks;\n\n function getComponentsToLink() {\n return componentDependencies.reduce((acc, componentWithDeps) => {\n const component = componentWithDeps.component;\n const componentMap = bitMap.getComponent(component.id);\n component.componentMap = componentMap;\n\n if (componentMap.origin === _constants().COMPONENT_ORIGINS.AUTHORED) {\n _logger().default.debug(`writeComponentsDependenciesLinks, ignoring a component ${component.id.toString()} as it is an author component`);\n\n return acc;\n } // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n\n\n return acc.concat(componentWithDeps);\n }, []);\n }\n\n function addLinksForComponents() {\n componentsToLink.forEach(componentWithDeps => {\n const component = componentWithDeps.component;\n if (linkedComponents.has(component.id)) return; // it must be IMPORTED. We don't pass NESTED to this function\n\n _logger().default.debug(`writeComponentsDependenciesLinks, generating links for ${component.id.toString()}`);\n\n const componentsLinks = getComponentLinks({\n consumer,\n component,\n dependencies: componentWithDeps.allDependencies,\n createNpmLinkFiles,\n bitMap\n });\n componentsDependenciesLinks.merge(componentsLinks);\n linkedComponents.push(component.id);\n });\n }\n\n function addLinksForDependencies() {\n componentsToLink.forEach(componentWithDeps => {\n if (!componentWithDeps.component.dependenciesSavedAsComponents) return;\n componentWithDeps.allDependencies.forEach(dep => {\n if (linkedComponents.has(dep.id)) return; // We pass here the componentWithDeps.dependencies again because it contains the full dependencies objects\n // also the indirect ones\n // The dep.dependencies contain only an id and relativePaths and not the full object\n\n const dependencies = componentWithDeps.allDependencies;\n dependencies.push(componentWithDeps.component);\n const dependencyLinks = getComponentLinks({\n consumer,\n component: dep,\n dependencies,\n createNpmLinkFiles,\n bitMap\n });\n componentsDependenciesLinks.merge(dependencyLinks);\n linkedComponents.push(dep.id);\n });\n });\n }\n}", "title": "" }, { "docid": "203f050ad2f5d14f2b11f49cdfb3e203", "score": "0.606575", "text": "buildDependencyList(deps) {\n\t\tlet allFlat = [];\n\t\t_.forEach(deps, (dep) => {\n\t\t\tallFlat = _.union(allFlat, dep.flat);\n\t\t});\n\n\t\treturn Array.sort(allFlat);\n\t}", "title": "" }, { "docid": "031fae7856b37593b045ebd246e8d24d", "score": "0.6054266", "text": "_depend(changers, _allow_unordered) {\n if (Tracker.active) {\n const dependency = new Tracker.Dependency();\n const notify = dependency.changed.bind(dependency);\n dependency.depend();\n const options = {\n _allow_unordered,\n _suppress_initial: true\n };\n ['added', 'addedBefore', 'changed', 'movedBefore', 'removed'].forEach(fn => {\n if (changers[fn]) {\n options[fn] = notify;\n }\n }); // observeChanges will stop() when this computation is invalidated\n\n this.observeChanges(options);\n }\n }", "title": "" }, { "docid": "3ac3ffa96d06f8660576e9ff54d184d2", "score": "0.6050386", "text": "prepare() {\n // References\n for (const ref of this.node.findReferences()) {\n if (cfn_reference_1.CfnReference.isCfnReference(ref.reference)) {\n ref.reference.consumeFromStack(this, ref.source);\n }\n }\n // Resource dependencies\n for (const dependency of this.node.findDependencies()) {\n const theirStack = dependency.target.node.stack;\n if (theirStack !== undefined && theirStack !== this) {\n this.addDependency(theirStack);\n }\n else {\n for (const target of findResources([dependency.target])) {\n for (const source of findResources([dependency.source])) {\n source.addDependsOn(target);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "aa1e4936c385bdcdf8c2c0a6d970a556", "score": "0.604393", "text": "function dependArray(value){for(var e=void 0,i=0,l=value.length;i<l;i++){e=value[i];e&&e.__ob__&&e.__ob__.dep.depend();if(Array.isArray(e)){dependArray(e);}}}", "title": "" }, { "docid": "aa1e4936c385bdcdf8c2c0a6d970a556", "score": "0.604393", "text": "function dependArray(value){for(var e=void 0,i=0,l=value.length;i<l;i++){e=value[i];e&&e.__ob__&&e.__ob__.dep.depend();if(Array.isArray(e)){dependArray(e);}}}", "title": "" }, { "docid": "aa1e4936c385bdcdf8c2c0a6d970a556", "score": "0.604393", "text": "function dependArray(value){for(var e=void 0,i=0,l=value.length;i<l;i++){e=value[i];e&&e.__ob__&&e.__ob__.dep.depend();if(Array.isArray(e)){dependArray(e);}}}", "title": "" }, { "docid": "aa1e4936c385bdcdf8c2c0a6d970a556", "score": "0.604393", "text": "function dependArray(value){for(var e=void 0,i=0,l=value.length;i<l;i++){e=value[i];e&&e.__ob__&&e.__ob__.dep.depend();if(Array.isArray(e)){dependArray(e);}}}", "title": "" }, { "docid": "eaf2738c83caab20fe7c3a4de7e6f62b", "score": "0.60208714", "text": "function create_dependencies(data) {\n var dev_mode_tmp = false;\n\n if (dev_mode_tmp) console.log(\"---------------------CREATE DEPENDANCEIS---------------------\")\n\n // TODO: Error checking that the input node is valid\n\n var data_obj = anything_to_feat_object(data);\n\n // If the render function for this type is off, return immediately.\n if(!feat_categories[feat_type_to_number(data_obj.type)].render) return;\n\n var feat_type = feat_type_to_number(data_obj.type)\n\n if (dev_mode_tmp) {\n console.log(\"DATA: \")\n console.log(data_obj)\n }\n\n var tmp_total_EI_PR;\n var tmp_total_PR;\n var tmp_node_ID;\n\n // Create node for input feat\n tmp_node_ID = create_node(data_obj.id, 0, true, 10)\n\n var layer_cache = [[data_obj.name]]\n var node_cache = [[tmp_node_ID]]\n\n var layer = 0;\n\n // Use 'next_layer_checker' to fill layer_cache \n while(1) {\n // Add new layer to caches\n node_cache.push([])\n layer_cache.push(next_layer_checker(layer_cache[layer]))\n\n if (layer_cache[layer+1].length == 0) { \n layer_cache.pop()\n node_cache.pop()\n break;\n }\n layer++;\n }\n\n var tmp_node_ID\n\n // Use layer_cache to create nodes and fill node_cache\n for (layer = 1; layer < layer_cache.length; layer++) {\n for (var i = 0; i < layer_cache[layer].length; i++) {\n tmp_node_ID = create_node(featString_to_featID_map.get(layer_cache[layer][i]), layer)\n node_cache[layer].push(tmp_node_ID)\n } \n }\n\n // Decrement layer counter because it incremented beyond maximum layer in previous for loop\n layer--;\n\n // Create links starting from the highest layer and going to 0\n // Using 'node_cache'\n\n if (dev_mode_tmp) {\n console.log(\"layer_cache\")\n console.log(layer_cache.slice())\n console.log(\"node_cache\")\n console.log(node_cache)\n }\n\n // Link all nodes on final layer to appropriate root node\n for (var i = 0; i < node_cache[layer].length; i++) {\n links.push({\n source: feat_type,\n target: node_cache[layer][i]\n })\n }\n\n // For each layer (working backwards)\n for ( ; layer >= 0; layer--) {\n if (dev_mode_tmp) console.log(\"LAYER: \" + layer + \" ______________ TOP\")\n\n for (var i = 0; i < node_cache[layer].length; i++) {\n if (dev_mode_tmp) console.log(\"\\t\\I: \" + i)\n\n // Check each node cache layer\n for (var x = 0; x < layer /*node_cache.length */; x++) {\n if (dev_mode_tmp) console.log(\"\\t\\tX: \" + i)\n\n // Check each feat within each node cache layer\n for (var y = 0; y < node_cache[x].length; y++) {\n if (dev_mode_tmp) console.log(\"\\t\\t\\tY: \" + i)\n\n tmp_total_EI_PR = list_total_explicity_implicit_PR(nodeID_to_featID_map.get(node_cache[x][y]))\n\n if (dev_mode_tmp) {\n console.log(\"\\t\\t\\tTesting Here: (data, <node_cache[x][y]> array)\")\n console.log(node_cache[layer][i])\n console.log(tmp_total_EI_PR.explicit_prerequisites_ID)\n }\n\n if (array_contains(nodeID_to_featID_map.get(node_cache[layer][i]), tmp_total_EI_PR.explicit_prerequisites_ID)) {\n links.push({\n source: node_cache[layer][i],\n target: node_cache[x][y]\n })\n }\n\n if (tmp_total_EI_PR.explicit_prerequisites_ID.length == 0) {\n links.push({\n source: feat_type,\n target: node_cache[x][y]\n })\n }\n }\n }\n }\n }\n\n if (dev_mode_tmp) {\n console.log(\"Testing: \" + data_obj.name)\n console.log(list_total_explicity_implicit_PR(data_obj))\n\n console.log(\"-------------------END CREATE DEPENDANCEIS-------------------\")\n }\n}", "title": "" }, { "docid": "272d6788a1cbf7b4b487698567c9c552", "score": "0.60069275", "text": "depend() {\n if (Dep.target) {\n Dep.target.addDep(this);\n }\n }", "title": "" }, { "docid": "455be036f13d5b966e3a9f4273fcf444", "score": "0.6005025", "text": "function collectRecommendations({\n dependencies,\n declaredDependencies,\n optionalDependencies,\n externalDependencies,\n isEffect\n}) {\n // Our primary data structure.\n // It is a logical representation of property chains:\n // `props` -> `props.foo` -> `props.foo.bar` -> `props.foo.bar.baz`\n // -> `props.lol`\n // -> `props.huh` -> `props.huh.okay`\n // -> `props.wow`\n // We'll use it to mark nodes that are *used* by the programmer,\n // and the nodes that were *declared* as deps. Then we will\n // traverse it to learn which deps are missing or unnecessary.\n const depTree = createDepTree();\n\n function createDepTree() {\n return {\n isRequired: false,\n // True if used in code\n isSatisfiedRecursively: false,\n // True if specified in deps\n hasRequiredNodesBelow: false,\n // True if something deeper is used by code\n children: new Map() // Nodes for properties\n\n };\n } // Mark all required nodes first.\n // Imagine exclamation marks next to each used deep property.\n\n\n dependencies.forEach((_, key) => {\n const node = getOrCreateNodeByPath(depTree, key);\n node.isRequired = true;\n markAllParentsByPath(depTree, key, parent => {\n parent.hasRequiredNodesBelow = true;\n });\n }); // Mark all satisfied nodes.\n // Imagine checkmarks next to each declared dependency.\n\n declaredDependencies.forEach(({\n key\n }) => {\n const node = getOrCreateNodeByPath(depTree, key);\n node.isSatisfiedRecursively = true;\n });\n optionalDependencies.forEach(key => {\n const node = getOrCreateNodeByPath(depTree, key);\n node.isSatisfiedRecursively = true;\n }); // Tree manipulation helpers.\n\n function getOrCreateNodeByPath(rootNode, path) {\n let keys = path.split('.');\n let node = rootNode;\n\n for (let key of keys) {\n let child = node.children.get(key);\n\n if (!child) {\n child = createDepTree();\n node.children.set(key, child);\n }\n\n node = child;\n }\n\n return node;\n }\n\n function markAllParentsByPath(rootNode, path, fn) {\n let keys = path.split('.');\n let node = rootNode;\n\n for (let key of keys) {\n let child = node.children.get(key);\n\n if (!child) {\n return;\n }\n\n fn(child);\n node = child;\n }\n } // Now we can learn which dependencies are missing or necessary.\n\n\n let missingDependencies = new Set();\n let satisfyingDependencies = new Set();\n scanTreeRecursively(depTree, missingDependencies, satisfyingDependencies, key => key);\n\n function scanTreeRecursively(node, missingPaths, satisfyingPaths, keyToPath) {\n node.children.forEach((child, key) => {\n const path = keyToPath(key);\n\n if (child.isSatisfiedRecursively) {\n if (child.hasRequiredNodesBelow) {\n // Remember this dep actually satisfied something.\n satisfyingPaths.add(path);\n } // It doesn't matter if there's something deeper.\n // It would be transitively satisfied since we assume immutability.\n // `props.foo` is enough if you read `props.foo.id`.\n\n\n return;\n }\n\n if (child.isRequired) {\n // Remember that no declared deps satisfied this node.\n missingPaths.add(path); // If we got here, nothing in its subtree was satisfied.\n // No need to search further.\n\n return;\n }\n\n scanTreeRecursively(child, missingPaths, satisfyingPaths, childKey => path + '.' + childKey);\n });\n } // Collect suggestions in the order they were originally specified.\n\n\n let suggestedDependencies = [];\n let unnecessaryDependencies = new Set();\n let duplicateDependencies = new Set();\n declaredDependencies.forEach(({\n key\n }) => {\n // Does this declared dep satisfy a real need?\n if (satisfyingDependencies.has(key)) {\n if (suggestedDependencies.indexOf(key) === -1) {\n // Good one.\n suggestedDependencies.push(key);\n } else {\n // Duplicate.\n duplicateDependencies.add(key);\n }\n } else {\n if (isEffect && !key.endsWith('.current') && !externalDependencies.has(key)) {\n // Effects are allowed extra \"unnecessary\" deps.\n // Such as resetting scroll when ID changes.\n // Consider them legit.\n // The exception is ref.current which is always wrong.\n if (suggestedDependencies.indexOf(key) === -1) {\n suggestedDependencies.push(key);\n }\n } else {\n // It's definitely not needed.\n unnecessaryDependencies.add(key);\n }\n }\n }); // Then add the missing ones at the end.\n\n missingDependencies.forEach(key => {\n suggestedDependencies.push(key);\n });\n return {\n suggestedDependencies,\n unnecessaryDependencies,\n duplicateDependencies,\n missingDependencies\n };\n} // Finds functions declared as dependencies", "title": "" }, { "docid": "ec7560237fb89343b26002ed6af42e85", "score": "0.6000552", "text": "function updateDependencies() {\n dependencies.forEach(function (value, key, map) {\n try {\n map.set(key, document.getElementById('chkBox'+key).checked);\n } catch (e) {\n console.error(e);\n }\n });\n buildStaticInstructions();\n}", "title": "" }, { "docid": "73b476734144145cc5ea2c345c8f4af6", "score": "0.5987522", "text": "get deepDependencies() {\n const deps = new Set();\n const collect = module => {\n for (const dependency of module.dependencies) {\n if (!deps.has(dependency)) {\n deps.add(dependency);\n collect(dependency);\n }\n }\n };\n collect(this);\n return deps;\n }", "title": "" }, { "docid": "dc58ed745a8d67ee2dc13777ea661da6", "score": "0.5983671", "text": "resolveDependencies(inputs) {\n const dependencies = this.resolveInputDependencies(inputs);\n\n // Add stubs for non-standard functions in the beginning.\n dependencies.unshift(sourceHelpers.loadResource('stubs.js'));\n\n // Add our fuzzing support helpers. This also overrides some common test\n // functions from earlier dependencies that cause early bailouts.\n dependencies.push(sourceHelpers.loadResource('fuzz_library.js'));\n\n return dependencies;\n }", "title": "" }, { "docid": "081e4621f06897a2b65cd90ea7666b10", "score": "0.598346", "text": "[_buildDeps] () {\n process.emit('time', 'idealTree:buildDeps')\n const tree = this.idealTree.target\n tree.assertRootOverrides()\n this[_depsQueue].push(tree)\n // XXX also push anything that depends on a node with a name\n // in the override list\n log.silly('idealTree', 'buildDeps')\n this.addTracker('idealTree', tree.name, '')\n return this[_buildDepStep]()\n .then(() => process.emit('timeEnd', 'idealTree:buildDeps'))\n }", "title": "" }, { "docid": "3958e8ba47f4662693e7998ab4c160c4", "score": "0.5982546", "text": "depend() {\n if ( Dep.target ) {\n Dep.target.addDep( this );\n }\n }", "title": "" }, { "docid": "f8706172c1749ea9cdcfb6eef6939106", "score": "0.5974028", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n\t var immediateDeps = depGraph[fromName];\n\t if (immediateDeps) {\n\t Object.keys(immediateDeps).forEach(function (toName) {\n\t if (!collected[toName]) {\n\t collected[toName] = true;\n\t collectTransitiveDependencies(collected, depGraph, toName);\n\t }\n\t });\n\t }\n\t}", "title": "" }, { "docid": "84db16607ab28dc283f4d757ee63eec2", "score": "0.59623134", "text": "addDependency(...dependencies) {\n for (const dependency of dependencies) {\n this.dependencies.add(dependency);\n }\n }", "title": "" }, { "docid": "40dbded87a7a44e0412c927a8b03fce0", "score": "0.59605473", "text": "function PackageDependencyGraph(){\n this.dependencies = {};\n this.orderedPackages = [];\n this.noCycles = true;\n this.writeOut = function(){\n this.orderedPackages.foreach(function(pkg){\n console.log(pkg);\n });\n };\n\n }", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.59585434", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.59585434", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.59585434", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.59585434", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.59585434", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.59585434", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "6f639bfc66bc207a881ff141974ea17a", "score": "0.59585434", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function (toName) {\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n}", "title": "" }, { "docid": "ad3ad077ab1fd94f101dbee06146e224", "score": "0.592339", "text": "function getdependency(comp_array) {\n var styles = \"\";\n var resource = \"\";\n var theme = \"\";\n window.dependency_arr = [];\n theme = themeDeps(comp_array, window.dependentCollection[\"styles\"], window.dependentCollection[\"resources\"]);\n var packs = Object.keys(theme.compPack);\n dependency_arr = ['base','buttons/button'];\n var selectComparray = [];\n var colorpickercomponent = [];\n var filecomponent = [];\n for (var pack of packs) {\n\n for (var comp of theme.compPack[pack]) {\n if (comp_array.indexOf(comp) !== -1 || dependency_arr.indexOf(comp) !== -1 ) {\n \n var styledependency = pack + '/' + (comp === 'listview' ? 'list-view' : comp);\n selectComparray.push(styledependency);\n \n }\n else {\n if (((comp === \"color-picker\") && window.dependency_arr.indexOf('button') === -1) && comp !== \"file-manager\") {\n var styledependency = pack + '/' + comp;\n colorpickercomponent.push(styledependency);\n } else if (comp !== \"file-manager\") {\n var styledependencys = pack + '/' + (comp === 'listview' ? 'list-view' : comp);\n window.dependency_arr.push(styledependencys);\n } else {\n var styledependency = pack + '/' + comp;\n filecomponent.push(styledependency);\n }\n\n }\n \n\n }\n \n }\n window.dependency_arr.push('layouts/dashboardlayout');\n window.dependency_arr = window.dependency_arr.concat(selectComparray);\n window.dependency_arr = window.dependency_arr.concat(colorpickercomponent);\n window.dependency_arr = window.dependency_arr.concat(filecomponent);\n\n\n\n}", "title": "" }, { "docid": "bc65f5a1e34c1a876a91d81d2ab08e90", "score": "0.58939856", "text": "function buildDependencyPrequisites (pre, dependency) {\n pre.push({\n method: function (request, h) {\n return h.response(request.container.resolve(dependency))\n },\n assign: dependency\n })\n return pre\n}", "title": "" }, { "docid": "d32cf7fb43754eb3391ae7240661f0fb", "score": "0.5871895", "text": "addDependency(...dependencies) {\n constructs_1.Node.of(this).addDependency(...dependencies);\n }", "title": "" }, { "docid": "d32cf7fb43754eb3391ae7240661f0fb", "score": "0.5871895", "text": "addDependency(...dependencies) {\n constructs_1.Node.of(this).addDependency(...dependencies);\n }", "title": "" }, { "docid": "57a9679364005496ac8c10b250c6c034", "score": "0.58608085", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n for (var _i6 = 0, _Object$keys4 = Object.keys(immediateDeps); _i6 < _Object$keys4.length; _i6++) {\n var toName = _Object$keys4[_i6];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "186016aded7af5b1452cfd8daa7b718e", "score": "0.58556956", "text": "function getDependencies(tree) {\n // SOLUTION GOES HERE\n // Note: Feel free to add additional arguments\n // to this function for use with recursive calls.\n // Or not! There are many ways to recurse.\n}", "title": "" }, { "docid": "f1dcb85bfd0de1cc11d600010338845c", "score": "0.5852324", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n var _arr2 = Object.keys(immediateDeps);\n\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var toName = _arr2[_i3];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "f1dcb85bfd0de1cc11d600010338845c", "score": "0.5852324", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n var _arr2 = Object.keys(immediateDeps);\n\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var toName = _arr2[_i3];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "c5b248fbabd6c95e37511d6bd7a7f20c", "score": "0.5843813", "text": "get dependencies() {\n const found = new Map(); // Deduplication map\n const ret = new Array();\n for (const source of this.findAll()) {\n for (const dependable of Node.of(source)._dependencies) {\n for (const target of dependency_1.DependableTrait.get(dependable).dependencyRoots) {\n let foundTargets = found.get(source);\n if (!foundTargets) {\n found.set(source, foundTargets = new Set());\n }\n if (!foundTargets.has(target)) {\n ret.push({ source, target });\n foundTargets.add(target);\n }\n }\n }\n }\n return ret;\n }", "title": "" }, { "docid": "8ad743671b589490de607a0b77fd959b", "score": "0.58425194", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n for (var _i4 = 0, _Object$keys2 = Object.keys(immediateDeps); _i4 < _Object$keys2.length; _i4++) {\n var toName = _Object$keys2[_i4];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "c43d7043b3d4249cf23709fa7dc3b264", "score": "0.5834828", "text": "if (graph.dependencies.get(path)) {\n delta.modified.add(path);\n\n await traverseDependenciesForSingleFile(\n path,\n graph,\n delta,\n internalOptions,\n );\n }", "title": "" }, { "docid": "f1cdb93e1130d44d3a169f5949532942", "score": "0.58251375", "text": "function dependencies() {\n return project.splitDependencies()\n .pipe(project.rejoin());\n}", "title": "" }, { "docid": "6ae7390e9f0d0ce1b840620e636742ba", "score": "0.5822764", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n for (var _i3 = 0, _Object$keys2 = Object.keys(immediateDeps); _i3 < _Object$keys2.length; _i3++) {\n var toName = _Object$keys2[_i3];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "67cfe707cf13883383630e497f71e3db", "score": "0.58195", "text": "function re_dependency(re){var i,l,r\n switch(re[0]){\n case 0:\n case 1:\n case 8:\n return\n case 2:\n case 3:\n for(i=0,l=re[1].length;i<l;i++)\n if(r=re_dependency(re[1][i]))return r\n return\n case 4:\n return re_dependency(re[3])\n case 5:\n return re[1]\n case 6:\n case 7:\n return re_dependency(re[1])\n default:\n throw Error('re_dependency: unknown re type: '+re[0])}}", "title": "" }, { "docid": "2b25b3e070d885fc44adb0199c3f3562", "score": "0.5818193", "text": "constructor() {\n this.dependencies = {};\n }", "title": "" }, { "docid": "7922a4bed7b4ab3dba8e72e435840434", "score": "0.581543", "text": "constructor () {\n this.dependencies = []\n }", "title": "" }, { "docid": "a72e3d296c58fab4d72161e2d61e6fbb", "score": "0.5813163", "text": "function areDependenciesAvailable() {}", "title": "" }, { "docid": "aedb0fea82e1a7e3cf27edebf3dddfa6", "score": "0.5804771", "text": "addDependent(dependent, dependencies) { }", "title": "" }, { "docid": "b08e14ab6a166e5980d49ea1fc11f86b", "score": "0.58011365", "text": "get depends(){\r\n\t\treturn (this.dependencies ?? {})[this.path] }", "title": "" }, { "docid": "4e054285a55572daab278bf433e03e79", "score": "0.5799593", "text": "resetDependencies() {\n // we only need to resolve new dependencies if we're an automatic custos\n if (this.auto) this.needsLayout = true;\n }", "title": "" }, { "docid": "60bd3b1dcb22cf240112579435b88e7e", "score": "0.5795004", "text": "static get dependency() {\n throw new error.NotImplemented()\n }", "title": "" }, { "docid": "fec42e1c51364139d2becf0fd78f86ba", "score": "0.5777439", "text": "dependents (identifier) {\n const identifiers = _.castArray(identifier);\n\n const { items } = this;\n\n const directDependents = items\n .filter(item => hasSubArray(item.path, identifiers));\n\n const childDependents = directDependents\n .map(item => this.dependents(item.identifier))\n .reduce((acc, val) => acc.concat(val), []);\n\n return [...directDependents, ...childDependents];\n }", "title": "" }, { "docid": "11dfc338d7c116ca0a6d90812c15ec6f", "score": "0.5741501", "text": "function depends_example() {\n var deps = [];\n /* e.g.\n if (!$.fn.datetimepicker){\n $('head').append('<link rel=\"stylesheet\" href=\"' + ftui.config.basedir + 'lib/jquery.datetimepicker.css\" type=\"text/css\" />');\n deps.push(ftui.config.basedir + \"lib/jquery.datetimepicker.js\");\n }\n if(typeof window[\"Modul_label\"] === 'undefined'){\n deps.push('label');\n }\n */\n return deps;\n}", "title": "" }, { "docid": "050501d7978ea0bf169ddc719240bc54", "score": "0.57266086", "text": "async function buildDependency () {\n \n for(let entry of entries) {\n let entryModule = _app.modules.find(m => { return m.path === entry; });\n if (!entryModule) {\n console.error(chalk.red(`NO_ENTRY_POINT:`, entry));\n process.exit(1);\n }\n entryModule.skipReduce = true;\n entryModule.isUsed = true;\n console.log(chalk.bold.yellow('> STARTING:'), entry)\n await readModule(entryModule);\n }\n}", "title": "" }, { "docid": "77c2ed1ceebccb00dea4db545e817008", "score": "0.571897", "text": "addDependency(...dependencies) {\n for (const dependency of dependencies) {\n this._dependencies.add(dependency);\n }\n }", "title": "" }, { "docid": "aa8380576f80fa0bb1dc3d961ed5a813", "score": "0.5711849", "text": "getPrerequisites () {\n return []\n }", "title": "" }, { "docid": "62ff39165fad48ad0c8d10da28f5269a", "score": "0.5706334", "text": "function dependArray(value){\r\n for(let e, i = 0, l = value.length; i<l; i++){\r\n e = value[i]\r\n e && e.__ob__ && e.__ob__.dep.depend()\r\n if(Array.isArray(e)){\r\n dependArray(e)\r\n }\r\n }\r\n}", "title": "" }, { "docid": "7195c446c197d78813962e184e74d7d0", "score": "0.57060266", "text": "function depend () {\n\tvar args = Array.prototype.slice.call(arguments, 0);\n\tvar comp = args.shift();\n\tcomponents[comp] = {\n\t\tdependencies: args\n\t}\n\tprettyLog('info','COMPONENT ' + comp + ' DEFINED WITH DEPENDENCIES ' + (args.length ? args.join(', ') : '-NONE-'));\n\t\n}", "title": "" }, { "docid": "39e0d2bbeb05bf08c99b74f765e89924", "score": "0.5694381", "text": "function addDependency() {\n const value = document.getElementById('chkBoxInput').value;\n if(value === '' || dependencies.has(value)) return;\n const chkBoxContainer = document.getElementById('checkboxes');\n chkBoxContainer.innerHTML +=\n `<div class='form-group form-check'>\n <label class='form-check-label'>\n <input class='form-check-label' checked=\"true\" id=chkBox` + value + ` type='checkbox' onClick=\"updateDependencies()\">\n ` + value + `\n </label>\n </div>\\n`;\n dependencies.set(value, true);\n document.getElementById('chkBoxInput').value = '';\n buildStaticInstructions();\n}", "title": "" }, { "docid": "e7d7605294f539d3fd7c8f5f8370fe5d", "score": "0.56678504", "text": "function depends_filelog() {\n var deps = [];\n return deps;\n}", "title": "" }, { "docid": "9f5c716ce4c0523fe5bb77f87a257f02", "score": "0.5663704", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n if (!collected.has(fromName)) {\n collected.add(fromName);\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps !== undefined) {\n for (var _i8 = 0; _i8 < immediateDeps.length; _i8++) {\n var toName = immediateDeps[_i8];\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "9f5c716ce4c0523fe5bb77f87a257f02", "score": "0.5663704", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n if (!collected.has(fromName)) {\n collected.add(fromName);\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps !== undefined) {\n for (var _i8 = 0; _i8 < immediateDeps.length; _i8++) {\n var toName = immediateDeps[_i8];\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}", "title": "" }, { "docid": "2acd40c10a88e83a150e8c1721587b3c", "score": "0.56396735", "text": "_getResolvedDependencies(service) {\n let classDependencies = [];\n if(service.dependencies) {\n classDependencies = service.dependencies.map((dep) => {\n //All dependencies need to already be registered in the container\n return this.get(dep);\n });\n }\n return classDependencies;\n }", "title": "" }, { "docid": "cc780cd0406f28e4e7720ea55d423f7c", "score": "0.56234694", "text": "function registerDependencies(moduleEmitter, moduleName) {\n\n // Register depends on parent\n if (calipso.modules[moduleName].fn && calipso.modules[moduleName].fn.depends) {\n calipso.modules[moduleName].fn.depends.forEach(function (dependentModule) {\n moduleEmitter.modules[moduleName].check[dependentModule] = false;\n });\n }\n}", "title": "" }, { "docid": "095c21e848155e0eab503e77a8966e7c", "score": "0.5617004", "text": "populatePeerPackageDependencies(): void {\n const componentMap = this.component.componentMap;\n const getPeerDependencies = (): Object => {\n const packageJson = this._getPackageJson();\n if (packageJson && packageJson.peerDependencies) return packageJson.peerDependencies;\n if (this.component.componentFromModel && componentMap.origin !== COMPONENT_ORIGINS.AUTHORED) {\n return this.component.componentFromModel.peerPackageDependencies;\n }\n return {};\n };\n const projectPeerDependencies = getPeerDependencies();\n const peerPackages = {};\n if (R.isEmpty(projectPeerDependencies)) return;\n\n // check whether the peer-dependencies was actually require in the code. if so, remove it from\n // the packages/dev-packages and add it as a peer-package.\n // if it was not required in the code, don't add it to the peerPackages\n Object.keys(projectPeerDependencies).forEach((pkg) => {\n if (this.overridesDependencies.shouldIgnorePeerPackage(pkg)) return;\n ['packageDependencies', 'devPackageDependencies'].forEach((field) => {\n if (Object.keys(this.allPackagesDependencies[field]).includes(pkg)) {\n delete this.allPackagesDependencies[field][pkg];\n peerPackages[pkg] = projectPeerDependencies[pkg];\n }\n });\n });\n this.allPackagesDependencies.peerPackageDependencies = peerPackages;\n }", "title": "" }, { "docid": "1dc933ecab9796d9b496c679b230bc29", "score": "0.5603385", "text": "function requireDeps() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad','$q', function ($ocLL, $q) {\n // Creates a promise chain for each argument\n var promise = $q.when(1); // empty promise\n for(var i=0, len=_args.length; i < len; i ++){\n promise = addThen(_args[i]);\n }\n return promise;\n\n // creates promise to chain dynamically\n function addThen(_arg) {\n // also support a function that returns a promise\n if(typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function() {\n // if is a module, pass the name. If not, pass the array\n var whatToLoad = getRequired(_arg);\n // simple error check\n if(!whatToLoad) return $.error('Route resolve: Bad resource name [' + _arg + ']');\n // finally, return a promise\n return $ocLL.load( whatToLoad );\n });\n }\n // check and returns required data\n // analyze module items with the form [name: '', files: []]\n // and also simple array of script files (for not angular js)\n function getRequired(name) {\n if (appDependencies.modules)\n for(var m in appDependencies.modules)\n if(appDependencies.modules[m].name && appDependencies.modules[m].name === name)\n return appDependencies.modules[m];\n return appDependencies.scripts && appDependencies.scripts[name];\n }\n\n }]};\n }", "title": "" }, { "docid": "6e06813b71826a73459ca39e3df2d84f", "score": "0.5600294", "text": "injectIntoDependence () {\n const dependence = new Dependence(this.module || this.name)\n if (!this.module) dependence.resolved = false\n dependence.addChild(this.name)\n\n return dependence\n }", "title": "" }, { "docid": "3fd6392b2af30b8af57a299eda6291d2", "score": "0.5593389", "text": "_generateLibrary() {}", "title": "" }, { "docid": "20022afa7edd8834b674c4367d2af307", "score": "0.5584157", "text": "function resolveDeps(dependency) {\n function processDep(depId) {\n\t var dep_dependency = parseDependencyId(depId);\n\t dependency.dependencies.push(dep_dependency);\n\t dep_dependency.requirers.push(dependency); \n\t if (dep_dependency.resource.status === 'new') {\n log(I,'queueing ' + dep_dependency.id );\n\t depstack.push(dep_dependency);\n\t dep_dependency.resource.status = 'queued'; }\n\t else {\n\t if (dep_dependency.resource.status === 'loaded') {\n\t log(I, 'The resource for this dependency has already been loaded: ' + dep_dependency.id ); \n\t if (dep_dependency.isBonus) {\n\t dep_dependency.isBonus = false;\n\t //make quasi browser callback, as if we just loaded this new definer\n\t //though it had come for free with a previous resourceLoad\n\t setTimeout(function() { timeouts_pending--;\n\t\t\t\t processDependency(dep_dependency); \n\t\t\t\t endThread(); }, 0);\n\t timeouts_pending++;\n\t log(I, 'This is a bonus definer being activated.. ,setting callback'); \n\t }\n\t } \n\t else log(I,'this dependency is already queued: ' + dep_dependency.id); \n\t }\n }\n var definer = dependency.definer;\n if (definer) {\n\t log(I,'Resolving deps for ' + dependency.id);\n\t log(I, definer.load, definer.inject);\n\t definer.load.forEach(processDep);\n\t definer.inject.forEach(processDep); } \n }", "title": "" }, { "docid": "f1fbebc8da540df7edeeaa4ceb61f590", "score": "0.55778134", "text": "function dependArray (value) {\n for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n }", "title": "" }, { "docid": "263a34039bb5d52c4ecbe5f49c955dfe", "score": "0.5570528", "text": "function disableBrokenDependencies() {\n\n var disabled = 0;\n for (var moduleName in calipso.modules) {\n var module = calipso.modules[moduleName];\n if (module.enabled && module.fn && module.fn.depends) {\n module.fn.depends.forEach(function (dependentModule) {\n if (!calipso.modules[dependentModule].enabled) {\n calipso.modules[module.name].error = \"Module \" + module.name + \" depends on \" + dependentModule + \", but it does not exist or is disabled - this module will not load.\";\n calipso.error(calipso.modules[module.name].error);\n calipso.modules[module.name].enabled = false;\n disabled = disabled + 1;\n }\n });\n }\n }\n\n // Recursive\n if (disabled > 0) {\n disableBrokenDependencies();\n }\n\n}", "title": "" }, { "docid": "4efb7d502a9234a15639af44e1234031", "score": "0.556399", "text": "function newDependants(load) {\n\t\tvar out = [];\n\t\tvar deps = this.getDependants(load.name);\n\t\tvar shakenParents = load.metadata.shakenParents;\n\t\tif (!shakenParents) {\n\t\t\tout = deps;\n\t\t} else {\n\t\t\tfor (var i = 0; i < deps.length; i++) {\n\t\t\t\tif (shakenParents.indexOf(deps[i]) === -1) {\n\t\t\t\t\tout.push(deps[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}", "title": "" }, { "docid": "fd20adb692a0ba2a484bc2de3ccbcfa5", "score": "0.5552162", "text": "function dependArray(value) {\n for (let e, i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n }", "title": "" }, { "docid": "2c6a268d3439427f29826938d37931e6", "score": "0.5547729", "text": "function dependenciesFromGlobalMetadata(type,outputCtx,reflector){// Use the `CompileReflector` to look up references to some well-known Angular types. These will\n// be compared with the token to statically determine whether the token has significance to\n// Angular, and set the correct `R3ResolvedDependencyType` as a result.\nvar injectorRef=reflector.resolveExternalReference(Identifiers.Injector);// Iterate through the type's DI dependencies and produce `R3DependencyMetadata` for each of them.\nvar deps=[];for(var _iterator6=type.diDeps,_isArray6=Array.isArray(_iterator6),_i16=0,_iterator6=_isArray6?_iterator6:_iterator6[Symbol.iterator]();;){var _ref28;if(_isArray6){if(_i16>=_iterator6.length)break;_ref28=_iterator6[_i16++]}else{_i16=_iterator6.next();if(_i16.done)break;_ref28=_i16.value}var dependency=_ref28;if(dependency.token){var tokenRef=tokenReference(dependency.token);var resolved=dependency.isAttribute?R3ResolvedDependencyType.Attribute:R3ResolvedDependencyType.Token;// In the case of most dependencies, the token will be a reference to a type. Sometimes,\n// however, it can be a string, in the case of older Angular code or @Attribute injection.\nvar token=tokenRef instanceof StaticSymbol?outputCtx.importExpr(tokenRef):literal(tokenRef);// Construct the dependency.\ndeps.push({token:token,resolved:resolved,host:!!dependency.isHost,optional:!!dependency.isOptional,self:!!dependency.isSelf,skipSelf:!!dependency.isSkipSelf})}else{unsupported(\"dependency without a token\")}}return deps}", "title": "" }, { "docid": "d0ce524bed279fb351fe0de43cecdfab", "score": "0.5541791", "text": "resolveDependency(dependency, builtFiles) {\n const file = dependency.asIfTo;\n return new Promise((resolve, reject) => {\n const resultDir = path.dirname(path.resolve(this.resultPath, path.relative(this.sourcePath, file)));\n const resultPath = path.join(resultDir, FsUtil.setExtension(path.basename(file), '._include_.html'));\n if (builtFiles.has(resultPath)) {\n return resolve();\n }\n builtFiles.add(resultPath);\n\n /**\n * @type {FileConfig}\n */\n const fileConfig = {\n baseUrlMap: this.baseUrlMap,\n baseUrl: this.baseUrl,\n rootPath: this.rootPath,\n headerIdMap: {},\n };\n const pageSources = new PageSources();\n const componentPreprocessor = new ComponentPreprocessor(fileConfig, this.variableProcessor,\n pageSources);\n const componentParser = new ComponentParser(fileConfig);\n\n return fs.readFileAsync(dependency.to, 'utf-8')\n .then(result => this.variableProcessor.renderPage(dependency.to, result))\n .then(result => componentPreprocessor.includeFile(dependency.to, result, file))\n .then(result => Page.removeFrontMatter(result))\n .then(result => this.collectPluginSources(result))\n .then(result => this.preRender(result))\n .then(result => componentParser.render(dependency.to, result, file))\n .then(result => this.postRender(result))\n .then(result => this.collectPluginsAssets(result))\n .then(result => Page.unwrapIncludeSrc(result))\n .then((result) => {\n const outputContentHTML = this.disableHtmlBeautify\n ? result\n : htmlBeautify(result, Page.htmlBeautifyOptions);\n return fs.outputFileAsync(resultPath, outputContentHTML);\n })\n .then(() => {\n // Recursion call to resolve nested dependency\n const resolvingFiles = [];\n Page.unique(pageSources.getDynamicIncludeSrc()).forEach((src) => {\n if (!FsUtil.isUrl(src.to)) {\n resolvingFiles.push(this.resolveDependency(src, builtFiles));\n }\n });\n return Promise.all(resolvingFiles);\n })\n .then(() => {\n this.collectIncludedFiles(pageSources.getDynamicIncludeSrc());\n this.collectIncludedFiles(pageSources.getStaticIncludeSrc());\n this.collectIncludedFiles(pageSources.getMissingIncludeSrc());\n })\n .then(resolve)\n .catch(reject);\n });\n }", "title": "" }, { "docid": "89745bc299822438eff4daa9d5c1da09", "score": "0.5525291", "text": "_retrieveAndMergeExistingDependencies(dependenciesKeyStringMap){const{_ldsCache}=this;const ldsCacheName=_ldsCache.cacheName;const cacheDepsCacheKey=new LdsCacheDependenciesCacheKeyBuilder().setLdsCacheName(ldsCacheName).build();const thenable=_ldsCache.getValue(cacheDepsCacheKey).then(dependencyMapCacheValue=>{if(!dependencyMapCacheValue||!dependencyMapCacheValue.dependencies){// Nothing to merge; return the input unchanged.\n return dependenciesKeyStringMap;}const mergedDependenciesMap=new Map(dependenciesKeyStringMap);const depsObjectArray=Object.entries(dependencyMapCacheValue.dependencies);for(let len=depsObjectArray.length,n=0;n<len;n++){const[keyString,arrayOfKeyStrings]=depsObjectArray[n];// In the cached depsObject, key should be a string and value should be an array of strings.\n let set=mergedDependenciesMap.get(keyString);if(!set){set=new UsefulSet();mergedDependenciesMap.set(keyString,set);}set.addAll(arrayOfKeyStrings);}return mergedDependenciesMap;});return thenable;}", "title": "" }, { "docid": "62a89277685c2bbf773412be4d2a307d", "score": "0.55179125", "text": "getDependentFiles(fixedModules) {\n let implicitDeps = this.implicitDependencies(fixedModules);\n let sorted = require('toposort')(implicitDeps);\n debug('sorted dependencies %o', sorted);\n return sorted.filter((file) => !fixedModules.has(file));\n }", "title": "" }, { "docid": "baec1eff1c0250e7ffabf37f7c25c7c6", "score": "0.5516575", "text": "async _writeDependencies() {\n const projectCfg = this.config.get('project');\n const githubCfg = this.config.get('github');\n\n const dependencies = merge(projectCfg.dependencies, await this._fetchDependenciesVersion(['leaflet', 'proj4']));\n\n // applying a different set of dependencies for the react-boilerplate that contains backwards\n // incompatible changes\n const enzymeDeps =\n githubCfg.tag.version.major === 4\n ? await this._fetchDependenciesVersion(['enzyme', 'enzyme-adapter-react-16', 'enzyme-to-json'])\n : {};\n\n const devDependencies = merge(\n projectCfg.devDependencies,\n await this._fetchDependenciesVersion([\n 'babel-plugin-inline-react-svg',\n 'dyson-generators',\n 'dyson-image',\n 'npm-run-all',\n 'dyson',\n ]),\n enzymeDeps,\n );\n\n if (githubCfg.tag.version.major === 4) {\n this._writeJestConfig();\n }\n\n const packageJson = this.config.get('packageJson');\n const merged = merge(packageJson, { dependencies, devDependencies });\n\n this.config.set('packageJson', merged);\n }", "title": "" }, { "docid": "8d2e6eae7fa290b4bd9f118fb692754d", "score": "0.5516099", "text": "function dependArray(value) {\n for (var e = void 0, i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n }", "title": "" }, { "docid": "8d2e6eae7fa290b4bd9f118fb692754d", "score": "0.5516099", "text": "function dependArray(value) {\n for (var e = void 0, i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n }", "title": "" }, { "docid": "d27581dd54b751ce087f069b0b060466", "score": "0.55076337", "text": "function buildDependencyPaths(self, context) {\n var dependencies = {};\n\n context.__dependencyPaths__.forEach(function (p) {\n var dep = new DependencyFile(p, self.environment.stat(p).mtime,\n self.environment.getFileDigest(p));\n dependencies[JSON.stringify(dep)] = dep;\n });\n\n _.forEach(context.__dependencyAssets__, function (p) {\n var dep, asset;\n\n if (p === self.pathname) {\n dep = new DependencyFile(p, self.environment.stat(p).mtime,\n self.environment.getFileDigest(p));\n dependencies[JSON.stringify(dep)] = dep;\n return;\n }\n\n asset = self.environment.findAsset(p, { bundle: false });\n\n if (asset) {\n asset.dependencyPaths.forEach(function (dep) {\n dependencies[JSON.stringify(dep)] = dep;\n });\n }\n });\n\n prop(self, '__dependencyPaths__', _.values(dependencies));\n}", "title": "" }, { "docid": "b08b9d87855f9b9c578caea931527640", "score": "0.5500202", "text": "get allDeps() {\n var _a, _b;\n const fromParent = (_b = (_a = this.parentGraph) === null || _a === void 0 ? void 0 : _a.allDeps) !== null && _b !== void 0 ? _b : [];\n return [...this.dependencies, ...fromParent];\n }", "title": "" }, { "docid": "351eedcd371094bb241c44ddc6c006bc", "score": "0.5495897", "text": "function dependArray(value) {\n\t for (var e = void 0, i = 0, l = value.length; i < l; i++) {\n\t e = value[i];\n\t e && e.__ob__ && e.__ob__.dep.depend();\n\n\t if (Array.isArray(e)) {\n\t dependArray(e);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "80978cfa49df1ffd33be2d22f9ded168", "score": "0.5494274", "text": "function dependArray(value) {\n for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n }", "title": "" }, { "docid": "8e77c4b1ad6fd31309ee09e01508de2e", "score": "0.54905534", "text": "function dependArray (value) {\n for (let e, i = 0, l = value.length; i < l; i++) {\n e = value[i]\n e && e.__ob__ && e.__ob__.dep.depend()\n if (Array.isArray(e)) {\n dependArray(e)\n }\n }\n}", "title": "" }, { "docid": "b49bbfbc45302c6c6af4633fc92daa4d", "score": "0.5486893", "text": "function registerModuleDependencies(module) {\n\n if (module.fn && module.fn.depends && module.enabled) {\n\n // Create object to hold dependent status\n module.check = {};\n\n // Register depends on parent\n module.fn.depends.forEach(function (dependentModule) {\n\n module.check[dependentModule] = false;\n\n if (calipso.modules[dependentModule] && calipso.modules[dependentModule].enabled) {\n\n // Create a notification array to allow this module to notify modules that depend on it\n calipso.modules[dependentModule].notify = calipso.modules[dependentModule].notify || [];\n calipso.modules[dependentModule].notify.push(module.name);\n\n } else {\n\n calipso.modules[module.name].error = \"Module \" + module.name + \" depends on \" + dependentModule + \", but it does not exist or is disabled - this module will not load.\";\n calipso.error(calipso.modules[module.name].error);\n calipso.modules[module.name].enabled = false;\n\n }\n\n });\n\n }\n\n}", "title": "" }, { "docid": "a3b636f3a9cffbdb2691073612ef2f12", "score": "0.548454", "text": "function getDependencyListForGraph(graph) {\n // We need to do this because if A dependecy on bundled B\n // And A has a secondary entry point A/1 we want only to bundle B if it's used.\n // Also if A/1 depends on A we don't want to bundle A thus we mark this a dependency.\n const dependencyList = {\n dependencies: [],\n bundledDependencies: []\n };\n for (const entry of graph.filter(nodes_1.isEntryPoint)) {\n const { bundledDependencies = [], dependencies = {}, peerDependencies = {} } = entry.data.entryPoint.packageJson;\n dependencyList.bundledDependencies = array_1.unique(dependencyList.bundledDependencies.concat(bundledDependencies));\n dependencyList.dependencies = array_1.unique(dependencyList.dependencies.concat(Object.keys(dependencies), Object.keys(peerDependencies), entry.data.entryPoint.moduleId));\n }\n return dependencyList;\n}", "title": "" }, { "docid": "a1b95697b3cf5776e982a6c4c5e90b63", "score": "0.5475931", "text": "function dependArray (value) {\n for (let e, i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n}", "title": "" }, { "docid": "284c663f65e2891f99cc0f64b005c999", "score": "0.5472476", "text": "_getTransitiveDependencies(keyStringsIterable,dependenciesKeyStringMap){const transitiveDepsSet=new UsefulSet();const dependencySetsToProcess=[];const keyStringsArray=Array.from(keyStringsIterable);for(let len=keyStringsArray.length,n=0;n<len;n++){const keyString=keyStringsArray[n];const nextSet=dependenciesKeyStringMap.get(keyString);if(nextSet){dependencySetsToProcess.push(nextSet);}}while(dependencySetsToProcess.length>0){const dependencySet=dependencySetsToProcess.shift();if(dependencySet){const dependencySetArray=Array.from(dependencySet.values());for(let len=dependencySetArray.length,n=0;n<len;n++){const keyString=dependencySetArray[n];if(!transitiveDepsSet.has(keyString)){transitiveDepsSet.add(keyString);const nextSet=dependenciesKeyStringMap.get(keyString);if(nextSet){dependencySetsToProcess.push(nextSet);}}}}}return transitiveDepsSet;}", "title": "" }, { "docid": "6a29ae47eeaf568ee7237a1007fe095d", "score": "0.54715675", "text": "injectCollectionIntoDependence () {\n if (this.collectionName) {\n const dependence = new Dependence(this.getCollectionModule())\n dependence.addChild(this.collectionName)\n\n return dependence\n }\n return ''\n }", "title": "" }, { "docid": "c21419a4d0b874cf19e9582b8c335f5f", "score": "0.547062", "text": "function dependenciesFromGlobalMetadata(type, outputCtx, reflector) {\n var e_1, _a;\n // Use the `CompileReflector` to look up references to some well-known Angular types. These will\n // be compared with the token to statically determine whether the token has significance to\n // Angular, and set the correct `R3ResolvedDependencyType` as a result.\n var injectorRef = reflector.resolveExternalReference(Identifiers.Injector);\n // Iterate through the type's DI dependencies and produce `R3DependencyMetadata` for each of them.\n var deps = [];\n try {\n for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(type.diDeps), _c = _b.next(); !_c.done; _c = _b.next()) {\n var dependency = _c.value;\n if (dependency.token) {\n var tokenRef = tokenReference(dependency.token);\n var resolved = dependency.isAttribute ?\n R3ResolvedDependencyType.Attribute :\n R3ResolvedDependencyType.Token;\n // In the case of most dependencies, the token will be a reference to a type. Sometimes,\n // however, it can be a string, in the case of older Angular code or @Attribute injection.\n var token = tokenRef instanceof StaticSymbol ? outputCtx.importExpr(tokenRef) : literal(tokenRef);\n // Construct the dependency.\n deps.push({\n token: token,\n resolved: resolved,\n host: !!dependency.isHost,\n optional: !!dependency.isOptional,\n self: !!dependency.isSelf,\n skipSelf: !!dependency.isSkipSelf,\n });\n }\n else {\n unsupported('dependency without a token');\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return deps;\n}", "title": "" }, { "docid": "c21419a4d0b874cf19e9582b8c335f5f", "score": "0.547062", "text": "function dependenciesFromGlobalMetadata(type, outputCtx, reflector) {\n var e_1, _a;\n // Use the `CompileReflector` to look up references to some well-known Angular types. These will\n // be compared with the token to statically determine whether the token has significance to\n // Angular, and set the correct `R3ResolvedDependencyType` as a result.\n var injectorRef = reflector.resolveExternalReference(Identifiers.Injector);\n // Iterate through the type's DI dependencies and produce `R3DependencyMetadata` for each of them.\n var deps = [];\n try {\n for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(type.diDeps), _c = _b.next(); !_c.done; _c = _b.next()) {\n var dependency = _c.value;\n if (dependency.token) {\n var tokenRef = tokenReference(dependency.token);\n var resolved = dependency.isAttribute ?\n R3ResolvedDependencyType.Attribute :\n R3ResolvedDependencyType.Token;\n // In the case of most dependencies, the token will be a reference to a type. Sometimes,\n // however, it can be a string, in the case of older Angular code or @Attribute injection.\n var token = tokenRef instanceof StaticSymbol ? outputCtx.importExpr(tokenRef) : literal(tokenRef);\n // Construct the dependency.\n deps.push({\n token: token,\n resolved: resolved,\n host: !!dependency.isHost,\n optional: !!dependency.isOptional,\n self: !!dependency.isSelf,\n skipSelf: !!dependency.isSkipSelf,\n });\n }\n else {\n unsupported('dependency without a token');\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return deps;\n}", "title": "" }, { "docid": "c21419a4d0b874cf19e9582b8c335f5f", "score": "0.547062", "text": "function dependenciesFromGlobalMetadata(type, outputCtx, reflector) {\n var e_1, _a;\n // Use the `CompileReflector` to look up references to some well-known Angular types. These will\n // be compared with the token to statically determine whether the token has significance to\n // Angular, and set the correct `R3ResolvedDependencyType` as a result.\n var injectorRef = reflector.resolveExternalReference(Identifiers.Injector);\n // Iterate through the type's DI dependencies and produce `R3DependencyMetadata` for each of them.\n var deps = [];\n try {\n for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(type.diDeps), _c = _b.next(); !_c.done; _c = _b.next()) {\n var dependency = _c.value;\n if (dependency.token) {\n var tokenRef = tokenReference(dependency.token);\n var resolved = dependency.isAttribute ?\n R3ResolvedDependencyType.Attribute :\n R3ResolvedDependencyType.Token;\n // In the case of most dependencies, the token will be a reference to a type. Sometimes,\n // however, it can be a string, in the case of older Angular code or @Attribute injection.\n var token = tokenRef instanceof StaticSymbol ? outputCtx.importExpr(tokenRef) : literal(tokenRef);\n // Construct the dependency.\n deps.push({\n token: token,\n resolved: resolved,\n host: !!dependency.isHost,\n optional: !!dependency.isOptional,\n self: !!dependency.isSelf,\n skipSelf: !!dependency.isSkipSelf,\n });\n }\n else {\n unsupported('dependency without a token');\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return deps;\n}", "title": "" }, { "docid": "c21419a4d0b874cf19e9582b8c335f5f", "score": "0.547062", "text": "function dependenciesFromGlobalMetadata(type, outputCtx, reflector) {\n var e_1, _a;\n // Use the `CompileReflector` to look up references to some well-known Angular types. These will\n // be compared with the token to statically determine whether the token has significance to\n // Angular, and set the correct `R3ResolvedDependencyType` as a result.\n var injectorRef = reflector.resolveExternalReference(Identifiers.Injector);\n // Iterate through the type's DI dependencies and produce `R3DependencyMetadata` for each of them.\n var deps = [];\n try {\n for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(type.diDeps), _c = _b.next(); !_c.done; _c = _b.next()) {\n var dependency = _c.value;\n if (dependency.token) {\n var tokenRef = tokenReference(dependency.token);\n var resolved = dependency.isAttribute ?\n R3ResolvedDependencyType.Attribute :\n R3ResolvedDependencyType.Token;\n // In the case of most dependencies, the token will be a reference to a type. Sometimes,\n // however, it can be a string, in the case of older Angular code or @Attribute injection.\n var token = tokenRef instanceof StaticSymbol ? outputCtx.importExpr(tokenRef) : literal(tokenRef);\n // Construct the dependency.\n deps.push({\n token: token,\n resolved: resolved,\n host: !!dependency.isHost,\n optional: !!dependency.isOptional,\n self: !!dependency.isSelf,\n skipSelf: !!dependency.isSkipSelf,\n });\n }\n else {\n unsupported('dependency without a token');\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return deps;\n}", "title": "" }, { "docid": "9c7f5ad5b60d7f3cfdb8221a2ee88d7f", "score": "0.54706144", "text": "function dependArray (value) {\n for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n }", "title": "" }, { "docid": "9c7f5ad5b60d7f3cfdb8221a2ee88d7f", "score": "0.54706144", "text": "function dependArray (value) {\n for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n }", "title": "" }, { "docid": "9c7f5ad5b60d7f3cfdb8221a2ee88d7f", "score": "0.54706144", "text": "function dependArray (value) {\n for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n }", "title": "" }, { "docid": "9c7f5ad5b60d7f3cfdb8221a2ee88d7f", "score": "0.54706144", "text": "function dependArray (value) {\n for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n }", "title": "" } ]
fc21c30a874a39e61dd20ca4f33109e8
13) Swap String For Array Negative Values
[ { "docid": "1921c93af551c1772c53938e3d0c9aea", "score": "0.80987567", "text": "function SwapStringForArrayNegativeVals(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 'dojo';\n }\n }\n return arr;\n}", "title": "" } ]
[ { "docid": "cfe24984d3ab59bee6ede6e884111e6e", "score": "0.8090563", "text": "function swapStringForArrayNegativeVals(arr)\n{ \n for (var idx = 0; idx < arr.length; idx++) \n {\n if (arr[idx] < 0 ) \n { \n arr[idx] = \"Dojo\";\n } \n } \n return arr ;\n}", "title": "" }, { "docid": "4e830a58d0baf26589c71cd811858f67", "score": "0.80785036", "text": "function SwapStringForArrayNegativeVals(arr){\n\tfor (var i=0;i<arr.length;i++){\n\t\tif (arr[i] < 0){\n\t\t\tarr[i] = \"dojo\"\n\t\t}\n\t}\n\treturn arr\n}", "title": "" }, { "docid": "f98fb4a34aefcba7178b380a86cd577b", "score": "0.7825074", "text": "function swapNegative(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = \"Dojo\";\n }\n }\n return arr;\n}", "title": "" }, { "docid": "43507fdd232afa5c753c2b97275994f5", "score": "0.7757759", "text": "function swapStringForArrayNegativeVals(arr) {\n for (const i in arr) {\n if (arr[i] < 0) arr[i] = 'Dojo';\n }\n return arr;\n}", "title": "" }, { "docid": "fe288bc094304be2ecc933cd4cecfc3a", "score": "0.74950045", "text": "function swapNegatives(arr) {\n\tfor (var i = 0; i< arr.length; i++) {\n\t\tif (arr[i] < 0) {\n\t\t\tarr[i] = \"Dojo\"\n\t\t}\n\t}\n\tconsole.log(arr);\n\treturn arr;\n}", "title": "" }, { "docid": "d6e94bf4cb2f5012527f6ee1cdc83ea5", "score": "0.7373801", "text": "function swapStrings(arr) {\r\n for (var i = 0; i < arr.length; i++) {\r\n if(arr[i] < 0) {\r\n arr[i] = 'dojo';\r\n }\r\n }\r\n console.log(arr);\r\n}", "title": "" }, { "docid": "d8089860e18ea0e2f74c275b9c050d1a", "score": "0.73373264", "text": "function replaceNegative(arr){\n for(let i =0; i<arr.length; i++){\n if(arr[i]<0){\n arr[i]= \"Dojo\";\n }\n }\n return arr;\n }", "title": "" }, { "docid": "001bde109e41bf606d826da52a922ff8", "score": "0.69102865", "text": "function NegativeToString(arr) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 'dojo';\n }\n }\n console.log(arr);\n}", "title": "" }, { "docid": "b68acc035e9e3331a66f1ef035d3fb26", "score": "0.6905844", "text": "function replaceNegatives(arr) {\n for(var i = 0; i < arr.length; i++) {\n if (arr[i]<0) {\n arr[i]=\"Dojo\";\n }\n }\n return arr;\n}", "title": "" }, { "docid": "7e29bf0e9fa06f851b8be7d466d69040", "score": "0.68958545", "text": "function swapNegsWithString(arr) {\n\n if (arr.length === 0) {\n\n return 'Array is empty'\n\n }\n\n for (var i = 0; i < arr.length; i++) {\n\n if (arr[i] < 0) {\n\n arr[i] = 'Dojo'\n\n }\n\n }\n\n return arr;\n\n}", "title": "" }, { "docid": "8c164b8f855dd98d7036a763adf60b6e", "score": "0.6880562", "text": "function flip(temp) {\n\tfor (let i = 0; i < temp.length; i++) {\n\t\tif (temp[i] == \"-\") {\n\t\t\ttemp[i] = \"+\";\n\t\t} else {\n\t\t\ttemp[i] = \"-\";\n\t\t}\n\t}\n}", "title": "" }, { "docid": "da16c3c9e7ec92165a5f36bb4c73702c", "score": "0.67665935", "text": "function negative(array){\n\tvar length = array.length;\n\tfor(var i = 0; i < length; i++){\n\t\tif(array[i] < 0){\n\t\t\tarray[i] = 'Dojo';\n\t\t}\n\t}\n\treturn array;\n}", "title": "" }, { "docid": "ef9938b9c7791c12f525382f10249246", "score": "0.6666074", "text": "function swap(index, arr){\n // create a copy of given word array to ensure not modifying the main array\n var arr2 = arr.slice(0);\n\n // extract elements to swap\n const current = arr[index - 1];\n const toSwap = arr[index];\n\n // assign new values and return string value\n arr2[index - 1] = toSwap;\n arr2[index] = current;\n return arr2.join('');\n }", "title": "" }, { "docid": "115688e4d8641878d4060008d241ae79", "score": "0.66165876", "text": "function swapNegatives(arr){\r\n for (var i = 0; i < arr.length; i++){\r\n if (arr[i] < 0){\r\n arr[i] = 0;\r\n }\r\n }\r\n console.log(arr);\r\n}", "title": "" }, { "docid": "a4fe0d9d24d900bb349c61905215aefe", "score": "0.631734", "text": "function dojoSwap(arr) {\r\n for (var i = 0; i < arr.length; i++){\r\n if (arr[i] < 0){\r\n arr[i] = \"Dojo\";\r\n }\r\n }\r\n console.log(arr);\r\n }", "title": "" }, { "docid": "12ac81a23150dacf3cf3760dd8faaa14", "score": "0.62974954", "text": "function replaceNegatives(array){\n for (var i = 0; i < array.length; i++) {\n if (array[i] < 0){\n array[i] = 0;\n }\n }\n return array;\n}", "title": "" }, { "docid": "91b5c9f84d66916e44ae540433749e35", "score": "0.6258966", "text": "function negDojo(arr){\n for(var i=0; i<arr.length; i++){\n if(arr[i] < 0){\n arr[i] = \"Dojo\";\n }\n }\n console.log(arr);\n}", "title": "" }, { "docid": "a48d911f06a02d74a7a9a251c4f405f8", "score": "0.6229422", "text": "function resetNegativetoString(x){\n for (var i = 0; i< x.length; i++){\n if (x[i]<0){\n x[i] = 'Dojo';\n }\n }\n return x;\n}", "title": "" }, { "docid": "ff6bc5b8df0be736581fa6109e0cb08e", "score": "0.6196647", "text": "function mirrored(arr) {\n return arr.map(function (item) {\n return item + item.toString().split(\"\").reverse().join(\"\");\n })\n}", "title": "" }, { "docid": "f42d3976585b8e03f417b0b4258deddd", "score": "0.617026", "text": "function swapArr(s) {\r\n var newZero = 0;\r\n var oldZero = s[0];\r\n var newLast = 0;\r\n var indexLast = s.length - 1;\r\n var oldLast = s[indexLast];\r\n newZero = oldLast;\r\n newLast = oldZero;\r\n\r\n s.splice(0, 1, newZero);\r\n s.splice(indexLast, 1, newLast);\r\n\r\n return s;\r\n}", "title": "" }, { "docid": "cd33c7f8eac6929cf53d5e23caa2f445", "score": "0.61561346", "text": "function negativesToString(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 'Dojo'\n }\n }\n return arr;\n}", "title": "" }, { "docid": "179ec7a83f2d7913b9a5e92840887654", "score": "0.61412555", "text": "function std_iter_swap(array,a,b){var tmp=array[a];array[a]=array[b];array[b]=tmp;}", "title": "" }, { "docid": "173f13bbef3981284bf4d38aa1ed44ce", "score": "0.6139755", "text": "function arrayReplace(inputArray, elementToReplace, subtractionElement){\n \n inputArray.forEach((element, index) => { //foreach ekti method jeti index theke ekta ekta single element dei\n \n if(element === elementToReplace){ //element er shathe jodi elementTpReplace match hoi\n \n inputArray[index] = subtractionElement; //inputArray er index theke oi position take subtractionElement diye replace kore dibo\n \n }\n \n });\n\n console.log(inputArray);\n}", "title": "" }, { "docid": "1d27242786d23e632c6cd6ea89278ef0", "score": "0.6053158", "text": "function swapvalues(){\n\n var arr = [1,5,10,-2]\n var temp = arr[0];\n\n arr[0] = arr[arr.length - 1];\n arr[arr.length - 1] = arr[0];\n arr[arr.length - 1] = temp;\n console.log(arr);\n\n }", "title": "" }, { "docid": "24b5e7b057bb87abfc86563f5c36cc2d", "score": "0.6047485", "text": "function std_iter_swap$1(array,a,b){var tmp=array[a];array[a]=array[b];array[b]=tmp;}", "title": "" }, { "docid": "a927a93d92f4e8088ed470690876c16a", "score": "0.6001141", "text": "function numstring (){\n var arr = [-1,-1,-1]\n for (var i=0; i<arr.length; i++){\n if (arr[i]<0) {\n arr[i]=\"Dojo\";\n }\n }\n console.log(arr);\n }", "title": "" }, { "docid": "310a76c8249f001820940aa82939598c", "score": "0.5999844", "text": "function outlookNegative(arr){\n for(i=0; i<arr.length; i++){\n if (arr[i] > 0){\n arr[i] *= -1\n }\n }\n return arr\n}", "title": "" }, { "docid": "a5e1c234377105fe86756b0355fff196", "score": "0.5999772", "text": "function convertToNeg(arr) {\n for (var i = 0; i < arr.length; i++) {\n arr[i] = arr[i] * -1\n }\n return arr;\n}", "title": "" }, { "docid": "7850bd6975ea5cf2d82baf718e01816c", "score": "0.5992108", "text": "function swap(arr){\r\n var temp = arr[arr.length-1];\r\n arr[arr.length-1] = arr[0];\r\n arr[0] = temp;\r\n}", "title": "" }, { "docid": "7cb7c27bc3311ba0edb51fc4c0d1a90c", "score": "0.5977246", "text": "function swap(pos1, pos2) {\n tmp = inputArr[pos1];\n inputArr[pos1] = inputArr[pos2];\n inputArr[pos2] = tmp;\n }", "title": "" }, { "docid": "ad733a1869370d89c630ecd5abd37fc5", "score": "0.59765697", "text": "function mirror(){\n let alp = [ '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 str = arguments[0];\n let str2 = arguments[1];\n let temp = []\n let res = str.toLowerCase().split('');\n \n if(str2===undefined){\n for(let i=0;i<res.length;i++){\n if(alp[25-alp.indexOf(res[i])]==undefined ){\n temp.push(res[i])\n }\n else{\n temp.push(alp[25-alp.indexOf(res[i])])\n }\n }\n return temp.join('')\n }\n temp = [];\n let arr = str2.toLowerCase().split('')\n for(let i=0; i<res.length; i++){\n if(arr[(arr.length-1)-arr.indexOf(res[i])]==undefined){ \n temp.push(res[i])\n } else {\n temp.push(arr[(arr.length-1)-arr.indexOf(res[i])])\n }\n }\n return temp.join('')\n}", "title": "" }, { "docid": "8ffa4a9e5cb20ecd21d8222115599ec6", "score": "0.596849", "text": "function fixTheMeerkat(arr) {\n return arr.reverse();\n}", "title": "" }, { "docid": "7aa114f00029f769ca1d1ff213f89212", "score": "0.5948786", "text": "function outlookNegative(arr) {\r\n for (var i = 0; i < arr.length; i++) {\r\n if (arr[i] > 0) {\r\n arr[i] *= -1;\r\n }\r\n }\r\n return arr;\r\n}", "title": "" }, { "docid": "c9799caaa1e82cb1a7a934d267c6d871", "score": "0.591936", "text": "function swapNums(array){\n var temp = array[0];\n array[0] = array[array.length-1];\n array[array.length-1] = temp;\n return array;\n}", "title": "" }, { "docid": "516cdf375ab993bdba26ab2ccb5a4729", "score": "0.5919005", "text": "function swap(chars, i, j) {\n var tmp = chars[i];\n chars[i] = chars[j];\n chars[j] = tmp;\n }", "title": "" }, { "docid": "0a4e3dfd8b96cc0e5322272844bcd5e5", "score": "0.5917957", "text": "function SwapValueInAarray(arr, pOld, pNew) {\n var temp = arr[pNew];\n arr[pNew] = arr[pOld];\n arr[pOld] = temp;\n }", "title": "" }, { "docid": "c2dec05b55281fdfe834eef8db395a59", "score": "0.5907454", "text": "function swapValues(arr) {\r\n var temp = arr[0];\r\n arr[0] = arr[arr.length - 1];\r\n arr[arr.length - 1] = temp;\r\n return arr;\r\n}", "title": "" }, { "docid": "b476e3d8b5d971507152d2e634ab3887", "score": "0.5907167", "text": "function swap(array, i, j) {\n array[i] = array[i] ^ array[j];\n array[j] = array[i] ^ array[j];\n array[i] = array[i] ^ array[j];\n}", "title": "" }, { "docid": "7fa6f9cbe3b1fb0b26a668bec87fb7a3", "score": "0.58808845", "text": "function swapVal(array, a, b) {\n let temp = array[a];\n array[a] = array[b];\n array[b] = temp;\n}", "title": "" }, { "docid": "f52ea00bd22ea217e42ae84e901d275e", "score": "0.586974", "text": "function swap1(arr, src, dest) {\n arr[dest] = [arr[src], arr[src] = arr[dest]][0];\n}", "title": "" }, { "docid": "b37b648ccce3b356fb80a83644116a75", "score": "0.58676404", "text": "function swapPosition(x,y) {\n\nfor (var i = 0; i < temporal.length; i++) {\n \n if (temporal[i] == x) {\n var temp = temporal[y];\n temporal[y] = temporal[x];\n temporal[x] = temp;\n console.log(\"Swap de \" + x + \" - \"+y+\" array position: \"+temporal[y]+\" - \"+temporal[x]);\n console.log(temporal);\n return;\n }\n}\n\n}", "title": "" }, { "docid": "57216f22f33b6c84b6a975792f5e86b1", "score": "0.5866485", "text": "function backwardFruitsOld(arr){\n\tvar newArray = []\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tnewArray.push(arr[i].split(\"\").reverse().join(\"\"));\n\t} \t\n \treturn newArray\n}", "title": "" }, { "docid": "93f5785c3c377ebb5a75ea38be4d32dc", "score": "0.58648956", "text": "function decrease(numArray) {\n var temp;\n for (let i = 0; i < numArray.length - 1; i++) {\n for (let j = i + 1; j < numArray.length; j++) {\n if (numArray[i] < numArray[j]) {\n // swap 1 : use 3rd variable\n temp = numArray[i];\n numArray[i] = numArray[j];\n numArray[j] = temp;\n // swap2: use array\n //[numArray[i], numArray[j]] = [numArray[j], numArray[i]];\n }\n }\n }\n console.log(numArray);\n}", "title": "" }, { "docid": "62209955bb5b8260ca409a98622150e7", "score": "0.58641857", "text": "function swap(arr,i1,i2) {\n let oldie = arr[i1];\n arr[i1] = arr[i2];\n arr[i2] = oldie;\n}", "title": "" }, { "docid": "fe8f0ba3db2bcc2fae8c90ad5b10456a", "score": "0.5862714", "text": "function swapValue(arr){\nvar temp;\ntemp = arr[0];\narr[0] = arr[arr.length-1];\narr[arr.length-1] = temp;\nreturn arr;\n}", "title": "" }, { "docid": "f80e407f41e25877406c8d431e60bef8", "score": "0.58589995", "text": "function swapValue(arr){\n let temp= arr[0];\n arr[0]=arr[arr.length-1];\n arr[arr.length-1]=temp;\n return arr;\n }", "title": "" }, { "docid": "6332d132ebe7541ed1bb52a67dd93e68", "score": "0.5842533", "text": "function swap(arr, pos1, pos2){ \r\n var temp = arr[pos1];\r\n arr[pos1] = arr[pos2];\r\n arr[pos2] = temp; \r\n }", "title": "" }, { "docid": "15b9f5604a781b2ab6023bb363c355af", "score": "0.58295864", "text": "function shiftArrayVals(arr) {\n\n if (arr.length === 0) {\n\n return 'Array is empty'\n\n }\n\n \n\n for (var i = 1; i < arr.length; i++) {\n\n arr[i - 1] = arr[i];\n\n }\n\n arr[arr.length - 1] = 0;\n\n return arr;\n\n}", "title": "" }, { "docid": "3c66275a5dc36551df5e8f8134f5cd00", "score": "0.5820187", "text": "function swap( arr, posA, posB ) {\n var temp = arr[posA];\n arr[posA] = arr[posB];\n arr[posB] = temp;\n}", "title": "" }, { "docid": "1120511d4f80eaf0de70180e37259887", "score": "0.58163136", "text": "swap(arr, idx1, idx2){\n var temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n }", "title": "" }, { "docid": "73886b7efe485c7c236d622a614fae8d", "score": "0.581262", "text": "function ArraySwap(array, one, two) {\n var holdingBay = array[one];\n array[one] = array[two];\n array[two] = holdingBay;\n}", "title": "" }, { "docid": "4303b669d875616cc7f0d045dd39ef2d", "score": "0.581222", "text": "function swapofArrayValues(x){\n var temp = x[x.length-1];\n x[x.length-1]= x[0];\n x[0] = temp;\n return x;\n}", "title": "" }, { "docid": "5aa28f8bd8b7195293804a98bbe6aec3", "score": "0.58100253", "text": "function swap(a, b, arr) {\n arr[b] = arr[b] - arr[a];\n arr[a] = arr[a] + arr[b];\n arr[b] = arr[a] - arr[b];\n}", "title": "" }, { "docid": "972ba7c37f430915417b39975f400776", "score": "0.5807937", "text": "function swap(array,i1, i2){\n\tif(!Array.isArray(array))\n\t{\n\t\tconsole.error(\"Not an array\"+ array)\n\t\treturn;\n\t}\n\t// console.log(\"swapping from \"+array)\n\tvar buffer = array[i1]\n\tarray[i1] = array[i2]\n\tarray[i2] = buffer\n\t// console.log(\"to \"+array)\n}", "title": "" }, { "docid": "1d1602edf661a44cdf5dbe727dbc0efd", "score": "0.5804775", "text": "function swap(arr, a, b)\n\t\t\t{\n\t\t\t\tvar tmp = arr[a];\n\t\t\t\tarr[a] = arr[b];\n\t\t\t\tarr[b] = tmp;\n\t\t\t}", "title": "" }, { "docid": "2e0cfa923be11d8965cf9d063ea2f87c", "score": "0.5800902", "text": "function reverseString(arr) {}", "title": "" }, { "docid": "01bc4319ba645ba013a26bcafe970573", "score": "0.58008754", "text": "function swap(x, y, array){\n let temp = array[y];\n array[y] = array[x];\n array[x] = temp;\n }", "title": "" }, { "docid": "a20f879b322fe9a6942f22b5f2c88e05", "score": "0.5800546", "text": "function swap(arr){\n var val= arr[0];\n arr[0]=arr[arr.length-1];\n arr[arr.length-1]=val;\n return arr;\n}", "title": "" }, { "docid": "64eec8762b03774ca5521f73f26f7c6e", "score": "0.5792776", "text": "function negitive_nancy(arr){\n // 1) itterate through the Array\n for(var i=0; i< arr.length; i++){\n if(arr[i]>0){\n arr[i]=-arr[i];\n }\n }\n return arr\n}", "title": "" }, { "docid": "ae540a1e3f8f0cf68502932d3b863d6d", "score": "0.5790481", "text": "function swap(a, b, arr){\n let tmp = arr[a];\n arr[a] = arr[b];\n arr[b] = tmp;\n }", "title": "" }, { "docid": "b4c2ca4cfa9b6b674c15bf5c85a485dd", "score": "0.5786215", "text": "function swap(arr) {\n //your code here\n var temp = arr[0];\n arr[0] = arr[arr.length - 1];\n arr[arr.length - 1] = temp;\n var arrnew = arr;\n return arrnew;\n}", "title": "" }, { "docid": "d870eee053925d348b93c0de4938e68e", "score": "0.57832384", "text": "function reverseInPlace(input) {\n \n if(!input || typeof input != \"string\") {\n console.log(\"invalid input:\"+input)\n return input\n } else if(input.length < 2) {\n return input\n }\n \n let inputArray = input.split('')\n for(let i=0; i<inputArray.length/2; i++) {\n let currentItem = inputArray[i]\n let oppositeItem = inputArray[inputArray.length -1 -i]\n inputArray[i] = oppositeItem\n inputArray[inputArray.length -1 -i] = currentItem\n }\n return inputArray.join('')\n}", "title": "" }, { "docid": "054a0431af89197f92a90759629a271e", "score": "0.57777745", "text": "function invert(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = arr[i] * -1\n }\n return arr\n}", "title": "" }, { "docid": "c6f32c630f6970c7c062a03cdb6d1d0b", "score": "0.5776397", "text": "function SwapValues(x){\n var temp=0;\n temp=x[0];\n x[0]=x[x.length-1];\n x[x.length-1]=temp;\n return x;\n}", "title": "" }, { "docid": "0d4a62db3fd7670960e33620ad3df47e", "score": "0.5770524", "text": "function swap(array, firstIndex, secondIndex) { //swaps 2 elements\n let temp = array[firstIndex];\n array[firstIndex] = array[secondIndex];\n array[secondIndex] = temp;\n}", "title": "" }, { "docid": "ffdd1c6c99a71dfac7cfbd0416709762", "score": "0.5761849", "text": "function swap(array, index1, index2) {\n var aux = array[index1];\n array[index1] = array[index2];\n array[index2] = aux;\n }", "title": "" }, { "docid": "cb0d65ba892d8645d9fa881c5241b7e5", "score": "0.5756301", "text": "function swap(array, firstIndex, secondIndex){\n var temp = array[firstIndex];\n array[firstIndex] = array[secondIndex];\n array[secondIndex] = temp;\n}", "title": "" }, { "docid": "696f0bc4c3d6784a3abc722b26e06eb5", "score": "0.5745107", "text": "function swap(arr, indexB, indexS) {\n let temp = arr[indexB];\n arr[indexB] = arr[indexS];\n arr[indexS] = temp;\n}", "title": "" }, { "docid": "70d0a14683465d70ea131b0c7ce5d8c9", "score": "0.57355016", "text": "function flip(text){\n var arrText = text.split(\"\");\n arrText.reverse();\n return arrText.join(\"\");\n}", "title": "" }, { "docid": "b864be3593b121ff81a7210d90d87bbd", "score": "0.5732905", "text": "function arrayReverser(arr) {\n\t// enter code here\n\n}", "title": "" }, { "docid": "42d6c97ebb8ebf4941cb8a4c3111e462", "score": "0.5731348", "text": "function swapTwoVals(arr){\n\tvar temp = arr[0];\n\tarr[0] = arr[arr.length-1];\n\tarr[arr.length-1] = temp;\n\treturn arr;\n}", "title": "" }, { "docid": "109a2bf521d553c9b37d51045005ae31", "score": "0.57277715", "text": "function changeToMinus(arr,value){\n for(var i = 0; i < arr.length;i++){\n for(var j =0; j<arr[i].length; j++){\n if(arr[i][j] == value){\n arr[i][j] = -1;\n return -1;\n }\n }\n }\n}", "title": "" }, { "docid": "dbb4714f41bee55a9f74e036ec6c2937", "score": "0.5727492", "text": "function swap(arr, xp, yp) {\n var temp = arr[xp];\n arr[xp] = arr[yp];\n arr[yp] = temp;\n}", "title": "" }, { "docid": "2857011e3ce6701078f4c1136fcf44e0", "score": "0.57273394", "text": "function noNeg(nn){\r\n for(var i = 0; i < nn.length; i++){\r\n if(nn[i] < 0){\r\n nn.splice([i],1,0);\r\n }\r\n }\r\n return nn;\r\n}", "title": "" }, { "docid": "213706aa04e096c458eaf0ac6f789f73", "score": "0.57267094", "text": "function replaceNums(array) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] < 0){\n array[i] = 'Fun';\n }\n }\n return array;\n}", "title": "" }, { "docid": "4142afdbde961295a24e3feb0481f995", "score": "0.57264686", "text": "function swap(arr) {\n var change1 = arr.pop();\n var change2 = arr.shift();\n arr.unshift(change1);\n arr.push(change2);\n return arr;\n}", "title": "" }, { "docid": "2157e6f0b6d33458d3dd5fc89cf4b1ae", "score": "0.5725171", "text": "function swap(arr,xp, yp)\n{\n var temp = arr[xp];\n arr[xp] = arr[yp];\n arr[yp] = temp;\n}", "title": "" }, { "docid": "779f1b36c97ea380397d641f420ee1fe", "score": "0.5722699", "text": "function swap(str, arr) {\n\tvar index;\n\tvar len = arr.length,\n\t\tindicesChosen = [],\n\t\tindices = [],\n\t\tlettersToSwap = [],\n\t\tstrArr = str.split(\"\");\n\n\tif(len === 0) {\n\t\treturn str;\n\t}\n\n\tfor(var i = 0; i < len; i++) {\n\t\tindex = arr[i];\n\t\tif(typeof indicesChosen[index] === \"undefined\") {\n\t\t\tlettersToSwap.push(strArr[index]);\n\t\t\tindices.push(index);\n\t\t\tindicesChosen[index] = true;\n\t\t}\n\t}\n\n\tlettersToSwap.sort(function(a, b) {\n\t\treturn b > a;\n\t});\n\n\tindices.sort();\n\n\tfor(var i = 0, indLen = indices.length; i < indLen; i++) {\n\t\tindex = indices[i];\n\t\tstrArr[index] = lettersToSwap[i];\n\t}\n\n\treturn strArr.join(\"\");\n}", "title": "" }, { "docid": "b5f36040fd0fa33033b7ad7115d711ac", "score": "0.5720992", "text": "function swap(arr)\n{\n let temp = 0;\n\n temp = arr[0];\n arr[0] = arr[arr.length-1];\n arr[arr.length-1] = temp;\n\n return arr;\n}", "title": "" }, { "docid": "8a808d3d4b21a4880ad755359d8f2b06", "score": "0.57147855", "text": "function numStr(arr)\n{\n for(let i = 0; i < arr.length; i++)\n {\n if(arr[i] < 0)\n {\n arr[i] = 'Dojo';\n }\n }\n\n return arr;\n}", "title": "" }, { "docid": "4989a186e88677baac4b593b9b2ae763", "score": "0.571353", "text": "function reverseArr(arr){\r\n arr.reverse();\r\n\r\n reverseP.textContent = `Reverse Order = ${arr.join()}`;\r\n seriesForm.appendChild(reverseP);\r\n}", "title": "" }, { "docid": "73ab3e5293b30e137bb003b24319672d", "score": "0.57106006", "text": "function swapVals(arr){\n var temp = arr[arr.length-1];\n arr[arr.length-1]=arr[0];\n arr[0]=temp;\n console.log (arr);\n}", "title": "" }, { "docid": "8de5aed353eec4eae082d80ee37fe36a", "score": "0.5705177", "text": "function neg(arr)\n{\n for(let i = 0; i < arr.length; i++)\n {\n if(arr[i] < 0)\n {\n arr[i] = 0;\n }\n }\n\n return arr;\n}", "title": "" }, { "docid": "cab1f81a01b391f54166dd75027d1025", "score": "0.57044125", "text": "function reverseMessage1(str) {\n var arr = str.split(\" \");\n /* loop through arr and replace first index with last index, second index with second to last index, third index with third to last index, etc */\n for (var i = 0,j=(arr.length)-1; i < arr.length/2; i++) {\n temp=arr[i]\n arr[i] = arr[j];\n arr[j] = arr[i]\n arr[j] = temp; j--;\n }\n return arr.join(\" \");\n}", "title": "" }, { "docid": "b58bddd992e5db1892c37f1634370255", "score": "0.5702555", "text": "function swap(array, pos1, pos2) {\n var element1 = array[pos1];\n var element2 = array[pos2];\n array[pos1] = element2;\n array[pos2] = element1;\n }", "title": "" }, { "docid": "8faad9829f2391fca0f97b3956b143da", "score": "0.57025224", "text": "function swap(array, i, j) {\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }", "title": "" }, { "docid": "fca62446a692101d4ed31cbab4170792", "score": "0.56980705", "text": "function swap(i, j) {\n var tmp = temArr[i];\n temArr[i] = temArr[j];\n temArr[j] = tmp;\n }", "title": "" }, { "docid": "40ade43f0756f5d0b1a38b887163735e", "score": "0.56969076", "text": "function swap(arr){\r\n\tvar temp = arr[0];\r\n \tarr[0] = arr[arr.length - 1];\r\n \tarr[arr.length - 1] = temp;\r\n \treturn arr;\r\n}", "title": "" }, { "docid": "abbad887d05c8da07aea992b2bf0a109", "score": "0.56912726", "text": "function swap(arr, a, b) {\n var temp = arr[a];\n arr[a] = arr[b];\n arr[b] = temp;\n}", "title": "" }, { "docid": "0a2de26aaf407b11a56ccca8851c511e", "score": "0.5691122", "text": "function swap(arr, first_Index, second_Index) {\n var temp = arr[first_Index];\n arr[first_Index] = arr[second_Index];\n arr[second_Index] = temp;\n }", "title": "" }, { "docid": "2cd387032bc60e2c31b0054f139bf5b2", "score": "0.56891567", "text": "function reverse(arr){\n var len = arr.length,\n numberOfSwitches = Math.floor(len / 2),\n idx = 0,\n temp\n\n for(let i = 1; i <= numberOfSwitches; i++){\n temp = arr[idx]\n arr[idx] = arr[len - (idx + 1)]\n arr[len - (idx + 1)] = temp\n idx++\n }\n}", "title": "" }, { "docid": "5e06c5fc1bff988ee20b8e7ede02c2f8", "score": "0.56890464", "text": "function swapArrElems(arr, i, j) {\r\n var s = arr[i];\r\n arr[i] = arr[j];\r\n arr[j] = s;\r\n}", "title": "" }, { "docid": "3324620edc96ce9990cd87994a083f1c", "score": "0.56870633", "text": "function swap(array, i, j) {\n sCounter++;\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n}", "title": "" }, { "docid": "9e6937ef792f93ecc950c65155f3bebe", "score": "0.5686924", "text": "function swap(array, element_1, element_2){\n \n let temp = array[element_1]\n element_1 = array[element_2]\n element_2 = temp \n\n return array\n}", "title": "" }, { "docid": "7a22def76b26f03ab9dd286a6b230fa2", "score": "0.5682549", "text": "function swap(arr, indx1, indx2) {\n let temp = arr[indx1];\n arr[indx1] = arr[indx2];\n temp = arr[indx2];\n}", "title": "" }, { "docid": "528546d3f3f53f0b95fbee20a695e5a2", "score": "0.56809634", "text": "function swap(array, i, j) {\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }", "title": "" }, { "docid": "528546d3f3f53f0b95fbee20a695e5a2", "score": "0.56809634", "text": "function swap(array, i, j) {\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }", "title": "" }, { "docid": "5b2b080e94d26e03fa1c60a287a037ef", "score": "0.5679197", "text": "function swap(a, i1, i2) {\n\t\t\t\t\t\tvar t = a[i1];\n\t\t\t\t\t\ta[i1] = a[i2];\n\t\t\t\t\t\ta[i2] = t;\n\t\t\t\t\t }", "title": "" }, { "docid": "80126e6005be64c3546986aaea897ae5", "score": "0.56755435", "text": "function swap (unsortedArray, leftIndex, rightIndex) {\r\n var temp = unsortedArray[leftIndex];\r\n unsortedArray[leftIndex] = unsortedArray[rightIndex];\r\n unsortedArray[rightIndex] = temp;\r\n}", "title": "" }, { "docid": "bf98233fe9f96ce9244fe6655f248614", "score": "0.5672592", "text": "function swap(arr, i1, i2) {\r\n var temp = arr[i1]\r\n arr[i1] = arr[i2];\r\n arr[i2] = temp;\r\n}", "title": "" } ]
60a1be12d86417d4f5342c58408ea314
Rule for validating a value exists in an enumerable list.
[ { "docid": "ef4766bc41cf4b34a2cd513d20dbb990", "score": "0.6339347", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" } ]
[ { "docid": "1303daba9e755ca124f2258726af5229", "score": "0.64325184", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n \n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n }", "title": "" }, { "docid": "ad503b0b5eb79023cb9a50a274488b63", "score": "0.6386706", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(\n util.format(\n options.messages[ENUM],\n rule.fullField,\n rule[ENUM].join(\", \")\n )\n );\n }\n }", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "20f7e592efaa96413726bb66111d418b", "score": "0.62996835", "text": "function contains(list, value) {\n for (var i = 0; i < list.length; i++) {\n if (list[i] === value) return true;\n }\n return false;\n }", "title": "" }, { "docid": "571959376b535d39e0322ebcd05be601", "score": "0.6287605", "text": "function enumerable(rule, value, source, errors, options) {\n\t\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t\t if (rule[ENUM].indexOf(value) === -1) {\n\t\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t\t }\n\t\t}", "title": "" }, { "docid": "10119ab8d554f5ccb5d2d4fac3a1923c", "score": "0.6246956", "text": "function enumerable(rule,value,source,errors,options){rule[ENUM]=Array.isArray(rule[ENUM])?rule[ENUM]:[];if(rule[ENUM].indexOf(value)===-1){errors.push(util.format(options.messages[ENUM],rule.fullField,rule[ENUM].join(', ')));}}", "title": "" }, { "docid": "573b467fac36f4106036c9c667e0d1b5", "score": "0.61447245", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "ee9070b824b78a215749af2a12170006", "score": "0.6083711", "text": "function isValueInList( list, sValue )\r\n{\r\n\tfor ( var i=0; i<list.length; i++ ) \r\n\t{\r\n\t\tif ( list[i].value == sValue ) return ( true );\r\n\t}\r\n\treturn ( false );\r\n}", "title": "" }, { "docid": "14efe931f9e14e4ba8a5cccf02060721", "score": "0.6040242", "text": "function exists(list){\n if (!list) return false;\n if (!list.length) return false;\n for (var i=0; i < list.length; i++){\n if (list[i]) return true;\n }\n return false;\n}", "title": "" }, { "docid": "3af7cce30b4dda86f78c384bfb0e5ab5", "score": "0.6024649", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3af7cce30b4dda86f78c384bfb0e5ab5", "score": "0.6024649", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3af7cce30b4dda86f78c384bfb0e5ab5", "score": "0.6024649", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3af7cce30b4dda86f78c384bfb0e5ab5", "score": "0.6024649", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3af7cce30b4dda86f78c384bfb0e5ab5", "score": "0.6024649", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "c9684dcf5553103820253290ecad9f0d", "score": "0.60021424", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c9684dcf5553103820253290ecad9f0d", "score": "0.60021424", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c9684dcf5553103820253290ecad9f0d", "score": "0.60021424", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c9684dcf5553103820253290ecad9f0d", "score": "0.60021424", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c9684dcf5553103820253290ecad9f0d", "score": "0.60021424", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c9684dcf5553103820253290ecad9f0d", "score": "0.60021424", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c041aaabe351aeb5c4b1f4dd349553df", "score": "0.5982973", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c041aaabe351aeb5c4b1f4dd349553df", "score": "0.5982973", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c041aaabe351aeb5c4b1f4dd349553df", "score": "0.5982973", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c041aaabe351aeb5c4b1f4dd349553df", "score": "0.5982973", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c041aaabe351aeb5c4b1f4dd349553df", "score": "0.5982973", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "37f989831099b761bba1da4b46f163bc", "score": "0.5966479", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "37f989831099b761bba1da4b46f163bc", "score": "0.5966479", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "37f989831099b761bba1da4b46f163bc", "score": "0.5966479", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "37f989831099b761bba1da4b46f163bc", "score": "0.5966479", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "37f989831099b761bba1da4b46f163bc", "score": "0.5966479", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "37f989831099b761bba1da4b46f163bc", "score": "0.5966479", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "f70cb178ac48abde60464a59f5659ae6", "score": "0.59154636", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "f70cb178ac48abde60464a59f5659ae6", "score": "0.59154636", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "f70cb178ac48abde60464a59f5659ae6", "score": "0.59154636", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "695b0d4085dfde8bfc98c4c8c9bb0809", "score": "0.5900301", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__.default.required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__.default[ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "82530ade5c80fa54d89b0a86fc6a7bd4", "score": "0.5839032", "text": "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n \n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n \n rules.required(rule, value, source, errors, options);\n \n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n \n callback(errors);\n }", "title": "" }, { "docid": "9e7d0400645ef28adcd4e4c969638475", "score": "0.58202404", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2.default.required(rule, value, source, errors, options);\n if (value) {\n _rule2.default[ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "9e7d0400645ef28adcd4e4c969638475", "score": "0.58202404", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2.default.required(rule, value, source, errors, options);\n if (value) {\n _rule2.default[ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "8014718e8b36dc755897be0857f1400f", "score": "0.58094686", "text": "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2['default'].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2['default'][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "8014718e8b36dc755897be0857f1400f", "score": "0.58094686", "text": "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2['default'].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2['default'][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "8014718e8b36dc755897be0857f1400f", "score": "0.58094686", "text": "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2['default'].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2['default'][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "2e9ce5df2f48e19a0c63325dcb15c300", "score": "0.57834464", "text": "function validateNewItem(value) {\n for(let i = 0; i < itemArray.length; i++) {\n if(itemArray[i] == value) {\n alert('That item is already in the list!')\n return false\n }\n }\n return true\n }", "title": "" }, { "docid": "a6fc01383867564ee9a5466d27c304b4", "score": "0.5776334", "text": "function enumerable(rule, value, callback, source, options) {\n\t\t var errors = [];\n\t\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t\t if (validate) {\n\t\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t\t return callback();\n\t\t }\n\t\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t\t if (value) {\n\t\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t\t }\n\t\t }\n\t\t callback(errors);\n\t\t}", "title": "" }, { "docid": "6b898417eccf174d645bf0946c7f53a3", "score": "0.5771753", "text": "function contains(item, list, cb) {\n \n}", "title": "" }, { "docid": "53db326e355662199a6f520b6c56a807", "score": "0.57711166", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate =\n rule.required ||\n (!rule.required && source.hasOwnProperty(rule.field));\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n }", "title": "" }, { "docid": "41186529ca4dccfba682dd4598034545", "score": "0.577036", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "41186529ca4dccfba682dd4598034545", "score": "0.577036", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "41186529ca4dccfba682dd4598034545", "score": "0.577036", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "41186529ca4dccfba682dd4598034545", "score": "0.577036", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "41186529ca4dccfba682dd4598034545", "score": "0.577036", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "41186529ca4dccfba682dd4598034545", "score": "0.577036", "text": "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "901142e86aae61a44dedf1da09b4fcfb", "score": "0.5765929", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "901142e86aae61a44dedf1da09b4fcfb", "score": "0.5765929", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "901142e86aae61a44dedf1da09b4fcfb", "score": "0.5765929", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "76b286d30a7cccee3f49159cb0fbc6fa", "score": "0.5761201", "text": "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "76b286d30a7cccee3f49159cb0fbc6fa", "score": "0.5761201", "text": "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "76b286d30a7cccee3f49159cb0fbc6fa", "score": "0.5761201", "text": "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "76b286d30a7cccee3f49159cb0fbc6fa", "score": "0.5761201", "text": "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "76b286d30a7cccee3f49159cb0fbc6fa", "score": "0.5761201", "text": "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "76b286d30a7cccee3f49159cb0fbc6fa", "score": "0.5761201", "text": "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" } ]
fe52c05dcb84bea99eaf57470aeddd90
Render game, or dev, or system
[ { "docid": "d6055042d9ec646d3f6b1484fbf2df95", "score": "0.0", "text": "renderItem(item, type, count,default_images_path, company_images_path){\n\t\treturn <Item_Mongo key={count} name={item.name} type={type} fullitem={item} default_images_path={default_images_path} company_images_path={company_images_path} /> ;\n\t}", "title": "" } ]
[ { "docid": "03da41f0f1562f7ce6c0ab359e16a7b7", "score": "0.70445585", "text": "function render() {\n\trenderGame();\n}", "title": "" }, { "docid": "699064723fa70ef050bae085fdab57ac", "score": "0.6977129", "text": "render() {\n // prevent all animations if any of the menu screens are turned on\n if (gameManager.gameOver) return;\n if (gameManager.mainMenu) return;\n if (gameManager.quitGame) return;\n if (gameManager.difficultySelectMenu) return;\n if (gameManager.newGame) return;\n \n let context = this.gameManager.context;\n let canvas = this.gameManager.canvas;\n \n this.gameManager.render();\n this.ball.render(context);\n this.player.render(context);\n this.enemy.render(context);\n this.scoreboard.render(canvas, context, this.gameManager, this.ball);\n }", "title": "" }, { "docid": "8bbadaf174532dfb302b153ceba33597", "score": "0.6772333", "text": "function render()\n{\n if(GameWon == true)\n {\n gl.clearColor( 0.0, 1.0, 0.0, 1.0 );\n }\n else if(GameLost == true)\n {\n gl.clearColor( 1.0, 0.0, 0.0, 1.0 );\n }\n\n gl.clear( gl.COLOR_BUFFER_BIT );\n renderEnvironment();\n\n if(GameWon == false && GameLost == false)\n {\n AddGravity(JumperManModel, GravPixelsPerSecond);\n SetPhysicsTrans(JumperManModel, [BigPlatformModel, SmallPlatformModel1, SmallPlatformModel2]);\n\n MovePellet();\n MoveSpikes();\n\n StartMovingSpikes();\n\n PelletSpikeCollision();\n PlayerSpikeCollision();\n\n if(GameLost == true)\n {\n render();\n return;\n }\n\n CheckWin();\n if(GameWon == true)\n {\n render();\n return;\n }\n }\n\n RenderModel(JumperManModel, ShaderProgram);\n RenderSpikes();\n\n if(GameWon == false && GameLost == false)\n {\n requestAnimFrame(render);\n }\n}", "title": "" }, { "docid": "364ecbd348e0292719aa42387baee306", "score": "0.6744985", "text": "function render() {\n\t//clear all canvases for a fresh render\n\tclearScreen();\n\t\n\t//draw grid\n\tdrawGrid();\n\t\n\t//draw all objects\n\tdrawPellets();\n\tdrawGhosts();\n\tdrawPlayer();\n\t\n\t//draw gui elements\n\tdrawVerticalScore(\"GAME\",HUDLeft,score);\n\tdrawVerticalScore(\"HIGH\",HUDRight,bestScore);\n\tdrawLives();\n\tdrawButtons();\n\t\n\t//dim the screen if the game is not active\n\tcheckDimScreen();\n}", "title": "" }, { "docid": "fea0cfbf6a08a22c87ac590c3c7a1848", "score": "0.67197686", "text": "function render() {\n /*Background*/\n if (player.level === \"level1\") {\n level1();\n } else if (player.level === \"level2\") {\n level2();\n }\n renderEntities();\n }", "title": "" }, { "docid": "38d82988bf88ddb42b393f6c7a39ea9b", "score": "0.6700601", "text": "function render(){\n display.renderCanvas(game.world.backgroundColor);\n display.renderPlayer(game.world.player.x, game.world.player.y, game.world.player.width, game.world.player.height, game.world.player.color);\n // display.render();\n }", "title": "" }, { "docid": "afdbe96230842f4f3373de931b8df912", "score": "0.66828114", "text": "render() {\n // Allow the gameworld to render anything it needs to\n this.gameWorld.render();\n\n // Let the debug manager render anything\n if (this.debugManager != null) {\n this.debugManager.render();\n }\n }", "title": "" }, { "docid": "b0a9f5639707fbd3d1182ea2a4e77827", "score": "0.665422", "text": "function renderSimulation(ctx) {\n \n if (screenManager.curFrame.visible) {\n\n world.render(ctx);\n\n entityManager.render(ctx);\n\n world.choiceRect.render(ctx);\n\n world.renderOnTop(ctx);\n \n cross.render(ctx);\n \n // show messages\n g_sprites.render(ctx);\n\n screenManager.commonrender(ctx);\n\n world.minimap.render(ctx);\n\n entityManager.renderHUD(ctx);\n }\n \n if (screenManager.startscreen.visible) {\n\n screenManager.startscreen.render(ctx);\n }\n \n if (screenManager.victoryFrame.visible) {\n screenManager.victoryFrame.render(ctx);\n\t\t multiplayer.endGame();\n }\n \n if (screenManager.defeatFrame.visible) {\n\n screenManager.defeatFrame.render(ctx);\n\t\t multiplayer.endGame();\n }\n \n if (diagnostics.visible) {\n\n diagnostics.render(ctx);\n }\n \n mouse.render(ctx);\n}", "title": "" }, { "docid": "1c0d261e4000294818e09ab4475dd1f3", "score": "0.66463614", "text": "engineRender() {\n if (this.renderer) {\n this.renderer.render(this.stage);\n }\n }", "title": "" }, { "docid": "7d83653175bb3f90fc700db996f19add", "score": "0.6645913", "text": "function render() {\n renderWound();\n renderWBC();\n\t\trenderRBC();\n renderEnemies();\n\t\trenderVitamins();\n renderHUD();\n }", "title": "" }, { "docid": "9536d0c991d4c4a57f8477de0096ac4f", "score": "0.6579337", "text": "render() {\n if (this.visible) {\n if (this.shaderType == 'colored') {\n this.renderColored();\n } else if (this.shaderType == 'lit') {\n this.renderLit();\n } else if (this.shaderType == 'textured') {\n // TODO: render textured\n } else if (this.shaderType == 'textured-lit') {\n // TODO: render textured and lit\n }\n }\n }", "title": "" }, { "docid": "e6a2c2e0230224a9e937f081ebc6439d", "score": "0.65452987", "text": "function render() {\n\n // display some debug info of the camera\n game.debug.cameraInfo(game.camera, 32, 32);\n // display some debug info of the camera\n game.debug.spriteInfo(player, 32, game.height - 120);\n game.debug.body(player);\n\n game.debug.text(game.time.fps || '--', 2, 14, \"#00ff00\"); \n\n}", "title": "" }, { "docid": "f4c5280906dbc1ce0b0f39d7bd822a62", "score": "0.6523798", "text": "function render() {\n drawGameBoard();\n renderEntities();\n }", "title": "" }, { "docid": "ae0a2fab764c2fa7899da86794a96aed", "score": "0.65119964", "text": "function render() {\n\t\t\tgame.contextBackground.clearRect(0, 0, game.width, game.height);\n\t\t\tgame.contextBackground.fillStyle = \"white\";\n\t\t\tfor (i in game.stars) {\n\t\t\t\tvar star = game.stars[i];\n\t\t\t\t\n\t\t\t\tgame.contextBackground.fillRect(star.x, star.y, star.size, star.size);\n\t\t\t}\n\n\t\t\t// tova spira prerendervaneto na player ako ne se dviji\n\t\t\tif (!game.player.rendered) {\n\t\t\t\t// console.log(\"rendering\");\n\t\t\t\tgame.player.rendered = true;\n\t\t\t } \n\n\t\t\t // render enemy\n\t\t\tgame.contextEnemy.drawImage(game.images[game.enemy.image], game.enemy.x, game.enemy.y, game.enemy.width, game.enemy.height);\n\t\t\t\n\t\t\tgame.contextBackground.font = \"bold 20px Arial\";\n\t\t\tgame.contextBackground.fillText(\"Score: \" + game.score, 10, 110);\n\t\t\tgame.contextBackground.fillText(\"Bullets: \" + game.bulletCounter, 10, 140);\n\n\t\t\t// render projectiles\n\t\t\tfor (i in game.projectiles) {\n\t\t\t \tvar proj = game.projectiles[i];\n\t\t\t \tgame.contextEnemy.clearRect(proj.x, proj.y, proj.size, proj.size);\n\t\t\t \tgame.contextEnemy.drawImage(game.images[proj.image], proj.x, proj.y, proj.size, proj.size);\n\t\t\t }\n\n\t\t\t if(game.gameOver) {\n\t\t\t\tgame.contextPlayer.font = \"bold 50px arial\";\n\t\t\t\tgame.contextPlayer.fillStyle = \"white\";\n\t\t\t\tgame.contextPlayer.fillText(\"game over\",game.width / 2 - 140, game.height / 2 - 25 );\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif(game.gameWon) {\n\n\t\t\t\tgame.enemy.image = 3; \n\t\t\t\t// disables sound if gameiswon/lost\n\t\t\t\tif (!game.playSound) { \n\t\t\t\t\tgame.explodeSound.play();\n\t\t\t\t\tgame.playSound = true;\n\t\t\t\t}\n\t\t\t\tgame.enemy.dead = true;\n\n\t\t\t\tgame.player.y--;\n\n\n\n\t\t\t\tgame.contextPlayer.font = \"bold 50px arial\";\n\t\t\t\tgame.contextPlayer.fillStyle = \"white\";\n\t\t\t\tgame.contextPlayer.fillText(\"game won\",game.width / 2 - 140, game.height / 2 - 25 );\n\t\t\t}\n\n\t\t\t// destroy enemy if game is won\n\t\t\tif (game.enemy.dead) {\n\t\t\t\tgame.enemy.deadTime--;\t\t\n\t\t\t}\n\n\t\t\tif (game.enemy.dead && game.enemy.deadTime <= 0) {\n\t\t\t\tgame.contextEnemy.clearRect(0, 0, game.width, game.height);\n\t\t\t}\n\n\n\t\t}", "title": "" }, { "docid": "36152186376bebc63c14da510c5421cb", "score": "0.6474256", "text": "function render() {\n renderEngine.clear();\n renderEngine.renderGameState();\n\n //---------------------\n\t\t/*creep1.render();\n\t\tcreep2.render();\n\t\tcreep3.render();\n spider.render();*/\n for (let i = 0; i < monsters.length; i++) {\n monsters[i].render();\n }\n //----------------------\n }", "title": "" }, { "docid": "b18efb075b969c586679e34987027470", "score": "0.6460719", "text": "function render() {\n\n\t// game.debug.bodyInfo(guy, 40, 24);\n\n\t// game.debug.body(sprite);\n\t// game.debug.body(sprite2);\n\n}", "title": "" }, { "docid": "233b4a1faa1517c551d2fdc7f38e1bbf", "score": "0.6452036", "text": "function render() {\n // Pulisci lo schermo\n ctx.fillStyle = '#000';\n ctx.fillRect(0, 0, gameScreen.width, gameScreen.height);\n\n // Rendring\n ctx.fillStyle = '#fff';\n ctx.strokeStyle = '#fff';\n ctx.lineWidth = 10;\n ctx.font = '100px Monospace';\n ctx.textAlign = \"center\";\n\n middleLine.render(ctx);\n leftPaddle.render(ctx);\n rightPaddle.render(ctx);\n ball.render(ctx);\n counter.render(ctx);\n\n if (socket.disconnected) {\n ctx.fillStyle = '#D00';\n ctx.fillText('NON CONNESSO!', gameScreen.width / 2, gameScreen.height / 2);\n } else if (!gameStatus.gameRuninng) {\n ctx.fillStyle = '#0DD';\n ctx.fillText('Attendo giocatori', gameScreen.width / 2, gameScreen.height / 2);\n\n if (gameStatus.lastWinner) {\n const side = gameStatus.lastWinner === 'left' ? 'sinistra' : 'destra';\n ctx.font = '45px Monospace';\n ctx.fillStyle = '#0D0'\n ctx.fillText(`Ha vinto il giocatore a ${side}`, gameScreen.width / 2, gameScreen.height / 2 - 100);\n }\n }\n}", "title": "" }, { "docid": "48d3f3f5129c0fbdadb6b75d9b2336e0", "score": "0.6446913", "text": "function drawGameScreen() {\r\n drawGameBackground();\r\n\r\n drawGameCarrots();\r\n\r\n drawGameLadders();\r\n\r\n drawRabbit();\r\n\r\n drawFoxes();\r\n\r\n drawGamePlatforms();\r\n\r\n if (noDrawMode) {\r\n drawGameGrid();\r\n }\r\n}", "title": "" }, { "docid": "721d7f32888d437e92275145dcd2868a", "score": "0.6438892", "text": "renderplat(ctx) {\n this.platform.render(ctx);\n }", "title": "" }, { "docid": "7a9a227fd336a5a531cd276fa26a9ff3", "score": "0.6387747", "text": "function render(now) {\n now *= 0.001; // convert to seconds\n const deltaTime = now - then;\n then = now;\n shaderProgramNorm = initShaderProgram(gl, vsSourceNorm, fsSourceNorm);\n\n shaderProgramText = initShaderProgram(gl, vsSourceText, fsSourceText);\n\n shaderProgramWall = initShaderProgram(gl, vsSourceText, fsSourceWall);\n\n programInfo = {\n program: shaderProgramNorm,\n attribLocations: {\n vertexPosition: gl.getAttribLocation(shaderProgramNorm, 'aVertexPosition'),\n vertexColor: gl.getAttribLocation(shaderProgramNorm, 'aVertexColor'),\n },\n uniformLocations: {\n projectionMatrix: gl.getUniformLocation(shaderProgramNorm, 'uProjectionMatrix'),\n modelViewMatrix: gl.getUniformLocation(shaderProgramNorm, 'uModelViewMatrix'),\n },\n };\n if (GameStatus === true) {\n drawScene(gl, programInfo, deltaTime);\n if (pauseStatus === false) {\n tick_elements(gl);\n }\n }\n requestAnimationFrame(render);\n }", "title": "" }, { "docid": "04792d43efe9b4dca72d90b355222a31", "score": "0.6370608", "text": "function render() {\n player1.render();\n player2.render();\n puck.render();\n }", "title": "" }, { "docid": "fdcdc4a96a45bcf0a1f7256258c2506d", "score": "0.63664573", "text": "function renderSimulation(ctx) {\n\n if (g_menuScreenOn) {\n entityManager.render(ctx);\n\n if (g_renderSpatialDebug) spatialManager.render(ctx);\n\n } else {\n menu.screen(ctx);\n }\n\n\n if (isGameOver) gameOverScreen.render(ctx);\n}", "title": "" }, { "docid": "2dd3989921dfcab675fe82a25986b634", "score": "0.6363696", "text": "function renderGame() {\n // Render text to screen\n game.debug.reset();\n if (debug) {\n if (player) {\n game.debug.body(player.playerSprite);\n }\n game.debug.text(game.time.fps || \"--\", 2, 14, \"#00ff00\"); // Prints FPS\n game.debug.cameraInfo(game.camera, 32, 32);\n }\n for (var i = 0; i < enemies.length; i++) {\n game.debug.text(enemies[i].percentage, (30*enemies[i].lobbyID), 540, \"#00ff00\"); // Prints FPS\n game.debug.text(enemies[i].getStock(), (30*enemies[i].lobbyID), 570, \"#ff0000\");\n }\n}", "title": "" }, { "docid": "d44221d83482e4214d41d47abe73bc82", "score": "0.6354679", "text": "loadRender() {\n this.game.debug.text(\"loading data\", this.game.width / 2, this.game.width / 2, \"#AAA\");\n }", "title": "" }, { "docid": "5d79c5a6cae9f18966e4b3ea842af4a0", "score": "0.63522714", "text": "function renderScene() {\n\tgameCtx.fillStyle = \"lightgreen\";\n\tgameCtx.fillRect(0,0,gameCanvas.width,gameCanvas.height);\n\tfor (i=0;i<MAX_PLAYABLE_CHARS;i++) {\n\t\tvar myChar = characters[i];\n\t\tgameCtx.drawImage(classList[myChar.art], myChar.x, myChar.y);\n\t}\n\t\n\t//draw stuff depending on the state\n\tswitch (menuState) {\n\t\tcase STATE_TARGET:\n\t\t\tgameCtx.drawImage(art_pointer,characters[pointerLoc].x,characters[pointerLoc].y+classList[characters[pointerLoc].art].height/2);\n\t\t\t/*\n\t\t\tif (pointerLoc<3) {\n\t\t\t\tgameCtx.drawImage(art_pointer,16,48+pointerLoc*104);\n\t\t\t}\n\t\t\tif (pointerLoc>3) {\n\t\t\t\tgameCtx.drawImage(art_pointer,characters[pointerLoc].x,characters[pointerLoc].y);\n\t\t\t}\n\t\t\t*/\n\t\t\tbreak;\n\t\tdefault:\n\t}\n}", "title": "" }, { "docid": "7c87e8bce3eec6e44d05385e47c60a79", "score": "0.6346744", "text": "function renderSimulation(ctx) {\n\n gameManager.renderScreen(gameManager.currentScreen,ctx);\n\n\n //move this into gameScreen\n /*entityManager.render(ctx);\n\n if (g_renderSpatialDebug) spatialManager.render(ctx);\n */\n}", "title": "" }, { "docid": "eaf9561fcba6069f39a6e13e8089376c", "score": "0.6339058", "text": "render () {\n\t\tplayer.render();\t\n\t\tcat.render();\t\n\t}", "title": "" }, { "docid": "9a86e78d6e835511ded30dde30843779", "score": "0.6311733", "text": "static render(world) {\n // Background\n background(world.backdrop.r, world.backdrop.g, world.backdrop.b);\n\n // Shadows\n fill(world.backdrop.r - 20, world.backdrop.g - 20, world.backdrop.b - 20);\n noStroke();\n { // World\n if (world.type === 'rectangle') { // World\n rect(world.x + world.width / 2 + 7, world.y + world.height / 2 + 6, world.width, world.height);\n } else if (world.type === 'ellipse') {\n ellipse(world.x + world.width / 2 + 5, world.y + world.height / 2 + 4, world.width / 2, world.height / 2);\n }\n }\n { // Leaderboard\n translate(org.off.x, org.off.y); // Shadows in renderWorld() so it will render behind world\n rectMode(CORNER);\n Game.game.board.y = Game.game.board.marginTop; // Leaderboard Head\n switch (Game.game.info.mode) {\n case 'ffa':\n Game.game.board.x = width - (Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth + Game.game.board.threeWidth) - Game.game.board.marginRight;\n rect(Game.game.board.x + 4, Game.game.board.y + 3, Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth + Game.game.board.threeWidth, Game.game.board.rowHeight);\n Game.game.board.count = min(Game.game.board.show, Game.game.board.list.length);\n break;\n case 'skm':\n Game.game.board.x = width - (Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth + Game.game.board.threeWidth) - Game.game.board.marginRight;\n rect(Game.game.board.x + 4, Game.game.board.y + 3, Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth + Game.game.board.threeWidth, Game.game.board.rowHeight);\n Game.game.board.count = Game.game.teams.length;\n break;\n case 'srv':\n Game.game.board.x = width - (Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth) - Game.game.board.marginRight;\n rect(Game.game.board.x + 4, Game.game.board.y + 3, Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth, Game.game.board.rowHeight);\n Game.game.board.count = min(Game.game.board.show, Game.game.board.list.length);\n break;\n case 'ctf':\n Game.game.board.x = width - (Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth) - Game.game.board.marginRight;\n rect(Game.game.board.x + 4, Game.game.board.y + 3, Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth, Game.game.board.rowHeight);\n Game.game.board.count = Game.game.teams.length;\n break;\n case 'inf':\n Game.game.board.x = width - (Game.game.board.nameWidth + Game.game.board.oneWidth) - Game.game.board.marginRight;\n rect(Game.game.board.x + 4, Game.game.board.y + 3, Game.game.board.nameWidth + Game.game.board.oneWidth, Game.game.board.rowHeight);\n Game.game.board.count = min(Game.game.board.show, Game.game.board.list.length);\n break;\n case 'kth':\n Game.game.board.x = width - (Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth) - Game.game.board.marginRight;\n rect(Game.game.board.x + 4, Game.game.board.y + 3, Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth, Game.game.board.rowHeight);\n Game.game.board.count = min(Game.game.board.show, Game.game.board.list.length);\n break;\n }\n let a = 0;\n for (let i = 0; i < Game.game.board.count; i++) { // Leaderboard Body\n if (Game.game.info.mode !== 'skm' && Game.game.info.mode !== 'ctf') { // If not a team mode\n let spectator = false;\n for (let j = 0; j < Game.game.spectators.length; j++) {\n if (Game.game.board.list[i].id === Game.game.spectators[j]) {\n spectator = true;\n break;\n }\n }\n if (spectator === true) {\n if (i < Game.game.board.count) {\n if (Game.game.board.count < Game.game.info.player_count) {\n Game.game.board.count++; // Extend leaderboard length to include the next player\n i++; // Do not render leaderboard status if player is a spectator\n } else {\n continue;\n }\n }\n }\n }\n switch (Game.game.info.mode) {\n case 'ffa':\n rect(Game.game.board.x + 4, Game.game.board.y + 3 + (a + 1) * Game.game.board.rowHeight, Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth + Game.game.board.threeWidth, Game.game.board.rowHeight);\n break;\n case 'skm':\n rect(Game.game.board.x + 4, Game.game.board.y + 3 + (a + 1) * Game.game.board.rowHeight, Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth + Game.game.board.threeWidth, Game.game.board.rowHeight);\n break;\n case 'srv':\n rect(Game.game.board.x + 4, Game.game.board.y + 3 + (a + 1) * Game.game.board.rowHeight, Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth, Game.game.board.rowHeight);\n break;\n case 'ctf':\n rect(Game.game.board.x + 4, Game.game.board.y + 3 + (a + 1) * Game.game.board.rowHeight, Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth, Game.game.board.rowHeight);\n break;\n case 'inf':\n rect(Game.game.board.x + 4, Game.game.board.y + 3 + (a + 1) * Game.game.board.rowHeight, Game.game.board.nameWidth + Game.game.board.oneWidth, Game.game.board.rowHeight);\n break;\n case 'kth':\n rect(Game.game.board.x + 4, Game.game.board.y + 3 + (a + 1) * Game.game.board.rowHeight, Game.game.board.nameWidth + Game.game.board.oneWidth + Game.game.board.twoWidth, Game.game.board.rowHeight);\n break;\n }\n a++;\n }\n translate(-org.off.x, -org.off.y);\n rectMode(CENTER);\n } { // Messages\n translate(org.off.x, org.off.y);\n if (config.settings.messages === true) {\n textFont('Helvetica');\n textStyle(NORMAL);\n const message = new Message();\n if (message.hasText) {\n rect(5 + 25 + message.width / 2, 4 + 25 + 9 * message.breaks, 25 + message.width, 26 + 18 * message.breaks);\n }\n }\n translate(-org.off.x, -org.off.y);\n }\n\n // World\n fill(world.background.r, world.background.g, world.background.b);\n stroke(world.border.color.r, world.border.color.g, world.border.color.b);\n strokeWeight(world.border.weight);\n if (world.type === 'rectangle') {\n rect(world.x + world.width / 2, world.y + world.height / 2, world.width, world.height); // World border\n } else if (world.type === 'ellipse') {\n ellipse(world.x + world.width / 2, world.y + world.height / 2, world.width / 2, world.height / 2); // World border\n }\n\n // CTF\n if (Game.game.info.mode === 'ctf') {\n // Bases\n for (let i = 1; i < Game.game.teams.length + 1; i++) {\n let color = config.colors.teamsDef[config.colors.teams[i - 1]];\n stroke(config.colors.orgs[world.color][color].r, config.colors.orgs[world.color][color].g, config.colors.orgs[world.color][color].b);\n strokeWeight(3);\n let bin = i.toString(2); // Convert i to binary string\n if (bin.length < 2) {\n bin = '0' + bin; // Add zero to front to form equivalent two-length binary number\n }\n let x = world.x + (world.width * parseInt(bin[bin.length - 1]));\n let y = world.y + (world.height * parseInt(bin[bin.length - 2]));\n let theta;\n if (bin === '01') {\n theta = 270;\n } else if (bin === '10') {\n theta = 90;\n } else if (bin === '11') {\n theta = 180;\n } else if (bin === '100') {\n theta = 0;\n }\n let l = 150;\n if (world.type === 'rectangle') {\n arc(x, y, l, l, -theta + 1, -theta + 89); // -1 to avoid world border overlap with a degree cushion either side\n } else if (world.type === 'ellipse') {\n let r = world.width / 2;\n let h = x + cos(-theta + 45) * r * (Z.root2 - 1); // l = r(Z.root2 - 1); length from circle to square corner\n let k = y + sin(-theta + 45) * r * (Z.root2 - 1); // yoff = l*sin(-theta + 45); -theta + 45 gives angle to center\n let a = world.x + r; // a is world center x\n let b = world.y + r; // b is world center y\n let diffs = [];\n let points = [ /*{ p: Number, q: Number }*/ ];\n for (let j = 0; j < 720; j++) {\n let alpha = j;\n let p = h + l * cos(alpha);\n let q = k + l * sin(alpha);\n let d = abs(sqrt(sq(p - a) + sq(q - b)) - r); // Calculate distance of point on base circle to world circle\n diffs.push(d); // Store all distances to array\n points.push({ p: p, q: q }); // Store all points to array\n }\n let point = points[diffs.indexOf(min(diffs))]; // Find closest point to world circle (points and diffs are analogous)\n let phi = atan(abs(point.q - k) / abs(point.p - h));\n if (phi > 45) {\n phi = 90 - phi;\n }\n arc(h, k, l, l, -theta - phi + 1, -theta + 90 + phi - 1); // -1 to avoid world border overlap\n }\n }\n // Flag\n noFill();\n stroke(world.border.color.r, world.border.color.g, world.border.color.b);\n strokeWeight(2);\n line(Game.game.flag.x - Game.game.flag.width / 2, Game.game.flag.y - Game.game.flag.height / 2, Game.game.flag.x - Game.game.flag.width / 2, Game.game.flag.y + Game.game.flag.height / 2);\n fill(Game.game.flag.color.r, Game.game.flag.color.g, Game.game.flag.color.b);\n strokeWeight(1);\n triangle(Game.game.flag.x - Game.game.flag.width / 2, Game.game.flag.y - Game.game.flag.height / 2, Game.game.flag.x - Game.game.flag.width / 2, Game.game.flag.y, Game.game.flag.x + Game.game.flag.width / 2, Game.game.flag.y - Game.game.flag.height / 4);\n }\n }", "title": "" }, { "docid": "476d7e0cb5050599e0c93b4c65b6c45c", "score": "0.62696195", "text": "function render() {\n game.tick();\n\n if (game.player.dirty) sock.send(event('pos', game.player.y));\n game.player.dirty = false;\n\n\tvar context = game.canvas.getContext('2d');\n\tif (game.status != 0) {\n\t\t// blank it out\n\t\trenderClear(context);\n renderBall(context);\n\t\trenderPaddle(context, '#cc9999', game.opponent.x, game.opponent.y, game.opponent.h);\n\t\trenderPaddle(context, '#9999cc', game.player.x, game.player.y, game.player.h);\n }\n}", "title": "" }, { "docid": "373210232cf916c036b7b11784544b07", "score": "0.62554127", "text": "function render(delta)\n{\n bkgdImage.renderF(canvas.width, canvas.height);\n\n switch(gameState)\n {\n case 0:\n sStartButton.renderF(240, 100);\n styleText('white', '35px Courier New','center','middle');\n canvasContext.fillText(\"Asteroid Panic!\", canvas.width/2, 100);\n styleText('black', '30px Courier New','center','middle');\n canvasContext.fillText(\"Play\", canvas.width/2, canvas.height / 2 - 50);\n sInstructionButton.renderF(240, 100);\n canvasContext.fillText(\"Instructions\", canvas.width/2, canvas.height / 2 + 150);\n break;\n\n case 1:\n sAsteroid.renderF(100, 100);\n sPlayerShip.renderF(100, 150);\n\n if (asteroidSpawned == true)\n {\n sAsteroid2.renderF(100, 100);\n }\n\n if (asteroidSpawned2 == true)\n {\n sAsteroid3.renderF(100, 100);\n }\n\n if (asteroidSpawned3 == true)\n {\n sAsteroid4.renderF(100, 100);\n }\n\n if (shotFired == true)\n {\n sPlasmaBall.renderF(25, 25);\n }\n\n styleText('white', '30px Courier New','left','middle');\n canvasContext.fillText(\"Score: \" + score, 20, 20);\n canvasContext.fillText(\"Shield: \" + shipHealth + \"%\", 20, 40);\n break;\n\n case 2:\n sRetryButton.renderF(240, 100);\n styleText('black', '30px Courier New','center','middle');\n canvasContext.fillText(\"Retry\", canvas.width/2, canvas.height / 1.5 + 50);\n styleText('white', '35px Courier New','center','middle');\n canvasContext.fillText(\"Game Over!\", canvas.width/2, 100);\n canvasContext.fillText(\"Score:\" + score, canvas.width/2, 200);\n break;\n\n case 3:\n styleText('white', '15px Courier New','left','middle');\n canvasContext.fillText(\"Tap the screen to shoot plasma balls\", 5, 100);\n canvasContext.fillText(\"Destroy asteroids to gain score\", 5, 150);\n canvasContext.fillText(\"Don't let asteroids hit the ship\", 5, 200);\n canvasContext.fillText(\"Survive for two minutes to win\", 5, 250);\n sMenuButton.renderF(240, 100);\n styleText('black', '30px Courier New','center','middle');\n canvasContext.fillText(\"Return\", canvas.width/2, canvas.height / 2 + 250);\n break;\n\n case 4:\n sReplayButton.renderF(240, 100);\n styleText('black', '30px Courier New','center','middle');\n canvasContext.fillText(\"Replay\", canvas.width/2, canvas.height / 1.5 + 50);\n styleText('white', '35px Courier New','center','middle');\n canvasContext.fillText(\"Victory!\", canvas.width/2, 100);\n canvasContext.fillText(\"Score:\" + score, canvas.width/2, 200);\n break;\n }\n}", "title": "" }, { "docid": "181a8ee58fbd8f9d35bbd96720fdb680", "score": "0.6254753", "text": "function render()\n\t\t{\n\t\t\trequestAnimationFrame(render);\n\t\t\twindow[\"renderer\"+i].render(window[\"scene\"+i],window[\"camera\"+i]);\n\t\t}", "title": "" }, { "docid": "7d58b7b38338b47720c39128ddb277cd", "score": "0.6252267", "text": "function startGame(){\n render();\n}", "title": "" }, { "docid": "5a18f7e9855e42eecd45f4e0c0accfd6", "score": "0.6251336", "text": "render() {\n //draw various components to the screen\n this.background.drawToCanvas(ctx)\n this.score.drawToCanvas(ctx)\n this.worm.drawToCanvas(ctx)\n this.dirButtons.drawToCanvas(ctx)\n if (!this.playing || this.gameOver) {\n this.startButton.drawToCanvas(ctx)\n }\n }", "title": "" }, { "docid": "01e2eafaafa1f25e31c907de5f4a59eb", "score": "0.6247021", "text": "render({\n time\n }) {\n controls.update();\n\n if (SETTINGS.useComposer) {\n composer.render();\n } else {\n renderer.clear();\n renderer.render(scene, camera);\n }\n }", "title": "" }, { "docid": "e7c38105e5f703b156f2e48864b3f8ed", "score": "0.62400347", "text": "function game(){\r\n update();\r\n render();\r\n}", "title": "" }, { "docid": "9254fdff18118fa5760747b35c6e69e7", "score": "0.6239677", "text": "function render(s) {\nrenderTime0 = new Date().getTime();\n\tif(s==0){\n\t\tgl.viewport(0, 0, canvasWidth, canvasHeight);\n\t}\n\telse if(s==1){\n\t\tgl.viewport(0, 0,offscreenRenderWidth, offscreenRenderHeight);\t\n\t}\n\tgl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\tvar curPrg = null;\n\tvar curProgram = null;\n\t\n\ttry{\t \n\t\tfor(var i=0; i<Scene.objects.length; i++){\n\t\t\tvar object = Scene.objects[i];\n\t\t\tif(object.type==\"sidePlane\"){\t\n\t\t\t\tgl.useProgram(mainPrg);\n\t\t\t\tcurProgram = mainProgram;\n\t\t\t\tcurPrg = mainPrg;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tgl.useProgram(prg1);\n\t\t\t\tcurProgram = program1;\n\t\t\t\tcurPrg = prg1;\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tvar renderPosition = position.slice(0);\n\t\t\trenderPosition[0]+=object.xOff;\n\t\t\trenderPosition[1]+=object.yOff;\n\t\t\tvar renderRotation = rotation.slice(0);\n\t\t\trenderRotation[2]+=object.zRotation;\n\t\t\tif(object.isMiddle==true){\n\t\t\t\tobject.lightDirection0 = lightDirection0.slice(0);\n\t\t\t\tobject.lightDirection1 = lightDirection1.slice(0);\n\t\t\t\tobject.param0 = param0;\n\t\t\t\tobject.param1 = param1;\n\t\t\t\tobject.lightIntensity0 = lightIntensity0;\n\t\t\t\tobject.lightIntensity1 = lightIntensity1;\n\t\t\t}\n\t\t\t\n\t\t\t//gl.uniform1fv(curProgram.gkernels, kerneltest);\n\t\t\t\n\t\t\tif(s==1){\n\t\t\t\tmat4.perspective(30/180*Math.PI, offscreenRenderWidth/offscreenRenderHeight, 1, 10000.0, pMatrix);\t\t\n\t\t\t}\t\n\t\t\telse{\n\t\t\t\tmat4.perspective(30/180*Math.PI, canvasWidth / canvasHeight, 1, 10000.0, pMatrix); // We can resize the screen at any point so the perspective matrix should be updated always.\n\t\t\t}\n\t\t\tmat4.identity(mvMatrix);\n\t\t\tmat4.set(mvMatrix,mvMatrixCopy);\n\t\t\n\t\t\tif(object.type==\"sidePlane\"){\n\n\t\t\t\tif(s==1){\n\t\t\t\t\tmat4.translate(mvMatrix, [HOME[0]+object.xOff,HOME[1]+object.yOff,HOME[2]]);\n\t\t\t\t\trenderRotation[2] -= rotation[2];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tmat4.translate(mvMatrix, renderPosition);\n\t\t\t\t}\n\t\t\t\tmat4.rotateX(mvMatrix,renderRotation[0]*Math.PI/180);\n\t\t\t\tmat4.rotateY(mvMatrix,renderRotation[1]*Math.PI/180);\n\t\t\t\tmat4.rotateZ(mvMatrix,renderRotation[2]*Math.PI/180);\n\t\t\t\tmat4.rotateX(nMatrix,renderRotation[0]*Math.PI/180);\n\t\t\t\tmat4.rotateY(nMatrix,renderRotation[1]*Math.PI/180);\n\t\t\t\tmat4.rotateZ(nMatrix,renderRotation[2]*Math.PI/180);\t\n\t\t\t}\n\n\t\t\tif(object.id==\"objectLight0\"){\n\t\t\t\tvar zdisp = 5;\n\t\t\t\tmat4.translate(mvMatrix, [lightDirection0[0]*Math.tan(15/180*Math.PI)*zdisp*canvasWidth / canvasHeight/lightEllipseFactor,lightDirection0[1]*Math.tan(15/180*Math.PI)*zdisp/lightEllipseFactor,-zdisp]);\n\t\t\t\tmat4.rotateY(mvMatrix,-Math.acos(lightDirection0[0])-lightDirection0[0]*30/180*Math.PI+Math.PI/2);\n\t\t\t\tmat4.rotateX(mvMatrix,Math.acos(lightDirection0[1])+lightDirection0[1]*30/180*Math.PI/canvasWidth*canvasHeight-Math.PI/2);\n\t\t\t}\n\n\t\t\tif(object.id==\"objectLight1\"){\n\t\t\t\tvar zdisp = 5;\n\t\t\t\tmat4.translate(mvMatrix, [lightDirection1[0]*Math.tan(15/180*Math.PI)*zdisp*canvasWidth / canvasHeight/lightEllipseFactor,lightDirection1[1]*Math.tan(15/180*Math.PI)*zdisp/lightEllipseFactor,-zdisp]);\n\t\t\t\tmat4.rotateY(mvMatrix,-Math.acos(lightDirection1[0])-lightDirection1[0]*30/180*Math.PI+Math.PI/2);\n\t\t\t\tmat4.rotateX(mvMatrix,Math.acos(lightDirection1[1])+lightDirection1[1]*30/180*Math.PI/canvasWidth*canvasHeight-Math.PI/2);\n\t\t\t}\n\n\t\t\tgl.uniformMatrix4fv(curProgram.uMVMatrix, false, mvMatrix);\n\t\t\tgl.uniformMatrix4fv(curProgram.uPMatrix, false, pMatrix); \t\n\t\t\tmat4.inverse(mvMatrix,mvMatrix); \t\t\t\t\n\t\t\tmat4.transpose(mvMatrix, nMatrix); \t\n\t\t\tgl.uniformMatrix4fv(curProgram.uNMatrix, false, nMatrix); \t\n\t\t\tgl.uniform3fv(curProgram.uLightDirection0, object.lightDirection0);\n\t\t\tgl.uniform3fv(curProgram.uLightDirection1, object.lightDirection1);\n\t\t\tgl.uniform3fv(curProgram.uSplit, split);\n\t\t\tgl.uniform1f(curProgram.uLightIntensity0, object.lightIntensity0);\n\t\t\tgl.uniform1f(curProgram.uLightIntensity1, object.lightIntensity1);\n\t\t\tgl.uniform1f(curProgram.uFloatTex, floatingPointTextureSupport);\n\t\t\tif(moving){\t\t\n\t\t\t\tgl.uniform1f(curProgram.uParam0, 0.1);\n\t\t\t\tgl.uniform1f(curProgram.uParam1, 0);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tgl.uniform1f(curProgram.uParam0, object.param0);\n\t\t\t\tgl.uniform1f(curProgram.uParam1, object.param1);\n\t\t\t}\n\t\t\t\n\t\t\tmat4.set(mvMatrixCopy,mvMatrix); //switch back to old mvMatrix\n\t\n\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, object.vbo);\n\t\t\tgl.enableVertexAttribArray(0);\n\t\t\tgl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);\n\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, null);\n\t\t\t//console.log( \"VBO SIZE: \"+gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE));\n\n\t\t\tif(object.id==\"objectLight0\" && boolLightToggle()){gl.uniform4fv(curProgram.uMaterialAmbient, [1.0, 1.0, 0, 1.0]);}\n\t\t\telse if(object.id==\"objectLight1\"){gl.uniform4fv(curProgram.uMaterialAmbient, [1.0, 1.0, 0, 1.0]);}\n\t\t\telse{gl.uniform4fv(curProgram.uMaterialAmbient, [0, 0, 0, 0]);}\n\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, object.tbo);\n\t\t\tgl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);\t\t\n\t\t\tgl.enableVertexAttribArray(1);\n\t\t\t\n\t\t\tif (object.id!=\"objectLight0\" && object.id!=\"objectLight1\"){\n\t\t\t\tgl.uniform2fv(curProgram.uImgDim, [textureData[object.id].width,textureData[object.id].height]);\n\t\t\t\tgl.uniform1f(curProgram.uBoolDepthMap, boolDepthMap);\n\t\t\t\tif(boolDepthMap){\n\t\t\t\t\tgl.activeTexture(gl.TEXTURE0);\n\t\t\t\t\tgl.bindTexture(gl.TEXTURE_2D, disTex[object.id]);\n\t\t\t\t\tgl.uniform1i(curProgram.uDispSampler, 0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tgl.activeTexture(gl.TEXTURE1);\n\t\t\t\tgl.bindTexture(gl.TEXTURE_2D, normalTex[object.id]);\n\t\t\t\tgl.uniform1i(curProgram.uNormalSampler, 1);\n\t\t\t\t\n\t\t\t\tif(useAmbient){\n\t\t\t\t\tgl.activeTexture(gl.TEXTURE2);\n\t\t\t\t\tgl.bindTexture(gl.TEXTURE_2D, ambientTex[object.id]);\n\t\t\t\t\tgl.uniform1i(curProgram.uAlbedoSampler, 2);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tgl.activeTexture(gl.TEXTURE2);\n\t\t\t\t\tgl.bindTexture(gl.TEXTURE_2D, albedoTex[object.id]);\n\t\t\t\t\tgl.uniform1i(curProgram.uAlbedoSampler, 2);\n\t\t\t\t}\n\t\t\t\tif(boolRti){\n\t\t\t\t\tgl.activeTexture(gl.TEXTURE0);\n\t\t\t\t\tgl.bindTexture(gl.TEXTURE_2D, disTex[object.id]);\n\t\t\t\t\tgl.uniform1i(curProgram.hshCoeff0Tex, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tgl.uniform1f(curProgram.uBoolDepthMap, false);\n\t\t\t}\n\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, object.ibo);\n\t\t\tif((object.type==\"lightCone\")&& boolLightToggle() &&(mainPrg == prg1 || mainPrg == prg3 || mainPrg == prg4 ||mainPrg == prg8 || mainPrg == prg9)){\n gl.drawElements(gl.LINE_STRIP, object.indices.length, gl.UNSIGNED_SHORT,0);\n\t\t\t\tif(object.id==\"objectLight0\"){gl.uniform4fv(curProgram.uMaterialAmbient, [lightIntensity0/2, lightIntensity0/2,0, 1.0]);}\n\t\t\t\tif(object.id==\"objectLight1\"){gl.uniform4fv(curProgram.uMaterialAmbient, [lightIntensity1/2, lightIntensity1/2,0, 1.0]);}\n\t\t\t\tgl.drawElements(gl.TRIANGLES, object.indices.length, gl.UNSIGNED_SHORT,0);\n } \n if(object.type==\"sidePlane\"){gl.drawElements(gl.TRIANGLES, object.indices.length, gl.UNSIGNED_SHORT,0);}\n\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, null);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n }\ngl.finish(); // waiting for the program to have finished this draw call. performance trick, should be investigated further: some claim this actually make it worse due to context switch from gpu to cpu, but test indicated slow shaders worked better with this\nrenderTime1 = new Date().getTime();\nconsole.log((renderTime1-renderTime0));\n\n }\n catch(err){\n alert(err);\n console.error(err.description);\n }\n}", "title": "" }, { "docid": "5962063e7c2e43406731ffcafe528f6e", "score": "0.62336767", "text": "function runGame() {\n\tupdateGame();\n\trenderGame();\n}", "title": "" }, { "docid": "5b5b7f5438e44943559eaf22fed46691", "score": "0.62320286", "text": "function renderGame()\n{\n // CLEAR THE CANVAS\n canvas2D.clearRect(0, 0, canvasWidth, canvasHeight);\n\n // RENDER THE GRID LINES, IF NEEDED\n if (cellLength >= GRID_LINE_LENGTH_RENDERING_THRESHOLD)\n renderGridLines();\n\n // RENDER THE GAME CELLS\n renderCells();\n\n // AND RENDER THE TEXT\n renderText();\n\n // THE GRID WE RENDER THIS FRAME WILL BE USED AS THE BASIS\n // FOR THE UPDATE GRID NEXT FRAME\n swapGrids();\n}", "title": "" }, { "docid": "ccb9f4bf98d2bda9b6b7d12d0594b8ed", "score": "0.62195116", "text": "function render() {\n\n //game.debug.renderRectangle(spriteGirl.body);\n //game.debug.renderRectangle(chicken1.body);\n\t//game.debug.renderRectangle(chicken2.body);\n\t//game.debug.renderRectangle(chicken3.body);\n\n}", "title": "" }, { "docid": "70dc47faa2ffe239943810bc8e5ae186", "score": "0.6199765", "text": "function draw() {\n if (startScreen === true){\n start();\n }\n else if (fearsActive === true){\n fearsGame();\n }\n else if (stepsActive === true){\n stepsGame();\n }\n else if (drawingsActive === true){\n drawingsGame();\n }\n else if (wishesActive === true){\n wishesGame();\n }\n else if (reviewActive === true){\n reviewGame();\n }\n}", "title": "" }, { "docid": "efd774c7862c3c4dd476aa915da57352", "score": "0.6197134", "text": "function render(now) {\n now *= 0.001; // convert to seconds\n const deltaTime = now - then;\n then = now;\n\n if(!isGrey)\n drawScene(gl, programInfo, deltaTime);\n else\n drawScene(gl, programInfoGrey, deltaTime);\n\n requestAnimationFrame(render);\n }", "title": "" }, { "docid": "fca913ceae0b5cc539f5652675e31dd5", "score": "0.6181212", "text": "function render(now) {\n \tif(prevgrey != grey)\n \t{\n\t\tconvertToGrey(gl,grey);\n\t\tprevgrey=grey;\n \t}\n now *= 0.001; // convert to seconds\n const deltaTime = now - then;\n then = now;\n if(head.pos[2]>500)\n \tterminate();\n drawScene(gl, programInfo, programInfoTexture, deltaTime);\n tick();\n collision_detection();\n requestAnimationFrame(render);\n }", "title": "" }, { "docid": "c3d187f5a73ee9ed5396cfc7e2d550ef", "score": "0.6175723", "text": "function init() {\n\tvar renderer = \"auto\";\n\tif (location.hash.indexOf(\"#dom\") != -1) renderer = \"dom\";\n\n\tterm = new ut.Viewport(document.getElementById(\"game\"), 51, 25, renderer);\n\teng = new ut.Engine(term, randomTile);\n\n\tdocument.getElementById(\"renderer\").innerHTML = term.getRendererString();\n\tvar a = document.getElementById(\"switch-renderer\");\n\ta.onclick = again;\n\tif (term.getRendererString() === \"dom\") {\n\t\ta.innerHTML = \"Switch to &lt;canvas&gt; renderer\";\n\t\ta.href = \"#canvas\";\n\t} else {\n\t\ta.innerHTML = \"Switch to DOM renderer\";\n\t\ta.href = \"#dom\";\n\t}\n}", "title": "" }, { "docid": "57fe33458fe895c462aa97124a891199", "score": "0.61744285", "text": "function main()\r\n{\r\n render();\r\n\r\n}", "title": "" }, { "docid": "a6d5bb4ec6c7585647dd4f76d240f4c6", "score": "0.6170524", "text": "function render() {\n if (state !== global.EngineStateEnum.STARTED) {\n return;\n }\n\n map.render();\n player.render();\n npcs.forEach(function (npc) {\n npc.render();\n });\n\n checkAndHandleCollisions();\n }", "title": "" }, { "docid": "465be3a4a40d017ac79f28310ac9344f", "score": "0.6169866", "text": "function render() {\n requestAnimationFrame(render);\n\n now = Date.now();\n deltaTime = now - then;\n\n if(deltaTime > interval){\n drawScene(gl, programInfo);\n \n // Manage UI\n manage_ui();\n \n\n // If game is not paused tick elements\n if (!pause_status) tick_elements();\n \n then = now - (deltaTime%interval);\n }\n\n }", "title": "" }, { "docid": "e18e8d77850d96da46c3cda15ac4760c", "score": "0.615325", "text": "function render() {\n\t//clear rect\n\tctx.clearRect(0,0,1000,600);\n\tdrawUI();\n\tdrawTable();\n\t//draw player hands\n\tfor (let i = 0; i < 5; i++) {\n\t\tdrawHand(i);\n\t}\n\n\tdrawLives(livesLeft);\n\tdrawInfoCounter(numInfoTokens);\n\tdrawDiscarded();\n\n\tdynamicDrawables.forEach(function(item) {\n\t\titem.draw();\n\t});\n\n}", "title": "" }, { "docid": "7335aa2ebc10e843b15359d1f7cdca57", "score": "0.6149535", "text": "function renderSimulation(ctx) {\n\n g_bricks.render(ctx);\n\n g_ball.render(ctx);\n g_ball2.render(ctx);\n \n displayScore(ctx);\n\n g_paddle3.render(ctx);\n\n if (g_extraballs) randomBalls_render(ctx);\n\n if (g_multiplayer) g_paddle1.render(ctx);\n // Uncoment to see the effect\n \n \n}", "title": "" }, { "docid": "69aeacceb3a90956adffe13b22ef04f3", "score": "0.61485934", "text": "function render(){\n\trenderer.render(scene,camera);\n}", "title": "" }, { "docid": "2a76d3b9a8d2ef35c86295e4315ac816", "score": "0.6143951", "text": "function renderEntities() {\n /* Loop through all of the objects within the allEnemies array and call\n * the render function\n */\n allEnemies.forEach(function(enemy) {\n enemy.render();\n });\n\n player.render();\n \n // Render a new random gem if there is no current gem on the boards\n if(!gemOnBoard){\n currentGem= getRandomGem();\n gemOnBoard = true;\n }\n\n // Render current gem and goal(star)\n currentGem.render();\n goal.render();\n }", "title": "" }, { "docid": "ccc48e6103f1a2e8dc3748615146748c", "score": "0.6134387", "text": "function main(){\n\n\tif(!gameStart){\n\n\t\tstartScreen();\n\n\t}else{\n\n\t\tvar now = Date.now();\n\t\tvar delta = now - then;\n\n\t\tupdate(delta / 1000);\n\t\trender();\n\n\t\tthen = now;\n\n\t\tif (gameStatus == \"lose\"){\n\t\t\tendGame();\n\t\t\treturn\n\t\t}\n\t\t\n\t\tif (gameStatus == \"win\"){\n\t\t\tendGame();\n\t\t\treturn\n\t\t}\n\n\t\t// Request to do this again ASAP\n\t\trequestAnimationFrame(main);\n\t}\n}", "title": "" }, { "docid": "e2a49f21fe72e197e3331c732968e175", "score": "0.61191946", "text": "function render(now) {\n now *= 0.001; // convert to seconds\n const deltaTime = now - then;\n then = now;\n if(timeup == 0) {\n timeup = 0.5;\n countTime = now;\n } // time up restored\n if (now - countTime >= 1.0) {\n timeup = 1;\n }\n if (countTimePol == 0) {\n countTimePol = now;\n }\n if (now - countTimePol >= 3.0) {\n timeupPol = 1;\n }\n if (isJetpack == 1) {\n countTimeJet = now;\n isJetpack = 0.5;\n }\n if(timeupJet == 0) {\n if (now - countTimeJet >= 10.0) {\n timeupJet = 1;\n }\n }\n if (isShoe == 1) {\n countTimeShoe = now;\n isShoe = 0.5;\n }\n if(timeupShoe == 0) {\n if (now - countTimeShoe >= 10.0) {\n timeupShoe = 1;\n isShoe = 0;\n }\n }\n // c.rotation += 0.02;\n tickelements()\n detect_collision_x()\n // detect_collision_y()\n drawScene(gl, programInfo, deltaTime);\n // tick elements and tickinput\n requestAnimationFrame(render);\n }", "title": "" }, { "docid": "737ebf99d283296bc9ec8365cb1584a8", "score": "0.6114069", "text": "function render() {\r\n renderer.render(scene, camera);\r\n\r\n if (renderer2 != undefined) {\r\n renderer2.render(scene2, camera2);\r\n }\r\n}", "title": "" }, { "docid": "b831c990994e0b3e56e303ac8d199629", "score": "0.6112285", "text": "function render() {\r\n\r\n // Clear the scene\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n\r\n // Draw the board\r\n draw_board();\r\n\r\n // Draw pieces\r\n draw_pieces(gl.current_player); \r\n}", "title": "" }, { "docid": "d0bb5f9b5144be61975155936aacc166", "score": "0.610126", "text": "function render() {\n window.requestAnimFrame(render, canvas); // loop\n\n currentGame.render();\n animate();\n}", "title": "" }, { "docid": "af8062e7b063c15d753ef55ed43d4450", "score": "0.60954785", "text": "render(renderer) {\n\t\t// TODO: Render all game elements.\n\t\tif (sdl.SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF) !== 0) {\n\t\t\tthrow new Error(sdl.SDL_GetError())\n\t\t}\n\t\tlet rectToDraw = new sdl.SDL_Rect({\n\t\t\tx: this.location.x,\n\t\t\ty: this.location.y,\n\t\t\tw: this.size.x,\n\t\t\th: this.size.y\n\t\t})\n\t\tsdl.SDL_RenderFillRect(renderer, rectToDraw.ref())\n\t}", "title": "" }, { "docid": "f6318b90730ad12c1aed59ef0e153c2c", "score": "0.6090599", "text": "function renderSimulation(ctx) {\n if (!breakout.gameOver) {\n g_ball.render(ctx);\n g_paddle.render(ctx);\n for (b in bricks) {\n bricks[b].render(ctx);\n }\n }\n breakout.highScoreRender(ctx);\n breakout.heartRender(ctx);\n}", "title": "" }, { "docid": "c0e92c9c183ba3f5d46b344dab6ee369", "score": "0.6088567", "text": "render(ctx) {\n ctx.imageSmoothingEnabled = false;\n\n\n switch (this.state) {\n case \"PLAYING\":\n ctx.clearRect(0, 0, this.VIEW_WIDTH, this.VIEW_HEIGHT);\n ctx.fillStyle = this.BG_COLOR;\n ctx.fillRect(0, 0, this.VIEW_WIDTH, this.VIEW_HEIGHT);\n //render the map\n this.map.forEach( (row, row_i) => {\n row.forEach( (square, col_i) => {\n square.render(ctx); \n })\n })\n \n //render the actors\n this.player.render(ctx);\n this.aliens.forEach( (alien) => {\n alien.render(ctx);\n })\n\n \n //check if all aliens are defeated\n if(this.aliens.every((alien) => alien.state === \"DEAD\")) {\n this.goToNextLevel();\n }\n\n //check if player is dead\n if(this.player.state === \"DEAD\") {\n this.handleGameOver();\n }\n \n break;\n case \"LEVEL_START\":\n\n //render the map\n this.map.forEach( (row, row_i) => {\n row.forEach( (square, col_i) => {\n square.render(ctx); \n })\n })\n \n //render the actors\n this.player.render(ctx);\n this.aliens.forEach( (alien) => {\n alien.render(ctx);\n })\n\n ctx.fillStyle = 'rgba(240, 242, 245, 0.7)';\n ctx.fillRect(-5, 150, 700, 160);\n ctx.strokeRect(-50, 150, 700, 160);\n ctx.fillStyle = 'black';\n ctx.font = \"40px Noto Sans\";\n ctx.fillText(`Level ${this.current_level}`, 150, 220);\n ctx.font = \"20px Noto Sans\";\n ctx.fillText(\"Press Enter to start\", 150, 270);\n break;\n case \"VICTORY\":\n\n //render the map\n this.map.forEach( (row, row_i) => {\n row.forEach( (square, col_i) => {\n square.render(ctx); \n })\n })\n \n //render the actors\n this.player.render(ctx);\n this.aliens.forEach( (alien) => {\n alien.render(ctx);\n })\n\n ctx.fillStyle = 'rgba(240, 242, 245, 0.7)';\n ctx.fillRect(-5, 150, 700, 160);\n ctx.strokeRect(-50, 150, 700, 160);\n ctx.fillStyle = 'black';\n ctx.font = \"40px Noto Sans\";\n ctx.fillText(`CONGRATULATIONS`, 150, 220);\n ctx.font = \"20px Noto Sans\";\n ctx.fillText(\"Thank you for playing!\", 150, 270);\n break;\n }\n }", "title": "" }, { "docid": "d6b58184f64b5641f4a43f6f097690e7", "score": "0.60829014", "text": "function renderSimulation(ctx) {\n if(g_isGameStarted) {\n entityManager.render(ctx);\n particleManager.render(ctx);\n sideBar.render(ctx);\n }\n\n if(g_gameOver) {\n gameOverScreen.render(ctx);\n }\n\n if(startScreen.isVisible()) {\n ctx.save();\n ctx.translate(0, startScreen.offsetY);\n startScreen.render(ctx);\n ctx.restore();\n }\n}", "title": "" }, { "docid": "930da282182fdb948e813ebe006d3c7a", "score": "0.6072918", "text": "function playGame(){\r\n\r\n\tupdateLogic();\r\n\trenderGUI();\r\n}", "title": "" }, { "docid": "e00961c02a6ff7bd4c80412280596271", "score": "0.6069454", "text": "function render(){\n renderer.render(scene,camera);\n }", "title": "" }, { "docid": "a589ab918912821a0505c99d1c6e4a18", "score": "0.60591865", "text": "function render(now) {\n now *= 0.001; // convert to seconds\n const deltaTime = now - then;\n then = now;\n count ++;\n\n // Well Played Cleared\n if(player.pos[2] <= -999)\n {\n // console.log(player.pos[2]);\n document.getElementById(\"glcanvas\").style.display=\"none\";\n document.getElementById(\"wellplayed\").style.display = \"\";\n player.speed = 0;\n }\n // Movements Function\n movements(); \n\n // if()\n // Collision Function \n collision();\n\n // Clearing Screen When Dead\n if(dead == 1){\n player.speed = 0;\n // train.speed = 0;\n document.getElementById(\"glcanvas\").style.display=\"none\";\n document.getElementById(\"gameover\").style.display = \"\";\n }\n\n drawScene(gl, programInfo, deltaTime);\n\n requestAnimationFrame(render);\n }", "title": "" }, { "docid": "89ec5e778ff62b7c65117ad458c00def", "score": "0.60519797", "text": "function render(){\n\tdraw();\n\tupdate();\n\tconsole.log(\"in render\");\n\tcounter++;\n\n\t// similar to setInterval()\n\tif(gameover == false){\n\t\t// similar to setInterval()\n\t\twindow.requestAnimationFrame(render);\n\t}\n\telse{\n\t\tstartGame();\n\t}\n\t}", "title": "" }, { "docid": "5be51564ffe85045126d0c27e890e018", "score": "0.6047195", "text": "function render() {\n\n ctx.clearRect(0,0, canvas.width, canvas.height)\n\n // Render the player if the game isn't over\n if(!isGameOver) {\n renderEntity(player)\n }\n\n renderEntities(bullets)\n renderEntities(bulletEnemy5)\n renderEntities(enemies)\n renderEntities(enemies5)\n renderEntities(boss)\n renderEntities(bossBullet)\n renderEntities(bossBullet2)\n renderEntities(bossBullet3)\n renderEntities(bossBullet4)\n renderEntities(explosions)\n}", "title": "" }, { "docid": "6acc5ba10296373c86f4e5fd5a630214", "score": "0.6045192", "text": "function render(now) {\n now *= 0.001; // convert to seconds\n const deltaTime = now - then;\n then = now;\n if(player.dead==true){\n document.getElementById('theme').pause();\n alert('You died'+'\\nFinal Score: '+score);\n return;\n }\n if(gray==0)\n gl.clearColor(135/256, 206/256, 235/256, 1.0);\n else\n gl.clearColor(220/256, 220/256, 220/256, 1.0);\n\n gl.clearDepth(1.0); // Clear everything\n gl.enable(gl.DEPTH_TEST); // Enable depth testing\n gl.enable(gl.BLEND)\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n gl.depthFunc(gl.LEQUAL); // Near things obscure far things\n\n // Clear the canvas before we start drawing on it.\n\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n drawScene(gl, programInfo, programInfotxt,textureobj, deltaTime);\n \n var GrayBuffer = gl.getUniformLocation(programInfotxt.program, \"uGray\");\n gl.uniform1i(GrayBuffer, gray);\n\n var FlashBuffer = gl.getUniformLocation(programInfotxt.program, \"uFlash\");\n gl.uniform1f(FlashBuffer,flash);\n\n if(flash>0)\n flash-=0.01;\n else\n flash=0;\n\n if(document.getElementById('theme').paused)\n document.getElementById('theme').play();\n \n \n tick_elements(now);\n tick_input();\n\n requestAnimationFrame(render);\n }", "title": "" }, { "docid": "c5e2b206a19a56bde60ba9af9504588c", "score": "0.6036826", "text": "function main() {\n\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n now = Date.now();\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n\n // If startScreen is 'true', the Start screen is displayed\n if (startScreen === true) {\n updateStartScreen(dt);\n renderStartScreen();\n }\n\n // If characterSelect is 'true', Character Selection screen is displayed\n if (characterSelect === true) {\n updateChaSelScreen();\n renderChaSelScreen(dt);\n }\n\n // After the new game button is pressed, the gameplay variable is\n // assigned to 'true' and the Game screen is displayed as long as\n // the player's lives is different from zero\n if (gameplay === true) {\n update(dt);\n render();\n }\n\n // If credits variable is 'true', the Credits screen is shown\n if (credits === true) {\n updateCreditScreen(dt);\n renderCreditScreen();\n }\n\n\n // If the player's lives reaches zero or time is over (2min max.), \n // the Game Over screen is displayed\n if (player.lives === 0 || count === 120) {\n gameplay = false;\n gameOver = true;\n }\n\n if (gameOver === true) {\n updateGameOverScreen();\n renderGameOverScreen();\n }\n\n\n // If the player gets 1000 points the game is won\n if (player.score >= 1000) {\n gameplay = false;\n winScreen = true;\n }\n\n if (winScreen === true) {\n updateWinScreen();\n renderYouWinScreen();\n }\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n requestId = win.requestAnimationFrame(main);\n }", "title": "" }, { "docid": "164534c7d2725370555631f89db8f3da", "score": "0.60235995", "text": "function render(lastTime) {\n screenDefault();\n ctx.textAlign = 'center';\n\n if (self.current === 'intro') {\n ctx.fillStyle = 'cyan';\n ctx.fillText('GALAGA', canvas.width / 2, canvas.height * 0.12);\n ctx.fillText('PUSH \\'P\\' TO START', canvas.width / 2, canvas.height * 0.30);\n ctx.drawImage(Resources.get('images/galaga-white-fighter.png'), canvas.width * 0.16, canvas.height * 0.37, 138 * 0.23, 145 * 0.23);\n ctx.fillStyle = 'yellow';\n ctx.fillText('1ST BONUS FOR 20000 PTS', canvas.width / 2, canvas.height * 0.405);\n\n ctx.drawImage(Resources.get('images/galaga-white-fighter.png'), canvas.width * 0.16, canvas.height * 0.44, 138 * 0.23, 145 * 0.23);\n ctx.fillStyle = 'yellow';\n ctx.fillText('2ND BONUS FOR 70000 PTS', canvas.width / 2, canvas.height * 0.475);\n\n ctx.drawImage(Resources.get('images/galaga-white-fighter.png'), canvas.width * 0.16, canvas.height * 0.51, 138 * 0.23, 145 * 0.23);\n ctx.fillStyle = 'yellow';\n ctx.fillText('AND FOR EVERY 70000 PTS', canvas.width / 2, canvas.height * 0.545);\n\n var c = 169; // 0xA9\n ctx.fillText(String.fromCharCode(c) + ' 1981 NAMCO LTD.', canvas.width / 2, canvas.height * 0.65);\n\n }\n else if (self.current === 'start') {\n ctx.fillStyle = 'red';\n ctx.fillText('STAGE ' + game.stage, canvas.width / 2, canvas.height * 0.40);\n\n if (lastTime > self.startTimerOne) {\n ctx.fillStyle = 'red';\n ctx.fillText('PLAYER 1', canvas.width / 2, canvas.height * 0.44);\n }\n }\n else if (self.current === 'summary') {\n ctx.fillStyle = 'yellow';\n ctx.textAlign = 'right';\n ctx.fillText('SHOTS FIRED:', canvas.width / 2 - 5, canvas.height * 0.44);\n ctx.fillText('ENEMIES KILLED:', canvas.width / 2 - 5, canvas.height * 0.48);\n ctx.fillText('EFFICIENY:', canvas.width / 2 - 5, canvas.height * 0.52);\n ctx.textAlign = 'left';\n ctx.fillText(self.playerShots.toString(), canvas.width / 2 + 10, canvas.height * 0.44);\n ctx.fillText(self.enemiesKilled.toString(), canvas.width / 2 + 10, canvas.height * 0.48);\n ctx.fillText(((self.enemiesKilled / self.playerShots) * 100).toFixed(0) + '%', canvas.width / 2 + 10, canvas.height * 0.52);\n }\n else if (self.current === 'active') {\n self.enemyManager.render(ctx);\n self.player.render(ctx);\n if (self.missiles.length > 0) {\n self.missiles.forEach(function updateMissiles(m) {\n m.render(ctx);\n });\n\n }\n addPlayerLives();\n }\n else if (self.current === 'over') {\n ctx.fillStyle = 'red';\n ctx.fillText('GAME OVER', canvas.width / 2, canvas.height * 0.30);\n ctx.fillStyle = 'cyan';\n ctx.fillText('PRESS \\'R\\' TO RESTART', canvas.width / 2, canvas.height * 0.50);\n }\n }", "title": "" }, { "docid": "3d71ebeba6f40b6861acf29655f538cc", "score": "0.6018782", "text": "function render() {\n /* This array holds the relative URL to the image used\n * for that particular row of the game level.\n */\n \n\n if(level === 0) {\n renderL1();\n } else if(level === 1) {\n renderL2();\n } else if(level === 2) {\n renderL3();\n }\n \n renderEntities();\n \n }", "title": "" }, { "docid": "ea94107d7f23709a63e04f0921571d11", "score": "0.6014668", "text": "function render() {\n console.log(state);\n renderPlayerTurn();\n //updatePlayerState();\n //renderScores();\n renderBoard();\n if (state.winner) {\n renderPlayAgain();\n }\n}", "title": "" }, { "docid": "2ee85618ccbc2bf98607fadcd37847b9", "score": "0.60050386", "text": "function renderingGameElements() {\n game1.platforms.forEach(platform => {\n platform.createPlatform()\n })\n\n movingPlat.createPlatform()\n elevatorPlatform.createPlatform()\n movingPlat.movePlatForm()\n elevatorPlatform.movePlatformUp()\n\n\n}", "title": "" }, { "docid": "9fbf615f836b93597ff30a6047856853", "score": "0.6002556", "text": "function render() {\n clearCanvas();\n drawWalls(); // walls\n drawPlayers(); // players\n drawShots(); // shots\n drawScore(); // score\n drawHearts(); // hearts\n manageCollisions(); // collisions\n}", "title": "" }, { "docid": "435cd74c14e4587d7381bf46e78076b0", "score": "0.5998426", "text": "function render(now) {\n now *= 0.001; // convert to seconds\n const deltaTime = now - then;\n then = now;\n // if(now%200>100 && boostcatch)\n // boostcatch = 0;\n // console.log(\"FLash\",flashScala);\n if(now%3>1)\n flashScala = true;\n else\n flashScala = false;\n document.getElementById(\"Score\").innerHTML = score;\n document.getElementById(\"Keys\").innerHTML = keys;\n\n gl.uniform1i(programInfo.uniformLocations.flashScala,flashScala);\n gl.uniform1i(programInfo.uniformLocations.grayScala,grayScala);\n drawScene(gl, programInfo, deltaTime);\n if(Math.abs(duck_hap-face.pos[2])>5 && duck==1)\n {\n duck =0 \n face.pos[1]+=2.5;\n leg1.pos[1]+=2.5;\n leg2.pos[1]+=2.5;\n center.pos[1]+=2.5;\n dog1.pos[1]+=0.5;\n dog2.pos[1]+=0.5;\n\n }\n if(face.speed1==0)\n with_train = 1;\n if(Math.abs(face.pos[2])>1000)\n stop = 1;\n // console.log(face.pos[2],stop);\n if(!stop && !with_train)\n {\n tick();\n detect();\n }\n\n\n requestAnimationFrame(render);\n }", "title": "" }, { "docid": "16fa89b244751d01353870afc97881d8", "score": "0.5998406", "text": "function render()\n{\n listenForKeyboard();\n checkPlayerWallCollision();\n\n ballPhysics.update();\n enemyAI.update();\n\n if(particles != null)\n {\n particles.update();\n }\n\n requestAnimationFrame(render);\n base.render();\n}", "title": "" }, { "docid": "13f46042ba0b2dc6ed75e57f5d1e3288", "score": "0.5997036", "text": "function render(){\n renderer.render( scene, camera );\n cssRenderer.render(cssScene,camera);\n }", "title": "" }, { "docid": "bb532d8c9414bbeccf4d2871d324f149", "score": "0.5988848", "text": "isRenderable() {\n return this.renderableOverride ?? (this.render || this.isRenderForced());\n }", "title": "" }, { "docid": "ecca0ae069f83639c6cf19a2523f204f", "score": "0.5984958", "text": "function draw() {\n background(0);\n\n computer.render();\n}", "title": "" }, { "docid": "82193f8dff7ba93137cf28c66d61776a", "score": "0.5982796", "text": "function render() {\n if (DEBUG) {\n lightHelper.update();\n shadowCameraHelper.update();\n }\n\n updateClockTime();\n\n renderer.render(scene, camera);\n requestAnimationFrame(render);\n}", "title": "" }, { "docid": "ade40c89664eab2ae77946e2dfb0a120", "score": "0.59793514", "text": "render(){\n\t\tthis.renderer.render(this.scene, this.camera)\t\n\t}", "title": "" }, { "docid": "bb15a5fa78cd8b2ff2f3fd19703abdb1", "score": "0.59789014", "text": "function render() {\n\n\tmixer.update( clock.getDelta() );\n\trenderer.render( scene, camera );\n}", "title": "" }, { "docid": "ad65a2cac3584ff4dfbb99dc93c9bac0", "score": "0.5978756", "text": "function renderEntities() {\n\n allEnemies.forEach(function(enemy) {\n enemy.render();\n });\n\n if(gamescore.score % 10 === 0 && gamescore.score > 0 ){\n jewel.render();\n }\n else{\n rock.render();\n }\n player.render();\n gamescore.render();\n life.render();\n\n if(life.numLives < 1){\n ctx.beginPath();\n ctx.fillStyle = \"#008080\";\n ctx.fillRect(0, 0, canvas.width, 600);\n ctx.fillStyle = \"#FF8C00\";\n ctx.font = '100px Cursive';\n ctx.textAlign = \"center\";\n ctx.fillText(\"Game Over\", canvas.width/2, 200);\n ctx.fillText(\"You Scored: \"+gamescore.score, canvas.width/2, 400);\n }\n }", "title": "" }, { "docid": "de91c41a032f49cde5928eed3c60a76c", "score": "0.5973493", "text": "function render() {\n //var delta = clock.getDelta();\n moverBola();\n tirarBola();\n\n\n //Para no tirar todos los bolos una vez superado los cuatro niveles\n if(todosNiveles == false){ \n contactoBolos(sphere);\n }\n //console.log('Tirar: '+tirar);\n //console.log('empezarTirar: '+empiezaTirar);\n //console.log('banderaTirar: '+banderaTirar);\n //console.log(todosNiveles==true && mostrarPuntuacion==false); \n\n // render using requestAnimationFrame\n renderer.render(scene, camera);\n requestAnimationFrame(render);\n\n }", "title": "" }, { "docid": "4a1d858fac0934e156bc2e8ba4ec418a", "score": "0.59720135", "text": "function draw() {\n if (start===false) {\n titleScreen();\n } else {\n play();\n }\n if (gameOver===true) {\n gameOverScreen();\n }\n}", "title": "" }, { "docid": "2c2ff895b5447551167c58134f9a4bf9", "score": "0.597121", "text": "function render() {\n renderBackground();\n renderMap();\n renderEntities();\n renderLives();\n renderBullets();\n }", "title": "" }, { "docid": "9c436497b15cc4ec44f765c0dfe9d4e0", "score": "0.5965919", "text": "function render(renderSettings) {\n\t\t\t\t\t\tvar image = null;\n\t\t\t\t\t\tvar mode = renderSettings.mode;\n\t\t\t\t\t\tvar el = renderSettings.el;\n\t\t\t\t\t\tvar holderSettings = renderSettings.holderSettings;\n\t\t\t\t\t\tvar engineSettings = renderSettings.engineSettings;\n\n\t\t\t\t\t\tswitch (engineSettings.renderer) {\n\t\t\t\t\t\t\tcase 'svg':\n\t\t\t\t\t\t\t\tif (!App.setup.supportsSVG) return;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'canvas':\n\t\t\t\t\t\t\t\tif (!App.setup.supportsCanvas) return;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//todo: move generation of scene up to flag generation to reduce extra object creation\n\t\t\t\t\t\tvar scene = {\n\t\t\t\t\t\t\twidth: holderSettings.dimensions.width,\n\t\t\t\t\t\t\theight: holderSettings.dimensions.height,\n\t\t\t\t\t\t\ttheme: holderSettings.theme,\n\t\t\t\t\t\t\tflags: holderSettings.flags\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tvar sceneGraph = buildSceneGraph(scene);\n\n\t\t\t\t\t\tfunction getRenderedImage() {\n\t\t\t\t\t\t\tvar image = null;\n\t\t\t\t\t\t\tswitch (engineSettings.renderer) {\n\t\t\t\t\t\t\t\tcase 'canvas':\n\t\t\t\t\t\t\t\t\timage = sgCanvasRenderer(sceneGraph, renderSettings);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'svg':\n\t\t\t\t\t\t\t\t\timage = svgRenderer(sceneGraph, renderSettings);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tthrow 'Holder: invalid renderer: ' + engineSettings.renderer;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn image;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\timage = getRenderedImage();\n\n\t\t\t\t\t\tif (image == null) {\n\t\t\t\t\t\t\tthrow 'Holder: couldn\\'t render placeholder';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//todo: add <object> canvas rendering\n\t\t\t\t\t\tif (mode == 'background') {\n\t\t\t\t\t\t\tel.style.backgroundImage = 'url(' + image + ')';\n\t\t\t\t\t\t\tel.style.backgroundSize = scene.width + 'px ' + scene.height + 'px';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (el.nodeName.toLowerCase() === 'img') {\n\t\t\t\t\t\t\t\tDOM.setAttr(el, {\n\t\t\t\t\t\t\t\t\t'src': image\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else if (el.nodeName.toLowerCase() === 'object') {\n\t\t\t\t\t\t\t\tDOM.setAttr(el, {\n\t\t\t\t\t\t\t\t\t'data': image,\n\t\t\t\t\t\t\t\t\t'type': 'image/svg+xml'\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (engineSettings.reRender) {\n\t\t\t\t\t\t\t\tglobal.setTimeout(function() {\n\t\t\t\t\t\t\t\t\tvar image = getRenderedImage();\n\t\t\t\t\t\t\t\t\tif (image == null) {\n\t\t\t\t\t\t\t\t\t\tthrow 'Holder: couldn\\'t render placeholder';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t//todo: refactor this code into a function\n\t\t\t\t\t\t\t\t\tif (el.nodeName.toLowerCase() === 'img') {\n\t\t\t\t\t\t\t\t\t\tDOM.setAttr(el, {\n\t\t\t\t\t\t\t\t\t\t\t'src': image\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t} else if (el.nodeName.toLowerCase() === 'object') {\n\t\t\t\t\t\t\t\t\t\tDOM.setAttr(el, {\n\t\t\t\t\t\t\t\t\t\t\t'data': image,\n\t\t\t\t\t\t\t\t\t\t\t'type': 'image/svg+xml'\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}, 150);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//todo: account for re-rendering\n\t\t\t\t\t\tDOM.setAttr(el, {\n\t\t\t\t\t\t\t'data-holder-rendered': true\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "title": "" }, { "docid": "151553fb26f4f45494ee23c773070743", "score": "0.5949938", "text": "function render(now) {\n if(c.pos[2] >= end_flags.pos[2])\n exit(0);\n now *= 0.001; // convert to seconds\n const deltaTime = now - then;\n then = now;\n if(rightPressed) {\n c.move_right();\n }\n else if(leftPressed) {\n c.move_left();\n }\n if(upPressed){\n c.move_up();\n }\n tick_elements();\n drawScene_texture(gl, programInfo,programInfo_c,programInfo_g,programInfo_f, deltaTime);\n requestAnimationFrame(render);\n }", "title": "" }, { "docid": "e5e4cc99096827d4bb9337c0c2b345e0", "score": "0.5945511", "text": "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n if (GLBL.paused !== true && GLBL.soundReady === true &&\n GLBL.inFocus === true) {\n\n //if we just unpaused or gained focus, reset our dt and hide\n //instructions\n if (GLBL.waspaused === true || GLBL.lostFocus === true) {\n lastTime = _.now();\n GLBL.waspaused = false;\n GLBL.lostFocus = false;\n toggleInstructions(false);\n }\n var now = _.now();\n dt = (_.now() - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render(dt);\n\n /* Set our lastTime variable which is used to determine the time\n * delta for the next time this function is called.\n */\n lastTime = _.now();\n\n }\n else if (GLBL.waspaused !== true && GLBL.paused === true){\n //set our waspaused so that when we unpause we know it happened\n //also go ahead and tell our pause button to look different\n //show instructions while we are at it\n GLBL.waspaused = true;\n renderUI(true);\n if (GLBL.playerDied !== true) {\n toggleInstructions(true);\n }\n //player died so draw some red and show a different modal\n else {\n var death_gradient = ctx.createLinearGradient(\n 0, 0, 0, canvas.height);\n death_gradient.addColorStop(0, \"red\");\n death_gradient.addColorStop(1, \"transparent\");\n ctx.fillStyle = death_gradient;\n ctx.fillRect(0,0,canvas.width,canvas.height);\n //draw ui one last time this game so player can see score\n renderUI(false, true)\n //turn on death isntruction modal\n toggleInstructions(true, true);\n //let the game know the player isn't dead and reset the game\n GLBL.playerDied = false;\n reset();\n }\n }\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "title": "" }, { "docid": "c644fbef750a2d9cb7069f55f093e0c9", "score": "0.59422255", "text": "function render()\n{\n\tif (client.makeSetButtonIsEnabled)\n\t{\n\t\trenderWindow.draw(client.makeSetButton);\n\t}\n\n\t//Draw the top card on the discard pile.\n\tif (client.discard[client.discard.length - 1] != null)\n\t{\n\t\trenderWindow.draw(client.discard[client.discard.length - 1].sprite);\n\t\trenderWindow.draw(client.discard[client.discard.length - 1].grabBtn);\n\t}\n\n\t//Draw this client's hand.\n\tfor (var i = 0; i < client.hand.length; i++)\n\t{\n\t\trenderWindow.draw(client.hand[i].sprite);\n\t\trenderWindow.draw(client.hand[i].discardBtn);\n\t\trenderWindow.draw(client.hand[i].grabBtn);\n\t}\n\n\tfor (var i = 0; i < client.currentSet.length; i++)\n\t{\n\t\trenderWindow.draw(client.currentSet[i].sprite);\n\t\tclient.currentSet[i].setPosition(10 + (i * (renderWindow.width * 0.0337837837837)), renderWindow.height * 0.4);\n\t}\n\n\t//Draw all of the card backs in the game.\n\tfor (var i = 0; i < cardBacks.length; i++)\n\t{\n\t\tif (cardBacks[i] != null)\n\t\t{\n\t\t\trenderWindow.draw(cardBacks[i]);\n\t\t}\n\t}\n\n\trenderWindow.draw(takeFromStockBtn);\n}", "title": "" }, { "docid": "f32974e0d0085cc344f5432ed00d2fb4", "score": "0.5941247", "text": "function render(now) {\n now *= 0.001; // convert to seconds\n bright_count+=1;\n const deltaTime = now - then;\n then = now;\n drawScene(gl, programInfo,programInfoTexture, deltaTime);\n tick();\n if(!end_of_game && !won)\n {\n requestAnimationFrame(render);\n }\n else\n {\n document.getElementById('starting').style.visibility=\"visible\";\n document.getElementById('glcanvas').style.visibility = \"hidden\";\n document.getElementById('score').innerHTML=\"\";\n document.getElementById('score_table').setAttribute(\"border\", \"0\");\n if(won)\n {\n a=\"<h1 style='color:red;'>Congratulations on winning</h1><br><center>Number of coins collected: \"+number_of_coins+\"</ceter>\";\n }\n else\n {\n a=\"<h1 style='color:red;'>Game Over</h1><br><center>Number of coins collected: \"+number_of_coins+\"</ceter>\";\n }\n document.getElementById('starting_inside').innerHTML=a;\n\n }\n }", "title": "" }, { "docid": "33cf9befa9ff5992dcb5dd1fb5bf4b33", "score": "0.59388846", "text": "function drawScene() {\r\n\tvar ctx = app.ctx;\r\n\r\n\tctx.save();\t//\tsave before screen shake or any other rendering\r\n\r\n\t//Draw background\r\n\tctx.drawImage(app.backGroundImage, 0, 0, app.width, app.height);\r\n\r\n\t//Screen shake\r\n\tif (app.hitScreenShakeTimer > 0) {\r\n\t\tctx.translate(Math.random() * 20 - 5, Math.random() * 20 - 5);\r\n\t}\r\n\r\n\t//Draw the egg first so it shows behind everything else\r\n\tctx.save();\r\n\t\tctx.translate(app.width - 100, app.height - 40);\r\n\t\tctx.drawImage(app.showEmptyNest ? app.eggInNest : app.emptyNest, -60, -50, 120, 100);\r\n\tctx.restore();\r\n\r\n\tif (app.collisionMessageTimer > 0 && app.state !== \"finished\") {\r\n\t\tctx.font = \"italic 20px Courier\";\r\n\t\tctx.textAlign = \"center\";\r\n\t\tif(app.collisionMessage.good) {\r\n\t\t\tctx.fillStyle = \"#adff2f\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tctx.fillStyle = \"#ff0000\";\r\n\t\t}\r\n\r\n\t\tctx.fillText(app.collisionMessage.message, app.width/2, 65);\r\n\t}\r\n\r\n\t//Draw objects\r\n\tfor (var i = 0; i < app.objects.length; i++) {\r\n\t\tvar o = app.objects[i];\r\n\r\n\t\t//Don't draw horton outside of normal play state\r\n\t\tif (o.type === 'horton' && app.state !== 'play')\r\n\t\t\tcontinue;\r\n\r\n\t\t//Draw object image, centered/rotated around its pos\r\n\t\tctx.save();\r\n\t\t\tctx.translate(o.pos.x, o.pos.y);\r\n\t\t\tctx.rotate(o.angle);\r\n\t\t\tctx.drawImage(o.image, -o.xSize/2, -o.ySize/2, o.xSize, o.ySize);\r\n\t\tctx.restore();\r\n\t}\r\n\r\n\t//Done with all game world drawing - restore old ctx state\r\n\tctx.restore();\r\n\r\n\t//Show score, depending on game state\r\n\tif(app.state === 'pre-play') {\r\n\t\t//Draw a big happy elephant\r\n\t\tctx.save();\r\n\t\t\tctx.translate(app.width/7, app.height - 120);\r\n\t\t\tctx.drawImage(app.horton.image, -120, -120, 240, 240);\r\n\t\tctx.restore();\r\n\r\n\t\tif(!app.showHelpWindow) {\r\n\t\t\tif(app.showStartHighScores) {\r\n\t\t\t\troundRect(ctx, app.width *.28, 65, app.width *.44, app.height *.55, 10, true, true);\r\n\t\t\t\tdrawButton(app.startHighScoreResumeBtnWidth, app.startHighScoreResumeBtnHeight, \"Back\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//Draw a thought bubble\r\n\t\t\t\tctx.save();\r\n\t\t\t\t\tctx.translate(app.width * .53, app.height * .3);\r\n\t\t\t\t\tctx.drawImage(app.thoughtBubble, -500, -270, 900, 540);\r\n\t\t\t\tctx.restore();\r\n\r\n\t\t\t\tdrawButton(app.startButtonMaxWidth, app.startButtonHeight, \"Start!\", app.height * .68);\r\n\t\t\t\tdrawButton(app.startHighScoreBtnWidth, app.startHighScoreBtnHeight, \"See High Scores\", app.height *.8);\r\n\r\n\t\t\t\tctx.font = \"22px Courier\";\r\n\t\t\t\tctx.textAlign = \"center\";\r\n\t\t\t\tctx.fillStyle = \"#000080\";\r\n\t\t\t\tctx.fillText(\"Horton is hatching an egg! Help him catch all\", app.width/2, app.height/7 + 35);\r\n\t\t\t\tctx.fillText(\"of the happy things so that he can prepare his\", app.width/2, app.height/7 + 70);\r\n\t\t\t\tctx.fillText(\"nest before the elephant-bird hatches.\", app.width/2, app.height/7 + 105);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse if (app.state === 'play') {\r\n\t\tctx.font = \"italic 25px Courier\";\r\n\t\tctx.textAlign = \"center\";\r\n\t\tctx.fillStyle = \"#FFFF00\";\r\n\r\n\t\tif(app.score < 0) {\r\n\t\t\tctx.fillStyle = \"#ff0000\";\r\n\t\t}\r\n\t\tctx.fillText(\"Score \" + app.score, app.width/2, 40);\r\n\r\n\t\tctx.fillStyle = \"#000080\";\r\n\t\tctx.textAlign = \"right\";\r\n\t\tctx.fillText(app.pregnancyCounter.weeks + \" \" + (app.pregnancyCounter.weeks == 1 ? \"week\" : \"weeks\")\r\n\t\t+ \" and \" + app.pregnancyCounter.days + \" \" + (app.pregnancyCounter.days == 1 ? \"day\" : \"days\"), app.width - 15, 40);\r\n\t}\r\n\telse if(app.state === \"finished\") {\r\n\t\tctx.font = \"italic 25px Courier\";\r\n\t\tctx.textAlign = \"center\";\r\n\t\tctx.fillStyle = \"#FFFF00\";\r\n\r\n\t\tif(app.score < 0) {\r\n\t\t\tctx.fillStyle = \"#ff0000\";\r\n\t\t}\r\n\t\tctx.fillText(\"Final Score \" + app.score, app.width/2, 40);\r\n\r\n\t\tctx.fillStyle = \"#000080\";\r\n\t\tctx.textAlign = \"right\";\r\n\t\tctx.fillText(\"40 weeks!\", app.width - 15, 40);\r\n\r\n\t\t//Draw a big happy elephant\r\n\t\tctx.save();\r\n\t\t\tctx.translate(app.width/7, app.height - 120);\r\n\t\t\tctx.drawImage(app.horton.image, -120, -120, 240, 240);\r\n\t\tctx.restore();\r\n\r\n\t\t//Because this will show across multiple phase timers, it just has its own boolean\r\n\t\tif(app.endingSettings.showBrokenEgg) {\r\n\t\t\tctx.save();\r\n\t\t\t\tctx.translate(app.width - 100, app.height - 65);\r\n\t\t\t\tctx.drawImage(app.emptyHatchedEgg, -45, -37.5, 90, 75);\r\n\t\t\tctx.restore();\r\n\t\t}\r\n\r\n\t\t//This can also span multiple phase timers\r\n\t\tif(app.endingSettings.elephantBirdSettings.show) {\r\n\t\t\tctx.save();\r\n\t\t\t\tctx.translate(app.endingSettings.elephantBirdSettings.finalXPosition, app.endingSettings.elephantBirdSettings.finalYPosition);\r\n\t\t\t\tctx.drawImage(app.elephantBird, -app.endingSettings.elephantBirdSettings.size/2, -app.endingSettings.elephantBirdSettings.size/2, app.endingSettings.elephantBirdSettings.size, app.endingSettings.elephantBirdSettings.size);\r\n\t\t\tctx.restore();\r\n\t\t}\r\n\r\n\t\t//This next section is to decide which phase we are in and to show the content specific to that phase\r\n\t\tif(app.endingSettings.phaseThreeTimer > 0) {\r\n\t\t\t//Draw a thought bubble\r\n\t\t\tctx.save();\r\n\t\t\t\tctx.translate(app.width *.53, app.height *.3);\r\n\t\t\t\tctx.drawImage(app.thoughtBubble, -500, -270, 900, 540);\r\n\t\t\tctx.restore();\r\n\r\n\t\t\tctx.font = \"26px Courier\";\r\n\t\t\tctx.textAlign = \"center\";\r\n\t\t\tctx.fillStyle = \"#000080\";\r\n\t\t\tctx.fillText(\"I think it's hatching!\", app.width/2, app.height/7 + 70);\r\n\t\t}\r\n\t\t//Show the elephant bird sitting in its hatched egg\r\n\t\telse if(app.endingSettings.phaseFiveTimer > 0) {\r\n\t\t\tctx.save();\r\n\t\t\t\tctx.translate(app.width - 100, app.height - 65);\r\n\t\t\t\tctx.drawImage(app.lilHortonInEgg, -45, -37.5, 90, 75);\r\n\t\t\tctx.restore();\r\n\t\t}\r\n\t\t//Fly up with the elephant bird\r\n\t\telse if(app.endingSettings.phaseSixTimer > 0) {\r\n\t\t\tvar weight = app.endingSettings.phaseSixTimer/app.endingSettings.phaseSixLimit;\r\n\t\t\tvar risingYPosition = app.height - app.endingSettings.elephantBirdSettings.risingWeight - 65;\r\n\t\t\tvar yPosition = risingYPosition <= app.endingSettings.elephantBirdSettings.finalYPosition ? app.endingSettings.elephantBirdSettings.finalYPosition : risingYPosition;\r\n\t\t\tctx.save();\r\n\t\t\t\tctx.translate(app.endingSettings.elephantBirdSettings.finalXPosition, yPosition);\r\n\t\t\t\tctx.drawImage(app.elephantBird, -(app.endingSettings.elephantBirdSettings.size/2)*weight, -(app.endingSettings.elephantBirdSettings.size/2)*weight, app.endingSettings.elephantBirdSettings.size*weight, app.endingSettings.elephantBirdSettings.size*weight);\r\n\t\t\tctx.restore();\r\n\t\t}\r\n\t\telse if(app.endingSettings.phaseEightTimer > 0) {\r\n\t\t\tif(!app.endingSettings.showLeaderboard) {\r\n\t\t\t\t//Draw a thought bubble\r\n\t\t\t\tctx.save();\r\n\t\t\t\t\tctx.translate(app.width * .53, app.height * .3);\r\n\t\t\t\t\tctx.drawImage(app.thoughtBubble, -500, -270, 900, 540);\r\n\t\t\t\tctx.restore();\r\n\r\n\t\t\t\tctx.font = \"26px Courier\";\r\n\t\t\t\tctx.textAlign = \"center\";\r\n\t\t\t\tctx.fillStyle = \"#000080\";\r\n\t\t\t\tctx.fillText(\"Baby Horton coming November 2015!\", app.width / 2, app.height / 7 + 70);\r\n\r\n\t\t\t\tdrawButton(app.endingSettings.nextButton.maxWidth, app.endingSettings.nextButton.height, \"Next\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\t//Show the high score box\r\n\t\t\t\troundRect(ctx, app.width *.28, 65, app.width *.44, app.height *.55, 10, true, true);\r\n\r\n\t\t\t\t//Show either the \"Submit\" button for the high scores or the \"Play Again\" button if they didn't make or already submitted\r\n\t\t\t\tif(app.endingSettings.showSubmitButton) {\r\n\t\t\t\t\tdrawButton(app.endingSettings.submitScoreButton.maxWidth, app.endingSettings.submitScoreButton.height, \"Submit\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tdrawButton(app.endingSettings.playAgainButton.maxWidth, app.endingSettings.playAgainButton.height, \"Play again?\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//These are all things that should be on top of everything else\r\n\t//==============================================================\r\n\tctx.save();\r\n\r\n\t\t//Draw speaker\r\n\t\tvar speakerImage;\r\n\t\tif(app.speakerSettings.on) {\r\n\t\t\tspeakerImage = app.speakerOn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tspeakerImage = app.speakerOff;\r\n\t\t}\r\n\t\tctx.drawImage(speakerImage, app.speakerSettings.xPos, app.speakerSettings.yPos, app.speakerSettings.xSize, app.speakerSettings.ySize);\r\n\r\n\t\t//Draw the help button\r\n\t\tif(app.showHelpButton) {\r\n\t\t\tctx.drawImage(app.helpButtonImage, app.helpButtonSettings.xPos, app.helpButtonSettings.yPos, app.helpButtonSettings.xSize, app.helpButtonSettings.ySize);\r\n\t\t}\r\n\r\n\t\t//Show the Help Window\r\n\t\tif(app.showHelpWindow || app.showMandatoryHelpWindow) {\r\n\r\n\t\t\tvar helpPopupSettings = {\r\n\t\t\t\t\txPos : app.width *.1,\r\n\t\t\t\t\tyPos : 10,\r\n\t\t\t\t\txSize : app.width *.78,\r\n\t\t\t\t\tySize : app.height *.85\r\n\t\t\t};\r\n\r\n\t\t\troundRect(ctx, helpPopupSettings.xPos, helpPopupSettings.yPos, helpPopupSettings.xSize, helpPopupSettings.ySize, 10, true, true);\r\n\t\t\tctx.drawImage(app.helpPopup, helpPopupSettings.xPos, helpPopupSettings.yPos, helpPopupSettings.xSize, helpPopupSettings.ySize);\r\n\r\n\t\t\tif(app.showMandatoryHelpWindow) {\r\n\t\t\t\tdrawButton(app.playButtonMaxWidth, app.playButtonHeight, \"Play!\", app.height *.94);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdrawButton(app.resumeButtonMaxWidth, app.resumeButtonHeight, \"Resume\", app.height *.94);\r\n\t\t\t}\r\n\t\t}\r\n\tctx.restore();\r\n}", "title": "" }, { "docid": "a973c179376ad42da07eea18b4469d98", "score": "0.5936484", "text": "start() {\n if(!this.rendering) {\n console.log(\"Starting game...\");\n\n this.graphics.initialize((ck) => {\n this.canvasKit = ck;\n if(!this.loaded && this.assetPaths.length > 0) {\n console.log(\"Loading assets...\");\n this._load();\n } else this.loaded = true;\n this._render();\n });\n this.rendering = true;\n console.log(\"Game started\");\n } else console.warn(\"Game was already started\")\n }", "title": "" }, { "docid": "f529800d1d82106caa75ebddf6289eeb", "score": "0.59319645", "text": "renderplat(ctx) {\n for (const platform of this.levels[this.currentLevel].platforms) {\n platform.render(ctx);\n }\n }", "title": "" }, { "docid": "4fdbacc228b8210f4aba46f02b768b40", "score": "0.5904685", "text": "function stepGameOfLife()\n{\n // FIRST PERFORM GAME LOGIC\n updateGame();\n\n // RENDER THE GAME\n renderGame();\n}", "title": "" }, { "docid": "cda807a3de7d372e929abc91b8cc396a", "score": "0.5898234", "text": "function drawUI(){\n\t\t\t\tif (loading == true){\n\t\t\t\t\tctx.save();\n\t\t\t\t\tctx.fontStyle = \"black\";\n\t\t\t\t\tctx.textAlign = \"center\";\n\t\t\t\t\tctx.font = \"50px TEXWORK\";\n\t\t\t\t\tctx.fillText(\"LOADING...\", CANVAS_WIDTH/2, CANVAS_HEIGHT/2);\n\t\t\t\t}\n\t\t\t\t// if the game is on the title screen draw this\n\t\t\t\telse if (gameState == \"title\"){\n\t\t\t\t\t// save current draw settings\n\t\t\t\t\tctx.save();\n\t\t\t\t\tctx.fillStyle = \"white\";\n\n\t\t\t\t\t// actually draw the text\n\t\t\t\t\tctx.drawImage(images[\"title\"], 20, 0, 600, 300);\n\n\t\t\t\t\t// draw the blue orb\n\t\t\t\t\t// img, subx, suby, subWidth, subHeight, dx, dy, dHeigh, dWidth\n\t\t\t\t\tctx.drawImage(images[\"orb\"], 0, 0, 30, 30, 220, 320, 30, 30);\n\t\t\t\t\tctx.font = \"20px TEXWORK\";\n\t\t\t\t\tctx.fillText(\"+5 sec\", 260, 340);\n\n\t\t\t\t\t\n\t\t\t\t\t// img, subx, suby, subWidth, subHeight, dx, dy, dHeigh, dWidth\n\t\t\t\t\tctx.drawImage(images[\"redOrb\"], 0, 0, 30, 30, 370, 320, 30, 30);\n\t\t\t\t\tctx.font = \"20px TEXWORK\";\n\t\t\t\t\tctx.fillText(\"-3 sec\", 410, 340 );\n\n\t\t\t\t\t// draw the blue gem\n\t\t\t\t\t// img, subx, suby, subWidth, subHeight, dx, dy, dWidth, dHeight\n\t\t\t\t\tctx.drawImage(images[\"blue\"], 0, 0, 30, 30, 170, 360, 30, 30);\n\t\t\t\t\tctx.font = \"20px TEXWORK\";\n\t\t\t\t\tctx.fillText(\"+2 sec\", 220, 380);\n\t\t\t\t\tctx.fillText(\"50 pts\", 220, 400);\n\n\t\t\t\t\t// draw the green gem\n\t\t\t\t\t// img, subx, suby, subWidth, subHeight, dx, dy, dWidth, dHeight\n\t\t\t\t\tctx.drawImage(images[\"green\"], 0, 0, 30, 30, 320, 360, 30, 30);\n\t\t\t\t\tctx.font = \"20px TEXWORK\";\n\t\t\t\t\tctx.fillText(\"100 pts\", 365, 380 );\n\n\t\t\t\t\t// draw the pink gem\n\t\t\t\t\t// img, subx, suby, subWidth, subHeight, dx, dy, dWidth, dHeight\n\t\t\t\t\tctx.drawImage(images[\"pink\"], 0, 0, 21, 29, 470, 360, 21, 29);\n\t\t\t\t\tctx.font = \"20px TEXWORK\";\n\t\t\t\t\tctx.fillText(\"Invincibility\", 500, 380 );\n\n\t\t\t\t\t// draw the ship\n\t\t\t\t\t// img, subx, suby, subWidth, subHeight, dx, dy, dWidth, dHeight\n\t\t\t\t\tctx.drawImage(images[\"ship\"], 100, 0, 50, 40, 80, 335, 50, 40);\n\n\t\t\t\t\t// Set the font\n\t\t\t\t\tctx.font = \"20px TEXWORK\";\n\t\t\t\t\tctx.fillText(\"Instructions:\", 50, CANVAS_HEIGHT/2);\n\n\t\t\t\t\tctx.font = \"15px TEXWORK\";\n\t\t\t\t\tctx.fillText(\"Up or W speed up, Down or S slow down\", 50, CANVAS_HEIGHT/2 + 15);\n\t\t\t\t\tctx.fillText(\"Left or A turns left, Right or D turns right\", 50, CANVAS_HEIGHT/2 + 30);\n\t\t\t\t\tctx.fillText(\"M to Mute, P to Pause\", 50, CANVAS_HEIGHT/2 + 45);\n\t\t\t\t\t\n\n\t\t\t\t\tctx.font = \"18px TEXWORK\";\n\t\t\t\t\tctx.fillText(\"Press SPACE to start\", CANVAS_WIDTH/2 - 100, CANVAS_HEIGHT - 70);\n\n\t\t\t\t\tctx.font = \"14px TEXWORK\";\n\t\t\t\t\tctx.fillText(\"Code by Bobby Pruden\", 10, CANVAS_HEIGHT - 30);\n\t\t\t\t\tctx.fillText(\"Art by Tiffany McFarlane\", 10, CANVAS_HEIGHT - 10);\n\t\t\t\t\tctx.font = \"16px TEXWORK\";\n\t\t\t\t\tctx.fillText(\"Music by Demigod q\", CANVAS_WIDTH/2 + 110, CANVAS_HEIGHT - 10);\n\n\t\t\t\t\t//restore the draw settings\n\t\t\t\t\tctx.restore();\n\t\t\t\t}\n\n\t\t\t\t// if the game is currently \"play\"ing draw this\n\t\t\t\telse if (gameState == \"play\"){\n\t\t\t\t\t// save current draw settings\n\t\t\t\t\tctx.save();\n\t\t\t\t\t// set the font\n\t\t\t\t\tctx.font = \"20px TEXWORK\";\n\t\t\t\t\tctx.fillStyle = \"white\";\n\n\t\t\t\t\t// actually draw the text\n\t\t\t\t\tctx.fillText(\"Score: \" + score, 170, 30);\n\t\t\t\t\tctx.fillText(\"Time: \" + timer.toFixed(2), 30, 30);\n\t\t\t\t\t//ctx.fillText(\"Elapsed Time: \" + Math.ceil(elapsed_time), 300, 30);\n\n\n\t\t\t\t\t//restore the draw settings\n\t\t\t\t\tctx.restore();\n\t\t\t\t} \n\n\t\t\t\t// if you are on the endScreen screen draw this\n\t\t\t\telse if (gameState == \"endScreen\") {\n\t\t\t\t\t// save current draw settings\n\t\t\t\t\tctx.save();\n\t\t\t\t\t// set the font\n\t\t\t\t\tctx.textAlign = \"center\";\n\t\t\t\t\tctx.font = \"50px TEXWORK\";\n\t\t\t\t\tctx.fillStyle = \"white\";\n\n\t\t\t\t\t// ctx.save();\n\t\t\t\t\t// ctx.strokeStyle = \"white\";\n\t\t\t\t\t// ctx.beginPath();\n\t\t\t\t\t// ctx.moveTo(CANVAS_WIDTH/2,0);\n\t\t\t\t\t// ctx.lineTo(CANVAS_WIDTH/2, CANVAS_HEIGHT);\n\t\t\t\t\t// ctx.stroke();\n\t\t\t\t\t// ctx.restore();\n\n\t\t\t\t\t// actually draw the text\n\t\t\t\t\tctx.fillText(\"Time is Up!\", (CANVAS_WIDTH/2), 200);\n\t\t\t\t\tctx.fillText(\"Score: \" + score, (CANVAS_WIDTH/2), 250);\n\n\t\t\t\t\tctx.font = \"20px TEXWORK\";\n\t\t\t\t\tctx.fillText(\"Press SPACE to return to menu\", (CANVAS_WIDTH/2), CANVAS_HEIGHT - 100);\n\n\t\t\t\t\t//restore the draw settings\n\t\t\t\t\tctx.restore();\n\t\t\t\t}\n\n\t\t\t\t// if paused draw this \n\t\t\t\telse if (gameState == \"pause\") {\n\n\t\t\t\t\t// save current draw settings\n\t\t\t\t\tctx.save();\n\t\t\t\t\t\n\t\t\t\t\t// set the font\n\t\t\t\t\tctx.font = \"20px TEXWORK\";\n\t\t\t\t\tctx.fillStyle = \"white\";\n\n\t\t\t\t\t// actually draw the text\n\t\t\t\t\tctx.fillText(\"Score: \" + score, 170, 30);\n\t\t\t\t\tctx.fillText(\"Time: \" + Math.ceil(timer), 30, 30);\n\n\t\t\t\t\tctx.save();\n\t\t\t\t\tctx.globalAlpha = 0.2;\n\t\t\t\t\tctx.fillRect(0,0,CANVAS_WIDTH, CANVAS_HEIGHT,1);\n\t\t\t\t\tctx.restore();\n\n\t\t\t\t\tctx.textAlign = \"center\";\n\t\t\t\t\t// set the font\n\t\t\t\t\tctx.font = \"50px TEXWORK\";\n\t\t\t\t\tctx.fillStyle = \"white\";\n\n\t\t\t\t\t// actually draw the text\n\t\t\t\t\tctx.fillText(\">> PAUSE <<\", CANVAS_WIDTH/2, CANVAS_HEIGHT/2);\n\n\t\t\t\t\tctx.font = \"20px TEXWORK\"\n\t\t\t\t\tctx.fillText(\"Press P to resume\", CANVAS_WIDTH/2, CANVAS_HEIGHT - 100);\n\n\t\t\t\t\t//restore the draw settings\n\t\t\t\t\tctx.restore();\n\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "e497c5f46535ead6386a518863404879", "score": "0.5897933", "text": "function drawGame() {\n themeSong.stop();\n stars();\n\n if(boss==true) bossFight();\n else waveHandler();\n player();\n shotHandler();\n enemyShotHandler();\n bossShotHandler();\n explosionHandler();\n playerHitHandler();\n\n diverHandler();\n enemyHandler();\n powerupHandler();\n\n playing = true;\n\n drawSprites();\n gameStats();\n\n if(lives<=0) currentScene=4;\n}", "title": "" }, { "docid": "417184d319324e50f962c9424bf2fea1", "score": "0.58955187", "text": "render() {\n ctx.fillStyle = 'rgba(0,0,0,0.5)';\n\t\tctx.fillRect(0,50, 707, 45);\n\t\tthis.level();\n\t\tthis.score();\n\t\tthis.lives();\n\t\tthis.gems();\n }", "title": "" }, { "docid": "a3fb991a4fc5c45cde4ae227a777a81c", "score": "0.5894235", "text": "function render(){\n\t// Here we control how the camera looks around the scene.\n\tcontrols.activeLook = false;\n\tif(mouseOverCanvas){\n\t\tif(mouseDown){\n\t\t\tcontrols.activeLook = true;\n\t\t}\n\t}\n\n\t// Get the time since this method was called.\n\tvar deltaTime = clock.getDelta();\n\n\t// Update the controls.\n\tcontrols.update( deltaTime );\n\n\t// Render the scene.\n\trenderer.render(scene, camera);\n\n\t// Update the stats.\n\tstats.update();\n\n\t// Request the next frame.\n\t/* The \"requestAnimationFrame()\" method tells the browser that you \n\t wish to perform an animation and requests that the browser call a specified \n\t function to update an animation before the next repaint. The method takes \n\t as an argument a callback to be invoked before the repaint. */\n requestAnimationFrame(render);\n}", "title": "" }, { "docid": "8d80253a339268cb0870f8789dcc8478", "score": "0.58933836", "text": "function render()\n{\n\t// Iterate through all cycles and animate them\n\tfor(var i = 0; i < cycles.length; i++)\n\t{\n\t\tif(cycles[i].isActive == true)\n\t\t{\n\t\t\t// cycle.draw returns false when a player collides with something\n\t\t\tif(!cycles[i].draw())\n\t\t\t{\n\t\t\t\tcycles[i].isActive = false;\n\t\t\t\tplayersActive--;\n\n\t\t\t\tif(playersActive < 2)\n\t\t\t\t{\n\t\t\t\t\tfor(var j = 0; j < cycles.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cycles[j].isActive == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tviewMessage(\"Player \" + (cycles[j].idNum + 1) + \" is the winner!\", 5000);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcycles[j].reset();\n\t\t\t\t\t}\n\n\t\t\t\t\tgameReset();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Limit to frameRate(found in global.js) for efficiency\n\tif(isActive == true)\n\t{\n\t\tsetTimeout( function()\n\t\t{\n\t\t\trequestAnimationFrame(render);\n\t\t}, frameRate);\n\t}\n}", "title": "" }, { "docid": "d31271bee3700261d897a124ff8d3f92", "score": "0.5889562", "text": "function render(now) {\n stats.begin();\n now *= 0.001; // convert to seconds\n const deltaTime = now - then;\n then = now;\n\n state.deltaTime = deltaTime;\n\n //wait until the scene is completely loaded to render it\n if (state.numberOfObjectsToLoad <= state.objects.length) {\n if (!state.gameStarted) {\n startGame(state);\n state.gameStarted = true;\n }\n\n if (state.keyboard[\"w\"]) {\n //moveForward(state);\n }\n if (state.keyboard[\"s\"]) {\n //moveBackward(state);\n }\n if (state.keyboard[\"a\"]) {\n //moveLeft(state);\n }\n if (state.keyboard[\"d\"]) {\n //moveRight(state);\n //vec3.rotateY(state.camera.position, state.camera.position, vec3.fromValues(0,0,0), 90 * (Math.PI/180));\n }\n\n //correct camera\n let tmp = returnMat4Logically(state.gravityMatrix);\n\n if (state.animationState === animation.ROTATING)\n {\n state.camera.targetPosition = vec3.fromValues(tmp.z[0], tmp.z[1], tmp.z[2]);\n vec3.scale(state.camera.targetPosition, state.camera.targetPosition, -9);\n }\n else\n {\n state.camera.up = vec3.fromValues(-tmp.y[0], -tmp.y[1], -tmp.y[2]);\n state.camera.position = vec3.fromValues(tmp.z[0], tmp.z[1], tmp.z[2]);\n vec3.scale(state.camera.position, state.camera.position, -9);\n }\n \n\n state.lightIndices.forEach(object => {\n object.model.position = state.camera.position;\n })\n\n if (state.mouse['camMove']) {\n //vec3.rotateY(state.camera.center, state.camera.center, state.camera.position, (state.camera.yaw - 0.25) * deltaTime * state.mouse.sensitivity);\n //vec3.rotateY(state.camera.center, state.camera.center, state.camera.position, (-state.mouse.rateX * deltaTime * state.mouse.sensitivity));\n if (tmp.y[0] != 0)\n {\n //console.log(\"a\")\n //need to change to better account for the matrix \n vec3.rotateY(state.freeCamera.position, state.freeCamera.position, vec3.fromValues(0,0,0), (tmp.y[0] * state.mouse.rateY * deltaTime * state.mouse.sensitivity))\n vec3.rotateX(state.freeCamera.position, state.freeCamera.position, vec3.fromValues(0,0,0), (tmp.y[0] * state.mouse.rateX * deltaTime * state.mouse.sensitivity));\n }\n else if (tmp.y[1] != 0)\n {\n //console.log(\"b\")\n vec3.rotateX(state.freeCamera.position, state.freeCamera.position, vec3.fromValues(0,0,0), (-tmp.y[1] * state.mouse.rateY * deltaTime * state.mouse.sensitivity))\n vec3.rotateY(state.freeCamera.position, state.freeCamera.position, vec3.fromValues(0,0,0), (tmp.y[1] * state.mouse.rateX * deltaTime * state.mouse.sensitivity));\n }\n else if (tmp.y[2] != 0)\n {\n //console.log(\"c\")\n\n vec3.rotateY(state.freeCamera.position, state.freeCamera.position, vec3.fromValues(0,0,0), (-tmp.y[2] * state.mouse.rateY * deltaTime * state.mouse.sensitivity))\n vec3.rotateZ(state.freeCamera.position, state.freeCamera.position, vec3.fromValues(0,0,0), (-tmp.y[2] * state.mouse.rateX * deltaTime * state.mouse.sensitivity));\n }\n // let forward = vec3.create();\n // vec3.sub(forward, vec3.fromValues(0,0,0), state.freeCamera.position);\n // vec3.normalize(forward, forward);\n\n state.freeCamera.use = true;\n sortedObjects = null;\n doOnce = true; // for handling transparency one last time after spinning freecam to opposite side\n }\n else {\n if (doOnce)\n {\n \n sortedObjects = null; \n //doOnce = false;\n }\n state.freeCamera.use = false;\n //console.log(\"here\");\n state.freeCamera.position = state.camera.position.slice();\n state.freeCamera.up = state.camera.up.slice();\n \n }\n\n //UGHHHH\n if (state.playerObject != null)\n {\n \n //move only if we're not locked in \"animation\"\n if (state.animationState === null)\n {\n let grav = returnMat4Logically(state.gravityMatrix);\n //player is always offset by half of the cube size (origin at 0, 0, 0; \"cube origin/middle\" at size/2, size/2, size/2)\n nextCubeIndex = cubeIndex(parseInt(state.targetGridPosition[0] + size/2 + grav.y[0]), parseInt(state.targetGridPosition[1] + size/2 + grav.y[1]), parseInt(state.targetGridPosition[2] + size/2 + grav.y[2]));\n let nextCube = state.cubes[nextCubeIndex]\n if (nextCube != undefined && nextCube.material.alpha >= 0.8)\n {\n \n }\n else\n {\n if (nextCube != null && nextCubeIndex != undefined)\n {\n //calculate next location to transition to\n state.nextPlayerPosition = nextCube.model.position.slice();\n let playerOffset = vec3.fromValues(0.5, 0.5, 0.5);\n vec3.add(state.nextPlayerPosition, nextCube.model.position, playerOffset);\n\n state.animationState = animation.DROPPING;\n previousDistance = 50\n distance = 40;\n if (nextCube.material.ambient[0] > 0.5)\n {\n win = true;\n }\n //CRUNCH TIME WOOOOOO\n }\n }\n }\n else if (state.animationState === animation.ROTATING)\n { // player keypress activates this animation state first\n let grav = returnMat4Logically(state.gravityMatrix);\n previousDistance = distance;\n distance = vec3.distance(state.camera.position, state.camera.targetPosition)\n if (distance > 0.8)\n {\n let delta = vec3.create();\n let direction = vec3.create();\n vec3.sub(direction, state.camera.targetPosition, state.camera.position);\n vec3.scale(delta, direction, deltaTime * 4);\n vec3.add(state.camera.position, state.camera.position, delta);\n sortedObjects = null;\n }\n else\n {\n state.animationState = null;\n }\n \n }\n else if (state.animationState === animation.DROPPING)\n {\n \n previousDistance = distance;\n distance = vec3.distance(state.playerObject.model.position, state.nextPlayerPosition)\n //player moving down still\n if (distance < previousDistance)\n {\n mat4.rotateY(state.playerObject.model.rotation, state.playerObject.model.rotation, 3 * deltaTime);\n mat4.rotateX(state.playerObject.model.rotation, state.playerObject.model.rotation, 3 * deltaTime);\n let down = returnMat4Logically(state.gravityMatrix).y;\n let delta = vec3.create();\n vec3.scale(delta, down, deltaTime * 3);\n //console.log(delta);\n vec3.add(state.playerObject.model.position, state.playerObject.model.position, delta); //move down\n //sortedObjects = null;\n } \n //player has moved past, stop animation\n else\n {\n //console.log(nextCubeIndex);\n setToCubePosition(state, state.playerObject, nextCubeIndex); //correct position\n state.targetGridPosition = state.cubes[nextCubeIndex].model.position.slice();\n state.animationState = null;\n if (win)\n { \n alert(\"You win!\")\n }\n }\n }\n }\n\n // Draw our scene\n drawScene(gl, deltaTime, state);\n }\n stats.end();\n // Request another frame when this one is done\n requestAnimationFrame(render);\n }", "title": "" }, { "docid": "63c9e02c94f807715dd51320b0d9f1e6", "score": "0.58820564", "text": "function render() {\n\n\tSCREEN_WIDTH = window.innerWidth;\n\tSCREEN_HEIGHT = window.innerHeight - 30;\n\n\tif (currentTheme == \"canvas\") {\n\n\t\tcanvas.width = SCREEN_WIDTH;\n\t\tcanvas.height = SCREEN_HEIGHT;\n\t\tblockWidth = SCREEN_HEIGHT / (themes[currentTheme].size * 4/3);\n\t\twallWidth = SCREEN_HEIGHT / themes[currentTheme].size - blockWidth;\n\t\n\t\tctx.clearRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );\n\t\t\n\t\tfor (var i = 0; i < 9; i++) {\n\t\t\tfor (var j = 0; j < 9; j++) {\n\t\t\t\tif (j == 0 || j == 8) {\n\t\t\t\t\tif ( j == 8 ) {\n\t\t\t\t\t\t\tvar color1 = \"red\";//document.getElementById(\"color1\").value;\n\t\t\t\t\t\t\tctx.fillStyle = (color1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar color2 = \"blue\";//document.getElementById(\"color2\").value;\n\t\t\t\t\t\t\tctx.fillStyle = (color2);\n\t\t\t\t\t} \n\t\t\t\t\tctx.fillRect( SCREEN_HEIGHT*i/9+SCREEN_WIDTH/2-SCREEN_HEIGHT/2-1, SCREEN_HEIGHT*j/9+wallWidth/2, blockWidth+2, blockWidth+2 );\n\t\t\t\t\tctx.fillStyle = \"888\";\n\t\t\t\t} else\n\t\t\t\t\tctx.fillStyle = \"666\";\n\t\t\t\tctx.fillRect( SCREEN_HEIGHT*i/9+SCREEN_WIDTH/2-SCREEN_HEIGHT/2, SCREEN_HEIGHT*j/9+wallWidth/2+1, blockWidth, blockWidth );\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tctx.fillStyle = \"fff\";\n\t\t\t\t\tctx.fillText( j+1, SCREEN_WIDTH/2-SCREEN_HEIGHT/2+wallWidth/2, SCREEN_HEIGHT*j/9+blockWidth );\n\t\t\t\t} if (j == 8) {\n\t\t\t\t\tctx.fillStyle = \"fff\";\n\t\t\t\t\tctx.fillText( numberToLetter(i), SCREEN_HEIGHT*i/9+blockWidth+SCREEN_WIDTH/2-SCREEN_HEIGHT/2-wallWidth/2, SCREEN_HEIGHT-wallWidth );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpaintWalls();\n\t\tpaintPawns();\n\t}\n\n\t//adjust camera position based on keyboard keys\n\tif(isZoomInDown && radius > 2)\n\t\tradius--;\n\tif(isZoomOutDown)\n\t\tradius++;\n\tif(isLeftDown)\n\t\ttheta -= turnIncrement;\n\tif(isUpDown && phi < TAU / 4 - turnIncrement)\n\t phi += turnIncrement;\n\tif(isRightDown)\n\t\ttheta += turnIncrement;\n\tif(isDownDown && phi > turnIncrement)\n\t\tphi -= turnIncrement;\n\n\tcamera.position.y = radius * Math.sin(phi);\n\tcamera.position.x = radius * Math.cos(phi) * Math.sin(theta);\n\tcamera.position.z = radius * Math.cos(phi) * Math.cos(theta);\n\n\tcamera.updateMatrix();\n\n\tcameraCube.target.position.x = - camera.position.x;\n\tcameraCube.target.position.y = - camera.position.y;\n\tcameraCube.target.position.z = - camera.position.z;\n\n\n mouse3D = projector.unprojectVector( mouse2D.clone(), camera );\n\tray.direction = mouse3D.subSelf( camera.position ).normalize();\n\n\n\twebglRenderer.clear();\n\twebglRenderer.enableDepthBufferWrite( false );\n\twebglRenderer.render( sceneCube, cameraCube );\n\twebglRenderer.enableDepthBufferWrite( true );\n\twebglRenderer.render( scene, camera );\n\n}", "title": "" }, { "docid": "9b577142179341926956294e50014657", "score": "0.5879368", "text": "function render() {\n var rowImages = [\n 'images/water-block.png', // Top row is water\n 'images/stone-block.png', // Row 1 of 3 of stone\n 'images/stone-block.png', // Row 2 of 3 of stone\n 'images/stone-block.png', // Row 3 of 3 of stone\n 'images/grass-block.png', // Row 1 of 2 of grass\n 'images/grass-block.png' // Row 2 of 2 of grass\n ],\n numRows = 6,\n numCols = 5,\n row, col;\n\n // Before drawing, clear existing canvas\n ctx.clearRect(0,0,canvas.width,canvas.height)\n\n // Draw gameboard tiles\n for (row = 0; row < numRows; row++) {\n for (col = 0; col < numCols; col++) {\n ctx.drawImage(Resources.get(rowImages[row]), col * 101, row * 83);\n }\n }\n\n // Draw win portal\n ctx.drawImage(Resources.get('images/selector.png'), 202, -41.5);\n\n // Draw gem items\n if (player.gemOrange == false && hideItems == false){\n ctx.drawImage(Resources.get('images/gem-orange.png'), gemOrangeX, gemOrangeY);\n }\n if (player.gemGreen == false && hideItems == false){\n ctx.drawImage(Resources.get('images/gem-green.png'), gemGreenX, gemGreenY);\n }\n if (player.gemBlue == false && hideItems == false){\n ctx.drawImage(Resources.get('images/gem-blue.png'), gemBlueX, gemBlueY);\n }\n\n // Draw key item\n if (player.key == false && hideItems == false){\n ctx.drawImage(Resources.get('images/key.png'), keyX, keyY);\n }\n renderEntities();\n }", "title": "" }, { "docid": "f78951baf678e4387d11ec508518230c", "score": "0.58788127", "text": "async function globalRender(){\n setTimeout(() => {\n canvas.renderAll();\n vid1Layer.renderAll();\n fabric.util.requestAnimFrame(globalRender);\n }, 1000/fps)\n}", "title": "" } ]
dc7a6fc5c54d6c7ed6dd036675c14ab4
This implementation is based heavily on node's url.parse
[ { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.0", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" } ]
[ { "docid": "dc294e83444e971798161d02e9190e4d", "score": "0.72364956", "text": "function parse_url(str, component)\n{\n // http://kevin.vanzonneveld.net\n // + original by: Steven Levithan (http://blog.stevenlevithan.com)\n // + reimplemented by: Brett Zamir (http://brett-zamir.me)\n // + input by: Lorenzo Pisani\n // + input by: Tony\n // + improved by: Brett Zamir (http://brett-zamir.me)\n // % note: Based on http://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js\n // % note: blog post at http://blog.stevenlevithan.com/archives/parseuri\n // % note: demo at http://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js\n // % note: Does not replace invalid characters with '_' as in PHP, nor does it return false with\n // % note: a seriously malformed URL.\n // % note: Besides function name, is essentially the same as parseUri as well as our allowing\n // % note: an extra slash after the scheme/protocol (to allow file:/// as in PHP)\n // * example 1: parse_url('http://username:password@hostname/path?arg=value#anchor');\n // * returns 1: {scheme: 'http', host: 'hostname', user: 'username', pass: 'password', path: '/path', query: 'arg=value', fragment: 'anchor'}\n var query, key = ['source', 'scheme', 'authority', 'userInfo', 'user', 'pass', 'host', 'port',\n 'relative', 'path', 'directory', 'file', 'query', 'fragment'],\n ini = (this.php_js && this.php_js.ini) || {},\n mode = (ini['phpjs.parse_url.mode'] &&\n ini['phpjs.parse_url.mode'].local_value) || 'php',\n parser = {\n php: /^(?:([^:\\/?#]+):)?(?:\\/\\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\\/?#]*)(?::(\\d*))?))?()(?:(()(?:(?:[^?#\\/]*\\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*):?([^:@]*))?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/\\/?)?((?:(([^:@]*):?([^:@]*))?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/ // Added one optional slash to post-scheme to catch file:/// (should restrict this)\n };\n\n var m = parser[mode].exec(str),\n uri = {},\n i = 14;\n while (i--) {\n if (m[i]) {\n uri[key[i]] = m[i];\n }\n }\n\n if (component) {\n return uri[component.replace('PHP_URL_', '').toLowerCase()];\n }\n if (mode !== 'php') {\n var name = (ini['phpjs.parse_url.queryKey'] &&\n ini['phpjs.parse_url.queryKey'].local_value) || 'queryKey';\n parser = /(?:^|&)([^&=]*)=?([^&]*)/g;\n uri[name] = {};\n query = uri[key[12]] || '';\n query.replace(parser, function ($0, $1, $2) {\n if ($1) {\n uri[name][$1] = $2;\n }\n });\n }\n delete uri.source;\n return uri;\n}", "title": "" }, { "docid": "3bd1c02f9e158a4035dd93c9b6627267", "score": "0.7064528", "text": "function parseURL(e){var t=document.createElement(\"a\");t.href=e;return{source:e,protocol:t.protocol.replace(\":\",\"\"),host:t.hostname,port:t.port,query:t.search,params:function(){var e={},n=t.search.replace(/^\\?/,\"\").split(\"&\"),r=n.length,i=0,s;for(;i<r;i++){if(!n[i]){continue}s=n[i].split(\"=\");e[s[0]]=s[1]}return e}(),file:(t.pathname.match(/\\/([^\\/?#]+)$/i)||[,\"\"])[1],hash:t.hash.replace(\"#\",\"\"),path:t.pathname.replace(/^([^\\/])/,\"/$1\"),relative:(t.href.match(/tps?:\\/\\/[^\\/]+(.+)/)||[,\"\"])[1],segments:t.pathname.replace(/^\\//,\"\").split(\"/\")}}", "title": "" }, { "docid": "2b1a75777ea26cb033b03ce63c54de38", "score": "0.6907726", "text": "function parseURL(url){\n\tparsed_url = {}\n\n\tif ( url == null || url.length == 0 )\n\t\t\treturn parsed_url;\n\n\tprotocol_i = url.indexOf('://');\n\tparsed_url.protocol = url.substr(0,protocol_i);\n\n\tremaining_url = url.substr(protocol_i + 3, url.length);\n\tdomain_i = remaining_url.indexOf('/');\n\tdomain_i = domain_i == -1 ? remaining_url.length - 1 : domain_i;\n\tparsed_url.domain = remaining_url.substr(0, domain_i);\n\tparsed_url.path = domain_i == -1 || domain_i + 1 == remaining_url.length ? null : remaining_url.substr(domain_i + 1, remaining_url.length);\n\n\tdomain_parts = parsed_url.domain.split('.');\n\tswitch ( domain_parts.length ){\n\t\tcase 2:\n\t\t\tparsed_url.subdomain = null;\n\t\t\tparsed_url.host = domain_parts[0];\n\t\t\tparsed_url.tld = domain_parts[1];\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tparsed_url.subdomain = domain_parts[0];\n\t\t\tparsed_url.host = domain_parts[1];\n\t\t\tparsed_url.tld = domain_parts[2];\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tparsed_url.subdomain = domain_parts[0];\n\t\t\tparsed_url.host = domain_parts[1];\n\t\t\tparsed_url.tld = domain_parts[2] + '.' + domain_parts[3];\n\t\t\tbreak;\n\t}\n\n\tparsed_url.parent_domain = parsed_url.host + '.' + parsed_url.tld;\n\n\treturn parsed_url;\n}", "title": "" }, { "docid": "cf0e2831669f6f90b1640b7cbb21e64f", "score": "0.68956673", "text": "function uriParser (url) {\n // jshint maxstatements:19\n let original = url;\n let protocol = '', domain = '', port = '', path = '', query = '', hash = '';\n if (url.includes('#')) {\n [url, hash] = splitString(url, url.indexOf('#'));\n }\n\n if (url.includes('?')) {\n [url, query] = splitString(url, url.indexOf('?'));\n }\n\n if (url.includes('://')) {\n [protocol, url] = url.split('://');\n [domain, url] = splitString(url, url.indexOf('/'));\n } else if (url.substr(0,2) === '//') {\n url = url.substr(2);\n [domain, url] = splitString(url, url.indexOf('/'));\n }\n\n if (domain.substr(0,4) === 'www.') {\n domain = domain.substr(4);\n }\n\n if (domain && domain.includes(':')) {\n [domain, port] = splitString(domain, domain.indexOf(':'));\n }\n\n path = url; // Whatever is left, must be the path\n return { original, protocol, domain, port, path, query, hash };\n}", "title": "" }, { "docid": "074578141cb17a18782c1e02e9261799", "score": "0.6816595", "text": "function parseURL(url) {\n\n var result,\n resource,\n protocolIndex = url.indexOf(':'),\n protocol = url.substring(0, protocolIndex),\n serverIndex = url.indexOf('/', protocolIndex + 3),\n server = url.substring(protocolIndex + 3, serverIndex);\n\n if (url.substring(serverIndex).length > 1) {\n resource = url.substring(serverIndex);\n }\n\n result = {\n 'protocol': protocol,\n 'server': server,\n 'resource': resource ? resource : 'No resource used.'\n };\n return result;\n}", "title": "" }, { "docid": "b27e8da3d7e899b5b7d71c41aac5e82d", "score": "0.6767387", "text": "function parseUri(str) {\n if (str == undefined){\n str = window.location.href;\n }\n var o = {\n strictMode: false,\n key: [\"source\",\"protocol\",\"authority\",\"userInfo\",\"user\",\"password\",\"host\",\"port\",\"relative\",\"path\",\"directory\",\"file\",\"query\",\"anchor\"],\n q: {\n name: \"queryKey\",\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*):?([^:@]*))?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n }\n var m = o.parser[o.strictMode ? \"strict\" : \"loose\"].exec(str),\n uri = {},\n i = 14;\n while (i--) uri[o.key[i]] = m[i] || \"\";\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) uri[o.q.name][$1] = $2;\n });\n return uri;\n }", "title": "" }, { "docid": "b2186c1419f557f88dbd0ab789d6602f", "score": "0.66896075", "text": "function parseUrl(url) {\n\t\t\tvar match = url.match(/^(([^:\\/?#]+):)?(\\/\\/([^\\/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\t\t\tif (!match) return {};\n\n\t\t\t// coerce to undefined values to empty string so we don't get 'undefined'\n\t\t\tvar query = match[6] || '';\n\t\t\tvar fragment = match[8] || '';\n\t\t\treturn {\n\t\t\t\tprotocol: match[2],\n\t\t\t\thost: match[4],\n\t\t\t\tpath: match[5],\n\t\t\t\trelative: match[5] + query + fragment // everything minus origin\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "a4a72405a35ca12b211ec9786197d992", "score": "0.6643411", "text": "function URLUtils() {}", "title": "" }, { "docid": "e161494a12dc97a8a04d06d8fc892fc5", "score": "0.6626349", "text": "function unparse(self) {\n self = self || this;\n var protocol = self[_url_parse_key[1]] || 'http',\n username = self[_url_parse_key[4]],\n password = self[_url_parse_key[5]],\n hostname = self[_url_parse_key[6]],\n port = self[_url_parse_key[7]],\n pathname = self[_url_parse_key[9]],\n search = self[_url_parse_key[12]],\n hash = self[_url_parse_key[13]],\n search_key = self[_url_parse_qname[0]],\n search_list = self[_url_parse_qname[1]],\n parts = hostname ? [protocol, '://'] : [],\n qparts = [],\n key, vals, i, l;\n if (username) {\n parts.push(username);\n if (password) parts.push(':', password);\n parts.push('@');\n }\n parts.push(hostname);\n if (port) parts.push(':', port);\n parts.push(pathname || (hostname ? '/' : ''));\n if (search) {\n parts.push('?', search);\n } else {\n if (search_list) {\n for (key in search_list) {\n for (i=0, vals=search_list[key], l=vals.length; i<l; i++) {\n qparts.push(_encode_uri_component(key) + '=' + _encode_uri_component(vals[i]));\n }\n if (!l) qparts.push(key);\n }\n } else if (search_key) {\n for (key in search_key) {\n qparts.push(_encode_uri_component(key) + '=' + _encode_uri_component(search_key[key]));\n }\n }\n if (qparts.length) parts.push('?', qparts.join('&'));\n }\n if (hash) parts.push('#', hash);\n\n return parts.join('')\n}", "title": "" }, { "docid": "4d6ea71924749fc19309d7efe5d252d4", "score": "0.65982944", "text": "function parse(url) {\n ['?', '#'].forEach(function(separator) {\n var index = url.indexOf(separator);\n if (index !== -1) url = url.substring(0, index);\n });\n return url;\n}", "title": "" }, { "docid": "1ab814966cec7c5a348b6a0d20b6a18b", "score": "0.6587839", "text": "function parseURL() {\n //Retrieve usefull info from url\n let url = base_url.split('mutable.html?')[1];\n\n //Slit url into data type and data value\n const url_data = url.split('=');\n\n const type = url_data[0];\n const data = url_data[1];\n\n //Make request to vimeo\n if (type === video) return ['video', `${data}`];\n\n //Make internal request to retrieve writting post\n if (type === writting) return ['writting', data];\n\n}", "title": "" }, { "docid": "19c64ec23acb4812fd3d65b3846ed5a0", "score": "0.6571159", "text": "parseUrl(url) {\n let urlTree;\n try {\n urlTree = this.urlSerializer.parse(url);\n }\n catch (e) {\n urlTree = this.malformedUriErrorHandler(e, this.urlSerializer, url);\n }\n return urlTree;\n }", "title": "" }, { "docid": "19c64ec23acb4812fd3d65b3846ed5a0", "score": "0.6571159", "text": "parseUrl(url) {\n let urlTree;\n try {\n urlTree = this.urlSerializer.parse(url);\n }\n catch (e) {\n urlTree = this.malformedUriErrorHandler(e, this.urlSerializer, url);\n }\n return urlTree;\n }", "title": "" }, { "docid": "19c64ec23acb4812fd3d65b3846ed5a0", "score": "0.6571159", "text": "parseUrl(url) {\n let urlTree;\n try {\n urlTree = this.urlSerializer.parse(url);\n }\n catch (e) {\n urlTree = this.malformedUriErrorHandler(e, this.urlSerializer, url);\n }\n return urlTree;\n }", "title": "" }, { "docid": "719a95700880a88a2431ed13e3a4ec11", "score": "0.65707743", "text": "function parseUrl(url) {\n var match = url.match(/^(([^:\\/?#]+):)?(\\/\\/([^\\/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n if (!match) return {};\n\n // coerce to undefined values to empty string so we don't get 'undefined'\n var query = match[6] || '';\n var fragment = match[8] || '';\n return {\n protocol: match[2],\n host: match[4],\n path: match[5],\n relative: match[5] + query + fragment // everything minus origin\n };\n}", "title": "" }, { "docid": "223517cc7e711b84aea4ee12c4427816", "score": "0.6560995", "text": "function parseUrl(url) {\n\tvar match = url.match(/^(([^:\\/?#]+):)?(\\/\\/([^\\/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\tif (!match) return {};\n\n\t// coerce to undefined values to empty string so we don't get 'undefined'\n\tvar query = match[6] || '';\n\tvar fragment = match[8] || '';\n\treturn {\n\t\tprotocol: match[2],\n\t\thost: match[4],\n\t\tpath: match[5],\n\t\trelative: match[5] + query + fragment // everything minus origin\n\t};\n}", "title": "" }, { "docid": "e8a48e2ee1bf7a1ad06b204b544b977b", "score": "0.6550939", "text": "function parseUrl(url) {\n const lastSlash = url.lastIndexOf('/');\n const lastSearchParam = url.lastIndexOf('?');\n const prefix = url.substring(0, lastSlash);\n const suffix = lastSearchParam > lastSlash ? url.substring(lastSearchParam) : '';\n return [prefix + '/', suffix];\n}", "title": "" }, { "docid": "5a9f4becc0b74233fada16cee4fc8ac9", "score": "0.6543888", "text": "parseURL(path) {\n const params = {};\n let parser = document.createElement('a');\n parser.href = path;\n\n const pathname = parser.pathname.slice(1).split(\"/\");\n const search = parser.search.slice(1).split(\"/\")[0];\n\n if (search) {\n const paramsArr = search.split(\"&\").map(part => {\n return part.split(\"=\");\n });\n\n let paramsObj = {};\n for (let i = 0; i < paramsArr.length; i++) {\n for (let j = 0; j < paramsArr[i].length; j++) {\n params[paramsArr[i][j]] = paramsArr[i][j + 1];\n j += 2;\n }\n }\n }\n\n return params;\n }", "title": "" }, { "docid": "2d7aa786ef00451dd7b89ceb87e0c562", "score": "0.65400904", "text": "function parseUrl(url) {\n let parts = {};\n let match = /^(?:(\\w+):)?\\/\\/([^\\/]+)(\\/.*$)?/.exec(url);\n if (match) {\n parts.protocol = match[1];\n parts.host = match[2];\n parts.path = match[3];\n } else {\n parts.path = url;\n }\n return parts;\n}", "title": "" }, { "docid": "d783ccd04bbb4f5027383505eac30488", "score": "0.65279424", "text": "function parseUrl(url) {\n var lastSlash = url.lastIndexOf('/');\n var lastSearchParam = url.lastIndexOf('?');\n var prefix = url.substring(0, lastSlash);\n var suffix = lastSearchParam > lastSlash ? url.substring(lastSearchParam) : '';\n return [prefix + '/', suffix];\n}", "title": "" }, { "docid": "d783ccd04bbb4f5027383505eac30488", "score": "0.65279424", "text": "function parseUrl(url) {\n var lastSlash = url.lastIndexOf('/');\n var lastSearchParam = url.lastIndexOf('?');\n var prefix = url.substring(0, lastSlash);\n var suffix = lastSearchParam > lastSlash ? url.substring(lastSearchParam) : '';\n return [prefix + '/', suffix];\n}", "title": "" }, { "docid": "7b3b4d98078b5a1e56c2a4643e2a1926", "score": "0.65252674", "text": "function parseURL(url) {\n var a = document.createElement('a');\n a.href = url;\n return {\n source: url,\n protocol: a.protocol.replace(':',''),\n host: a.hostname,\n port: a.port,\n query: a.search,\n params: (function(){\n var ret = {},\n seg = a.search.replace(/^\\?/,'').split('&'),\n len = seg.length, i = 0, s;\n for (;i<len;i++) {\n if (!seg[i]) { continue; }\n s = seg[i].split('=');\n ret[s[0]] = s[1];\n }\n return ret;\n })(),\n file: (a.pathname.match(/\\/([^\\/?#]+)$/i) || [,''])[1],\n hash: a.hash.replace('#',''),\n path: a.pathname.replace(/^([^\\/])/,'/$1'),\n relative: (a.href.match(/tps?:\\/\\/[^\\/]+(.+)/) || [,''])[1],\n segments: a.pathname.replace(/^\\//,'').split('/')\n };\n}", "title": "" }, { "docid": "7b3b4d98078b5a1e56c2a4643e2a1926", "score": "0.65252674", "text": "function parseURL(url) {\n var a = document.createElement('a');\n a.href = url;\n return {\n source: url,\n protocol: a.protocol.replace(':',''),\n host: a.hostname,\n port: a.port,\n query: a.search,\n params: (function(){\n var ret = {},\n seg = a.search.replace(/^\\?/,'').split('&'),\n len = seg.length, i = 0, s;\n for (;i<len;i++) {\n if (!seg[i]) { continue; }\n s = seg[i].split('=');\n ret[s[0]] = s[1];\n }\n return ret;\n })(),\n file: (a.pathname.match(/\\/([^\\/?#]+)$/i) || [,''])[1],\n hash: a.hash.replace('#',''),\n path: a.pathname.replace(/^([^\\/])/,'/$1'),\n relative: (a.href.match(/tps?:\\/\\/[^\\/]+(.+)/) || [,''])[1],\n segments: a.pathname.replace(/^\\//,'').split('/')\n };\n}", "title": "" }, { "docid": "2c62c797dd692ccdbcc641a1554f236b", "score": "0.6522446", "text": "function parseUri(e){var a=parseUri.options,f=a.parser[a.strictMode?\"strict\":\"loose\"].exec(e),b={},c=14;while(c--)b[a.key[c]]=f[c]||\"\";b[a.q.name]={};b[a.key[12]].replace(a.q.parser,function(h,d,g){if(d)b[a.q.name][d]=g});return b}", "title": "" }, { "docid": "a96b777cda8a3c0b9933a07d7f5a6370", "score": "0.65213466", "text": "function _parseURL()\n\t{\n\t\tvar hashes = window.location.search.substr(1).split('&');\n\t\tvar params = {};\n\t\t_.each(hashes, function(hash) {\n\t\t\tvar splithash = hash.split('=');\n\t\t\tparams[splithash[0]] = splithash[1];\n\t\t});\n\n\t\tif(params.story) {\n\t\t\tvar id = parseInt(params.story.substr(3), 10);\n\t\t\tvar model = stories.at(id-1);\n\t\t\t_showStory(null, model);\n\t\t}\n\t\telse {\n\t\t\t_showStories();\n\t\t}\n\t}", "title": "" }, { "docid": "0727803242bef18a159d390399112a26", "score": "0.6504684", "text": "function urlparser(){\n var ret = {};\n var option = unescape(window.location.href);\n var r = /[?&]([^?=#&]*)=([^?=#&]*)/g; // http://xxx.com?test=1&try=2 -->> {test:\"1\",try:\"2\"}\n var temp;\n while(temp=r.exec(option)) ret[temp[1]]=temp[2];\n return ret;\n}", "title": "" }, { "docid": "5c8549931b7183d591cf079dc3c4a140", "score": "0.6453053", "text": "function parseURL(url) {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(\"The url string provided does not contain a scheme. \" +\n \"Supported schemes are: \" +\n (\"\" + ModelStoreManagerRegistry.getSchemes().join(',')));\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}", "title": "" }, { "docid": "5c8549931b7183d591cf079dc3c4a140", "score": "0.6453053", "text": "function parseURL(url) {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(\"The url string provided does not contain a scheme. \" +\n \"Supported schemes are: \" +\n (\"\" + ModelStoreManagerRegistry.getSchemes().join(',')));\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}", "title": "" }, { "docid": "bc1008edb7ecb4853f47e1ee1bdd65d4", "score": "0.64477515", "text": "function parseUrl(url) {\r\n if (!url) {\r\n return {};\r\n }\r\n var match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\r\n if (!match) {\r\n return {};\r\n }\r\n // coerce to undefined values to empty string so we don't get 'undefined'\r\n var query = match[6] || '';\r\n var fragment = match[8] || '';\r\n return {\r\n host: match[4],\r\n path: match[5],\r\n protocol: match[2],\r\n relative: match[5] + query + fragment,\r\n };\r\n }", "title": "" }, { "docid": "248dcbd6266d492e867915f2ddb26b0d", "score": "0.64352196", "text": "function parseURI(url) {\n var m = String(url).replace(/^\\s+|\\s+$/g, \"\").match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@\\/?#]*(?::[^:@\\/?#]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n // authority = '//' + user + ':' + pass '@' + hostname + ':' port\n return (m ? {\n href: m[0] || \"\",\n protocol: m[1] || \"\",\n authority: m[2] || \"\",\n host: m[3] || \"\",\n hostname: m[4] || \"\",\n port: m[5] || \"\",\n pathname: m[6] || \"\",\n search: m[7] || \"\",\n hash: m[8] || \"\"\n } : null);\n }", "title": "" }, { "docid": "021489adcd6dbe2ab0b61e779c855e48", "score": "0.64309585", "text": "function parseURL() {\r\n var search = location.search.slice(1);\r\n var pairs = search.split(\"&\");\r\n var values = [];\r\n var junk = /\\+/g;\r\n\r\n for(var i = 0; i < pairs.length; i++) {\r\n for(var j = 0; j < arguments.length; j++) {\r\n var pair = pairs[i].split(\"=\");\r\n if(pair[0] == arguments[j]) {\r\n values.push(pair[1].replace(junk, \" \"));\r\n }\r\n }\r\n }\r\n return (values.length == 1 ? values[0] : (values.length == 0 ? \"\" : values));\r\n }", "title": "" }, { "docid": "2f333938acd5139045807ac912319f5c", "score": "0.6422818", "text": "function parseUrl(url) {\n if (!url) {\n return {};\n }\n var match = url.match(/^(([^:\\/?#]+):)?(\\/\\/([^\\/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n if (!match) {\n return {};\n }\n // coerce to undefined values to empty string so we don't get 'undefined'\n var query = match[6] || '';\n var fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment,\n };\n}", "title": "" }, { "docid": "40d62362293b7efdab3bc4611f3090bd", "score": "0.64211994", "text": "function parseURL(url) {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(`The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}", "title": "" }, { "docid": "40d62362293b7efdab3bc4611f3090bd", "score": "0.64211994", "text": "function parseURL(url) {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(`The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}", "title": "" }, { "docid": "6c17c52f0a0ebda705452359d5716f81", "score": "0.6411937", "text": "function parseUrl(url) {\n if (!url) {\n return {};\n }\n var match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n if (!match) {\n return {};\n }\n // coerce to undefined values to empty string so we don't get 'undefined'\n var query = match[6] || '';\n var fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment,\n };\n}", "title": "" }, { "docid": "e73e665b73d59f99691fc9ef5e6411df", "score": "0.63567936", "text": "parse(url) {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }", "title": "" }, { "docid": "e73e665b73d59f99691fc9ef5e6411df", "score": "0.63567936", "text": "parse(url) {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }", "title": "" }, { "docid": "e73e665b73d59f99691fc9ef5e6411df", "score": "0.63567936", "text": "parse(url) {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }", "title": "" }, { "docid": "3cdc2b3647eac28a15f56484de11b64e", "score": "0.6349686", "text": "function parseURI(url) {\r\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\r\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\r\n\treturn (m ? {\r\n\t\thref : m[0] || '',\r\n\t\tprotocol : m[1] || '',\r\n\t\tauthority: m[2] || '',\r\n\t\thost : m[3] || '',\r\n\t\thostname : m[4] || '',\r\n\t\tport : m[5] || '',\r\n\t\tpathname : m[6] || '',\r\n\t\tsearch : m[7] || '',\r\n\t\thash : m[8] || ''\r\n\t} : null);\r\n}", "title": "" }, { "docid": "3cdc2b3647eac28a15f56484de11b64e", "score": "0.6349686", "text": "function parseURI(url) {\r\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\r\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\r\n\treturn (m ? {\r\n\t\thref : m[0] || '',\r\n\t\tprotocol : m[1] || '',\r\n\t\tauthority: m[2] || '',\r\n\t\thost : m[3] || '',\r\n\t\thostname : m[4] || '',\r\n\t\tport : m[5] || '',\r\n\t\tpathname : m[6] || '',\r\n\t\tsearch : m[7] || '',\r\n\t\thash : m[8] || ''\r\n\t} : null);\r\n}", "title": "" }, { "docid": "3cdc2b3647eac28a15f56484de11b64e", "score": "0.6349686", "text": "function parseURI(url) {\r\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\r\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\r\n\treturn (m ? {\r\n\t\thref : m[0] || '',\r\n\t\tprotocol : m[1] || '',\r\n\t\tauthority: m[2] || '',\r\n\t\thost : m[3] || '',\r\n\t\thostname : m[4] || '',\r\n\t\tport : m[5] || '',\r\n\t\tpathname : m[6] || '',\r\n\t\tsearch : m[7] || '',\r\n\t\thash : m[8] || ''\r\n\t} : null);\r\n}", "title": "" }, { "docid": "67807c7f2e0d1865f878a8c6906f6a5a", "score": "0.6332067", "text": "function parseURL(str) {\n if (typeof str !== 'string') {\n return {};\n }\n\n str = str.trim().replace(/^(\\?|#|&)/, '');\n\n if (!str) {\n return {};\n }\n\n return str.split('&').reduce(function (ret, param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = parts[0];\n var val = parts[1];\n\n key = decodeURIComponent(key);\n // missing `=` should be `null`:\n // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n val = val === undefined ? null : decodeURIComponent(val);\n\n if (!ret.hasOwnProperty(key)) {\n ret[key] = val;\n } else if (Array.isArray(ret[key])) {\n ret[key].push(val);\n } else {\n ret[key] = [ret[key], val];\n }\n\n return ret;\n }, {});\n }", "title": "" }, { "docid": "104a2014f73fc3952ae3e8d3e2233ff6", "score": "0.6327533", "text": "function parseUrl(urlStr, callback) {\n\tvar urlObj = url.parse(urlStr);\n\tif (urlObj.host === null) {\n\t\tcallback(new Error('host not found, please include protocol in url'));\n\t} else if (urlObj.host.match('youtube')) {\n\t\tvar queryObj = querystring.parse(urlObj.query);\n\t\tif (queryObj.v === null) {\n\t\t\tcallback(new Error('youtube query invalid, requires \\'v\\' field'));\n\t\t} else {\n\t\t\tcallback(null, 'youtube', queryObj.v);\n\t\t}\n\t} else {\n\t\tcallback(new Error('unsupported host'), null, null);\n\t}\n}", "title": "" }, { "docid": "200392139672a29aa6aa88b8b2ca5a6c", "score": "0.6326779", "text": "function k(a){return a.replace(/\\?_pjax=[^&]+&?/,\"?\").replace(/_pjax=[^&]+&?/,\"\").replace(/[\\?&]$/,\"\")}// Internal: Parse URL components and returns a Locationish object.", "title": "" }, { "docid": "d4a24340ac3962df9e1f51dd6a1a657e", "score": "0.6319265", "text": "function parseURL (url) {\n var queryStart = url.indexOf(\"?\") + 1,\n queryEnd = url.indexOf(\"#\") ,\n query = url.slice(queryStart, queryEnd );\n console.log(query);\n return query;\n }", "title": "" }, { "docid": "e92a4ed9054843a5bc4f31065f89bb59", "score": "0.6315847", "text": "function parseURI(url) {\n var m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@\\/?#]*(?::[^:@\\/?#]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n // authority = '//' + user + ':' + pass '@' + hostname + ':' port\n return (m ? {\n href : m[0] || '',\n protocol : m[1] || '',\n authority: m[2] || '',\n host : m[3] || '',\n hostname : m[4] || '',\n port : m[5] || '',\n pathname : m[6] || '',\n search : m[7] || '',\n hash : m[8] || ''\n } : null);\n }", "title": "" }, { "docid": "1a1b92b38ff149c87736b5d0299aad9f", "score": "0.630802", "text": "function parseUrl (url) {\n const a = document.createElement('a')\n a.href = url\n\n return {\n href: a.pathname,\n search: a.search,\n hash: a.hash\n }\n }", "title": "" }, { "docid": "8d9e41563fe871e6a0661dc5dd323d02", "score": "0.63068974", "text": "function parseURL(URL){\n let urlDescription = {};\n \n /*\n ** TODO:: A bug where HTTPS doesn't get a responsee\n */\n // determines port number and removes protocol\n if(URL.search(\"https://\") > -1){\n urlDescription[\"port\"] = 80; // HTTPS PORT = 443\n URL = URL.substr(8);\n }else{\n urlDescription[\"port\"] = 80;\n if(URL.search(\"http://\") > -1){\n URL = URL.substr(7);\n }\n }\n \n //removes www.\n if(URL.search(\"www.\") > -1){\n URL = URL.substr(4);\n }\n \n // parses host and request\n let host = URL.split(/\\/(.+)/);\n if(host[1] === undefined){\n host[1] = \"\";\n if(host[0].search(\"/\") > -1){\n host[0] = host[0].slice(0,-1);\n }\n }\n urlDescription[\"host\"] = host[0];\n urlDescription[\"path\"] = \"/\"+host[1];\n \n // parses URL queries\n urlDescription[\"args\"] = {}\n if(URL.search(\"\\\\?\") > -1){\n let urlArgs = URL.split(\"?\");\n if(urlArgs[1].search(\"&\") > -1){\n urlArgs = urlArgs[1].split(\"&\");\n for(let i = 0; i < urlArgs.length; i++){\n let temp = urlArgs[i].split(\"=\");\n urlDescription.args[temp[0]] = temp[1];\n }\n }\n }\n \n if(verbose){\n log(chalk.yellow(\"[Parsing URL]\"));\n log(chalk.green(URL))\n log(chalk.blue(JSON.stringify(urlDescription,null,2))); \n }\n return urlDescription;\n}", "title": "" }, { "docid": "88ed5e866db27da780277119e4801cf7", "score": "0.6304401", "text": "function parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}", "title": "" }, { "docid": "88ed5e866db27da780277119e4801cf7", "score": "0.6304401", "text": "function parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}", "title": "" }, { "docid": "88ed5e866db27da780277119e4801cf7", "score": "0.6304401", "text": "function parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}", "title": "" }, { "docid": "7e35b72869d4a5d04134c6ce104d4f61", "score": "0.62991613", "text": "function parseURL() {\n courseNumber = getQueryVariable(\"course\");\n moduleCounter = getQueryVariable(\"module\")\n}", "title": "" }, { "docid": "3510ccfe2bd9a7b43e8204a72a526da1", "score": "0.6293436", "text": "function parseURL (url) {\n var queryStart = url.indexOf(\"?\") + 1,\n queryEnd = url.indexOf(\"#\") ,\n query = url.slice(queryStart, queryEnd );\n console.log(query);\n return query;\n }", "title": "" }, { "docid": "4eb3e6e32430358ddf585dc57e2d7fd6", "score": "0.62866026", "text": "function parseUrl(url) {\n var uri = new URI(url);\n var hash = uri.fragment();\n return queryToObject(hash);\n }", "title": "" }, { "docid": "41c742563e7e5e9c9067c085787cc370", "score": "0.62543404", "text": "function parseURI(url) {\n var m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n // authority = '//' + user + ':' + pass '@' + hostname + ':' port\n return m ? {\n href: m[0] || '',\n protocol: m[1] || '',\n authority: m[2] || '',\n host: m[3] || '',\n hostname: m[4] || '',\n port: m[5] || '',\n pathname: m[6] || '',\n search: m[7] || '',\n hash: m[8] || ''\n } : null;\n}", "title": "" }, { "docid": "34f0821a12411dc7fee7922156fa8a8b", "score": "0.6228334", "text": "function articleBaseUrl$1(url,parsed){var parsedUrl=parsed||URL$1.parse(url);var protocol=parsedUrl.protocol,host=parsedUrl.host,path=parsedUrl.path;var firstSegmentHasLetters=false;var cleanedSegments=path.split('/').reverse().reduce(function(acc,rawSegment,index){var segment=rawSegment;// Split off and save anything that looks like a file type.\nif(segment.includes('.')){var _segment$split=segment.split('.'),_segment$split2=_slicedToArray$1(_segment$split,2),possibleSegment=_segment$split2[0],fileExt=_segment$split2[1];if(IS_ALPHA_RE$1.test(fileExt)){segment=possibleSegment;}}// If our first or second segment has anything looking like a page\n// number, remove it.\nif(PAGE_IN_HREF_RE$1.test(segment)&&index<2){segment=segment.replace(PAGE_IN_HREF_RE$1,'');}// If we're on the first segment, check to see if we have any\n// characters in it. The first segment is actually the last bit of\n// the URL, and this will be helpful to determine if we're on a URL\n// segment that looks like \"/2/\" for example.\nif(index===0){firstSegmentHasLetters=HAS_ALPHA_RE$1.test(segment);}// If it's not marked for deletion, push it to cleaned_segments.\nif(isGoodSegment$1(segment,index,firstSegmentHasLetters)){acc.push(segment);}return acc;},[]);return protocol+'//'+host+cleanedSegments.reverse().join('/');}// Given a string, return True if it appears to have an ending sentence", "title": "" }, { "docid": "be3aa8f0df91bb6bb7055feea44e3dca", "score": "0.61834466", "text": "parseURL(fullURL){\n var vm = this,\n fullBaseURL = vm.fullBaseURL;\n if ( fullURL === undefined ){\n return '';\n }\n if ( typeof(fullURL) !== 'string' ){\n return fullURL.toString();\n }\n if ( fullURL.indexOf(bbn.env.root) === 0 ){\n fullURL = fullURL.substr(bbn.env.root.length);\n }\n if ( fullBaseURL === (fullURL + '/') ){\n return '';\n }\n if ( fullBaseURL && (fullURL.indexOf(fullBaseURL) === 0) ){\n return fullURL.substr(fullBaseURL.length);\n }\n /*if ( vm.baseURL && (url.indexOf(vm.baseURL) === 0) ){\n return url.substr(vm.baseURL.length);\n }\n else if ( vm.baseURL === (url + '/') ){\n return '';\n }*/\n return fullURL;\n }", "title": "" }, { "docid": "7b2b314829728f43250ef174cafc3081", "score": "0.6181501", "text": "function parseRequestURL(){\n\n let url = location.hash.slice(1).toLowerCase() || '/';\n let r = url.split(\"/\")\n let request = {\n resource : null,\n id : null,\n verb : null\n }\n request.resource = r[1]\n request.id = r[2]\n request.verb = r[3]\n\n return request\n}", "title": "" }, { "docid": "eee546f5096e99d6118c3178beb04bbd", "score": "0.6177855", "text": "function parseUrl() {\n var params = gadgets.util.getUrlParameters();\n for (var i in params) {\n if (params.hasOwnProperty(i)) {\n if (i.indexOf('up_') === 0 && i.length > 3) {\n prefs[i.substr(3)] = String(params[i]);\n } else if (i === 'country') {\n country = params[i];\n } else if (i === 'lang') {\n language = params[i];\n } else if (i === 'mid') {\n moduleId = params[i];\n }\n }\n }\n }", "title": "" }, { "docid": "6e3c8ec1df1d647fe9c757f635f3438d", "score": "0.6149597", "text": "parseName() {\n return decodeURI(location.href.split('?')[1].split('=')[1]);\n }", "title": "" }, { "docid": "ac3bf68df7ada19ab794d56acfb11857", "score": "0.613576", "text": "function parseUnixUrl( url ) {\n\tsys.puts( 'parsing url: ' + url );\n\t\n\tvar path = require('url').parse( url ).pathname;\n\tvar cmd = path.replace('/','');\n\tvar querystring = require('url').parse( url, true );\n\tvar stdin = querystring.query.stdin; \n\tvar cmdargs = eval(querystring.query.args);\n\tsys.puts(querystring.query.args);\n\tsys.puts(cmd);\n\treturn { name: cmd, args: cmdargs, stdin: stdin };\n}", "title": "" }, { "docid": "5a66a5eb8ac2597309e754edad1176eb", "score": "0.60657305", "text": "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n // Index is starting from 1\n if ( index < 1 ) {\n index = 1;\n }\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "title": "" }, { "docid": "075fd3769a70c697cf72c727e7352cf4", "score": "0.60554206", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "732f02b34e7b761150b8a754bb18fe68", "score": "0.60549074", "text": "function parseUri( url, strictMode )\n {\n var str = decodeURI( url ),\n res = parser[ strictMode || false ? \"strict\" : \"loose\" ].exec( str ),\n uri = { attr : {}, param : {}, seg : {} },\n i = 14;\n \n while ( i-- )\n {\n uri.attr[ key[i] ] = res[i] || \"\";\n }\n \n // build query and fragment parameters\n \n uri.param['query'] = {};\n uri.param['fragment'] = {};\n \n uri.attr['query'].replace( querystring_parser, function ( $0, $1, $2 ){\n if ($1)\n {\n uri.param['query'][$1] = $2;\n }\n });\n \n uri.attr['fragment'].replace( fragment_parser, function ( $0, $1, $2 ){\n if ($1)\n {\n uri.param['fragment'][$1] = $2;\n }\n });\n \n // split path and fragement into segments\n \n uri.seg['path'] = uri.attr.path.replace(/^\\/+|\\/+$/g,'').split('/');\n \n uri.seg['fragment'] = uri.attr.fragment.replace(/^\\/+|\\/+$/g,'').split('/');\n \n // compile a 'base' domain attribute\n \n uri.attr['base'] = uri.attr.host ? uri.attr.protocol+\"://\"+uri.attr.host + (uri.attr.port ? \":\"+uri.attr.port : '') : '';\n \n return uri;\n }", "title": "" }, { "docid": "1b62371332b1800bb0d25e54a8046a92", "score": "0.6045923", "text": "function parseUrlOrigin(url){// url could be domain-relative\n// url could give a domain\n// cross origin means:\n// same domain\n// same port\n// some protocol\n// so, same everything up to the first (single) slash \n// if such is given\n//\n// can ignore everything after that \nvar URL_HOST_PATTERN=/(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,// if no match, use an empty array so that\n// subexpressions 1,2,3 are all undefined\n// and will ultimately return all empty\n// strings as the parse result:\nurlHostMatch=URL_HOST_PATTERN.exec(url)||[];return{protocol:urlHostMatch[1]||'',host:urlHostMatch[2]||'',port:urlHostMatch[3]||''};}", "title": "" }, { "docid": "d3f4f78565ce34294a57ca081ce232c2", "score": "0.6042419", "text": "function Url() {\n //For more efficient internal representation and laziness.\n //The non-underscore versions of these properties are accessor functions\n //defined on the prototype.\n this._protocol = null;\n this._href = \"\";\n this._port = -1;\n this._query = null;\n\n this.auth = null;\n this.slashes = null;\n this.host = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n\n this._prependSlash = false;\n}", "title": "" }, { "docid": "d3f4f78565ce34294a57ca081ce232c2", "score": "0.6042419", "text": "function Url() {\n //For more efficient internal representation and laziness.\n //The non-underscore versions of these properties are accessor functions\n //defined on the prototype.\n this._protocol = null;\n this._href = \"\";\n this._port = -1;\n this._query = null;\n\n this.auth = null;\n this.slashes = null;\n this.host = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n\n this._prependSlash = false;\n}", "title": "" }, { "docid": "feea20fd98c1acfaf07b355680a27e4f", "score": "0.6040273", "text": "function parseUrlSafe(url) {\n try {\n return new URL(url);\n }\n catch (e) {\n if (!url.includes('://')) {\n return new URL('http://' + url);\n }\n throw e;\n }\n}", "title": "" }, { "docid": "6d544cc6f442ed828f69c42bb9f69108", "score": "0.60351974", "text": "function parseUri( url, strictMode )\n {\n var str = decodeURI( url ),\n res = parser[ strictMode || false ? \"strict\" : \"loose\" ].exec( str ),\n uri = { attr : {}, param : {}, seg : {} },\n i = 14;\n \n while ( i-- )\n {\n uri.attr[ key[i] ] = res[i] || \"\";\n }\n \n // build query and fragment parameters\n \n uri.param['query'] = {};\n uri.param['fragment'] = {};\n \n uri.attr['query'].replace( querystring_parser, function ( $0, $1, $2 ){\n if ($1)\n {\n uri.param['query'][$1] = $2;\n }\n });\n \n uri.attr['fragment'].replace( fragment_parser, function ( $0, $1, $2 ){\n if ($1)\n {\n uri.param['fragment'][$1] = $2;\n }\n });\n \n // split path and fragement into segments\n \n uri.seg['path'] = uri.attr.path.replace(/^\\/+|\\/+$/g,'').split('/');\n \n uri.seg['fragment'] = uri.attr.fragment.replace(/^\\/+|\\/+$/g,'').split('/');\n \n // compile a 'base' domain attribute\n \n uri.attr['base'] = uri.attr.host ? uri.attr.protocol+\"://\"+uri.attr.host + (uri.attr.port ? \":\"+uri.attr.port : '') : '';\n \n return uri;\n }", "title": "" }, { "docid": "77df8d12d249fd01454835c968526819", "score": "0.60347295", "text": "function parseImageURL() {\n\t\t\tvar href = imageArray[0].href;\n\t\t\tvar pos0 = href.lastIndexOf('/') + 1;\n\t\t\tvar pre = href.substring(0, pos0);\n\t\t\tvar post = href.substring(pos0, href.length);\n\t\t\thref = pre + 'm' + post;\n\t\t\treturn href;\n\t\t}", "title": "" }, { "docid": "4b32104ddbd06a77ad89d91b6d5830a6", "score": "0.60313195", "text": "function parseUri (str) {\n\t\tvar\to = parseUri.options,\n\t\t\tm = o.parser[o.strictMode ? \"strict\" : \"loose\"].exec(str),\n\t\t\turi = {},\n\t\t\ti = 14;\n\t\n\t\twhile (i--) uri[o.key[i]] = m[i] || \"\";\n\t\n\t\turi[o.q.name] = {};\n\t\turi[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n\t\t\tif ($1) uri[o.q.name][$1] = $2;\n\t\t});\n\t\n\t\treturn uri;\n\t}", "title": "" }, { "docid": "2cf0d7c9f88d53445d9e66636b2f4133", "score": "0.6026458", "text": "function parseUri(str) {\n var o = parseUri.options,\n m = o.parser[o.strictMode ? \"strict\" : \"loose\"].exec(str),\n uri = {},\n i = 14;\n\n while (i--) {\n uri[o.key[i]] = m[i] || \"\";\n }\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n }", "title": "" }, { "docid": "e090e16954f7035e40353cb13bb4e81d", "score": "0.60210556", "text": "function parseUri (str) {\n var o = parseUri.options;\n var m = o.parser[o.strictMode ? \"strict\" : \"loose\"].exec(str);\n var uri = {};\n var i = 14;\n\n while (i--) uri[o.key[i]] = m[i] || \"\";\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) uri[o.q.name][$1] = $2;\n });\n\n return uri;\n}", "title": "" }, { "docid": "1670be6c7355a4b8128b9b35849f4437", "score": "0.6019639", "text": "function parseUri (str) {\n var o = parseUri.options\n , m = o.parser[o.strictMode ? \"strict\" : \"loose\"].exec(str)\n , uri = {}\n , i = 14\n\n while (i--) { uri[o.key[i]] = m[i] || \"\" }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) { uri[o.q.name][$1] = $2 }\n })\n\n return uri\n}", "title": "" }, { "docid": "410b791d8685f3458ab49ee55d356bef", "score": "0.6019457", "text": "function parseUri(str) {\n var o = parseUri.options,\n m = o.parser[o.strictMode ? \"strict\" : \"loose\"].exec(str),\n uri = {},\n i = 14;\n\n while (i--) uri[o.key[i]] = m[i] || \"\";\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) uri[o.q.name][$1] = $2;\n });\n\n return uri;\n }", "title": "" }, { "docid": "2399f7b5fcb3619e4e27f68aa19f3483", "score": "0.60191447", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1);\n var rez = hash.split('-');\n var index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1;\n var gallery = rez.join('-');\n\n // Index is starting from 1\n if (index < 1) {\n index = 1;\n }\n\n return {\n hash: hash,\n index: index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "64b139c631f44770a8cb5d74af155c7a", "score": "0.6011748", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "64b139c631f44770a8cb5d74af155c7a", "score": "0.6011748", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "64b139c631f44770a8cb5d74af155c7a", "score": "0.6011748", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "64b139c631f44770a8cb5d74af155c7a", "score": "0.6011748", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "64b139c631f44770a8cb5d74af155c7a", "score": "0.6011748", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "title": "" }, { "docid": "cbdc3578e23272d3a3fa6e33af557536", "score": "0.60117", "text": "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "title": "" }, { "docid": "cbdc3578e23272d3a3fa6e33af557536", "score": "0.60117", "text": "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "title": "" }, { "docid": "c71e5d18c5e18f4f2c917337527a20d5", "score": "0.6008984", "text": "function parseUri(str) {\n var o = parseUri.options,\n m = o.parser[o.strictMode ? \"strict\" : \"loose\"].exec(str),\n uri = {},\n i = 14;\n\n while (i > 0) {\n i -= 1;\n uri[o.key[i]] = m[i] || \"\";\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) uri[o.q.name][$1] = $2;\n });\n\n return uri;\n }", "title": "" }, { "docid": "6702e54aa4ce450dbf1ac9f789fcddfd", "score": "0.60036683", "text": "function parseUrl (urlStr) {\n \"use strict\";\n \n var urlObject = URL.parse(urlStr, true),\n vId = '';\n \n if (urlObject.query.v) {\n vId = urlObject.query.v;\n }\n else if (videoRegex(urlStr)) {\n vId = videoRegex(urlStr);\n }\n\n return vId; \n}", "title": "" }, { "docid": "07dda20ea7dcf71d75c3d218bb3e7000", "score": "0.59955144", "text": "function parseUri (str) {\n var o = parseUri.options,\n m = o.parser[o.strictMode ? \"strict\" : \"loose\"].exec(str),\n uri = {},\n i = 14;\n\n while (i--) uri[o.key[i]] = m[i] || \"\";\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) uri[o.q.name][$1] = $2;\n });\n\n return uri;\n}", "title": "" }, { "docid": "3f3215d78e5764b33df1e2873fbffa66", "score": "0.59933805", "text": "function parseUri (str) {\n var\to = parseUri.options,\n m = o.parser[o.strictMode ? \"strict\" : \"loose\"].exec(str),\n uri = {},\n i = 14;\n\n while (i--) uri[o.key[i]] = m[i] || \"\";\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) uri[o.q.name][$1] = $2;\n });\n\n return uri;\n}", "title": "" }, { "docid": "010b5fb376c8ac97330670bfda2a7f56", "score": "0.59878194", "text": "function parseURL(){\n\t// check the URL passed for routing information\n\tconst query = window.location.search;\n\tconsole.log(query);\n\tconst urlParams = new URLSearchParams(query);\n\t\n\t// mode = solo means check for the example #, multi means check for the ordered string (not implemented anymore)\n\t//var mode = urlParams.get('mode');\n\tvar ex = Number(urlParams.get('ex'));\n\tvar tile = Number(urlParams.get('tile'));\n\t//console.log(mode,ex);\n\tif(ex < 1 || ex > 7){\n\t\tconsole.log(\"Link parameters do not match. Defaulted to example 1.\");\n\t\tex = 1;\n\t} else {\n\t\tconsole.log(\"You have chosen to open to example\", ex);\n\t}\n\t\n\t// start creating the map with any given info/the defaults\n\tcreateMap(ex,tile);\n}", "title": "" }, { "docid": "a7a61b632242fa77ec09818c0c55716b", "score": "0.5982011", "text": "function parseUri (str) {\n var\to = parseUri.options,\n m = o.parser[o.strictMode ? \"strict\" : \"loose\"].exec(str),\n uri = {},\n i = 14;\n\n while (i--) {\n uri[o.key[i]] = m[i] || \"\";\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n }", "title": "" }, { "docid": "7471678d22790d470f7ef43b07c5db5a", "score": "0.5981238", "text": "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "title": "" }, { "docid": "7471678d22790d470f7ef43b07c5db5a", "score": "0.5981238", "text": "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "title": "" }, { "docid": "7471678d22790d470f7ef43b07c5db5a", "score": "0.5981238", "text": "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "title": "" }, { "docid": "7471678d22790d470f7ef43b07c5db5a", "score": "0.5981238", "text": "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "title": "" }, { "docid": "7471678d22790d470f7ef43b07c5db5a", "score": "0.5981238", "text": "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "title": "" }, { "docid": "7471678d22790d470f7ef43b07c5db5a", "score": "0.5981238", "text": "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "title": "" }, { "docid": "7471678d22790d470f7ef43b07c5db5a", "score": "0.5981238", "text": "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "title": "" }, { "docid": "7471678d22790d470f7ef43b07c5db5a", "score": "0.5981238", "text": "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "title": "" }, { "docid": "7471678d22790d470f7ef43b07c5db5a", "score": "0.5981238", "text": "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "title": "" }, { "docid": "7471678d22790d470f7ef43b07c5db5a", "score": "0.5981238", "text": "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "title": "" }, { "docid": "7471678d22790d470f7ef43b07c5db5a", "score": "0.5981238", "text": "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "title": "" }, { "docid": "7471678d22790d470f7ef43b07c5db5a", "score": "0.5981238", "text": "function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}", "title": "" } ]
93b825dcf2e53955efd4d010fd5366f7
Function that saves an axiom from the editor
[ { "docid": "c6f9650ca64262f8c3bc0a579767d4de", "score": "0.6242637", "text": "function saveAxiom (aId) {\n var axiom = document.getElementById(aId);\n var label = axiom.getAttribute('name');\n var id = axiom.getAttribute('id');\n var temp = new Thing(label, 'axiom', id);\n var cList = [];\n var rList = [];\n\n for (var i = 0; i < axiom.children.length; i++) {\n if(axiom.children[i].getAttribute('class') === 'concept'){\n cList.push(axiom.children[i]);\n } else if (axiom.children[i].getAttribute('class') === 'relation') {\n rList.push(axiom.children[i]);\n }\n }\n console.log(cList,rList);\n //continue going through both lists and creating objects and adding etc\n}", "title": "" } ]
[ { "docid": "a37627cd2155c310726fc4499cfa578b", "score": "0.6377857", "text": "function saveDocumentAs() {\n//a3935\nif (__YY__.S('a3935', arguments)) {debugger;}\n if (checkLocalStorage()) {\n var saveName = prompt(\"Save file as...\", getCurrentFileName());\n if (saveName && saveName !== UnsavedFileName) {\n setCurrentFileName(saveName);\n saveDiagramProperties()\n window.localStorage.setItem(saveName, myDiagram.model.toJson());\n myDiagram.isModified = false;\n }\n }\n}", "title": "" }, { "docid": "9fb587ec01c7d68d7f9cadd502f94f7c", "score": "0.63596946", "text": "function save() {\n var str = myDiagram.model.toJson();\n document.getElementById(\"mySavedModel\").value = str;\n }", "title": "" }, { "docid": "3ef099ef8f0090fcb6f90da743b92a23", "score": "0.634677", "text": "function save() {\n var str = myDiagram.model.toJson();\n document.getElementById(\"mySavedModel\").value = str;\n myDiagram.isModified = false;\n }", "title": "" }, { "docid": "3deb814447a0fda1b1caee8471e9c2ca", "score": "0.61518604", "text": "function saveDocument() {\n//a3934\nif (__YY__.S('a3934', arguments)) {debugger;}\n if (checkLocalStorage()) {\n var saveName = getCurrentFileName();\n if (saveName === UnsavedFileName) {\n saveDocumentAs();\n } else {\n saveDiagramProperties()\n window.localStorage.setItem(saveName, myDiagram.model.toJson());\n myDiagram.isModified = false;\n }\n }\n}", "title": "" }, { "docid": "6d4150707c8242843dcffd8e4423ef57", "score": "0.60576", "text": "function save() {\n document.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n myDiagram.isModified = false;\n}", "title": "" }, { "docid": "ce572b398bda74b959a0e097421510e1", "score": "0.5997112", "text": "function saveModel() {\n//a3945\nif (__YY__.S('a3945', arguments)) {debugger;}\n var str = myDiagram.model.toJson();\n document.getElementById(\"mySavedModel\").value = str;\n}", "title": "" }, { "docid": "3ae64db172f03cb92aabbf5609a68342", "score": "0.59181947", "text": "function Save(){\n net = { places:[], trans:[], arcs:[] };\n savePlaces();\n saveTrans();\n saveArcs();\n saveContent = JSON.stringify(net);\n var blob = new Blob([saveContent], {type: \"text/plain;charset=utf-8\"});\n saveAs(blob, fileName);\n \n\n }", "title": "" }, { "docid": "5acc0014d5b8bdfcb7eefa9ed4d48e29", "score": "0.58449185", "text": "function saveFile() {\n model.setFile(filepath,editor.session.doc.getValue());\n }", "title": "" }, { "docid": "faefe1549809c775e278b1f26410ba43", "score": "0.58294433", "text": "function saveDiagramProperties() {\n//a3939\nif (__YY__.S('a3939', arguments)) {debugger;}\n myDiagram.model.modelData.position = yy.Point.stringify(myDiagram.position);\n}", "title": "" }, { "docid": "fe994564b807f8e9d38f258e6566f90c", "score": "0.5826604", "text": "function save() {\n var svg = canvasElement.innerHTML\n\n var element = document.createElement('a')\n var filename = model.name + \".svg\"\n\n element.setAttribute('href', 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svg));\n element.setAttribute('download', filename);\n\n element.style.display = 'none';\n\n document.body.appendChild(element);\n\n element.click();\n\n document.body.removeChild(element);\n}", "title": "" }, { "docid": "c550b30df7bb66ef90b76887d49c6395", "score": "0.58044946", "text": "function saveFile () {\n saveData (JSON.stringify(paperModelToJson(paper)), \"paper.json\");\n}", "title": "" }, { "docid": "5be4d5106bec635326f6f119666867cc", "score": "0.57514644", "text": "save() {\n this.displayButtons(true);\n var dump = VRSPACEUI.assetLoader.dump();\n if ( Object.keys(dump).length > 0 ) {\n VRSPACEUI.saveFile(this.world.name+\".json\", JSON.stringify(dump));\n }\n }", "title": "" }, { "docid": "c514ebe012079e25203d1bd7be086dec", "score": "0.5683336", "text": "function save(){\r\n var fileName = prompt(\"Please enter a file name\", \"default\");\r\n saveFile(new SOR(fileName, convertCoords(vertices), convertTriangles(poly)));\r\n}", "title": "" }, { "docid": "ebe5643b3f32ad870f26038bb14dc23f", "score": "0.5682939", "text": "function save() {\n svgCanvas.save();\n}", "title": "" }, { "docid": "e8dcf84d52a668b8ed917a3a774469b2", "score": "0.5666983", "text": "function save(filename) {\n var file = new Blob([editor.getValue()], {\n type: \"text/plain\",\n });\n if (window.navigator.msSaveOrOpenBlob)\n // IE10+\n window.navigator.msSaveOrOpenBlob(file, filename);\n else {\n // Others\n var a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function () {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n}", "title": "" }, { "docid": "9eebb6773a999db1ef58895355dc9afe", "score": "0.56185967", "text": "@action\n async save() {\n let files = [];\n for (let [_, form] of Object.entries(this.forms)) {\n let fileObj = form.model;\n let file = rdflib.sym(this.args.folder.value + fileObj.file)\n await new Promise((resolve, reject) => {\n this.storeCommunicator.store.updater.put(file, [], 'text/turtle', (uri, ok, err) => {\n if (ok) {\n resolve();\n } else {\n reject(new Error(\"Could not create new document\"));\n }\n });\n });\n files.push(file);\n }\n await Promise.all(files.map(file => this.args.onCreate(file)));\n this.args.onClose();\n }", "title": "" }, { "docid": "e6a725b3e10fa52be9f81847e5a9b959", "score": "0.5599727", "text": "function doSave() {\n let filedata = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"' + artBWidth + '\" height=\"' + artBWidth + '\"> <g id=\"Layer_1\">' + blocks + \"</g> <g id='Layer_2'>\" + blocks2 + \"</g><g id='Layer_3'>\" + blocks3 + \"</g> </svg> \";\n let locfile = new Blob([filedata], {\n type: \"image/svg+xml;charset=utf-8\"\n });\n let locfilesrc = URL.createObjectURL(locfile); //mylocfile);\n\n let downlo = document.getElementById(\"dwn\");\n dwn.innerHTML =\n \"<a href=\" + locfilesrc + \" download='mysvg.svg'>DownloadSVG</a>\";\n }", "title": "" }, { "docid": "a89ac3138daf201b0be034f6ce8865e1", "score": "0.5581514", "text": "function EnableEpicEditorExport() {\n $('.export').on('click', function() {\n var blob = new Blob([$('textarea').val()], {\n type: \"text/plain;charset=utf-8\"\n });\n saveAs(blob, \"GetDown.md\");\n });\n}", "title": "" }, { "docid": "cc872d0d635719055852d00cc0b81c40", "score": "0.555962", "text": "function save(){\n Words.push({index: Words.length , word: mot.text, definition: def.text})\n console.log(Words)\n {/*fs.writeFile('./vocabulaire.json', JSON.stringify(Words), (err) => {\n if (err) console.log('Error writing file:', err);\n })*/}\n }", "title": "" }, { "docid": "81794c219a013768388590f144652bda", "score": "0.5535693", "text": "function save() {\n \n const content = JSON.stringify(MOUSEKEYBOARD, (key, value) => {\n if(['I_CURRENT', 'save', 'update'].indexOf(key) !== -1) return undefined;\n return value;\n }, 2);\n \n fs.writeFile(`${local}/Platform/Settings/mouse-keyboard.json`, content, (err) => {\n if(err) console.error('alert error')\n })\n}", "title": "" }, { "docid": "9ffa15f349b395616990fbf6f68b6680", "score": "0.55207926", "text": "function savePad() {\n var lang = $(\"#languageselected\").text().toLowerCase();\n if(lang == \"language \") \n lang = \"python\";\n var content = firepad.getText() + \"\\n\\n\" + cmt[lang] + \"Output:\\n\";\n var outputArray = outputPad.getText().split(/\\n/);\n for(var i = 0; i < outputArray.length; i++) {\n content += (cmt[lang] + outputArray[i] + \"\\n\"); \n }\n var blob = new Blob([content], {type: \"text/plain;charset=utf-8\"});\n saveAs(blob, filename);\n}", "title": "" }, { "docid": "1a919598219e2003aadd915761f3055b", "score": "0.5512976", "text": "save() {\n\t\tstore.saveGame(JSON.stringify(this.export()));\n\t}", "title": "" }, { "docid": "11881f2c1e69db05744adac0cc22034b", "score": "0.55076355", "text": "function SaveEditable(el) {\n var html = markDownToHtml(el.find('textarea').val());\n SetStorage(el.attr('id'), Tag(html));\n el.html((showGreeting ? greeting : \"\") + UnTag(html));\n }", "title": "" }, { "docid": "96f3f9f70bd772a5de771259ad728bf8", "score": "0.5475662", "text": "function saveBuffer() {\n sendZoocrypt({ 'cmd': 'save', 'arg': editorProof.getValue(), 'filename': currentFile });\n}", "title": "" }, { "docid": "4b0c907674e9996ec6ce4406000103ac", "score": "0.5472695", "text": "function savepdf() {\n var xy = editor.getSession().getValue();\n ipcRenderer.send(\"savetopdfnow\",xy);\n}", "title": "" }, { "docid": "ae0f58d5d9381488e7cb2a9e1916db44", "score": "0.5462495", "text": "function Save() {\n win.name = JSON.stringify(store);\n }", "title": "" }, { "docid": "ae0f58d5d9381488e7cb2a9e1916db44", "score": "0.5462495", "text": "function Save() {\n win.name = JSON.stringify(store);\n }", "title": "" }, { "docid": "b1f4c1218317864839dccc50e1a4934a", "score": "0.54541445", "text": "function saveAnalysis(analysis, fileName){\n //Blob object becomees downloadable text file\n var spotAnalysis = new Blob([\"//SPOT analysis file usable at https://people.ucsc.edu/~jbellik/spot/interface1.html\\n\"+\"'\"+analysis+\"'\"+\"\\n\"], {type: \"text/plain;charset=utf-8\"});\n fileName = fileName+\".SPOT\";\n //saveAs is defined at the bottom of interface1.js\n saveAs(spotAnalysis, fileName);\n //confirmation:\n document.getElementById(\"save/load-dialog\").innerHTML = \"File saved as \"+fileName+\" <br/>Press \\\"Load\\\" and choose \"+fileName+\" to load this analysis in the future.\"\n}", "title": "" }, { "docid": "ea332b1176b43881b2ae7e49195a2d6e", "score": "0.544835", "text": "function save (){\n\n}", "title": "" }, { "docid": "aa2130efcc19023f53f2aab3b961d097", "score": "0.5446851", "text": "save() {\n var fields = [\"\", \"name\", \"camera\", \"url\", \"positioning\", \"pivot\", \"x\", \"y\", \"z\", \"rx\", \"ry\", \"rz\", \"radius\", \"stl\", \"parts\"];\n\n function replacer(key, value) {\n if (value === null) {\n //console.log('ignoring undefined '+key+'('+typeof (key)+')');\n return undefined;\n }\n if (fields.includes(key))\n return value;\n // allow normal arrays (parts) to be stringified\n if (key.match('[0-9]+'))\n return value;\n //console.log('ignoring '+key+'('+typeof (key)+')');\n };\n var json = (JSON.stringify(this, replacer, 2));\n SceneExporter.saveJSON(json, this.name + \".json\");\n }", "title": "" }, { "docid": "03fd07ab28e9a904dfae2584e9af23ea", "score": "0.54358274", "text": "function autoSave() {\n let definedAxiom = false;\n angular.forEach(scope.concept.classAxioms, function(axiom){\n if(axiom.active && axiom.definitionStatus === 'FULLY_DEFINED'){\n definedAxiom = true;\n }\n });\n if(definedAxiom){\n scope.concept.definitionStatus = 'FULLY_DEFINED';\n }\n else{\n scope.concept.definitionStatus = 'PRIMITIVE';\n }\n\n if (scope.conceptHistoryPtr < scope.conceptHistory.length - 1) {\n scope.conceptHistory = scope.conceptHistory.slice(0, scope.conceptHistoryPtr + 1);\n }\n\n scope.conceptHistory.push(JSON.parse(JSON.stringify(scope.concept)));\n scope.conceptHistoryPtr = scope.conceptHistory.length - 1;\n\n scope.isModified = true;\n if (scope.isInactivation) {\n if (scope.validation && scope.validation.hasErrors) {\n notificationService.sendError('Fix errors before continuing');\n } else {\n scope.saving = false;\n scope.isModified = false;\n $rootScope.$broadcast('saveInactivationEditing', {concept: scope.concept});\n }\n }\n\n // save the modified concept\n saveModifiedConcept();\n }", "title": "" }, { "docid": "41352257d1ed25e9f515c52fdb594335", "score": "0.54234487", "text": "function saveProperty(){\r\n\t\tvar propertys=\"\";\r\n\t\tpropertys+=assemblyProperty(\"type\",document.getElementById(\"componentType\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"caption\",document.getElementById(\"autoform.caption\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"name\",document.getElementById(\"autoform.name\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"value\",document.getElementById(\"autoform.value\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"changeable\",document.getElementById(\"autoform.changeable\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"cols\",document.getElementById(\"autoform.cols\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"rows\",document.getElementById(\"autoform.rows\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"classid\",document.getElementById(\"autoform.css\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"datasrc\",document.getElementById(\"autoform.datasrc\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"maxlength\",document.getElementById(\"autoform.maxlength\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"size\",document.getElementById(\"autoform.size\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"required\",document.getElementById(\"autoform.required\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"multible\",document.getElementById(\"autoform.multible\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"list\",document.getElementById(\"autoform.list\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"url\",document.getElementById(\"autoform.url\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"para\",document.getElementById(\"autoform.para\"));\r\n\t\tpropertys+=\"|\"+assemblyProperty(\"buttontype\",document.getElementById(\"autoform.buttontype\"));\r\n\t\t\r\n\t\t\r\n\t\tpropertyValue=document.getElementById(\"propertyValue\");\r\n\t\tpropertyValue.value=propertys;\r\n\t\t\r\n\t\tvar actions=\"\";\r\n\t\tactions+=assemblyAction(\"onblue\",document.getElementById(\"autoform.onblue\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"onclick\",document.getElementById(\"autoform.onclick\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"onchange\",document.getElementById(\"autoform.onchange\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"ondblclick\",document.getElementById(\"autoform.ondblclick\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"onfocus\",document.getElementById(\"autoform.onfocus\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"onkeydown\",document.getElementById(\"autoform.onkeydown\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"onkeypress\",document.getElementById(\"autoform.onkeypress\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"onkeyup\",document.getElementById(\"autoform.onkeyup\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"onmousedown\",document.getElementById(\"autoform.onmousedown\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"onmousemove\",document.getElementById(\"autoform.onmousemove\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"onmouseout\",document.getElementById(\"autoform.onmouseout\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"onmouseover\",document.getElementById(\"autoform.onmouseover\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"onmouseup\",document.getElementById(\"autoform.onmouseup\"));\r\n\t\tactions+=\"|\"+assemblyAction(\"onselect\",document.getElementById(\"autoform.onselect\"));\r\n\t\tactionValue=document.getElementById(\"actionValue\");\r\n\t\tactionValue.value=actions;\r\n\t\t\r\n\t\t\r\n\t\tname=document.getElementById(\"autoform.name\").value;\r\n\t\tcaption=document.getElementById(\"autoform.caption\").value;\r\n\t\ttype=document.getElementById(\"componentType\").value;\r\n\t\tif(type==\"button\"){\r\n\t\t\ttype=document.getElementById(\"autoform.buttontype\").value;\r\n\t\t}\r\n\t\tvar objDest=document.getElementById(name);\r\n\t\tobjDest.innerHTML=name+\" \"+caption+\"(\"+type+\")\";\r\n\t\t\r\n\t\taction=document.getElementById(\"action\");\r\n\t\taction.value=\"designer_saveProperty\";\r\n\t\tvar formObj = new DHTMLSuite.form({ formRef:'form1',action:'../../autoform.shtml',responseEl:'debug'});\r\n\t\tformObj.submit();\r\n\t\r\n\t\t\r\n\t}", "title": "" }, { "docid": "5a79625339ac90450ce9de5e3d312c09", "score": "0.54091424", "text": "function Save(force) {\r\n\tif (checkReferences() == 0 || force == \"force\") {\r\n\tif (title == undefined) {\r\n\t\t\t title = prompt(\"Enter the title of your Mathifold document.\");\r\n\t\t}\r\n\t\tif(title!=null){\r\n\r\n\t\tvar html = document.getElementById('editor').innerHTML;\r\n\t\tdataObj = {\r\n\r\n\t\t\t\"Equations\" : JSON.stringify(Equations),\r\n\t\t\t\"References\" : JSON.stringify(References),\r\n\t\t\t\"HTML\" : html,\r\n\t\t\t\"EquationCount\" : globalEquationCount,\r\n\t\t\t\"ReferenceCount\" : referenceCount,\r\n\t\t\t\"TextReferenceCount\" : TextreferenceCount,\r\n\t\t\t\"TextReferences\" : JSON.stringify(TextReferences),\r\n\t\t\t\"FigureCount\" : figureNo,\r\n\t\t\t\"Title\" : title\r\n\t\t};\r\n\t\t\r\n\t\tpostData(\"./save.php\", dataObj);\r\n\t\t}\r\n\t} else {\r\n\t\tfixReferences(arguments.callee);\r\n\t}\r\n}", "title": "" }, { "docid": "12ea24be7240c845baf43d4fbb6f685a", "score": "0.54081273", "text": "function save() {\n\t\tif (editor) {\n\t\t\tconsole.log('saving', editor.getValue());\n\t\t\tres.setContent(editor.getValue(), true, function(status){\n\t\t\t\tif (status && status.isError) console.error('Could\\'t save Resource:', status);\n\t\t\t\telse console.log('Resource saved!');\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "5f5dc716605a62f7b91180af3bf7dbee", "score": "0.5384739", "text": "function saveClicked() {\n var ref = edgeCMS.app.database().ref().child(edgeCMS.config.namespace);\n var editableElements = document.getElementsByClassName(\"edge-cms\");\n for (i=0; i < editableElements.length; i++) {\n var keyName = editableElements[i].getAttribute(\"data-key-name\");\n var dict = {};\n var thisElement = {};\n\n // check if the element has a link and record it if necessary\n if (typeof $(editableElements[i]).attr('href') !== \"undefined\"){\n thisElement = {\n text : editableElements[i].innerHTML,\n link : $(editableElements[i]).attr('href')\n };\n }\n else{\n thisElement = {\n text : editableElements[i].innerHTML\n };\n }\n dict[keyName] = thisElement;\n ref.update(dict);\n }\n makeNotEditable();\n removeSaveButton();\n addEditButton();\n }", "title": "" }, { "docid": "59a303c8ee6f1ec93eaa1f132fdd1aa7", "score": "0.5380766", "text": "saveTheEndess(writer, xrefPos) {\n writer.write(Operators.newLine + Operators.startxref + Operators.newLine);\n writer.write(xrefPos.toString() + Operators.newLine);\n writer.write(Operators.eof + Operators.newLine);\n }", "title": "" }, { "docid": "3b95b68f98085f78f1672035db882742", "score": "0.53712296", "text": "save() { return this.writeTo(this.path); }", "title": "" }, { "docid": "bb1406fb5deb374377c54623cc80bee6", "score": "0.53706414", "text": "function save(){\n \n }", "title": "" }, { "docid": "3a6782599729948bdf7afe189f363dd8", "score": "0.536619", "text": "save() {\n // call our confirm function with the file name and mode\n this['confirm'](this['fileName'], this['mode']);\n this.close_();\n }", "title": "" }, { "docid": "d8110b5c3b671a27edba85cf84676052", "score": "0.535668", "text": "doSaveObject(obj, reference, writer) {\n let correctPosition = writer.length;\n writer.write(reference.objNumber.toString());\n writer.write(Operators.whiteSpace);\n writer.write(reference.genNumber.toString());\n writer.write(Operators.whiteSpace);\n writer.write(Operators.obj);\n writer.write(Operators.newLine);\n obj.save(writer);\n let stream = writer.stream;\n writer.write(Operators.endObj);\n writer.write(Operators.newLine);\n }", "title": "" }, { "docid": "6fc7f22abd7ffb20a8ec2f0e7a742020", "score": "0.5355383", "text": "function save() {\n var save = {\n parts: parts,\n knowledge: knowledge,\n enemy: enemy,\n scana: scana,\n able: able,\n trfix: trfix,\n updc: updc,\n uphc: uphc,\n updl: updl,\n uphl: uphl,\n speedupc: speedupc,\n //\n toyrobots: toyrobots,\n teacherbots: teacherbots,\n mechacockroach: mechacockroach,\n mechamantis: mechamantis,\n mechawolf: mechawolf,\n mechagorilla: mechagorilla,\n cyborgdolphin: cyborgdolphin,\n cyborgparrot: cyborgparrot,\n cyborgchimpanzee: cyborgchimpanzee,\n cyborghuman: cyborghuman,\n //\n fightertoyrobot: fightertoyrobot,\n //\n wrench: wrench,\n fix: fix,\n jetpacks: jetpacks,\n eyeglasses: eyeglasses,\n language: language,\n engineering: engineering,\n boxing: boxing,\n scanner: scanner,\n overdrive: overdrive\n };\n localStorage.setItem(\"save\", JSON.stringify(save));\n}", "title": "" }, { "docid": "0e6fa22b16a896f0566e879e4781b1f5", "score": "0.5351031", "text": "function onSaveClick(ev) {\n // TODO...\n }", "title": "" }, { "docid": "41ed95e3f4b53f14af130a10b6bf0358", "score": "0.53481495", "text": "function saveScript()\n{\n\tif(currentItem<0)\n\t{\n\t\treturn;\n\t}\n\tvar item = objectlist[currentItem];\n\titem.source = window.btoa(editor.getValue());\n\titem.name = document.getElementById(\"nameProperty\").value;\n\titem.description = document.getElementById(\"decriptionProperty\").value;\n\t// saveAjax.send(\"http://constructivedamage.xyz/cd/luascripts/?\"+JSON.stringify(item));\n\tnew Ajax.request({\n\t\turl: 'luascripts',\n\t\tmethod: 'post',\n\t\tdata: item,\n\t\tsuccess: ajaxHandleSave\n\t}).send();\n}", "title": "" }, { "docid": "8f9edc317dca2d49aa7b5a4954b09a30", "score": "0.5341712", "text": "function save(result,res,uri,c,obj){\n \n if (res==503) { //if the server is currently unable to handle the request we try again until its done \n abs(uri,c,obj,save); \n }\n else{\n obj.Resources[c]['@abstract']=result; // if its ok\n\n fs.writeFile(\"json_files/olympic_2004.json\",JSON.stringify(obj), function(err) { // we save the json file containing the input text, the \n if(err) { // annotated entities and the abstracts for those \n return console.log(err); // entities at the folder \"json_files\"\n };\n });\n };\n}", "title": "" }, { "docid": "dbf4bfcc37822298572733086a30f4f5", "score": "0.533487", "text": "function exportDoc(self){\n\t\tvar file = new Blob([self.state.curDoc.getContent()], {type: self.state.curDoc.getMode()+\";charset=UTF-8\"});\n\t\twindow.saveAs(file, self.state.curDoc.getName());\n\t}", "title": "" }, { "docid": "94680d2cbf682ce12f34ddd31ed2881d", "score": "0.53318393", "text": "function saveCanvas() {\r\n var sor = new SOR();\r\n sor.objName = \"model\";\r\n sor.vertices = g_points;\r\n sor.indexes = [];\r\n for (i = 0; i < g_points.length/3; i++)\r\n sor.indexes.push(i);\r\n console.log(sor.indexes);\r\n saveFile(sor);\r\n}", "title": "" }, { "docid": "a225c4113972426357e0902ea7b6543f", "score": "0.5330413", "text": "handleSave() {\n const { editor, target } = this;\n const code = this.getCodeViewer().getContent();\n target.set(keyCustomCode, code);\n target.trigger(`change:${keyCustomCode}`);\n var nestedComp = getAllComponents(target);\n if (nestedComp.length > 0) {\n $(nestedComp).each(function (index, value) {\n value.set({ removable: false, draggable: false, droppable: false, badgable: false, stylable: false, highlightable: false, copyable: false, resizable: false, layerable: false, selectable: false, editable: false, hoverable: false });\n });\n }\n editor.Modal.close();\n }", "title": "" }, { "docid": "9bd07beb0d0ab11cb7de99c95230a2ab", "score": "0.53300875", "text": "function main_saveSettings(){\r\n\r\n\t// Save options in the PSD\r\n\tvar instructionsArray = String(origDocRef.info.instructions).split(INSTRUCTIONS_SPLIT_TOKEN);\r\n\tvar originalInstructions = String(instructionsArray[0]).trim();\r\n\tvar originalSavedSettings = String(instructionsArray[1]).trim();\r\n\r\n\t// Generate JSON\r\n\tvar newSettingsString = JSON.stringify(exportInfo);\r\n\r\n\t// If nothing is changed, don't update the file\r\n\tif ( newSettingsString == originalSavedSettings || !newSettingsString ) return;\r\n\r\n\tLog.notice('Saving settings in METADATA: ' + newSettingsString);\r\n\tvar newInstructionsArray = new Array();\r\n\tnewInstructionsArray.push(originalInstructions);\r\n\tnewInstructionsArray.push(INSTRUCTIONS_SPLIT_TOKEN);\r\n\tnewInstructionsArray.push(newSettingsString);\r\n\tvar newInstructionsString = newInstructionsArray.join(\"\\n\\n\");\r\n\torigDocRef.info.instructions = newInstructionsString;\r\n\r\n}", "title": "" }, { "docid": "d216a33c2ccd1fe89ef2a99b5a8de124", "score": "0.53237957", "text": "goSave() {\n this.setMode('save');\n }", "title": "" }, { "docid": "6787cf827eef180c8e696fa62ca2933a", "score": "0.53185636", "text": "function menuSaveClick(event) {\n // console.log('menuSaveClick');\n\n event.preventDefault();\n\n let diagramTitle = decodeURIComponent(PageData.Filename);\n diagramTitle = Common.customPrompt('Save diagram as:', diagramTitle);\n\n if (!diagramTitle) return;\n\n let storageKey = Date.now().toString();\n\n const svgXml = SvgModule.getSvgXml();\n const svgObject = { Title: diagramTitle, SvgXml: svgXml };\n const jsonData = JSON.stringify(svgObject);\n localStorage.setItem(storageKey, jsonData);\n}", "title": "" }, { "docid": "3079cb38448411854ad5f5861b92ce91", "score": "0.53089184", "text": "function savedoc(mode) {\r\n\r\n //called from saverecord_onclick()\r\n if (!mode)\r\n mode = 'SAVE'\r\n\r\n //first update the current field\r\n //otherwise the db is updated without the last entry!!!\r\n if (!validateupdate())\r\n return false\r\n\r\n if (gKeyNodes && (!gchangesmade || !glocked) && !gallowsavewithoutchanges) {\r\n neosysinvalid('Nothing to be saved.\\r\\rPlease enter or change some data first or just click Close')\r\n return false\r\n }\r\n\r\n //return saveandorcleardoc(mode,save=true,clear=false)\r\n return saveandorcleardoc(mode)\r\n\r\n}", "title": "" }, { "docid": "726689c7954bc87e71ea85d9fdff259c", "score": "0.5308604", "text": "function SaveFile()\n{\n\tif( dirty )\n\t{\n\t\tvar txt = edit.GetText();\n\t\ttxt = txt.replace( RegExp( \"\\u00A0\",\"gim\"), \" \" ); //Replace nbsp with normal space.\n\t\tapp.WriteFile( appPath+\"/\"+curProgram+\"/\"+ curFileTitle, txt );\n\t\tdirty = false;\n\t}\n\tlastCursorPos[curFileTitle] = edit.GetCursorPos();\n}", "title": "" }, { "docid": "863c978cc38d6d4a0e2790e72a6ff504", "score": "0.5300007", "text": "function save() {\n\n writeFile(trip);\n}", "title": "" }, { "docid": "3b3241f31b6f7cea8c8307dec5cd7e6b", "score": "0.5277015", "text": "function editor() {\n var a = '<button class=\"edit\" onclick=\"save()\">' +\n ' Save ' +\n '<i class=\"fa fa-floppy-o\" aria-hidden=\"true\">' +\n\n '</i>' +\n '</button>';\n\n document.getElementById('edit').innerHTML = a;\n document.getElementById('heading').readOnly = false;\n document.getElementById('contentbox').readOnly = false;\n\n\n}", "title": "" }, { "docid": "bcd485efd2bc258965366533b3fde03f", "score": "0.52704906", "text": "function saveOBJ( scene, name ){\n var exporter = new THREE.OBJExporter();\n var objString = exporter.parse( scene );\n \n var blob = new Blob([objString], {type: 'text/plain'});\n \n\n function saveTextAsFile(blob, name) {\n var textToSaveAsURL = window.URL.createObjectURL(blob);\n\t\n var downloadLink = document.createElement(\"a\");\n downloadLink.download = name;\n downloadLink.innerHTML = \"Download File\";\n downloadLink.href = textToSaveAsURL;\n downloadLink.onclick = destroyClickedElement;\n downloadLink.style.display = \"none\";\n document.body.appendChild(downloadLink);\n\t\n downloadLink.click();\n }\n\n function destroyClickedElement(event) {\n document.body.removeChild(event.target);\n }\n saveTextAsFile(blob, name + '.obj');\n}", "title": "" }, { "docid": "e6372144e62e7b4780b906a07d0d65d9", "score": "0.5229306", "text": "static write() {\n let json = {};\n let jsonObjs = {};\n for (let id in this.kb) {\n jsonObjs[id] = this.kb[id];\n }\n json[Utils.numToString(TitleSettingKind.KeyboardAssigment)] = jsonObjs;\n json[Utils.numToString(TitleSettingKind.Language)] = this.currentLanguage;\n IO.saveFile(Paths.FILE_SETTINGS, json);\n }", "title": "" }, { "docid": "32c48cc83382d925af270a7ac532f2a1", "score": "0.5221866", "text": "function saveEdited(){\n\tactiveDataSet = studentList.find( arr => arr.absenceId == activeElement ); \n\txhttp.open(\"POST\", \"?type=editabsence&console&aid=\"+activeDataSet['absenceId']\n\t+\"&id=\"+activeElement\n\t+\"&start=\"+formatDateDash(document.getElementById('esickstart').value)\n\t+\"&end=\"+formatDateDash(document.getElementById('esickend').value)\n\t+\"&ecomment=\"+document.getElementById('ecomment').value\n\t+\"&evia=\"+document.querySelector('input[name=\"evia\"]:checked').value, true);\n\txhttp.send();\t\n}", "title": "" }, { "docid": "fbfd3632b8e90e1bf90e888ef677d4a6", "score": "0.52188396", "text": "function saveToText() {}", "title": "" }, { "docid": "e77732f400d4d51ae57bc92b66de1e1f", "score": "0.52184093", "text": "function save() {\n vm.page.saveButtonState = 'busy';\n vm.partialViewMacro.content = vm.editor.getValue();\n contentEditingHelper.contentEditorPerformSave({\n saveMethod: codefileResource.save,\n scope: $scope,\n content: vm.partialViewMacro,\n rebindCallback: function rebindCallback(orignal, saved) {\n }\n }).then(function (saved) {\n // create macro if needed\n if ($routeParams.create && $routeParams.nomacro !== 'true') {\n macroResource.createPartialViewMacroWithFile(saved.virtualPath, saved.name).then(function (created) {\n navigationService.syncTree({\n tree: 'macros',\n path: '-1,new',\n forceReload: true,\n activate: false\n });\n completeSave(saved);\n }, Utilities.noop);\n } else {\n completeSave(saved);\n }\n }, function (err) {\n vm.page.saveButtonState = 'error';\n localizationService.localize('speechBubbles_validationFailedHeader').then(function (headerValue) {\n localizationService.localize('speechBubbles_validationFailedMessage').then(function (msgValue) {\n notificationsService.error(headerValue, msgValue);\n });\n });\n });\n }", "title": "" }, { "docid": "f63342c5c96edeeadbb1aab568407561", "score": "0.52146393", "text": "function saveGame() {\n emit('saveundo');\n bak = getState();\n state.undo_enable = true;\n }", "title": "" }, { "docid": "ab4a766cead02838cd2dcdd8ca82ba3e", "score": "0.52006197", "text": "function saveFile() {\n var session = IDE.sessionTabView.getActiveSession();\n if (session)\n session.persist();\n }", "title": "" }, { "docid": "77084129ffb1cbf4a46ba8f681f6e7c5", "score": "0.51984", "text": "function save()\n{\n\n}", "title": "" }, { "docid": "6eb02e470d40e8edc6744eff1d8e046f", "score": "0.519624", "text": "function save(){\n\tif(current_file !== \"welcome\"){\n\t\tvar content = editor().getValue();\n\t\tif(typeof content !== \"undefined\"){ //if nothing is \"null\"\n\t\t\tif(cloud_use === \"drive\"){\n\t\t var contentArray = new Array(content.length);\n\t\t for (var i = 0; i < contentArray.length; i++) {\n\t\t contentArray[i] = content.charCodeAt(i);\n\t\t }\n\t\t var byteArray = new Uint8Array(contentArray);\n\t\t var blob = new Blob([byteArray], {type: 'text/plain'}); //this is the only way I could get this to work\n\t\t var request = gapi.client.drive.files.get({'fileId': current_file});//gets the metadata, which is left alone\n\t\t\n\t\t \n\t\t request.execute(function(resp) {\n\t\t drive.updateFile(current_file,resp,blob, function(resp){\n\t\t\t manager.setSaveState(resp.id, true)\n\t\t\t });\n\t\t });\n\t\t }\n\t\t else if(cloud_use === \"sky\"){\n\t\t\t sky.updateFile(current_file, content, function(resp){\n\t\t\t\t console.log(resp);\n\t\t\t });\n\t\t }\n\t }\n\t}\n}", "title": "" }, { "docid": "5357aa7f3eb49966deae3ed506f83178", "score": "0.5192956", "text": "function save(mot)\n{\n\tif (mot==\"-\")\n\t{\n\t\tmot = \"\";\n\t\tdocument.info.zonetexte.value=document.info.zonetexte.value+mot;\n\t}\n\telse if (mot==\"\\n\")\n\t\tdocument.info.zonetexte.value=document.info.zonetexte.value+mot;\n\telse\n\t\tdocument.info.zonetexte.value=document.info.zonetexte.value+mot+\" \";\n}", "title": "" }, { "docid": "1e782e8493cf8443843412f543b655d8", "score": "0.5188182", "text": "function saveWithDialog() {\n return FileSystem.pathType(realComponent)\n .then(function(type) {\n var index = realComponent.lastIndexOf('/');\n var openAt;\n\n // Get a reasonable location to open the dialog at.\n if (realComponentType === 'directory') openAt = realComponent;\n else if (realComponentType === 'file') openAt = realComponent.slice(0, index);\n else openAt = buffer.filepath || null;\n\n // Show the save dialog, and get the user's selection.\n return FileSystem.showSaveDialogue(openAt, title)\n .then(function(selection) {\n return FileSystem.writeFile(selection, buffer.text)\n .then(function() {\n buffer.setFilepath(selection);\n });\n });\n });\n }", "title": "" }, { "docid": "bd9537e9edd17e9dff54248d04b6e65a", "score": "0.51877034", "text": "saveGraphicsState() {\n this.writeOperator(Operators.saveState);\n }", "title": "" }, { "docid": "01a173cf630e143706c9d7b01f600d77", "score": "0.5174139", "text": "function openDocument() {\n//a3936\nif (__YY__.S('a3936', arguments)) {debugger;}\n if (checkLocalStorage()) {\n if (myDiagram.isModified) {\n var save = confirm(\"Would you like to save changes to \" + getCurrentFileName() + \"?\");\n if (save) {\n saveDocument();\n }\n }\n openElement(\"openDocument\", \"mySavedFiles\");\n }\n}", "title": "" }, { "docid": "2f0ecae89bc549be35b92ed580aef36d", "score": "0.51511735", "text": "function saveProject() {\n var fileName = `${getValue('lpe-file-name')}.lpe`;\n\n // create file content\n var content = getProjectData();\n\n //set download link\n var linkHolder = document.getElementById('save-project-link-holder');\n\n linkHolder.href = 'data:text/plain;charset=utf-8,' + encodeURIComponent(content);\n linkHolder.download = fileName;\n linkHolder.click();\n\n ga('send', 'event', 'Pixel Editor Save', selectedPalette, canvasSize[0]+'/'+canvasSize[1]); /*global ga*/ \n}", "title": "" }, { "docid": "fe4a69cfb8353beb6e49cb069cc72fc9", "score": "0.5150023", "text": "function save(){\n app.activeDocument.name = \"overlayed-image-\" + i;\n var Name = app.activeDocument.name;\n var psdsaveFile = File(psdoutputFolder + \"/\" + Name +\".psd\");\n var pngsaveFile = File(pngoutputFolder + \"/\" + Name +\".png\");\n SavePSD(psdsaveFile);\n SavePNG(pngsaveFile);\n }", "title": "" }, { "docid": "d65e7964e44b98db0eca02ca2c1fba06", "score": "0.51465076", "text": "saveTab() {\n fs.writeFileSync(\n this.state.previousPaths[this.state.previousPaths.length - 1],\n this.state.openTabs[\n this.state.previousPaths[this.state.previousPaths.length - 1]\n ].editorValue,\n { encoding: \"utf8\" }\n );\n }", "title": "" }, { "docid": "46c000c7ef99dc982c807a07430d3749", "score": "0.51436895", "text": "function saveFile() {\n const wrapperArray = [];\n const title = localStorage.getItem('activeFile');\n const element = document.getElementById('mainTextArea');\n const content = element.value;\n wrapperArray[0] = title;\n wrapperArray[1] = content;\n wrapperArray[2] = JSON.stringify(indentLog);\n if (localStorage.getItem('activeFile') !== 'Unnamed File') {\n localStorage.setItem(`saveFile:${localStorage.getItem('activeFile')}`, JSON.stringify(wrapperArray));\n } else {\n localStorage.setItem('Unnamed File', JSON.stringify(wrapperArray));\n }\n}", "title": "" }, { "docid": "451ea6fa11ec7061897ce6b4c654b9dc", "score": "0.5143295", "text": "public function Save(path : String) {\n \t\tvar serializer : XmlSerializer = new XmlSerializer(SaveAndLoad);\n \t\tvar stream : Stream = new FileStream(path, FileMode.Create);\n \t\tserializer.Serialize(stream, this);\n \t\tstream.Close();\n \t}", "title": "" }, { "docid": "4d33e9484a9f4a0ab1fb1cb37cf542a0", "score": "0.51423407", "text": "function save() {\n table.rows[rIndex].cells[2].innerHTML = document.getElementById(\n \"data-type-output\"\n ).value;\n}", "title": "" }, { "docid": "105e82d56e575cb9ccb0df6ce63ff5fa", "score": "0.5133652", "text": "function saveNote() {\n var notes = getNotes();\n\n if (currentIndex !== null) {\n notes[currentIndex] = editorField.value;\n } else {\n notes.push(editorField.value);\n }\n\n addStorage(notes);\n\n clearEditor();\n showNotes();\n tau.changePage(mainPageId);\n }", "title": "" }, { "docid": "e8e3c3673c61b7780b68cf94c964dceb", "score": "0.51333076", "text": "function saveNovelToFile(novel_code) {\r\n let novel = dl_data.novels.filter(novel => novel.code_name == novel_code)[0];\r\n let json = JSON.stringify(novel, null, 4);\r\n let blob = new Blob([json], {type: \"text/plain;charset=utf-8\"});\r\n saveAs(blob, `${novel.code_name}.nov.json`);\r\n}", "title": "" }, { "docid": "0d1c48727f2359cfd1c8e005922fc73e", "score": "0.51271045", "text": "export () {\n let parser = new DOMParser();\n let serializer = new XMLSerializer();\n let data = parser.parseFromString(emptyFile, \"application/xml\");\n if (typeof (model.activeDiagram) === \"undefined\") {\n return serializer.serializeToString(data);\n }\n // fill the file\n data.children[0].appendChild(model.activeDiagram.cloneNode(true));\n let allDiagramObjects = model.getTargets(\n [model.activeDiagram],\n \"Diagram.DiagramElements\");\n for (let diagramObject of allDiagramObjects) {\n data.children[0].appendChild(diagramObject.cloneNode(true));\n }\n let allEquipments = model.getTargets(\n allDiagramObjects,\n \"DiagramObject.IdentifiedObject\");\n for (let equipment of allEquipments) {\n data.children[0].appendChild(equipment.cloneNode(true));\n }\n let allDiagramObjectPoints = model.getTargets(\n allDiagramObjects,\n \"DiagramObject.DiagramObjectPoints\");\n for (let diagramObjectPoint of allDiagramObjectPoints) {\n data.children[0].appendChild(diagramObjectPoint.cloneNode(true));\n }\n let allTerminals = model.getTerminals(allEquipments);\n for (let terminal of allTerminals) {\n data.children[0].appendChild(terminal.cloneNode(true));\n }\n let allNodes = model.getNodes();\n for (let node of allNodes) {\n data.children[0].appendChild(node.cloneNode(true));\n }\n let allEqContainers = model.getLinkedObjects(\n [\"cim:Substation\", \"cim:Line\"],\n [\"EquipmentContainer.Equipments\"]);\n let allSubstations = allEqContainers[\"cim:Substation\"];\n for (let substation of allSubstations) {\n data.children[0].appendChild(substation.cloneNode(true));\n }\n let allLines = allEqContainers[\"cim:Line\"];\n for (let line of allLines) {\n data.children[0].appendChild(line.cloneNode(true));\n }\n let allBaseVoltages = model.getTargets(\n allEquipments,\n \"ConductingEquipment.BaseVoltage\");\n for (let baseVoltage of allBaseVoltages) {\n data.children[0].appendChild(baseVoltage.cloneNode(true));\n }\n let allTrafoEnds = model.getTargets(\n allEquipments,\n \"PowerTransformer.PowerTransformerEnd\");\n for (let trafoEnd of allTrafoEnds) {\n data.children[0].appendChild(trafoEnd.cloneNode(true));\n }\n // TODO: measurements can also be tied to power system resources\n // (e.g. busbars), not only terminals\n let allMeasurements = model.getTargets(\n allTerminals,\n \"ACDCTerminal.Measurements\");\n for (let measurement of allMeasurements) {\n data.children[0].appendChild(measurement.cloneNode(true));\n }\n let allAnalogValues = model.getTargets(\n allMeasurements,\n \"Analog.AnalogValues\");\n for (let analogValue of allAnalogValues) {\n data.children[0].appendChild(analogValue.cloneNode(true));\n }\n\n let sXML = serializer.serializeToString(data);\n return sXML;\n }", "title": "" }, { "docid": "f84c51cabcec56bd114759e6d2990d2a", "score": "0.51252145", "text": "function saveSOR(){\n indices[4999]=numOfIndex;\n //console.log(numOfVertsC);\n indices[4998]=numOfVertsC;\n var p = prompt(\"Please enter your file name\", \"temperooni\");\n\n if (p != null) {\n document.getElementById(\"fileName\").innerHTML =p;\n }\n\n saveFile(new SOR(p, cVert, indices));\n}", "title": "" }, { "docid": "c1387345dd15fef9e9f8bdcb63b919f5", "score": "0.51236784", "text": "function saveupdate()\n{\n document.execCommand(\"SaveAs\")\n\n}", "title": "" }, { "docid": "a56a39d72a350d064b9ae03ae57383df", "score": "0.5107777", "text": "function save_quiz2() : void {\n // Build decoded_3et so that it contains the new exercise\n\n decoded_3et.desc = ckeditor.val();\n\n decoded_3et.selectedPaths = [];\n\n for (let i=0; i<checked_passages.length; ++i) {\n let r = $(checked_passages[i]).data('ref');\n if (r!='')\n decoded_3et.selectedPaths.push(r);\n }\n\n decoded_3et.maylocate = $('#maylocate_cb').prop('checked');\n decoded_3et.sentbefore = $('#sentbefore').val();\n decoded_3et.sentafter = $('#sentafter').val();\n decoded_3et.fixedquestions = +$('#fixedquestions').val(); // Convert to number\n decoded_3et.randomize = $('#randomorder').prop('checked');\n if (!(decoded_3et.fixedquestions>0))\n decoded_3et.fixedquestions = 0; // Non-positive or NaN\n\n decoded_3et.sentenceSelection = panelSent.getInfo();\n decoded_3et.quizObjectSelection = panelSentUnit.getInfo();\n decoded_3et.quizFeatures = panelFeatures.getInfo();\n\n // The HTML form contains the directory, the filename and the exercise as a JSON string\n let form : JQuery = $(`<form action=\"${submit_to}\" method=\"post\">\n <input type=\"hidden\" name=\"dir\" value=\"${encodeURIComponent(dir_name)}\">\n <input type=\"hidden\" name=\"quiz\" value=\"${encodeURIComponent(quiz_name)}\">\n <input type=\"hidden\" name=\"quizdata\" value=\"${encodeURIComponent(JSON.stringify(decoded_3et))}\">\n </form>`);\n\n $('body').append(form);\n\n isSubmitting = true;\n form.submit();\n}", "title": "" }, { "docid": "c87bb9e30da52f8d73079d5ffd4f1f94", "score": "0.5105795", "text": "function saveScript(script)\n{\n\tif (!script)\n\t\treturn;\n\n\tscript.name = textboxScriptName.value;\n\tscript.contents = textboxCommands.value;\n}", "title": "" }, { "docid": "0c636beab53d8f59d8325291686a1802", "score": "0.5092766", "text": "function saveBlock() {\n var xml = Blockly.Xml.workspaceToDom(workspace);\n var xml_text = Blockly.Xml.domToPrettyText(xml)\n\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(xml_text));\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": "e0d85c639b560fd92b89d7afa492e5b2", "score": "0.5091033", "text": "function save() {\n window.localStorage.setItem(\"save\", JSON.stringify(Save));\n}", "title": "" }, { "docid": "50a847c18d648a0353c37439cd0cdfe0", "score": "0.50819254", "text": "function saveEdit() {\n var index = $('.editArea').data('editIndex');\n var newName = $('.editName').val();\n\n var names = getNames();\n\n names[index] = newName;\n\n writeNames(names);\n renderNames(names);\n cancelEdit();\n}", "title": "" }, { "docid": "540e0dbccc2687d934155888c20604fe", "score": "0.5078512", "text": "function doSaveDocument() {\n var presenter = new mindmaps.SaveDocumentPresenter(eventBus,\n mindmapModel, new mindmaps.SaveDocumentView(), autosaveController, filePicker);\n presenter.go();\n }", "title": "" }, { "docid": "d9dce37306e70e8801586b1c6f6f30b7", "score": "0.5077584", "text": "function DFA_SAVE () {\n if ( !JSON ) {\n console.log( \"Seu navegador não é suportado.\" );\n return;\n }\n\n var tuplaDesigner = {\n 'nodes': [],\n 'links': []\n };\n var i;\n // NODEs\n for ( i in nodes ) {\n // um NODE dos NODES\n var node = nodes[ i ];\n var designerNode = {\n 'x' : node.x,\n 'y' : node.y,\n 'text' : node.text,\n 'isAcceptState': node.isAcceptState\n };\n tuplaDesigner.nodes.push( designerNode );\n }\n\n // LINKs\n for ( i in links ) { // Uma transicao dos links\n var link = links[ i ];\n\n var designerLink = null;\n if ( link instanceof SelfLink ) { // transicao para ele msm\n designerLink = {\n 'type' : 'SelfLink',\n 'node' : nodes.indexOf( link.node ),\n 'text' : link.text,\n 'anchorAngle': link.anchorAngle\n };\n } else if ( link instanceof StartLink ) { // transicao inicial\n designerLink = {\n 'type' : 'StartLink',\n 'node' : nodes.indexOf( link.node ),\n 'text' : link.text,\n 'deltaX': link.deltaX,\n 'deltaY': link.deltaY\n };\n } else if ( link instanceof Link ) { // transicao de nodeA para nodeB\n designerLink = {\n 'type' : 'Link',\n 'nodeA' : nodes.indexOf( link.nodeA ),\n 'nodeB' : nodes.indexOf( link.nodeB ),\n 'text' : link.text,\n 'lineAngleAdjust' : link.lineAngleAdjust,\n 'parallelPart' : link.parallelPart,\n 'perpendicularPart': link.perpendicularPart\n };\n }\n if ( designerLink != null ) {\n tuplaDesigner.links.push( designerLink );\n }\n }\n\n // Designer do DFA\n document.getElementById( \"DFAdesign\" ).value = JSON.stringify( tuplaDesigner );\n\n // Dados do DFA\n document.getElementById( \"DFAdados\" ).value = \"\";\n\n // Tipo de submissao\n document.getElementById( \"tipoDeSubmissao\" ).value = \"salvar\";\n\n // Mostra no campo <pre>\n document.getElementById( \"DFAdesign_pre\" ).innerHTML = JSON.stringify( tuplaDesigner );\n document.getElementById( \"DFAdados_pre\" ).innerHTML = \"\";\n document.getElementById( \"erros\" ).className = 'hidden';\n\n return true;\n}", "title": "" }, { "docid": "d9ece972f0721b36e4e95ecaac93522d", "score": "0.5076982", "text": "save(writer) {\n if (typeof this.cmapBeginSave !== 'undefined') {\n this.onCmapBeginSave();\n }\n if (typeof this.fontProgramBeginSave !== 'undefined') {\n this.onFontProgramBeginSave();\n }\n let data = '';\n for (let i = 0; i < this.data.length; i++) {\n data = data + this.data[i];\n }\n if (data.length > 1 && !this.isImage && !this.isFont) {\n data = 'q\\r\\n' + data + 'Q\\r\\n';\n }\n data = this.compressContent(data, writer);\n let length = data.length;\n this.items.setValue(this.dictionaryProperties.length, new PdfNumber(length));\n super.save(writer, false);\n writer.write(this.dicPrefix);\n writer.write(Operators.newLine);\n if (data.length > 0) {\n writer.write(data);\n }\n writer.write(Operators.newLine);\n writer.write(this.dicSuffix);\n writer.write(Operators.newLine);\n }", "title": "" }, { "docid": "fb510329e998456c254220e116a20fda", "score": "0.50736207", "text": "function saveGame() {\n let gameboard = document.getElementById(\"gameboard\")\n writeToLS(\"Save\", gameboard.innerHTML)\n}", "title": "" }, { "docid": "1eff1ad88e59325128ed254883ed4e97", "score": "0.5072754", "text": "function save() {\n fs.writeFileSync(doc, JSON.stringify(docd.data), \"utf8\");\n docd.saveTimer = null;\n }", "title": "" }, { "docid": "9de291eaecc519ca5ae1ab0e04f9ba29", "score": "0.5067635", "text": "@action\n async save() {\n let graph = this.args.graph;\n if (!graph) {\n graph = this.args.subject.doc();\n }\n\n let statements = [];\n for (let [_, form] of Object.entries(this.forms)) {\n const predObj = form.model;\n // this.sanitizePredObj(predObj);\n let objectVal = predObj.object;\n\n if (predObj.objType === \"Resource\") {\n objectVal = predObj.objVocab + objectVal;\n }\n\n let statement = this.composeStatement({\n subject: this.args.subject,\n predicate: predObj.predVocab + predObj.predicate,\n object: objectVal,\n graph: graph,\n objType: predObj.objType\n });\n if (statement) {\n statements.push(statement);\n }\n }\n await this.storeCommunicator.store.update([], statements);\n await Promise.all(statements.map(stmt => this.args.onCreate(stmt)));\n this.args.onClose();\n\n }", "title": "" }, { "docid": "e7b0799c43c6f456b7e8533f0e7dbf3c", "score": "0.50621396", "text": "function exportFileToAI (dest) {\n\tif ( app.documents.length > 0 ) {\n\t\tvar saveOptions = new IllustratorSaveOptions();\n\t\tvar ai8Doc = new File(dest);\n\t\tsaveOptions.compatibility = Compatibility.ILLUSTRATOR8;\n\t\tsaveOptions.flattenOutput = OutputFlattening.PRESERVEAPPEARANCE;\n\t\tapp.activeDocument.saveAs( ai8Doc, saveOptions );\n\t}\n}", "title": "" }, { "docid": "4ec80ae494a9a0a3753033cf4c27008d", "score": "0.5061123", "text": "function editSave(feature) {\r\n var editedFeature = F_.clone(feature)\r\n editedFeature.properties.name = $('#sketchToolEditName').val()\r\n editedFeature.properties.description = $('#sketchToolEditDescription').val()\r\n if (SketchTool.lastEditedGeometry != null)\r\n editedFeature.geometry = SketchTool.lastEditedGeometry\r\n var newColor = F_.rgb2hex($('#sketchToolEditColor').css('background-color'))\r\n editedFeature.properties.fill = newColor\r\n if (editedFeature.geometry.type.toLowerCase() == 'multilinestring') {\r\n editedFeature.properties.stroke = newColor\r\n }\r\n SketchTool.lastEditedGeometry = null\r\n editedFeature = F_.geojsonAddSpatialProperties(editedFeature)\r\n writetoPolygonGeoJSON('replace', feature, editedFeature)\r\n}", "title": "" }, { "docid": "da0ac4efbdc9620bfd56b41a776c43e4", "score": "0.5059952", "text": "save(writer) {\n writer.write(this.boolToStr(this.value));\n }", "title": "" }, { "docid": "b807d7fd2a9c41e5a4784b9ac5786852", "score": "0.5053066", "text": "function saveCurrentDocument(documentModel) {\n \ttry{\n \t\tdocumentModel.history_object = $.extend({}, document.hisotry_object, jambi.getJambiEditor().getHistory());\n \t\tdocumentModel.text = jambi.getJambiEditor().getValue();\n \t\tdocumentModel.line = jambi.getJambiEditor().getCursor().line;\n \t\tdocumentModel.col = jambi.getJambiEditor().getCursor().ch;\n \t\tdocumentModel.mode = jambi.getJambiEditor().getOption('mode');\n\t\t} catch(e) {\n\n\t\t}\n\t}", "title": "" }, { "docid": "7f3b3a532fdf874747af55a4327e2748", "score": "0.50513357", "text": "function savePolygon() {\n save(\"polygon\", polygonGJSON);\n}", "title": "" }, { "docid": "3965c99aafe0c635b2a555357a86cc37", "score": "0.50469255", "text": "function saveAs() {\n //var g = createGraphJSON(\"testGraph\");\n mindMap_name = prompt(\"Creating new Mindmap... What is the name?\");\n if (mindMap_name == null)\n {\n return;\n }\n currentMindMap.label = mindMap_name;\n var result = ref.push(currentMindMap, dataSent);\n console.log(\"currentMindMap in saveMindMap(): \");\n console.log(currentMindMap);\n console.log(result.key);\n\n}", "title": "" }, { "docid": "deeb7a08843dd9bb2f857d9e3612c460", "score": "0.50413764", "text": "function saveSketch(){\n\t//code to save the above object somewhere\n\t// console.log(curSketch.thumbnail);\n\tvar sk = cloneObject(curSketch);\n\tsk.objects = sk.objects.concat(sk.tempObj);\n\tsk.tempObj = new Array();\n\tsk.delObjects = new Array();\n\tif(sk.name == \"None\"){\n\t\tsk.name = getNewName();\n\t\tcurSketch.name = sk.name;\n\t}\n\t\n\tstrSketch = JSON.stringify(sk);\n\t\n\t$.post(\"actions.php\",\n {\n action: \"save\",\n sketch: strSketch\n },\n function(data, status){\n\t\tvar data_packet = null;\n\t\ttry{\n\t\t\tdata_packet = JSON.parse(data);\n\t\t\treportError(data_packet);\n\t\t\thelpText.html(data_packet.message + '\"'+data_packet.sketch_name+'\"');\n\n\t\t\t//now printing debug messages if any\n\t\t\t// console.log(data_packet.debug);\n\t\t}catch(e){\n\t\t\tconsole.log(e);\n\t\t\tconsole.log(data);\n\t\t}\n });\n}", "title": "" }, { "docid": "10c4aa8624f942c49e92fc5a71754f62", "score": "0.5035394", "text": "function saveQuestion(question) {\n inquirer.prompt({\n type: 'confirm',\n name: 'save',\n message: 'Do you want to save this question?'\n }).then( (data) => {\n if(data.save) question.save();\n builderMenu();\n })\n}", "title": "" }, { "docid": "41a0057cc2aef5cb2ed6a740aa28eb93", "score": "0.502637", "text": "save() {\n let id = this.getAttribute(\"my-id\");\n \n //Save the value in the text area of the note to the note.\n let noteText = document.querySelector(\"#note_\" + id + \"_text\");\n let noteContent = noteText.value;\n let newNoteText = document.createElement(\"p\");\n newNoteText.setAttribute(\"id\", \"note_\" + id + \"_text\");\n newNoteText.innerText = noteContent;\n noteText.parentNode.replaceChild(newNoteText, noteText);\n\n //Save the value of the title to the note.\n let title = document.querySelector(\"#note_\" + id + \"_title\");\n let titleText = title.value;\n let newTitle = document.createElement(\"h3\");\n newTitle.innerText = titleText;\n newTitle.setAttribute(\"id\", \"note_\" + id + \"_title\");\n title.parentNode.replaceChild(newTitle, title);\n\n //Update the last mofification time of the note.\n let lastModify = document.querySelector(\"#note_\" + id + \"_last_edit\");\n if (lastModify == null) {\n let dates = document.querySelector(\"#note_\" + id + \"_create_modify\")\n let editDate = document.createElement(\"span\")\n editDate.setAttribute(\"id\", \"note_\" + id + \"_last_edit\")\n editDate.innerText = \"Last edited: \" + new Date();\n dates.appendChild(editDate)\n } else {\n lastModify.innerText = \"Last edited: \" + new Date();\n }\n\n let modifyButtons = createLiveNoteModificationButtons(id);\n\n let buttons = document.querySelector(\"#buttons_\" + id);\n buttons.parentNode.replaceChild(modifyButtons, buttons);\n }", "title": "" }, { "docid": "d37e03ac85d8fd43688fd74d26c3a389", "score": "0.50232476", "text": "function save_file(path, content)\n{\n\tvar writer = new java.io.PrintWriter(project.replaceProperties(path));\n\twriter.print(content);\n\twriter.close();\n}", "title": "" }, { "docid": "6e5cbb7c92dc00f8877872eeb165889c", "score": "0.5017498", "text": "function saveExploration(exploration) {\n\tupdateExplorationControls(\"saved\");\n\n\t// if the exploration has no audio, go ahead and send\n\tif (!exploration.audio){\n\t\tsendExploration(exploration);\n\t}\n\telse { // if the exploration contains audio\n\t\t// convert audio from blob to string so it can be sent\n\t\tvar reader = new FileReader();\n\t\treader.addEventListener(\"loadend\", audioConverted);\n\t\treader.readAsBinaryString(exploration.getAudio());\n\n\t\tfunction audioConverted(){\n\t\t\tvar audioString = reader.result;\n\t\t\texploration.setAudio(audioString);\n\t\t\tsendExploration(exploration);\n\t\t}\n\t}\n\n\tfunction sendExploration(exploration){\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: \"/postExploration\",\n\t\t\tdata: JSON.stringify(exploration),\n\t\t\tsuccess: function(response){\n\n\t\t\t\tloadAllExplorations(currentUser.name, gotExplorations);\n\n\t\t\t\tfunction gotExplorations(allExplorations){\n\t\t\t\t\tcurrentUser.setExplorations(allExplorations);\n\t\t\t\t\tupdateExplorationChooser();\n\t\t\t\t}\n\n\t\t\t\tenableAction([\"delete\"]);\n\t\t\t\tupdateExplorationChooser();\n\t\t\t},\n\t\t\tcontentType: \"application/json\"\n\t\t});\n\t}\n}", "title": "" } ]
10be24dec07a0556ba0180cfd927ae3c
Called if the user presses a key in the query box. Send an AJAX request to the server and check the query.
[ { "docid": "5a0a456b9f35c48c7c26faf276becfe5", "score": "0.61870265", "text": "function checkQuery(event) {\r\n\tif (timer) clearTimeout(timer);\r\n\tswitch (event.keyCode) {\r\n\t\tcase Event.KEY_RIGHT :\r\n\t\tcase Event.KEY_LEFT :\r\n\t\tcase Event.KEY_UP :\r\n\t\tcase Event.KEY_DOWN :\r\n\t\tcase Event.KEY_ESC :\r\n\t\t\treturn;\r\n\t}\r\n\ttimer = setTimeout('compileAndCheck()', 1000);\r\n}", "title": "" } ]
[ { "docid": "a730d9a50755b4a1047760d0e29d86e7", "score": "0.69468737", "text": "function inputHandler(e) {\n query(inputBox.value);\n }", "title": "" }, { "docid": "8204460dfb8384657cbec257a9870c4b", "score": "0.652047", "text": "function hive_query(){ \n\t var Query = document.getElementById('queryholder').value;\n\t\t$.ajax({ \n\t\t type : \"Post\", \n\t\t url : \"query_hive.form\", \n\t\t data : {\n\t\t \t\tquery: Query\n\t\t },\n\t\t success : function(reslt) { \n\t\t\t \tshow('hive_data','hive_query_editor');\n\t\t\t \tcreateTable(reslt,'populated_data');\n\t\t\t \thive_data = reslt;\n\t\t }, \n\t\t error : function(e) { \n\t\t Apprise('Error: ' + e); \n\t\t } \n\t\t}); \n }", "title": "" }, { "docid": "06c5718a82a498ce0a136e7d7c9eabb0", "score": "0.6464977", "text": "function remoteQuery()\n{\n $('#search-form').submit(function(e) {\n e.preventDefault();\n if ($.trim($(this).find('input[type=search]').first().val()) != '') {\n $(this).find('input[type=submit]').first().attr('disabled', 'disabled');\n $('#wrapper').html('<p>Searching...</p>');\n $.get(\n $(this).attr('action'),\n $(this).find('input[type=search]').first(),\n function(data) {\n if (data.length > 0) {\n $('#wrapper').html(renderData(data));\n } else {\n $('#wrapper').html('<p>No results found.</p>');\n }\n }\n )\n .fail(function() {\n $('#wrapper').html('<p>Internal server error</p>');\n })\n .always(function() {\n $('#search-form').find('input[type=submit]').first().removeAttr('disabled');\n }); \n }\n })\n}", "title": "" }, { "docid": "c77061bc70334f161709e00c29c93319", "score": "0.6460333", "text": "function callajaxreq(inputid, type, url, resultsid){\n \n // Setup AJAX request onclick\n var query_input = document.getElementById(inputid);\n\n query_input.onkeyup = function(event){\n \n var query_value = document.getElementById(inputid).value;\n var request = $.ajax({\n url: url,\n type: \"GET\",\n data: { params : query_value },\n dataType: \"html\"\n }); //end var request\n \n request.done(function( msg ) {\n $( \"#\" + resultsid ).html( msg );\n }); //end request.done\n\n }// end query_input.onkeyup\n\n} //end callajaxreq", "title": "" }, { "docid": "ece9668e6885baa55263d4572f9c8c4c", "score": "0.64520633", "text": "function assignQueryButtonListenerAjax(e) {\t\t\t\t\t\t\t// if query button was clicked\n var fieldstuff = this.id.match(/button_(.*)/);\t\t\t\t\t\t// this is event (button click)\n var field = fieldstuff[1];\t\t\t\t\t\t\t\t\t// get the field name from the event id\n var userValue = \"\";\t\t\t\t\t\t\t\t\t\t// userValue is what they entered in matching input\n if ( ( fieldsData[field][\"type\"] === \"toggle\" ) || ( fieldsData[field][\"type\"] === \"toggle_text\" ) ) {\t// toggle fields\n if (top.frames['editor'].document.getElementById(\"toggle_\" + field).style.backgroundColor === \"red\") { userValue = fieldsData[field][\"label\"]; } }\t// if checked on the backgroundColor is red, and the value is the field's label\n else if ( fieldsData[field][\"type\"] === \"queryonly\" ) { userValue = \"queryonly\"; }\t\t// if it's a queryonly field, assign a dummy value to make a query\n else if ( fieldsData[field][\"type\"] === \"textarea\" ) { \t\t\t\t\t// if it's a textarea field there is no corresponding input field\n userValue = top.frames['editor'].document.getElementById(\"textarea_\" + field).value; }\t// userValue is what they entered in matching textarea\n else {\t\t\t\t\t\t\t\t\t\t\t// non toggle fields get their value from input_<field>\n userValue = top.frames['editor'].document.getElementById(\"input_\" + field).value; }\t// userValue is what they entered in matching input\n if (userValue === \"\") { return; }\t\t\t\t\t\t\t\t// don't query if no input\n\n postgresQueryField(field, userValue, 0); \t\t\t\t\t\t\t// ajax call to query postgres by field and userValue\n}", "title": "" }, { "docid": "d8cdb978c9c8d526a056ca0e0ff1a565", "score": "0.6269082", "text": "function submitHandler(event) {\n event.preventDefault(); \n const queryTarget = $(event.currentTarget).find('.js-query');\n const queryVal = queryTarget.val();\n console.log(\"queryVal: \", queryVal);\n getPwned(queryVal, successHandler);\n}", "title": "" }, { "docid": "f670deef66c6e6f2a72b2d83a06685e5", "score": "0.62647486", "text": "function doneTyping() {\n var $searInput = $(\"#searchInput\");\n var $searPrompt = $(\"#search-prompt\");\n keyWords = $searInput.val().trim();\n console.log(\"keyWords: \" + keyWords);\n if (keyWords != null) {\n if (keyWords.length > 0) {\n ajaxRequestQuery(keyWords);\n $searPrompt.show();\n }\n if (keyWords.length == 0) {\n $searPrompt.hide();\n }\n }\n}", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.6258281", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.6258281", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.6258281", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.6258281", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.6258281", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "b099abf2110e5f7d9f22f2104909c63e", "score": "0.62444705", "text": "function formSubmitted(event) {\n event.preventDefault();\n var url = \"http://omdbapi.com/?s=\" + $(\"#query\").val();\n $.get(url, resultsReceived);\n}", "title": "" }, { "docid": "e804c5c5c822ae30aa62b231487166c9", "score": "0.6233364", "text": "function HandleKey(evt){\n\tUpdateSearchButton();\n\tif (SearchButton.disabled === false && RequestInProgress === false){\n\t\tif(evt.keyCode == 13){\n\t\t\t MakeNewQuery();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3934f1a2a625aaf4fc8181db544e94c6", "score": "0.6194832", "text": "function onSearchButt() {\n\t\t// var uri = new URI();\n\t\t// var queries = uri.search(true)\n\t\t// console.log(queries)\n\t\turi.setSearch({input: $(\"#search-input\").val()});\n\t\turi.setSearch({source: $(\"#data-source-selection\").val()});\n\t\t// queries['input'] = $(\"#search-input\").val();\n\t\t// queries['source'] = $(\"#data-source-selection\").val()\n\t\t\n\t\t// if user is dumb and pressed search on empty input\n\t\tif (! uri.search(true).input) {\n\t\t\thideContent(true)\n\t\t\t$(\"#emptySearch\").show()\n\t\t\treturn false;\n\t\t}\n\t\t// wrong\n\t\t// pushGuai(queries)\n\t\t\n\t\tsearch();\n\t\t// why is this return false here?\n\t\treturn false;\n\t}", "title": "" }, { "docid": "370b5e7b9433abd117829e522ddcdd12", "score": "0.61891943", "text": "function watchSubmit() {\n $('button[id=\"submit\"]').click(function() {\n var queryTarget = $('form').find('.js-query');\n var query = queryTarget.val();\n // clear out the input\n queryTarget.val(\"\");\n getDataFromApi(query, callback);\n });\n}", "title": "" }, { "docid": "360411aa5e2741d6c1c1527c5c37b094", "score": "0.6181397", "text": "function handleQuery () {\n var searchText = $scope.searchText || '',\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[ term ]) {\n ctrl.matches = cache[ term ];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "5de498af7f87c95ef08a9519f7b978eb", "score": "0.6174334", "text": "function run_search(query) {\n\t\t\t\tvar queryStringDelimiter = settings.url.indexOf(\"?\") < 0 ? \"?\" : \"&\";\n\t\t\t\tvar callback = function(results) {\n\t\t\t\t\tpopulate_display(query, results);\n\n\t\t\t\t\tif($.isFunction(settings.onResult)) {\n\t\t\t\t\t settings.onResult.call(this, results);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tif(settings.method == \"POST\") {\n\t\t\t\t\t$.post(settings.url + queryStringDelimiter + settings.queryParam + \"=\" + query, {}, callback, settings.contentType);\n\t\t\t\t} else {\n\t\t\t\t\t$.get(settings.url + queryStringDelimiter + settings.queryParam + \"=\" + query, {}, callback);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "09b5bf2e7384f11a5d2bc8a564b26fa9", "score": "0.6168071", "text": "function handleQuery () {\n var searchText = $scope.searchText || '',\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[ term ]) {\n ctrl.matches = cache[ term ];\n updateMessages();\n setLoading(false);\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "1115d2c8625c652526e10ce2708b8cf3", "score": "0.61056966", "text": "function searchFunction() {\n\tsetResultErrorString(\"\");\n\treplaceResultTableBody();\n\treplaceResultSummaryList();\n\ttry {\n\t\tconst searchString = document.getElementById(\"searchText\").value;\n\t\tif (searchString == \"\") throw \"Empty search string.\"\n\t\tconst mode = document.querySelector(\"input[name = 'mode']:checked\").value;\n\t\tconst data = JSON.stringify({\"searchString\": searchString, \"mode\": mode});\n\t const xmlhttp = new XMLHttpRequest();\n\t xmlhttp.onreadystatechange = queryStatusChange;\n\t xmlhttp.open(\"POST\", \"http://localhost:8765/api/index.php\", true);\n\t xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t xmlhttp.send(\"q=\" + data);\n\t}\n\tcatch(err) {\n\t\tsetResultErrorString(\"Error searching. \" + err);\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "351d14a9dad12c0dbab780b08156a34a", "score": "0.60892916", "text": "function handleQuery () {\n var searchText = $scope.searchText,\n term = searchText.toLowerCase();\n //-- cancel promise if a promise is in progress\n if (promise && promise.cancel) {\n promise.cancel();\n promise = null;\n }\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[term]) {\n ctrl.matches = cache[term];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n if (hasFocus) ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "bea2da5a53fb116fe92cf986c9388821", "score": "0.6081027", "text": "function search(query, submit) {\n loadQuery(query);\n\n if (submit) {\n clearTimeout(searchTimeout);\n searchTimeout = setTimeout(askQuestion, 100);\n }\n}", "title": "" }, { "docid": "893617713e033299467ae62529b0f94c", "score": "0.60784674", "text": "function searchCall() {\n $('#searchButton').click(function () {\n var qString = $('#searchInput').val();\n bindSearchUrl(qString);\n });\n\n $('#searchInput').keypress(keypressHandler);\n}", "title": "" }, { "docid": "d002c35a338542bc905fb1589f3a791d", "score": "0.6046345", "text": "function handleQuery() {\n\tvar url = new URL(window.location.href)\n\tvar searchParams = new URLSearchParams(url.search);\n\t// did we get a game id via the URL?\n\tvar gameid = searchParams.get('gameid')\n\t// if not we use the one from the input field\n\tif (gameid==null)\n\t\tgameid=document.getElementById(\"gameid\")\n\tupdateGame(gameid)\n}", "title": "" }, { "docid": "5d50ecafe3d2424f91c2a7c7d761e4d7", "score": "0.603443", "text": "function searchStream () {\n if (document.getElementById('search-query').value != '') {\n let searchQuery = document.getElementById('search-query').value;\n queryGame (SEARCH_URI + \"?q=\" + searchQuery);\n }\n else {\n alert('Add valid Search Query, Please!');\n }\n \n}", "title": "" }, { "docid": "46131ab6b5ff63ca00e40642655c92d5", "score": "0.60255694", "text": "function setQuery(evt) {\n if (evt.keyCode == 13) {\n getResults(searchBox.value);\n console.log(searchBox);\n }\n}", "title": "" }, { "docid": "a3a6d2499d376964a7bc13297758498a", "score": "0.5993238", "text": "function handleQuery () {\n var searchText = $scope.searchText || '';\n var term = searchText.toLowerCase();\n\n // If caching is enabled and the current searchText is stored in the cache\n if (!$scope.noCache && cache[term]) {\n // The results should be handled as same as a normal un-cached request does.\n handleResults(cache[term]);\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "a3a6d2499d376964a7bc13297758498a", "score": "0.5993238", "text": "function handleQuery () {\n var searchText = $scope.searchText || '';\n var term = searchText.toLowerCase();\n\n // If caching is enabled and the current searchText is stored in the cache\n if (!$scope.noCache && cache[term]) {\n // The results should be handled as same as a normal un-cached request does.\n handleResults(cache[term]);\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "a3a6d2499d376964a7bc13297758498a", "score": "0.5993238", "text": "function handleQuery () {\n var searchText = $scope.searchText || '';\n var term = searchText.toLowerCase();\n\n // If caching is enabled and the current searchText is stored in the cache\n if (!$scope.noCache && cache[term]) {\n // The results should be handled as same as a normal un-cached request does.\n handleResults(cache[term]);\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "a3a6d2499d376964a7bc13297758498a", "score": "0.5993238", "text": "function handleQuery () {\n var searchText = $scope.searchText || '';\n var term = searchText.toLowerCase();\n\n // If caching is enabled and the current searchText is stored in the cache\n if (!$scope.noCache && cache[term]) {\n // The results should be handled as same as a normal un-cached request does.\n handleResults(cache[term]);\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "0df8dcfed1d29fd488f4dd2d0a8238d3", "score": "0.59890056", "text": "function execSearch(){\n \n var search = $(\"#search\").val();\n if(search){\n\t\n var url = \"https://api.twitch.tv/kraken/search/streams?q=\"+search;\n\tdocument.getElementById(\"resultTitle\").innerHTML = \"Search: \"+search;\n\tajaxCall(url, display);\n }else{\n document.getElementById(\"test\").innerHTML += \"Not A Valid Search\";\n }\n}", "title": "" }, { "docid": "96c5d23c3e5672c2a0d41a346916137a", "score": "0.5967641", "text": "function execQuery() {\r\n\tdocument.getElementById('output').innerHTML = '';\r\n\tclearErrors();\r\n var code = document.getElementById('codeEditor').value;\r\n if (code.length == 0)\r\n\t\treturn;\r\n\tresizeQueryBox(true);\r\n\tvar params = 'qu=' + escapeQuery(code);\r\n var callback = {\r\n success: showQueryResponse,\r\n failure: requestFailed\r\n };\r\n YAHOO.util.Connect.asyncRequest('POST', 'execute.xq', callback, params);\r\n\tmessage('Query sent to execute.xq ...');\r\n}", "title": "" }, { "docid": "b5863ecffd6e68265126d109337b04ef", "score": "0.59641445", "text": "function customSearch() {\n // Base query on input field\n let searchInput = document.querySelector(\"#search\");\n\n searchInput.addEventListener('click',function(e){\n $('.topic').removeClass('active');\n\n this.value = '';\n $('.instructions-oops').removeClass('show');\n $('.instructions').removeClass('show');\n clearContainer();\n });\n\n searchInput.addEventListener('keydown',function(e){\n if (e.keyCode === 13) {\n submitQuery(e);\n }\n });\n\n function submitQuery(e) {\n var query = e.target.value;\n fetchdata(query);\n }\n}", "title": "" }, { "docid": "0fec93cac267854c514455a02248bda4", "score": "0.5959576", "text": "function handleQuery () {\n\t var searchText = $scope.searchText || '';\n\t var term = searchText.toLowerCase();\n\t\n\t // If caching is enabled and the current searchText is stored in the cache\n\t if (!$scope.noCache && cache[term]) {\n\t // The results should be handled as same as a normal un-cached request does.\n\t handleResults(cache[term]);\n\t } else {\n\t fetchResults(searchText);\n\t }\n\t\n\t ctrl.hidden = shouldHide();\n\t }", "title": "" }, { "docid": "a16892a60b1b1f0c0517cdf33a6062bf", "score": "0.5958728", "text": "function handleQuery() {\n var searchText = $scope.searchText || '';\n var term = searchText.toLowerCase();\n\n // If caching is enabled and the current searchText is stored in the cache\n if (!$scope.noCache && cache[term]) {\n // The results should be handled as same as a normal un-cached request does.\n handleResults(cache[term]);\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "35627dab764cd1a86f1a0a83f50074ef", "score": "0.5921684", "text": "function contact_users_KeySearch(event){\n //ths SAI Value\n var sValue = \"\";\n //our element \n var oElement = null;\n\n if(event.keyCode == 13)\n contact_usersDoQuery();\n\n oElement = document.getElementById(\"SAI_search_Query\");\n\n if(oElement != null){\n sValue = oElement.value;\n\n if(sValue.length > HEIMDALL_AUTO_QUERY_SIZE)\n contact_usersDoQuery();\n }\n}", "title": "" }, { "docid": "407583b26171defc8d3e9aebcd222b08", "score": "0.5907739", "text": "function search() {\n\t\thideContent(true);\n\t\t$(\"#ajaxLoader\").show();\n\t\t$(\"#search-input\").val(uri.search(true).input);\n\t\tgetData(populateHTML.bind(null));\n\t}", "title": "" }, { "docid": "b52f86fa556b3d9b42652e5f0700f0ed", "score": "0.5906239", "text": "function watchSubmit() {\n\t$('.js-query').keypress(function(event) {\n\t\tif (event.which === 13) {\n\t\t\tevent.preventDefault();\n\t\t\tcreateWordObjectArray();\n\t\t\temptyScreen();\n\t\t\tfetchNextDefinitions();\n\t\t}\n\t});\n\t$('.start-button').on(\"click\", function(e) {\n\t\te.preventDefault();\n\t\tcreateWordObjectArray();\n\t\temptyScreen();\n\t\tfetchNextDefinitions();\n\n\t})\n}", "title": "" }, { "docid": "433248230cf7eafb8aa12d50e5a5bbda", "score": "0.589901", "text": "function searchSuggest(event) {\n\tif (searchReq.readyState == 4 || searchReq.readyState == 0) {\n\t\tvar str = escape(document.getElementById('txt1').value);\n\t\tsearchReq.open(\"GET\", 'searchSuggest.php?search=' + str, true);\n\t\tsearchReq.onreadystatechange = handleSearchSuggest; \n\t\tsearchReq.send(null);\n\t\t\n\t}\n\n}", "title": "" }, { "docid": "486818f94ac020eda94244e46b4f5b4c", "score": "0.589562", "text": "function ss_handleKey(e) {\n if (!enableSuggestions) {\n return;\n }\n var tbl = document.getElementById(ss_popup_element);\n var rows = tbl.getElementsByTagName('tr');\n var kid = (window.event) ? window.event.keyCode : e.keyCode;\n // alert(kid);\n var fo = document.getElementById(ss_form_element);\n var qnow = (!ss_qbackup) ? fo.query.value : ss_qbackup;\n var sum = 0;\n var tbl = document.getElementById(ss_popup_element);\n if (isBlockedChar(kid)) {\n return;\n }\n switch (kid) {\n case 40: // \"key down\".\n ss_dismissed = false;\n if (ss_processed(qnow)) {\n sum = ss_countSuggestions(qnow);\n if (sum > 0) {\n if (tbl.style.visibility == 'hidden') {\n ss_show(qnow);\n break;\n }\n if (ss_qbackup) {\n ss_loc++;\n } else {\n ss_qbackup = qnow;\n ss_loc = 0;\n }\n while (ss_loc >= sum)\n ss_loc -= sum;\n var rows = tbl.getElementsByTagName('tr');\n for (var ri = 0; ri < rows.length - 1; ri++) {\n if (ri == ss_loc + 1) {\n rows[ri].className = SS_ROW_SELECTED_CLASS;\n } else {\n rows[ri].className = SS_ROW_CLASS;\n }\n }\n\n // Find out what type of suggestion it is.\n var suggestion = ss_locateSuggestion(qnow, ss_loc);\n\n // Adjust the query in the search box.\n if (suggestion.q) {\n fo.query.value = suggestion.q;\n } else {\n fo.query.value = ss_qbackup;\n }\n }\n } else {\n // May be here if using back button.\n if (ss_panic) {\n // alert('run ajax when key down');\n }\n ss_suggest(qnow);\n }\n break;\n case 38: // \"key up\".\n ss_dismissed = false;\n if (ss_processed(qnow)) {\n sum = ss_countSuggestions(qnow);\n if (sum > 0) {\n if (tbl.style.visibility == 'hidden') {\n ss_show(qnow);\n break;\n }\n if (ss_qbackup) {\n ss_loc--;\n } else {\n ss_qbackup = qnow;\n ss_loc = -1;\n }\n while (ss_loc < 0)\n ss_loc += sum;\n var rows = tbl.getElementsByTagName('tr');\n for (var ri = 1; ri < rows.length - 1; ri++) {\n if (ri == ss_loc + 1) {\n rows[ri].className = SS_ROW_SELECTED_CLASS;\n } else {\n rows[ri].className = SS_ROW_CLASS;\n }\n }\n\n // Find out what type of suggestion it is.\n var suggestion = ss_locateSuggestion(qnow, ss_loc);\n\n // Adjust the query in the search box.\n if (suggestion.q) {\n fo.query.value = suggestion.q;\n } else {\n fo.query.value = ss_qbackup;\n }\n }\n } else {\n // May be here if using back button.\n if (ss_panic) {\n // alert('run ajax when key up');\n }\n ss_suggest(qnow);\n }\n break;\n case 13: // \"enter\".\n var url = null;\n if (ss_processed(qnow) && ss_qbackup && ss_loc > -1) {\n // Find out what type of suggestion it is.\n var suggestion = ss_locateSuggestion(ss_qbackup, ss_loc);\n // Adjust the query in the search box.\n if (suggestion.u) {\n url = suggestion.u;\n }\n }\n ss_qbackup = null;\n ss_dismissed = true;\n ss_clear();\n if (url) {\n window.location.href = url;\n }\n break;\n case 27: // \"escape\".\n // alert(\"before escape key >\"+textEntered);\n /* var x=textEntered; */\n if (ss_qbackup) {\n fo.query.value = ss_qbackup;\n ss_qbackup = null;\n }\n ss_dismissed = true;\n ss_clear();\n // alert(\"escape key >\"+textEntered);\n /*\n * textEntered=x; fo.query.value=x;\n */\n break;\n case 37: // \"key left\".\n autoCompleteEnable = false;\n break;\n case 16: // \"shift-tab\".\n break;\n case 9: // \"tab\".\n break;\n case 35 : // end\n if (!autoCompleteEnable) {\n autoCompleteEnable = true;\n }\n break;\n case 39: // key right\n if (ss_dismissed)\n return;\n if (doGetCaretPosition(fo.query) >= fo.query.value.length) {\n\n if (!autoCompleteEnable) {\n autoCompleteEnable = true;\n break;\n }\n ss_dismissed = false;\n if (ss_processed(qnow)) {\n sum = ss_countSuggestions(qnow);\n if (sum > 0) {\n var queryToBeFilled = \"\";\n // Find out what type of suggestion it is.\n var suggestion = ss_locateSuggestion(qnow, 0);\n if (suggestion.q) {\n queryToBeFilled = suggestion.q;\n }\n for (var ri = 1; ri < rows.length - 1; ri++) {\n if (rows[ri].className == SS_ROW_SELECTED_CLASS) {\n ss_loc = ri - 1;\n var suggestion = ss_locateSuggestion(ss_qbackup, ss_loc);\n if (suggestion.q) {\n queryToBeFilled = suggestion.q;\n }\n }\n }\n // Adjust the query in the search box.\n if (suggestion.q) {\n fo.query.value = queryToBeFilled;\n drawTextBox('');\n }\n }\n }\n clear_suggestions();\n }\n else {\n autoCompleteEnable = false;\n break;\n }\n break;\n default:\n ss_dismissed = false;\n if (fo.query.value == ss_qshown) {\n // The key stroke has not changed the searched text.\n } else {\n if (ss_key_handling_queue) {\n // Ignore pending key handling request delayed earlier.\n clearTimeout(ss_key_handling_queue);\n }\n ss_qbackup = null;\n ss_loc = -1;\n // Flow through for delayed AJAX calls.\n ss_waiting++;\n if (ss_allow_debug && ss_debug && ss_debug.getDebugMode()) {\n ss_debug.addWaitDebugLine(fo.query.value, 'queue', ss_wait_millisec);\n }\n ss_key_handling_queue = setTimeout(\n 'ss_handleQuery(\"' + ss_escape(fo.query.value) + '\", ' +\n ss_waiting + ')', ss_wait_millisec);\n }\n break;\n }\n }", "title": "" }, { "docid": "41dc516f9104f3bae67a010313e07d9a", "score": "0.58814573", "text": "function doSearch(){\n window.location = (currEng.url+currEng.query+input.value);\n return false;\n }", "title": "" }, { "docid": "af48eaf3333c2a02fd058a7fdc78a014", "score": "0.5876554", "text": "function doSearch(event) {\n\t\t// clears the results from previous search\n\t\tclearResultsList()\n\n\t\t// cancels the event if it is cancelable\n\t\tevent.preventDefault();\n\t\t\n\t\tsearchFieldInput = textField.value;\n\t\tif (searchFieldInput === '') {\n\t\t\talert('Please enter a search term!');\n\t\t} else {\n\t\t\tvar fullRequestURL = apiURLPrefix + searchFieldInput\n\t\t\tapiRequest(fullRequestURL, showResults, 'Search')\n\t\t}\n\t}", "title": "" }, { "docid": "4ac2553bc9001e8825643e4055bb82a2", "score": "0.58388656", "text": "function doRemoteQuery (queryString)\n{\n searching = true;\n if(xmlHttp && xmlHttp.readyState != 0) {\n xmlHttp.abort()\n } \n xmlHttp=getXMLHTTP();\n if(xmlHttp){\n xmlHttp.open(\"GET\", lookupURL + queryString, true);\n \n // What do we do when the response comes back?\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.responseText && searching) {\n\t\t\teval(xmlHttp.responseText);\n\t\t\tsearching = false;\n }\n }\n xmlHttp.send(null);\n }\n \n}", "title": "" }, { "docid": "9da16f75a9ec9667584051d5a8314743", "score": "0.582805", "text": "function query(query_str, callback) {\n $.post(\n queryScript,\n {query: query_str},\n function(data, status) {\n callback(data);\n }\n );\n}", "title": "" }, { "docid": "57bb6ddc5eafb21a4b59d49ab5e41771", "score": "0.5822767", "text": "handleSearch() {\n var newSymbol = this.symbolValue;\n\n if (newSymbol != null && newSymbol != \"\") {\n var symbolParam = \"symbol:\" + newSymbol;\n\n var params =\n this.params != null\n ? this.params\n : { q: symbolParam, fields: this.fields };\n this.$.ajax.params = params;\n this.$.ajax.generateRequest();\n }\n }", "title": "" }, { "docid": "bd413ed7799d55e6f2946270485991ad", "score": "0.5805748", "text": "function checkSearchQuery() {\r\n var query = getURLParameterByName(\"searchQuery\");\r\n var type = getURLParameterByName(\"type\");\r\n if (query != null) {\r\n document.getElementById(\"searchQuery\").setAttribute(\"value\", query);\r\n if (type == \"comic\") {\r\n comicSearch();\r\n }\r\n else {\r\n contribSearch();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "8f2612b01596adb911aaaea688057003", "score": "0.58023673", "text": "function watchSubmitButton() {\n $('#youtube_mini_search').submit(event => {\n event.preventDefault();\n const queryTarget = $(this).find('#js-query');\n const query = queryTarget.val();\n queryTarget.val(\"\");\n getDataFromApi(query, displayYoutubeSearchData);\n });\n}", "title": "" }, { "docid": "b603e8612b65355cefe1930353a651e3", "score": "0.5799816", "text": "onInput_() {\n\t\tvar query = this.inputElement.value;\n\n\t\tthis.emit('query', query);\n\n\t\tPromise.resolve(this.data(query))\n\t\t.then(function(data) {\n\t\t\tthis.emit('result', this.formatData_(data));\n\t\t}.bind(this))\n\t\t.catch(function(error) {\n\t\t\tthis.emit('error', error);\n\t\t}.bind(this));\n\t}", "title": "" }, { "docid": "b76bac73db047e157c7b2195dd1c39c0", "score": "0.57932705", "text": "function keypressHandler(event) {\n\n if ((event.keyCode == '13') || (event.keyCode == '10')) {\n var qString = $('#searchInput').val();\n bindSearchUrl(qString)\n }\n}", "title": "" }, { "docid": "f048c0c4ccd5223245d71cb212f26e4a", "score": "0.57851654", "text": "function searchFromInput() {\n if (actualSearch.value.trim() == \"\") {\n makePopup(\"Enter a search query\", true)\n return\n }\n fadeInLoading()\n searchSpotify(actualSearch.value)\n}", "title": "" }, { "docid": "5abd264013345f9aa239688551871a1c", "score": "0.5782297", "text": "function queryServiceNow(input)\n{\n RMPApplication.debug(\"begin queryServiceNow: input = \", input);\n $(\"#id_spinner_search\").show();\n var option = {};\n id_get_work_order_list_api.trigger(input, option, order_ok, order_ko);\n RMPApplication.debug(\"end queryServiceNow\");\n}", "title": "" }, { "docid": "5abd264013345f9aa239688551871a1c", "score": "0.5782297", "text": "function queryServiceNow(input)\n{\n RMPApplication.debug(\"begin queryServiceNow: input = \", input);\n $(\"#id_spinner_search\").show();\n var option = {};\n id_get_work_order_list_api.trigger(input, option, order_ok, order_ko);\n RMPApplication.debug(\"end queryServiceNow\");\n}", "title": "" }, { "docid": "88a5bbe8b400851f72e4e910bc2e15e8", "score": "0.5777646", "text": "function sendSearch () {\n\tif ($('#searchTitle').val().length === 0) {\n\t\t$('#err').css(\"visibility\", \"visible\");\n\t\t$('#err').css(\"opacity\", \"1\");\n\t\t$('#err').css(\"display\", \"block\");\n\t\t$('#err').fadeOut(3000);\n\t} else {\n\t\t$('#loadingImg').css(\"visibility\", \"visible\")\n\t\tvar searchQuery = $('#searchTitle').val();\n\t\t$.ajax({\n\t\t\tmethod: \"GET\",\n\t\t\turl: '/jobreq/' + searchQuery,\n\t\t\tsuccess: showResult\n\t\t});\n\t}\n}", "title": "" }, { "docid": "e1862d6a57b6a3b4b402b4d5fcaf4e74", "score": "0.5755976", "text": "function submitSearchQuery(q, cb) {\n $.ajax({\n type: 'GET',\n url: '/search',\n data: q,\n complete: function (res, status) {\n try {\n if (status != 'success' || !res.responseText) throw 0;\n cb && cb(res.responseText);\n } catch (e) {\n cb && cb({ error: e || 'An error occured. Please try again.' });\n if (e) throw e;\n }\n },\n });\n }", "title": "" }, { "docid": "971da8227278d22e2f89643961bcfea2", "score": "0.57411784", "text": "function onSearch(...args) {\n emptyContainer(answersBox)\n answersBox.packStart(new Gtk.Label({ label: 'Loading' }), false, false, 0)\n answersBox.showAll()\n const pulseInterval = setInterval(() => input.progressPulse(), 200)\n\n const query = input.getText()\n\n howdoi({ query, results: 1, answers: 5, engine: 'google' })\n .then(results => {\n console.log(results)\n\n emptyContainer(answersBox)\n const result = results[0]\n\n const box = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL })\n answersBox.packStart(box, false, false, 0)\n box.packStart(new Gtk.Label({ label: result.title }), false, false, 0)\n\n result.answers.forEach(answer => {\n const view = new WebKit2.WebView()\n view.loadHtml(answer.html, null)\n box.packStart(view, false, false, 0)\n })\n\n answersBox.showAll()\n })\n .catch(err => {\n // XXX(handle error)\n })\n .then(() => {\n clearInterval(pulseInterval)\n input.setProgressFraction(0)\n })\n\n return false\n}", "title": "" }, { "docid": "743648cd2f9713fb6213898a32785afb", "score": "0.57362235", "text": "function inputRequest() {\n//avvia ricerca con bottone\n var btn = $('#push');\n var target = $('#search');\n\n btn.click(function(){\n\n startSearch();\n\n });\n\n// avvia ricerca con tasto enter\n target.keyup(function() {\n\n if ( event.which == 13 ) {\n\n startSearch();\n\n }\n\n });\n\n}", "title": "" }, { "docid": "0b9c23d7fd43fe0171287a1e0bdb32ba", "score": "0.57311237", "text": "function UpdateSearchButton(){\n\tif (QueryField != null && QueryField != undefined){\n\t\tSearchButton.disabled = QueryField.value.length <= 0 && !RequestInProgress;\n\t}\n}", "title": "" }, { "docid": "659112201c9785438549aaa2f3ff152b", "score": "0.57249373", "text": "function runWhereAmI () {\n sendAjaxQuery_WhereAmI(makeWhereAmIQueryString());\n}", "title": "" }, { "docid": "b156d7bf719a69db418a99fab43626d5", "score": "0.57157284", "text": "function handleQuery(){var searchText=$scope.searchText||'';var term=searchText.toLowerCase();// If caching is enabled and the current searchText is stored in the cache\nif(!$scope.noCache&&cache[term]){// The results should be handled as same as a normal un-cached request does.\nhandleResults(cache[term]);}else{fetchResults(searchText);}ctrl.hidden=shouldHide();}", "title": "" }, { "docid": "9696d76355840ee0f04cd57db4b0d23e", "score": "0.5710032", "text": "function yt_search() {\n $.ajax({\n url: '/search_song',\n data: JSON.stringify({ query : $('#search_query').val()}),\n type: 'POST',\n beforeSend : function() {\n $('#my_container').html('');\n $('#loading_songs').show();\n\n },\n success: function(response) {\n $('#loading_songs').hide();\n $('#my_container').html(response);\n },\n error: function(response) {\n console.log(\"Something went wrong! See response below\" )\n console.log(response)\n },\n contentType: 'application/json;charset=UTF-8'\n });\n }", "title": "" }, { "docid": "3bb4a78575d1c9a35451a2126cb3ae98", "score": "0.5700503", "text": "function search(){\n $.ajax({\n url: getURL(),\n success: resultReceived\n });\n}", "title": "" }, { "docid": "95fb586a7f4c58d435e849d6ce3cc3e5", "score": "0.5694442", "text": "function setupSearch() {\r\n\tvar textForm = $('#quick-search');\r\n\tvar textField = $(\"#quick-search-box\");\r\n\ttextField.autocomplete({\r\n\t\tminLength: 3,\r\n\t\t//delay: 750,\r\n\t\tsource: function (req, add) {\r\n\t\t\tvar term = $(\"#quick-search-box\").val()\r\n\t\t\t$.get(\"/xq/lscoll/suggest.xqy?term=\" + encodeURIComponent(term), function (data) {\r\n\t\t\t\tadd(data.split(\",\"));\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\t// for firefox sumbission (ie submission causes submit event directly)\r\n\ttextField.keyup(function (e) {\r\n\t\tif (e.keyCode == 13) {\r\n\t\t\te.preventDefault();\r\n\t\t\ttextForm.submit();\r\n\t\t};\r\n\t});\r\n\t// button click\r\n\t$(\"#lc-ajax-button\").click(function (e) {\r\n\t\te.preventDefault();\r\n\t\ttextForm.submit();\r\n\t});\r\n\t// ie submit event and override of submit event\r\n\ttextForm.submit(function (e) {\r\n\t\te.preventDefault();\r\n\t\tsubmitSearchText();\r\n\t});\r\n}", "title": "" }, { "docid": "72971f33ed394560c820778b8d6b2cce", "score": "0.56888276", "text": "function handleSearch() {\n apiRequest(searchText.value);\n}", "title": "" }, { "docid": "12a055a051a5c6c93f76efbbc309a878", "score": "0.56881607", "text": "function startApp() {\r\n $('#query-form').submit(event => {\r\n event.preventDefault();\r\n const userQueryIpnut = $('#queryInput').val();\r\n $('#queryInput').text(\"\");\r\n getRepos(userQueryIpnut);\r\n })\r\n}", "title": "" }, { "docid": "3771527f0206e2b6a1463f547ec26543", "score": "0.5684266", "text": "function podSearchHasChanged() {\n var query = document.getElementById(\"pod_search\").value\n if (old_query != query) {\n searchTermChanged();\n } \n}", "title": "" }, { "docid": "609607a2b0afd6e0137eb7f967e34f6b", "score": "0.56772137", "text": "function ajax_query(url, query, callback, method) {\n if (request) {\n request.open(method, url, true); /* true: asíncrono */\n request.onreadystatechange = function() { if (request.readyState == 4) callback(); };\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n request.send(query);\n } else { /* pass */ }\n /* alert(\"Su navegador no soporta Ajax\"); */ /* recuperar */\n\n return false;\n}", "title": "" }, { "docid": "c0f5b8615f8c4a8fb50feaffcfc2dd55", "score": "0.56762576", "text": "function input_to_db() {\n\t\tvar entries = document.getElementById(\"search_bar_input\").value\n\t\tconsole.log(\"Sending: \"+entries)\n\n\t\t$.getJSON($SCRIPT_ROOT + \"/guesser\", {\n\t\t\tentries: entries\n\t\t}, function(data){\n\t\t\tconsole.log(data)\n\t\t})\n\t}", "title": "" }, { "docid": "3d0ebb5e8d124d111e25a41907b9f5da", "score": "0.56743467", "text": "function run_search(){\n var val = $('input#q').val();\n var params = {q: val}\n\n if (val == ''){\n $('.cpv_container .cpv-search-results').fadeOut(function(){\n $('.cpv_container .cpv-search-results').html('');\n $('.cpv_container .cpv-parents').fadeIn();\n });\n\n history.pushState(params, '', updateQueryString('code', null, updateQueryString('q', null, window.location.href)));\n\n }else{\n // call the search api\n make_ajax_call(generate_api_url('search'), params, function(data){\n // build the search results\n build_search_results(data, val);\n });\n\n // show the code in the url\n history.pushState(params, '', updateQueryString('q', params.q, window.location.href));\n }\n\n // hide children\n $('.cpv_container .cpv_children').html('');\n $('.cpv_container .cpv_children').removeClass('active');\n\n\n}", "title": "" }, { "docid": "5cd1a33eaa5a89cb4f685765c7320378", "score": "0.56727374", "text": "function makeKeyupHandler(director) {\n var params = \"&keyword=\" + director.value;\n makeAjaxGetRequest('movie_zone_admin_main.php', 'cmd_director_filter', params, function(data) {\n document.getElementById('id_director_filter').innerHTML = data;\n });\n}", "title": "" }, { "docid": "f8baf925cf04feb7ed7ed27d84096a7c", "score": "0.56672925", "text": "function watchSubmit() {\n $('.js-search-form').submit(event => {\n event.preventDefault();\n const queryTarget = $(event.currentTarget).find('#js-query');\n const query = queryTarget.val();\n // clear out the input\n queryTarget.val(\"\");\n\n getAddress(query, getGoogleLatLong);\n displayTopBar();\n });\n}", "title": "" }, { "docid": "a316a646425b23b7474ad1d919bdd368", "score": "0.5663659", "text": "function queryStatusChange() {\n if (this.readyState == 4 && this.status == 200) {\n\t\tprocessResults(this.responseText);\n\n }\n}", "title": "" }, { "docid": "a3704cb32041bb19b27fe173c49c3079", "score": "0.56613433", "text": "function contribSearch() {\r\n var query = document.getElementById(\"searchQuery\").value;\r\n var cquery = { \"contribQuery\": query };\r\n notifyUser('Searching Through Users', 'glyphicon glyphicon-retweet', \"info\");\r\n $.ajax({\r\n type: \"GET\",\r\n url: \"/search/contributor\",\r\n contentType: \"application/json; charset=utf-8\",\r\n data: cquery,\r\n async: true,\r\n timeout: 4000,\r\n dataType: 'json',\r\n success: function (data) {\r\n renderSearchResults(\"searchResContainer\", JSON.stringify(data), userType);\r\n notifyUser('Showing Search Results', 'glyphicon glyphicon-ok', \"success\");\r\n },\r\n error: function (xhr, ajaxOptions, thrownError) {\r\n notifyUser('Error: Retry Search', 'glyphicon glyphicon-remove', \"danger\");\r\n }\r\n });\r\n}", "title": "" }, { "docid": "eb25fb2f2426ffea12bd99db5d771003", "score": "0.5661063", "text": "function submitSearchText() {\r\n\tvar textBox = $(\"#quick-search-box\");\r\n\tvar existingParams = textBox.attr(\"rel\");\r\n\tvar textBoxVal = textBox.val();\r\n\tif (textBoxVal.length == 0 || textBoxVal == \"Enter search word(s)\") {\r\n\t\tvar mypath = $.address.path();\r\n\t\tvar resultspath = mypath.replace(/page=search/, \"page=results\");\r\n\t\t$.address.path(resultspath);\r\n\t} else {\r\n\t\tvar addressVal = existingParams + '&q=' + textBoxVal;\r\n\t\t$.address.value(addressVal);\r\n\t}\r\n}", "title": "" }, { "docid": "fbe39c0122780d01f97bc892294a634f", "score": "0.5659293", "text": "function searchFor(query) {\r\n inputBox.value = query;\r\n search(query);\r\n}", "title": "" }, { "docid": "a5a67986e40f7430c1350e8e1fc2b8c4", "score": "0.5647828", "text": "function searchForSong(event) {\n\t\n\tevent.preventDefault();\n\tvar userInput = $(\".js-user-input\").val();\n\t\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: `https://api.spotify.com/v1/search?type=track&query=${userInput}`,\n\t\tsuccess: goToTrack,\n\t\terror: handleError\n\t});\n}", "title": "" }, { "docid": "c62a403becead09fa8715ebc58a5a316", "score": "0.56377256", "text": "function watchSubmit(){\n $('.js-search-form').submit(function(event){\n event.preventDefault();\n const queryTarget = $(this).find('.js-query');\n const query = queryTarget.val();\n queryTarget.val('');\n getDataFromAPI(query, displayYoutubeSearch);\n displaySearchTitle(query);\n });\n}", "title": "" }, { "docid": "2680a088d2b9ae5085af78a6b4d6e92d", "score": "0.56333554", "text": "function query(input, type) {\r\n if (input.trim()) {\r\n // Chiamata AJAX per effettuare la ricerca e stampare sul DOM i risultati con HB\r\n $.ajax({\r\n url: `https://api.themoviedb.org/3/search/${type}`,\r\n method: 'GET',\r\n data: {\r\n api_key: '5735ba8aa714f2161c6a9f7f267223ef',\r\n language: 'it-IT',\r\n query: input\r\n },\r\n success: function (obj) {\r\n if (obj.total_results > 0) {\r\n listPrint(obj, type)\r\n } else {\r\n $(`#${type}-covers`).css('display', 'block').append(`Non ci sono risultati nella categoria \"${type}\"`);\r\n }\r\n },\r\n error: function () {\r\n alert('Errore');\r\n }\r\n });\r\n } else {\r\n $('#search-input').val('').focus();\r\n }\r\n}", "title": "" }, { "docid": "f7e6568bf3324b416d1cd3b5f6a327d3", "score": "0.5628145", "text": "function triggerResult(e)\n {\n e.preventDefault();\n jQuery.ajax({\n type:\"GET\",\n async:false,\n url:\"search.php\",\n data: jQuery(\"#search_whisky_form\").serialize(),\n success: function(response){\n console.log(jQuery(\"#searchResultContent\").html(response));\n }\n });\n }", "title": "" }, { "docid": "79a716e5a0e8b79733c3163a8a8d056a", "score": "0.56261486", "text": "function handleQuery () { // 19309\n var searchText = $scope.searchText || '', // 19310\n term = searchText.toLowerCase(); // 19311\n //-- if results are cached, pull in cached results // 19312\n if (!$scope.noCache && cache[ term ]) { // 19313\n ctrl.matches = cache[ term ]; // 19314\n updateMessages(); // 19315\n } else { // 19316\n fetchResults(searchText); // 19317\n } // 19318\n // 19319\n ctrl.hidden = shouldHide(); // 19320\n } // 19321", "title": "" }, { "docid": "89e1f256fe347bfe2f92805234f04f66", "score": "0.5619288", "text": "function query_select(which_query)\n{\n\tvar query_value = queries[which_query];\n\tif( query_value !== null )\n\t{\n\t\t$('#queryText').val( query_value );\n\t}\n}", "title": "" }, { "docid": "37298b764020f0ee1c35bd648a4b7f23", "score": "0.5610541", "text": "function handleHuntClick() {\r\n $('#hunt-btn').on('click', function() {\r\n $('#find-box-wrap').animate(\r\n { width: 'toggle' }\r\n );\r\n\r\n $('#find-box').focus();\r\n\r\n const queryTerm = $('#find-box').val();\r\n\r\n if (queryTerm == \"\" || queryTerm == \" \" || queryTerm == null) {\r\n // No mathces found and returned\r\n renderNoResult(\"No Match Found\");\r\n } else {\r\n // Matches found and returned\r\n let n = STATS.questionNumber;\r\n\r\n if (n === 1) {\r\n getDataFromComicVineComicsApi(queryTerm);\r\n } else if (n === 2) {\r\n getDataFromComicVineMoviesApi(queryTerm);\r\n } else if (n === 3) {\r\n getDataFromMapsApi(queryTerm);\r\n } else {\r\n console.warn('not 1 or 2 or 3');\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "625b0a99c5aa8e00e09bece62e814170", "score": "0.56078506", "text": "function searchForNewFriend(){\n if (event.keyCode == 13) { //pushes enter\n $.post(\"php/friend_search.php\",\n {\n request: \"sendInvitation\",\n friend_uname: $(\"#friends\").val(),\n },\n function(data){\n if(data == \"search=success\"){\n alert(\"Friend request sent\")\n window.location.reload()\n return true\n }else if(data == \"search=failure\"){\n alert(\"Failed sending friend request\")\n window.location.reload()\n return false\n }else{\n alert(data)\n window.location.reload()\n return false\n }\n }\n );\n }\n}", "title": "" }, { "docid": "0ea8af37e7846bb42d92ec46fbcd3e0a", "score": "0.5605869", "text": "function handleSearch(e) {\n e.preventDefault();\n let query = txtSearch.value;\n let performed = performSearch(getTwitchSearchUrl(query));\n if (performed) currentPage = 1;\n}", "title": "" }, { "docid": "027ac5d36f87e926fdddb5f4873222c3", "score": "0.5602092", "text": "function doSearch(query) {\n //If the query is not null, undefined, empty and has the minimum chars\n if (query && query.length && query.length >= settings.minChars) {\n //Call the onDataRequest function and then call the populateDropDrown\n settings.onDataRequest.call(this, 'search', query, function (responseData) {\n populateDropdown(query, responseData);\n });\n } else { //If the query is null, undefined, empty or has not the minimun chars\n hideAutoComplete(); //Hide the autocompletelist\n }\n }", "title": "" }, { "docid": "d58440cfc6ef1480add6e1c16ecf590c", "score": "0.55942017", "text": "typingLogic() {\n if (this.searchField.val() != this.previousValue) {\n // Only if the search field is changed will we run the code (Allows for arrow pressing)\n clearTimeout(this.typingTimer); // Everytime a key is pressed we reset the timer\n\n if (this.searchField.val()) {\n // If searchField is not blank run code\n if (!this.isSpinnerVisible) {\n // if isSpinnerVisible is false do the following\n this.resultsDiv.html('<div class=\"spinner-loader\"></div>'); // Add a spinner to results\n this.isSpinnerVisible = true;\n }\n this.typingTimer = setTimeout(this.getResults.bind(this), 750); // Arg you want to run, how long to run\n } else {\n this.resultsDiv.html(\"\"); // If searchField is empty display nothing, and stop spinner\n this.isSpinnerVisible = false;\n }\n }\n this.previousValue = this.searchField.val();\n }", "title": "" }, { "docid": "1e2ebb2a61cee0a770721730251472aa", "score": "0.5593976", "text": "function searchStart(){\r\n\tsearchInFlight = null;\r\n\tif(searching){\r\n\t\treSearch = true;\r\n\t\treturn;\r\n\t}\r\n\tif(lastBoxValue==\"\"){\r\n\t\tclearSearchResults();\r\n\t\treturn;\r\n\t}\r\n\tsearching = true;\r\n\tsearchBox.addClass('Working');\r\n\tsetSearchStatus('Searching for \"'+lastBoxValue+'\"');\r\n\tsearchStatusDownload.hide();\r\n\tsearchUrl = document.cakeBase+\"/api/users/search/\"+lastBoxValue; \r\n\t$.ajax({\r\n\t\turl: searchUrl+\"/json\",\r\n\t\tdataType: \"json\",\r\n\t\tsuccess: searchComplete,\r\n\t\terror: searchError\r\n\t});\r\n\thideLightbox();\r\n}", "title": "" }, { "docid": "1ead047d331b4245ef8d5419ebf5f746", "score": "0.55897665", "text": "function submit(){\n $.ajax({\n method: \"POST\",\n url: \"/userinput\",\n data: {\n numberOne: numOne,\n numberTwo: numTwo,\n operator: operator\n }\n })\n .done(function (response){\n console.log('You did such a great job :)');\n getresults();\n \n });\n\n}", "title": "" }, { "docid": "854547bd570310ef2e28c5362d193e34", "score": "0.55643964", "text": "function searchRequest(query_terms)\n{\n $.ajax\n ({\n type: \"GET\",\n url: \"/search/\",\n data: {'q' : query_terms,\n 't' : window.search.result_type},\n success: paginateResults\n });\n}", "title": "" }, { "docid": "bef0418bec3d2e22a810e194600d27b0", "score": "0.55497223", "text": "function requestResults()\n{\n\tvar input = $('.requestInput').val();\n\t$('.requestInput').val(''); //reset textbox\n\tvar inputArray = input.split('-');\n\n\tif(inputArray.length == 1)\n\t{\n\t\tinputArray.push(\"\");\n\t}\n\n\t//loads request\n\tvar song = escape(inputArray[0].trim());\n\tvar artist = escape(inputArray[1].trim());\n\n\twindow.location.href = ip+\"results.php?song=\"+song.replace(/^\\s+|\\s+$/g, \"\")+\"&artist=\"+artist.replace(/^\\s+|\\s+$/g, \"\");\n}", "title": "" }, { "docid": "c7e435d42cce8bf5de64f490977c0c36", "score": "0.55469227", "text": "function onint(){\n // take off all events from the searchfield\n $(\"#rstable_wrapper input[type='search']\").off();\n\n // Use return key to trigger search\n $(\"#rstable_wrapper input[type='search']\").on(\"keydown\", function(evt){\n if(evt.keyCode == 13){\n var hnum = $(\"input[type='search']\").val();\n //alert(\"search val\"+hnum);\n $('#rstable').DataTable().ajax.url(\"/users/hnum?hnum=\"+hnum).load();\n }\n });\n\n /* $(\"#btnrtable\").button().on(\"click\", function(){\n $(\"#example\").DataTable().search($(\"input[type='search']\").val()).draw();\n });*/\n}", "title": "" }, { "docid": "b0fef2d65b0361b32c3fe5871769adfa", "score": "0.5545125", "text": "function search_it(){\n new Ajax.Request( \"world.php\",{\n method: \"get\",\n parameters: $('term').serialize(true),\n onSuccess: search\n });\n}", "title": "" }, { "docid": "5cfd3a721dfb36f8b5b9d79b94d10e6e", "score": "0.55432016", "text": "function sendQuery(query) {\r\n //Setup XMLHttpRequest\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n document.getElementById('AdminCollection').innerHTML = this.responseText;\r\n }\r\n };\r\n //Send request\r\n xmlhttp.open(\"POST\", \"ManageIdeas.php\", true);\r\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n xmlhttp.send(\"sql=\" + query);\r\n\r\n}", "title": "" }, { "docid": "d8bbee544526fe39dccca86a31ff6a4a", "score": "0.55430937", "text": "function onSearchType($search) {\n var $wrap = $search.parents('.kb-search__input-wrap');\n var needle = $search.val() && $search.val().trim();\n var $topics = $wrap.find('input[name=\"topics\"]');\n var topics = $topics.length ? $topics.val() : null;\n var $kbId = $wrap.find('input[name=\"kb_id\"]');\n var $lang = $wrap.find('input[name=\"lang\"]');\n var kbId = $kbId.length ? parseInt($kbId.val()) : null;\n var searchParams = {\n action: 'mkb_kb_search',\n search: needle,\n mode: searchMode\n };\n\n if (kbId) {\n searchParams.kb_id = kbId;\n }\n\n if (topics) {\n searchParams.topics = topics;\n }\n\n if ($lang.length && $lang.val()) {\n searchParams.lang = $lang.val();\n }\n\n var serializedParams = serializeRequestParams(searchParams);\n\n if (needle) {\n $wrap.addClass(HAS_CONTENT_CLASS);\n } else {\n $wrap.removeClass(HAS_CONTENT_CLASS);\n }\n\n // check cache for response\n if (settings['search_request_fe_cache'] && searchCache[serializedParams]) {\n // track cached result, if it wasn tracked before\n if (searchMode === 'nonblocking') {\n handleNonBlockingTracking(searchParams);\n }\n\n return handleSearchResultsReceive.call(this, $search, searchCache[serializedParams]);\n }\n\n if (!needle || needle.length < searchNeedleLength) {\n hasResults = false;\n resultsCount = 0;\n activeResult = -1;\n $wrap.removeClass(HAS_RESULTS_CLASS).removeClass(NO_RESULTS_CLASS);\n\n if (searchMode === 'nonblocking' && needle.length > 0) {\n fakeRequest($wrap); // progress indicator for input to be more responsive\n }\n\n return;\n }\n\n if (searchMode === 'nonblocking') {\n handleNonBlockingTracking(searchParams);\n }\n\n if (searchMode === 'blocking') {\n $search.attr('disabled', 'disabled');\n }\n\n $wrap.addClass(REQUEST_CLASS);\n ++searchRequestsCount;\n\n $.ajax({\n method: settings['live_search_use_post'] ? 'POST' : 'GET',\n url: ajaxUrl,\n dataType: 'json',\n data: searchParams\n })\n .then(function(response) {\n if (settings['search_request_fe_cache']) {\n searchCache[serializedParams] = response;\n }\n\n return handleSearchResultsReceive.call(this, $search, response);\n }.bind(this))\n .always(function () {\n if (searchMode === 'blocking') {\n $search\n .attr('disabled', false)\n .focus();\n }\n\n --searchRequestsCount;\n\n if (searchRequestsCount === 0) {\n $wrap.removeClass(REQUEST_CLASS);\n }\n });\n }", "title": "" }, { "docid": "9c112399883e7c8e7e9049dd2bf5838d", "score": "0.5541914", "text": "function doHashSearch() {\n var page_interface = $('#interface_type');\n var query = getHashValue('query');\n var page = getHashValue('page');\n\n if (query) {\n if (!page || isNaN(page)) {\n page = 1;\n }\n\n if (/\\S/.test(query)) { // Check if string contains at least one non-whitespace character\n var queryField = $('#query');\n\n if (parseInt(page_interface.val()) != 1) {\n query = query.replace(/\\+/g, ' ');\n queryField.val(query);\n var formSerialized = $('form').serialize();\n formSerialized += '&page=' + page;\n processRequest(formSerialized, true);\n }\n else {\n // With an interface of 1, we have to pull the previous querystring from the server!\n $.ajax({\n url: APP_ROOT + 'searcha_querystring/',\n success: function(data) {\n interface1Querystring = data['querystring'];\n interface1Querystring += '&page=' + page;\n interface1Querystring += '&noDelay=true';\n interface1Querystring += '&csrfmiddlewaretoken=' + $('input[name=csrfmiddlewaretoken]').val();\n processRequest(interface1Querystring, true);\n }\n });\n }\n }\n }\n}", "title": "" }, { "docid": "5d3cf61d080f13113c7e938eb3af46f6", "score": "0.5541222", "text": "function search() {\r\n var query_value = $('#support_summary').val();\r\n if( query_value !== '' ) {\r\n $.ajax({\r\n type: \"POST\",\r\n url: ajaxurl,\r\n data: {\r\n\t action : 'rocket_helpscout_live_search',\r\n\t query : query_value\r\n\t },\r\n success: function(html) {\r\n\t html = JSON.parse(html);\r\n if ( html ) {\r\n\t \tlast_search_results[ query_value ] = html;\r\n\t \t$(\"#support_searchbox-suggestions ul\").html(html);\r\n\t\t\t\t\t\t$(\"#support_searchbox\").fadeIn();\r\n\t\t\t\t\t}\r\n $('#support_summary').parents('fieldset').attr( 'data-loading', \"false\" );\r\n }\r\n });\r\n }\r\n return false;\r\n }", "title": "" }, { "docid": "5d3cf61d080f13113c7e938eb3af46f6", "score": "0.5541222", "text": "function search() {\r\n var query_value = $('#support_summary').val();\r\n if( query_value !== '' ) {\r\n $.ajax({\r\n type: \"POST\",\r\n url: ajaxurl,\r\n data: {\r\n\t action : 'rocket_helpscout_live_search',\r\n\t query : query_value\r\n\t },\r\n success: function(html) {\r\n\t html = JSON.parse(html);\r\n if ( html ) {\r\n\t \tlast_search_results[ query_value ] = html;\r\n\t \t$(\"#support_searchbox-suggestions ul\").html(html);\r\n\t\t\t\t\t\t$(\"#support_searchbox\").fadeIn();\r\n\t\t\t\t\t}\r\n $('#support_summary').parents('fieldset').attr( 'data-loading', \"false\" );\r\n }\r\n });\r\n }\r\n return false;\r\n }", "title": "" }, { "docid": "a9812ccd1d0cd3d73d390750c8786dd9", "score": "0.5536673", "text": "function checkSetQuery(e) {\n e.target.value == \"\" || e.target.value == null?\n setQuery(null): (setQuery(e.target.value), setCount(1))\n }", "title": "" }, { "docid": "5eed8eeec218e69b7bed00b520455b74", "score": "0.55289114", "text": "function submitSearchQuery() {\n //searchTerms corresponds to to the main search bar\n var queryBar = document.getElementById(\"searchTerms\");\n if (queryBar.options.length < 1) {\n // searchTerms2 corresponds to the home page search bar\n queryBar = document.getElementById(\"searchTerms2\");\n }\n query = ''\n for (var i = 0, len = queryBar.options.length; i < len; i++) {\n opt = queryBar.options[i]\n if (opt.selected === true) {\n query += opt.value + \" \";\n }\n }\n\n if (query) {\n window.location.href = window.location.protocol + \"//\" +\n window.location.host + window.location.pathname + '?' + 'q=' +\n encodeURIComponent(query.trim());\n }\n}", "title": "" }, { "docid": "051a6c818263ef72212727cf7b2da18d", "score": "0.5507135", "text": "function comicSearch() {\r\n //var comicID = (<HTMLInputElement> document.getElementById(\"comicID\"));\r\n var query = document.getElementById(\"searchQuery\").value;\r\n var cquery = { \"comicQuery\": query };\r\n notifyUser('Searching Through Comics', 'glyphicon glyphicon-retweet', \"info\");\r\n $.ajax({\r\n type: \"GET\",\r\n url: \"/search/text\",\r\n contentType: \"application/json; charset=utf-8\",\r\n data: cquery,\r\n async: true,\r\n timeout: 4000,\r\n dataType: 'json',\r\n success: function (data) {\r\n renderSearchResults(\"searchResContainer\", JSON.stringify(data), userType);\r\n notifyUser('Showing Search Results', 'glyphicon glyphicon-ok', \"success\");\r\n },\r\n error: function (xhr, ajaxOptions, thrownError) {\r\n notifyUser('Error: Retry Search', 'glyphicon glyphicon-remove', \"danger\");\r\n }\r\n });\r\n}", "title": "" }, { "docid": "1363f94c80c082f652964c66c2d96510", "score": "0.5500244", "text": "function search(query = $(\".input\").val()) {\r\n\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n url: getBackendUrl(`/randgif/gif/${encodeURIComponent(query)}`),\r\n dataType: \"json\",\r\n success: onSearchSuccess,\r\n statusCode: {\r\n 404: function () {\r\n alert(\"page not found\");\r\n },\r\n 500: function () {\r\n alert(\"server error\");\r\n },\r\n }\r\n });\r\n}", "title": "" } ]
ffc88835d87f5a27144ddfe3043546e6
Takes into account the origin offset For example, this takes a geographic coordinate and returns a point relative to the three.js / 3D origin (0,0)
[ { "docid": "d4bc81d94e1ed327dc79d5c85545bdef", "score": "0.0", "text": "latLonToPoint(latlon) {\n var projectedPoint = this.project(LatLon(latlon));\n return projectedPoint._subtract(this._originPoint);\n }", "title": "" } ]
[ { "docid": "75500d1880d00da48546b33d2161d115", "score": "0.68798923", "text": "origin() {\n\t\treturn { x: -3, y: -4 };\n\t}", "title": "" }, { "docid": "36b92c7b8395f0293a89dc9cebc99e0e", "score": "0.614932", "text": "function qsc_shift_lon_origin(lon, offset) {\n var slon = lon + offset;\n if (slon < -M_PI) {\n slon += M_TWOPI;\n } else if (slon > +M_PI) {\n slon -= M_TWOPI;\n }\n return slon;\n }", "title": "" }, { "docid": "2fdc20a72b2455d38ef1f451bb5ed103", "score": "0.614872", "text": "get position() { return p5.prototype.createVector(0, this.height + Earth.RADIUS, 0); }", "title": "" }, { "docid": "36f96b8b404cc2a00eeb93f3acdfcd23", "score": "0.61430126", "text": "function physics2Origin(point){ return [point[0] - Globals.origin[0], point[1] - Globals.origin[1]]; }", "title": "" }, { "docid": "484cf8617214eacb2ce6004b6be064cd", "score": "0.6067364", "text": "function getRelativePoint(xy) {\r\n\t\tsets = $['mapsettings'];\r\n\t\tvar percentxy = new Point( ((xy.x*100/sets.resolutions[sets.resolutions.length-1].width)/100) ,((xy.y*100/sets.resolutions[sets.resolutions.length-1].height)/100));\r\n\t\tvar offset = new Point(percentxy.x*sets.resolutions[sets.zoom-1].width,percentxy.y*sets.resolutions[sets.zoom-1].height);\r\n\t\toffset = new Point(Math.round(offset.x), Math.round(offset.y));\r\n\t\treturn offset;\r\n\t}", "title": "" }, { "docid": "6cc72f87dffb3fc554c44b506d0a5ad0", "score": "0.6029039", "text": "function qsc_shift_lon_origin(lon, offset) {\n var slon = lon + offset;\n if (slon < -SPI) {\n slon += TWO_PI;\n } else if (slon > +SPI) {\n slon -= TWO_PI;\n }\n return slon;\n}", "title": "" }, { "docid": "ec4943daaa7042b648e9cd71c1a78933", "score": "0.60156804", "text": "function getOriginX() {\n\t\treturn Math.min(this.originX, this.finalX);\n\t}", "title": "" }, { "docid": "070305f2488f1859e092f1d82d2c0ae4", "score": "0.6001736", "text": "function toLocalPoint(globalPosition) {\n\n var viewbox = canvas.viewbox();\n\n var clientRect = canvas._container.getBoundingClientRect();\n\n return {\n x: viewbox.x + (globalPosition.x - clientRect.left) / viewbox.scale,\n y: viewbox.y + (globalPosition.y - clientRect.top) / viewbox.scale\n };\n }", "title": "" }, { "docid": "070305f2488f1859e092f1d82d2c0ae4", "score": "0.6001736", "text": "function toLocalPoint(globalPosition) {\n\n var viewbox = canvas.viewbox();\n\n var clientRect = canvas._container.getBoundingClientRect();\n\n return {\n x: viewbox.x + (globalPosition.x - clientRect.left) / viewbox.scale,\n y: viewbox.y + (globalPosition.y - clientRect.top) / viewbox.scale\n };\n }", "title": "" }, { "docid": "8ee3e6259a96fbd96c0fdb10ef9bbf78", "score": "0.5959931", "text": "function qsc_shift_lon_origin(lon, offset) {\n var slon = lon + offset;\n if (slon < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) {\n slon += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"TWO_PI\"];\n } else if (slon > +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) {\n slon -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"TWO_PI\"];\n }\n return slon;\n}", "title": "" }, { "docid": "ed4c45d9856dca9a50085e95fb48f8f1", "score": "0.59577256", "text": "function WorldToLocal(x, y, scale)\n{\n\tvar relativeX = (character.real_x - x)*scale * -1;\n\tvar relativeY = (character.real_y - y)*scale * -1;\n\t\n\treturn {x: relativeX, y: relativeY};\n}", "title": "" }, { "docid": "472411df1b97df58f637dfabb1c86eaf", "score": "0.5953909", "text": "function getProjectedPosition(width, height, position) {\r\n\t/*\r\n\t\tUsing the coordinates of a country in the 3D space, this function will\r\n\t\treturn the 2D coordinates using the camera projection method.\r\n\t*/\r\n\tposition = position.clone();\r\n\tvar projected = position.project(camera.object);\r\n\treturn {\r\n\t\tx: (projected.x * width) + width,\r\n\t\ty: -(projected.y * height) + height\r\n\t};\r\n}", "title": "" }, { "docid": "c10070bb7d4894a1274e74272cced14e", "score": "0.59517175", "text": "function toLocalPoint(globalPosition) {\n\n var viewbox = canvas.viewbox();\n\n var clientRect = canvas._container.getBoundingClientRect();\n\n return {\n x: viewbox.x + round((globalPosition.x - clientRect.left) / viewbox.scale),\n y: viewbox.y + round((globalPosition.y - clientRect.top) / viewbox.scale)\n };\n }", "title": "" }, { "docid": "9c416fb3cc425babf2da39dac696fa13", "score": "0.5935573", "text": "function getAbsolutePoint(xy) {\r\n\t\tsets = $['mapsettings'];\r\n\t\tvar percentxy = new Point( ((xy.x*100/sets.resolutions[sets.zoom-1].width)/100) ,((xy.y*100/sets.resolutions[sets.zoom-1].height)/100));\r\n\t\tvar offset = new Point(percentxy.x*sets.resolutions[sets.resolutions.length-1].width,percentxy.y*sets.resolutions[sets.resolutions.length-1].height);\r\n\t\treturn offset;\r\n\t}", "title": "" }, { "docid": "bdf8f8e7c47a3ceb1260b5f610f2fd83", "score": "0.59333396", "text": "function toLocalPoint(globalPosition) {\n var viewbox = canvas.viewbox();\n var clientRect = canvas._container.getBoundingClientRect();\n return {\n x: viewbox.x + (globalPosition.x - clientRect.left) / viewbox.scale,\n y: viewbox.y + (globalPosition.y - clientRect.top) / viewbox.scale\n };\n }", "title": "" }, { "docid": "eb1e2934a2b46887fa0045a5c943cff4", "score": "0.5921974", "text": "function toLocalPoint(globalPosition) {\n var viewbox = canvas.viewbox();\n\n var clientRect = canvas._container.getBoundingClientRect();\n\n return {\n x: viewbox.x + (globalPosition.x - clientRect.left) / viewbox.scale,\n y: viewbox.y + (globalPosition.y - clientRect.top) / viewbox.scale\n };\n } // helpers", "title": "" }, { "docid": "fda58d7a26daa74c26b4c262d6d1b3b3", "score": "0.58964396", "text": "function hackMapProjection(lat, lon, originLat, originLon) {\n var lonCorrection = 1;\n var rMajor = 6378137.0;\n\n function lonToX(lon) {\n return rMajor * (lon * Math.PI / 180);\n }\n\n function latToY(lat) {\n if (lat === 0) {\n return 0;\n } else {\n return rMajor * Math.log(Math.tan(Math.PI / 4 + (lat * Math.PI / 180) / 2));\n }\n }\n\n var x = lonToX(lon - originLon) / lonCorrection;\n var y = latToY(lat - originLat);\n\n return {'x': x, 'y': y};\n}", "title": "" }, { "docid": "eba825520f0dc2f88b5eb6ef0c760cd9", "score": "0.5858908", "text": "getCenter() {\n let point = L.CRS.EPSG3857.latLngToPoint(this.map.getCenter(), this.map.getZoom());\n let rMap = document.getElementById(this.id);\n if (rMap.clientWidth > rMap.clientHeight) {\n point.x -= this.map.getSize().x * 0.15;\n } else {\n //point.y += this.map.getSize().y * 0.15;\n }\n let location = L.CRS.EPSG3857.pointToLatLng(point, this.map.getZoom());\n return location;\n }", "title": "" }, { "docid": "570d945504172fb874d5be2ca329ad61", "score": "0.57958114", "text": "calculatePosition() {\n const x = (this.mCornerRTF.x + this.mCornerLBB.x) * 0.5;\n const y = (this.mCornerRTF.y + this.mCornerLBB.y) * 0.5;\n const z = (this.mCornerRTF.z + this.mCornerLBB.z) * 0.5;\n const position = new THREE.Vector3(x, y, z);\n\n return position;\n }", "title": "" }, { "docid": "c4dc950308a44c177afef64e1d7e4064", "score": "0.57902634", "text": "function computeOrigin(x, y, quad, vec) {\r\n\r\n switch (quad) {\r\n case 2:\r\n vec = computeCameraOrientation(x, y, quad, vec);\r\n break;\r\n case 3:\r\n vec = computeCameraOrientation(x, y, quad, vec);\r\n break;\r\n case 4:\r\n vec = computeCameraOrientation(x, y, quad, vec);\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "e72751b9689ae1bf91f26a54fbd12859", "score": "0.5776673", "text": "get origin() {\n return { x: this.x, y: this.y };\n }", "title": "" }, { "docid": "8fbbd0f373c0cdf430b7c02bf4e859d5", "score": "0.5732932", "text": "_projectCoordinates() {\n var _point;\n return this._coordinates.map(latlon => {\n _point = this._world.latLonToPoint(latlon);\n\n // TODO: Is offset ever being used or needed?\n if (!this._offset) {\n this._offset = Point(0, 0);\n this._offset.x = -1 * _point.x;\n this._offset.y = -1 * _point.y;\n\n this._options.pointScale = this._world.pointScale(latlon);\n }\n\n return _point;\n });\n }", "title": "" }, { "docid": "8a725019950b432b7ba9404752e684ea", "score": "0.570151", "text": "function getInitialLocation(){\n\t\t\t\tvar latitude = $surface.attr('latitude');\n\t\t\t\tvar longitude = $surface.attr('longitude');\n\t\t\t\tvar latlng = new google.maps.LatLng(latitude, longitude);\n\t\t\t\treturn latlng;\n\t\t\t}", "title": "" }, { "docid": "bc8cf805c2628c6e648f2ffbb073c67e", "score": "0.57012784", "text": "function proj(coord){\n var x = (coord[0] - min_lon) / lon_width;\n var y = (coord[1] - min_lat) / lat_width;\n\n return [x * width, y * height]; \n}", "title": "" }, { "docid": "6d15492d47623ee482d20ca17f4663fb", "score": "0.5687193", "text": "get3DMousePosition(z=0) {\n // https://stackoverflow.com/questions/13055214/mouse-canvas-x-y-to-three-js-world-x-y-z\n \n vec.set(\n this.relativeMouse.x,\n this.relativeMouse.y,\n z);\n\n vec.unproject( this.camera );\n \n vec.sub( this.camera.position ).normalize();\n \n var distance = - this.camera.position.z / vec.z;\n \n pos.copy( this.camera.position ).add( vec.multiplyScalar( distance ) );\n\n return pos;\n }", "title": "" }, { "docid": "623eda04c942463e068d6212ace0456a", "score": "0.5681399", "text": "function offset(e) {\n e = e || window.event;\n var target = e.target || e.srcElement, rect = target.getBoundingClientRect(), offsetX = e.clientX - rect.left, offsetY = e.clientY - rect.top;\n return vec2.fromValues(offsetX, offsetY);\n }", "title": "" }, { "docid": "623eda04c942463e068d6212ace0456a", "score": "0.5681399", "text": "function offset(e) {\n e = e || window.event;\n var target = e.target || e.srcElement, rect = target.getBoundingClientRect(), offsetX = e.clientX - rect.left, offsetY = e.clientY - rect.top;\n return vec2.fromValues(offsetX, offsetY);\n }", "title": "" }, { "docid": "8229261b46003447c4ade9e952ff8f96", "score": "0.56790537", "text": "function Origin(){\n this.x = midWidth;\n this.y = midHeight;\n}", "title": "" }, { "docid": "eeab3beaea7336991e885c3bd4cb81cc", "score": "0.56607276", "text": "getCenterPoint() {\n return this.getIntermediatePoint(0.5);\n }", "title": "" }, { "docid": "cfad8c3678bda2b9b0f8a346c88145fd", "score": "0.5660515", "text": "getCenter(){\n\t\treturn {\n\t\t\tx: 2,\n\t\t\ty: 2\n\t\t};\n\t}", "title": "" }, { "docid": "cb7547d0dcea28903862199a7449f3d4", "score": "0.56547403", "text": "function getPos(joint) {\n return createVector(joint.cameraX*width/4, -joint.cameraY*width/4, joint.cameraZ*100);\n}", "title": "" }, { "docid": "fa6c0e93e52cf5211009e63388e11791", "score": "0.56521654", "text": "function getMapCenter() {\n \n var mapCenterCoords = [30, 0];\n\n return mapCenterCoords;\n \n}", "title": "" }, { "docid": "a2d532332458dfa2b6a3dd6454f687ef", "score": "0.564201", "text": "function getWorldPosition(_ref7) {\n var longitude = _ref7.longitude,\n latitude = _ref7.latitude,\n zoom = _ref7.zoom,\n scale = _ref7.scale,\n meterOffset = _ref7.meterOffset,\n _ref7$distanceScales = _ref7.distanceScales,\n distanceScales = _ref7$distanceScales === undefined ? null : _ref7$distanceScales;\n\n // Calculate scale from zoom if not provided\n scale = scale !== undefined ? scale : zoomToScale(zoom);\n\n // Make a centered version of the matrix for projection modes without an offset\n var center2d = lngLatToWorld([longitude, latitude], scale);\n var center = new __WEBPACK_IMPORTED_MODULE_0_math_gl__[\"b\" /* Vector3 */](center2d[0], center2d[1], 0);\n\n if (meterOffset) {\n // Calculate distance scales if lng/lat/zoom are provided\n distanceScales = distanceScales || getDistanceScales({ latitude: latitude, longitude: longitude, scale: scale });\n\n var pixelPosition = new __WEBPACK_IMPORTED_MODULE_0_math_gl__[\"b\" /* Vector3 */](meterOffset)\n // Convert to pixels in current zoom\n .scale(distanceScales.pixelsPerMeter)\n // We want positive Y to represent an offset towards north,\n // but web mercator world coordinates is top-left\n .scale([1, -1, 1]);\n center.add(pixelPosition);\n }\n\n return center;\n}", "title": "" }, { "docid": "a0e090a2194d4a18dbd856334c5ba36f", "score": "0.56366396", "text": "function getCenterPoint() {\n var p = root.createSVGPoint();\n // center of 1024, 768\n p.x = 512;\n p.y = 384;\n return p;\n}", "title": "" }, { "docid": "d8e7f390aaf15498ff3f5637bdb4c1fa", "score": "0.56359804", "text": "function getPos(joint) {\n return createVector((joint.cameraX * width/2) + width/2, (-joint.cameraY * width/2) + height/2);\n}", "title": "" }, { "docid": "67e404a6f3373d9fea5e5c10b1c9f780", "score": "0.56211126", "text": "function calcPos() {\n\t\t// Current coordinates\n\t\tvar coords = sphoords.getCoordinates();\n\t\tvar coords_deg = sphoords.getCoordinatesInDegrees();\n\n\t\t// Corresponding position on the sphere\n\t\treturn {\n\t\t\t\tx: radius * Math.cos(coords.latitude) * Math.sin(coords.longitude),\n\t\t\t\ty: radius * Math.cos(coords.latitude) * Math.cos(coords.longitude),\n\t\t\t\tz: radius * Math.sin(coords.latitude),\n\t\t\t\tlong: coords_deg.longitude,\n\t\t\t\tlat: coords_deg.latitude,\n\t\t\t\torientation: sphoords.getScreenOrientation()\n\t\t\t};\n\t}", "title": "" }, { "docid": "507a8c2d4d16d12559fbb30186df65b8", "score": "0.56207323", "text": "get worldSpaceViewerPosition() {\n\t\treturn SpiderGL.Math.Vec3.dup(this.worldSpaceViewerPosition$);\n\t}", "title": "" }, { "docid": "1b7908466eeb17e43715861177b262e7", "score": "0.56145847", "text": "atZero() {\n let mp = this.bounds.midpoint;\n return this.translated(-mp.x, -mp.y, -mp.z);\n }", "title": "" }, { "docid": "d3e57af40b8e11dc598abd0e5bdeca75", "score": "0.56007695", "text": "getCenterPosition() {\n\t\tlet center = this.getCenter();\n\t\treturn {\n\t\t\tx: this.x + center.x,\n\t\t\ty: this.y + center.y\n\t\t};\n\t}", "title": "" }, { "docid": "f1bff77aa4677cb3d79a481259945a9d", "score": "0.55990356", "text": "_setWorldTransformOrigin() {\n // set transformation origin relative to world space as well\n this._boundingRect.world.transformOrigin = new Vec3(\n (this.transformOrigin.x * 2 - 1) // between -1 and 1\n * this._boundingRect.world.width,\n -(this.transformOrigin.y * 2 - 1) // between -1 and 1\n * this._boundingRect.world.height,\n this.transformOrigin.z\n );\n }", "title": "" }, { "docid": "d0f0b09481a213cd49284c144cf9eb46", "score": "0.55921835", "text": "function calculateCenter() {\n center = map.getCenter();\n}", "title": "" }, { "docid": "45e2b2fff4194884634bb0b3a1936dbe", "score": "0.55887496", "text": "function planeCoordToAbsScreenPosition(coordX, coordY, offsetX, offsetY) {\n // account for plane's \"origin\" being different than the canvas origin.\n // also account for canvas not starting at 0,0 in document's body.\n // offset var allows for small adjustments\n let screenPosX = (coordX * gridSpacing) + (plane.width / 2) +\n plane.offsetLeft + offsetX;\n let screenPosY = (-1 * coordY * gridSpacing) + (plane.height / 2) +\n plane.offsetTop + offsetY;\n // -1 flips y direction to graphics coord system (pos y goes down)\n\n return {\n x: screenPosX,\n y: screenPosY\n };\n}", "title": "" }, { "docid": "7409465c067f8a9a51ba5a4b603fe295", "score": "0.5581478", "text": "function getMiddlePoint(p1, p2) {\n return createVector((p1.x + p2.x) / 2, (p1.y + p2.y) / 2);\n}", "title": "" }, { "docid": "4b25abf59f76c93d9cd1671b668393d7", "score": "0.5564485", "text": "function origin2Physics(point){ return [point[0] + Globals.origin[0], point[1] + Globals.origin[1]]; }", "title": "" }, { "docid": "541aab2d17cf324b34203b1be27400d6", "score": "0.55640537", "text": "lngX(lon, worldSize) {\n return ((180 + lon) * (worldSize || this.worldSize)) / 360;\n }", "title": "" }, { "docid": "347d41380ea8552e6bc7c8a5f1c25bd2", "score": "0.55509186", "text": "function computeSpawnPointFromPosition(center, position) {\n let dist = Math.sqrt(position.lat*position.lat + position.lng*position.lng);\n let directionX = position.lat / dist;\n let directionY = position.lng / dist;\n let distFromOrigen = 0.01 * Panorama.getDistanceBetween(center, position);\n return {x: directionX * distFromOrigen, y: directionY * distFromOrigen, z: 0};\n}", "title": "" }, { "docid": "16189655e8654d26fb43b29c6aa50a70", "score": "0.5550031", "text": "project(coord, transMat) {\n var point = BABYLON.Vector3.TransformCoordinates(coord, transMat);\n // The transformed coordinates will be based on coordinate system\n // starting on the center of the screen. But drawing on screen normally starts\n // from top left. We then need to transform them again to have x:0, y:0 on top left.\n var x = point.x * this.workingWidth + this.workingWidth / 2.0 >> 0; // >>0 二进制右移 相当于取整\n var y = -point.y * this.workingHeight + this.workingHeight / 2.0 >> 0;\n return (new BABYLON.Vector2(x, y));\n }", "title": "" }, { "docid": "0beab0365519d578e30ef61c99db864b", "score": "0.55438226", "text": "function forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var dlat = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lat - this.lat0);\n p.x = this.x0 + (this.a * dlon * this.rc);\n p.y = this.y0 + (this.a * dlat);\n return p;\n}", "title": "" }, { "docid": "3b97b098efeb3f3143b9a2325bb2bc07", "score": "0.5532127", "text": "function calculateCenter(){\n center = map.getCenter();\n }", "title": "" }, { "docid": "40c2c016e0c5854fe1f10b96ab8e92d5", "score": "0.5516352", "text": "getMapCenter() {\n const windowPosition = new Cesium.Cartesian2(this.viewer.container.clientWidth / 2, this.viewer.container.clientHeight / 2);\n const pickRay = this.viewer.scene.camera.getPickRay(windowPosition);\n const result = {};\n const pickPosition = this.viewer.scene.globe.pick(pickRay, this.viewer.scene, result);\n if (pickPosition == undefined) {\n return null;\n }\n console.log(result);\n return result;\n }", "title": "" }, { "docid": "fc3e013bd003c775603e936992da88b8", "score": "0.5510316", "text": "get tileOrigin() {\n return { x: Math.round(this.x / 8), y: Math.round(this.y / 8) }\n }", "title": "" }, { "docid": "7d8cd79d4d3e0ae81ec9e4e76d2e95ec", "score": "0.54980564", "text": "function calculateCenter() {\r\n center = map.getCenter();\r\n}", "title": "" }, { "docid": "b4394354d67c05af77fdd34c35429bdb", "score": "0.5497295", "text": "function distanceFromOrigin(point) {\n let x = point[0];\n let y = point[1];\n return Math.pow(Math.pow(x, 2) + Math.pow(y, 2), 0.5);\n}", "title": "" }, { "docid": "4909b54c73772ddcee64f5af96a97eda", "score": "0.54914564", "text": "function getPlayerCoordinate()\r\n{\r\n\tvar player = getPlayerPosition();\r\n\t\r\n\treturn getCoordinate(player);\r\n}", "title": "" }, { "docid": "1bb14a68e76eb3a0d1eff1d8e813ce08", "score": "0.54788005", "text": "function getElementPosition() {\r\n obj = document.getElementById(\"threecanvas\");\r\n var curleft = 0, curtop = 0;\r\n if (obj.offsetParent) {\r\n do {\r\n curleft += obj.offsetLeft;\r\n curtop += obj.offsetTop;\r\n } while (obj = obj.offsetParent);\r\n return { x: curleft, y: curtop };\r\n }\r\n return undefined;\r\n}", "title": "" }, { "docid": "93d702748610de2404acc9fdb8016026", "score": "0.5465537", "text": "_coord(arr) {\n var a = arr[0], d = arr[1], b = arr[2];\n var sum, pos = [0, 0];\n sum = a + d + b;\n if (sum !== 0) {\n a /= sum;\n d /= sum;\n b /= sum;\n pos[0] = corners[0][0] * a + corners[1][0] * d + corners[2][0] * b;\n pos[1] = corners[0][1] * a + corners[1][1] * d + corners[2][1] * b;\n }\n return pos;\n }", "title": "" }, { "docid": "f9708a7a4983e82dd08cbc56ebdd00f4", "score": "0.54544705", "text": "function forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n var dlon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_adjust_lon__[\"a\" /* default */])(lon - this.long0);\n var dlat = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lat__[\"a\" /* default */])(lat - this.lat0);\n p.x = this.x0 + (this.a * dlon * this.rc);\n p.y = this.y0 + (this.a * dlat);\n return p;\n}", "title": "" }, { "docid": "f50728bc45e9cb580a0f3778bab08e68", "score": "0.5453767", "text": "function forward(p) {\n var lon = p.x;\n var lat = p.y;\n // convert to radians\n if (lat * __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"j\" /* R2D */] > 90 && lat * __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"j\" /* R2D */] < -90 && lon * __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"j\" /* R2D */] > 180 && lon * __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"j\" /* R2D */] < -180) {\n return null;\n }\n\n var x, y;\n if (Math.abs(Math.abs(lat) - __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"b\" /* HALF_PI */]) <= __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"a\" /* EPSLN */]) {\n return null;\n }\n else {\n if (this.sphere) {\n x = this.x0 + this.a * this.k0 * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(lon - this.long0);\n y = this.y0 + this.a * this.k0 * Math.log(Math.tan(__WEBPACK_IMPORTED_MODULE_4__constants_values__[\"f\" /* FORTPI */] + 0.5 * lat));\n }\n else {\n var sinphi = Math.sin(lat);\n var ts = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_tsfnz__[\"a\" /* default */])(this.e, lat, sinphi);\n x = this.x0 + this.a * this.k0 * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(lon - this.long0);\n y = this.y0 - this.a * this.k0 * Math.log(ts);\n }\n p.x = x;\n p.y = y;\n return p;\n }\n}", "title": "" }, { "docid": "4c20a7ed4fb9963d8f78ccd292c2234a", "score": "0.5445932", "text": "function computeOffsetOrigin(to, distance, heading) {\n heading = toRadians(heading);\n distance /= EARTH_RADIUS;\n // http://lists.maptools.org/pipermail/proj/2008-October/003939.html\n var n1 = Math.cos(distance);\n var n2 = Math.sin(distance) * Math.cos(heading);\n var n3 = Math.sin(distance) * Math.sin(heading);\n var n4 = Math.sin(toRadians(to.lat));\n // There are two solutions for b. b = n2 * n4 +/- sqrt(), one solution results\n // in the latitude outside the [-90, 90] range. We first try one solution and\n // back off to the other if we are outside that range.\n var n12 = n1 * n1;\n var discriminant = n2 * n2 * n12 + n12 * n12 - n12 * n4 * n4;\n if (discriminant < 0) {\n // No real solution which would make sense in LatLng-space.\n return null;\n }\n var b = n2 * n4 + Math.sqrt(discriminant);\n b /= n1 * n1 + n2 * n2;\n var a = (n4 - n2 * b) / n1;\n var fromLatRadians = Math.atan2(a, b);\n if (fromLatRadians < -Math.PI / 2 || fromLatRadians > Math.PI / 2) {\n b = n2 * n4 - Math.sqrt(discriminant);\n b /= n1 * n1 + n2 * n2;\n fromLatRadians = Math.atan2(a, b);\n }\n if (fromLatRadians < -Math.PI / 2 || fromLatRadians > Math.PI / 2) {\n // No solution which would make sense in LatLng-space.\n return null;\n }\n var fromLngRadians = toRadians(to.lng) -\n Math.atan2(n3, n1 * Math.cos(fromLatRadians) - n2 * Math.sin(fromLatRadians));\n return new LatLng(toDegrees(fromLatRadians), toDegrees(fromLngRadians));\n}", "title": "" }, { "docid": "37ddeb131e9c180ea416da462e423795", "score": "0.5437039", "text": "function getCameraWorldPosition() {\n let camera = document.getElementById('cameraPosition');\n let worldPos = new THREE.Vector3();\n return worldPos.setFromMatrixPosition(camera.object3D.matrixWorld);\n}", "title": "" }, { "docid": "c6d68a65c84175b2f1be3a39b70f548a", "score": "0.54343045", "text": "function globalToLocalX(gX) {\n\tvar delta = (MAP_SIZE - 1) / 2;\n\treturn gX - mapGlobalCenter.x + delta;\n}", "title": "" }, { "docid": "f6b2d9b9e92ba1d01e365c5abaf95f4e", "score": "0.5431584", "text": "function setScreenPerpCenter(point, camera) {\n // If it does not exist, create a new one\n if (!gplane) {\n var planeGeo = new THREE.PlaneGeometry(100, 100);\n var material = new THREE.MeshBasicMaterial({ visible: false });\n var plane = gplane = new THREE.Mesh(planeGeo, material);\n plane.visible = true; // Hide it..\n scene.add(gplane);\n }\n\n // Center at mouse position\n gplane.position.copy(point);\n\n // Make it face toward the camera\n gplane.quaternion.copy(camera.quaternion);\n}", "title": "" }, { "docid": "8e2215bfff4cf97628eb996cb8ae0fb8", "score": "0.5421481", "text": "get adjustedX() { return this.x - this.originX }", "title": "" }, { "docid": "6b63afbca3fc6ae73469695c14cc16fd", "score": "0.5417683", "text": "function getPos(joint) {\n return createVector((joint.z * xscl) + xshift, (joint.x * yscl) + yshift);\n}", "title": "" }, { "docid": "0f8f06c5d485f8982c8519a1be84de5d", "score": "0.54174775", "text": "function inverse$f(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lon = adjust_lon(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));\n lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));\n }\n else {\n lat = iqsfnz(this.e, 2 * p.y * this.k0 / this.a);\n lon = adjust_lon(this.long0 + p.x / (this.a * this.k0));\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "022ddf426568d17d7b89954fff30f3bd", "score": "0.5414662", "text": "function getRelativePosition(e, el) {\n div = document.getElementById(\"scene\");\n dim = div.getBoundingClientRect();\n x = Math.floor( ((e.clientX - dim.left) / pw) / level);\n y = Math.floor(((e.clientY - dim.top) / pw) / level);\n}", "title": "" }, { "docid": "ca38f5e3af5269518a8bb44bcafab16f", "score": "0.5410291", "text": "function pixelCoordinate(body){\n var result = {};\n result.x = body.state.pos.x + Globals.translation.x;\n result.y = body.state.pos.y - Globals.translation.y;\n return result;\n}", "title": "" }, { "docid": "cf41cb5e471e0ac849460b3281328cd2", "score": "0.5405213", "text": "function inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n\n var lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_adjust_lon__[\"a\" /* default */])(this.long0 + p.x / this.a);\n var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "ce11d0f315ef569fd46ae9569a619451", "score": "0.54028946", "text": "function correctCoordinates(x, y) {\n /* Correction for scrolling */\n x += document.body.scrollLeft + document.documentElement.scrollLeft;\n y += document.body.scrollTop + document.documentElement.scrollTop;\n\n /* Correction for canvas position */\n x -= canvas.offsetLeft + 1; /* <-- Weird! */\n y -= canvas.offsetTop;\n\n /* Correction for world's coordinate system */\n x -= camera.x;\n y -= camera.y;\n return new Vec2(x, y);\n }", "title": "" }, { "docid": "edc38273aefbcbeb4c2432fceba620a7", "score": "0.5401371", "text": "function getRelativeXY(x, y, svg, element){\n var p = svg.createSVGPoint();\n var ctm = element.getCTM();\n p.x = x;\n p.y = y;\n return p.matrixTransform(ctm);\n}", "title": "" }, { "docid": "14846f2188a2327135a3067865d2d7f7", "score": "0.54002464", "text": "function mapPointToScreenSpace(point) {\n\tlet scale = screen_height/(2*camera.zoom);\n\treturn {x:(camera.zoom+point.x)*scale*camera.aspect,y:(camera.zoom-point.y)*scale}\n}", "title": "" }, { "docid": "f5d7d845c2113e80bf2f9f4a6316ea2b", "score": "0.539697", "text": "function getOffset(element, x, y) {\n let rect = element.getBoundingClientRect();\n let newx = Math.round((x - rect.left) / (rect.right - rect.left) * canvas.width);\n let newy = Math.round((y - rect.top) / (rect.bottom - rect.top) * canvas.height);\n\n return new Position(newx, newy);\n}", "title": "" }, { "docid": "6e26b61913d8933a611164e80feff3b9", "score": "0.53964317", "text": "get center(): _Point {\n return Point(\n this.position.x + this.width / 2,\n this.position.y + this.height / 2\n )\n }", "title": "" }, { "docid": "da567fe0c5b39636b3fc10b05b278f5d", "score": "0.53914803", "text": "centerObj (gObj, offset = 0) {\n\t\t// Detect Main camera and grabs width and heigh of screen\n\t\tlet screenWidth = this.cameras.main.width;\n\t\tlet screenHeight = this.cameras.main.width;\n\n\t\t// Move the object\n\t\tgObj.x = screenWidth / 2;\n\t\tgObj.y = screenHeight / 2 - offset * 100;\n\t}", "title": "" }, { "docid": "dc4df5e4048715dcefdc249a2a68c05f", "score": "0.538639", "text": "function inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n\n var lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + p.x / this.a);\n var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "9bd49b2b9e6ecd018865a4751bbfa2e0", "score": "0.5384889", "text": "adjustPosition() {\n //this.geometry.applyMatrix( new THREE.Matrix4().makeTranslation( -(this.width / 2), 0, -(this.height / 2)) );\n this.geometry.translate(-(this.width / 2), 0, -(this.height / 2));\n }", "title": "" }, { "docid": "cef62aa1c2027a72787fc5f5977a26cd", "score": "0.53834", "text": "function buildLayoutProjectionTransformOrigin(_a) {\n var deltaFinal = _a.deltaFinal;\n return deltaFinal.x.origin * 100 + \"% \" + deltaFinal.y.origin * 100 + \"% 0\";\n}", "title": "" }, { "docid": "cef62aa1c2027a72787fc5f5977a26cd", "score": "0.53834", "text": "function buildLayoutProjectionTransformOrigin(_a) {\n var deltaFinal = _a.deltaFinal;\n return deltaFinal.x.origin * 100 + \"% \" + deltaFinal.y.origin * 100 + \"% 0\";\n}", "title": "" }, { "docid": "cef62aa1c2027a72787fc5f5977a26cd", "score": "0.53834", "text": "function buildLayoutProjectionTransformOrigin(_a) {\n var deltaFinal = _a.deltaFinal;\n return deltaFinal.x.origin * 100 + \"% \" + deltaFinal.y.origin * 100 + \"% 0\";\n}", "title": "" }, { "docid": "05dc8db324b46ac32ce1c9487504a081", "score": "0.5382127", "text": "function handleOrigin(){\n\tvar newZoom = DEFAULT_SIZE / blob.r*5; //Precalculate the new zoom.\n\tzoom = lerp(zoom, newZoom, ZOOM_ACC); //Slowly 'lerp' to the new zoom from the old zoom.\n\t\n\ttranslate(width/2, height/2); //Center the view.\n\tscale(zoom); //Scale the view.\n\ttranslate(-blob.pos.x, -blob.pos.y); //Translate view with respect to player movement.\n}", "title": "" }, { "docid": "c805ebce57c575c1fba0e14bea93669f", "score": "0.5381497", "text": "function getCenterXY() {\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tvar $this = sets.element;\r\n\t\tvar centerx = ($this.innerWidth()/2)-parseInt($('#inner').css('left'));\r\n\t\tvar centery = ($this.innerHeight()/2)-parseInt($('#inner').css('top'));\r\n\t\treturn new Point(centerx,centery);\r\n\t}", "title": "" }, { "docid": "8342aea0a95ba950e4e9a626389863bd", "score": "0.538001", "text": "function precal_loc() {\n buffer_loc.forEach((obj)=>{obj.x = (obj.longitude + 180) * 10; obj.y = (90 - obj.latitude) * 10;});\n}", "title": "" }, { "docid": "7673d0053df8495f172cbcf1d4fe4012", "score": "0.53792644", "text": "get worldSpaceViewerPosition$() {\n\t\treturn (this._c.wp || (this._c.wp = SpiderGL.Math.Vec4.to3(SpiderGL.Math.Mat4.col(this.viewMatrixInverse$, 3))));\n\t}", "title": "" }, { "docid": "5810d1bffa9159c19a4762eb33a23539", "score": "0.5370735", "text": "function latLongToVector3(lat, lon, r) {\n // http://www.smartjava.org/content/render-open-data-3d-world-globe-threejs\n\n var phi = lat * Math.PI / 180;\n var theta = (lon - 180) * Math.PI / 180;\n\n var x = -r * Math.cos(phi) * Math.cos(theta);\n var y = r * Math.sin(phi);\n var z = r * Math.cos(phi) * Math.sin(theta);\n\n return new THREE.Vector3(x, y, z);\n }", "title": "" }, { "docid": "67dd02fbe4dcf3303b7dab6de928e62d", "score": "0.53687894", "text": "position_from_offset(offset) {\n const [col, row] = this.col_row_from_offset(offset);\n return new Position(col, row);\n }", "title": "" }, { "docid": "663f21dfd3711b4c1828310de8608c56", "score": "0.53675115", "text": "GetWorldPoint(viewPoint)\n {\n let worldx = this.wo.dx + viewPoint[0]/this.zoom.now;\n let worldy = this.wo.dy + viewPoint[1]/this.zoom.now; \n return [worldx,worldy];\n }", "title": "" }, { "docid": "f39289fe563925a9c162428d74c62da4", "score": "0.536367", "text": "function proj(point) {\n // Shift the point by the camera's position.\n var shifted = [point[0] - camera[0], point[1] - camera[1], point[2] - camera[2]];\n // Rotate the point by the camera's rotation.\n var rotated = rotateX(\n rotateY(\n rotateZ(\n [shifted[0], shifted[1], shifted[2]],\n rotation[2]),\n rotation[1]),\n rotation[0]);\n if (rotated[2] <= 0 || rotated[2] > 100) {\n // Return false for points behind the camera or too far in front of it, which shouldn't be drawn.\n return false;\n }\n return [rotated[0] / rotated[2] * zoom, rotated[1] / rotated[2] * zoom];\n}", "title": "" }, { "docid": "b32f7c09726bd36beb25dd8f10541fb4", "score": "0.5361093", "text": "_getOriginPoint(originRect, pos) {\n let x;\n if (pos.originX == 'center') {\n // Note: when centering we should always use the `left`\n // offset, otherwise the position will be wrong in RTL.\n x = originRect.left + (originRect.width / 2);\n }\n else {\n const startX = this._isRtl() ? originRect.right : originRect.left;\n const endX = this._isRtl() ? originRect.left : originRect.right;\n x = pos.originX == 'start' ? startX : endX;\n }\n let y;\n if (pos.originY == 'center') {\n y = originRect.top + (originRect.height / 2);\n }\n else {\n y = pos.originY == 'top' ? originRect.top : originRect.bottom;\n }\n return { x, y };\n }", "title": "" }, { "docid": "2c00b8410cf413c202a6f9b224c0c304", "score": "0.53603923", "text": "function toScreenPosition(obj, camera, renderer){\n var vector = new THREE.Vector3();\n\n var widthHalf = 0.5*renderer.context.canvas.width;\n var heightHalf = 0.5*renderer.context.canvas.height;\n\n obj.updateMatrixWorld();\n vector.setFromMatrixPosition(obj.matrixWorld);\n vector.project(camera);\n\n vector.x = ( vector.x * widthHalf ) + widthHalf;\n vector.y = - ( vector.y * heightHalf ) + heightHalf;\n\n return {\n x: vector.x,\n y: vector.y\n };\n}", "title": "" }, { "docid": "ec8e4c364997c72db0b7401d1b4211ae", "score": "0.5355892", "text": "function inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));\n lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));\n }\n else {\n lat = Object(_common_iqsfnz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, 2 * p.y * this.k0 / this.a);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + p.x / (this.a * this.k0));\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "9af305a08622dd245aeacb05c0844256", "score": "0.5355252", "text": "function getCanvasXY (map, current_position) {\n var scale = Math.pow(2, map.getZoom());\n console.log(scale);\n var nw = new google.maps.LatLng(\n map.getBounds().getNorthEast().lat(),\n map.getBounds().getSouthWest().lng()\n );\n var world_coordinate_nw = map.getProjection().fromLatLngToPoint(nw);\n var world_coordinate = map.getProjection().fromLatLngToPoint(current_position);\n var position_offset = new google.maps.Point(\n Math.floor((world_coordinate.x - world_coordinate_nw.x) * scale),\n Math.floor((world_coordinate.y - world_coordinate_nw.y) * scale)\n );\n return position_offset;\n// console.log(nw);\n// console.log(world_coordinate_nw);\n }", "title": "" }, { "docid": "d34a0ac35a95845f34d180d17ed08647", "score": "0.5355182", "text": "function buildLayoutProjectionTransformOrigin(_a) {\n var x = _a.x, y = _a.y;\n return x.origin * 100 + \"% \" + y.origin * 100 + \"% 0\";\n}", "title": "" }, { "docid": "19d819667f7d3af1f85102950675b889", "score": "0.5353813", "text": "function lat_lng_inter_point(lat1, lng1, lat2, lng2, offset) {\r\n\r\n lat1 = lat1 * PI180;\r\n lng1 = lng1 * PI180;\r\n lat2 = lat2 * PI180;\r\n lng2 = lng2 * PI180;\r\n\r\n var d = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin((lat1 - lat2) / 2), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin((lng1 - lng2) / 2), 2)));\r\n var A = Math.sin((1 - offset) * d) / Math.sin(d);\r\n var B = Math.sin(offset * d) / Math.sin(d);\r\n var x = A * Math.cos(lat1) * Math.cos(lng1) + B * Math.cos(lat2) * Math.cos(lng2);\r\n var y = A * Math.cos(lat1) * Math.sin(lng1) + B * Math.cos(lat2) * Math.sin(lng2);\r\n var z = A * Math.sin(lat1) + B * Math.sin(lat2);\r\n var lat = Math.atan2(z, Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))) * 180 / Math.PI;\r\n var lng = Math.atan2(y, x) * 180 / Math.PI;\r\n\r\n return {\r\n lat: lat,\r\n lng: lng\r\n }\r\n}", "title": "" }, { "docid": "a922f357bcd4792af962be0a2f084bed", "score": "0.53500926", "text": "function latlngOffset(lat, dx, dy) {\n var dlat = dy / 111111;\n var dlng = dx / (111111 * Math.cos(toRadians(lat)));\n return {dlat: dlat, dlng: dlng};\n}", "title": "" }, { "docid": "32a2eacc50b21f67a682300b6ea08268", "score": "0.53472644", "text": "function relativePoint(e, element) {\n var p = element.point(e.screenX, e.screenY);\n p.x -= element.x();\n p.y -= element.y();\n return p;\n}", "title": "" }, { "docid": "24183a0394128cce6b914330a5b64d9f", "score": "0.5344304", "text": "function inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_adjust_lon__[\"a\" /* default */])(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));\n lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));\n }\n else {\n lat = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_iqsfnz__[\"a\" /* default */])(this.e, 2 * p.y * this.k0 / this.a);\n lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_adjust_lon__[\"a\" /* default */])(this.long0 + p.x / (this.a * this.k0));\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "title": "" }, { "docid": "0124dbf8a99906537fe15faacaab5c24", "score": "0.53414255", "text": "function forward(p) {\n var lon = p.x;\n var lat = p.y;\n // convert to radians\n if (lat * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] > 90 && lat * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] < -90 && lon * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] > 180 && lon * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] < -180) {\n return null;\n }\n\n var x, y;\n if (Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return null;\n }\n else {\n if (this.sphere) {\n x = this.x0 + this.a * this.k0 * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n y = this.y0 + this.a * this.k0 * Math.log(Math.tan(_constants_values__WEBPACK_IMPORTED_MODULE_4__[\"FORTPI\"] + 0.5 * lat));\n }\n else {\n var sinphi = Math.sin(lat);\n var ts = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, lat, sinphi);\n x = this.x0 + this.a * this.k0 * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n y = this.y0 - this.a * this.k0 * Math.log(ts);\n }\n p.x = x;\n p.y = y;\n return p;\n }\n}", "title": "" }, { "docid": "cc9f0c2317e8644a91eab96627588ed0", "score": "0.5340573", "text": "function getCenter (coord1, coord2) {\n if (!coord2) {\n return coord1\n }\n const lat = (coord1.lat + coord2.lat) / 2\n let lng = (coord1.lng + coord2.lng) / 2\n if ((coord1.lng > 90 && coord2.lng < -90) || (coord2.lng > 90 && coord1.lng < -90)) {\n lng = (coord1.lng + coord2.lng + 360) / 2\n if (lng > 180) {\n lng -= 360\n }\n }\n return {lat, lng}\n}", "title": "" }, { "docid": "78b475976b57865060f9bac02335e6dd", "score": "0.5337171", "text": "function getSceneCenter(){\n var lat = null;\n var lon = null;\n var alt = null;\n if (viewer.scene.mode == 3) {\n var windowPosition = new Cesium.Cartesian2(viewer.container.clientWidth / 2, viewer.container.clientHeight / 2);\n var pickRay = viewer.scene.camera.getPickRay(windowPosition);\n var pickPosition = viewer.scene.globe.pick(pickRay, viewer.scene);\n var pickPositionCartographic = viewer.scene.globe.ellipsoid.cartesianToCartographic(pickPosition);\n lon = pickPositionCartographic.longitude * (180 / Math.PI);\n lat = pickPositionCartographic.latitude * (180 / Math.PI);\n alt = viewer.camera.getMagnitude();\n } else if (viewer.scene.mode == 2) {\n var camPos = viewer.camera.positionCartographic;\n lat = camPos.latitude * (180 / Math.PI);\n lon = camPos.longitude * (180 / Math.PI);\n alt = viewer.camera.getMagnitude();\n }\n return [lat, lon, alt];\n}", "title": "" }, { "docid": "9291f9ce109689ee11d82684cf92e1c5", "score": "0.5328452", "text": "recenter(origin = Vector.zero) {\n this.originX = origin.x;\n this.originY = origin.y;\n }", "title": "" }, { "docid": "f841df919e644f9a23c501e1181986ff", "score": "0.5320666", "text": "resetOrigin()\n\t{\n\t\tvar centerX = this.canvasElement.innerWidth() / 2.0;\n\t\tvar centerY = this.canvasElement.innerHeight() / 2.0;\n\t\t\n\t\tvar centerFloorplan = this.floorplan.getCenter();\t\t\n\t\tthis.originX = Dimensioning.cmToPixel(centerFloorplan.x) - centerX;\n\t\tthis.originY = Dimensioning.cmToPixel(centerFloorplan.z) - centerY;\n\t\t\n\t\tthis.unScaledOriginX = Dimensioning.cmToPixel(centerFloorplan.x, false) - centerX;\n\t\tthis.unScaledOriginY = Dimensioning.cmToPixel(centerFloorplan.z, false) - centerY;\n\t\t\n//\t\tthis.originX = centerFloorplan.x * this.pixelsPerCm - centerX;\n//\t\tthis.originY = centerFloorplan.z * this.pixelsPerCm - centerY;\n\t}", "title": "" } ]
a99e68eca0b5cfba01720eb51f016b40
loads any already uploaded images loads images already uploaded
[ { "docid": "8834f84bb2d33d6472894dae7eb50b56", "score": "0.0", "text": "function getImages() {\n $http.get('/uploads')\n .then(function(response) {\n $scope.uploads = response.data;\n console.log('GET /uploads ', response.data);\n });\n }", "title": "" } ]
[ { "docid": "48eee06ee0a9d99b14f69aa7b82793e8", "score": "0.7618732", "text": "loadImages() {\n\t\t\twhile (this.imagesToLoad.length > 0) {\n\t\t\t\tlet slice = this.imagesToLoad.splice(0, 1);\n\t\t\t\tthis.replaceImage(slice[0]);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "3c3592d34cf0ee083704c91ce2f2f238", "score": "0.728223", "text": "async loadImages() {\n await this.run('loadImage', null, {\n getFieldType: this.getFieldType,\n getRemoteImage: this.getRemoteImage,\n updateNodes: this.updateNodes,\n options: this.options\n })\n }", "title": "" }, { "docid": "4aeee501328330379a809cd8b76abba7", "score": "0.72347945", "text": "function loadImages(){\n\t\tvar imageCount=items.length;\n\t\tfor(var i in items){\n\t\t\tif(items.hasOwnProperty(i)){\n\t\t\t var img = new Image();\n\t\t\t\t$(img).load(function() {\n\t\t\t\t\timagesLoaded++;\n\t\t\t\t\tif(imagesLoaded===imageCount){\n\t\t\t\t\t\t//all the images are loaded, display them all\n\t\t\t\t\t\tdisplayItems();\n\t\t\t\t\t}\n\t\t\t\t}).attr('src', items[i].thumbnail); \n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7ae3bd14a4d18b002b87b33d9ddf3848", "score": "0.70876145", "text": "function StartLoadImages() {\n if (m_isLoading) {\n return;\n }\n\n LoadImage();\n }", "title": "" }, { "docid": "f4dfe74f78e5b42851fffeb8e74e76e9", "score": "0.7051014", "text": "function loadImages() {\n for (var i = 0; i < imageInfoArray.length; i++) {\n var tmpImage = new CImages(imageInfoArray[i].name, imageInfoArray[i].fileName, checkLoaded);\n if (tmpImage != null) {\n tmpImage.load();\n imageInfoArray[i].cimage = tmpImage;\n }\n }\n }", "title": "" }, { "docid": "7d749358fffbcec61b327481c33f6fa5", "score": "0.7000904", "text": "function reloadImages() {\n\n $.ajax( {\n url: Y.doccirrus.infras.getPrivateURL( '/1/media/:list' ),\n data: { 'collection': ownerCollection, 'id': ownerId },\n type: 'GET',\n xhrFields: {\n withCredentials: true\n },\n success: onImageSetLoaded,\n error: onImageSetError\n } );\n }", "title": "" }, { "docid": "31c6de92d3d9d5d5a0205902596ea63c", "score": "0.6975643", "text": "function imagesLoad ( post ) {\n\t\t\t// POST === POST ID\n\t\t\tconsole.log(\"imagesLoad\");\n\t\t\t// CHECK IF NOT LOADED ALREADY\n\t\t\tif ( !$(\"body\").find(\"#wrapper_\" + post).length ) {\n\t\t\t\t// ADD LI TO LOAD WRAPPER\n\t\t\t\t$(\"#load_wrapper\").append(\"<li id='wrapper_\" + post + \"'></li>\");\n\n\t\t\t\t// AJAX CALL\n\t\t\t\t$( \"#wrapper_\" + post ).load(\"?p=\" + post, function () {\n\t\t\t\t\tconsole.log(\"Ajax loaded\");\n\t\t\t\t\t// IMAGESINJECT\n\t\t\t\t\timagesInject( post );\t\n\t\t\t\t\timagesAnim(); \n\t\t\t\t\tsetTimeout( function(){\n\t\t\t\t\t\timagesFadeIn();\t\t\t\t\t\t\n\t\t\t\t\t}, 500 );\n\t\t\t\t\t// ???\n\t\t\t\t\t// $(\".current\").find(\".duplicate\").show();\t//\t\t\n\t\t\t\t});\t\t\t\n\t\t\t} else {\n\t\t\t\tconsole.log(\"Already loaded.\");\n\t\t\t}\t\n\n\t\t}", "title": "" }, { "docid": "6b6cf844cf111de1258e09915c1bb897", "score": "0.69091094", "text": "function load_image_uploader() {\r\n if( $('.js-s3_file_field').length > 0 ) {\r\n var $progress = $('.progress');\r\n var $meter = $('.meter');\r\n $progress.hide('fast');\r\n\r\n $('.js-s3_file_field').each(function() {\r\n var progress = 0;\r\n var listID = $(this).attr('id') == 'usr_photo2' ? 'list2' : 'list';\r\n\r\n // process file fields for s3 upload\r\n processField($(this), $progress, goUpload, setAttr(), listID);\r\n });\r\n }\r\n}", "title": "" }, { "docid": "8517004bee87e6a0df48fc3da66d56ee", "score": "0.6882159", "text": "function loadAllImages() {\n var images = document.querySelectorAll('img[data-src]' );\n for (var i = 0; i < images.length; i++) {\n ImageLoader.load(images[i], {load: true});\n }\n }", "title": "" }, { "docid": "87f0b40967f703710af80f6914922bad", "score": "0.68593276", "text": "function loadImagesFromLocal() {\r\n if (packageList && packageList.length > 0) {\r\n for (i= 0; i < packageList.length; i++) {\r\n removeSpinner(packageList[i].id);\r\n document.getElementById(packageList[i].id)\r\n .setAttribute(\"src\", packageList[i].base64Img);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "df17345ae3210e76580b5471d907e3f6", "score": "0.68451226", "text": "function handleFileLoad(evt) {\n if (evt.item.type == \"image\") {\n images[evt.item.id] = evt.result;\n }\n}", "title": "" }, { "docid": "fe7880c0cfadded83361a96fd270e741", "score": "0.68434703", "text": "function photoLoad () {\n list = grabImages(gridObject.parent, nodes);\n imgList = binImages(gridObject.maxWidthHeighRatio, list);\n sizeImages(parent, imgList[0], imgList[1], gridObject.photoMargin, nodes);\n } // this waits until the last photo's onload event triggers to start...", "title": "" }, { "docid": "5524dad73a726547747d31b603784368", "score": "0.6836102", "text": "function loadImages(){\n // transforms DOM array into proper JS array\n function toArray(obj) {\n var array = [];\n // iterate backwards ensuring that length is an UInt32\n for (var i = obj.length >>> 0; i--;) { \n array[i] = obj[i];\n }\n return array;\n }\n var imgs = toArray(document.getElementsByTagName('img'));\n imgs.forEach(function(img){\n _images[img.id] = img;\n console.log(img.id, 'loaded');\n });\n \n console.log('all images loaded');\n }", "title": "" }, { "docid": "183fad28c574c807ee1ace1c9381bf74", "score": "0.6820409", "text": "function firstImageLoad() {\n $.getJSON(\"http://209.208.110.166:3000/images\")\n .then(function(results) {\n results.forEach(function(result) {\n imageQueue.push(result.image);\n });\n ee.emit('insertImage');\n });\n}", "title": "" }, { "docid": "4daa936e716ebfb7c366182b7e942bba", "score": "0.67814636", "text": "function handleFileLoad(evt) {\n\tif (evt.item.type == \"image\") { images[evt.item.id] = evt.result; }\n}", "title": "" }, { "docid": "72ee374a720b39939e5bcb3abfda93af", "score": "0.6777095", "text": "function loadImages()\n {\n hxp_overlay_text.text(\"Collecting all Images...\");\n let hxp_image_urls = [];\n let hxp_image_names = [];\n let hxp_image_short_urls = [];\n\n hxp_export_images.forEach((image_url) => {\n let stripped_image_url = image_url.replace(/\"/g, '');\n let index = stripped_image_url.lastIndexOf('/') + 1;\n hxp_image_names.push(stripped_image_url.substr(index));\n hxp_image_urls.push(stripped_image_url);\n index = stripped_image_url.indexOf('uploads') + 8;\n stripped_image_url = stripped_image_url.substring(index);\n hxp_image_short_urls.push(stripped_image_url);\n });\n\n let data = {\n 'action': 'hxp_save_images',\n 'image_urls': JSON.stringify(hxp_image_urls),\n 'image_names': JSON.stringify(hxp_image_names),\n };\n\n jQuery.post(hxp_ajax_object.ajax_url, data, (response) => {\n if (response == true)\n {\n hxp_overlay_text.text('Collecting all Images completed');\n console.info(\"Copy Images went well\");\n }\n else\n {\n hxp_overlay.css('display', 'none');\n alert('Something went wrong: Copy Images to export Folder');\n }\n });\n\n let response = {};\n response.names = hxp_image_names;\n response.paths = hxp_image_urls;\n response.shortPaths = hxp_image_short_urls;\n return response;\n }", "title": "" }, { "docid": "0c438044fb62d0b754d0d094b06c5a2f", "score": "0.6773939", "text": "async ensureImagesLoaded() {\n const images = config.getImages();\n\n for (const image of images) {\n await client.pull(image.name, {});\n\n // await client.pull(image.image, { authconfig: image.auth });\n }\n }", "title": "" }, { "docid": "539960d79cd12da6e42912e1b0f4cc60", "score": "0.6737432", "text": "function loadImagesAndSvgs(){\n for(var i=0; i<imagesAndSvgs.length; i++){\n (function(){\n var img = new Image();\n img.src = imagesAndSvgs[i];\n }());\n }\n }", "title": "" }, { "docid": "0c94bb55df69132403e168dfa6f30314", "score": "0.6737313", "text": "_startLoad() {\r\n let queue = this.queue;\r\n let len = this.queue.length;\r\n let imgRegEx = /.(jpg|gif|png)/;\r\n let loaded = [];\r\n\r\n for (var i = 0; i < len; ++i) {\r\n let item = queue[i];\r\n if (item.match(imgRegEx)) {}\r\n }\r\n }", "title": "" }, { "docid": "45a1286dcb1319b19790f5e69aed4d9b", "score": "0.6735071", "text": "function onImageLoad() {\n\t\t\t\timagesLoaded++;\n\t\t\t\t$element.trigger(self.IMAGE_LOADED, self.getStateData());\n\t\t\t\tif (imagesLoaded == imagesToLoad.length) {\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t$element.removeClass(\".load-images-loading\").addClass(\"load-images-loaded\");\n\t\t\t\t\t\t$element.trigger(self.IMAGES_LOADED, self.getStateData());\n\t\t\t\t\t}, options.delayAfterLoadedInMs);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "8d74f5c3c26b048b00bfb7da7bec0655", "score": "0.67348796", "text": "function loadpics(){\n getfiles();\n rotater();\n }", "title": "" }, { "docid": "813f8b6088bbc5493337dbfea74e7c28", "score": "0.6720196", "text": "function checkImages() {\n if (game.loadedImages >= game.requiredImages) {\n init();\n } else {\n setTimeout(function () {\n checkImages();\n }, 1);\n }\n }", "title": "" }, { "docid": "0f149f1580f8d3221f27a8f2bb3a8f86", "score": "0.67131376", "text": "function checkImages() {\n if (numImagesLoaded === images.length) {\n areImagesLoaded = true;\n } else { return; }\n\n\n //If the images have been loaded in, then get their data\n if (areImagesLoaded && !areImagesPrepped) {\n populateImageData();\n }\n}", "title": "" }, { "docid": "bb82855a3d7172cd8d614e9514473cbd", "score": "0.6712559", "text": "function loadImageList() {\n\n let params = {\n image_set_id: gImageSetId,\n filter_annotation_type_id: gFilterType\n };\n\n $.ajax(API_IMAGES_BASE_URL + 'imageset/load/?' + $.param(params), {\n type: 'GET',\n headers: gHeaders,\n dataType: 'json',\n success: function (data, textStatus, jqXHR) {\n if (data.image_set.images.length === 0) {\n // redirect to image set view.\n if (gFilterType === \"Unverified\") {\n $(\"#filter_annotation_type\").notify(\"All images are verified. :)\",\n {position: \"top\", className: \"error\", autoHide: false});\n\n } else {\n $(\"#filter_annotation_type\").notify(\"The image set is empty with that filter applied.\",\n {position: \"top\", className: \"error\"});\n //$('#filter_annotation_type').val('All');\n }\n }\n displayImageList(data.image_set.images);\n },\n error: function () {\n displayFeedback($('#feedback_connection_error'));\n }\n });\n }", "title": "" }, { "docid": "bec54beb678e3a98d15a07da5e7356d7", "score": "0.6705207", "text": "function loadImage(){\n loadImageCount++;\n if(loadImageCount === totalImages){\n ready = true;\n loader.hidden = true;\n } \n}", "title": "" }, { "docid": "7ff4a2c53571c6bf978504c3eae68eac", "score": "0.6669075", "text": "areAllImagesLoaded() {\n if (this.imgCount === this.imgLoadedCount) {\n // // do something when all images are loaded\n // console.log('loaded');\n }\n }", "title": "" }, { "docid": "f2b262073d48c190c4593d76da820a99", "score": "0.6659301", "text": "function loadImage(id) {\n var imagesList = $('.load');\n var current = imagesList.index(id);\n var allFile = $('.file');\n var currentLoad = allFile[current];\n // image from a machine upload\n if (currentLoad.files && currentLoad.files[0]) {\n var reader = new FileReader();\n reader.onload = function(e) {\n var allWidget = $('.image-src');\n var currentWidget = allWidget[current];\n currentWidget.setAttribute(\"src\", e.target.result);\n }\n var allUrl = $('.url');\n var currentUrl = allUrl[current];\n reader.onloadend = () => {\n // sets the base64 image econding into the text input\n currentUrl.value = reader.result.split(',')[1];\n }\n reader.readAsDataURL(currentLoad.files[0]);\n }\n // image from a web url\n else {\n var allUrl = $('.url');\n var currentLoad = allUrl[current];\n var currentSrc = currentLoad.value;\n if (currentSrc != \"\") {\n var allWidget = $('.image-src');\n var currentWidget = allWidget[current];\n // sets the image source to the image\n currentWidget.setAttribute(\"src\", currentSrc);\n }\n }\n var allImage = $('.client-image');\n var currentImage = allImage[current];\n currentImage.classList.add('d-none');\n}", "title": "" }, { "docid": "d795deb205280272a3577a71652c96e9", "score": "0.661682", "text": "function loadNextImages() {\r\n\t\t\tvar i, image, len = (lastLoaded + o.loadPortions >= imgNum) ? \r\n\t\t\t\t(imgNum - 1) : (lastLoaded + o.loadPortions);\r\n\r\n\t\t\tfor(i = lastLoaded + 1; i <= len; i += 1) {\r\n\t\t\t\tif(!images[i].loaded) {\r\n\t\t\t\t\timage = new Image();\r\n\t\t\t\t\timage.setAttribute(\"src\", images[i].img);\r\n\r\n\t\t\t\t\t(function(i) {\r\n\t\t\t\t\t\timages[i].el = $(image).imagesLoaded(function() {\r\n\t\t\t\t\t\t\timages[i].loaded = true;\r\n\t\t\t\t\t\t\tif(pendingImg === i) {\r\n\t\t\t\t\t\t\t\t//image has been selected to show, but wasn't loaded yet\r\n\t\t\t\t\t\t\t\tpendingImg = -1;\r\n\t\t\t\t\t\t\t\thideLoading();\r\n\t\t\t\t\t\t\t\tshowImage(true);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t})(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlastLoaded = len;\r\n\t\t}", "title": "" }, { "docid": "5dc87ff537d1417c7eccbab939033edb", "score": "0.66029096", "text": "function CheckImages() {\n var y = 0;\n var src = null;\n var image = null;\n var newImage = null;\n var loadingImage = null;\n var viewportHeight = BrowserGeometry.GetViewportHeight();\n\n for (var i = 0; i < m_images.length; i++) {\n if (!(image = m_images[i])) {\n continue;\n }\n\n // ignore not appeared images\n y = DocumentUtility.GetElementY(image);\n if (y - m_threshold > viewportHeight || y + image.offsetHeight + m_threshold < 0) {\n continue;\n }\n\n src = image.getAttribute(m_sourceAttributeName);\n loadingImage = m_loadingQueue.Where(function (item) {\n return item.Url == src;\n }).FirstOrNull();\n if (loadingImage != null) {\n if (loadingImage.Loaded) {\n image.src = src;\n } else {\n loadingImage.Targets.push(image);\n }\n } else {\n m_loadingQueue.push({\n Url: src,\n Targets: [image],\n Loaded: false\n });\n }\n image.setAttribute(m_loadedAttributeName, \"true\");\n\n m_images[i] = null;\n }\n\n StartLoadImages();\n }", "title": "" }, { "docid": "6b4e926f8fe07c035f0527fad5499fa6", "score": "0.6596503", "text": "function imageIsLoaded(e) {\n $(\"#img\" + imgCardRefId).removeAttr(\"class\");\n $(\"#img\" + imgCardRefId).attr(\"src\", e.target.result);\n \n for (var i = 0; i < storedFaves.length; i++) {\n if (storedFaves[i].image[0] === imgCardRefId) {\n storedFaves[i].image.splice(0, 2);\n }\n if (storedFaves[i].id === imgCardRefId) {\n storedFaves[i].image.push(imgCardRefId, e.target.result);\n }\n }\n\n storeFaves();\n}", "title": "" }, { "docid": "646e0cdef654b54bad19b80f9b1a8370", "score": "0.6594125", "text": "function loadComplete(event)\n{\n var $gallery_wrapper = $('.gallery-wrapper');\n for (var i = 0; i < images.length; i++)\n {\n var img = queue.getResult(images[i].id);\n var img_wrapper = '<div class=\"gallery-img\"><img src=\"'+img.src+'\" /></div>';\n $gallery_wrapper.append(img_wrapper);\n }\n $gallery_wrapper.append('<div class=\"clear-left\"></div>');\n}", "title": "" }, { "docid": "45430a8cf2a8aa8d7a2bdf9b4fd22931", "score": "0.6587498", "text": "areImageLoaded() {\n if (this.imgElems.length > 0) {\n this.imgElems.forEach(img => {\n img.onload = () => {\n this.imgLoadedCount++;\n this.areAllImagesLoaded();\n }\n });\n }\n }", "title": "" }, { "docid": "d1c236be69435b5e87dda67713683008", "score": "0.65791094", "text": "function trackImagesLoad() {\r\n\troadPic.onload = countLoadedImagesAndLaunchIfReady;\r\n\twallPic.onload = countLoadedImagesAndLaunchIfReady;\r\n\troadPic.src = \"track_road.png\";\r\n\twallPic.src = \"track_wall.png\";\r\n}", "title": "" }, { "docid": "4fb8955c0ef885945b72dff373c9cdce", "score": "0.6567786", "text": "function loadImages() {\n\timages.forEach((image) => {\n\t\timage.onload = () => {\n\t\t\timgCount++;\n\t\t\tif (imgCount === images.length) {\n\t\t\t\tstartGame();\n\t\t\t}\n\t\t};\n\t\timg.push(image);\n\t});\n}", "title": "" }, { "docid": "b5bd86e3a35094a7d62720440dc8aac8", "score": "0.6566729", "text": "function loadImages() {\n wadata = {};\n $('.allimages').html('');\n $('div.loading').show();\n $('div.empty').hide();\n \n // loads all the webapp items\n var items = new BCAPI.Models.WebApp.ItemCollection(WEBAPP_NAME);\n items.fetch({\n order: \"weight\",\n limit: 1000, // get all items\n success: loadImagesCB,\n error: createWebApp\n });\n}", "title": "" }, { "docid": "e0408895228fbd537ef6a27be2a6d1e9", "score": "0.6560462", "text": "lazyLoadImages() {\n const loadClass = 'is-loadable';\n const imgs = document.querySelectorAll(`.${loadClass}, img[data-src]:not(.${loadClass})`);\n\n if (imgs.length) {\n [].slice.call(imgs).forEach((img) => {\n const imgUrl = img.getAttribute('data-src');\n const newImg = new Image();\n\n newImg.onload = () => {\n img.setAttribute('src', imgUrl);\n img.removeAttribute('data-src');\n img.classList.remove(loadClass);\n };\n\n newImg.setAttribute('src', imgUrl);\n });\n }\n }", "title": "" }, { "docid": "44a6860664c51e14bcc9ae7c1ed523f8", "score": "0.655586", "text": "function initImageLoad() {\n scope.currentIndex = 0;\n scope.selectedSlide = scope.slidesCopy[scope.currentIndex]\n loadNextImage(scope.currentIndex);\n }", "title": "" }, { "docid": "5706787adc4ce89b3f35fb9f5d461fdf", "score": "0.6539089", "text": "checkImageLoadComplete() {\n\t\t// Get list of any remaining unloaded images\n\t\tvar remainingImagesToLoad = this.gameImages.filter( imageInfo => {\n\t\t\treturn !( imageInfo.regularLoaded && imageInfo.glitchedLoaded );\n\t\t});\n\n\t\tif ( remainingImagesToLoad.length === 0 ) {\n\t\t\tconsole.log('loading complete');\n\t\t\tthis.emit( 'complete' );\n\t\t}\n\t}", "title": "" }, { "docid": "fa7a8deb211c9aa21edd9cf3579d28df", "score": "0.6537184", "text": "loadImages() {\n\n\t\tvar ids = [];\n\n\t\tthis.products.results.map(( p ) => {\n\t\t\tids.push( p.id );\n\t\t});\n\n\t\tthis.productsSvc.getProductPictures(ids.join(\",\")).then(( products ) => {\n \t\t\n \t\tthis.products.results.map((p) => {\n \t\t\tlet product_with_image = products.data.filter((o) => {\n \t\t\t\treturn o.id === p.id;\n \t\t\t});\n \t\t\tif (product_with_image && product_with_image[0].pictures.length) {\n \t\t\t\tp.image = product_with_image[0].pictures[0].secure_url;\n \t\t\t}\n \t\t})\n \t});\n\t}", "title": "" }, { "docid": "1f231648adb061236ab27e3ab763ea4c", "score": "0.6523676", "text": "preload(images = []) {\n const deferred = this.$q.defer();\n let loaded = 0;\n\n if (!images.length) {\n deferred.resolve(images);\n }\n\n images.map(image => {\n angular\n .element(new Image())\n .bind('load error', () => {\n image.loaded = true;\n if (++loaded >= images.length) {\n deferred.resolve(images);\n }\n })\n .attr('src', image.url)\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "d3fa3607f6dbc26dbd24fc88b36ad2f1", "score": "0.6503287", "text": "function lazyLoad(){\n galleryImgs.each(function(){\n $(this).attr('src', $(this).attr('data-src'));\n\n $(this).on('load', function(){\n $(this).removeAttr('data-src');\n $(this).addClass('imgLoaded');\n $(this).css('opacity', '1');\n loadedImgs++;\n loadProgress();\n })\n\n })\n\n // expiremented with a lazy load library, wanted to check out loading images\n // as elements are scrolled into view...\n // $('img:not([src])').css({\n // // 'visibility': 'hidden'\n // })\n //\n // const LazyLoad = new LL({\n // data_src: 'src',\n // // threshold: 600,\n // callback_load: function(img){\n //\n // // $(img).addClass('imgLoaded');\n // $(img).css({\n // 'opacity': '1',\n // // 'visibility': 'visible'\n // });\n //\n // loadedImgs++;\n // loadProgress();\n // }\n // });\n\n }", "title": "" }, { "docid": "ce421ffcee5c05086d475885fb088b1b", "score": "0.65022826", "text": "function loadImages(){\n\t//clear the child nodes and append the images\n\tvar list = $(\".list-unstyled\");\n\timageList = [];\n\tlist.empty();\n\t$.get('/images', (data)=>{\n\t\tdata.forEach((el, i)=>{\n\t\t\tif( el.match(/\\.(jpe?g|png)$/) ) { \n\t\t \t\tlist.append( \"<li><img id=\"+i+\" onclick ='imageListClick(\"+i+\")' src='\"+ el +\"'></li>\" );\n\t\t \t\timageList[i] = el;\n\t\t \t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "f0a64f39f405c3ab3ad5aa5ac95f641a", "score": "0.64942074", "text": "function doneLoadingImages(arg) {\n console.log(\"DONE loading images\");\n app.loadedImages = true;\n app.requestStart();\n }", "title": "" }, { "docid": "dd51a95cbd7c47e5da7d7b241eabc3ae", "score": "0.64784104", "text": "function imageLoaded() {\n imagesLoaded++\n if (imagesLoaded === totalImages) {\n readyToLoad = true\n loader.hidden = true\n }\n}", "title": "" }, { "docid": "71627fa41930597baa4c503ea474cf76", "score": "0.64676464", "text": "function image_loaded() {\n images_loaded++;\n if (images_loaded === total_images) {\n ready = true;\n loader.hidden = true;\n };\n}", "title": "" }, { "docid": "3ec9fdf18b2397561241fdc67e904468", "score": "0.64527047", "text": "function addImages(e) {\n systemNotifications.showInfo(\"Loading...\", \"Uploading images.\");\n \n // callback is called when after images upload and items created\n _.imagesUploaded = _.after($('#newItem')[0].files.length*2, imagesUploaded);\n \n _.each($('#newItem')[0].files, function(file) {\n addImage(file);\n });\n}", "title": "" }, { "docid": "7f57b942f42017a40481fdd3a66a0a20", "score": "0.64421684", "text": "function setNewLoadStatImages(){\n\tif(loadImagecount == toLoad){\n\t\tRemapIt();\n\t}\n\tShow_Loadstate();\n}", "title": "" }, { "docid": "75c7fcd495bca2133b3003abfd0be183", "score": "0.6436166", "text": "loadImage() {\n if (this.imageLoaded === false || this.imageReloader === true) {\n this.getImageFile(this.smartImageElem);\n }\n }", "title": "" }, { "docid": "0fa597ec1d25f8420e5d888bbd79f19d", "score": "0.64241797", "text": "load({onFail})\r\n {\r\n return this.getImages()\r\n .then((result) => this.loadImages(result), onFail)\r\n .then(() => this.init());\r\n }", "title": "" }, { "docid": "d29dc4403a6675888727f79ab7051e57", "score": "0.6423884", "text": "function checkIfAllImagesLoaded() {\n imagesLoaded++;\n if (imagesLoaded === totalImages) {\n //checks to see if the initial call has finished\n //if so, it changed the photosLoadedCount to 6 photos\n totalImages === 3 ? (photosToLoad = 6) : \"\";\n ready = true;\n loader.hidden = true;\n }\n}", "title": "" }, { "docid": "e2c94695077febea7927b58659cc3816", "score": "0.64219034", "text": "function getImages(offset) {\n window.loading_process = true;\n $.ajax({\n url: '/admin/loadimages',\n type: 'GET',\n data: {offset: offset},\n dataType: 'json'\n })\n .done(function (resp) {\n window.loading_process = false;\n window.images_loader_current_offset = resp.current_offset;\n window.images_loader_count = resp.count;\n //startUploadMoreImages();\n ic.unset();\n events.callEvent('imagesRecived', resp.data);\n });\n }", "title": "" }, { "docid": "84e6b82163cedb6fcf7006a2b8f0e358", "score": "0.6419759", "text": "function imageIsLoaded(e) {\n $('.uploaded-icon').attr('src', e.target.result);\n \n}", "title": "" }, { "docid": "4b5c9e79de383b1d2fa96320589cc633", "score": "0.6418251", "text": "function loadImages() {\n let referenceImageName = localStorage.getItem(\"referenceImageName\");\n\n let noLivenessImageName = localStorage.getItem(\"noLivenessImageName\");\n\n let livenessImageName = localStorage.getItem(\"livenessImageName\");\n\n var files = navigator.getDeviceStorage('pictures');\n\n var cursor = files.enumerate();\n\n cursor.onsuccess = function() {\n var file = this.result;\n if (file != null) {\n if (file.name == referenceImageName) {\n console.log(' referenceImageName ---- ' + file.name + ' -- ' + referenceImageName);\n fileReferenceImage = file;\n var imageElement = $('<img height=\"100\" width=\"100\">');\n imageElement.attr('src', window.URL.createObjectURL(file));\n imageElement.appendTo(\"#referenceImage\");\n }\n\n if (file.name == noLivenessImageName || file.name == livenessImageName) {\n console.log(' livenessImageName ---- ' + file.name + ' -- ' + livenessImageName);\n var imageElement = $('<img height=\"100\" width=\"100\">');\n imageElement.attr('src', window.URL.createObjectURL(file));\n imageElement.appendTo(\"#noLivenessImage\");\n if (livenessImageName != null) {\n if (!livenessImageName.includes(\"null\")) {\n let matchScore = localStorage.getItem(\"matchScore\");\n showMatchingScoreOnScreen(matchScore);\n } else {\n goForOnlineMatching(file);\n }\n } else {\n goForOnlineMatching(file);\n }\n }\n this.done = false;\n } else {\n this.done = true;\n }\n if (!this.done) {\n this.continue();\n }\n }\n}", "title": "" }, { "docid": "e5904ac97c41053c26f1af2c8d84560d", "score": "0.6407865", "text": "loadData() {\n console.log('Loading images...');\n this.data = loadImages(IMAGES_DIR);\n console.log('Images loaded successfully.')\n }", "title": "" }, { "docid": "237ddef4c39502a0fa7aa31fad3835e4", "score": "0.640235", "text": "function imageLoaded() {\n imagesLoaded++;\n if (imagesLoaded === totalImages) {\n ready = true;\n loader.hidden = true;\n loadCountAPI = 30;\n }\n}", "title": "" }, { "docid": "94aed61e04155b4652e7cbcf2e6ad846", "score": "0.6396472", "text": "function loadImages(){\n\t\tfolder = \"media/\";\n\t\tvar image = new Image();\n\t\t\timage.src= folder+\"dice.png\";\n\t\t\timage.onload=loadContent;\n\t\t\timages.push(image);\t\t\t\n\t\t\n\t\tvar image = new Image();\n\t\t\timage.src= folder+\"controller.png\";\n\t\t\timage.onload=loadContent;\n\t\t\timages.push(image);\n\t\t\n\t\tvar image = new Image();\n\t\t\timage.src= folder+\"contabout.png\";\n\t\t\timage.onload=loadContent;\n\t\t\timages.push(image);\n\t\t\n\t\tvar image = new Image();\n\t\t\timage.src= folder+\"compass4.png\";\n\t\t\timage.onload=loadContent;\n\t\t\timages.push(image);\n\t\t\n\t\tvar image = new Image();\n\t\t\timage.src= folder+\"itsasecrettoeverybody.png\";\n\t\t\timage.onload=loadContent;\n\t\t\timages.push(image);\n\t\t\n\t\t//add ads\n\t\tvar ad = new Image();\n\t\t\tad.src = folder+\"Adds_beard.png\";\n\t\t\tad.onload=loadContent;\n\t\t\tads.push(ad);\n\t\t\t\n\t\tvar ad = new Image();\n\t\t\tad.src = folder+\"ads_swine.png\";\n\t\t\tad.onload=loadContent;\n\t\t\tads.push(ad);\n\t}", "title": "" }, { "docid": "11ffe1acf0eeeae05b28f90bfd76b268", "score": "0.6387985", "text": "function imageLoaded()\n{\n mImagesLoaded += 1;\n if (mImagesLoaded == mTotalImages)\n {\n mbReady = true;\n mLoader.hidden = true; // hide the loading icon once we're done loading\n mCountToLoad = 30; // once we're done loading first images, we continue to load more\n }\n}", "title": "" }, { "docid": "e04415b9c3e7fc0fbf1de11a9c0f6490", "score": "0.6384916", "text": "function handleImagesLoaded(array) {\n // Checks if the images are loaded using \"imagesLoaded\" by Desandro (❤️)\n // When te images are loaded set the state to TRUE and run the function to handle the context\n imagesLoaded(array, function (instance) {\n if (instance.isComplete) {\n // Checks if the element (the first one) is an image or a link. If it's a link, the user is using the gallery\n // And we need to grab the correct source of the image, not the thumbnail\n const elementType = instance.elements[0].nodeName\n if (!imagesAreLoaded) {\n setImagesAreLoaded(true)\n handleImagesWithContext(instance.images, elementType)\n }\n }\n })\n }", "title": "" }, { "docid": "64facaf5c8384f1c49c184d4ed444994", "score": "0.6378551", "text": "loadImages()\n {\n this.il.loadImage(\"entities/player/debug.png\");\n this.il.loadImage(\"entities/enemy/debug.png\");\n this.il.loadImage(\"entities/enemy/staticBot.png\");\n this.il.loadImage(\"entities/enemy/staticBotHit.png\");\n this.il.loadImage(\"entities/enemy/slowBot.png\");\n this.il.loadImage(\"entities/pickups/healthPickup.png\");\n this.il.loadImage(\"projectiles/player.png\");\n this.il.loadImage(\"projectiles/enemy.png\");\n this.il.loadImage(\"particles/explosion/explosion_1.png\");\n this.il.loadImage(\"particles/explosion/explosion_2.png\");\n this.il.loadImage(\"particles/explosion/explosion_3.png\");\n this.il.loadImage(\"particles/explosion/explosion_4.png\");\n this.il.loadImage(\"particles/explosion/explosion_5.png\");\n this.il.loadImage(\"particles/explosion/explosion_6.png\");\n this.il.loadImage(\"particles/explosion/explosion_7.png\");\n this.il.loadImage(\"scifi/door.png\");\n }", "title": "" }, { "docid": "94ec09e963599b2a0002d56288579097", "score": "0.6372096", "text": "function _preloadImages () {\n var self = this\n ,data = self._itemsData\n ,filetype = self._options.mediaKeys.mediaType\n ,fileadd = self._options.mediaKeys.mediaAdd;\n if (!data){\n return false;\n } else {\n data = data.items;\n }\n for (var i = 0; i <= data.length-1; i++){\n var item = data[i];\n if (item[filetype] === 'image/jpeg' || item[filetype] === 'image/gif' || item[filetype] === 'image/png'){\n // get image width & height via http://stackoverflow.com/questions/106828/javascript-get-image-height\n var image = new Image();\n image.name = 'imageItem' + item.id;\n image.mediaWindow = self;\n image.itemNumber = i;\n image.onload = _fetchImageData;\n image.src = item[fileadd];\n }\n }\n }", "title": "" }, { "docid": "16084074d836ce108f49a82d57ebd244", "score": "0.6370448", "text": "function reloadImages() {\n\tlet profileBoxImg = document.getElementsByTagName(\"img\");\n\tfor (let image of profileBoxImg) {\n\t\tif (image.alt != '')\n\t\t{\n\t\t\timage.src = image.alt;\n\t\t\timage.removeAttribute('alt');\n\t\t}\n\t}\n\tfor (let i = 0; i < profileBoxImg.length; i++) {\n\t\tif (profileBoxImg[i].complete) {\n\t\t\tresizeProfileBoxImg(profileBoxImg[i]);\n\t\t\tloadedImages++;\n\t\t}\n\t}\n\tif (loadedImages != profileBoxImg.length) setTimeout(reloadImages, 300);\n}", "title": "" }, { "docid": "c0be7301c37637f41aa9c9c4dc91c32a", "score": "0.6366969", "text": "function loadImages(){\n var imageElements = document.getElementsByClassName(CLASS_IMAGE_SINGLE);\n for(var i = 0; i < imageSources.length; i++){\n if(i < imageElements.length){\n imageElements[i].src = imageSources[i];\n }\n }\n}", "title": "" }, { "docid": "24e1206454c6c4398d307c4b38709226", "score": "0.63583446", "text": "function init(){\n loadPhotos();\n}", "title": "" }, { "docid": "6fb34cdfd050c6769c7be10736517ffe", "score": "0.6357048", "text": "function loadFileImages(path, tracker, no_load_diffs){\r\n\tno_load_diffs = window.listDir == null ? true : no_load_diffs \r\n\r\n\tvar res = $.Deferred()\r\n\r\n\t// default locations...\r\n\tif(path == null){\r\n\t\tvar base = normalizePath(CONFIG.cache_dir_var) \r\n\t\tvar loader = loadLatestJSONFile(base, \r\n\t\t\t\tmakeBaseFilename(CONFIG.images_file), \r\n\t\t\t\tmakeFilenamePattern(CONFIG.images_file), \r\n\t\t\t\tmakeDiffFilePattern(CONFIG.images_file),\r\n\t\t\t\tnull,\r\n\t\t\t\ttracker)\r\n\t\r\n\t// explicit base dir...\r\n\t} else if(!/\\.json$/i.test(path)) {\r\n\t\tvar base = normalizePath(path +'/'+ CONFIG.cache_dir_var) \r\n\t\tvar loader = loadLatestJSONFile(base, \r\n\t\t\t\tmakeBaseFilename(CONFIG.images_file), \r\n\t\t\t\tmakeFilenamePattern(CONFIG.images_file), \r\n\t\t\t\tmakeDiffFilePattern(CONFIG.images_file),\r\n\t\t\t\tnull,\r\n\t\t\t\ttracker)\r\n\r\n\t// explicit path...\r\n\t} else {\r\n\t\tvar loader = loadLatestJSONFile(normalizePath(path), null, null, null, null, tracker)\r\n\t}\r\n\r\n\tbubbleProgress('Images', loader, res)\r\n\r\n\tres.done(function(images){\r\n\t\tIMAGES = images\r\n\t\tIMAGES_UPDATED = []\r\n\t\tIMAGES_CREATED = false\r\n\r\n\t\t// XXX is this the correct spot to do this???\r\n\t\t$('.viewer').trigger('imagesLoaded')\r\n\t})\r\n\r\n\treturn res\r\n}", "title": "" }, { "docid": "16b62bc0fe2571febb929117aaa36fcf", "score": "0.6353345", "text": "function loadImageAssetUtilities(){\n var imagefiles = null;\n // Add events\n $('input[id=\"storyimage-imagefile\"]').on('change', prepareUpload);\n\n // Grab the files and set them to our variable\n function prepareUpload(event){\n imagefiles = event.target.files;\n }\n $('form[id^=\"image-upload-form-\"] input[type=\"button\"].submit').click(function(){\n $('form[id=\"image-upload-form-'+$(this).data('storyid')+'\"]').submit();\n });\n // process the form\n $('[id^=\"image-upload-form\"]').submit(function(event) {\n // stop the form from submitting the normal way and refreshing the page\n event.preventDefault();\n event.stopImmediatePropagation();\n\n if(imagefiles != null){\n statusApp.showPleaseWait();\n var story_id = $(this).data('storyid');\n\n // Create a formdata object and add the files\n var data = new FormData();\n $.each(imagefiles, function(key, value)\n {\n data.append(key, value);\n });\n data.append('story_id', story_id);\n data.append('StoryImage[imageFile]', $(this).find('#storyimage-imagefile').val());\n\n // process the form\n $.ajax({\n url: '/image/upload',\n type: 'POST',\n data: data,\n dataType: 'json',\n processData: false, // Don't process the files\n contentType: false, // Set content type to false as jQuery will tell the server its a query string request\n success: function(data, textStatus, jqXHR){ \n statusApp.hidePleaseWait();\n\n // report validation errors\n reportFormErrors(data.errors);\n\n //refresh media\n if(data.save_success){\n refreshImageMedia(story_id);\n }\n }\n });\n imagefiles = null; // reset files\n }\n });\n refreshImageListFunctions();\n}", "title": "" }, { "docid": "c52e9c6d9c4c3c73cdd17577f816d717", "score": "0.63454896", "text": "function registNewImageLoadEvents() {\r\n\t\tfirstLoad = false;\r\n\t\timg.addEventListener('load', function() {\r\n\t\t\t$(\".loader-wrap\").hide();\r\n\t\t\tactualImageLoaded = true;\r\n\t\t});\r\n\t\t\r\n\t\t// Se a imagem actual não existe, faz replace pela imagem que estava antes e devolve o erro de que não dispõe da imagem actual, mudar para modal.\r\n\t\timg.addEventListener('error', function() {\r\n\t\t\t$('#errorNoMapImageModal').modal('show')\r\n\t\t\t//alert(\"Não existem imagens para este momento.\"); // a substituir por um modal\r\n\t\t\tif(isPlaying) play();\r\n\t\t\td.setTime(dAnterior.getTime());\r\n\t\t\tactualizeImgSrc();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "855b11c188ca279866f3c9066b2f0e33", "score": "0.6343184", "text": "function loadImages() {\r\n\tvar imageList = [\r\n\t\t{varName: carPic, theFile: \"player1car.png\"},\r\n\t\t{varName: carPic2, theFile: \"player2car.png\"},\r\n\t\t{trackType: TRACK_ROAD, theFile: \"track_road.png\"},\r\n\t\t{trackType: TRACK_WALL, theFile: \"track_wall.png\"},\r\n\t\t{trackType: TRACK_FLAG, theFile: \"track_flag.png\"},\r\n\t\t{trackType: TRACK_TREE, theFile: \"track_tree.png\"},\r\n\t\t{trackType: TRACK_GOAL, theFile: \"track_goal.png\"},\r\n\t\t{trackType: BEFORE_GOAL_CHECK, theFile: \"track_road.png\"}\r\n\t\t];\r\n\r\n\tpicsToLoad = imageList.length;\r\n\r\n\tfor (var i = 0; i < imageList.length; i++) {\r\n\t\tif (imageList[i].varName != undefined) {\r\n\t\t\tbeginLoadingImages(imageList[i].varName, imageList[i].theFile);\r\n\t\t} else {\r\n\t\t\tloadImageForTrackCode(imageList[i].trackType, imageList[i].theFile);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "f91ff91748f64340816f048c60e4ef3c", "score": "0.63426775", "text": "preloadImages(){\n\n console.log(\"Enter Preload Img!\");\n\n let linkList = [];\n\n //Accumulate portfolio image links\n this.contentData[0].forEach(d => {\n\n if(d.content.media[0].type === \"image\")\n linkList.push(`portfolio/${d.id}/${d.content.media[0].link}`);\n \n\n })\n\n //Accumulate adventure image links\n this.contentData[1].forEach(d => {\n\n linkList.push(`adventure/${d.id}/${d.cover}`);\n\n if(d.diary.media[0].type === \"image\")\n linkList.push(`adventure/${d.id}/${d.diary.media[0].link}`);\n\n })\n \n let counter = linkList.length;\n let loadingList = [];\n\n linkList.forEach(link => {\n\n const img = new Image();\n\n img.onload = () => {\n\n const index = loadingList.indexOf(this);\n\n if (index !== -1) {\n\n loadingList.splice(index, 1);\n\n }\n\n counter--;\n console.log(counter);\n\n if(counter == 0)\n document.querySelector(\".loading-screen\").dispatchEvent(new Event(\"loaded\"));\n\n };\n\n loadingList.push(img);\n img.src = `https://res.cloudinary.com/bbazukun123/image/upload/w_auto:50:${Math.min(1920, Math.max(300, screen.width*2))}/q_auto/v1560892787/Personal%20Website/` + link;\n\n });\n \n }", "title": "" }, { "docid": "a8831e57de688f25cd59175c98087cfc", "score": "0.6342641", "text": "loadAllImages() {\n this.cards.forEach((card) => {\n card.el.src = card.src;\n this.preload(card);\n });\n }", "title": "" }, { "docid": "14779e149ff0cfb2e4a4382264e66a11", "score": "0.6339558", "text": "function load() {\n var list = [\n // map view images\n 'images/map/map.png',\n 'images/map/heightmap.png',\n 'images/map/areas.png',\n\n // item view images\n 'images/ui/details-icon-fav.png',\n 'images/ui/details-icon-fav-dark.png',\n 'images/ui/details-icon-link.png',\n\n // favorites view\n 'images/ui/favorites-empty-msg.png',\n\n // favorites and tags view\n 'images/ui/pagination-next-btn.jpg',\n 'images/ui/pagination-previous-btn.jpg'\n ];\n\n // add all images from the thumbs used in TunnelView\n var tunnelItemsData = appModel.getTunnelItemsData();\n\n tunnelItemsData.forEach(function(item) {\n list.push(item.thumbUrl);\n });\n list.forEach(function(item) {\n // the images will be cached.\n textures[item] = new THREE.TextureLoader(manager).load(item);\n });\n }", "title": "" }, { "docid": "23f854b0ed56a56bb143e6ab4e1110ac", "score": "0.6334472", "text": "function loadGalleryImages () {\n if (!imagesLoaded) {\n var gallerySel = \"div#picgallery-panel .swiper-container .swiper-slide\";\n var imgSelBase = \"img.swiper-pic.slide\";\n var imgContainerSel = \"div.gallery-img-container \" + imgSelBase;\n\n var tmpImages = [imgGalleryUrls.length];\n\n for (var i = 1; i < imgGalleryUrls.length; i++) {\n var imgSel = gallerySel + \" \" + imgContainerSel + i;\n var alt = imgGalleryCaps[i];\n var url = imgGalleryUrls[i];\n\n // avoid caching in IE versions prior 10 to make load event trigger\n if (isLteIE (9)) url += \"?\" + new Date ().getTime ();\n\n // load images in memory; trigger throbber replacement when ready\n tmpImages[i] = new Image ();\n tmpImages[i].src = url;\n tmpImages[i].alt = alt;\n tmpImages[i].imgSel = imgSel;\n\n tmpImages[i].onload = function () {\n insertImage (this.imgSel, this.src, this.alt);\n }\n\n imagesLoaded = true;\n }\n }\n }", "title": "" }, { "docid": "2e9c7864bc54e84e975b41a83e9550a6", "score": "0.6319686", "text": "function allImagesLoaded()\n{\n if (level.bg_img != null)\n if (!level.bg_img.complete)\n return false;\n for (var i = 0; i < entlist.length; i++)\n if (entlist[i].img != null)\n if (!entlist[i].img.complete)\n return false;\n return true;\n}", "title": "" }, { "docid": "e7967627409e2ba7aa9bdafaf6fc7f68", "score": "0.62984574", "text": "function loadImages(){\n\t\tvar pictureItems = \n\t\t[\"mono-1\",\n\t\t\"mono-2\",\n\t\t\"mono-3\",\n\t\t\"mono-4\",\n\t\t\"mono-5\",\n\t\t\"mono-6\",\n\t\t\"mono-7\",\n\t\t\"mono-8\",\n\t\t\"mono-1\",\n\t\t\"mono-2\",\n\t\t\"mono-3\",\n\t\t\"mono-4\",\n\t\t\"mono-5\",\n\t\t\"mono-6\",\n\t\t\"mono-7\",\n\t\t\"mono-8\"];\n\t jQuery.each(pictureItems, function(index) {\n\t picture.push(pictureItems[index]);\n });\n }", "title": "" }, { "docid": "4dad6d6df25743c1362df28fff5b092d", "score": "0.6296058", "text": "function imagesLoaded() {\n return imagesToLoad.every((img) => img.complete);\n}", "title": "" }, { "docid": "158f6397f5f71eae385b75a569c19c20", "score": "0.6289962", "text": "function imagesUploaded() {\n $('body').append($('#trashIcon'));\n systemNotifications.showSuccess(\"Success\", \"Images uploaded.\");\n resetFormElement($('#newItem'));\n loadImages();\n}", "title": "" }, { "docid": "6b0a7e7e86cc836ee194fae698dac88b", "score": "0.6284644", "text": "function getAllStoredImages() {\n var message = \"Fetching stored images...\"\n var dataToSend = {\n 'getAll': true\n };\n makeAjaxCall(dataToSend, true, defaultContentType, message, appendAllImages);\n }", "title": "" }, { "docid": "98ed68e8ec56d0b4c63e926f6e007d75", "score": "0.62782556", "text": "function imageLoaded() {\n imagesLoaded++;\n if (imagesLoaded === totalImages) {\n ready = true;\n loader.hidden = true;\n }\n}", "title": "" }, { "docid": "f20edaceb8b5446d469e82a1b2a332ea", "score": "0.6265495", "text": "function OnLoadImage() {\n var src = this.src;\n var loadingImage = m_loadingQueue[0];\n\n loadingImage.Loaded = true;\n\n var targets = loadingImage.Targets;\n for (var i = 0; i < targets.length; i++) {\n targets[i].src = src;\n }\n\n m_loadingQueue.shift();\n LoadImage();\n }", "title": "" }, { "docid": "514e43cbea2d1162335a7b14f6b9d0b4", "score": "0.62629", "text": "function loadImageList(type) {\n $.ajax({\n url: window.location.href + 'index.php/upload/list_uploads',\n data: {},\n cache: false,\n contentType: false,\n processData: false\n }).done(function (result) {\n var imageList = JSON.parse(result);\n //Convert JSON to an array\n var array = $.map(imageList, function (value, index) {\n return [value];\n });\n\n showImages(array, type);\n }).fail(function () {\n showError('A kép(ek) betöltése nem sikerült');\n });\n}", "title": "" }, { "docid": "83d89f90ef78e8b0f31fd8cdc214b954", "score": "0.6255402", "text": "function preloadAllImages($target) {\n\t\t\tvar $images = $target.find('img');\n\t\t\tvar count = $images.length;\n\n\t\t\t$images.each(function() {\n\t\t\t\tvar $image = $(this);\n\n\t\t\t\t$image.load(function() {\n\t\t\t\t\tcount--;\n\n\t\t\t\t\tif(count == 0)\n\t\t\t\t\t\t$target.trigger('allImagesLoaded');\n\t\t\t\t})\n\n\t\t\t\t$image.attr('src', $image.attr('src'));\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "c656f45cdc3356b0e3b5152dd975e26f", "score": "0.62529093", "text": "function imageLoaded() {\n imagesLoaded++;\n if (imagesLoaded === totalImages) {\n readyFlag = true;\n loader.hidden = true;\n // increase # of loaded images to 10 after initial image count load\n count = 10;\n }\n}", "title": "" }, { "docid": "7b6944489a0a6a59200d5ab9e3034375", "score": "0.62520784", "text": "function imageLoaded(){\n console.log('image loaded')\n imagesReady++;\n if (imagesReady === totalImages){\n ready = true;\n loader.hidden = true;\n\n }\n}", "title": "" }, { "docid": "629357264e0308d9b143a36d882f2af4", "score": "0.62515825", "text": "function uploadButtonHandler() {\n imagesToBeDisplayed.forEach(imageFile => {\n renderImageFromFile(imageFile)\n })\n clearImageArray()\n}", "title": "" }, { "docid": "bc1b1603c1b819482b25387b77aac83e", "score": "0.624672", "text": "function addLoadedImage(){\n num_loaded++;\n refreshLoader();\n\n}", "title": "" }, { "docid": "141d167eca0ec334880d8b9940161dfe", "score": "0.62407804", "text": "function imageLoaded() {\n imagesLoaded++;\n if (imagesLoaded === totalImages) {\n loader.hidden = true;\n ready = true;\n }\n}", "title": "" }, { "docid": "141d167eca0ec334880d8b9940161dfe", "score": "0.62407804", "text": "function imageLoaded() {\n imagesLoaded++;\n if (imagesLoaded === totalImages) {\n loader.hidden = true;\n ready = true;\n }\n}", "title": "" }, { "docid": "c8c2bf15f050021759c928a6dc93c9cf", "score": "0.6232194", "text": "function loadImages() {\n for (var i = 0; i < 7; i++) {\n images[i] = loadImage('Assets/sq' + i + '.png');\n }\n}", "title": "" }, { "docid": "d4820f5b24ddf7f57537fec100b61be7", "score": "0.62305564", "text": "function startBigLoading() {\n\t\t\t\tfor (var i = 0; i < loadingOrder.length; i++) {\n\t\t\t\t\tvar model = self.collection.at(loadingOrder[i]);\n\t\t\t\t\tvar src = model.get('path');\n\t\t\t\t\tvar img = new Image();\n\n\t\t\t\t\timg.src = src;\n\t\t\t\t\timg.onload = (function (i, m) {\n\t\t\t\t\t\treturn function () {\n\t\t\t\t\t\t\tself.count++;\n\t\t\t\t\t\t\tm.set({\n\t\t\t\t\t\t\t\tloaded: true,\n\t\t\t\t\t\t\t\ttag: i\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t})(img, model);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "4561e52e46ac4a7cfc928e64b2f7047f", "score": "0.623015", "text": "function imgLazyLoad() {\n\tvar $productsImg = $('.products__img');\n\n\tif ($productsImg.length) {\n\t\t$productsImg.find('img').unveil();\n\t}\n\n\tvar $cardImages = $('.card-figure');\n\n\tif ($cardImages.length) {\n\t\t$cardImages.find('img').unveil();\n\t}\n}", "title": "" }, { "docid": "3197036cedf6d43cb582d175aca1f9ff", "score": "0.6229115", "text": "function imageLoaded() {\n imagesLoaded++;\n if (imagesLoaded === totalImages) {\n ready = true;\n loader.hidden = true;\n }\n}", "title": "" }, { "docid": "f115beb20c9c57c5fcf4af545208e4e6", "score": "0.6211521", "text": "function preloadImages() {\n\t\t\t$slides.each(function() {\n\t\t\t\tvar $slide = $(this),\n\t\t\t\t\t count = $slide.find('img').length;\n\n\t\t\t\t$slide\n\t\t\t\t\t.data('count', count)\n\t\t\t\t\t.find('img').each(function() {\n\t\t\t\t\t\tvar $image = $(this)\n\n\t\t\t\t\t\t$image\n\t\t\t\t\t\t\t.data('slide', $slide)\n\t\t\t\t\t\t\t.load(imageLoaded);\n\n\t\t\t\t\t\t$image.attr('src', $image.attr('src'));\n\t\t\t\t\t})\n\n\t\t\t\tif($slide.data('count') == 0)\n\t\t\t\t\tslideReady($slide);\n\t\t\t})\n\n\t\t\tpreload_timer = setTimeout(preloadTimeout, preload_time);\n\t\t}", "title": "" }, { "docid": "2c7c9743d3be08eba503eb983bc4576a", "score": "0.620728", "text": "function allPhotos() {\n\t\tvar xmlhr1 = new XMLHttpRequest();\n\t\tvar script= \"get_images.php\";\n\t\txmlhr1.addEventListener(\"load\", loadPhotos);\t\n\t\tloadSpinner(); \n\t\txmlhr1.open(\"GET\", script, true);\n\t\txmlhr1.responseType = \"json\";\n\t\txmlhr1.send();\n\t}", "title": "" }, { "docid": "df92ba1615c6804684f8d4280d18ce4e", "score": "0.6203143", "text": "function countLoadedImagesAndLaunchIfReady(){\n picsToLoad--;\n console.log(picsToLoad);\n if (picsToLoad == 0){\n imageLoadingDone();\n }\n}", "title": "" }, { "docid": "aa862511538935a3a05f056e9f8dac99", "score": "0.61900866", "text": "function loadImages(imgType, rand) {\n jQuery.each(rand, function (i, val) { // the images are created and added to the pieces div\n addPieceImage(imgType, val);\n });\n setPiecesDraggable();\n }", "title": "" }, { "docid": "d93738ee632c04b7b0dbfa4c26036791", "score": "0.6188546", "text": "function preloadImages() {\n if (!preloaded) {\n for (var i = 0; i < preloadUrls.length; i++) {\n preloadedImages[i] = new Image();\n preloadedImages[i].src = preloadUrls[i];\n }\n\n preloaded = true;\n }\n }", "title": "" }, { "docid": "4ea660fbecc90a81e94ecdf4725e43db", "score": "0.6185458", "text": "function loadImages() {\n var imgs = document.getElementsByTagName('img');\n for (var i = 0; i < imgs.length; i++) {\n if (imgs[i].getAttribute('data-src') && imgs[i].style.display != 'none') {\n imgs[i].setAttribute('src', imgs[i].getAttribute('data-src'));\n\t\t\timgs[i].removeAttribute('data-src');\n }\n }\n}", "title": "" }, { "docid": "d32e967d262a02a57c77aa00ebeccb68", "score": "0.6184547", "text": "fetchImages() {\n const { pathname, search } = window.location\n const selected = self.color.selected\n self.loadingImages = true\n\n if (selected) {\n fetch(`${pathname}/images/${selected.id}.json${search}`)\n .then(res => res.json())\n .then(state => self.apply({ ...state, loadingImages: false }))\n .catch(() => self.apply({ loadingImages: false }))\n }\n }", "title": "" }, { "docid": "1b04d2361bfdd11240302dded458eace", "score": "0.61711246", "text": "initializeImages() {\n this.images = this.links.reduce((images, link, index) => {\n const image = this.calculateImagePosition(index)\n image.visibility = this.calculateImageVisibility(image.y)\n image.startedLoading = false\n image.loaded = false\n image.link = link\n image.id = index\n images[index] = image\n return images\n }, {})\n }", "title": "" }, { "docid": "f96e7192e71cbfc00ff2fc7987b41078", "score": "0.6169889", "text": "function imageLoaded(){\n \n imagesLoaded++;\n \n if (imagesLoaded===totalImagesLoaded){\n readyToLoad=true;\n delayLoader.hidden=true;\n imagesToLoad=30;\n apiUrl=`https://api.unsplash.com/photos/random/?client_id=${apiKey}&count=${imagesToLoad}`;\n \n \n \n }\n}", "title": "" }, { "docid": "c1ac94af03b050222619c02e5a5b4b9c", "score": "0.61632264", "text": "loadSelectedImages(evt, cb) {\n const [Images, OutputBin] = [evt.target.files, this.fileContainer];\n // Loop through selected images and render as thumbnails:\n for (let i = 0, currImg; currImg = Images[i]; i++) {\n // Secondary check to ensure only allowable MIME types pass through for image processing:\n if (!/image(\\/.*)?/.test(currImg.type)) { continue; }\n ::this.readInThumbnailWithBckgImage(currImg, i, OutputBin);\n }\n }", "title": "" }, { "docid": "183ac33d165162b30f92aca50ecf04b4", "score": "0.6160407", "text": "function start() {\n\t\t\t\tdebug(\"Info:\", \"start();\", initiated);\n\t\t\t\tif (!initiated)\n\t\t\t\t\treturn;\n\t\t\t\tvar $imagesToLoad = $element.find(\"img.load-image\");\n\t\t\t\timagesToLoad = $imagesToLoad.toArray();\n\t\t\t\timagesLoaded = 0;\n\t\t\t\t$element.trigger(self.IMAGES_LOADING, self.getStateData());\n\t\t\t\tif (imagesToLoad.length == 0) {\n\t\t\t\t\t$element.removeClass(\".load-images-loading\").addClass(\"load-images-loaded\");\n\t\t\t\t\t$element.trigger(self.IMAGES_LOADED, self.getStateData());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$element.removeClass(\".load-images-loaded\").addClass(\"load-images-loading\");\n\t\t\t\t$.each($imagesToLoad, function(index, item) {\n\t\t\t\t\t$(item).attr(\"src\", $(item).attr(\"src\"));\n\t\t\t\t\t$(item)[0].complete\n\t\t\t\t\t\t? onImageLoad() \n\t\t\t\t\t\t: $(item)[0].onload = onImageLoad;\n\t\t\t\t});\n\t\t\t}", "title": "" } ]
b7978aeee33c988dedb262498f4708ba
=================================================== Battles List ===================================================
[ { "docid": "2b58a9051781bc2f6a87f53c30acc260", "score": "0.5776595", "text": "function doBattlesList() {\r\n\tvar allElements;\r\n\tallElements = document.getElementById('contentRow').children[1];\r\n\t\r\n\tvar tmp;\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Battles)/,\"Μάχες\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Battle start)/,\"Έναρξη μάχης\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Battle)/,\"Μάχη\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(defender vs attacker)/,\"αμυνόμενος vs επιτιθέμενος\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Score)/,\"Αποτέλεσμα\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Total damage done)/,\"Συνολική ζημιά\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(No battles)/,\"Καμία μάχη\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Previous)/,\"Προηγούμενη\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Next)/,\"Επόμενη\");\r\n\r\n\ttmp = allElements.children[1];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Country)/,\"Χώρα\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Sorting:)/,\"Ταξινόμιση:\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Only subsidized Battles:)/,\"Μόνο επιδοτούμενες μάχες:\");\r\n\t\r\n\treplaceInputByValue({\"Show battles\":[\"Show battles\",\"Εμφάνισε μάχες\"]});\r\n\r\n\tresults = getElements(document, \"//option[@value]\");\r\n\tfor (var i = 0; i < results.snapshotLength; i++) {\r\n\t\tobj = results.snapshotItem(i);\r\n\t\tif (obj.innerHTML.match(\"Sorting by start time\")) {\r\n\t\t\tobj.innerHTML=obj.innerHTML.replace(/(Sorting by start time)/,\"Ταξινόμιση κατά ώρα έναρξης\");\r\n\t\t} else if (obj.innerHTML.match(\"Sorting by subsidy size\")) {\r\n\t\t\tobj.innerHTML=obj.innerHTML.replace(/(Sorting by subsidy size)/,\"Ταξινόμιση κατά ύψος επιδότησης\");\r\n\t\t} else if (obj.innerHTML.match(\"Sorting by total damage\")) {\r\n\t\t\tobj.innerHTML=obj.innerHTML.replace(/(Sorting by total damage)/,\"Ταξινόμιση κατά συνολική ζημιά\");\r\n\t\t}\r\n\t\t}\r\n\t\r\n tmp = allElements.children[4].children[0].children[0];\r\n var loopz = tmp.children.length;\r\n for (i = 1; i < loopz; i++) {\r\n obj = tmp.children[i].children[3];\r\n replaceBattleTime(obj);\r\n }\r\n\t\r\n\t//Needed ???\r\n\tallElements = document.getElementById('battlesTable');\r\n\ttmp = allElements.children[0].children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Battle start)/,\"Έναρξη μάχης\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Battle)/,\"Μάχη\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(defender vs attacker)/,\"αμυνόμενος vs επιτιθέμενος\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Score)/,\"Αποτέλεσμα\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Total damage done)/,\"Συνολική ζημιά\");\r\n\ttmp = allElements.children[0].children[1];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(No battles)/,\"Καμία μάχη\");\r\n\t\r\n\treplaceAlliesLink();\r\n\treplaceAlliesLink2();\r\n\treplaceAlliesLinksss();\r\n}", "title": "" } ]
[ { "docid": "de92c8df9648a0318be670f949f9a91a", "score": "0.6419033", "text": "async function getBattles(channel) {\n\n}", "title": "" }, { "docid": "05c61d90c00c764fa20f0c396fc09fba", "score": "0.6197058", "text": "function listBattles() {\n element(\"listOfBattles\").innerHTML = \"\";\n for (let i = 0; i < myBattles.length; i++) {\n const battle = myBattles[i];\n // for each battle create an element\n let entry = document.createElement(\"a\");\n entry.classList.add(\"battleListEntry\");\n let island = getMyIslandFromBattle(battle);\n let enemy = getEnemyFromBattle(battle);\n entry.setAttribute(\"onclick\", \"showMinigame({island: \" + island + \"}, \" + JSON.stringify(enemy) + \")\");\n entry.innerHTML = enemy.username.toUpperCase() + \" turn: \" + battle.turn;\n element(\"listOfBattles\").appendChild(entry);\n }\n}", "title": "" }, { "docid": "db6dbf38e34ce5a29875ee21dda655e7", "score": "0.595416", "text": "async function getListOfBattles(req, res) {\n\tconst { skip = 0, status } = req.query;\n\tlet { limit } = req.query;\n\n\tif (parseInt(limit, 10) > 100 || !limit) {\n\t\tlimit = 100;\n\t}\n\n\tconst query = {};\n\tif (status) {\n\t\tquery.status = status;\n\t}\n\n\tconst [battleLists, totalCount] = await Promise.all([\n\t\tBattle.find(query)\n\t\t\t.sort({ createdAt: -1 })\n\t\t\t.skip(parseInt(skip, 10))\n\t\t\t.limit(parseInt(limit, 10))\n\t\t\t.lean(),\n\t\tBattle.countDocuments(query),\n\t]);\n\n\treturn res.status(200).send({\n\t\tmessage: 'Successfully got battles list',\n\t\tresults: battleLists,\n\t\ttotalCount,\n\t});\n}", "title": "" }, { "docid": "f69ad5c7cfe47bb5e65ae8e9d2b8c8f5", "score": "0.5800651", "text": "generateListOfBookmarks() {\n const { bookmarksList } = this.props;\n const listOfAvailableFlats = [];\n\n bookmarksList.forEach((flat) => {\n const {\n title,\n summary,\n img_url,\n id,\n price_formatted,\n } = flat;\n listOfAvailableFlats.push(\n <ListItem\n title={title}\n summary={summary}\n thumbUrl={img_url}\n key={id}\n id={id}\n price={price_formatted}\n />,\n );\n });\n\n return listOfAvailableFlats;\n }", "title": "" }, { "docid": "063541e32fb62960c6eed3b00460ac6b", "score": "0.57823586", "text": "getBoats() {\n var boats = []\n for (var i in instance.connections) {\n var socket = instance.connections[i]\n if (socket.rooms.boats) {\n boats.push({ id: socket.boatId, name: socket.name, followQuay: socket.followQuay, followCoords: socket.followCoords, controllable: socket.controllable })\n }\n }\n this.emit('getBoats', { boats: boats })\n }", "title": "" }, { "docid": "0bb3b9ebc528af7ac790df80aa968a45", "score": "0.56897694", "text": "getBoatConnections() {\n\tvar boats = []\n\tfor(var i = 0; i < instance.connections.length; i++) {\n\t\tif(instance.connections[i].isBoat) {\n\t\t\tboats.push(instance.connections[i])\n\t\t}\n\t}\n\treturn boats;\n }", "title": "" }, { "docid": "b8bd9427beb667956a976fd5958fc542", "score": "0.5647705", "text": "function getBattles(res, mysql, context, complete) {\r\n\t\tmysql.pool.query(\"SELECT * FROM battle\", function(error, results, fields){\r\n\t\t\tif(error) {\r\n\t\t\t\tres.write(JSON.stringify(error));\r\n\t\t\t\tres.end();\r\n\t\t\t}\r\n\t\t\tcontext.battle = results;\r\n\t\t\tcomplete();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "db11b4c6e13d7b218d1c36cf11f699e4", "score": "0.5616896", "text": "function doBattlesList() {\r\n\tvar allElements;\r\n\tallElements = document.getElementById('contentRow').children[1];\r\n\t\r\n\tvar tmp;\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Battles)/,\"Batalhas\");\r\n\t\r\n\ttmp = allElements.children[1];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Country)/,\"País\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Sorting:)/,\"Classificando:\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Only subsidized Battles:)/,\"Somente batalhas:\");\r\n\t\r\n\treplaceInputByValue({\"Show battles\":[\"Show battles\",\"Ver batalhas\"]});\r\n\t\r\n\tallElements = document.getElementById('battlesTable');\r\n\ttmp = allElements.children[0].children[0];\r\n//\talert(tmp.innerHTML);\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Battle start)/,\"Começar\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Battle)/,\"Batalha\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(defender vs attacker)/,\"defensor vs atacante\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Score)/,\"Pontuação\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/(Total damage done)/,\"Dano total\");\r\n\t\r\n\ttmp = allElements.children[0];\r\n//\talert(tmp.children.length);\r\n\t\r\n\tfor (i = 1; i < tmp.children.length; i++) {\r\n\t\tobj = tmp.children[i].children[3];\r\n\t\treplaceBattleTime(obj);\r\n\t}\r\n//\treplaceBattleInfo(tmp);\r\n//\treplaceBattleTime(tmp);\r\n\r\n\treplaceAlliesLink();\r\n\treplaceAlliesLink2();\r\n\treplaceAlliesLinksss();\r\n\t\r\n}", "title": "" }, { "docid": "ceecea6306253c46dcd7d2a4346c4bbf", "score": "0.5518041", "text": "function pairList(b,iList) {\n\t\tvar p = []\n\t\tfor (var i = 0; i < b.length; i++ ) {\n\t\t\tp[b[i]] = []\n\t\t\tfor (var j = 0; j < i; j ++) {\n\t\t\t\tvar weight = b.length - j // set to 1 maybe\n\t\t\t\tvar weight = 1\n\t\t\t\tp[b[i]][b[j]] = weight // set all beats to 1\n\t\t\t}\n\t\t}\n\t\tvar pairs = []\n\t\tfor (var m = 0; m < iList.length; m++ ) {\n\t\t\tvar i = iList[m]\n\t\t\tfor (var n = 0; n < iList.length; n ++) {\n\t\t\t\tvar j = iList[n]\n\t\t\t\tif (p[i] && p[i][j]) {\n\t\t\t\t\tpairs.push(p[i][j])\n\t\t\t\t} else {\n\t\t\t\t\tpairs.push(0)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn pairs\n\t\t\n\t}", "title": "" }, { "docid": "79659f436d19273d7192a5541e776c23", "score": "0.5506462", "text": "dohtwo() {\n let attributes = [];\n //by zebra puzzle specification, there are 15 constraints.\n for (let i = 0; i < 15; i++) {\n this.state.items.map((item) =>\n //determining whether the item is an array or not to determine whether branching is present.\n Array.isArray(Object.values(item)[i])\n ? this.loadEmbedElements2(\n //call to another function to deal with embedded attribute values due to branching. That's the way they come in JSON format\n Object.values(item)[i].length,\n Object.values(item)[i],\n attributes\n )\n : //if not an array - means no branching and the values are appended to this output.\n attributes.push(Object.values(item)[i].House2)\n );\n }\n //returned is a list of all attribute values for house two at each application of a constraint and including the different versions of the same\n //values when branching occurs.\n return attributes;\n }", "title": "" }, { "docid": "1bb2663a8748966c55c949b9ef5e5f59", "score": "0.53689706", "text": "function populateBreeds() {\n fetch(breedUrl)\n .then (resp => resp.json())\n .then (json => {\n \n // console.log(json.message)\n \n const breedList = json.message\n \n const ul = document.getElementById(\"dog-breeds\")\n \n for ( let breed in breedList ) {\n \n const li = document.createElement(\"li\")\n const text = document.createElement(\"text\")\n \n text.textContent = breed\n li.appendChild(text)\n ul.appendChild(li)\n \n li.addEventListener(\"click\", event => {\n event.target.style=\"color: aquamarine\" \n })\n }\n })\n \n }", "title": "" }, { "docid": "f7e0f990083360e6c89bd1fa5346c66d", "score": "0.53152746", "text": "function renderBreeds(breeds){\n const main = document.getElementById('dog-breeds')\n for (const breed in breeds.message){\n const li = document.createElement('li')\n li.innerHTML = breed\n main.appendChild(li)\n //the event listener to change color\n li.addEventListener('click', function(){\n li.style.color = \"blue\"\n })\n }\n }", "title": "" }, { "docid": "091fb334558323613ffe15c0c291cf83", "score": "0.52306545", "text": "function addBreeds(brd){\n const dogBreedContainer = document.getElementById(\"dog-breeds\")\n const dogBreed = document.createElement(\"li\")\n dogBreed.innerText = brd\n dogBreedContainer.append(dogBreed)\n }", "title": "" }, { "docid": "1be28c09017e2575bda5402d551261f0", "score": "0.5171341", "text": "function getBlueToothList(viewModel) {\n var blueToothList = viewModel.get('devicesFound');\n var bluetoothRefreshList = [];\n for (var i = 0; i < blueToothList.length; i++) {\n bluetoothRefreshList[i] = { bluetoothID: blueToothList[i].bluetoothID, isSelected: false };\n }\n return bluetoothRefreshList;\n}", "title": "" }, { "docid": "47f4847c5e18e1640caa6ea5d8bb5f9e", "score": "0.5168789", "text": "function renderBreeds(json) {\n const ul = document.getElementById('dog-breeds')\n let breeds = json.message\n\n for(var i = 0 in breeds) {\n let li = document.createElement('li')\n li.innerHTML = `${i}`\n // font color of a particular <li> changes on click\n li.addEventListener('click', () => li.style.color = \"green\")\n ul.appendChild(li)\n myData.push(li)\n }\n}", "title": "" }, { "docid": "c316980410c079cf8b821d558a231e68", "score": "0.5156214", "text": "getVerbList() {\n return this.state.verbList.slice();\n }", "title": "" }, { "docid": "d8d9bb983f2f4578603f242038d19418", "score": "0.51327574", "text": "function generateBoats(grid) {\n // This array represente the number of boat with its size\n let boats = [5, 4, 3, 3, 2, 2]\n for (let i = 0; i < boats.length; i++) {\n placeBoat(boats[i], grid);\n }\n}", "title": "" }, { "docid": "bd93555a6f28f58f1ac243ce34ae1117", "score": "0.51228684", "text": "lookForBikeElement(data) {\n if (data === []) return []\n console.log('Lista: ', data)\n let newList = []\n data.forEach( (element) => {\n if (element.advertising.localName === 'BIKE' || element.name === 'Arduino') {\n newList.push(element)\n console.log('pushed element: ', element)\n }\n })\n return newList\n }", "title": "" }, { "docid": "73109e64f314da55d97e9cfccab2b0af", "score": "0.5121466", "text": "giveBirth(cell) {\n let babies = [];\n let [neighborhood] = this.neigborhoodsKeys(cell);\n for (let neighborKey of neighborhood) {\n if (this.livings.has(neighborKey)) {\n // neighbor is alive. Do not give birth here.\n //console.debug('someone is living here !');\n } else {\n // neighbor is not alive. Give birth here.\n let nCell = Helper.parseCell(neighborKey);\n //console.debug('neighborKey:', neighborKey, 'nCell:', nCell);\n let baby = new Cell(nCell.c, nCell.r, cell.strategy);\n //console.debug('A new baby:', baby);\n babies.push(baby);\n break;\n }\n }\n\n //console.debug('Giving birth to cell:', cell, 'with babies:', babies);\n return babies;\n }", "title": "" }, { "docid": "6f775fee93586c33b83bb71854881a3d", "score": "0.51055455", "text": "function ProcessBrew(item, index) {\n var li = document.createElement('li');\n ul.appendChild(li);\n\n li.innerHTML=li.innerHTML + index + \": \" + \" Brew Name: \" + item.BrewName + \"--- \\tBrewer: \" + item.Brewer + \"---\\tBrewer Location: \" + item.BrewerLocation + \"--- \\tTried It? \"+ item.Tried;\n }", "title": "" }, { "docid": "3aa45fcd8a801b7f1240ffd82f027fd5", "score": "0.509296", "text": "function getbatter(){\nvar a2=[];\nfor(var i=0;i<array.length;i++){\n\n // for(var m=0;m<array[i].batters[\"batter\"].length;m++){\n\n a2 = array[i].batters.batter;\n\n\nfor(var j = 0 ; j< a2.length ; j++ )\n{\n console.log(a2[j].type);\n}}\n}", "title": "" }, { "docid": "05f02b34d93d878138e931310312175f", "score": "0.5092344", "text": "build() {\n\n this.list = [];\n\n for (let r = 0; r < this.rows; r++) {\n for (let c = 0; c < this.columns; c++) {\n\n let b = brick();\n b.setPosition(c * (b.width + this.offset), this.offsetTop + ((this.offset + b.height) * r));\n b.color = this.getRandomColor();\n b.render();\n\n this.list.push(b);\n }\n }\n }", "title": "" }, { "docid": "2ac1cd76d1fe7704299726351d96d2b6", "score": "0.5079259", "text": "function getBreed (breeds){\n // console.log(breeds)\n const breedUl = document.getElementById('dog-breeds')\n \n \n for(let breed in breeds['message']) {\n breedArr.push(breed)\n const breedLi = document.createElement('li'); \n breedLi.textContent = breed; \n breedUl.appendChild(breedLi)\n }\n \n}", "title": "" }, { "docid": "67844fc15f54ce53be56f320289918e5", "score": "0.5063073", "text": "componentDidMount() {\n const blurbArray = [\n \"Whimsical Wordsmith\",\n \"Pragmatic Programmer\",\n \n \"Alliterative Aficionado\",\n \"Endorphin Enthusiast\",\n \n \n \n ];\n const pairedBlurbs = this.pairBlurbs(this.shuffleBlurbs(blurbArray));\n\n this.setState({\n blurbPairs: pairedBlurbs\n });\n }", "title": "" }, { "docid": "e9091b9e71f0e402000c598604668e24", "score": "0.50618696", "text": "function showBoats(){\r\n if (boats.length>0){\r\n if (boats.length<4 && boats[boats.length-1].body.position.x<width-300){\r\n var positions = [-40,-60,-70,-20];\r\n var position = random(positions);\r\n var boat = new Boat(width,height-100,170,170,position,boatAnimation);\r\n boats.push(boat);\r\n }\r\n \r\n for(var i=0;i<boats.length; i++){\r\n Matter.Body.setVelocity(boats[i].body,{x:-0.9,y:0});\r\n boats[i].display();\r\n boats[i].animate();\r\n }\r\n}\r\n else{\r\n var boat = new Boat(width,height-60,170,170,-60,boatAnimation);\r\n boats.push(boat);\r\n }\r\n}", "title": "" }, { "docid": "a9c3572487f3b12fcfda12c97ec8e064", "score": "0.5059727", "text": "function getSortedBeaconList()\t{\n\t\tvar beaconList = [];\n\t\tfor (var key in beacons)\n\t\t{\n\t\t\t// We check that the beacon we insert in the array is one of our beacons and not other company's one as well as it's not corrupted:\n\t\t\tif (beacons[key] != null && beacons[key] !== undefined && uint8ArrayToString(beacons[key].nid) == \"a7ae2eb7a749bac1ca64\") { // Apparently, namespace ID has to be compared in lowercase values\n\t\t\t\tconsole.log(\"Pool of beacons. Address: \" + key);\n\t\t\t\tbeaconList.push(beacons[key]);\n\t\t\t\tif (_frequencyHistogram[uint8ArrayToString(beacons[key].bid)] == undefined) {_frequencyHistogram[uint8ArrayToString(beacons[key].bid)] = {instance:uint8ArrayToString(beacons[key].bid), n: 0};} else {_frequencyHistogram[uint8ArrayToString(beacons[key].bid)].n += 1;}\n\t\t\t\tconsole.log(\"frequencyHistogram[\"+uint8ArrayToString(beacons[key].bid)+\"].n = \" + _frequencyHistogram[uint8ArrayToString(beacons[key].bid)].n);\n\t\t\t}\n\t\t}\n\t\tif (beaconList.length == 0) {\n\t\t\t// Firstly, we check whether the beacons are reachable or not. If we are not receiving signals from the beacons we will let the user know.\n\t\t\tconsole.log(\"undefinedCounter = \" + undefinedCounter);\n\t\t\tif (undefinedCounter != -1) {\n\t\t\t\tundefinedCounter++;\n\t\t\t\tif (undefinedCounter == 16) {showToolTip('You might be experimenting some interferences! Beacons might not be reachable! :('); return null;} // If 16 consecutive frames are not received, we warn the user.\n\t\t\t\tif (undefinedCounter == 20) {_allowYOUlabel = false; updateYOUlabel(); return null;} // If 20 consecutive frames are not received, we make dissapear the 'YOU' label and source point.\n\t\t\t\tif (undefinedCounter < 20) {_real_X=undefined; _real_Y=undefined; updateGUI();} // We want to show the user's last known position in gray scale.\n\t\t\t\tif (undefinedCounter == 28) { // If 28 consecutive frames are not received, we warn the user and force him/her to accept the message dialog.\n\t\t\t\t\tundefinedCounter = -1;\n\t\t\t\t\t_allowYOUlabel = false;\n\t\t\t\t\tparenLasRotativas();\n\t\t\t\t\t_blestatusTimerID = setInterval(checkBLEStatus, 1000);\n\t\t\t\t\tif (!_showingDialog) {\n\t\t\t\t\t\t_showingDialog = true;\n\t\t\t\t\t\tnavigator.notification.alert(\"It seems that you are experimenting strong interferences. No data readings \" +\n\t\t\t\t\t\t\"are received, make sure you have the Bluetooth feature enabled in your device \" +\n\t\t\t\t\t\t\" and ensure you are inside the building! :)\", function() {\n\t\t\t\t\t\t\t_showingDialog = false;\n\t\t\t\t\t\t\tbluetoothSerial.enable(function(){console.log(\"The user enabled Bluetooth in purpose\");}, function(){console.log(\"The user declined enabling Bluetooth\");})\n\t\t\t\t\t\t}, \"Serious interferences :(\", \"Oki Doki!\");\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else {\n\t\t\tundefinedCounter = 0; // The counter is reset in case the contact with the beacons is again lost.\n\t\t\t// Next step is sorting our own beacons based on RSSI strength\n\t\t\tbeaconList.sort(function(beacon1, beacon2)\n\t\t\t{\n\t\t\t\treturn mapBeaconRSSI(beacon1.rssi) < mapBeaconRSSI(beacon2.rssi);\n\t\t\t});\n\t\t\treturn beaconList;\n\t\t}\n\t}", "title": "" }, { "docid": "f720af033f4a6e58a8e1799319dbb7ea", "score": "0.50580966", "text": "function getBag() {\r\n \tbag = [];\r\n \tvar contents = \"\";\r\n \tfor (var i = 0; i < 7; i++) {\r\n \t\tvar shape = randomKey(shapes);\r\n \t\twhile(contents.indexOf(shape) != -1) {\r\n \t\t\tshape = randomKey(shapes);\r\n \t\t}\r\n \t\tbag[i] = shape;\r\n \t\tcontents += shape;\r\n \t}\r\n \tbagIndex = 0;\r\n }", "title": "" }, { "docid": "ce172a10f3af999f9100f729afa29d83", "score": "0.5049896", "text": "function getBreads() {\n var url = \"cookbook.json\";\n getJSON(url).then(function (data) {\n console.log(data);\n\n var breads = data.Breads;\n\n\n var recipeListElement = document.getElementById(\"recipeList\");\n breads.forEach(function(recipe){\n var recipeCall = createRecipe(recipe);\n recipeListElement.appendChild(recipeCall);\n });\n\n });\n\n\n }", "title": "" }, { "docid": "a4ffac125185414fb103f50ac56ac2c9", "score": "0.5023721", "text": "function bagMarbles(bag) {\n\tvar l, marble;\n\tl = bag.length;\n\n\tfunction randomMarble(array) {\n\t\treturn array.splice(Math.floor(Math.random() * array.length), 1);\n\t}\n\n\tfunction selectMarble(arr) {\n\t\tvar marble, marbleItem, marbleCount;\n\t\tmarbleItem = randomMarble(arr)[0];\n// \t\tconsole.log(marbleItem);\n\t\tmarble = marbleItem[0];\n\t\tmarbleCount = marbleItem[1];\n\t\tmarbleCount--;\n\t\tmarbleItem = [marble, marbleCount];\n\t\t\n\t\tif (marbleCount > 0) {\n\t\t arr.push(marbleItem); \n\t\t}\n\t\telse if (marbleCount === 0) {\n\t\t l--;\n\t\t // console.log(l);\n\t\t}\n // console.log(arr);\n \n return marble;\n\t}\n\n\twhile (l > 0) {\n\t\tmarble = selectMarble(bag);\n\t\tconsole.log('Marble: ' + marble);\n\t}\n\n// \tconsole.log(l);\n// \tselectMarble(bag);\n}", "title": "" }, { "docid": "ca71bf157c16605b884f1502928bc7eb", "score": "0.5010647", "text": "static get tagList() {\n return [\n ['Castle', 49.013790, 8.404435, '#sight'],\n ['IWI', 49.013790, 8.390071, '#edu'],\n ['Building E', 49.014993, 8.390049, '#campus'],\n ['Building F', 49.015608, 8.390112, '#campus'],\n ['Building M', 49.016171, 8.390155, '#campus'],\n ['Building LI', 49.015636, 8.389318, '#campus'],\n ['Auditorium He', 49.014915, 8.389264, '#campus'],\n ['Building R', 49.014992, 8.392365, '#campus'],\n ['Building A', 49.015738, 8.391619, '#campus'],\n ['Building B', 49.016843, 8.391372, '#campus'],\n ['Building K', 49.013190, 8.392090, '#campus'],\n ];\n }", "title": "" }, { "docid": "89a4f574dfc3a3cd98ee1a89e87aaf1a", "score": "0.4995631", "text": "function makeBaddies(baddies){\n var baddiesUl = $('<ul>');\n for (var i = 0; i < baddies.length; i++) {\n var newBaddie = $('<li>').html(baddies[i]);\n }\n $('body').append(baddiesUl);\n}", "title": "" }, { "docid": "7336b567edb271f0d2c2db8152f6199b", "score": "0.49790716", "text": "render() {\n\n const allBattles = this.props.battles.map((battle) => {\n return (\n <div className=\"post\" key={battle.battle.id}>\n <Battle\n users={battle.users}\n category={battle.battle.category}\n id={battle.battle.id}\n likes={battle.likes}\n />\n </div>\n )\n })\n\n return (\n <div className=\"post-container\">\n {allBattles}\n </div>\n )\n }", "title": "" }, { "docid": "29ac562c02d35894eaa82a23ce9dc41e", "score": "0.49777824", "text": "get allBees() {\n var bees = [];\n for(var i=0; i<this._places.length; i++){\n for(var j=0; j<this._places[i].length; j++){\n bees = bees.concat(this._places[i][j].bees);\n }\n }\n return bees; \n }", "title": "" }, { "docid": "6d2702e5d11fe38b2fc65b7da15bcaf0", "score": "0.4966013", "text": "function parseBlues(data) {\n\treturn data.payload.items.map(mapConcert);\n}", "title": "" }, { "docid": "c8d0c32b5d1e3747148def10cfdceb30", "score": "0.49646708", "text": "function LmbsSpriteBattler() {\r\n this.initialize.apply(this, arguments);\r\n}", "title": "" }, { "docid": "e56f029614d14d8b6feb2cc252a6cd1e", "score": "0.4955364", "text": "function getBeachesList(msg) {\n beachServices\n .getList()\n .then(response => sendMessage(response, msg))\n .catch(handleError);\n }", "title": "" }, { "docid": "4d7547e8a92f027132ad7b51e972306e", "score": "0.49488595", "text": "function Bartender(myQuestionList) {\n this.questionList = myQuestionList;\n}", "title": "" }, { "docid": "489694ce1dca8934b61ef43dc463e491", "score": "0.49299595", "text": "function displayBirds() {\n for (i=0;i<data.individuals.length;i++){\n //$('#birds').append('<li onclick=\"markerClick(' + i + ');\">' + data.individuals[i]['individual_local_identifier'] + '</li');\n $('#birds').append('<li onclick=\"markerClick(' + i + ');\">' + data.individuals[i]['individual_local_identifier'] + '</li');\n }\n}", "title": "" }, { "docid": "23356cdfcbb6f0ccaaf9de3baa92961e", "score": "0.4903115", "text": "function findLighterBike(arrayList){\n for (i = 0; i < arrayList.length; i++){\n const { name, weight } = arrayList[i];\n\n if(!lighterBike || weight < lighterBike.weight) {\n lighetrBike = {\n name,\n weight\n //oppure, che è uguale, usando lo spread operator\n ...bici\n }\n }\n }\n return lighterBike;\n}", "title": "" }, { "docid": "676d6f198a39510beb75cb1dbfdedba7", "score": "0.4890733", "text": "function getAttractions() {\n let rawData = fs.readFileSync('business.json');\n let businesses = JSON.parse(rawData).Businesses;\n let results = [];\n\n for (let i = 0; i < businesses.Categories.length; i++) {\n if (businesses.Categories[i].Category.CategoryName === \"Cosas para hacer\") {\n for (let j = 0; j < businesses.Categories[i].Category.CategoryData.length; j++) {\n let Business_Rating;\n for(let k=5; k>-1; k--){\n for(let l = 0; l < businesses.Ratings[k].Rating.CategoryData.length; l++){\n if(businesses.Ratings[k].Rating.CategoryData[l].Business_Name === businesses.Categories[i].Category.CategoryData[j].Business_Name){\n Business_Rating = businesses.Ratings[k].Rating.RatingNumber\n }\n }\n }\n let business = {\n \"Owners_Name\": businesses.Categories[i].Category.CategoryData[j].Owners_Name,\n \"Business_Name\": businesses.Categories[i].Category.CategoryData[j].Business_Name,\n \"Business_Type\": businesses.Categories[i].Category.CategoryData[j].Business_Type,\n \"Business_Desc\": businesses.Categories[i].Category.CategoryData[j].Business_Desc,\n \"Business_Location\": businesses.Categories[i].Category.CategoryData[j].Business_Location,\n \"Business_Price\": businesses.Categories[i].Category.CategoryData[j].Business_Price,\n \"Business_Rating\": Business_Rating,\n \"Image_Src\": businesses.Categories[i].Category.CategoryData[j].Image_Src\n }\n results.push(business);\n }\n }\n }\n return results;\n}", "title": "" }, { "docid": "0ba09f1f73d53bfe1a2a46be1bce6de8", "score": "0.48844242", "text": "loadBans() {\n return this.createCommand(\"banList.load\").send();\n }", "title": "" }, { "docid": "e5b4c8cb960d5eb7ffa15c6b1222b387", "score": "0.4884248", "text": "generateListOfAvailableFlats() {\n const { flatsList } = this.state;\n const listOfAvailableFlats = [];\n\n flatsList.forEach((flat) => {\n const {\n title,\n summary,\n img_url,\n id,\n price_formatted,\n } = flat;\n\n listOfAvailableFlats.push(\n <ListItem\n title={title}\n summary={summary}\n thumbUrl={img_url}\n key={id}\n id={id}\n price={price_formatted}\n />,\n );\n });\n\n return listOfAvailableFlats;\n }", "title": "" }, { "docid": "4c93e341cccb48aedfa056718870bb94", "score": "0.48776495", "text": "componentDidMount() {\n axios({\n method: \"GET\",\n url: '/api/puppyfinder/breeds'\n })\n .then(data => {\n const breedList = data.data.data.map(breed => {\n return {value: breed.$t, label: breed.$t}\n })\n this.setState({\n breedList: breedList\n })\n console.log(breedList);\n })\n .catch(err => {\n console.log(err);\n })\n }", "title": "" }, { "docid": "48c496e8558ffdc76258ff0846b927b7", "score": "0.48723233", "text": "getAllBallots(tallyData) {\n\t\t// return value\n\t\tconst ballots = [];\t\n\t\t// for each candidate key in tallyData\n\t\tfor (let candidate in tallyData) {\n\t\t\t// for each vote in tha candidate's tally\n\t\t\tfor (let vote of tallyData[candidate]) {\n\t\t\t\t// pushes a copy of the vote array onto ballots\n\t\t\t\tballots.push([...vote]);\n\t\t\t}\n\t\t}\n\t\t// returns ballots at the end\n\t\treturn ballots;\n\t}", "title": "" }, { "docid": "999d0505774cffa15c0d46b7a2fcb0eb", "score": "0.48643768", "text": "function displayBuff(player, type, list) {\n \n for (var i = 0; i < list.length; i++) {\n var newBuff = document.createElement(\"div\");\n newBuff.classList.add(list[i]);\n newBuff.classList.add(type);\n qs(player + \" .buffs\").appendChild(newBuff);\n }\n }", "title": "" }, { "docid": "8640655f5a561d8ce2cc49ddb8a70575", "score": "0.48601317", "text": "function bacteriaName(name) {\n var listOfBact = [];\n\n for (var i = 0; i < name.length; i++) {\n var stringName = name[i].toString();\n var splitValue = stringName.split(\";\");\n if (splitValue.length > 1) {\n listOfBact.push(splitValue[splitValue.length - 1]);\n } else {\n listOfBact.push(splitValue[0]);}\n }\n return listOfBact;\n}", "title": "" }, { "docid": "7949ce0bc2e33b192f84f739f74dd2b0", "score": "0.48560268", "text": "dohfive() {\n let attributes = [];\n for (let i = 0; i < 15; i++) {\n this.state.items.map((item) =>\n Array.isArray(Object.values(item)[i])\n ? this.loadEmbedElements5(\n Object.values(item)[i].length,\n Object.values(item)[i],\n attributes\n )\n : attributes.push(Object.values(item)[i].House5)\n );\n }\n return attributes;\n }", "title": "" }, { "docid": "ac8731d6d9142b82b97587e81955064a", "score": "0.48526344", "text": "function organizeBreedNames(list) {\n let finalList = [];\n for (let breed in list) {\n // If the general breed has sub-breeds, reorder the names and add a space.\n if (list[breed].length) {\n for (let descriptor of list[breed]) {\n finalList.push(descriptor + ' ' + breed);\n }\n } else {\n finalList.push(breed);\n }\n }\n // Sort alphabetically.\n finalList.sort();\n return finalList;\n }", "title": "" }, { "docid": "03cc57f498130b38038eda9a9a0a4563", "score": "0.48482767", "text": "function getAllBerriesCallback(response){\n\tconsole.log(response.count);\n\tresponse.results.forEach(function(berry){\n\t\tconsole.log(berry.name);\n\t})\n}", "title": "" }, { "docid": "e51db279a29e6283a3b713977f9723fd", "score": "0.48446888", "text": "function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) {\n\t var result = [];\n\n\t for(var i = 0; i < safeContents.length; i++) {\n\t for(var j = 0; j < safeContents[i].safeBags.length; j++) {\n\t var bag = safeContents[i].safeBags[j];\n\t if(bagType !== undefined && bag.type !== bagType) {\n\t continue;\n\t }\n\t // only filter by bag type, no attribute specified\n\t if(attrName === null) {\n\t result.push(bag);\n\t continue;\n\t }\n\t if(bag.attributes[attrName] !== undefined &&\n\t bag.attributes[attrName].indexOf(attrValue) >= 0) {\n\t result.push(bag);\n\t }\n\t }\n\t }\n\n\t return result;\n\t}", "title": "" }, { "docid": "20f46994326e26d640239f74f9b88b63", "score": "0.48328885", "text": "function addBreeds(dogBreedString){\n const liElement = document.createElement(\"li\")\n liElement.innerText = dogBreedString\n dogBreedList.append(liElement)\n}", "title": "" }, { "docid": "ee51ed2def518545a828c1a19dbebcdf", "score": "0.4830168", "text": "async function fetchBans() {\n\t\tawait axios({\n\t\t\tmethod: \"get\",\n\t\t\turl: `${process.env.REACT_APP_SERVER_PATH}/ban`,\n\t\t\theaders: {\n\t\t\t\tauthorization: \"Bearer \" + props.authtoken\n\t\t\t}\n\t\t}).then(res => {\n\t\t\tif (res.status == 200) {\n\t\t\t\tsetBans(res.data);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "2e899eea621fc62742bc8805788d9799", "score": "0.48234296", "text": "createBonds(bonds = \"auto\") {\n this.bondFills = [];\n // Manual bonds\n if (Array.isArray(bonds)) {\n for (let bond of bonds) {\n let i = bond[0];\n let j = bond[1];\n let pos1 = this.atomPos[i];\n let pos2 = this.atomPos[j];\n this.addBond(i, j, pos1, pos2);\n }\n // Automatically detect bonds\n }\n else if (bonds === \"auto\") {\n let nAtoms = this.atomPos.length;\n for (let i = 0; i < nAtoms; ++i) {\n for (let j = 0; j < nAtoms; ++j) {\n if (j > i) {\n let pos1 = this.atomPos[i];\n let pos2 = this.atomPos[j];\n let num1 = this.atomNumbers[i];\n let num2 = this.atomNumbers[j];\n let distance = pos2.clone().sub(pos1).length();\n let radii1 = this.options.structure.radiusScale * this.elementRadii[num1];\n let radii2 = this.options.structure.radiusScale * this.elementRadii[num2];\n if (distance <= this.options.structure.bondScale * 1.1 * (radii1 + radii2)) {\n this.addBond(i, j, pos1, pos2);\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "952809e846b2d0cfcd6e9ba21e5a6a51", "score": "0.48135433", "text": "function displayBikeListings(data) {\n let bikeResults = data.features.map((listing, index) => renderBikeListings(listing, index))\n $('.bike-listings').html('<ul>' + bikeResults.join('') + '</ul>');\n $('.listings').css('visibility', 'visible');\n showBikeListDetails();\n flyToBike(data);\n}", "title": "" }, { "docid": "d509b763992aa25c97eea17452c9823f", "score": "0.4805467", "text": "function bindArrayItems() {\n\tvar randomWordIndex;\n\n\t// Loop through the five set of list\n\tfor(let item of obj) {\n\t\tlet elem = document.querySelector(item[\"nodeName\"]);\n\t\tlet btn = document.createElement(\"button\");\n\t\tlet listArray = item[\"wordList\"];\n\t\tlet randomColor = getRandomColor();\n\n\t\tbtn.classList = \"btn btn-primary btn-number\";\n\t\telem.style.backgroundColor = randomColor;\n\t\tbtn.style.backgroundColor = randomColor;\n\t\tbtn.style.borderColor = randomColor;\n\t\tbtn.innerHTML = `<i class=\"far fa-hand-pointer\"></i>`;\n\t\telem.parentElement.insertBefore(btn, elem);\n\n\t\t// Loop through the list of words in each set to display the items\n\t\tfor(let list of listArray){\n\t\t\tlet listItem = document.createElement(\"li\");\n\t\t\tlet listImage = document.createElement(\"img\");\n\t\t\tlistImage.setAttribute('src', list.img);\n\t\t\tlistItem.textContent = list.text;\n\t\t\tlistItem.appendChild(listImage);\n\t\t\telem.appendChild(listItem);\n\t\t}\n\t\t\n\t\t// Click event of buttons of each set of list\n\t\tbtn.addEventListener('click', function(event) {\n\t\t\tlistButtonClick(event, listArray);\n\t\t});\n\t}\n\t\n}", "title": "" }, { "docid": "96348991d14e86a55fd8b2f79b5a70b1", "score": "0.4802839", "text": "static async getDataToBlacklist () {\n // CBL = ContentBlacklist\n const tracksFromCBL = await models.ContentBlacklist.findAll({\n attributes: ['value'],\n where: {\n type: types.track\n },\n raw: true\n })\n const usersFromCBL = await models.ContentBlacklist.findAll({\n attributes: ['value'],\n where: {\n type: types.user\n },\n raw: true\n })\n const segmentsFromCBL = await models.ContentBlacklist.findAll({\n attributes: ['value'],\n where: {\n type: types.cid\n },\n raw: true\n })\n\n const segmentsToBlacklist = segmentsFromCBL.map(entry => entry.value)\n const userIdsToBlacklist = usersFromCBL.map(entry => parseInt(entry.value))\n const trackIdsToBlacklist = tracksFromCBL.map(entry => parseInt(entry.value))\n\n return { trackIdsToBlacklist, userIdsToBlacklist, segmentsToBlacklist }\n }", "title": "" }, { "docid": "dfade8e62b9aa7b6d95909b1ad409234", "score": "0.4792866", "text": "function initBoats(){\r\n //loadBoat(name, woodCost, goldCostBase, persec, goldCostGrowth)\r\n loadBoat(\"Row Boat\", 10, 10, 1, 1.1);\r\n loadBoat(\"Sloop\", 100, 150, 5, 1.15);\r\n loadBoat(\"Longship\", 1000, 1800, 25, 1.14);\r\n loadBoat(\"Caravelle\", 10000, 21600, 150, 1.13);\r\n loadBoat(\"Schooner\", 100000, 259200, 750, 1.12);\r\n loadBoat(\"Galley\", 1000000, 3110400, 3750, 1.11);\r\n loadBoat(\"Brigantine\", 10000000, 37324800, 18750, 1.10);\r\n loadBoat(\"Barque\", 100000000, 447897600, 93750, 1.09);\r\n loadBoat(\"Galleon\", 1000000000, 5374771200, 468750, 1.08);\r\n loadBoat(\"Trireme\", 10000000000, 64497254400, 2343750, 1.07);\r\n loadBoat(\"Man-of-War\", 100000000000, 773967052800, 11718750, 1.06);\r\n loadBoat(\"Dreadnought\", 100000000000, 9287604633600, 58593750, 1.05);\r\n}", "title": "" }, { "docid": "81ee4227eae647626f749ef4d541330a", "score": "0.47897723", "text": "function get_boats(owner) {\n const q = datastore.createQuery(BOATS);\n return datastore.runQuery(q).then( (entities) => {\n return entities[0].map(ds.fromDatastore).filter( item => item.owner === owner );\n }); \n}", "title": "" }, { "docid": "c09b522c58a63fc56c0e01c9cfc4c187", "score": "0.47849137", "text": "function getArrayOfBalls() {\r\n let balls = []\r\n for (let i = 0; i < noOfRecords.Red; i++) {\r\n balls.push(\"Red\")\r\n }\r\n for (let i = 0; i < noOfRecords.Green; i++) {\r\n balls.push(\"Green\")\r\n }\r\n for (let i = 0; i < noOfRecords.Blue; i++) {\r\n balls.push(\"Blue\")\r\n }\r\n return balls\r\n}", "title": "" }, { "docid": "8c970790ef909716567e9cdb460e7531", "score": "0.47822642", "text": "async getBooster(set) {\n let data = await this.http.fetch(`/sets/${set}/booster`).then(response => this.parseResponse(response))\n let results = []\n let response = await data.body.then(result => {\n return result.cards\n })\n response.forEach(card => {\n results.push(new Card(card))\n })\n return results\n }", "title": "" }, { "docid": "c02cc3cf0e226ebd976e350704c45060", "score": "0.47714522", "text": "get boosts() {\n return this._boosts;\n }", "title": "" }, { "docid": "71bc6a58fad69cd9110bbcca8214ee99", "score": "0.4768165", "text": "function createBattingTeam() {\n var battersTeam = new Batters();\n for(var i = 0; i < batsmenData.length; i++) {\n var batterObj = new Batsman({\n id: batsmenData[i].id\n });\n battersTeam.add(batterObj);\n }\n return battersTeam;\n}", "title": "" }, { "docid": "f5e31185773949f73d0c0e8d17f82cbb", "score": "0.4763093", "text": "getAllBreeds(context) {\n fetch(\"https://dog.ceo/api/breeds/list/all\").then(response => {\n return response.json();\n }).then(json => {\n context.commit('setBreeds', json.message);\n }).catch(err => {\n console.log('Error retrieving breeds', err);\n });\n }", "title": "" }, { "docid": "9473c453173e004c9693e706bc77dff0", "score": "0.4762118", "text": "Flock() {\n boids = new ArrayList(); // Initialize the arraylist\n }", "title": "" }, { "docid": "c1ee20d5caea815e60e98ac5161e90c8", "score": "0.47515067", "text": "renderBirdSightings(){\n return this.state.birds.map((sighting)=>{\n return<div key={sighting._id}>\n <p className=\"list-group-item item-list\" > {sighting.name} seen {sighting.number} times </p>\n </div>\n })\n }", "title": "" }, { "docid": "1617fca89ee274ea0ecbcbf3e83b7d85", "score": "0.47493148", "text": "function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) {\n var result = [];\n\n for(var i = 0; i < safeContents.length; i++) {\n for(var j = 0; j < safeContents[i].safeBags.length; j++) {\n var bag = safeContents[i].safeBags[j];\n if(bagType !== undefined && bag.type !== bagType) {\n continue;\n }\n // only filter by bag type, no attribute specified\n if(attrName === null) {\n result.push(bag);\n continue;\n }\n if(bag.attributes[attrName] !== undefined &&\n bag.attributes[attrName].indexOf(attrValue) >= 0) {\n result.push(bag);\n }\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "1617fca89ee274ea0ecbcbf3e83b7d85", "score": "0.47493148", "text": "function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) {\n var result = [];\n\n for(var i = 0; i < safeContents.length; i++) {\n for(var j = 0; j < safeContents[i].safeBags.length; j++) {\n var bag = safeContents[i].safeBags[j];\n if(bagType !== undefined && bag.type !== bagType) {\n continue;\n }\n // only filter by bag type, no attribute specified\n if(attrName === null) {\n result.push(bag);\n continue;\n }\n if(bag.attributes[attrName] !== undefined &&\n bag.attributes[attrName].indexOf(attrValue) >= 0) {\n result.push(bag);\n }\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "1617fca89ee274ea0ecbcbf3e83b7d85", "score": "0.47493148", "text": "function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) {\n var result = [];\n\n for(var i = 0; i < safeContents.length; i++) {\n for(var j = 0; j < safeContents[i].safeBags.length; j++) {\n var bag = safeContents[i].safeBags[j];\n if(bagType !== undefined && bag.type !== bagType) {\n continue;\n }\n // only filter by bag type, no attribute specified\n if(attrName === null) {\n result.push(bag);\n continue;\n }\n if(bag.attributes[attrName] !== undefined &&\n bag.attributes[attrName].indexOf(attrValue) >= 0) {\n result.push(bag);\n }\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "1617fca89ee274ea0ecbcbf3e83b7d85", "score": "0.47493148", "text": "function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) {\n var result = [];\n\n for(var i = 0; i < safeContents.length; i++) {\n for(var j = 0; j < safeContents[i].safeBags.length; j++) {\n var bag = safeContents[i].safeBags[j];\n if(bagType !== undefined && bag.type !== bagType) {\n continue;\n }\n // only filter by bag type, no attribute specified\n if(attrName === null) {\n result.push(bag);\n continue;\n }\n if(bag.attributes[attrName] !== undefined &&\n bag.attributes[attrName].indexOf(attrValue) >= 0) {\n result.push(bag);\n }\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "1617fca89ee274ea0ecbcbf3e83b7d85", "score": "0.47493148", "text": "function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) {\n var result = [];\n\n for(var i = 0; i < safeContents.length; i++) {\n for(var j = 0; j < safeContents[i].safeBags.length; j++) {\n var bag = safeContents[i].safeBags[j];\n if(bagType !== undefined && bag.type !== bagType) {\n continue;\n }\n // only filter by bag type, no attribute specified\n if(attrName === null) {\n result.push(bag);\n continue;\n }\n if(bag.attributes[attrName] !== undefined &&\n bag.attributes[attrName].indexOf(attrValue) >= 0) {\n result.push(bag);\n }\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "1617fca89ee274ea0ecbcbf3e83b7d85", "score": "0.47493148", "text": "function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) {\n var result = [];\n\n for(var i = 0; i < safeContents.length; i++) {\n for(var j = 0; j < safeContents[i].safeBags.length; j++) {\n var bag = safeContents[i].safeBags[j];\n if(bagType !== undefined && bag.type !== bagType) {\n continue;\n }\n // only filter by bag type, no attribute specified\n if(attrName === null) {\n result.push(bag);\n continue;\n }\n if(bag.attributes[attrName] !== undefined &&\n bag.attributes[attrName].indexOf(attrValue) >= 0) {\n result.push(bag);\n }\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "1617fca89ee274ea0ecbcbf3e83b7d85", "score": "0.47493148", "text": "function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) {\n var result = [];\n\n for(var i = 0; i < safeContents.length; i++) {\n for(var j = 0; j < safeContents[i].safeBags.length; j++) {\n var bag = safeContents[i].safeBags[j];\n if(bagType !== undefined && bag.type !== bagType) {\n continue;\n }\n // only filter by bag type, no attribute specified\n if(attrName === null) {\n result.push(bag);\n continue;\n }\n if(bag.attributes[attrName] !== undefined &&\n bag.attributes[attrName].indexOf(attrValue) >= 0) {\n result.push(bag);\n }\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "f6d3a0acf583deb6162c817c3aeaa93b", "score": "0.4747261", "text": "function placeAllPlayersBoats () \n{\n\tplaceBoat(\"#five\", 320, 422, 5);\n\tplaceBoat(\"#four\", 320, 422, 4);\n\tplaceBoat(\"#three\", 320, 422, 3);\n\tplaceBoat(\"#two\", 320, 422, 2);\n}", "title": "" }, { "docid": "daced82eba84e451bbe25db9080cabef", "score": "0.47425613", "text": "function showBoats() {\n if (boats.length > 0) {\n if (\n boats.length < 4 &&\n boats[boats.length - 1].body.position.x < width - 300\n ) {\n var positions = [-40, -60, -70, -20];\n var position = random(positions);\n var boat = new Boat(\n width,\n height - 100,\n 170,\n 170,\n position,\n boatAnimation\n );\n\n\n boats.push(boat);\n }\n\n for (var i = 0; i < boats.length; i++) {\n Matter.Body.setVelocity(boats[i].body, {\n x: -0.9,\n y: 0\n });\n\n boats[i].display();\n boats[i].animate();\n\n var collision=Matter.SAT.collides(tower.body,boats[i].body);\n if(collision.collided && !boats[i].isBroken){\n if(!isLaughing && !pirateLaughSound.isPlaying()){\n pirateLaughSound.play();\n isLaughing=true;\n }\n isGameOver=true;\n gameOver();\n }\n \n }\n } else {\n var boat = new Boat(width, height - 60, 170, 170, -60, boatAnimation);\n boats.push(boat);\n }\n}", "title": "" }, { "docid": "7de2bb88c606cc9984205de0822e9db3", "score": "0.4734245", "text": "createListItems() {\n var items = [];\n for(var item in this.props.friendsList){\n items.push(\n <CalendarListItem key={this.props.friendsList[item].uid + this.props.friendsList[item].friend} value={this.props.friendsList[item]} removeItem={this.removeItem} toggleItem={this.toggleItem}/> \n );\n }\n return items;\n }", "title": "" }, { "docid": "db13c6b16799e76e45f7608bb8a2aa18", "score": "0.4732349", "text": "function moreBees(_event) {\n let randomBee = Math.floor(Math.random() * 2);\n switch (randomBee) {\n case 0:\n let b = new Advanced.NormalBee(1175, 505); // Neue Biene mit neuer Klasse\n Advanced.allBees.push(b);\n break;\n case 1:\n let h = new Advanced.HoneyBee(1175, 505); // Neue Biene mit neuer Klasse\n Advanced.allBees.push(h);\n break;\n }\n }", "title": "" }, { "docid": "fd30d80d7d4efd725e31f60ce9534ee7", "score": "0.4731467", "text": "async function getBreeds(type) {\n const breeds = await client.animalData.breeds(type)\n return breeds.data.breeds\n}", "title": "" }, { "docid": "a0fce4c43ddd518a6175e430930932e4", "score": "0.47307563", "text": "function Ball(descr) {\r\n for (var property in descr) {\r\n this[property] = descr[property];\r\n }\r\n this.trail = [];\r\n}", "title": "" }, { "docid": "3073c5c332588a3d8c2c510267c7e56f", "score": "0.4719982", "text": "dohone() {\n let attributes = [];\n for (let i = 0; i < 15; i++) {\n this.state.items.map((item) =>\n Array.isArray(Object.values(item)[i])\n ? this.loadEmbedElements1(\n Object.values(item)[i].length,\n Object.values(item)[i],\n attributes\n )\n : attributes.push(Object.values(item)[i].House1)\n );\n }\n return attributes;\n }", "title": "" }, { "docid": "d87c7fa5d29dec7ddef96b005a323fb0", "score": "0.47182867", "text": "function buyFruit(list) {\r\n const mergedResult = list.map(subarray =>\r\n Array(subarray[1]).fill(subarray[0])\r\n );\r\n return [].concat(...mergedResult);\r\n}", "title": "" }, { "docid": "bd570d39ae3deacb96179b35f43d5e2f", "score": "0.47175428", "text": "get elements(){\n //se pasa el arreglo como copia\n\t\t\tvar elements = this.bars.map(function(bar){ return bar; });\n\t\t\telements.push(this.ball);\n\t\t\treturn elements;\n\t\t}", "title": "" }, { "docid": "cba4d3bfa30b3df302573f668af065ff", "score": "0.47130913", "text": "function get_boats(req, cursor){\n var q = datastore.createQuery(BOAT).limit(3);\n var result = {};\n if (cursor) {\n q = q.start(cursor);\n }\n\n return datastore.runQuery(q).then( (entities) => {\n result.boats = entities[0].map(function(dataObj){\n return convBoat(req, dataObj);\n });\n // Pagination - next link added\n if (entities[1].moreResults != Datastore.NO_MORE_RESULTS) {\n result.next = getUrl(req) + \"/boats?cursor=\" + entities[1].endCursor;\n }\n return result;\n });\n}", "title": "" }, { "docid": "87fd5ab05549986ba59f9729feebf5f4", "score": "0.47105184", "text": "function generateBricks() {\n\t\tfor (var i = 0; i < brickColumnCount; i++) {\n\t\t\tbricks[i] = [];\n\t\t\tfor (var j = 0; j < brickRowCount; j++) {\n\t\t\t\tbricks[i][j] = {\n\t\t\t\t\tx: 0,\n\t\t\t\t\ty: 0,\n\t\t\t\t\tstatus: 1\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "b09a59edd880dfb2496e3c51479557d8", "score": "0.47092202", "text": "getBlacklist(req, res, next) {\n c.crn.blacklist.find().toArray((err, docs) => {\n if (err) {return next(err);}\n res.send(docs);\n });\n }", "title": "" }, { "docid": "ebeeb8bfb63147b5a95c099786f86144", "score": "0.47082174", "text": "function renderBreed (breed) {\n let ulContainer = document.getElementById('dog-breeds')\n let li = document.createElement('li')\n\n li.textContent = breed\n li.style.cursor = 'pointer';\n ulContainer.append(li)\n li.addEventListener('click', toggleColor)\n}", "title": "" }, { "docid": "1798b5eeebc7214a38afdae9cf2cabb2", "score": "0.47077668", "text": "maybeBuddyList (stanza) {\n // the directory, load it all up in a hash\n let query = stanza.getChild('query')\n if (query && query.getChildren('item')) {\n (query.getChildren('item') || []).forEach((el) => {\n let jid = new XmppClient.JID(el.attrs.jid).bare().toString()\n let buddy = this.directory[jid] || {}\n buddy.jid = jid\n buddy.name = el.attrs.name\n buddy.mention_name = el.attrs.mention_name\n debug('profile', JSON.stringify(buddy))\n this.directory[jid] = buddy\n })\n return true\n }\n }", "title": "" }, { "docid": "7e1895f1e8bfd710a9ed7b0269075fc1", "score": "0.47066233", "text": "function makeBuddies(buddies){\n var aside = $('<aside>');\n var buddiesUl = $('<ul>');\n $(aside).append(buddiesList);\n for (var i = 0; i < buddies.length; i++) {\n var newBuddy = $('<li>').html(buddies[i]);\n $(buddiesUl).append(newBuddy);\n }\n $('body').append(aside);\n var gandalfTheGrey.css('background-color', 'grey')\n}", "title": "" }, { "docid": "3032d462a6b63f604568aa7a9fe51071", "score": "0.46973565", "text": "fill() {\n\n let bricks = Utility.getRange(0, this.total);\n //randomize order of bricks\n this.bag.push(...Utility.shuffle(bricks));\n }", "title": "" }, { "docid": "46b071e92f1852696264beb5e9ddd377", "score": "0.4696748", "text": "friendsList(friendsArray) {\n\n const friendsListDOM = document.querySelector(\".friendsList\")\n // Clear the friends list\n friendsListDOM.innerHTML = \"\"\n friendsArray.forEach(friend => {\n const friendHTML = domObject.friendComponent(friend)\n friendsListDOM.innerHTML += friendHTML\n })\n }", "title": "" }, { "docid": "1253a5ccedcc4dd0c685fe0f753a3a68", "score": "0.46942508", "text": "static getBidAddresses() {\n if (this.hasLocalStorage()) {\n return this.getArrayItem(Static.KEY.BIDS);\n }\n return [];\n }", "title": "" }, { "docid": "7c8b8becb8300826996fad49cc8274d6", "score": "0.46844187", "text": "function $6fcb727b03413917$var$_getBagsByAttribute(safeContents, attrName, attrValue, bagType) {\n var result = [];\n for(var i = 0; i < safeContents.length; i++)for(var j = 0; j < safeContents[i].safeBags.length; j++){\n var bag = safeContents[i].safeBags[j];\n if (bagType !== undefined && bag.type !== bagType) continue;\n // only filter by bag type, no attribute specified\n if (attrName === null) {\n result.push(bag);\n continue;\n }\n if (bag.attributes[attrName] !== undefined && bag.attributes[attrName].indexOf(attrValue) >= 0) result.push(bag);\n }\n return result;\n}", "title": "" }, { "docid": "5cfac8fbaaf2436ee085a491f8e7b01a", "score": "0.46819034", "text": "function lookForBulbs(){\n //var auth = btoa() ? \n ajax({\n url : api + '/lights/all/',\n method : 'GET',\n headers: {\n authorization : 'Basic ' + base64_encode(token + ':' + '')\n },\n type : 'json'\n }, function(bulbs){\n var groups = [];\n\n bulbs.forEach(function(data){\n data.title = data.label;\n data.subtitle = 'Single Bulb';\n data.type = 'single';\n groups.push(data.group.name);\n });\n\n groups = uniq(groups);\n\n groups.forEach(function(data){\n data.title = data;\n bulbs.unshift({title : data, subtitle : 'Group', type : 'group'});\n });\n\n bulbs.unshift({ title : 'All', type : 'all'});\n\n bulbsMenu = new UI.Menu({\n sections: [{\n title: 'Available Lights',\n items: bulbs\n }]\n });\n splashCard.hide();\n bulbsMenu.show();\n\n bulbsMenu.on('select', function(event) {\n openOptions(bulbs[event.itemIndex]);\n });\n }, function(error){\n showError();\n });\n}", "title": "" }, { "docid": "1da5030d78138263433bd65dacc3df3a", "score": "0.46811885", "text": "function addBaskets() {\nbaskets = baskets + basketsGain;\n }", "title": "" }, { "docid": "be07b4e4d45e288314d1d545ccafcc48", "score": "0.46775162", "text": "static async _pGetBrewProcessed_pDoBlacklistExtension ({cpyBrews}) {\n\t\tfor (const {body} of cpyBrews) {\n\t\t\tif (!body?.blacklist?.length || !(body.blacklist instanceof Array)) continue;\n\t\t\tawait ExcludeUtil.pExtendList(body.blacklist);\n\t\t}\n\t}", "title": "" }, { "docid": "dc2b2594babc79f1ade4c903d54125f5", "score": "0.46769112", "text": "function generisiBoje(brojBoja){\n\tvar arr = [];\n\n\tfor( var i = 0; i < brojBoja; i++){\n\t\tvar r = Math.floor(Math.random() * 256);\n\t\tvar g = Math.floor(Math.random() * 256);\n\t\tvar b = Math.floor(Math.random() * 256);\n\n\t\tarr.push(\"rgb(\" + r +\", \" + g +\", \"+ b +\")\");\n\t}\n\n\treturn arr;\n}", "title": "" }, { "docid": "86f1caa895e47753c8367e7aab749252", "score": "0.46725556", "text": "get elements() {\n var elements = this.bars.map(function(n){return n}); //AGREGADO --> Pasamos el arreglo como copia y no como referencia para evitar BUGS\n elements.push(this.ball);\n return elements;\n }", "title": "" }, { "docid": "895b1b3295f4a297b5d2ba506881ef59", "score": "0.46725276", "text": "function allid(){\narray.forEach(element =>console.log(element .id))\narray.forEach(element => element.batters.batter.forEach(b => console.log(b.id)))\narray.forEach(element => element.topping.forEach(t => console.log(t.id)))\n\n}", "title": "" }, { "docid": "00d20e57276a32f7d042e97fad73dd97", "score": "0.46681687", "text": "function bringDownBloodStatuses() {\n // change blood status for every student\n allStudents.forEach(changeBloodStatus);\n console.log(\"Blood statuses were randomly changed\");\n}", "title": "" }, { "docid": "9bde36b8aef3d0b33ab4a4c84cb0a9a1", "score": "0.4664649", "text": "get elements() {\n var elements = this.bars.map(function (bar) {\n return bar;\n });\n elements.push(this.ball);\n return elements;\n }", "title": "" }, { "docid": "32e50218a436460b7ccc88e0052aad0b", "score": "0.46609503", "text": "getBlueprints() {\n return _.sortBy(_blueprints, 'name');\n }", "title": "" } ]
5c39e24c3e0babdc2500ca2d71d46647
Crossplatform codegen helper for generating vmodel value assignment code.
[ { "docid": "169ad8488e9002c85a463e6aa813731f", "score": "0.6490498", "text": "function genAssignmentCode(value, assignment) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return value + \"=\" + assignment;\n } else {\n return \"$set(\" + modelRs.exp + \", \" + modelRs.idx + \", \" + assignment + \")\";\n }\n }", "title": "" } ]
[ { "docid": "f4f780541e593639171878032d4899cb", "score": "0.6516541", "text": "function genComponentModel(\nel,\nvalue,\nmodifiers)\n{\nvar ref=modifiers||{};\nvar number=ref.number;\nvar trim=ref.trim;\n\nvar baseValueExpression='$$v';\nvar valueExpression=baseValueExpression;\nif(trim){\nvalueExpression=\n\"(typeof \"+baseValueExpression+\" === 'string'\"+\n\"? \"+baseValueExpression+\".trim()\"+\n\": \"+baseValueExpression+\")\";\n}\nif(number){\nvalueExpression=\"_n(\"+valueExpression+\")\";\n}\nvar assignment=genAssignmentCode(value,valueExpression);\n\nel.model={\nvalue:\"(\"+value+\")\",\nexpression:JSON.stringify(value),\ncallback:\"function (\"+baseValueExpression+\") {\"+assignment+\"}\"};\n\n}", "title": "" }, { "docid": "1b0f8fbab27fea80ddf2c4e2f2831aac", "score": "0.6462008", "text": "function genAssignmentCode(value,assignment){var modelRs=parseModel(value);if(modelRs.idx===null){return value+\"=\"+assignment;}else{return\"var $$exp = \"+modelRs.exp+\", $$idx = \"+modelRs.idx+\";\"+\"if (!Array.isArray($$exp)){\"+value+\"=\"+assignment+\"}\"+\"else{$$exp.splice($$idx, 1, \"+assignment+\")}\";}}", "title": "" }, { "docid": "1b0f8fbab27fea80ddf2c4e2f2831aac", "score": "0.6462008", "text": "function genAssignmentCode(value,assignment){var modelRs=parseModel(value);if(modelRs.idx===null){return value+\"=\"+assignment;}else{return\"var $$exp = \"+modelRs.exp+\", $$idx = \"+modelRs.idx+\";\"+\"if (!Array.isArray($$exp)){\"+value+\"=\"+assignment+\"}\"+\"else{$$exp.splice($$idx, 1, \"+assignment+\")}\";}}", "title": "" }, { "docid": "1b0f8fbab27fea80ddf2c4e2f2831aac", "score": "0.6462008", "text": "function genAssignmentCode(value,assignment){var modelRs=parseModel(value);if(modelRs.idx===null){return value+\"=\"+assignment;}else{return\"var $$exp = \"+modelRs.exp+\", $$idx = \"+modelRs.idx+\";\"+\"if (!Array.isArray($$exp)){\"+value+\"=\"+assignment+\"}\"+\"else{$$exp.splice($$idx, 1, \"+assignment+\")}\";}}", "title": "" }, { "docid": "1b0f8fbab27fea80ddf2c4e2f2831aac", "score": "0.6462008", "text": "function genAssignmentCode(value,assignment){var modelRs=parseModel(value);if(modelRs.idx===null){return value+\"=\"+assignment;}else{return\"var $$exp = \"+modelRs.exp+\", $$idx = \"+modelRs.idx+\";\"+\"if (!Array.isArray($$exp)){\"+value+\"=\"+assignment+\"}\"+\"else{$$exp.splice($$idx, 1, \"+assignment+\")}\";}}", "title": "" }, { "docid": "1b0f8fbab27fea80ddf2c4e2f2831aac", "score": "0.6462008", "text": "function genAssignmentCode(value,assignment){var modelRs=parseModel(value);if(modelRs.idx===null){return value+\"=\"+assignment;}else{return\"var $$exp = \"+modelRs.exp+\", $$idx = \"+modelRs.idx+\";\"+\"if (!Array.isArray($$exp)){\"+value+\"=\"+assignment+\"}\"+\"else{$$exp.splice($$idx, 1, \"+assignment+\")}\";}}", "title": "" }, { "docid": "1b0f8fbab27fea80ddf2c4e2f2831aac", "score": "0.6462008", "text": "function genAssignmentCode(value,assignment){var modelRs=parseModel(value);if(modelRs.idx===null){return value+\"=\"+assignment;}else{return\"var $$exp = \"+modelRs.exp+\", $$idx = \"+modelRs.idx+\";\"+\"if (!Array.isArray($$exp)){\"+value+\"=\"+assignment+\"}\"+\"else{$$exp.splice($$idx, 1, \"+assignment+\")}\";}}", "title": "" }, { "docid": "1b0f8fbab27fea80ddf2c4e2f2831aac", "score": "0.6462008", "text": "function genAssignmentCode(value,assignment){var modelRs=parseModel(value);if(modelRs.idx===null){return value+\"=\"+assignment;}else{return\"var $$exp = \"+modelRs.exp+\", $$idx = \"+modelRs.idx+\";\"+\"if (!Array.isArray($$exp)){\"+value+\"=\"+assignment+\"}\"+\"else{$$exp.splice($$idx, 1, \"+assignment+\")}\";}}", "title": "" }, { "docid": "1b0f8fbab27fea80ddf2c4e2f2831aac", "score": "0.6462008", "text": "function genAssignmentCode(value,assignment){var modelRs=parseModel(value);if(modelRs.idx===null){return value+\"=\"+assignment;}else{return\"var $$exp = \"+modelRs.exp+\", $$idx = \"+modelRs.idx+\";\"+\"if (!Array.isArray($$exp)){\"+value+\"=\"+assignment+\"}\"+\"else{$$exp.splice($$idx, 1, \"+assignment+\")}\";}}", "title": "" }, { "docid": "575467d9985fe818891f0e784e7c1fcb", "score": "0.64556855", "text": "function genAssignmentCode(value, assignment) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return value + \"=\" + assignment;\n } else {\n return \"$set(\" + modelRs.exp + \", \" + modelRs.idx + \", \" + assignment + \")\";\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6319662", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6319662", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6319662", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "4bc5f22878351b75159aabee144b863d", "score": "0.6319662", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (modelRs.exp) + \", \" + (modelRs.idx) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "c052684b3cf730ea8e5f791757886482", "score": "0.6311306", "text": "function genAssignmentCode(value,assignment){var res=parseModel(value);if(res.key===null){return value+\"=\"+assignment;}else{return\"$set(\"+res.exp+\", \"+res.key+\", \"+assignment+\")\";}}", "title": "" }, { "docid": "4122a5ecfd03152985a378f1e8ce5934", "score": "0.6306364", "text": "function genAssignmentCode(value, assignment) {\n var res = parseModel(value);\n if (res.key === null) {\n return value + '=' + assignment;\n } else {\n return '$set(' + res.exp + ', ' + res.key + ', ' + assignment + ')';\n }\n}", "title": "" }, { "docid": "563d6c069e5a594ce6233eebabd6132c", "score": "0.6293345", "text": "function genAssignmentCode(value, assignment) {\n var res = parseModel(value);\n if (res.key === null) {\n return value + \"=\" + assignment;\n } else {\n return \"$set(\" + res.exp + \", \" + res.key + \", \" + assignment + \")\";\n }\n }", "title": "" }, { "docid": "d65f45c1477402189949558969806de0", "score": "0.62683463", "text": "function genAssignmentCode(\nvalue,\nassignment)\n{\nvar res=parseModel(value);\nif(res.key===null){\nreturn value+\"=\"+assignment;\n}else {\nreturn \"$set(\"+res.exp+\", \"+res.key+\", \"+assignment+\")\";\n}\n}", "title": "" }, { "docid": "ecb1558aa1c4ad7ea959ee530fdbce06", "score": "0.62559646", "text": "function genAssignmentCode(value, assignment) {\n var res = parseModel(value);\n\n if (res.key === null) {\n return value + \"=\" + assignment;\n } else {\n return \"$set(\" + res.exp + \", \" + res.key + \", \" + assignment + \")\";\n }\n }", "title": "" }, { "docid": "b9ebdb90a068a867e6f1fb34fb2168f0", "score": "0.6246034", "text": "function genAssignmentCode(value, assignment) {\n var res = parseModel(value);\n if (res.key === null) {\n return value + \"=\" + assignment;\n } else {\n return \"$set(\" + res.exp + \", \" + res.key + \", \" + assignment + \")\";\n }\n}", "title": "" }, { "docid": "94e582288afc51b2a2c7f98b765995a3", "score": "0.62224823", "text": "function genAssignmentCode(value, assignment) {\n var res = parseModel(value);\n\n if (res.key === null) {\n return value + \"=\" + assignment;\n } else {\n return \"$set(\" + res.exp + \", \" + res.key + \", \" + assignment + \")\";\n }\n}", "title": "" }, { "docid": "893c0d579d31173a41e6b0b8ea98e317", "score": "0.6212361", "text": "function genAssignmentCode(value, assignment) {\n var res = parseModel(value);\n if (res.key === null) {\n return value + \"=\" + assignment;\n }\n else {\n return \"$set(\" + res.exp + \", \" + res.key + \", \" + assignment + \")\";\n }\n}", "title": "" }, { "docid": "22bc3f2368551cfcdbdc3911c83d59ef", "score": "0.6198546", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n \"if (!Array.isArray($$exp)){\" +\n value + \"=\" + assignment + \"}\" +\n \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n }\n}", "title": "" }, { "docid": "22bc3f2368551cfcdbdc3911c83d59ef", "score": "0.6198546", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n \"if (!Array.isArray($$exp)){\" +\n value + \"=\" + assignment + \"}\" +\n \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n }\n}", "title": "" }, { "docid": "22bc3f2368551cfcdbdc3911c83d59ef", "score": "0.6198546", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n \"if (!Array.isArray($$exp)){\" +\n value + \"=\" + assignment + \"}\" +\n \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n }\n}", "title": "" }, { "docid": "22bc3f2368551cfcdbdc3911c83d59ef", "score": "0.6198546", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n \"if (!Array.isArray($$exp)){\" +\n value + \"=\" + assignment + \"}\" +\n \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n }\n}", "title": "" }, { "docid": "22bc3f2368551cfcdbdc3911c83d59ef", "score": "0.6198546", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n \"if (!Array.isArray($$exp)){\" +\n value + \"=\" + assignment + \"}\" +\n \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n }\n}", "title": "" }, { "docid": "22bc3f2368551cfcdbdc3911c83d59ef", "score": "0.6198546", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n \"if (!Array.isArray($$exp)){\" +\n value + \"=\" + assignment + \"}\" +\n \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n }\n}", "title": "" }, { "docid": "22bc3f2368551cfcdbdc3911c83d59ef", "score": "0.6198546", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n \"if (!Array.isArray($$exp)){\" +\n value + \"=\" + assignment + \"}\" +\n \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n }\n}", "title": "" }, { "docid": "22bc3f2368551cfcdbdc3911c83d59ef", "score": "0.6198546", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n \"if (!Array.isArray($$exp)){\" +\n value + \"=\" + assignment + \"}\" +\n \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n }\n}", "title": "" }, { "docid": "22bc3f2368551cfcdbdc3911c83d59ef", "score": "0.6198546", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n \"if (!Array.isArray($$exp)){\" +\n value + \"=\" + assignment + \"}\" +\n \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n }\n}", "title": "" }, { "docid": "22bc3f2368551cfcdbdc3911c83d59ef", "score": "0.6198546", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var modelRs = parseModel(value);\n if (modelRs.idx === null) {\n return (value + \"=\" + assignment)\n } else {\n return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n \"if (!Array.isArray($$exp)){\" +\n value + \"=\" + assignment + \"}\" +\n \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n }\n}", "title": "" }, { "docid": "2a66cf4ebae561428480285fa43814dd", "score": "0.61656165", "text": "function genAssignmentCode (\n value,\n assignment\n ) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n }", "title": "" }, { "docid": "2a66cf4ebae561428480285fa43814dd", "score": "0.61656165", "text": "function genAssignmentCode (\n value,\n assignment\n ) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n }", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" }, { "docid": "3cb2d5cb61c6b9fbd5d25b002a78d842", "score": "0.6155672", "text": "function genAssignmentCode (\n value,\n assignment\n) {\n var res = parseModel(value);\n if (res.key === null) {\n return (value + \"=\" + assignment)\n } else {\n return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n }\n}", "title": "" } ]
88e59d7908f84cb2f39c9c4835e0f90b
relevant for sample 4.3 only BEGIN / this is a dummy implementation to create poidata, which are passed over to JS / Wikitude SDK on first location update
[ { "docid": "e6bb6e5bf301b0e0bbb43d6728bf8e80", "score": "0.66427034", "text": "function onLocationUpdated(position) {\n var latitude = position.coords.latitude;\n var longitude = position.coords.longitude;\n var altitude = position.coords.altitude;\n var placesAmount = 10;\n var poiData = [];\n \n // creates dummy poi-data around given lat/lon\n for (var i=0; i< placesAmount; i++) {\n poiData.push({ 'id': (i+1), 'longitude': longitude + 0.001 * ( 5 - getRandomInt(1,10) ), 'latitude' : latitude + 0.001 * (5 - getRandomInt(1,10)), 'description': 'This is the description of POI#'+(i+1), 'altitude' : 100.0, 'name': 'POI#'+(i+1)})\n }\n \n // inject POI data in JSON-format to JS\n app.wikitudePlugin.callJavaScript( \"World.loadPoisFromJsonData(\" + JSON.stringify( poiData ) +\");\");\n}", "title": "" } ]
[ { "docid": "d2470562a5a08ed7e842310eb851acdc", "score": "0.60946923", "text": "function createPoiPin(data) {\n // create the location obj\n var loc = new Microsoft.Maps.Location(\n data[Finder.Config.latitudeField],\n data[Finder.Config.longidudeField]);\n\n // create a new pin\n var pin = new Microsoft.Maps.Pushpin(loc);\n\n // add the poi to the pin for future reference\n pin._poiData = data;\n pin._poiData._location = loc;\n\n // add to the poi layer\n Finder.Home.poiLayer.push(pin);\n\n // add click handler for the pin \n Microsoft.Maps.Events.addHandler(pin, 'click', function (e) {\n if (!Finder.Home.directionsVisible) {\n // get the bounds box\n var bounds = [];\n\n // add the pin data\n bounds.push(pin._poiData._location);\n\n // add the current location\n if (Finder.Config.includeUserLocationOnPoiSelected) {\n bounds.push(new Microsoft.Maps.Location(\n Locations.currentLocation.latitude,\n Locations.currentLocation.longitude));\n }\n\n // set the view for the map\n Finder.Home.map.setView({\n bounds: Microsoft.Maps.LocationRect.fromLocations(bounds)\n });\n\n // now show the infobox\n Locations.selectedPoi = pin._poiData;\n Finder.Home.infoBox.setLocation(e.target.getLocation());\n Finder.Home.infoBox.setOptions({ visible: true, title: pin._poiData[Finder.Config.nameField] });\n }\n });\n\n // return the location object\n return loc;\n }", "title": "" }, { "docid": "52479eee03d365de082cd5cc163043e6", "score": "0.60103226", "text": "function define_location_data(currentMarker) {\n if (settings.dataType === 'kml') {\n create_kml_location_variables(currentMarker.get(\"id\"));\n }\n else {\n create_location_variables(currentMarker.get(\"id\"));\n }\n\n var distLength;\n if (storeDistance <= 1) {\n if (settings.lengthUnit === \"km\") {\n distLength = \"kilometer\";\n }\n else {\n distLength = \"mile\";\n }\n }\n else {\n if (settings.lengthUnit === \"km\") {\n distLength = \"kilometers\";\n }\n else {\n distLength = \"miles\";\n }\n }\n\n //Set up alpha character\n var markerId = currentMarker.get(\"id\");\n //Use dot markers instead of alpha if there are more than 26 locations\n if (settings.storeLimit > 26) {\n var indicator = markerId + 1;\n }\n else {\n var indicator = 1 + markerId;\n //var indicator = String.fromCharCode(\"A\".charCodeAt(0) + markerId);\n }\n\n //Define location data\n if (settings.dataType === 'kml') {\n var locations = {\n location: [\n {\n \"distance\": storeDistance,\n \"markerid\": markerId,\n \"marker\": indicator,\n \"name\": storeName,\n \"description\": storeDescription,\n \"length\": distLength,\n \"origin\": origin\n }\n ]\n };\n }\n else {\n var locations = {\n location: [\n {\n \"distance\": storeDistance,\n \"markerid\": markerId,\n \"marker\": indicator,\n \"name\": storeName,\n \"address\": storeAddress1,\n \"address2\": storeAddress2,\n \"city\": storeCity,\n \"state\": storeState,\n \"postal\": storeZip,\n \"phone\": storePhone,\n \"web\": storeWeb,\n \"hours1\": storeHours1,\n \"hours2\": storeHours2,\n \"hours3\": storeHours3,\n \"type\": locType,\n \"atm\": locAtm,\n \"driveup\": locDriveup,\n \"safedeposit\": locSafedeposit,\n \"nightdeposit\": locNightdeposit,\n \"saturdayhours\": locSaturdayhours,\n \"atmdeposits\": locAtmdeposits,\n \"atmdriveup\": locAtmdriveup,\n \"atmwalkup\": locAtmwalkup,\n \"lobbysunday\": locLobbysunday,\n \"lobbymonday\": locLobbymonday,\n \"lobbytuesday\": locLobbytuesday,\n \"lobbywednesday\": locLobbywednesday,\n \"lobbythursday\": locLobbythursday,\n \"lobbyfriday\": locLobbyfriday,\n \"lobbysaturday\": locLobbysaturday,\n \"driveupsunday\": locDriveupsunday,\n \"driveupmonday\": locDriveupmonday,\n \"driveuptuesday\": locDriveuptuesday,\n \"driveupwednesday\": locDriveupwednesday,\n \"driveupthursday\": locDriveupthursday,\n \"driveupfriday\": locDriveupfriday,\n \"driveupsaturday\": locDriveupsaturday,\n \"isbranch\": locIsbranch,\n \"showatmservices\": locShowatmservices,\n \"length\": distLength,\n \"origin\": origin\n }\n ]\n };\n }\n\n return locations;\n }", "title": "" }, { "docid": "0711ec6be26339ec49ee7afeea672c73", "score": "0.5894114", "text": "createOwntracksLocationResponse() {\n var userLocation = {};\n var userLocationArray = [];\n\n try {\n for (var i=0; i < this.globalVar.getUserArray().length; i++) {\n userLocation._type = \"location\";\n userLocation.tid = this.globalVar.getUserArray()[i].tid;\n userLocation.lat = this.globalVar.getUserArray()[i].lat;\n userLocation.lon = this.globalVar.getUserArray()[i].lon;\n userLocation.tst = this.globalVar.getUserArray()[i].timestamp;\n \n userLocationArray.push(userLocation);\n userLocation = {};\n }\n this.logmodule.writelog('debug', JSON.stringify(userLocationArray));\n } catch(err) {\n this.logmodule.writelog('error', \"createOwntracksLocationResponse: \"+ err);\n return err;\n }\n return this.userLocationArray\n }", "title": "" }, { "docid": "c916ad46088a1830a77c1e65a01211ad", "score": "0.5796025", "text": "function readyToGetDataBaseData() {\r\n /* Every region must have data - the list must have same number of elements */\r\n if (weatherRegions.length != weatherData.length) return;\r\n /* For each new data, old markers and polygons are removed and replaced */\r\n clearMarkers();\r\n markers = [];\r\n markersArea = [];\r\n /* Add a marker for each region in database */\r\n for (let i = 0; i < weatherRegions.length; i++) {\r\n addMarker(weatherRegions[i], weatherData[i]);\r\n }\r\n}", "title": "" }, { "docid": "6d649f5a7696223477f7b4179a3be5cf", "score": "0.57481277", "text": "constructor(data) {\n if (data.wild) {\n this.initWild(data);\n } else if (data.nearby) {\n this.initNearby(data);\n } else {\n this.id = data.id;\n this.lat = data.lat;\n this.lon = data.lon;\n this.pokemonId = data.pokemon_id;\n this.form = data.form;\n this.level = data.level;\n this.costume = data.costume;\n this.weather = data.weather;\n this.gender = data.gender;\n this.spawnId = data.spawn_id;\n this.cellId = data.cell_id;\n this.firstSeenTimestamp = data.first_seen_timestamp || new Date().getTime() / 1000;\n this.expireTimestamp = data.expire_timestamp;\n this.expireTimestampVerified = data.expire_timestamp_verified;\n this.cp = data.cp;\n this.move1 = data.move_1;\n this.move2 = data.move_2;\n this.size = data.size;\n this.weight = data.weight;\n this.atkIv = data.atk_iv;\n this.defIv = data.def_iv;\n this.staIv = data.sta_iv;\n this.username = data.username;\n this.shiny = data.shiny;\n this.updated = data.updated;\n this.changed = data.changed;\n this.pokestopId = data.pokestop_id;\n this.displayPokemonId = data.display_pokemon_id;\n this.capture1 = data.capture_1;\n this.capture2 = data.capture_2;\n this.capture3 = data.capture_3;\n this.pvpRankingsGreatLeague = JSON.parse(data.pvp_rankings_great_league) || null;\n this.pvpRankingsUltraLeague = JSON.parse(data.pvp_rankings_ultra_league) || null;\n }\n if (!this.firstSeenTimestamp) {\n this.firstSeenTimestamp = new Date().getTime() / 1000;\n }\n }", "title": "" }, { "docid": "c0eeadd60db3b498059e9a5062526f53", "score": "0.5738", "text": "function poilceData() {\n fetch(\"/police\")\n .then((responseP) => responseP.json())\n .then((pol) => dumbpolice(pol));\n const markPol = L.marker();\n function dumbpolice(police) {\n const holderpolice = police;\n // console.log(holderpolice);\n // Putting Police on Map\n for (var i = 0; i < holderpolice.length; ++i) {\n // console.log(holder[i].lat);\n const polIcon = L.icon({\n //added a icon to identify Police Stations.\n iconUrl: \"Police-icon.png\",\n iconSize: [30, 14],\n iconAnchor: [15, 12],\n popupAnchor: [15, 12],\n });\n\n const markP = L.marker([holderpolice[i].lat, holderpolice[i].lon], {\n icon: polIcon,\n }).addTo(ourmap)\n markP.bindPopup(holderpolice[i].name + \" Police Station<br />Phone#: \" + holderpolice[i].phone).openPopup(); //Add description of Police.\n \n }\n }return markP;\n}", "title": "" }, { "docid": "3fa5fcfe23beb47f8e73f07b17829f2b", "score": "0.5588198", "text": "function locationCreator() {\r\n var locations = [\r\n new LocationStore('1st and Alki', 23, 65, 6.3, [], 0),\r\n new LocationStore('SeaTac Airport', 3, 24, 1.2, [], 0),\r\n new LocationStore('Seattle Center', 11, 38, 3.7, [], 0),\r\n new LocationStore('Capitol Hill', 20, 38, 2.3, [], 0),\r\n new LocationStore('Alki', 2, 16, 4.6, [], 0)\r\n ];\r\n\r\n for (var i = 0; i < locations.length; i++) {\r\n locations[i].makeData();\r\n allLocationsArray.push(locations[i]);\r\n }\r\n\r\n createTableDomElements();\r\n}", "title": "" }, { "docid": "87a3e2c0f8de5d2faa976fe4dd39c93a", "score": "0.558525", "text": "function createPOIGeneric(id, title, location, description, imagen)\n{\n\tvar newPOI = new arel.Object.POI();\n\tnewPOI.setMinDistance(0);\n\tnewPOI.setMaxDistance(0);\n\tnewPOI.setID(id);\n\tnewPOI.setTitle(title);\n\tnewPOI.setLocation(location);\n\tnewPOI.setThumbnail(imagen);\n\tnewPOI.setIcon(imagen);\n\tnewPOI.setVisibility(true,true,true);\n\tnewPOI.onTouchStarted = function(){ \n\t\tnoty({\n\t\t\tlayout: 'topRight',\n\t\t\ttheme: 'relax',\n\t\t\ttext: '<b>' + title + '</b></br>' + description,\n\t\t\tmaxVisible: 1,\n\t\t killer: true,\n\t\t closeWith: ['click'],\n\t\t\tbuttons: [\n\t\t\t\t{addClass: 'btn btn-primary', text: 'Escuchar', onClick: function() {\n\t\t\t\t\t\tarel.Media.speak(description);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{addClass: 'btn btn-danger', text: 'Ver Mapa', onClick: function() {\n\t\t\t\t\t\t$.noty.closeAll();\n\t\t\t\t\t\tarel.Navigation.routeToObjectOnMap(newPOI);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{addClass: 'btn', text: 'Cerrar', onClick: function() {\n\t\t\t\t\t\t$.noty.closeAll();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t});\n\t};\n\tarel.Scene.addObject(newPOI);\n}", "title": "" }, { "docid": "38a90f94edac5102b1119b26b19150b0", "score": "0.55619776", "text": "constructor (data, metadata = null) {\n // this.id = data.id\n this.orbrad = data.orbrad\n this.lvl = data.lvl\n this.pos = data.pos\n this.name = data.name\n this.complete = data.complete\n this.time = data.time\n this.intent_time = data.time\n this.point_to = data.point_to\n // to ensure the random number provide enough bits.\n var firstPart = (Math.random() * 46656) | 0\n var secondPart = (Math.random() * 46656) | 0\n firstPart = ('000' + firstPart.toString(36)).slice(-3)\n secondPart = ('000' + secondPart.toString(36)).slice(-3)\n this.id = firstPart + secondPart\n // internal metadata\n this.type = null\n this.metadata = metadata || {}\n if (this.metadata.created === undefined) { this.metadata.created = new Date() }\n // this.update()\n }", "title": "" }, { "docid": "0d784c99d6f516a2244f3dcde3038afa", "score": "0.55600977", "text": "function createPoint(position) {\n pointPoi = new Object();\n pointPoi.latitude = position.coords.latitude;\n pointPoi.longitude = position.coords.longitude;\n pointPoi.groupName = document.getElementById(\"groupNameTB\").value;\n pointPoi.name = document.getElementById(\"namePuiTXT\").value;\n pointPoi.description = document.getElementById(\"descriptionPuiTXT\").value;\n pointPoi.imageUrl = document.getElementById(\"imageUrl\").value;\n //save to db\n savePOI(pointPoi);\n}", "title": "" }, { "docid": "71a7aaef957c158a873126c9994bb975", "score": "0.5551771", "text": "function realLocationData(piece){\n piece.trueMap = [];\n for(let i = 0; i < piece.map.length; i++){\n if(piece.map[i] == 1){\n let multiplier = Math.floor(i/4);\n let levelAdd = 6;\n levelAdd = levelAdd * multiplier;\n let tileLoc = piece.truePos + levelAdd + i; \n piece.trueMap.push(tileLoc);\n }\n }\n }", "title": "" }, { "docid": "b420741a3e4622d487024643b91f5b24", "score": "0.5539992", "text": "function locate() { //Todo: Code Copy&Paste rauslöschen und Modularisieren\n if (navigator.geolocation) { //Überprüft ob geolocation supportet wird\n navigator.geolocation.getCurrentPosition(function (x) { //Wenn erfolgreich koordinaten ermittelt\n MetaJSON.Point = { //Erstellen eines JSON Objektes\n \"type\": \"Point\",\n \"coordinates\": [x.coords.longitude, x.coords.latitude]\n }\n document.getElementById('localnot').hidden = true;\n setLocationData();\n\n\n }, function () { //Bei fehler Tabelle ausblenden und Fehlermeldung einblenden\n document.getElementById('localnot').innerHTML = \"<h3>Fehler bei der Standort Lokalisierung, Default Standpunkt wird Verwendet</h3>\"\n document.getElementById('localnot').hidden = false;\n MetaJSON.Point = { //Erstellen eines JSON Objektes\n \"type\": \"Point\",\n \"coordinates\": [7.6261347, 51.9606649]\n }\n setLocationData();\n });\n } else {\n //Falls geolocation nicht supportet, Fehlermeldung einblenden\n document.getElementById('localnot').innerHTML = \"<h3>Geolocation nicht Supportet, Default Punkt wird Verwendet</h3>\"\n document.getElementById('localnot').hidden = false;\n MetaJSON.Point = { //Erstellen eines JSON Objektes\n \"type\": \"Point\",\n \"coordinates\": [7.6261347, 51.9606649]\n }\n setLocationData();\n }\n}", "title": "" }, { "docid": "6077f72000005b6e810d5d813e3dc959", "score": "0.55209833", "text": "function createPoi() {\n groupName = document.getElementById(\"groupNameTB\").value;\n name = document.getElementById(\"namePuiTXT\").value;\n description = document.getElementById(\"descriptionPuiTXT\").value;\n if (groupName == \"\" || name == \"\" || description == \"\") {\n alert(\"אנא מלא שם קבוצה, שם נקודה ותיאור\");\n return;\n }\n navigator.geolocation.getCurrentPosition(createPoint);\n}", "title": "" }, { "docid": "b058f3940f460504aabad5878fbad786", "score": "0.55173266", "text": "function createMarker(latlng, name, data) {\n //var contentString = html;\n var marker = new google.maps.Marker({\n position: latlng,\n map: map,\n title: name,\n icon: data.icon\n });\n if (data.povLat) {\n var location = new google.maps.LatLng(data.povLat, data.povLng);\n heading = data.heading;\n pitch = data.pitch;\n zoom = data.zoom;\n\n google.maps.event.addListener(marker, \"click\", function() {\n clickedMarker = marker;\n $('#pano').data('id', data);\n sv.getPanoramaByLocation(location, 5, processSVData);\n // openInfoWindow(marker);\n });\n }\n else { \n google.maps.event.addListener(marker, \"click\", function() {\n // clickedMarker = marker;\n // sv.getPanoramaByLocation(marker.getPosition(), 50, processSVData);\n openInfoWindow(marker);\n });\n }\n // save the info we need to use later for the side_bar\n gmarkers.push(marker);\n}", "title": "" }, { "docid": "d5e587da5aa53b617571922e713bef95", "score": "0.5501356", "text": "function get_location_info()\n{\n var location_info = {\n \"site_name\": RMPApplication.get(\"my_location.site_name\"),\n \"site_code\": RMPApplication.get(\"my_location.site_code\"),\n \"address\": RMPApplication.get(\"my_location.address\"),\n // \"town\": RMPApplication.get(\"my_location.town\"),\n // \"postal_code\": RMPApplication.get(\"my_location.postal_code\"),\n \"country\": RMPApplication.get(\"my_location.country\"),\n \"site_contact\": RMPApplication.get(\"my_location.site_contact\"),\n \"name_country\": RMPApplication.get(\"my_location.name_country\")\n };\n // stocke ident dans le widget var_ident\n RMPApplication.set(\"var_location_info\", JSON.stringify(location_info));\n}", "title": "" }, { "docid": "b3127423d118ab10922dae3562cd23ed", "score": "0.5467608", "text": "function createLocation() {\n new SalmonCookieLocation('1st and Pike', 23, 65, 6.3);\n new SalmonCookieLocation('Seatac Airport', 3, 24, 1.2);\n new SalmonCookieLocation('Seattle Center', 11, 38, 3.7);\n new SalmonCookieLocation('Capitol Hill', 20, 38, 2.3);\n new SalmonCookieLocation('Alki', 2, 16, 4.6);\n}", "title": "" }, { "docid": "cf254a1d5e3a26fa44f85b3c015773cd", "score": "0.5466978", "text": "function InitPoiPage() {\n if ($stateParams.idPoi)\n $scope.poi = angular.copy($scope.$parent.currentPath.pois[$stateParams.idPoi]);\n else\n $scope.poi = {\n \"title\": {\n \"de\": \"\",\n \"it\": \"\",\n \"en\": \"\"\n },\n \"description\": {\n \"de\": \"\",\n \"it\": \"\",\n \"en\": \"\"\n },\n \"coordinates\": {\n lat: '45.8832637',\n lng: '11.0014507'\n },\n \"images\": [],\n \"videos\": [],\n \"audios\": [],\n \"localId\": $scope.$parent.currentPath.localId + 'poi' + $scope.$parent.currentPath.pois.length + 1\n };\n drawMapPoi.createMap('map-poi', $scope.poi.coordinates.lat, $scope.poi.coordinates.lng, function (lat, lng) {\n $scope.poi.coordinates.lat = lat;\n $scope.poi.coordinates.lng = lng;\n $scope.$apply();\n });\n }", "title": "" }, { "docid": "8cfd735bf5b1f56a988de369292b7405", "score": "0.54515433", "text": "startData() { return {\r\n unlocked: true,\r\n\t\t//points: new OmegaNum(0),\r\n\r\n qs:\"无\",\r\n ws:\"无\",\r\n es:\"无\",\r\n as:\"无\",\r\n ss:\"无\",\r\n ds:\"无\",\r\n zs:\"无\",\r\n xs:\"无\",\r\n cs:\"无\",\r\n nowst:\"删除\",\r\n willMake:\"无\",\r\n }}", "title": "" }, { "docid": "2ac799e05bf72ac91218321420566f19", "score": "0.5437952", "text": "appendMapData(newData, coordinates, scene) {\n for (const kind in newData) {\n if (!this.data[kind]) {\n this.data[kind] = [];\n }\n for (let i = 0; i < newData[kind].length; ++i) {\n switch (kind) {\n case \"lane\":\n const lane = newData[kind][i];\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: addLane(lane, coordinates, scene)\n }));\n this.laneHeading[lane.id.id] = getLaneHeading(lane);\n break;\n case \"crosswalk\":\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: addCrossWalk(\n newData[kind][i], coordinates, scene)\n }));\n break;\n case \"signal\":\n const overlapMap = extractOverlaps(newData['overlap']);\n this.data[kind].push(Object.assign(newData[kind][i], {\n drewObjects: addTrafficLight(newData[kind][i],\n overlapMap, this.laneHeading, coordinates, scene)\n }));\n break;\n default:\n this.data[kind].push(newData[kind][i]);\n break;\n }\n }\n }\n }", "title": "" }, { "docid": "cf3185996fbd079109a91687d95f9c69", "score": "0.5437163", "text": "startData() { return {\n //part1\n unlocked: true,\n\t\tpoints: new ExpantaNum(0),\n\n updtime: new ExpantaNum(0),\n stutime: new ExpantaNum(0),\n simtime: new ExpantaNum(0),\n pattime: new ExpantaNum(0),\n\n stubuff: new ExpantaNum(0),\n simbuff: new ExpantaNum(0),\n patbuff: new ExpantaNum(1),\n\n patpoint: new ExpantaNum(0),\n\n doing:\"none\",\n\n //part2\n\n tpatpoint: new ExpantaNum(0),\n \n mupdtime: new ExpantaNum(0),\n mstutime: new ExpantaNum(0),\n msimtime: new ExpantaNum(0),\n mpatpoint: new ExpantaNum(0),\n\n mupdbuff: new ExpantaNum(1),\n mstubuff: new ExpantaNum(0),\n msimbuff: new ExpantaNum(0),\n mpatbuff: new ExpantaNum(1),\n }}", "title": "" }, { "docid": "8cca8bedc68c95558b5681d48d3555a3", "score": "0.54097784", "text": "function initData() {\n }", "title": "" }, { "docid": "1ab36cfff0b638c87e4c35e1116abcb3", "score": "0.5406468", "text": "function displayLocation(p) {\n console.log(p);\n var lat = p.coords.latitude;\n var long = p.coords.longitude;\n var url = \"http://api.openweathermap.org/data/2.5/weather?units=imperial&lat=\" + lat + \"&lon=\" + long + \"&APPID=98acbdc8fed4c94098e54b139af1f559&callback=getWeather\";\n var head = document.getElementsByTagName('head')[0];\n var script = document.createElement('script');\n script.setAttribute(\"src\", url);\n script.setAttribute(\"id\", \"jsonp\");\n head.appendChild(script);\n getWeather();\n}", "title": "" }, { "docid": "09270ed810c0216d64c25d56caf3011e", "score": "0.5398513", "text": "function set_location(data){\n if (\"lon\" in data && \"lat\" in data){\n DB.clients[data.userid].location = {\"lat\":data.lat, \"lon\":data.lon};\n\tvar username = DB.clients[data.userid].username;\n \treturn {'type':'set_location_complete', 'msg': 'Location set to '+JSON.stringify(DB.clients[data.userid].location) , 'target': data.userid, 'orig_msg':data, 'username':username}; \n }\n else{\n return {'type':'error', 'msg':'The message does not contain a lat or lon value.','target':data.userid,'orig_msg':data}; \n }\n}", "title": "" }, { "docid": "bea403d7a10cb4f90c7ee1a7fc6f7752", "score": "0.53976667", "text": "makeData (callback) {\n\t\tthis.expectMarkers = 1;\n\t\tthis.init(callback);\n\t}", "title": "" }, { "docid": "4726e7bbe8477262c35cc7d432121d89", "score": "0.53960454", "text": "function createMap(){\n //create the map\n var map = L.map('map', {\n center: [20, 0],\n zoom: 2\n });\n\n //add OSM base tilelayer\n L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap contributors</a>'\n }).addTo(map);\n\n //call getData retrieve data and puts it on the map\n getData(map);\n //calls getData2 and implements the circle markers\n getData2(map);\n //calls getData3 and if called by itself only picks points with < 20 population\n getData3(map);\n}", "title": "" }, { "docid": "b782b71d902ceec649940e255ed17dbb", "score": "0.53762287", "text": "function createMapInfo(leafletMap){\n setTileLayer(leafletMap, mapData.license);\n setMapView(leafletMap, mapData.posGPS, LEAFLET_MAP_DEFAULT_ZOOM);\n createNatParkArea(leafletMap, mapData.natPark, mapData.mun, mapData.area);\n createRoutes(leafletMap, mapData.routes);\n createInfoSites(leafletMap, mapData.infoSites);\n console.log(map);\n }", "title": "" }, { "docid": "2378f0dd8896044c7b7625bbbeb688b6", "score": "0.53719425", "text": "function create_map(){\n\tif(random_maps){\n\t\tif (initialized){\n\t\t\tdestroy_villages();\n\t\t\tdestroy_aqueduct();\n\t\t\t//TODO: get rid of those messages...here might be a good place\n\t\t}\n\t\tcursor_aqueduct = new Aqueduct (0, 0, \"right\");\n\t cursor_aqueduct.visible = false;\n\t\t\n\t water_source = new Grid_Object (0, 4, 0, \"source.png\", 2, 4);\n\t goal_city = new Grid_Object (22, 5, 0, \"goal_city.png\", 2, 2);\n\t for (var i = 0; i < 6; i++) {\n\t \tVillage.create ();\n\t }\n\t}\n\t\n}", "title": "" }, { "docid": "b474734374264d1ff30e27c3d4555504", "score": "0.53647125", "text": "function new_Airports(data) {\n var image = \"airport.png\";\n marker_airport = addPoint(data[\"name\"],{lat: data[\"airport_position\"][0],\n lng: data[\"airport_position\"][1]},image);\n \n\n \n }", "title": "" }, { "docid": "2c4ea601de1e95603eeba5c7b9bff08f", "score": "0.5356056", "text": "function locationSuccess(pos) {\n console.log('lat= ' + pos.coords.latitude + ' lon= ' + pos.coords.longitude);\n getAidsData(pos);\n \n}", "title": "" }, { "docid": "9d252bf9f1a53f0fdcc53d79e123b443", "score": "0.53556204", "text": "function create_kml_location_variables(loopcount) {\n storeDistance = locationset[loopcount][0];\n storeDistance = roundNumber(storeDistance, 2);\n storeName = locationset[loopcount][1];\n storeDescription = locationset[loopcount][4];\n }", "title": "" }, { "docid": "ddab0ea14a9c04e82b14cbc809c2ec4c", "score": "0.5348678", "text": "function Iwanttoloaddatafor940here(){\n buildMetadata(\"940\");\n buildCharts(\"940\");\n}", "title": "" }, { "docid": "c341322d9ed627098256378439b6a598", "score": "0.53484124", "text": "function createTelemetryData() {\n // TODO: implement if needed\n}", "title": "" }, { "docid": "80d0ef453071258ae2ff6648fdc94d93", "score": "0.5347938", "text": "function setupMapSeries() {\n var coordsPromise = $.getJSON('javascripts/vendor/indexed-city-coords.json');\n var valuePromise = $.getJSON(env.getUrlPrefix() + '/bigDataBigScreenWeb/boarddatayunan/getYuXiLoadPortLogisticData1?type=10');\n\n return $.when(coordsPromise, valuePromise).then(function(coordsResolved, valuesResolved) {\n return generateMapData(coordsResolved[0], valuesResolved[0].data);\n });\n }", "title": "" }, { "docid": "2d99613c846cf4c7420c22ae5ff9dd84", "score": "0.53419125", "text": "startData() { return {\n unlocked: true,\n\t\tpoints: new ExpantaNum(0),\n buffp: new ExpantaNum(0),\n nerfp: new ExpantaNum(0),\n tp: new ExpantaNum(0)\n }}", "title": "" }, { "docid": "8ea974e7602d5a4bbaea6c0c72956551", "score": "0.5329075", "text": "function setupMapSeries() {\n var coordsPromise = $.getJSON('javascripts/vendor/indexed-city-coords.json');\n var valuePromise = $.getJSON(env.getUrlPrefix() + '/bigDataBigScreenWeb/boarddatayunan/getYuXiLoadPortLogisticData?type=8');\n\n return $.when(coordsPromise, valuePromise).then(function(coordsResolved, valuesResolved) {\n return generateMapData(coordsResolved[0], valuesResolved[0].data);\n });\n }", "title": "" }, { "docid": "a241d9712f419694c631faadd5c87832", "score": "0.5327988", "text": "startData() { return {\n unlocked: false,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "a241d9712f419694c631faadd5c87832", "score": "0.5327988", "text": "startData() { return {\n unlocked: false,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "a241d9712f419694c631faadd5c87832", "score": "0.5327988", "text": "startData() { return {\n unlocked: false,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "a241d9712f419694c631faadd5c87832", "score": "0.5327988", "text": "startData() { return {\n unlocked: false,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "a241d9712f419694c631faadd5c87832", "score": "0.5327988", "text": "startData() { return {\n unlocked: false,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "a241d9712f419694c631faadd5c87832", "score": "0.5327988", "text": "startData() { return {\n unlocked: false,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "a241d9712f419694c631faadd5c87832", "score": "0.5327988", "text": "startData() { return {\n unlocked: false,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "a241d9712f419694c631faadd5c87832", "score": "0.5327988", "text": "startData() { return {\n unlocked: false,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "a241d9712f419694c631faadd5c87832", "score": "0.5327988", "text": "startData() { return {\n unlocked: false,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "a241d9712f419694c631faadd5c87832", "score": "0.5327988", "text": "startData() { return {\n unlocked: false,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "a241d9712f419694c631faadd5c87832", "score": "0.5327988", "text": "startData() { return {\n unlocked: false,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "9087d7cd30ca603af9d3afb1af92f44b", "score": "0.53209955", "text": "function makeLocation (locationArray){\n //return device\n var constructed = [];\n //iterate through locations\n for(var i = 0 ; i < locationArray.length; i++){\n var location = locationArray[i][0];\n var minCustHour = locationArray[i][1];\n var maxCustHour = locationArray[i][2];\n var avgCookie = locationArray[i][3];\n //push new\n var push = new LocationTemplate(location, minCustHour,maxCustHour,avgCookie);\n constructed.push(push);\n }//end for\n return constructed;\n}//end MakeLocation", "title": "" }, { "docid": "ff65323304c88ce72aacd5c26841f8ae", "score": "0.5317354", "text": "function createMetadata(){\n //Recupera metadata\n var geoloc = OpenLocationCode.encode(selLoc.getLatLng().lat, selLoc.getLatLng().lng, OpenLocationCode.CODE_PRECISION_EXTRA);\n console.log(geoloc);\n var purpose = $(\"#purpose\").val();\n var language = $(\"#language\").val();\n var content = $(\"#content\").val();\n var audience = 'A+';\n audience += $(\"#audience\").val();\n var detail = 'P+';\n detail += $(\"#detailLevel\").val();\n var description = $(\"#description\").val();\n var name = $(\"#name\").val();\n\n //definisce metadata\n var metadata = {\n kind: 'youtube#video',\n snippet: {\n title: name + \":8FPHF8VV+M59\", //crea titolo con olc per identificare clip\n description: [[geoloc, purpose, language, content, audience, detail].join(':'),description].join('#'),\n categoryId: 27 //categoria 'Istruzione'\n\n },\n status: {\n privacyStatus: 'public', //video pubblico\n embeddable: true\n }\n};\n\nreturn metadata;\n}", "title": "" }, { "docid": "2da66a89ba6a4a0db3e308b0037db70a", "score": "0.5316468", "text": "function createPOIGeometry(id, title, location, description, imagen)\n{\n\tvar newPOI = new arel.Object.POI();\n\tnewPOI.setMinDistance(1);\n\tnewPOI.setMaxDistance(150);\n\tnewPOI.setID(id);\n\tnewPOI.setTitle(title);\n\tnewPOI.setLocation(location);\n\tnewPOI.setThumbnail(imagen);\n\tnewPOI.setIcon(imagen);\n\tnewPOI.setVisibility(true,true,true);\n\tnewPOI.onTouchStarted = function(){ \n\t\t$.ClassyNotty({\n\t\t\ttitle : title,\n\t\t\tcontent : description,\n\t\t\timg : imagen,\n\t\t\tclick : function() {\n\t\t\t\t\t\tarel.Media.speak(description);\n\t\t\t\t\t}\n\t\t}); \n\t};\n\tarel.Scene.addObject(newPOI);\n}", "title": "" }, { "docid": "72a4b433dc09db10f0de481fed299437", "score": "0.53128403", "text": "function locationInfo(id, latitude, longitude, addr1,title,tel, overview, firstimage, array){\n\tarray.push({id:id, lat:latitude, lng:longitude, addr1:addr1, title:title, tel:tel, overview:overview, firstimage:firstimage});\n}", "title": "" }, { "docid": "534a21d78e033e7ee000665a9c1a4d07", "score": "0.53109145", "text": "generateAll() {\n let base = json.parse(json.read(\"db/cache/locations.json\"));\n let data = {};\n\n // use right id's and strip loot\n for (let locationName in this.locations) {\n let map = this.locations[locationName];\n\n map.Loot = [];\n data[this.locations[locationName]._Id] = map;\n }\n\n base.data.locations = data;\n return base.data;\n }", "title": "" }, { "docid": "a0e049bbcdece8e0e189754ccbb57989", "score": "0.5310777", "text": "function mapInit(dataInput, fillInput, location){\n$(location).empty();\n\tvar election = new Datamap({\n\t scope: 'usa',\n\t element: location,\n\t geographyConfig: {\n\t\thighlightBorderColor: '#bada55',\n\t popupTemplate: function(geography, dataParam) {\n\t\t return '<div class=\"hoverinfo\">' + geography.properties.name + ' Percentage of Searches: ' + dataParam.electoralVotes + '%'\n\t\t},\n\t\thighlightBorderWidth: 3\n\t },\n\t fills: fillInput,\n\tdata:dataInput\n\t});\n\telection.labels();\n}", "title": "" }, { "docid": "c321bab85fb50aeb71e04b2220cf08b7", "score": "0.5310221", "text": "function onSuccess(position) {\n var key = '';\n for (var i = 0; i < 20; i++) {\n key += (Math.floor(Math.random() * 10)).toString();\n }\n $scope.firebase.albums[$scope.key].waypoints[key] = {\n lat: position.coords.latitude,\n long: position.coords.longitude,\n time: Date.now()\n };\n }", "title": "" }, { "docid": "c484c0e7aabef9b853a63dca3b1e2315", "score": "0.5304873", "text": "function createData()\n{\n //loop through all the legislators in our raw data\n\tfor (var i = 0; i < rawLegislatorData.length; i++) {\n\t\t//in our legislatorData, use bill_id as the key\n\t\tlegislatorData[rawLegislatorData[i].bioguide_id] = {\n\t\t\tbioguide_id: rawLegislatorData[i].bioguide_id,\n\t\t\tfirstname: rawLegislatorData[i].firstname,\n\t\t\tlastname: rawLegislatorData[i].lastname,\n\t\t\tgender: rawLegislatorData[i].gender,\n\t\t\tlastname: rawLegislatorData[i].lastname,\n\t\t\tstate: rawLegislatorData[i].state,\n\t\t\tparty: rawLegislatorData[i].party,\n\t\t\ttitle: rawLegislatorData[i].title,\n\t\t\twebsite: rawLegislatorData[i].website,\n\t\t\timageURL: rawLegislatorData[i].imageURL,\n\t\t\tbills: [],\n\t\t\tbillCount: 0,\n\t\t\tdistrict: rawLegislatorData[i].district\n\t\t};\n\t\t\n\t\t//init our state data\n\t\tif (rawLegislatorData[i].title==\"Rep\"||rawLegislatorData[i].title==\"Sen\")\n\t\t{\n\t\t\tstateData[rawLegislatorData[i].state] = {\n\t\t\t\tname: rawLegislatorData[i].state,\n\t\t\t\tlegislatorCount: 0,\n\t\t\t\trepresentativeCount: 0,\n\t\t\t\trepresentatives: [],\n\t\t\t\tsenatorCount: 0,\n\t\t\t\tsenators: [], \n\t\t\t\tbillCount: 0,\n\t\t\t\tbills: []\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//loop through our bills and associate them with legislators\n\tfor (var bill in billData) {\n\t\tif (legislatorData[billData[bill].sponsor.bioguideid] != null) {\n\t\t\tlegislatorData[billData[bill].sponsor.bioguideid].bills.push(billData[bill]);\n\t\t\tlegislatorData[billData[bill].sponsor.bioguideid].billCount++;\n\t\t}\n\t}\n\t\n\t//loop through our legislator data to finalize our state data\n\tfor (var legislator in legislatorData) {\n\t\tif (legislatorData[legislator].title === \"Rep\") {\n\t\t\tstateData[legislatorData[legislator].state].representativeCount++;\n\t\t\tstateData[legislatorData[legislator].state].legislatorCount++;\n\t\t\tstateData[legislatorData[legislator].state].representatives.push(legislatorData[legislator]);\n\t\t}\n\t\telse if (legislatorData[legislator].title === \"Sen\") {\n\t\t\tstateData[legislatorData[legislator].state].senatorCount++;\n\t\t\tstateData[legislatorData[legislator].state].legislatorCount++;\n\t\t\tstateData[legislatorData[legislator].state].senators.push(legislatorData[legislator]);\n\t\t}\n\t\tif (stateData[legislatorData[legislator].state] != null) {\n\t\t\tstateData[legislatorData[legislator].state].billCount += legislatorData[legislator].bills.length;\n\t\t\tvar legislatorBills = legislatorData[legislator].bills;\n\t\t\tfor (var bill in legislatorBills) {\n\t\t\t\tstateData[legislatorData[legislator].state].bills.push(legislatorBills[bill]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//calculate maximums\n\tfor (var state in stateData) {\n\t\t//calculate the total number of legislators for each state\n\t\tvar totalLegis = stateData[state].representativeCount + stateData[state].senatorCount;\n\t\t//keep a running track of what the highest legislatorCount is\n\t\tif (totalLegis > maxLegislatorCountForState) \n\t\t\tmaxLegislatorCountForState = totalLegis;\n\t\t//calculate the max bill count for the states\n\t\tif (stateData[state].billCount > maxBillCountForState) {\n\t\t\tmaxBillCountForState = stateData[state].billCount;\n\t\t}\n\t}\t\n}", "title": "" }, { "docid": "3ff9407c0c037ba18ca20d37538c3374", "score": "0.5300995", "text": "function onSuccessPM(location) {\n console.log(\"Inside location success call\");\n //location recording time\n var locationTime = Date(location.timestamp);\n var lat = location.coords.latitude;\n var long = location.coords.longitude;\n //build map with current latitude and longitude\n buildMapSearch(lat, long);\n }", "title": "" }, { "docid": "f8a06665adee82afff4443b88d69d556", "score": "0.52981645", "text": "mapPoint() {\n return {\n type: \"point\",\n lat: [this.lat],\n lon: [this.lon],\n name: this.desc,\n waypoint: this.waypoint,\n };\n }", "title": "" }, { "docid": "efd5f0441ff4f68ac62136936586b2b9", "score": "0.5297725", "text": "function fillAllPointsWithGeoData() {\n\tvar geoData = TraxUtil.getGeoData();\n\tfor (var i = 0; i < geoData.length; i++) {\n\t\tallPoints[i] = Endpoint.create(parseInt(extractEasting(geoData[i]), 10), parseInt(extractNorthing(geoData[i]), 10));\n\t}\n}", "title": "" }, { "docid": "4013f959c03ed5029ee89b9541ba4577", "score": "0.52912146", "text": "function initpnpmap() {\t\n\t\t$('#loader').show();\n\t\tmap = L.map('map', mapOptions);\n\t\tmap.removeControl(map.zoomControl);\n\t\tvar marker = L.marker(map.getCenter()).addTo(map);\n\n\t\tvar basemapTileLayer = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {\n\t\t\t\tmaxZoom: 17,\n\t\t\t\ttype: 'map',\n\t\t\t\text: 'jpg',\n\t\t\t\tsubdomains: '1234',\n\t\t\t\tattribution: 'Esri, HERE, DeLorme, Intermap, increment P Corp., GEBCO, USGS, FAO, NPS, NRCAN, GeoBase, IGN, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), swisstopo, MapmyIndia, © OpenStreetMap contributors, and the GIS User Community'\n\t\t\t});\n\t\tmap.addLayer(basemapTileLayer);\n\t\t\n\t\tvar ctyService = L.esri.dynamicMapLayer({\n\t\t url: dynMapServiceURL,\n\t\t opacity: 0.25\n\t\t }).addTo(map);\n\n\t\tctyService.on('load', function(e) {\n\t\t\t$('#loader').hide();\n\t\t});\n\t\t\n\t\tmap.whenReady(function() {\n\t\t map.on('moveend', function() {\n\t\t \t \tmarker.setLatLng(map.getCenter());\n\t\t\t\t\t mapquery(map.getCenter());\n\t\t\t\t\t $('#loader').show();\n\t\t \t});\n\t\t});\n\t\t\n\t}", "title": "" }, { "docid": "544041223f93438a277b9ee4033aaa7d", "score": "0.5287765", "text": "function createPropSymbols(data, map){\r\n //create a Leaflet GeoJSON layer and add it to the map\r\n L.geoJson(data, {\r\n pointToLayer: pointToLayer\r\n }).addTo(map);\r\n}", "title": "" }, { "docid": "4783cda68a108de7d9cab5a275d8ce7d", "score": "0.52798086", "text": "startData() { return {\n unlocked: true,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "4783cda68a108de7d9cab5a275d8ce7d", "score": "0.52798086", "text": "startData() { return {\n unlocked: true,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "4783cda68a108de7d9cab5a275d8ce7d", "score": "0.52798086", "text": "startData() { return {\n unlocked: true,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "4783cda68a108de7d9cab5a275d8ce7d", "score": "0.52798086", "text": "startData() { return {\n unlocked: true,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "4783cda68a108de7d9cab5a275d8ce7d", "score": "0.52798086", "text": "startData() { return {\n unlocked: true,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "4783cda68a108de7d9cab5a275d8ce7d", "score": "0.52798086", "text": "startData() { return {\n unlocked: true,\n\t\tpoints: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "3420cb168f7db55d19c32f6b4cf43168", "score": "0.52777886", "text": "startData() { return {\r\n unlocked: true,\r\n //points:new OmegaNum(0),\r\n\r\n }}", "title": "" }, { "docid": "7a0b68c63e19bdcbfc9cc286d008cb72", "score": "0.52714723", "text": "getCurrentDataIpah1(state, payload) {\n let station = payload.station;\n let block = payload.block;\n let soilNitrogen = payload.soilNitrogen;\n let soilPhosphorus = payload.soilPhosphorus;\n let soilPotassium = payload.soilPotassium;\n let soilPH = payload.soilPH;\n let soilEC = payload.soilEC;\n let soilMS = payload.soilMS;\n let soilTEMP = payload.soilTEMP;\n state.stations[station].sensorSoil[block].sensorData[0].data = soilNitrogen;\n state.stations[station].sensorSoil[block].sensorData[1].data = soilPhosphorus;\n state.stations[station].sensorSoil[block].sensorData[2].data = soilPotassium;\n state.stations[station].sensorSoil[block].sensorData[3].data = soilPH;\n state.stations[station].sensorSoil[block].sensorData[4].data = soilEC;\n state.stations[station].sensorSoil[block].sensorData[5].data = soilMS;\n state.stations[station].sensorSoil[block].sensorData[6].data = soilTEMP;\n }", "title": "" }, { "docid": "cc289082d41934659a7fbeadb5edbc09", "score": "0.52673495", "text": "function createAllFingerData() {\n\t\t\tvar fingerData=[];\n\t\t\tfor (var i=0; i<=5; i++) {\n\t\t\t\tfingerData.push({\n\t\t\t\t\tstart:{ x: 0, y: 0 },\n\t\t\t\t\tend:{ x: 0, y: 0 },\n\t\t\t\t\tidentifier:0\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\treturn fingerData;\n\t\t}", "title": "" }, { "docid": "09a3fa113ad64774b0560a91d311db9a", "score": "0.52635026", "text": "initializeLocations() {\n logger.logWarning(\"Loading locations into RAM...\");\n\n for (let locationName in db.locations) {\n let node = db.locations[locationName];\n let location = json.parse(json.read(node.base));\n\n // set infill locations\n for (let entry in node.entries) {\n location.SpawnAreas.push(json.parse(json.read(node.entries[entry])));\n }\n\n // set exfill locations\n for (let exit in node.exits) {\n location.exits.push(json.parse(json.read(node.exits[exit])));\n }\n\n // set scav locations\n for (let wave in node.waves) {\n location.waves.push(json.parse(json.read(node.waves[wave])));\n }\n\n // set boss locations\n for (let spawn in node.bosses) {\n location.BossLocationSpawn.push(json.parse(json.read(node.bosses[spawn])));\n }\n\n this.locations[locationName] = location;\n }\n }", "title": "" }, { "docid": "37391e877efd1f2ad6227d557f7b8990", "score": "0.52597255", "text": "function UpdateLastKnownPosition(lkp) {\n console.log(\"UpdateLastsKnownPosition(lkp)\");\n \n var data = satellitesTracked[satelliteId];\n\n var oldPos = data.pos;\n\n data.pos = {\n lat: lkp.lat,\n lon: lkp.lon,\n alt: lkp.alt,\n timestamp: lkp.timestamp\n };\n\n console.log(satelliteId);\n console.log(data.feature);\n console.log(data.feature.getGeometry().getCoordinates());\n\n// var dataCoordinates = data.feature.getGeometry().getCoordinates();\n var lkpCoordinates = ol.proj.transform([lkp.lon, lkp.lat], 'EPSG:4326', 'EPSG:3857');\n \n data.feature.getGeometry().setCoordinates(lkpCoordinates);\n data.feature.alt = lkp.alt;\n// data.feature.geometry.x = lkp.lon;\n// data.feature.geometry.y = lkp.lat;\n// data.feature.geometry.alt = lkp.alt;\n\n if(oldPos != null && data.nextPos != null && data.nextPos ) {\n if(data.nextPos.timestamp <= lkp.timestamp) {\n UpdateNearestPoint();\n }\n }\n\n UpdateInterpolation();\n\n }", "title": "" }, { "docid": "b0175ea8bb8280000f839f1a21342790", "score": "0.5259175", "text": "getCurrentDataIpah2(state, payload) {\n let station = payload.station;\n let block = payload.block;\n let soilPH = payload.soilPH;\n let soilEC = payload.soilEC;\n let soilMS = payload.soilMS;\n state.stations[station].sensorSoil[block].sensorData[0].data = soilPH;\n state.stations[station].sensorSoil[block].sensorData[1].data = soilEC;\n state.stations[station].sensorSoil[block].sensorData[2].data = soilMS;\n }", "title": "" }, { "docid": "bed0cc67e8f0e8d0f3f2a977ef95d076", "score": "0.52489674", "text": "function populatePointInfoPage1() {\n console.log(\"populatePointInfoPage1\");\n var currentPoint = currentEditingTour.interest_points[currentEditPointIndex];\n $(\"#editTrackPOIName\").val(currentPoint.name);\n $.each(currentPoint.interp_items, function(index, interp_item) {\n $.each(interp_item.media_items, function(index, media_item) {\n var mimeType = media_item.item_content_type;\n var filename = media_item.item_file_name;\n\n if (mimeType.indexOf(\"text\") === 0 && (!$(\"#editTrackPOIDescription\").val())) {\n getTextItem(filename, function(textContents) {\n currentPoint.textMediaItemID = media_item.id;\n $(\"#editTrackPOIDescription\").val(textContents);\n });\n } else if (mimeType.indexOf(\"audio\") === 0 && (!$(\"#editTrackPOIAudioPlayer\").attr(\"src\"))) {\n currentPoint.audioMediaItemID = media_item.id;\n $(\"#editTrackPOIAudioPlayer\").attr(\"src\", mediaFiles[filename].fullPath);\n $(\"#editTrackPOIAudioPlayerContainer\").show();\n if ($(\"#editTrackPOIAudioPlayerContainer .audioplayer\").length === 0) {\n $(\"#editTrackPOIAudioPlayer\").audioPlayer();\n }\n } else if (mimeType.indexOf(\"image\") === 0 && (!$(\"#editTrackPOIImage\").attr(\"src\"))) {\n currentPoint.imageMediaItemID = media_item.id;\n $(\"#editTrackPOIImage\").attr('src', mediaFiles[filename].fullPath);\n }\n });\n });\n }", "title": "" }, { "docid": "cda402b01a374754230caeaa2aadf0ec", "score": "0.5235164", "text": "function setupMapSeries() {\n var coordsPromise = $.getJSON('javascripts/vendor/indexed-city-coords.json');\n var valuePromise = $.getJSON(env.getUrlPrefix() + '/bigDataBigScreenWeb/boarddatayunan/getYunNanGoodGoingSummary?type=7');\n\n return $.when(coordsPromise, valuePromise).then(function(coordsResolved, valuesResolved) {\n return generateMapData(coordsResolved[0], valuesResolved[0].data);\n });\n }", "title": "" }, { "docid": "1ecb51c81dcc02b4d97e2768b550c1be", "score": "0.52339804", "text": "function createPropSymbols(data, map, attributes){\n //create a Leaflet GeoJSON layer and add it to the map\n L.geoJson(data, {\n pointToLayer: function(feature, latlng){\n return pointToLayer(feature, latlng, attributes);\n\n }\n\n }, { pane:\"pointsPane\"}).addTo(map);\n }", "title": "" }, { "docid": "60635f4df817de58d4fcb8ed610d9691", "score": "0.52332765", "text": "function locationNote (location,ip){\n\n\tvar sqlInsert =\"q=INSERT INTO \"+ table_name +\" (ip,the_geom) VALUES('\"+ ip +\"', ST_GeomFromText('POINT(\" + location + \")', 4326) )\";\n\n console.log('updating current ID...');\n postToDB(sqlInsert);\n // console.log('post to DB commented out');\n \n}", "title": "" }, { "docid": "6205146fe3f1c606ccd8be8c89529970", "score": "0.5232461", "text": "function getData() {\n Parse.initialize(\"N2JqJz0aiZJCI8AsS54lIGS2ZPkIrnuAjjNwMDMp\", \"lifNBQyqt8tuG0GnSeOswmdHug1D1BV1FZyikMB2\");\n\n var Location = Parse.Object.extend(\"location\");\n var query = new Parse.Query(Location);\n\n query.find({\n success: function(results) { \n console.log(\"Successfully retrieved \" + results.length + \" scores.\");\n\n var currentLocationCount = results.length;\n\n Session.set(\"locationCount\", currentLocationCount);\n\n console.log(JSON.stringify(results));\n\n for (var i = 0; i < results.length; i++) {\n var magnitudes = results[i].get(\"Magnitude\");\n console.log(magnitudes);\n\n var geoPoints = results[i].get(\"location\");\n // console.log(JSON.stringify(geoPoints));\n\n var latitudeParse = geoPoints[\"latitude\"];\n var longitudeParse = geoPoints[\"longitude\"];\n\n // console.log(latitudeParse);\n // console.log(longitudeParse);\n locations[i] = new Array(3);\n\n locations[i][0] = latitudeParse;\n locations[i][1] = longitudeParse;\n locations[i][2] = magnitudes;\n\n console.log(\"Latitude No. \" + i + \" : \" + locations[i][0]);\n console.log(\"longitude No. \" + i + \" : \" + locations[i][1]);\n console.log(\"longitude No. \" + i + \" : \" + locations[i][2]);\n\n\n }\n\n //the array that will be watched for changes\n Session.set(\"locations\", locations);\n },\n\n error: function(object, error) {\n console.log(\"Error retrieving data from database\");\n }\n });\n }", "title": "" }, { "docid": "d8e70cf047312934513ecc36d94fb362", "score": "0.52277875", "text": "process_osm_data(data){\n console.log('loading data...');\n var context = this,\n // Convert to GeoJSON\n geojson_data = osmtogeojson(data),\n // Filter ways\n polys_geojson = geojson_data.features.filter(function(feature){\n return feature.properties.type == \"way\"\n }),\n // Filter points\n points_geojson = geojson_data.features.filter(function(feature){\n return feature.properties.type == \"node\"\n }),\n // Generate centroids for points\n polys_geojson_points = polys_geojson.map(function(poly){\n var copy = JSON.parse(JSON.stringify(poly));\n copy['geometry'] = GuadecMap.polygon_center(copy.geometry.coordinates);\n return copy\n }),\n // Get together both set of points\n all_features = points_geojson.concat(polys_geojson_points),\n // Get all properties out from the tags\n points_geojson_props = all_features.map(function(feature){\n var properties = feature['properties'],\n tags = properties['tags'];\n Object.assign(properties, tags);\n delete properties['tags'];\n \n if (properties['id'] == undefined){\n properties['id'] = String(feature['id'])\n } else {\n properties['id'] = String(properties['id'])\n };\n \n // Override the name in Engish, if it exists\n if (properties['name:en'] != undefined){\n properties['name'] = properties['name:en']\n };\n \n return feature\n }\n ),\n /* takes a feature, and augment it with any custom properties \n passed on thi list of nodes and ways */\n final_points = points_geojson_props.map(function(feature){\n var options = context.options,\n /* filter checker */\n filter_node = function(node){\n return typeof node != \"number\" && node['osm_id'] == feat_id;\n },\n properties = feature['properties'],\n /* feature id */\n feat_id = properties['id'],\n /* candidates */\n candidate = options.osm_nodes.filter(filter_node)\n .concat(options.osm_ways.filter(filter_node));\n\n if (candidate.length == 1){\n properties = Object.assign(properties,candidate[0]);\n };\n\n return feature;\n });\n\n context.geojson_data = {\n 'type': 'FeatureCollection',\n 'features': final_points\n }; \n\n // Build final geojson collection\n return context.geojson_data; \n }", "title": "" }, { "docid": "a957e3dcb13fcb8966ffbeaee4603bb1", "score": "0.522288", "text": "function createPropSymbols(data, map){\n //create a Leaflet GeoJSON layer and add it to the map\n L.geoJson(data, {\n pointToLayer: pointToLayer\n }).addTo(map);\n}", "title": "" }, { "docid": "246c383d5132b7c6b5f520a7c922b291", "score": "0.52129763", "text": "function getParkLocations() {\n\n for (var i = 0; i < parkCoords.length; i++) {\n // console.log(parkCoords[i]);\n var parkName = parkCoords[i].name;\n var location = parkCoords[i].Location;\n var lat = parkCoords[i].lat;\n var lon = parkCoords[i].lon;\n // Combine information from previous API searches into new park objects and build a local parksArray\n var newPark = {};\n newPark['name'] = parkName;\n newPark['location'] = location;\n newPark['lat'] = lat;\n newPark['lon'] = lon;\n if (parksWithTrails.includes(parkName)) {\n newPark['trails'] = 'Yes';\n } else {\n newPark['trails'] = 'No';\n }\n if (parksWithMonuments.includes(parkName)) {\n newPark['monument'] = 'Yes';\n } else {\n newPark['monument'] = 'No';\n }\n parksArray.push(newPark);\n }\n console.log('parksArray ready');\n}", "title": "" }, { "docid": "4a4840f21005feb0e62341600066be92", "score": "0.5208025", "text": "function create_location_variables(loopcount) {\n storeDistance = locationset[loopcount][0];\n storeDistance = roundNumber(storeDistance, 2);\n storeName = locationset[loopcount][1];\n storeAddress1 = locationset[loopcount][4];\n storeAddress2 = locationset[loopcount][5];\n storeCity = locationset[loopcount][6];\n storeState = locationset[loopcount][7];\n storeZip = locationset[loopcount][8];\n storePhone = locationset[loopcount][9];\n storeWeb = locationset[loopcount][10];\n storeHours1 = locationset[loopcount][11];\n storeHours2 = locationset[loopcount][12];\n storeHours3 = locationset[loopcount][13];\n locType = locationset[loopcount][14];\n locAtm = locationset[loopcount][15];\n locDriveup = locationset[loopcount][16];\n locSafedeposit = locationset[loopcount][17];\n locNightdeposit = locationset[loopcount][18];\n locSaturdayhours = locationset[loopcount][19];\n locAtmdeposits = locationset[loopcount][20];\n locAtmdriveup = locationset[loopcount][21];\n locAtmwalkup = locationset[loopcount][22];\n locLobbysunday = locationset[loopcount][23];\n locLobbymonday = locationset[loopcount][24];\n locLobbytuesday = locationset[loopcount][25];\n locLobbywednesday = locationset[loopcount][26];\n locLobbythursday = locationset[loopcount][27];\n locLobbyfriday = locationset[loopcount][28];\n locLobbysaturday = locationset[loopcount][29];\n locDriveupsunday = locationset[loopcount][30];\n locDriveupmonday = locationset[loopcount][31];\n locDriveuptuesday = locationset[loopcount][32];\n locDriveupwednesday = locationset[loopcount][33];\n locDriveupthursday = locationset[loopcount][34];\n locDriveupfriday = locationset[loopcount][35];\n locDriveupsaturday = locationset[loopcount][36];\n locIsbranch = locationset[loopcount][37];\n //Convert to a bool for infowindow comparison\n if (locIsbranch == \"Yes\")\n locIsbranch = true;\n else\n locIsbranch = false;\n }", "title": "" }, { "docid": "35011e2a875adb0432d5306a0ffe7d12", "score": "0.5207932", "text": "function initMap()\r\n{\r\n thePosition =\r\n {\r\n lat: 40.7413549,\r\n lng: -73.9980244\r\n };\r\n getMap(thePosition);\r\n getInfoWindow(thePosition, 'parking');\r\n\r\n}", "title": "" }, { "docid": "13c5851e3e28328fd4fa91091b16f883", "score": "0.5206403", "text": "function createMap(){\r\n\t//create the map\r\n\tvar map = L.map('map', {\r\n\t\tcenter: [20, 0],\r\n\t\tzoom: 2\r\n\t});\r\n\r\n\t//add OSM base tilelayer\r\n\tL.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\r\n\t\t\tattribution: '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap contributors</a>'\r\n\t}).addTo(map);\r\n\r\n\t//call getData function\r\n\tgetData(map);\r\n}", "title": "" }, { "docid": "b98aec9abafc5cba4ad9923e0e38db4d", "score": "0.5203267", "text": "function show_police_station() {\n markers_police_station = []; //add markers on the map\n for(var i=0; i < data_police_station.data.length; i++){\n \tvar address_police_station = data_police_station.data[i][10];\n \tvar latLng = JSON.parse('{ \"lat\":'+ data_police_station.data[i][20] +', \"lng\":'+ data_police_station.data[i][21] +' }');\n \tmarkers_police_station[i] = new google.maps.Marker({\n\t\t\t\t \tposition: latLng, map: map, title: address_police_station, icon: 'img/police.png'\n\t\t\t\t \t});\n }\n showing_police_station = true; // Change state app\n}", "title": "" }, { "docid": "d2164b8bb819ffb991e50902467ada00", "score": "0.5195558", "text": "function openthedata(counter,lati,longi) {\n $('#opendata').append( \"Point: \" + counter + \". \");\n $('#opendata').append(\"Lat: \" + lati + \". \");\n $('#opendata').append(\"Long: \" + longi + \". \");\n}", "title": "" }, { "docid": "9fb48b0da32661411a2d6db7334fe9f6", "score": "0.5195483", "text": "function initialize() {\n newMap();\n getData();\n }", "title": "" }, { "docid": "f5c04406f34723e53608a7cb47b42d59", "score": "0.51939046", "text": "function success_GetAllLocations_CallbackFunction(parRetrievedData) {\n\n console.log(\"Inside success_GetAllLocations()\");\n\n //Retrieve the incoming POI ID from the querystring\n var poiID = getQuerystring('qryPOI');\n console.log(\"poiID = \" + poiID);\n\n //Loop through the retrieved array of POI objects to get chosen POI info\n for (arrayIndex = 0; arrayIndex < parRetrievedData.length; arrayIndex++) {\n\n var currentPOIID = parRetrievedData[arrayIndex].RouteCode;\n // console.log(\"currentPOIID = \" + currentPOIID);\n\n //Get info from desired POI\n if (currentPOIID == poiID) {\n // console.log(\"chosen POI = \" + currentPOIID);\n\n var trailHead = parRetrievedData[arrayIndex].TrailHead;\n var lat = parRetrievedData[arrayIndex].TrailHead_Lat;\n var long = parRetrievedData[arrayIndex].TrailHead_Long;\n var title = parRetrievedData[arrayIndex].RouteName;\n var desc = parRetrievedData[arrayIndex].Description;\n var length = parRetrievedData[arrayIndex].RouteLength;\n var difficulty = parRetrievedData[arrayIndex].RouteDifficulty;\n var parking = parRetrievedData[arrayIndex].parking;\n var image1 = parRetrievedData[arrayIndex].Image1;\n var image2 = parRetrievedData[arrayIndex].Image2;\n var image3 = parRetrievedData[arrayIndex].Image3;\n var image4 = parRetrievedData[arrayIndex].Image4;\n var image5 = parRetrievedData[arrayIndex].Image5;\n //var image6 = parRetrievedData[arrayIndex].POI_Image6;\n //var url = parRetrievedData[arrayIndex].POI_URL;\n var cat = parRetrievedData[arrayIndex].TrailSystemCode;\n var routeFile = parRetrievedData[arrayIndex].RouteFile;\n\n\n break;\n }\n }\n var categoryTitle = unescape(getQuerystring('qryCatTitle'));\n var categoryID = unescape(getQuerystring('qryCatCode'));\n var trailType = unescape(getQuerystring('qryTrailType'));\n\n //Add link to buttons on POI.htm\n var buttonQuerystring = '?qryTrailType=' + trailType +\n '&qryPOI=' + poiID +\n '&qryCatCode=' + categoryID +\n '&qryCatTitle=' + categoryTitle +\n '&qryLat_POI=' + lat_POI +\n '&qryLong_POI=' + long_POI +\n '&qryRouteFile=' + routeFile;\n\n //$('a[id|=MapDirections]').attr('href', 'MapDirections.html' + buttonQuerystring);\n $('a[id|=icon-directions]').attr('href', 'ListDirections.html' + buttonQuerystring);\n $('a[id|=map-page]').attr('href', 'route_Map.html' + buttonQuerystring);\n\n //Add the title to the header and the info area\n $('#placeTitle').text(title);\n //$('#top-left #placeURL').html('<a href=\"' + url + ' \" target=\"_blank\">Website</a>');\n var trailHeadInfo = '<b>Trail Head: </b>' + trailHead;\n $('#trailHead').html(trailHeadInfo);\n var lengthInfo = '<b>Length:</b> ' + length;\n $('#length').html(lengthInfo);\n var diffInfo = '<b>Difficulty:</b> ' + difficulty;\n $('#difficulty').html(diffInfo);\n var descInfo = '<b>Description:</b> ' + desc;\n $('#desc').html(descInfo);\n var parkInfo = '<b>Parking:</b> ' + parking;\n $('#parking').html(parkInfo);\n\n //Display POI Info\n $('input[name|=q]').attr('value', [lat, long]);\n\n var imageQueryString = 'Display_Image.htm?qryPOI=' + poiID +\n '&qryCatCode=' + categoryID +\n '&qryCatTitle=' + categoryTitle +\n '&qryLat_POI=' + lat_POI +\n '&qryLong_POI=' + long_POI +\n '&qryImgFileName=';\n\n //Build and display first image (if any)\n //This assumes that if we don't have an image1 we don't have any images at all.\n if (image1 != \"\") {\n $('ul[id|=Gallery] li[id|=1]').html('<a rel=\"external\" id=\"image1\" href=\"Images/' + image1 + '\"><img id=\"mainImage\" src=\"Images/' + image1 + '\" /></a>');\n $('#Gallery').show();\n }\n else {\n $('span[id|=mainImage]').html('<img id=\"main\" alt=\"\" src=\"Images/' + \"no-image.jpg\" + '\" />');\n\n $('ul[id|=Gallery] li[id|=1]').remove();\n }\n //Build and display second image (if any)\n if (image2 != \"\") {\n $('ul[id|=Gallery] li[id|=2]').html('<a rel=\"external\" href=\"Images/' + image2 + '\"><img class=\"extra\" src=\"Images/' + image2 + '\" /></a>');\n $('#Gallery').show();\n }\n else {\n $('ul[id|=Gallery] li[id|=2]').remove();\n }\n\n ////Build and display third image (if any)\n if (image3 != \"\") {\n $('ul[id|=Gallery] li[id|=3]').html('<a rel=\"external\" href=\"Images/' + image3 + '\"><img class=\"extra\" src=\"Images/' + image3 + '\" /></a>');\n }\n else {\n $('ul[id|=Gallery] li[id|=3]').remove();\n }\n\n //Build and display fourth image (if any)\n if (image4 != \"\") {\n $('ul[id|=Gallery] li[id|=4]').html('<a rel=\"external\" href=\"Images/' + image4 + '\"><img class=\"extra\" src=\"Images/' + image4 + '\" /></a>');\n }\n else {\n $('ul[id|=Gallery] li[id|=4]').remove();\n }\n\n //Build and display fifth image (if any)\n if (image5 != \"\") {\n $('ul[id|=Gallery] li[id|=5]').html('<a rel=\"external\" href=\"Images/' + image5 + '\"><img class=\"extra\" src=\"Images/' + image5 + '\" /></a>');\n }\n else {\n $('ul[id|=Gallery] li[id|=5]').remove();\n }\n\n ////Build and display sixth image (if any)\n //if (image6 != \"\") {\n // $('ul[id|=Gallery] li[id|=6]').html('<a rel=\"external\" href=\"Images/' + image6 + '\"><img class=\"extra\" src=\"Images/' + image6 + '\" /></a>');\n //}\n //else {\n // $('ul[id|=Gallery] li[id|=6]').remove();\n //}\n\n //Photoswipe function\n myPhotoSwipe += $(\"#Gallery a\").photoSwipe({ enableMouseWheel: false, enableKeyboard: false });\n}", "title": "" }, { "docid": "382acac01f3d98916dce0d6ec155b529", "score": "0.5190654", "text": "function handleCustomLocations(blob) {\n if (window.custom_location) {\n window.latitude = blob.coord.lat\n window.longitude = blob.coord.lon\n window.location_saved = true\n }\n }", "title": "" }, { "docid": "d2d32d3e031ea002a9d65f7ed509fd7a", "score": "0.51865983", "text": "function createMap(){\r\n //create the map\r\n var map = L.map('map', {\r\n center: [20, 0],\r\n zoom: 2\r\n });\r\n\r\n //add OSM base tilelayer\r\n L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\r\n attribution: '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap contributors</a>'\r\n }).addTo(map);\r\n \r\n getData(map);\r\n}", "title": "" }, { "docid": "3c65f410cdec3f9f8cca6526b1447c5d", "score": "0.51822805", "text": "async initWild(data) {\n this.id = BigInt(data.wild.encounter_id).toString();\n let timestampMs = new Date().getTime();\n //console.log('Wild Pokemon Data:', data.wild.pokemon_data);\n this.pokemonId = data.wild.pokemon_data.pokemon_id;\n if (data.wild.latitude === undefined || data.wild.latitude === null) {\n console.debug('[Pokemon] Wild Pokemon null lat/lon!');\n }\n this.lat = data.wild.latitude;\n this.lon = data.wild.longitude;\n this.spawnId = BigInt(parseInt(data.wild.spawn_point_id, 16)).toString();\n this.gender = data.wild.pokemon_data.pokemon_display.gender;\n this.form = data.wild.pokemon_data.pokemon_display.form;\n if (data.wild.pokemon_data.pokemon_display) {\n this.costume = data.wild.pokemon_data.pokemon_display.costume;\n this.weather = data.wild.pokemon_data.pokemon_display.weather_boosted_condition;\n }\n this.username = data.wild.username;\n if (data.wild.time_till_hidden_ms > 0 && data.wild.time_till_hidden_ms <= 90000) {\n this.expireTimestamp = Math.round((data.timestampMs + data.wild.time_till_hidden_ms) / 1000);\n this.expireTimestampVerified = true;\n } else {\n this.expireTimestampVerified = false;\n }\n if (!this.expireTimestampVerified && this.spawnId) {\n // Spawnpoint not verified, check if we have the tth.\n let spawnpoint;\n try {\n spawnpoint = await Spawnpoint.getById(this.spawnId);\n } catch (err) {\n spawnpoint = null;\n }\n if (spawnpoint instanceof Spawnpoint && spawnpoint.despawnSecond) {\n let expireTimestamp = this.getDespawnTimer(spawnpoint);\n if (expireTimestamp > 0) {\n this.expireTimestamp = expireTimestamp;\n this.expireTimestampVerified = true;\n }\n } else {\n spawnpoint = new Spawnpoint(this.spawnId, this.lat, this.lon, null, Math.round(data.timestampMs / 1000));\n await spawnpoint.save(false);\n this.expireTimestamp = null;\n }\n }\n if (data.wild.cell === undefined || data.wild.cell === null) {\n this.cellId = Cell.getCellIdFromLatLon(this.lat, this.lon);\n } else {\n this.cellId = BigInt(data.wild.cell).toString();\n }\n if (data.wild.pokemon_data) {\n this.atkIv = data.wild.pokemon_data.individual_attack;\n this.defIv = data.wild.pokemon_data.individual_defense;\n this.staIv = data.wild.pokemon_data.individual_stamina;\n this.move1 = data.wild.pokemon_data.move_1;\n this.move2 = data.wild.pokemon_data.move_2;\n this.cp = data.wild.pokemon_data.cp;\n let cpMultiplier = data.wild.pokemon_data.cp_multiplier;\n let level;\n if (cpMultiplier < 0.734) {\n level = Math.round(58.35178527 * cpMultiplier * cpMultiplier - 2.838007664 * cpMultiplier + 0.8539209906);\n } else {\n level = Math.round(171.0112688 * cpMultiplier - 95.20425243);\n }\n this.level = level;\n this.capture1 = null;\n this.capture2 = null;\n this.capture3 = null;\n } else {\n this.atkIv = null;\n this.defIv = null;\n this.staIv = null;\n this.move1 = null;\n this.move2 = null;\n this.cp = null;\n this.level = null;\n this.capture1 = null;\n this.capture2 = null;\n this.capture3 = null;\n }\n this.changed = Math.round(timestampMs / 1000);\n }", "title": "" }, { "docid": "ea01f1f8378a95869e4d7dbef7e35dde", "score": "0.5176408", "text": "function PointData(name, recordFields, records, url, properties) {\n RamaddaUtil.inherit(this, new BasePointData(name, properties));\n this.parentPointData = properties?properties.parent:null;\n\n RamaddaUtil.defineMembers(this, {\n recordFields: recordFields,\n records: records,\n url: url,\n\tbaseUrl:url,\n loadingCnt: 0,\n\tgetRootPointData: function() {\n\t if(this.parentPointData)\n\t\treturn this.parentPointData.getRootPointData();\n\t return this;\n\t},\n getUrl: function() {\n\t if(this.url) return this.url;\n\t if(this.parentPointData) return this.parentPointData.getUrl();\n\t return null;\n\t},\n getCacheUrl: function() {\n\t if(!this.cacheUrl) {\n\t\tif(this.baseUrl) {\n\t\t this.cacheUrl = this.baseUrl;\n\t\t} else if(this.parentPointData) {\n\t\t this.cacheUrl =this.parentPointData.getCacheUrl();\n\t\t}\n\t\tif(this.cacheUrl) {\n\t\t if(this.display && this.display.displayManager) {\n\t\t\tlet props = {lat: this.lat,lon: this.lon};\n\t\t\tthis.cacheUrl = this.display.displayManager.getJsonUrl(this.cacheUrl, this.display, props);\n//\t\t\tconsole.log('CACHE',this.cacheUrl)\n\t\t }\n\t\t}\n\t }\n\t return this.cacheUrl;\n\t},\t\n equals: function(that) {\n\t if(this.jsonUrl) {\n\t\treturn this.jsonUrl == that.jsonUrl;\n\t }\n return this.url == that.url;\n },\n getIsLoading: function() {\n return this.loadingCnt > 0;\n },\n handleEventMapClick: function(myDisplay, source, lon, lat) {\n\t let url = this.getUrl();\n let cacheObject = getPointDataCacheObject(url);\n this.lon = lon;\n this.lat = lat;\n\t ///repository/grid/json?entryid=3715ca8e-3c42-4105-96b1-da63e3813b3a&location.latitude=0&location.longitude=179.5\n\t //\t initiallatitude=40&location.latitude=0&location.longitude=179.5\n if (myDisplay.getDisplayManager().hasGeoMacro(url)) {\n\t\tthis.loadData(myDisplay, true);\n return true;\n }\n return false;\n },\n startLoading: function() {\n this.loadingCnt++;\n },\n stopLoading: function() {\n this.loadingCnt--;\n },\n setGroupField: function() {\n if(this.recordFields) {\n for(var i=0;i<this.recordFields.length;i++) {\n var field = this.recordFields[i];\n if(field.isFieldGroup()) {\n this.groupField = field;\n break;\n }\n }\n }\n },\n extractGroup: function(group, records) {\n if(!this.groupField) return records;\n var groupData = this.getDataGroups(records);\n if(groupData.length==0) return records;\n if(!group) group = groupData[0];\n return records;\n },\n getDataGroups: function(records) {\n if(!this.groupData) {\n if(!records) return [];\n this.groupData= [];\n var groupField = this.getGroupField();\n if(!groupField) return this.groupData;\n var seen = {};\n for(var i=0;i<records.length;i++) {\n var record = records[i];\n var data;\n if(record.tuple) \n data = record.tuple;\n else if(record.record)\n data = record.record.getData();\n console.log(\"data:\" + data);\n var value = groupField.getValue(record);\n if(!seen[value]) {\n seen[value] = true;\n this.groupData.push(value);\n }\n }\n }\n console.log(this.groupData);\n return this.groupData;\n },\n getGroupField: function() {\n return this.groupField;\n },\n isGroup: function() {\n return this.getGroupField()!=null;\n },\n loadData: function(display, reload,callback) {\n\t let root = this.getRootPointData();\n if (root.url == null) {\n console.log(\"No URL\");\n return;\n }\n\t jsonUrl = root.url;\n\t this.display = display;\n\t if(display && display.displayManager) {\n\t\tlet props = {\n lat: this.lat,\n lon: this.lon,\n\t\t};\n\t\tjsonUrl = display.displayManager.getJsonUrl(root.url, display, props);\n\t }\n\t root.jsonUrl = jsonUrl;\n root.loadPointJson(jsonUrl, display, reload,callback);\n },\n\tgetCacheObject: function() {\n let cacheObject = getPointDataCacheObject(this.getUrl());\n\t if(!cacheObject) {\n\t\tlet cacheUrl = this.getCacheUrl();\n\t\tif(cacheUrl) cacheObject = getPointDataCacheObject(cacheUrl);\n\t }\n\t return cacheObject;\n\t},\n\n\tremoveFromCache:function(object) {\n let cacheObject = this.getCacheObject();\n if(cacheObject) {\n\t\tcacheObject.removeDisplay(object);\n\t }\n\t},\n\n\n\tpropagateEventDataChanged:function(source) {\n let cacheObject = this.getCacheObject();\n if(cacheObject) {\n\t\tlet displays = cacheObject.displays;\n\t\tif(displays) {\n\t\t displays.forEach(display=>{\n\t\t\tif(display==source) return;\n\t\t\tdisplay.pointDataLoaded(this, this.url, true);\n\t\t });\n }\n\t }\n\t},\n\n loadPointJson: function(url, display, reload,callback) {\n\t let debug = displayDebug.loadPointJson;\n\t let debug2 = false;\n let pointData = this;\n this.startLoading();\n let _this = this;\n\t if(debug) {\n\t\tconsole.log(\"loadPointJson: \"+ display.type +\" \" + display.getId() +\" url:\" + url);\n\t } \n\t let cacheId = this.getCacheUrl();\n\t if(display.getProperty && !display.getProperty(\"pointDataCacheOK\",true)) {\n\t\tcacheId = HtmlUtils.getUniqueId();\n\t }\n\n\n\n let cacheObject = getPointDataCacheObject(cacheId);\n if (cacheObject == null) {\n cacheObject = new PointDataCacheObject(url);\n\t\tif(debug)\n console.log(\"\\t**** created cache object: \" +cacheId);\n getPointDataCache()[cacheId] = cacheObject;\n } else {\n\t\tif(cacheObject.pending.indexOf(display)>=0) {\n\t\t if(debug)\n\t\t\tconsole.log(\"\\tcache hit - display in pending list\");\n\t\t return;\n\t\t} else {\n\t\t if(debug)\n\t\t\tconsole.log(\"\\tcache hit - display not in pending list\");\n\t\t}\n\t }\t\t\n\t if(cacheObject.displays.indexOf(display)<0) {\n\t\tif(debug2)\n\t\t console.log(\"adding to displays-1:\" + display);\n\t\tcacheObject.displays.push(display);\n\t }\n\t //If we are reloading then clear the data\n\t //Don't do this for now\n\t if(reload) {\n\t\t//If its a reload then add all dependent displays to the pending listd\n\t\tcacheObject.pointData = null;\n\t\tcacheObject.pending = [];\n\t\tif(debug)\n\t\t console.log(\"\\treloading adding to pending:\" + cacheObject.displays);\n\t\tcacheObject.displays.forEach(d=>{\n\t\t if(debug)\n\t\t\tconsole.log(\"\\tdisplay:\" + d.type +\" \" + d.getId());\n\t\t cacheObject.pending.push(d);\n\t\t});\n\t } else {\n\t\tif(cacheObject.displays.indexOf(display)<0) {\n\t\t if(debug2)\n\t\t\tconsole.log(\"adding to displays-2:\" + display);\n\t\t cacheObject.displays.push(display);\n\t\t}\n\t\tif (cacheObject.pointData != null) {\n\t\t if(debug)\n\t\t\tconsole.log(\"\\tdata was in cache:\" +cacheObject.pointData.getRecords().length+\" url:\" + url);\n\t\t if(callback)\n\t\t\tcallback(cacheObject.pointData);\n else\n\t\t\tdisplay.pointDataLoaded(cacheObject.pointData, url, reload);\n return;\n\t\t}\n\t\tcacheObject.pending.push(display);\n\t\tif (cacheObject.pending.length > 1) {\n\t\t if(debug)\n\t\t\tconsole.log(\"\\tWaiting on callback:\" + cacheObject.pending.length +\" \" + url +\" d:\" + display);\n return;\n\t\t}\n\t }\n let fail = function(jqxhr, textStatus, error) {\n let err = textStatus;\n\t\tif(err) {\n\t\t if(error)\n\t\t\terr += \": \" + error;\n\t\t} else {\n\t\t err = error;\n\t\t}\n\n\t\t//Check if the response is json\n\t\tif(jqxhr.responseText && jqxhr.responseText.startsWith(\"{\")) {\n\t\t try {\n\t\t\tlet tmp = JSON.parse(jqxhr.responseText);\n\t\t\tif(tmp.error) err = tmp.error;\n\t\t } catch(ignore) {\n\t\t }\n\t\t}\n\t\tconsole.log(\"Point data load error:\" + url+\" \" + (err?err:\"\"));\n\t\tcacheObject.pending.map(display=>{\n display.pointDataLoadFailed(err);\n\t\t});\n\t\tdelete getPointDataCache()[url];\n pointData.stopLoading();\n }\n\n let success=function(data) {\n\t\tif(typeof data == \"string\") {\n\t\t try {\n\t\t\tif(debug) console.log(\"parsing point data\");\n\t\t\tdata = JSON.parse(data);\n\t\t } catch(exc) {\n\t\t\tconsole.log(\"Error:\" + exc);\n\t\t\tif(data.length>1000) data = data.substring(0,999);\n\t\t\tconsole.log(\"data:\" + data);\n\t\t\tdisplay.displayError(\"Error loading data:\" + exc+\"<br>URL:\"+ url);\n\t\t\treturn;\n\t\t }\n\t\t}\n\t\tif(debug) console.log(\"pointDataLoaded\");\n if (GuiUtils.isJsonError(data)) {\n\t\t if(debug)\n\t\t\tconsole.log(\"\\tloadPointData failed\");\n\t\t console.log(\"loadPointData failed:\" + url);\n display.pointDataLoadFailed(data);\n return;\n }\n\t\tif(data.errorcode == \"nodata\" || !data.fields) {\n\t\t if(debug)\n\t\t\tconsole.log(\"\\tno data:\" + url);\n\t\t let dummy = new PointData(\"\", [],[]);\n let pending = cacheObject.pending;\n cacheObject.pending = [];\n\t\t pending.forEach(d=>{\n\t\t\td.handleNoData(dummy);\n\t\t });\n\t\t return;\n\t\t}\n//\t\tif(debug) console.log(\"\\tmaking point data\");\n\t\tlet t1 = new Date();\n let newData = makePointData(data, _this.derived, display,_this.url,callback);\n\t\tlet t2 = new Date();\n\t\tif(debug) Utils.displayTimes(\"makePointData #records: \" + newData.getRecords().length,[t1,t2],true);\n let pointData = cacheObject.pointData = newData;\n\t\tif(data.properties) {\n\t\t display.applyRequestProperties(data.properties);\n\t\t}\n let tmpPending = cacheObject.pending;\n\t\tif(debug) {\n\t\t console.log(\"\\tcalling pointDataLoaded on \" + tmpPending.length + \" pending displays\");\n\t\t}\n cacheObject.clearPending();\n\n\t\tif(callback) callback(pointData);\n\t\telse {\n for (let i = 0; i < tmpPending.length; i++) {\n\t\t\tif(debug)\n\t\t\t console.log(\"\\t\\t\" + tmpPending[i] +\" #:\" + pointData.getRecords().length);\n\t\t\ttmpPending[i].pointDataLoaded(pointData, url, reload);\n\t\t }\n }\n\n\t\tif(cacheObject.pointData.records && cacheObject.pointData.records.length) {\n\t\t cacheObject.setSize(cacheObject.pointData.records.length*cacheObject.pointData.records[0].getData().length);\n\t\t}\n\n\t\tlet size = 0;\n\t\tlet cnt = 0;\n\t\tObject.keys(getPointDataCache()).map(key=>{\n\t\t size+=getPointDataCache()[key].getSize();\n\t\t cnt++;\n\t\t});\n\t\tif(debug) console.log(\"\\tcache size:\" + size +\" #objects:\" + cnt);\n\t\t//Size is just the number of rows*columns\n\t\tif(size>1000000) {\n\t\t if(debug)\n\t\t\tconsole.log('\\tclearing cache');\n\t\t Object.keys(getPointDataCache()).map(key=>{\n\t\t\tlet cacheObject = getPointDataCacheObject(key);\n\t\t\tif(cacheObject.pending.length==0) {\n\t\t\t if(debug)console.log(\"\\tdeleting from cache:\" + key);\n\t\t\t cacheObject.clearData();\n\t\t\t}\n\t\t });\n\t\t}\n pointData.stopLoading();\n\t }\n\t let fullUrl = url;\n\t if(!fullUrl.startsWith(\"http\")) {\n\t\tlet base = window.location.protocol + \"//\" + window.location.host;\n\t\tfullUrl = base+fullUrl;\n\t }\n\n\t //Handle the snapshot relative file\n\t if(!url.startsWith(\"/\") && !url.startsWith(\"http\")) {\n\t\tlet root = String(window.location).replace(/\\/[^\\/]+$/,\"\");\n\t\turl = root + \"/\" + url;\n\t }\n\t display.handleLog(\"data:\" + url);\n\t $.getJSON(url,success).fail(fail);\n\t //$.getJSON(url, success,{crossDomain:true}).fail(fail);\n }\n\n });\n this.setGroupField();\n}", "title": "" }, { "docid": "905586ef620a919af167ebc0fe70b53d", "score": "0.51760906", "text": "startData() { return {\n unlocked: false,\n\t\tpoints: new ExpantaNum(0),\n total: new ExpantaNum(0),\n incrementali: new ExpantaNum(0),\n }}", "title": "" }, { "docid": "89cc781bf47ee6afc4885e1421105849", "score": "0.51748943", "text": "function createPropSymbols(data, map, attributes){\n//create a Leaflet GeoJSON layer and add it to the map\nL.geoJson(data, {\npointToLayer: function(feature, latlng){\nreturn pointToLayer(feature, latlng, attributes);\n }\n }).addTo(map);\n}", "title": "" }, { "docid": "7cc680967703bb81ba6ca57d5cb9e1fa", "score": "0.5169349", "text": "function createMap(){\n var southWest = L.latLng(-90, -180),\n northEast = L.latLng(90, 180),\n bounds = L.latLngBounds(southWest, northEast);\n\n //create the map\n var map = L.map('mapid', {\n center: [20, 10],\n zoom: 2,\n maxBounds: bounds,\n maxBoundsViscosity:.7\n });\n\n //add OSM base tilelayer\n L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}', {\n attribution: 'Tiles &copy; Esri &mdash; Esri, DeLorme, NAVTEQ',\n minZoom:2\n }).addTo(map);\n\n // Create necessary panes in correct order\n map.createPane(\"pointsPane\");\n map.createPane(\"polygonsPane\");\n\n\n //call getData function\n getCountryShapeData(map);\n getData(map);\n $(window).on(\"resize\", function () { $(\"#mapid\").height($(window).height()-50); map.invalidateSize(); }).trigger(\"resize\");\n $(document).ready(function() {$(window).resize(function() {\n var bodyheight = $(this).height();\n $(\"#page-content\").height(bodyheight-70);\n }).resize();\n});\n\n}", "title": "" }, { "docid": "b25af4a79538c9cd9abe5047fc3e8750", "score": "0.5166818", "text": "function mapPointValues(){\n\tvar fosaLocations = [];\n var dataLocationUrl = getDataLocationUrl(mapUrl) + reportLocationCodes;\n\tjQuery.getJSON(dataLocationUrl, function(data){\n\t\n\t\t// TODO\n\t\tif(data == null){\n\t\t\t//alert(\"error fct points\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tjQuery.each(data.features, function(i,f){\n\n\t\t\tvar fosaid = f.id;\n\t\t\tfosaLocations.push(fosaid+\"\");\n\n\t\t\tif(!f.value){\n\t\t\t\t// fosa coordinates missing\n\t\t\t\tmissingFosaCoordinates(fosaid);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tvar mapTableValues = $('.js-map-table-value.js-selected-value[data-location-code=\"'+fosaid+'\"]');\n\n\t\t\t\tif(mapTableValues.size() == 0){\n\t\t\t\t\tmapTableValues = $('.js-map-table-value[data-location-code=\"'+fosaid+'\"]').first();\n\t\t\t\t}\n\n\t\t\t\t$(mapTableValues).each(function(index, mapTableValue){\n\n\t\t\t\t\tvar mapValue = $(mapTableValue).children('div.report-value-number').children('div.report-value');\n\t\t\t\t\tvar rawValue = $(mapValue).data('report-value-raw');\n\t\t\t\t\tvar reportValue = $(mapValue).data('report-value');\n\n\t\t\t\t\tvar indicatorCode = rawValue != null ? $(mapTableValue).data('indicator-code') : null;\n\n\t\t\t\t\tif(!f.value){\n\t\t\t\t\t\t// fosa coordinates missing\n\t\t\t\t\t\tmissingFosaCoordinates(fosaid);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\n\t\t\t\t\t\tvar pointCoordinates = createCoordinate(f.value, false)\n\n\t\t\t\t\t\tvar feature = {\n\t\t\t\t\t\t\t\"id\": fosaid,\n\t\t\t\t\t\t \"geometry\": {\n\t\t\t\t\t\t \"coordinates\": pointCoordinates\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"properties\":{\n\t\t\t\t\t\t\t\t\"locationCode\": $(mapTableValue).attr('data-location-code'),\n\t\t\t\t\t\t\t\t\"locationName\": $(mapTableValue).data('location-names'),\n\t\t\t\t\t\t\t\t\"indicatorClass\": rawValue !=null ? $(mapTableValue).data('indicator-class') : null,\n\t\t\t\t\t\t\t\t\"indicatorCode\": rawValue !=null ? $(mapTableValue).data('indicator-code') : null,\n\t\t\t\t\t\t\t\t\"indicatorName\": rawValue !=null ? $(mapTableValue).data('indicator-names') : null,\n\t\t\t\t\t\t\t\t\"rawValue\": rawValue,\n\t\t\t\t\t\t\t\t\"reportValue\": reportValue,\n\t\t\t\t\t\t\t\t\"reportValueIcon\": reportValueLabelIcon\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// add value\n\t\t\t\t\t\tvar geojsonPointFeature = createGeoJsonPointFeature(feature);\n\t\t\t\t\t\tif(rawValue != null){\n\t\t\t\t\t\t\tvar locationValueLayer = locationValueLayerMap[indicatorCode];\n\t\t\t\t\t\t\tlocationValueLayer.addData(geojsonPointFeature);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse locationValueNaLayer.addData(geojsonPointFeature);\n\n\t\t\t\t\t\t// add value label\n\t\t\t\t\t\tlocationNameLayer.addData(geojsonPointFeature);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\t\t\t\t\t\t\t\t\n\t\t});\t\n\t\t// fosa locations missing\n\t\tvar dhsstLocations = (reportLocationCodes).split('|');\n\t\tmissingFosaLocations(fosaLocations, dhsstLocations);\t\t\t\t\t\t\t\t\t\n\t});\n\t// })\n\t// .success(function() { alert(\"second success\"); })\n\t// .error(function() { alert(\"error\"); })\n\t// .complete(function() { alert(\"complete\"); });\n}", "title": "" }, { "docid": "646ef71a73734adfd9032bd2b0a46a50", "score": "0.5166208", "text": "function addChild(data) {\n\n createMap(\n data.location.longitude,\n data.location.latitude,\n data.isp,\n data.ip_str\n );\n // document.querySelector(\"mapContainer\").appendChild(childMap);\n console.log(data);\n}", "title": "" }, { "docid": "927a5e076573e781b2b00e76ccc4f037", "score": "0.51600397", "text": "function makeCoordList(){\n\n // Get all current coordinates of both the POI- and Position-markers at the maximum zoom level to guarantee a correct integration into the Codecatch-App\n \n for( var a = 0; a < markerArray.length; a++){\n markerArray[a].pixCoordX = map.project(markerArray[a].getLatLng(), mapMaxZoom).x.toString();\n markerArray[a].pixCoordY = map.project(markerArray[a].getLatLng(), mapMaxZoom).y.toString();\n }\n \n for( var a = 0; a < markerArrayPos.length; a++){\n markerArrayPos[a].pixCoordX = map.project(markerArrayPos[a].getLatLng(), mapMaxZoom).x.toString();\n markerArrayPos[a].pixCoordY = map.project(markerArrayPos[a].getLatLng(), mapMaxZoom).y.toString();\n }\n \n \n \n // Start of the JSON-file content\n var textToWrite='{\"poi\":' + '\\n' + \" [\" + '\\n';\n\n\n // Get all the necessary marker information and write them into a form compatible with JSON syntax\n for( var a = 0; a < markerArray.length-1; a++){\n\n var tags = '';\n \n for(var i = 0; i < markerArray[a].tags.length; i++){\n \n if(i < markerArray[a].tags.length-1) \n tags = tags + '\"' + markerArray[a].tags[i].text + '\", '; \n else\n tags = tags + '\"' + markerArray[a].tags[i].text + '\"';\n }\n \n\n \n textToWrite = textToWrite + ' {' + '\"name\": ' + '\"' + String(markerArray[a].name) + '\"' + ', '\n + '\"beschreibung\": ' + '\"' + String(markerArray[a].info) + '\"' + ', '\n + '\"tags\": ' + '[' + tags + ']' + ', '\n + '\"x\": ' + '\"' + String(markerArray[a].pixCoordX) + '\"' + ', ' \n + '\"y\": ' + '\"' + String(markerArray[a].pixCoordY) + '\"' + ', '\n + '\"logoName\": ' + '\"' + markerArray[a].logo + '\"' + '},' + '\\n'; \n }\n \n \n // This section is supposed for the last array element only\n if(markerArray.length > 0){\n \n var tagsOfLastMarker = '';\n \n \n for(var i = 0; i < markerArray[markerArray.length - 1].tags.length; i++){\n \n if(i < markerArray[markerArray.length - 1].tags.length-1) \n \n \n tagsOfLastMarker = tagsOfLastMarker + '\"' + markerArray[markerArray.length - 1].tags[i].text + '\", '; \n else\n tagsOfLastMarker = tagsOfLastMarker + '\"' + markerArray[markerArray.length - 1].tags[i].text + '\"';\n }\n \n \n textToWrite = textToWrite + ' {' + '\"name\": ' + '\"' + String(markerArray[markerArray.length-1].name) +'\"'+', '\n + '\"beschreibung\": ' + '\"' + String(markerArray[markerArray.length-1].info) + '\"' + ', '\n + '\"tags\": ' + '[' + tagsOfLastMarker + ']' + ', '\n + '\"x\": ' + '\"' + String(markerArray[markerArray.length-1].pixCoordX) + '\"' + ', ' \n + '\"y\": ' + '\"' + String(markerArray[markerArray.length-1].pixCoordY) + '\"' + ', '\n + '\"logoName\": ' + '\"' + markerArray[markerArray.length-1].logo + '\"' + '}' + '\\n'; \n }\n\n textToWrite= textToWrite + \" ],\" + '\\n' + '\\n' + '\"position\":' + '\\n' + \" [\" + '\\n';\n \n \n if(markerArrayPos.length > 0){\n \n // Write all information about the Position-marker into the text\n for( var b = 0; b < markerArrayPos.length - 1 ; b++){\n \n textToWrite = textToWrite + ' {' + '\"posCode\": ' + '\"' + String(markerArrayPos[b].positionCode) + '\"' + ', '\n + '\"x\": ' + '\"' + String(markerArrayPos[b].pixCoordX) + '\"' + ', ' \n + '\"y\": ' + '\"' + String(markerArrayPos[b].pixCoordY) + '\"' + ','\n + '\"text\": \"You Are Here!\"' + '},' + '\\n'; \n }\n \n \n textToWrite = textToWrite + ' {' + '\"posCode\": ' + '\"' + String(markerArrayPos[markerArrayPos.length - 1].positionCode) + '\"' + ', '\n + '\"x\": ' + '\"' + String(markerArrayPos[markerArrayPos.length - 1].pixCoordX) + '\"' + ', ' \n + '\"y\": ' + '\"' + String(markerArrayPos[markerArrayPos.length - 1].pixCoordY) + '\"' + ','\n + '\"text\": \"You Are Here!\"' + '}' + '\\n'; \n }\n \n textToWrite= textToWrite + \" ]\" + '\\n' +'}';\n \n \n \n // Writing the text into a 'Blob' and preparing it for the download\n\n var textFileAsBlob = new Blob([textToWrite], {type:'application/JSON'});\n var fileNameToSaveAs = String('jsonData.json');\n\n var downloadLink = document.createElement(\"a\");\n downloadLink.download = fileNameToSaveAs;\n downloadLink.innerHTML = \"Download File\";\n if (window.webkitURL != null)\n {\n // Chrome allows the link to be clicked\n // without actually adding it to the DOM.\n downloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob);\n }\n else\n {\n // Firefox requires the link to be added to the DOM\n // before it can be clicked.\n \n downloadLink.href = window.URL.createObjectURL(textFileAsBlob);\n downloadLink.style.display = \"none\";\n document.body.appendChild(downloadLink);\n }\n\n downloadLink.click();\n\n\n\n}", "title": "" }, { "docid": "0b69488d5050585027120df10ba81125", "score": "0.5155106", "text": "function populateMap() {\r\n //Map Object\r\n map.setView([51.975, 7.61], 13);\r\n\r\n //Basemap Layer\r\n var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {}).addTo(map); //OpenStreetMap\r\n\r\n for(var i = 0; i < locations.length; i++) { //iterate over locations\r\n var location = L.geoJson(locations[i].GeoJson); //build geoJson leaflet object\r\n var position; //initialize variable for the position\r\n if(locations[i].GeoJson.features[0].geometry.type == \"Polygon\") { //if the location is a polygon\r\n location.addTo(locationsLayer); //add the polygon to the locationsLayer\r\n var polygon = []; //array for the \"polygon\"\r\n var coordinates = []; //array for the coordinates\r\n for(var j = 0; j < locations[i].GeoJson.features[0].geometry.coordinates[0].length; j++) { //iterate over the coordinates\r\n coordinates.push([ //push the coordinates into the coordinates array\r\n locations[i].GeoJson.features[0].geometry.coordinates[0][j][0],\r\n locations[i].GeoJson.features[0].geometry.coordinates[0][j][1] \r\n ]);\r\n }\r\n polygon.push(coordinates); //push the coordinates array into the polygon array\r\n position = turf.centroid(turf.polygon(polygon)).geometry.coordinates; //build a turf polygon and calculate its centroid\r\n }\r\n else {\r\n position = locations[i].GeoJson.features[0].geometry.coordinates; //store the position when the location is point\r\n }\r\n var mapObject = L.marker([position[1], position[0]], {icon: locationIcon}); //create marker from current position\r\n mapObject.addTo(locationsLayer); //add the marker to the map \r\n mapObject.addTo(map).bindPopup( //bind a popup\r\n '<p style=\"font-size: 18px;\"><b>' + \"Name der Sehenswürdigkeit: \" + '</b>' + locations[i].locationID + \"</p>\" +\r\n '<br>' + '<b>' + \"URL: \" + '</b>' + locations[i].GeoJson.features[0].properties.URL + \r\n '<br>' + '<b>' + \"Beschreibung: \" + '</b>' + locations[i].GeoJson.features[0].properties.Description +\r\n '<br>' + '<b>' + \"Koordinaten: \" + '</b>' + position[1] + \", \" + position[0] + \"<br><br>\" + \r\n '<br><button type=\"button\" class=\"btn btn-secondary\" onclick=\"getNearestBusstopp([' + position + '])\">Nächste Bushaltestelle</button>'\r\n );\r\n positions.push({ //push an object into positions\r\n leafletObject: location, //location\r\n name: locations[i].locationID, //locationID\r\n coords: locations[i].GeoJson.features[0].geometry.coordinates, //geometry\r\n popup: mapObject //map object -> a marker\r\n });\r\n }\r\n\r\n //Layer Control\r\n var baseLayer = {\r\n \"Open Street Map\": osm, //OpenStreetMap\r\n };\r\n \r\n featureLayer = {\r\n \"Sehenwürdigkeiten\": locationsLayer, //locations\r\n \"Touren\": toursLayer //tours\r\n };\r\n\r\n L.control.layers(baseLayer, featureLayer).addTo(map); //add layer control to map\r\n}", "title": "" }, { "docid": "f2fadf56eb9a469c50748ad3a268f302", "score": "0.51533556", "text": "function createObjectForPinwheel(filteredData) {\t\n\t// create an object with the city names and ids segregated from the indicies for easy ploting\n\tvar rowOfData = {};\t\n\trowOfData.meta = [];\n\trowOfData.indicies = [];\t\n\t$.each(filteredData, function( i, d ) {\t\t\n\t\trowOfData.meta.push({ id: d.id, geoid: d.geoid, metro: d.metro, year: d.year, lat: d.lat, lon: d.lon, oned_index: d.oned_index });\n\t\trowOfData.indicies.push({ name: 'Economy Index', index: d.economy_index, angle: 247.5 });\n\t\trowOfData.indicies.push({ name: 'Education Index', index: d.education_index, angle: 292.5 });\n\t\trowOfData.indicies.push({ name: 'Equity Index', index: d.equity_index, angle: 337.5 });\n\t\trowOfData.indicies.push({ name: 'Quality of Life Index', index: d.quality_of_life_index, angle: 22.5 });\n\t\trowOfData.indicies.push({ name: 'Transit Index', index: d.transit_index, angle: 67.5 });\n\t});\n\t// return the selected row\n\treturn rowOfData;\n}", "title": "" }, { "docid": "a8c71ddf1a760b3832661fa6618218b3", "score": "0.5153187", "text": "getCurrentDataKongPo(state, payload) {\n let station = payload.station;\n let block = payload.block;\n let soilNitrogen = payload.soilNitrogen;\n let soilPhosphorus = payload.soilPhosphorus;\n let soilPotassium = payload.soilPotassium;\n let soilPH = payload.soilPH;\n let soilEC = payload.soilEC;\n let soilMS = payload.soilMS;\n state.stations[station].sensorSoil[block].sensorData[0].data = soilNitrogen;\n state.stations[station].sensorSoil[block].sensorData[1].data = soilPhosphorus;\n state.stations[station].sensorSoil[block].sensorData[2].data = soilPotassium;\n state.stations[station].sensorSoil[block].sensorData[3].data = soilPH;\n state.stations[station].sensorSoil[block].sensorData[4].data = soilEC;\n state.stations[station].sensorSoil[block].sensorData[5].data = soilMS;\n }", "title": "" }, { "docid": "dbed506380c626d3480b9eeca1339fb5", "score": "0.5151796", "text": "getCurrentDataTkpmPagoh(state, payload) {\n let station = payload.station;\n let block = payload.block;\n let soilPH = payload.soilPH;\n let soilEC = payload.soilEC;\n let soilMS = payload.soilMS;\n state.stations[station].sensorSoil[block].sensorData[0].data = soilPH;\n state.stations[station].sensorSoil[block].sensorData[1].data = soilEC;\n state.stations[station].sensorSoil[block].sensorData[2].data = soilMS;\n }", "title": "" } ]
b99d67be68be8d741726981d1a82f64a
caches labels for current feed
[ { "docid": "e50327487b1613257817e2e410943468", "score": "0.6952123", "text": "cache_labels( feed_id ) {\n // load new labels, if requested\n if (typeof(feed_id) != 'undefined') {\n feedit.callAPI(\n ajax_url_fetch_labels,\n {\n 'feed' : feed_id,\n },\n function( response ) {\n if (typeof(response) == 'object') {\n // remove all old labels and create new ones\n $filter_labels.find('ion-select-option').remove();\n var\n html = [],\n oldValue = $filter_labels.val(),\n have_options = false,\n current_feed_id = feedit.getActiveFeedId();\n\n for (var label of response) {\n have_options = true;\n html.push(`\n <ion-select-option value=\"${label.id}\">${label.name}</ion-select-option>`);\n }\n\n if (have_options) {\n $filter_labels.append(html.join(''));\n }\n\n // give the UI time to populate\n setTimeout(function() {\n if (have_options) {\n $filter_labels.val(oldValue);\n }\n\n cache_labels();\n\n // if there's at least a single label present and we're not in Bookmarks or Everything,\n // un-hide labels dropdown as well as all labels badges on page\n if ( have_options ) {\n $('#active_feed_title_header, #labels-select-badge').removeClass('ion-hide no-labels simple-mode-ignore');\n\n // only show multi-labels tab button if we're not showing Bookmarks or Everything\n if (feedit.getActiveFeedItem().hasClass('feed_item')) {\n $('#multi_labels').removeClass('ion-hide no-labels simple-mode-ignore');\n } else {\n $('#multi_labels').addClass('ion-hide');\n }\n\n // only show labels badge if we're not in simple mode\n if (!feedit.isSimpleMode()) {\n var classes_to_remove = 'ion-hide';\n\n // only remove simple-mode-ignore class if we're not in Bookmarks or Everything\n if (current_feed_id != 'bookmarks' && current_feed_id != 'all') {\n classes_to_remove += ' simple-mode-ignore';\n }\n\n $('ion-badge.labels').removeClass(classes_to_remove);\n } else if (current_feed_id != 'bookmarks' && current_feed_id != 'all') {\n // only remove the simple-mode-ignore class, so badges don't remain hidden upon leaving Simple Mode\n $('ion-badge.labels').removeClass('simple-mode-ignore');\n }\n } else {\n // on the contrary, if we don't have any labels (left), hide dropdown and label badges\n $('#labels-select-badge, ion-badge.labels, #multi_labels').addClass('ion-hide');\n $('#active_feed_title_header').addClass('no-labels');\n $('ion-badge.labels').addClass('simple-mode-ignore');\n }\n }, 100);\n } else {\n feedit.defaultErrorNotification();\n }\n }\n );\n } else {\n cache_labels();\n }\n\n }", "title": "" } ]
[ { "docid": "88013025c19cfa8cce21613bb3c89cd7", "score": "0.66496885", "text": "function handleExistingLabels() {\n setExistingLabels('')\n axios.get(`http://localhost:5000/labels/${store.getState().id}`).then((res) => {\n if (res.data != 'null') {\n const temp = JSON.parse(res.data).replace(/['\"]+/g, '').split(', ')\n setExistingLabels(temp)\n }\n })\n }", "title": "" }, { "docid": "ac76a829b113560beaa1c5920c070c87", "score": "0.64253473", "text": "function updateLabel() {\n // set the label to be chosen emoji\n this.marker.setLabel(image)\n //return the image var to empty so that next created marker does not have a label from start\n image = \"\";\n\n }", "title": "" }, { "docid": "181627235972672a7ba37bdb764828d8", "score": "0.6388275", "text": "function setLabels() {\n storeLabels.find({}).sort({ timestamp: 1 }).exec((err, entries) => {\n if (err) console.log(err)\n\n if (entries.length === 0) {\n console.log('No labels entries')\n } else {\n labels = entries\n }\n })\n}", "title": "" }, { "docid": "5cc47ff6eebca9d720c13ae538ab765e", "score": "0.6122544", "text": "function saveLabels(newLabels) {\n for (var i=0;i<newLabels.length;i++) {\n if (labels.hasOwnProperty(newLabels[i])) {\n labels[newLabels[i]].count++;\n } else {\n labels[newLabels[i]] = new Label(newLabels[i]);\n }\n }\n }", "title": "" }, { "docid": "0f907289c876ffc323faf94f483a29de", "score": "0.60344857", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, r(d.count) / 2) + \"px\"; })\n .style(\"width\", function(d) { return r(d.count) * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(2.5 * r(d.count), this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return d.count + (d.r > 60 ? \" mentions\" : \"\"); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "da583d9d3c4a71b19c97a553387c77dd", "score": "0.59965533", "text": "update_lbl() {\n if(this.m2m_attrs.lbl == undefined) this.m2m_attrs.lbl = [];\n this.m2m_attrs.lbl[0] = 'esi';\n // this.m2m_attrs.lbl[1] = JSON.stringify(['esi:sae', this.state(), this.esi_attrs.service_dir.generate_pairs()]);\n this.m2m_attrs.lbl[1] = JSON.stringify(['esi:sae', this.state(), this.services()]);\n // this.attrs.lbl[1] = ['esi:sae', this.state(), JSON.stringify(this.esi_attrs.service_dir.generate_pairs())];\n }", "title": "" }, { "docid": "512694673fd75926ca65f8dbdf95aaa0", "score": "0.5995129", "text": "function updateGraphLabels() {\n var res = [];\n for (var i = 0; i < dialogService.graphLabels.length; i++) {\n res[i] = dialogService.graphLabels[i] + \":00\";\n }\n $scope.labels = res;\n }", "title": "" }, { "docid": "d7e152a713d7190730417c8fd481c01b", "score": "0.5991867", "text": "function initLabels(){\n\t\t\tlabel = zoomContainer\n\t\t\t\t.append(\"svg\")\n\t\t\t\t.attr(\"class\", \"lables\")\n\t\t\t\t.selectAll(\".lables\")\n\t\t\t\t.data(nodes);\n\n\t\t\tcorrelationLabel = zoomContainer\n\t\t\t\t.append(\"svg\")\n\t\t\t\t.attr(\"class\", \"correlationLabel\")\n\t\t\t\t.selectAll(\".correlationLabel\")\n\t\t\t\t.data(links);\t\t\n\t\t}", "title": "" }, { "docid": "50422380aa2bf2d41939464b53055f38", "score": "0.5927509", "text": "function handleLabels(labels) {\n setLabels(JSON.stringify(labels))\n const temp = labels\n temp.map((label) => {\n if (existingLabels.includes(label.value) === false && JSON.stringify(label.value) !== 'None') {\n const data = {'labels': JSON.stringify(label.value)}\n axios.post(`http://localhost:5000/labels/${store.getState().id}`, data)\n setExistingLabels(existingLabels => [...existingLabels, label.value])\n }\n })\n }", "title": "" }, { "docid": "6f35aec8b211554144a6ec2133af881e", "score": "0.5910041", "text": "function initLabels() {\n checkLabelExists();\n\n var itemsToLabel = [AdsApp.adGroups(), AdsApp.shoppingAdGroups()];\n\n for (i = 0; i < itemsToLabel.length; i++) {\n var iterator = getSelector(itemsToLabel[i]).get();\n\n while (iterator.hasNext()) {\n iterator.next().applyLabel(LABEL_PROCESSING);\n }\n }\n}", "title": "" }, { "docid": "c7836cdc099b423cdf0b24d36ab4aa63", "score": "0.5878768", "text": "function clearAllLabels() {\n knnClassifier.clearAllLabels();\n updateCounts();\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "d3b368ae7a81153fa926eb84433dfa69", "score": "0.58764327", "text": "function updateLabels() {\n label = label.data(data.topics, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(8, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { return formatShortCount(d.parties[0].count) + \" - \" + formatShortCount(d.parties[1].count); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "4f47d70f25600575d68b81c6a0622782", "score": "0.58474135", "text": "function updateLabelMap(labelMap,label,added){labelMap[label]=labelMap[label]||0,labelMap[label]+=added?1:-1}", "title": "" }, { "docid": "df048c62b4609e53c5fa843060a3bd4c", "score": "0.583518", "text": "function clearAllLabels() {\n knnClassifier.clearAllLabels();\n updateCounts();\n}", "title": "" }, { "docid": "4c7ce236bb6611d48eabfd8207d08b44", "score": "0.58028245", "text": "function renderLabels() {\n var labelsList = document.getElementsByClassName('labels')[0];\n // clear labels list\n removeChildren(labelsList);\n // repopulate labels list\n var currentLabels = Object.keys(labels);\n for (var i=0; i<currentLabels.length; i++) {\n console.log(currentLabels[i]);\n renderLabel(currentLabels[i], labelsList);\n }\n }", "title": "" }, { "docid": "7e40c76b8ab98fc84c25ce79624562ed", "score": "0.5739035", "text": "function resetAllLabels(){\n\t\t\t\t$(\".label\").each(function(){\n\t\t\t\t\t$(this).css(\"background-color\", \"white\");\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "7e40c76b8ab98fc84c25ce79624562ed", "score": "0.5739035", "text": "function resetAllLabels(){\n\t\t\t\t$(\".label\").each(function(){\n\t\t\t\t\t$(this).css(\"background-color\", \"white\");\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "8c392b36c564783d88784e2c759d4344", "score": "0.5729473", "text": "function LabelManager() {\n\tthis.revalidate_track_cache();\n\tthis.revalidate_label_cache();\n\tthis.revalidate_urls_labels_cache();\n}", "title": "" }, { "docid": "fecd1076bdd43f106cea051e9bca8206", "score": "0.571857", "text": "function bindLabels(data) {\n $scope.livingLables = data.labels;\n }", "title": "" }, { "docid": "f8db434003e925dd95f7ac640087053c", "score": "0.57083666", "text": "function setLabels() {\n\t\t\t\t\tvar data = [{\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.GRN.LISTS.HEADER.TITLE_SUPPLIER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\tkey: \"title\",\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.GRN.LISTS.HEADER.TITLE_BUYER\"\n\t\t\t\t\t}];\n\n\t\t\t\t\tvm.labels = authorizedObjectsFilter.getAuthorizedObjectsAsAssociative(data, 'key', 'label');\n\t\t\t\t}", "title": "" }, { "docid": "5546413cdd2614f4264447d1c6b3979c", "score": "0.57080007", "text": "function handleLabelUpdate(newList) {\n setLabelList(newList);\n // console.log(newList); // Debugging\n }", "title": "" }, { "docid": "7a8b93d3c61431f39ede81632b38f451", "score": "0.56985605", "text": "function setLabels() {\n\t\t\t\t\tvar data = [{\n\t\t\t\t\t\trights: [\"User\"],\n\t\t\t\t\t\tkey: \"title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.RELATED.LISTS.HEADER.TITLE\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"invoice\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.RELATED.LISTS.HEADER.TYPE.SUPPLIER_INVOICE\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tkey: \"invoice\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.RELATED.LISTS.HEADER.TYPE.BUYER_INVOICE\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"order\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.RELATED.LISTS.HEADER.TYPE.SUPPLIER_ORDER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tkey: \"order\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.RELATED.LISTS.HEADER.TYPE.BUYER_ORDER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"User\"],\n\t\t\t\t\t\tkey: \"grn\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.RELATED.LISTS.HEADER.TYPE.GRN\"\n\t\t\t\t\t}];\n\n\t\t\t\t\ttranslator.whenReady().then(function () {\n\t\t\t\t\t\t_.each(data, function (item) {\n\t\t\t\t\t\t\titem.label = translator.instantTranslate(item.label);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tvm.labels = authorizedObjectsFilter.getAuthorizedObjectsAsAssociative(data, 'key', 'label');\n\t\t\t\t\t});\n\t\t\t\t}", "title": "" }, { "docid": "c239a1d27d8488a1a6b4ea219ac6762e", "score": "0.5686923", "text": "setAllLabels(label){\n this.panel.labelMessage.length = 0;\n for(var key in this.panel.platformChildren){\n this.panel.platformChildren[key].defect.name = label;\n if(this.panel.platformChildren[key].defect.value){\n this.panel.labelMessage.push(this.panel.platformChildren[key].name + \"-\" +\n this.panel.platformChildren[key].defect.name);\n }\n }\n ctrl.render();\n }", "title": "" }, { "docid": "500d3cb42d15198070261db18b555b3c", "score": "0.56852335", "text": "function setLabels() {\n var data = [{\n rights: [\"Supplier\"],\n key: \"titleEdit\",\n label: \"EINVOICING.PORTAL.INVOICES.EDITOR.EDIT.HEADER.TITLE_SUPPLIER\"\n }, {\n rights: [\"Buyer\"],\n key: \"titleEdit\",\n label: \"EINVOICING.PORTAL.INVOICES.EDITOR.EDIT.HEADER.TITLE_BUYER\"\n }, {\n rights: [\"Supplier\"],\n key: \"titleNew\",\n label: \"EINVOICING.PORTAL.INVOICES.EDITOR.NEW.HEADER.TITLE_SUPPLIER\"\n }, {\n rights: [\"Buyer\"],\n key: \"titleNew\",\n label: \"EINVOICING.PORTAL.INVOICES.EDITOR.NEW.HEADER.TITLE_BUYER\"\n }];\n\n vm.labels = authorizedObjectsFilter.getAuthorizedObjectsAsAssociative(data, 'key', 'label');\n\n if (vm.mode === 'edit') {\n vm.labels.title = vm.labels.titleEdit;\n } else {\n vm.labels.title = vm.labels.titleNew;\n }\n }", "title": "" }, { "docid": "116a71ee749f6c94578dce93cdae8192", "score": "0.56746435", "text": "function setLabels() {\n\t\t\t\t\tvar data = [{\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.LISTS.HEADER.TITLE_SUPPLIER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\tkey: \"title\",\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.LISTS.HEADER.TITLE_BUYER\"\n\t\t\t\t\t}];\n\n\t\t\t\t\tvm.labels = authorizedObjectsFilter.getAuthorizedObjectsAsAssociative(data, 'key', 'label');\n\t\t\t\t}", "title": "" }, { "docid": "f217f0f9715c512e797b28116ac536fe", "score": "0.56727576", "text": "function setLabels() {\n\t\t\t\t\tvar data = [{\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.INVOICES.LISTS.HEADER.TITLE_SUPPLIER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\tkey: \"title\",\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.INVOICES.LISTS.HEADER.TITLE_BUYER\"\n\t\t\t\t\t}];\n\n\t\t\t\t\tvm.labels = authorizedObjectsFilter.getAuthorizedObjectsAsAssociative(data, 'key', 'label');\n\t\t\t\t}", "title": "" }, { "docid": "62608ab2370dbcca5cbab8e1cff167a7", "score": "0.5664637", "text": "function populateDatumLabels () {\n const datumLabelsPlaceholders = document.getElementsByClassName('datum-labels');\n const datumLabels = activeObj.labels;\n for (let i = 0; i < datumLabelsPlaceholders.length; i++) {\n datumLabelsPlaceholders[i].innerHTML = datumLabels[i];\n }\n}", "title": "" }, { "docid": "e73cc917216e7e2955f6bdf19ce542e0", "score": "0.566132", "text": "function setLabels() {\n\t\t\t\t\tvar data = [{\n\t\t\t\t\t\trights: [\"User\"],\n\t\t\t\t\t\tkey: \"title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.AUDIT.LISTS.HEADER.TITLE\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"invoice\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.AUDIT.LISTS.HEADER.TYPE.SUPPLIER_INVOICE\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tkey: \"invoice\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.AUDIT.LISTS.HEADER.TYPE.BUYER_INVOICE\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"purchase order\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.AUDIT.LISTS.HEADER.TYPE.SUPPLIER_ORDER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tkey: \"purchase order\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.AUDIT.LISTS.HEADER.TYPE.BUYER_ORDER\"\n\t\t\t\t\t}];\n\n\t\t\t\t\ttranslator.whenReady().then(function () {\n\t\t\t\t\t\t_.each(data, function (item) {\n\t\t\t\t\t\t\titem.label = translator.instantTranslate(item.label);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tvm.labels = authorizedObjectsFilter.getAuthorizedObjectsAsAssociative(data, 'key', 'label');\n\t\t\t\t\t});\n\t\t\t\t}", "title": "" }, { "docid": "2bf062260739f0ad160d5b12cb18f986", "score": "0.56398475", "text": "function clearLabel(label) {\n knnClassifier.clearLabel(label);\n updateCounts();\n}", "title": "" }, { "docid": "76e13def8515fe947dda884634c03554", "score": "0.5636678", "text": "function setLabels() {\n\t\t\t\t\tvar data = [{\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.INVOICES.VIEWER.HEADER.TITLE_SUPPLIER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tkey: \"title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.INVOICES.VIEWER.HEADER.TITLE_BUYER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"audit_title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.INVOICES.VIEWER.HEADER.AUDIT_TITLE_SUPPLIER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tkey: \"audit_title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.INVOICES.VIEWER.HEADER.AUDIT_TITLE_BUYER\"\n\t\t\t\t\t}];\n\n\t\t\t\t\tvm.labels = authorizedObjectsFilter.getAuthorizedObjectsAsAssociative(data, 'key', 'label');\n\t\t\t\t}", "title": "" }, { "docid": "1dae81c3354cc3bc95d4c2a1420c3966", "score": "0.55873847", "text": "function removeAllLabels() {\n var _self = this;\n try {\n for (var counter = 0; counter < _self.plottedLabels.length; counter++) {\n _self.plottedLabels[counter].setMap(null);\n }\n _self.plottedLabels = [];\n _self.plottedLabelNames = [];\n } catch (error) {}\n }", "title": "" }, { "docid": "df8ac556244a251866cd7441a9b23ed4", "score": "0.5559046", "text": "function resetFeedState() {\n $feedSubmissions.text('');\n currentFeedOffset = 0;\n }", "title": "" }, { "docid": "2aa0db2b309657d2b15679582a0a9371", "score": "0.5544317", "text": "function loadLabels()\n {\n // Get DZ Label\n DZLabel = dymo.label.framework.openLabelXml(getDZLabelXml());\n\n // Get Address Label\n addressLabel = dymo.label.framework.openLabelXml(getAddressLabelXml());\n\n // Get Tap Label\n tapeLabel = dymo.label.framework.openLabelXml(getTapeLabelXml());\n }", "title": "" }, { "docid": "0faa57a7be255022652886ff3d479163", "score": "0.5502341", "text": "function getLabels()\n{\n\tif(!g_json_labels)\n\t{\n\t\tvar strUrl = JSON_API_URL;\n\t\tvar data = { method:\"Utils.getLabels\", language:\"en\"};\n\t\tpostData(strUrl, data, function(json)\n\t\t{\n\t\t\tg_json_labels = json;\n\t\t\t//alert(JSON.stringify(json).substring(0, 2500)); //Limit the string size\n\t\t}, error);\n\t}\n}", "title": "" }, { "docid": "9abb067a40ca16b04769e4588a634a30", "score": "0.5485886", "text": "updateLabel() {\n if (!this.label) {\n return null\n }\n const newLabel = dom.create(this.labelConfig)\n this.label.parentElement.replaceChild(newLabel, this.label)\n this.label = newLabel\n }", "title": "" }, { "docid": "43be015b3a250803ae77aaeaee000904", "score": "0.5480036", "text": "function updateLabels() {\n label = label.data(data.commonTags, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .attr(\"href\", function(d) { return \"#\" + d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n\n label\n .style(\"font-size\", function(d) { return Math.max(15, d.r / 2) + \"px\"; })\n .style(\"width\", function(d) { return d.r * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n label.append(\"span\")\n .text(function(d) { return d.name; })\n .each(function(d) { d.dx = Math.max(d.r * 2.5, this.getBoundingClientRect().width); })\n .remove();\n\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n .text(function(d) { \n if (d.taglists[0].count == 0){\n return d.taglists[1].count;\n } \n else if(d.taglists[1].count == 0){\n return d.taglists[0].count;\n } \n else{\n return d.taglists[0].count + \" - \" + d.taglists[1].count;\n } \n });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { d.dy = this.getBoundingClientRect().height; });\n}", "title": "" }, { "docid": "bce0bc399d4d236391f16733cccc9d2b", "score": "0.54792684", "text": "_updateLocalizedLabel() {\n this.__updatingLabelFromLocalize = true;\n this.label = localize.msg(`${this.tagName.toLowerCase()}:defaultLabel`);\n this._updateFeedbackComponent(); // new label means new feedback message\n this.__updatingLabelFromLocalize = false;\n }", "title": "" }, { "docid": "5914138d7ff4c09c90e39fdb629ff3ea", "score": "0.54658115", "text": "function bindLabels(data) {\n\n\n $scope.labelsLeave = data.labels;\n\n }", "title": "" }, { "docid": "5e13199898cc0dcff57cc15fc50cf57a", "score": "0.54607624", "text": "function drawLabels() {\n\t drawDataLabels();\n\t updateCompositeLabels();\n\t }", "title": "" }, { "docid": "05ab7efbc0abbc37819427fbd81f4653", "score": "0.5425983", "text": "function fixGmailLabels ()\n{\n GmailApp.markThreadsUnread( GmailApp.search( 'in:inbox is:unread' ) );\n GmailApp.moveThreadsToInbox( GmailApp.search('in:inbox') );\n}", "title": "" }, { "docid": "dda7fa0d316d8793dd02cc5e536ddd7e", "score": "0.540902", "text": "function defineLabel(){if(!labelOffsets){labelOffsets=[];}var label=nextLabelId;nextLabelId++;labelOffsets[label]=-1;return label;}", "title": "" }, { "docid": "767a4460c436826a9157beb6f9fa453a", "score": "0.5400813", "text": "updateLabelText() { }", "title": "" }, { "docid": "449902c4aa7c70c491bcb8390f129c11", "score": "0.53951484", "text": "createLabels(wekanLabels, board) {\n wekanLabels.forEach(label => {\n const color = label.color;\n const name = label.name;\n const existingLabel = board.getLabel(name, color);\n if (existingLabel) {\n this.labels[label.id] = existingLabel._id;\n } else {\n const idLabelCreated = board.pushLabel(name, color);\n this.labels[label.id] = idLabelCreated;\n }\n });\n }", "title": "" }, { "docid": "62cf7804c621fe066678535d47c7c1ad", "score": "0.53787875", "text": "function resetChart(chart){\n chart.data.labels = [];\n for (i = 0; i < chart.data.datasets.length; i++) { \n chart.data.datasets[i].data = [];\n }\n chart.update();\n}", "title": "" }, { "docid": "c322abb0820ee78bee147d9b6d900f20", "score": "0.5377847", "text": "function writeLabels() {\n let ch = JSON.parse(canvas.innerHTML.replace('<!-- ','').replace(' -->',''));\n labels = alphabet.slice(0,Object.keys(ch.data.labels).length);\n canvas.chart.data.labels = labels;\n canvas.chart.update();\n }", "title": "" }, { "docid": "eb9e28f63000b2dfab9cd3d076d872d2", "score": "0.53741693", "text": "function clearLabel(classLabel) {\n knnClassifier.clearLabel(classLabel);\n updateCounts();\n}", "title": "" }, { "docid": "431913c5c29ca0b9ff16ffbaf7759382", "score": "0.53711104", "text": "function addNewLabels() {\r\n var label;\r\n var labelDiv;\r\n\r\n for (var i = 0, len = _ticks.length; i < len; i++) {\r\n label = _ticks[i].label;\r\n if (label && !label.hasClass('cz-timescale-label')) {\r\n labelDiv = label[0];\r\n labelsDiv[0].appendChild(labelDiv);\r\n label.addClass('cz-timescale-label');\r\n label._size = {\r\n width: labelDiv.offsetWidth,\r\n height: labelDiv.offsetHeight\r\n };\r\n }\r\n }\r\n }", "title": "" }, { "docid": "c0f5370d39c89554fb67053db1df40d5", "score": "0.53616494", "text": "function updateCounts() {\n const counts = knnClassifier.getCountByLabel();\n\n for (let i = 0; i<myClassNames.length; i++) {\n myClasses[i].exampleCount.html(myClasses[i].name + \" examples: \" + counts[myClasses[i].name] || 0);\n } \n}", "title": "" }, { "docid": "e64cddd765ed71e06a9100cd55b28146", "score": "0.5359889", "text": "function update_labels(axis, clickText) {\n // Switch active to inactive with booleans\n d3.selectAll(\".aText\")\n .filter(\".\" + axis)\n .filter(\".active\")\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n \n // switch text selected by clicking to active\n clickText.classed(\"inactive\", false).classed(\"active\", true);\n }", "title": "" }, { "docid": "1b417998926121e2f968f5db1c2c686a", "score": "0.53436464", "text": "function deleteLabel() {\n console.log('Deleting label: [' + tagModel.currentCategory + ']');\n tagModel.deleteCategory();\n resize();\n $('#label-selected').remove();\n if (tagModel.currentDoc != null && tagModel.currentCategory !== null) {\n $('.label[value=\"' + tagModel.currentCategory + '\"]').attr('id', 'label-selected');\n }\n mostRecentIndex = -1;\n}", "title": "" }, { "docid": "7487ebea2e374d8f420a89e64fa52f6f", "score": "0.5339173", "text": "function updateCounts() {\n const counts = knnClassifier.getCountByLabel();\n\n select('#exampleA').html(counts['A'] || 0);\n select('#exampleB').html(counts['B'] || 0);\n}", "title": "" }, { "docid": "b7998021aefb7c0f4788c8fb6fa0380e", "score": "0.53391236", "text": "function updateLayerToLabel(item) {\n if(item.type === 'layer') {\n layerToLabel[item.ids[0]] = item.name;\n layerSeriesData[item.ids[0]] = [];\n } else {\n for(var idx in item.children) {\n updateLayerToLabel(item.children[idx]);\n }\n }\n }", "title": "" }, { "docid": "87169df3d8785a885e2e337ba47b6d1a", "score": "0.5339048", "text": "_updateLabels() {\n for(let key in this._items) {\n if(this._items.hasOwnProperty(key)) {\n const { navElt, li } = this._items[key];\n if(typeof navElt.label === 'function') {\n li.innerText = navElt.label.call(this);\n }\n }\n }\n }", "title": "" }, { "docid": "a2e3fc25611aebd2a073257334867e71", "score": "0.53363746", "text": "function bindLabels(data) {\n $scope.vaccinationLables = data.labels;\n }", "title": "" }, { "docid": "33897ea59ddc0be9591c4c4bdf1d9e44", "score": "0.52885336", "text": "function updateChart(label, dataset, metricsChart){\n metricsChart.data.labels.push((label+1));\n metricsChart.data.datasets[0].data.push(dataset);\n metricsChart.update();\n}", "title": "" }, { "docid": "9221a5dac9231f6690bbc84074e7b2b0", "score": "0.52819884", "text": "function setLabels(){\n catVal = $('#catChild').val();\n if(!catVal){\n catVal = $('#catMain').val();\n }\n common_labels = {\n 0: 'Частное',\n 1: 'Коммерческое'\n };\n job_labels = {\n 0: 'Резюме',\n 1: 'Вакансия'\n };\n if(typeof job_ids != 'undefined'){\n if(catVal in job_ids){\n $('#eventPriceLabel').text('Ставка');\n $('#eventChangeLabel').hide();\n $('#eventFreeLabel').hide();\n $('#jobType').show();\n $('#eventType option').each(function(){\n $(this).text( job_labels[ $(this).val() ] );\n });\n $('#eventType').trigger('refresh');\n }\n else{\n $('#eventPriceLabel').text('Цена');\n $('#eventChangeLabel').show();\n $('#eventFreeLabel').show();\n $('#jobType').hide();\n $('#eventType option').each(function(){\n $(this).text( common_labels[ $(this).val() ] );\n });\n $('#eventType').trigger('refresh');\n }\n }\n }", "title": "" }, { "docid": "db9d7b036781f962563d3555b98ad572", "score": "0.52781254", "text": "function clearLabels() {\n const $labelOutput = $('#labelOutput');\n $labelOutput.html('&nbsp');\n const $fInput = $('#fInput');\n $fInput.val('');\n}", "title": "" }, { "docid": "85c6ca8f621e246183818dfaaab46514", "score": "0.52775294", "text": "function setLabels () \n{\n\tRMPApplication.debug(\"begin setLabels\");\n\tc_debug(debug.chart, \"=> setLabels\"); \n\t$(\"#id_spinner_search\").show();\n\n\t// hide actual & previous period during definitions\n\tid_currMonth.hide();\n\tid_prevMonth.hide();\n\tid_currQuart.hide();\n\tid_prevQuart.hide();\n\tid_currExercise.hide();\n\tid_prevExercise.hide();\n\n\t// Definition of content labels\n\tvar curr_month = getLongMonth(Date.now());\n\tvar prev_month = getPrevLongMonth(Date.now());\n\tvar curr_quarter = getCurrentQuarter();\n\tvar prev_quarter = getPreviousQuarter();\n\tvar curr_year = getCurrentYear();\n\tvar prev_year = getPreviousYear(); \n\tvar next_year = getNextYear();\n\tvar today = new Date();\n\tvar num_curr_month = getNumberMonth(today);\n\n\tvar month_text = ${P_quoted(i18n('month_period_text', 'Mois'))};\n\tvar quarter_text = ${P_quoted(i18n('quarter_period_text', 'Q'))};\n\tvar year_text = ${P_quoted(i18n('year_period_text', 'Exercice'))};\n\n\tid_currMonth.append(month_text + ': ' + curr_month);\n\tid_prevMonth.append(month_text + ': ' + prev_month);\n\tid_currQuart.append(quarter_text + curr_quarter.num + ' - ' + curr_quarter.year);\n\tid_prevQuart.append(quarter_text + prev_quarter.num + ' - ' + prev_quarter.year);\n\n\tif (FIRSTMONTHOFEXERCISE == \"01\") {\n\t\tid_currExercise.append(year_text + ': ' + curr_year);\n\t\tid_prevExercise.append(year_text + ': ' + prev_year);\t\t\t\n\t} else {\n\t\tif (num_curr_month < FIRSTMONTHOFEXERCISE) {\n\t\t\tprev_year -= 1;\n\t\t\tcurr_year -= 1;\n\t\t\tnext_year -= 1;\n\t\t}\n\t\tid_currExercise.append(year_text + ': ' + curr_year + ' / ' + next_year);\n\t\tid_prevExercise.append(year_text + ': ' + prev_year + ' / ' + curr_year);\n\t}\n\tRMPApplication.debug(\"end setLabels\");\n}", "title": "" }, { "docid": "c0793d303403492f2d7044fcefc63758", "score": "0.5228904", "text": "drawLabels() {\n this.base.append('text')\n .text((d, i) => { return this.pfBar.chart.data.labels[i]; })\n .attr('height', this.pfBar.barThickness)\n .attr('transform', 'translate(60,0)')\n .attr('x', (d, i) => { return this.barX(i) + '%'; })\n .attr('y', this.pfBar.chartHeight - this.pfBar.labelHeight/2)\n .attr('fill', this.pfBar.labelColor);\n }", "title": "" }, { "docid": "36fa4399742baa298a095c8746e0afaa", "score": "0.5223179", "text": "function updateSearchLabels(id,name,type){ \n labels.push({\n 'id' : id,\n 'label' : name, \n 'desc': type\n });\n}", "title": "" }, { "docid": "36fa4399742baa298a095c8746e0afaa", "score": "0.5223179", "text": "function updateSearchLabels(id,name,type){ \n labels.push({\n 'id' : id,\n 'label' : name, \n 'desc': type\n });\n}", "title": "" }, { "docid": "4274fb724a4044a4918f908c7d5563e0", "score": "0.5216338", "text": "function setLabels() {\n\t\t\t\tvar data = [{\n\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\tkey: \"orders\",\n\t\t\t\t\tlabel: \"EINVOICING.COMPONENTS.NAVIGATION.ORDERS_SUPPLIER\"\n\t\t\t\t}, {\n\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\tkey: \"orders\",\n\t\t\t\t\tlabel: \"EINVOICING.COMPONENTS.NAVIGATION.ORDERS_BUYER\"\n\t\t\t\t}, {\n\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\tkey: \"newOrder\",\n\t\t\t\t\tlabel: \"EINVOICING.COMPONENTS.NAVIGATION.ORDER_SUPPLIER\"\n\t\t\t\t}, {\n\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\tkey: \"newOrder\",\n\t\t\t\t\tlabel: \"EINVOICING.COMPONENTS.NAVIGATION.ORDER_BUYER\"\n\t\t\t\t}, {\n\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\tkey: \"invoices\",\n\t\t\t\t\tlabel: \"EINVOICING.COMPONENTS.NAVIGATION.INVOICES_SUPPLIER\"\n\t\t\t\t}, {\n\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\tkey: \"invoices\",\n\t\t\t\t\tlabel: \"EINVOICING.COMPONENTS.NAVIGATION.INVOICES_BUYER\"\n\t\t\t\t}, {\n\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\tkey: \"newInvoice\",\n\t\t\t\t\tlabel: \"EINVOICING.COMPONENTS.NAVIGATION.INVOICE_SUPPLIER\"\n\t\t\t\t}, {\n\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\tkey: \"newInvoice\",\n\t\t\t\t\tlabel: \"EINVOICING.COMPONENTS.NAVIGATION.INVOICE_BUYER\"\n\t\t\t\t}, {\n\t\t\t\t\trights: [\"Supervisor\"],\n\t\t\t\t\tkey: \"users\",\n\t\t\t\t\tlabel: \"EINVOICING.COMPONENTS.NAVIGATION.USERS\"\n\t\t\t\t}, {\n\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\tkey: \"partyManagement\",\n\t\t\t\t\tlabel: \"EINVOICING.COMPONENTS.NAVIGATION.BUYERS\"\n\t\t\t\t}, {\n\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\tkey: \"partyManagement\",\n\t\t\t\t\tlabel: \"EINVOICING.COMPONENTS.NAVIGATION.SUPPLIERS\"\n\t\t\t\t}, {\n\t\t\t\t\trights: [\"Supplier\", \"Buyer\"],\n\t\t\t\t\tkey: \"myPartyManagement\",\n\t\t\t\t\tlabel: \"EINVOICING.COMPONENTS.NAVIGATION.PARTY_MANAGEMENT\"\n\t\t\t\t}];\n\n\t\t\t\tvm.labels = authorizedObjectsFilter.getAuthorizedObjectsAsAssociative(data, 'key', 'label');\n\t\t\t\tvm.canManageUsers = util.isDefined(vm.labels.users);\n\t\t\t\tvm.canCreateDocuments = userRightsRepository.userHasRight('Supplier') && userRightsRepository.userHasRight('InvoiceWriter') && userRightsRepository.userHasRight('InvoiceCreator');\n\n\t\t\t\tpartyFeatureEnabledService.getPartyFeatureEnabled(1).then(function (result) {\n\t\t\t\t\tvm.canAccessIntegrator = result;\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "c2ba2bdbeaaaeceb2a3714f9a6732e81", "score": "0.5215962", "text": "function updateLabel(n) {\n n = n || label._node;\n label.style.color = n._style;\n label.innerHTML = n.fullName;\n label._node = n;\n }", "title": "" }, { "docid": "068226b92aea0ff074503f524b546d12", "score": "0.52027196", "text": "function resetState(){\n gState = {\n currMemeUrl: '',\n labels: {\n 'top': {\n x: 284,\n y: 50,\n text: '',\n textAlignment: 'center',\n fontFamily: 'Lato',\n textFontSize: 60,\n textColor: '#fff',\n textShadow: false\n },\n 'bottom':{\n x: 284,\n y: 320,\n text: '',\n textAlignment: 'center',\n fontFamily: 'Lato',\n textFontSize: 60,\n textColor: '#fff',\n textShadow: false\n }\n }\n };\n}", "title": "" }, { "docid": "94b4657550b18a1d7d3ba0d2dab99724", "score": "0.51825273", "text": "function updateLabels() {\n label = label.data(data, function(d) { return d.name; });\n\n label.exit().remove();\n\n var labelEnter = label.enter().append(\"a\")\n .attr(\"class\", \"g-label\")\n .call(force.drag);\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-name\")\n .text(function(d) { return d.name; });\n\n labelEnter.append(\"div\")\n .attr(\"class\", \"g-value\");\n \n // top label\n label\n .style(\"font-size\", function(d) { \n\t\tvar Size = Math.max(8, r(d.count) / 2) + \"px\"; \n\t\treturn Size})\n\t .style(\"color\",topColor)\n .style(\"width\", function(d) { return r(d.count) * 2.5 + \"px\"; });\n\n // Create a temporary span to compute the true text width.\n // https://developer.mozilla.org/en-US/docs/Web/API/Element.getBoundingClientRect\n label.append(\"span\")\n .text(function(d) { return d.name; })\n\t .each(function(d) { d.dx = Math.max(2.5 * r(d.count), this.getBoundingClientRect().width); })\n .remove();\n\n // bottom label\n label\n .style(\"width\", function(d) { return d.dx + \"px\"; })\n .select(\".g-value\")\n\t .style(\"color\",bottomColor)\n .text(function(d) { return d.count + (d.r > 60 ? \" hits\" : \"\"); });\n\n // Compute the height of labels when wrapped.\n label.each(function(d) { \n var Height = this.getBoundingClientRect().height;\n d.dy = Height });\n}", "title": "" }, { "docid": "751c77f698966fdfd57bad21e2339806", "score": "0.5178771", "text": "function updatePreview() {\n if (!label)\n return;\n\n var pngData = label.render();\n var labelImage = document.getElementById('labelImage');\n labelImage.src = \"data:image/png;base64,\" + pngData;\n }", "title": "" }, { "docid": "f169213c89fd74c0a373ebe7718d60cf", "score": "0.5171069", "text": "function setLabels() {\n\t\t\t\t\tvar data = [{\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.VIEWER.VIEW.HEADER.TITLE_SUPPLIER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tkey: \"title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.VIEWER.VIEW.HEADER.TITLE_BUYER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"orderNumber\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.VIEWER.COMPONENTS.DETAILS.PURCHASE_ORDER_NUMBER_SUPPLIER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tkey: \"orderNumber\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.VIEWER.COMPONENTS.DETAILS.PURCHASE_ORDER_NUMBER_BUYER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"detailsHeading\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.VIEWER.COMPONENTS.DETAILS.HEADING_SUPPLIER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tkey: \"detailsHeading\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.VIEWER.COMPONENTS.DETAILS.HEADING_BUYER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"notLoaded\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.VIEWER.COULD_NOT_LOAD_PURCHASE_ORDER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tkey: \"notLoaded\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.VIEWER.COULD_NOT_LOAD_SALES_ORDER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"PurchaseOrderFlipper\"],\n\t\t\t\t\t\tkey: \"flipOrder\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.VIEWER.ACTIONS.FLIP_ORDER_BUYER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Supplier\"],\n\t\t\t\t\t\tkey: \"audit_title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.VIEWER.VIEW.HEADER.AUDIT_TITLE_SUPPLIER\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\trights: [\"Buyer\"],\n\t\t\t\t\t\tkey: \"audit_title\",\n\t\t\t\t\t\tlabel: \"EINVOICING.PORTAL.PURCHASE_ORDERS.VIEWER.VIEW.HEADER.AUDIT_TITLE_BUYER\"\n\t\t\t\t\t}];\n\n\t\t\t\t\tvm.labels = authorizedObjectsFilter.getAuthorizedObjectsAsAssociative(data, 'key', 'label');\n\t\t\t\t}", "title": "" }, { "docid": "b05fb67ba08cf284027233c67e7a21b3", "score": "0.51658875", "text": "function changeLabel(choice) {\r\n //Based on a int in the label's id, make one label white (or grey) and make the other transparent\r\n\r\n //Change the old label to be invisible, show the new one\r\n currentLabel = choice;\r\n\r\n //Clear the paper glyph and recalculate the lines\r\n $(svgContainers[0].node()).empty();\r\n paperGlyphLines = [];\r\n lineColors = [];\r\n drawFirstColumn(110, (100 / currIncrement) * 16, 80, svgContainers[0], 100 / currIncrement);\r\n for (var i = 0; i < years.length; i++) {\r\n if (filteredYearCounts[years[i]['articleyear']] != undefined) {\r\n $(svgContainers[i + 1].node()).empty();\r\n drawColumn(years[i]['articleyear'], 80, 64, currBoxHeight, svgContainers[i + 1], filteredYearPercents[years[i]['articleyear']][currentLabel], filteredYearCounts[years[i]['articleyear']][currentLabel]);\r\n }\r\n }\r\n\r\n //Change the active label\r\n for (var i = 0; i < maxLabels; i++) {\r\n if (i != currentLabel) {\r\n d3.select(\"#changeLabelItem\" + i.toString()).classed('active', false);\r\n } else {\r\n d3.select(\"#changeLabelItem\" + i.toString()).classed('active', true);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "8590843855b077b1f950f3181864947f", "score": "0.51570576", "text": "refreshLabel() {\n const _elemId = this._getMarkupElemIdPart('label', 'HView#refreshLabel');\n if (this.isNumber(_elemId)) {\n ELEM.setHTML(_elemId, this.label);\n }\n return this;\n }", "title": "" }, { "docid": "199e26608da49fbaa2b9b419d5a4aab9", "score": "0.5154845", "text": "function clearLabels() {\n let labels = document.getElementsByClassName('value-label');\n for( let i = 0; i < labels.length; i++) {\n labels[i].innerHTML = '';\n }\n}", "title": "" }, { "docid": "9cb94924127d039d2aa3b558cb19becc", "score": "0.5146545", "text": "get label() { return this._label }", "title": "" }, { "docid": "37b019a935b3dd9c581384a56d35219a", "score": "0.514438", "text": "constructor(label) {\n this.label = label;\n this.wasVisited = false;\n }", "title": "" }, { "docid": "120525b17a2aec5ae045069e8b8522d1", "score": "0.5131334", "text": "function updateLabels()\n {\n label_currentMoneySum.setText(\"$\" + Math.floor(currentMoneySum));\n if(upgrade_rateValues[0] < 100) { label_moneyRate.setText(\"at $\" + upgrade_rateValues[0].toFixed(2) + \" per sec\");}\n else { label_moneyRate.setText(\"at $\" + Math.floor(upgrade_rateValues[0]) + \" per sec\");}\n }", "title": "" }, { "docid": "014c6cb4bc140525605be328bbd9b1e1", "score": "0.5119208", "text": "function idleFeedBack() {\n label = $(\"#apply label\");\n label.toggleClass(\"glyphicon-refresh\");\n label.toggleClass(\"glyphicon-refresh-animate\");\n label.toggleClass(\"glyphicon-play\");\n $(\"#apply\").prop(\"disabled\", false);\n }", "title": "" }, { "docid": "af2cdedbfa7fc39747fdf562426b53a8", "score": "0.5117753", "text": "function refresh_labels_in_play_bot_from() {\n var $select = $('#play_bot_from');\n looper(PLAY_BOT_FROM_STUFF, function (_, stuff) {\n var $option = $select.find('[value=' + $.escapeSelector(stuff.option_value) + ']');\n var cat = lex.cats.by_name[stuff.option_value];\n var num_cont = cat.num_conts;\n var formatted_label = f(stuff.label, {number: num_cont});\n // console.debug(stuff.option_value, formatted_label, cat_idn, num_cont);\n // EXAMPLE: my from my playlist (76) 735 76\n $option.text(formatted_label);\n });\n }", "title": "" } ]
ad4302545d4b5a71a80ceece8e19ae39
geofencing and route handling feature for pop up map
[ { "docid": "a9742b965ce79f1561ad369d2738ed6b", "score": "0.0", "text": "function showCoordinateInterface(param_1)\n{\n ///////////for visibility of map in the hidden div pop /////////////////\n document.getElementById(\"blackout\").style.visibility = \"visible\";\n document.getElementById(\"divpopup\").style.visibility = \"visible\";\n document.getElementById(\"blackout\").style.display = \"block\";\n document.getElementById(\"divpopup\").style.display = \"block\"; \n ///////////////////////////////////////////////////////////////////////////\n \n common_event=param_1; \n //alert(common_event);\n //alert(common_event);\n if(common_event==\"landmark\") ////////only for landmark\n {\n manage_landmark(common_event); \n }\n else if( (common_event==\"landmark1\") || (common_event==\"landmark2\") ) ////////only for landmark\n {\n manage_landmark_trip(common_event); \n }\n else if(common_event==\"location\")\n {\n manage_location(common_event);\n }\n //for making polyline\n else if(common_event==\"polyline\")\n {\n //document.getElementById(\"close_geo_route_coord\").value = document.getElementById(\"polyline_coord\").value; // kept last geo coord details for closing pop up div\n refreshIntervalId = setInterval(keep_alive,8400000); //My session expires at 140 minutes\n manage_draw_polyline_route();\n }\n else///////for geofencing and route both ////////////\n { \t \n if(common_event==\"geofencing\")\n {\n document.getElementById(\"close_geo_route_coord\").value = document.getElementById(\"geo_coord\").value; // kept last geo coord details for closing pop up div \n } \n else if(common_event==\"sector\")\n {\n document.getElementById(\"close_geo_route_coord\").value = document.getElementById(\"sector_coord\").value; // kept last geo coord details for closing pop up div\n } \n\n refreshIntervalId = setInterval(keep_alive,840000); //My session expires at 15 minutes\n manage_draw_geofencing_route();\n } \n}", "title": "" } ]
[ { "docid": "4c821de0764aba4a481cc656cf86d554", "score": "0.682776", "text": "onMapClick() {\n this.map.on('click', (e) => {\n this.map.featuresAt(\n e.point,\n { layer: 'zones-geometry-good', radius: 1, includeGeometry: true },\n (err, features) => {\n if (err) throw err;\n const coords = { lat: e.lngLat.lat.toFixed(5), long: e.lngLat.lng.toFixed(5) };\n let zoneId = null;\n if (features.length) {\n zoneId = features[0].properties.ID;\n }\n // change route and componentWillReceiveProps will call this.handleMarkerPlacement()\n this.context.router.push({\n pathname: `/map/mini/${coords.lat}/${coords.long}/${zoneId}`,\n search: this.props.location.search\n });\n }\n );\n });\n }", "title": "" }, { "docid": "272f9e820dbf6c12c0efea1f5479d69a", "score": "0.6732416", "text": "function generatePreviewRoute() {\n\n \n var vectorS = new ol.source.Vector();\n var routeLineStyle = new ol.style.Style({\n stroke: new ol.style.Stroke({\n color: 'rgb(255,0,0)',\n width: 5\n }),\n fill: new ol.style.Fill({\n color: 'rgba(255,0,0,.03)'\n })\n });\n var countLoggedWaypoints = 0;\n $.each(waypoints, function(index, value){\n if(value !== \"\"){\n countLoggedWaypoints++;\n }\n });\n // We give adjust the view so the route is not under the result list\n paddingRight = 0;\n if(parseInt( $(document).outerWidth()) > 768 && $(\"#results\").attr(\"data-status\") === \"out\" ){\n paddingRight = $(\"#search-addon\").outerWidth();\n }\n if (countLoggedWaypoints < 2 ) {\n if(countLoggedWaypoints === 1){\n // Let's Zoom into this point\n var point = null;\n $.each(waypoints, function(index, value){\n if(value !== \"\"){\n point = value;\n return false;\n }\n });\n if(point === \"gps\"){\n point = gpsLocation;\n }\n point = ol.proj.transform(point, 'EPSG:4326', 'EPSG:3857');\n map.getView().animate({\n center: point,\n zoom: 15,\n duration: 1500,\n padding: [5, paddingRight, 5, 5]\n });\n }\n return;\n } else {\n var points = \"\";\n $.each(waypoints, function(index, value) {\n if (value === '' || typeof value[0] === \"undefined\") {\n return;\n } else {\n if (value === 'gps') {\n points += gpsLocation.toString() + \";\";\n } else {\n points += value.toString() + \";\";\n }\n }\n });\n points = points.replace(/;+$/, '');\n // At this Point we can only Route between 2 Points so we have all the Information needed\n var url = '/route/preview/' + vehicle + '/' + points;\n // The Rest will be handled Asynchronious\n $.get(url, function(data) {\n var geojson = data[\"geojson\"];\n var duration = data[\"duration\"];\n var distance = data[\"distance\"];\n\n $(\"#route-information #length\").html(parseDistance(distance));\n $(\"#route-information #duration\").html(parseDuration(duration));\n\n var geom = (new ol.format.GeoJSON()).readGeometry(geojson, {\n 'dataProjection': 'EPSG:4326',\n 'featureProjection': 'EPSG:3857'\n });\n var feature = new ol.Feature({\n 'geometry': geom\n });\n feature.setStyle(routeLineStyle);\n vectorS.addFeature(feature);\n map.removeLayer(vectorLayerRoutePreview);\n vectorLayerRoutePreview = null;\n vectorLayerRoutePreview = new ol.layer.Vector({\n source: vectorS\n });\n \n map.addLayer(vectorLayerRoutePreview);\n\n if(autoChooseVehicle){\n // We change the vehicle to the probably best fitting\n var prevVehicle = vehicle;\n if(distance < 2000){\n vehicle = \"foot\";\n }else if(distance < 10000){\n vehicle = \"bicycle\";\n }else{\n vehicle = \"car\";\n }\n if(prevVehicle !== vehicle){\n refreshUrl();\n }\n }\n\n map.getView().fit(geom, {\n duration: 1500,\n padding: [5, (paddingRight + 20), 5, 6],\n maxZoom: 18,\n });\n });\n }\n\n \n}", "title": "" }, { "docid": "4200b1f14d07368b272ae78e74542fa3", "score": "0.667747", "text": "function initMap() {\n var area = new google.maps.LatLng(lat , lng );\n\n map = new google.maps.Map(document.getElementById('map'), {\n center: area,\n zoom: 13,\n\n styles: [\n { elementType: \"geometry\", stylers: [{ color: \"#242f3e\" }] },\n { elementType: \"labels.text.stroke\", stylers: [{ color: \"#242f3e\" }] },\n { elementType: \"labels.text.fill\", stylers: [{ color: \"#746855\" }] },\n {\n featureType: \"administrative.locality\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#d59563\" }],\n },\n {\n featureType: \"poi\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#d59563\" }],\n },\n {\n featureType: \"poi.park\",\n elementType: \"geometry\",\n stylers: [{ color: \"#263c3f\" }],\n },\n {\n featureType: \"poi.park\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#6b9a76\" }],\n },\n {\n featureType: \"road\",\n elementType: \"geometry\",\n stylers: [{ color: \"#38414e\" }],\n },\n {\n featureType: \"road\",\n elementType: \"geometry.stroke\",\n stylers: [{ color: \"#212a37\" }],\n },\n {\n featureType: \"road\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#9ca5b3\" }],\n },\n {\n featureType: \"road.highway\",\n elementType: \"geometry\",\n stylers: [{ color: \"#746855\" }],\n },\n {\n featureType: \"road.highway\",\n elementType: \"geometry.stroke\",\n stylers: [{ color: \"#1f2835\" }],\n },\n {\n featureType: \"road.highway\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#f3d19c\" }],\n },\n {\n featureType: \"transit\",\n elementType: \"geometry\",\n stylers: [{ color: \"#2f3948\" }],\n },\n {\n featureType: \"transit.station\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#d59563\" }],\n },\n {\n featureType: \"water\",\n elementType: \"geometry\",\n stylers: [{ color: \"#17263c\" }],\n },\n {\n featureType: \"water\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#515c6d\" }],\n },\n {\n featureType: \"water\",\n elementType: \"labels.text.stroke\",\n stylers: [{ color: \"#17263c\" }],\n },\n ],\n\n\n });\n\n var request = {\n location: area,\n radius: '10000',\n \n type: 'gym',\n openNow:true\n };\nservice = new google.maps.places.PlacesService(map);\nservice.nearbySearch(request, callback);\n }", "title": "" }, { "docid": "854f121484159dafac0714cb73bff733", "score": "0.6658562", "text": "function ShowAttributes(event) {\n var floor = getVisibleFloor();\n floor = floor + \" Selection\";\n var features = map.queryRenderedFeatures(event.point, { layers: [floor] });\n\n if (features.length) {\n map.flyTo({center: polylabel(features[0].geometry.coordinates, 1.0)});\n var $myTime = ConvertTimeformat(\"24\", $('#timepicker1').val());\n var $roomsWUntilObj;\n $.get(\"FreeRoomUntil/\" + features[0].properties.Room + \"/\" + \"Today\" + \"/\" + $myTime, function(result) {\n var $roomAvail;\n $roomsWUntilObj = JSON.parse(result)[0].AvailUntil;\n if($roomsWUntilObj != null){\n $roomAvail = \"Room available until \" + $roomsWUntilObj;\n }\n else {\n $roomAvail = \"Room Available rest of day\";\n }\n\n var popup = new mapboxgl.Popup({ offset: [0, -15] })\n .setLngLat(polylabel(features[0].geometry.coordinates, 1.0))\n .setHTML('<p>' + features[0].properties.Room + '</p>' +\n '<p>' + $roomAvail + '</p>' +\n '<p><a href=\"' + '/RoomSchedule/' + features[0].properties.Room +\n '\">Schedule</a></p>')\n //.setLngLat(feature.geometry.coordinates)\n .addTo(map);\n });\n\n // Get coordinates from the symbol and center the map on those coordinates\n //alert(features[0].geometry.coordinates);\n\n //alert(polylabel(features[0].geometry.coordinates, 1.0));\n\n }\n\n }", "title": "" }, { "docid": "fde59dd9ae1d3b674bd3efc902582ded", "score": "0.6654223", "text": "function createMap(){\n\n\n//create the map\n\nvar map = L.map('mapid', {\n\ncenter: [20, 0],\n\nzoom: 2,\n\nmaxBounds:[\n\n[70, 176],\n\n[-48, -130]\n\n],\n\n});\n\n\n//create the layers to make the maps\n\nL.tileLayer('http://korona.geog.uni-heidelberg.de/tiles/roadsg/x={x}&y={y}&z={z}', {\n\nmaxZoom: 19,\n\nattribution: 'Imagery from <a href=\"http://giscience.uni-hd.de/\">GIScience Research Group @ University of Heidelberg</a> &mdash; Map data &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>; <a href=\"http://biodiversitymapping.org/wordpress/index.php/home/\">Biodiversity Mapping</a>'\n\n}).addTo(map);\n\n\n\n//call getData function\n\ngetData(map);\n\n\n\nvar geojson;\n\n\n//function to retreve data\n\nfunction getData(map){\n\n//load the data\n\n$.ajax(\"data/hotspotData.geojson\", {\n\ndataType: \"json\",\n\nsuccess: function(response){\n\n\n//create a Leaflet GeoJSON layer and add it to the map\n\ngeojson = L.geoJson(response, {\n\n\nstyle: function (feature) {\n\nif(feature.properties.TYPE === 'hotspot_area'){\n\nreturn {color: '#de2d26' ,\n\nweight: 2,\n\nstroke: 1};\n\n} else if(feature.properties.TYPE === 'outer_limit'){\n\nreturn { color: '#fc9272',\n\nweight: 2,\n\nstroke: 0,\n\nfillOpacity: .5 };\n\n}\n\n},\n\n\nonEachFeature: function (feature, layer) {\n\nvar popupContent = \"\";\n\nif (feature.properties) {\n\n//loop to add feature property names and values to html string\n\n\npopupContent += \"<p>\" + \"Region\" + \": \" + feature.properties.NAME + \"</p>\";\n\nif (feature.properties.TYPE ===\"hotspot_area\"){\n\npopupContent += \"<p>\" + \"Type: \" + \"Hotspot\" + \"</p>\";\n\n}\n\n\nif (feature.properties.TYPE ===\"outer_limit\"){\n\npopupContent += \"<p>\" + \"Type: \" + \"Hotspot Outer Limit\" + \"</p>\";\n\n}\n\n\nlayer.bindPopup(popupContent);\n\n};\n\n\nlayer.on({\n\nmouseover: highlightFeature,\n\nmouseout: resetHighlight,\n\nclick: panelInfo,\n\nclick: zoomToFeature\n\n});\n\n\n\n\n\n}\n\n\n\n}).addTo(map);\n\n\n//create option to have no biodiversity overlay\n\nvar noneUrl = 'img/.jpg',\n\nnoneBounds = [];\n\nvar none = L.imageOverlay(noneUrl, noneBounds);\n\n\nvar amphibianUrl = 'img/amphibian_richness_10km_all.png',\n\namphibianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar amphibians = L.imageOverlay(amphibianUrl, amphibianBounds);\n\n\nvar caecilianUrl = 'img/caecilian_richness_10km.png',\n\ncaecilianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar caecilians = L.imageOverlay(caecilianUrl, caecilianBounds);\n\n\nvar anuraUrl = 'img/frog_richness_10km.png',\n\nanuraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar anura = L.imageOverlay(anuraUrl, anuraBounds);\n\n\nvar caudataUrl = 'img/salamander_richness_10km.png',\n\ncaudataBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar caudata = L.imageOverlay(caudataUrl, caudataBounds);\n\n\nvar psittaciformesUrl = 'img/psittaciformes_richness.png',\n\npsittaciformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar psittaciformes = L.imageOverlay(psittaciformesUrl, psittaciformesBounds);\n\n\nvar passeriformesUrl = 'img/passeriformes_richness.png',\n\npasseriformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar passeriformes = L.imageOverlay(passeriformesUrl, passeriformesBounds)\n\n\nvar songbirdsUrl = 'img/songbirds_richness.png',\n\nsongbirdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar songbirds = L.imageOverlay(songbirdsUrl, songbirdsBounds);\n\n\n\n//category names for toggle layers\n\nvar animals = {\n\n\"Overlays Off\": none,\n\n\"All Amphibians\": amphibians,\n\n\"Caecilian\": caecilians,\n\n\"Anura\": anura,\n\n\"Caudata\": caudata,\n\n\"Psittaciformes\": psittaciformes,\n\n\"Passeriformes\": passeriformes,\n\n\"Songbirds\": songbirds\n\n};\n\n\n//\n\nvar overlay = {\n\n\"Hotspots\" : geojson\n\n};\n\n\n//add heatmaps and hotspot to map\n\nL.control.layers(animals, overlay).addTo(map);\n\n\n}\n\n});\n\n};\n\n\n\nfunction panelInfo (e) {\n\nvar layer = e.target;\n\n\n$(\"#panel\").html(layer.feature.properties.NAME);\n\n\n};\n\n\n\nfunction highlightFeature(e) {\n\nvar layer = e.target;\n\n\nlayer.setStyle({\n\nweight: 5,\n\nstroke: 1,\n\ncolor: '#666',\n\ndashArray: '',\n\nfillOpacity: 0.7\n\n});\n\n\nif (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n\nlayer.bringToFront();\n\n}\n\n};\n\n\nfunction resetHighlight(e) {\n\nvar layer = e.target;\n\ngeojson.resetStyle(e.target);\n\n\nlayer.closePopup();\n\n};\n\n\nfunction zoomToFeature(e) {\n\nmap.fitBounds(e.target.getBounds());\n\n};\n\n\n}", "title": "" }, { "docid": "ca9fab0045dba3a5ae3699bddc463a2b", "score": "0.6642688", "text": "function initMap() {\r\n\r\n var mapOptions = {\r\n\r\n zoom: 14,\r\n center: {\r\n lat: 49.2498895,\r\n lng: -123.0016751\r\n },\r\n\r\n styles: [{\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#242f3e'\r\n }]\r\n },\r\n {\r\n elementType: 'labels.text.stroke',\r\n stylers: [{\r\n color: '#242f3e'\r\n }]\r\n },\r\n {\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#c48b31'\r\n }]\r\n },\r\n {\r\n featureType: 'poi',\r\n stylers: [{\r\n \"visibility\": \"off\"\r\n }]\r\n },\r\n {\r\n featureType: 'poi',\r\n elementType: 'labels.text',\r\n stylers: [{\r\n \"visibility\": \"off\"\r\n }]\r\n },\r\n {\r\n featureType: 'poi.park',\r\n elementType: 'geometry',\r\n stylers: [{\r\n \"visibility\": \"on\"\r\n }]\r\n },\r\n {\r\n featureType: 'poi.park',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#1e3c40'\r\n }]\r\n },\r\n\r\n {\r\n featureType: 'road',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#38414e'\r\n }]\r\n },\r\n {\r\n featureType: 'road',\r\n elementType: 'geometry.stroke',\r\n stylers: [{\r\n color: '#212a37'\r\n }]\r\n },\r\n {\r\n featureType: 'road',\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#f2f2f2'\r\n }]\r\n },\r\n {\r\n featureType: 'road.highway',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#746855'\r\n }]\r\n },\r\n {\r\n featureType: 'road.highway',\r\n elementType: 'geometry.stroke',\r\n stylers: [{\r\n color: '#1f2835'\r\n }]\r\n },\r\n {\r\n featureType: 'road.highway',\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#edc07a'\r\n }]\r\n },\r\n {\r\n featureType: 'transit',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#3b485b'\r\n }]\r\n },\r\n {\r\n featureType: 'transit.station',\r\n stylers: [{\r\n \"visibility\": \"off\"\r\n }]\r\n },\r\n {\r\n featureType: 'water',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#385b60'\r\n }]\r\n },\r\n {\r\n featureType: 'water',\r\n elementType: 'labels.text',\r\n stylers: [{\r\n \"visibility\": \"off\"\r\n }]\r\n }\r\n ]\r\n };\r\n\r\n map = new google.maps.Map(document.getElementById('map'), mapOptions);\r\n\r\n}", "title": "" }, { "docid": "332ed6c1fd8b0c08abb9b8aa460a7697", "score": "0.656206", "text": "function onEachFeature(feature, layer) {\n\n // House icon expansion//\n layer.on(\"mouseover\", function (e) {\n layer.setIcon(house_icon2)\n });\n\n // House icon reduction //\n layer.on(\"mouseout\", function (e) {\n layer.setIcon(house_icon1)\n });\n\n\n // Add house name, address to in the sidebar //\n layer.on('click', function () {\n $('h1').html('');\n $('h1').append(feature.properties.Name);\n $('div p:nth-child(2)').html('');\n $('div p:nth-child(2)').append(feature.properties.DO_NAME, ' ', feature.properties.GUN_NAME, ' ', feature.properties.YUB_NAME, ' ', feature.properties.LOTNO)\n });\n\n // 공간 분석 //\n layer.on('click', function () {\n\n // Layer 초기화 //\n map.removeLayer(a)\n map.removeLayer(b)\n map.removeLayer(c)\n map.removeLayer(d)\n map.removeLayer(f)\n\n // House centroid //\n var centroid = turf.centroid(feature)\n\n // Nearest point //\n var nearest_play = turf.nearestPoint(centroid, geojson_poi_play)\n var nearest_hospital = turf.nearestPoint(centroid, geojson_poi_hospital)\n var nearest_market = turf.nearestPoint(centroid, geojson_poi_market)\n var nearest_school = turf.nearestPoint(centroid, geojson_poi_school)\n var nearest_station = turf.nearestPoint(centroid, geojson_poi_station)\n console.log(nearest_school)\n\n // Distance //\n var dis_play = turf.distance(centroid, nearest_play, { units: 'kilometers' })\n var dis_hospital = turf.distance(centroid, nearest_hospital, { units: 'kilometers' })\n var dis_market = turf.distance(centroid, nearest_market, { units: 'kilometers' })\n var dis_school = turf.distance(centroid, nearest_school, { units: 'kilometers' })\n var dis_station = turf.distance(centroid, nearest_station, { units: 'kilometers' })\n console.log(((dis_play / 4.5) * 60).toPrecision(3), '분')\n console.log(((dis_hospital / 4.5) * 60).toPrecision(3), '분')\n console.log(((dis_market / 4.5) * 60).toPrecision(3), '분')\n console.log(((dis_school / 30) * 60).toPrecision(3), '분')\n console.log(((dis_station / 30) * 60).toPrecision(3), '분')\n\n\n // Add to sidebar //\n $('#play').html(seconds2time(((dis_play / 4.5) * 3600).toPrecision(1)))\n $('#hospital').html(seconds2time(((dis_hospital / 4.5) * 3600).toPrecision(1)))\n $('#market').html(seconds2time(((dis_market / 4.5) * 3600).toPrecision(1)))\n $('#school_t').html(seconds2time(((dis_school / 4.5) * 3600).toPrecision(1)))\n $('#station').html(seconds2time(((dis_station / 4.5) * 3600).toPrecision(1)))\n\n\n // Routing //\n var dir1 = MQ.routing.directions();\n dir1.route({\n locations: [\n { latLng: { lat: centroid.geometry.coordinates[1], lng: centroid.geometry.coordinates[0] } },\n { latLng: { lat: nearest_school.geometry.coordinates[1], lng: nearest_school.geometry.coordinates[0] } }\n ],\n options: {\n routeType: 'shortest',\n bestFit: true\n }\n });\n var mao = MQ.routing.routeLayer({\n directions: dir1\n })\n mao.addTo(map)\n\n\n // Number of CCTV for security //\n var aaa = turf.buffer(feature, 0.18, { units: 'kilometers' })\n var ccc = turf.within(cctvs, aaa);\n console.log('cctv갯수는' + ccc.features.length + '개')\n\n // Chart //\n Chart.defaults.global.legend.display = false;\n var ctx = document.getElementById(\"myChart1\");\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: [\"놀이시설\", \"의료시설\", \"편의시설\", \"교육시설\", \"치안\"],\n datasets: [{\n data: [\n 10 - (dis_play / 4.5) * 60,\n 10 - (dis_hospital / 4.5) * 60,\n 10 - (dis_market / 4.5) * 60,\n 10 - (dis_school / 4.5) * 60 / 6,\n ccc.features.length * 2],\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n\n ],\n borderColor: [\n 'rgba(255,99,132,1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n\n ],\n borderWidth: 5\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n },\n title: {\n display: true,\n text: '소요시간'\n }\n }\n });\n\n // Total score of each house //\n var total_s = ((dis_play / 4.5) * 3600) + ((dis_hospital / 4.5) * 3600) + (dis_market / 4.5) * 3600 + (dis_school / 4.5) * 3600\n var total_m = Number((total_s) / 60)\n console.log(total_m)\n console.log(typeof (total_m))\n if (total_m < 10) {\n var score = 100\n }\n else if (total_m < 20) {\n var score = 80\n }\n else if (total_m < 30) {\n var score = 60\n }\n else if (total_m < 40) {\n var score = 40\n }\n else {\n var score = 20\n }\n\n\n\n // Number increase animation //\n var decimal_places = 1;\n var decimal_factor = decimal_places === 0 ? 1 : decimal_places * 10;\n\n $('#target').animateNumber(\n {\n number: score * 10,\n color: 'green',\n 'font-size': '30px',\n\n numberStep: function (now, tween) {\n var floored_number = Math.floor(now) / decimal_factor,\n target = $(tween.elem);\n if (decimal_places > 0) {\n floored_number = floored_number.toFixed(decimal_places);\n }\n\n target.text(floored_number + ' 점');\n }\n },\n 1500\n )\n\n // Makers of poi //\n var nearest_play_l = L.geoJson(nearest_play, {\n pointToLayer: pointToLayer_play\n }).addTo(map)\n var nearest_hospital_l = L.geoJson(nearest_hospital, {\n pointToLayer: pointToLayer_hospital\n }).addTo(map)\n var nearest_market_l = L.geoJson(nearest_market, {\n pointToLayer: pointToLayer_market\n }).addTo(map)\n var nearest_school_l = L.geoJson(nearest_school, {\n pointToLayer: pointToLayer_school\n }).addTo(map)\n var nearest_station_l = L.geoJson(nearest_station, {\n pointToLayer: pointToLayer_station\n }).addTo(map)\n\n // Display CCTV //\n var cctvrow = document.querySelector('#cctv_row');\n var cctvmid = document.querySelector('#cctv_mid');\n var cctvhigh = document.querySelector('#cctv_high');\n cctvrow.style.visibility = 'hidden';\n cctvmid.style.visibility = 'hidden';\n cctvhigh.style.visibility = 'hidden';\n if (ccc.features.length <= 2)\n return cctvrow.style.visibility = 'visible';\n else if (ccc.features.length <= 4)\n return cctvmid.style.visibility = 'visible';\n else\n return cctvhigh.style.visibility = 'visible';\n\n });\n}", "title": "" }, { "docid": "09356d41a06ffa6b07eb238e7c9633cb", "score": "0.6556666", "text": "function initMap() {\n //The api is loaded at this step\n //L'api est chargée à cette étape\n\n // add translations\n translate();\n\n //options for creating viewer:\n var options= {\n // default value\n // valeur par défaut\n //mode:'normal',\n // default value\n // valeur par défaut\n //territory:'FXX',\n // default value\n // valeur par défaut\n //displayProjection:'IGNF:RGF93G'\n // only usefull when loading external resources\n // utile uniquement pour charger des resources externes */\n proxy:'/geoportail/api/xmlproxy'+'?url='\n };\n\n // viewer creation of type <Geoportal.Viewer>\n // création du visualiseur du type <Geoportal.Viewer>\n // HTML div id, options\n viewer= new Geoportal.Viewer.Default('viewerDiv', OpenLayers.Util.extend(\n options,\n // API keys configuration variable set by\n // <Geoportal.GeoRMHandler.getConfig>\n // variable contenant la configuration des clefs API remplie par\n // <Geoportal.GeoRMHandler.getConfig>\n window.gGEOPORTALRIGHTSMANAGEMENT===undefined? {'apiKey':'nhf8wztv3m9wglcda6n6cbuf'} : gGEOPORTALRIGHTSMANAGEMENT)\n );\n if (!viewer) {\n // problem ...\n OpenLayers.Console.error(OpenLayers.i18n('new.instance.failed'));\n return;\n }\n\n //Loading of data layers\n //Chargement des couches de données\n viewer.addGeoportalLayers([\n 'ORTHOIMAGERY.ORTHOPHOTOS',\n 'GEOGRAPHICALGRIDSYSTEMS.MAPS'],\n {});\n\n ////The GPX layer going from 10 to 13, so we must set the right zoom level :\n //La couche GPX allant de 10 à 13, on se met au bon niveau de zoom :\n viewer.getMap().setCenter(viewer.viewerOptions.defaultCenter,10);\n // cache la patience - hide loading image\n viewer.div.style[OpenLayers.String.camelize('background-image')]= 'none';\n\n //Adding a GPX layer: a bike ride\n //Ajout d'une couche GPX : une ballade en vélo ...\n var gpx= viewer.getMap().addLayer(\"GPX\",\n\n /**\n * layer_name parameter\n * holds the text that will be displayed by the layers switcher\n * contient le texte qui sera affiché dans le gestionnaire de couches\n *\n * Translations can directly be put here !\n * Les traductions peuvent être mises directement içi !\n */\n {\n 'track.gpx.name':\n {\n 'de':\"Reise\",\n 'en':\"Trip\",\n 'es':\"Viaje\",\n 'fr':\"Ballade\",\n 'it':\"Viaggio\"\n }\n },\n /**\n * url_to_gpx parameter\n * holds the path to the GPX resource\n * Chemin d'accès aux données GPX\n */\n \"../data/Campomoro-Tizzano-Sartene_3029.gpx\",\n {\n /**\n * gpx_options\n * optional: holds information about the GPX layer behavior\n * optionnel: contient les informations permettant d'affiner le comportement de la couche GPX\n */\n visibility:true,\n opacity:1.0,\n minZoomLevel:10,\n maxZoomLevel:14,\n originators:[{\n pictureUrl:'./img/tracegps.gif',\n url:'http://www.tracegps.com/'\n }],\n styleMap:new OpenLayers.StyleMap({\n \"default\": new OpenLayers.Style(\n OpenLayers.Util.applyDefaults({\n fillColor: \"#FFFF00\",\n fillOpacity: 0.75,\n strokeColor: \"#FF9900\",\n strokeWidth: 2,\n graphicZIndex: \"${zIndex}\",\n graphicName: \"triangle\",\n pointRadius: 8,\n //see context object below\n label:\"${getName}\",\n labelAlign: \"rb\",\n labelXOffset: -20,\n labelYOffset: -20,\n labelBackgroundColor: \"#FFFF00\",\n labelBorderColor: \"black\",\n labelBorderSize: \"1px\",\n fontColor: \"black\",\n fontWeight: \"bold\",\n fontSize: \"12px\",\n fontFamily: \"Courier New, monospace\"\n },OpenLayers.Feature.Vector.style[\"default\"]),{\n /**\n * The context object contains a function which is referenced in the symbolizer\n * This function will be called with the feature as an argument when using the appropriate style(\"temporary\")\n *\n * L'objet contexte contient une fonction appelée dans le symboliseur\n * Cette fonction qui prend comme argument feature ,sera appelée lors de l'utilisation du style \"temporary\"\n */\n context:{\n getName: function(f) {\n if (f.attributes['typeName']=='wpt') {\n return f.attributes['name'];\n }\n return '';\n }\n }\n }),\n \"select\": new OpenLayers.Style(\n OpenLayers.Util.applyDefaults({\n fillColor: \"#FF9900\",\n fillOpacity: 0.75,\n strokeColor: \"#FFFF00\",\n strokeWidth: 4,\n pointRadius: 12\n },OpenLayers.Feature.Vector.style[\"select\"]))\n }),\n\n /**\n * In order to customize the display and behavior of the GPX popups, one has to overload the following options:\n * Pour modifier le rendu et le comportement par défaut des fiches GPX, il faut surcharger les options:\n * preFeatureInsert, onFeatureInsert, onSelect, onUnselect, et, éventuellement, hover.\n */\n\n preFeatureInsert:\n /**\n * Set waypoints over tracks and routes.\n *\n * Parameters:\n * f - {OpenLayers.Feature} the newly created feature.\n */\n function(f) {\n if (f) {\n // default Geoportal API : cursor pointer on hover ...\n Geoportal.Popup.setPointerCursorForFeature(f);\n var zidx= 0;\n if (f.attributes['typeName']=='wpt') {\n zidx= 1;\n }\n f.attributes['zIndex']= zidx;\n }\n },\n rendererOptions: {\n\n /**\n * Z-Index:\n * allows to play on display order of the layers\n * Permet de jouer sur l'ordre d'affichage des couches\n * see the example: http://openlayers.org/dev/examples/ordering.html\n */\n zIndexing: true\n },\n\n /**\n * skipAttributes\n * table of attributes which should not be put in the popup\n * tableau des attributs à ne pas mettre dans la popup\n */\n skipAttributes:['zIndex'],//do not render zIndex in popups!\n eventListeners:{\n \"loadend\" : function() {\n if (this.maxExtent) {\n //Zoom and refocusing on the max extent\n //Zoom et recentrage sur l'emprise maxi\n this.map.zoomToExtent(this.maxExtent);\n }\n },\n //Changing the feature's style\n \"beforefeatureselected\": changeRenderIntent,\n \"featureunselected\" : changeRenderIntent\n }\n },\n /**\n * options_popup\n * optional: holds information about the gpx popup behavior\n * optionnel: contient les informations permettant d'affiner le comportement des popups associées à la couche gpx\n */\n {\n }\n );\n}", "title": "" }, { "docid": "087a04c609ea936da1fad6ca561dc24b", "score": "0.65546817", "text": "function zoomToFeature(e) {\n\n // reset counters;\n contained_fires_counter = 0;\n active_fires_counter = 0;\n protest_counter = 0;\n // zoom to map\n myMap.fitBounds(e.target.getBounds());\n // update html state name\n state = e.target.feature.properties.name;\n map_component.attr(\"state_name\", state);\n\n // call state functions\n\n stateUnemployment(state, datetoPass);\n single_state_fxn(state, datetoPass);\n optionChanged(state, datetoPass);\n\n // getting state polygon coordinates using state dictionary\n var state_index = state_dict[state];\n var polygon_coords = statesData.features[state_index].geometry.coordinates;\n var final_coords = [];\n // switching lat and long for final coords\n for (i = 0; i < polygon_coords[0].length; i++) {\n var update_coord = [polygon_coords[0][i][1], polygon_coords[0][i][0]];\n final_coords.push(update_coord);\n }\n\n var state_check = L.polygon(final_coords);\n\n // find markers within clicked state \n // contained fires\n for (var i = 0; i < contained_fires.length; i++) {\n // special requirements for Alaska (multipolygon)\n if (state_index == 1) {\n if (contained_fires[i]._latlng.lat > 52) {\n contained_fires_counter = contained_fires_counter + 1;\n }\n }\n // special requirements for Hawaii (multipolygon)\n if (state_index == 11) {\n if ((contained_fires._latlng.lng < -126) && (contained_fires._latlng.lat < 50)) {\n contained_fires_counter = contained_fires_counter + 1;\n }\n }\n // special requirements for Michigan (multipolygon)\n if (state_index == 22) {\n if ((contained_fires[i]._latlng.lng > -87) && (contained_fires[i]._latlng.lat > 41.8) && (contained_fires[i]._latlng.lng < -82.5)) {\n contained_fires_counter = contained_fires_counter + 1;\n }\n }\n // all other states check\n else {\n var marker_inside_polygon = state_check.contains(contained_fires[i].getLatLng());\n\n if (marker_inside_polygon) {\n contained_fires_counter = contained_fires_counter + 1;\n }\n }\n }\n\n // active fires\n for (var i = 0; i < total_active_fires.length; i++) {\n if (state_index == 1) {\n if (total_active_fires[i]._latlng.lat > 52) {\n active_fires_counter = active_fires_counter + 1;\n }\n }\n if (state_index == 11) {\n if ((total_active_fires._latlng.lng < -126) && (total_active_fires._latlng.lat < 50)) {\n active_fires_counter = active_fires_counter + 1;\n }\n }\n\n if (state_index == 22) {\n if ((total_active_fires[i]._latlng.lng > -87) && (total_active_fires[i]._latlng.lat > 41.8) && (total_active_fires[i]._latlng.lng < -82.5)) {\n active_fires_counter = active_fires_counter + 1;\n }\n }\n\n else {\n var marker_inside_polygon1 = state_check.contains(total_active_fires[i].getLatLng());\n if (marker_inside_polygon1) {\n active_fires_counter = active_fires_counter + 1;\n }\n }\n }\n\n // protest data\n for (var i = 0; i < protest_icons.length; i++) {\n if (state_index == 1) {\n if (protest_icons[i]._latlng.lat > 52) {\n protest_counter = protest_counter + 1;\n }\n }\n if (state_index == 11) {\n if ((protest_icons._latlng.lng < -126) && (protest_icons._latlng.lat < 50)) {\n protest_counter = protest_counter + 1;\n }\n }\n\n if (state_index == 22) {\n if ((protest_icons[i]._latlng.lng > -87) && (protest_icons[i]._latlng.lat > 41.8) && (protest_icons[i]._latlng.lng < -82.5)) {\n protest_counter = protest_counter + 1;\n }\n }\n\n else {\n var marker_inside_polygon2 = state_check.contains(protest_icons[i].getLatLng());\n if (marker_inside_polygon2) {\n protest_counter = protest_counter + 1;\n }\n }\n }\n\n // update the state information on html when state is clicked\n d3.select(\".contained_fires\").text(contained_fires_counter);\n d3.select(\".active_fires\").text(active_fires_counter);\n d3.select(\".protests\").text(protest_counter);\n d3.select(\".state\").text(state);\n }", "title": "" }, { "docid": "7675c3a515274bff7ff63d82d0637cac", "score": "0.6544826", "text": "renderGeofence(map, coordinates, id){\n map.on('load',function(){\n if(map.getLayer(id)) map.removeLayer(id)\n if(map.getSource(id)) map.removeSource(id)\n })\n map.on('load', function () {\n map.addSource(id, {\n 'type': 'geojson',\n 'data': {'type': 'Feature',\n 'geometry': {\n 'type': 'Polygon',\n 'coordinates': [coordinates]\n }\n }\n });\n map.addLayer({\n 'id': id,\n 'type': 'fill',\n 'source': id,\n 'layout': {},\n 'paint': {\n 'fill-color': '#4db2fa',\n 'fill-opacity': [\n 'case',\n ['boolean', ['feature-state', 'hover'], false],\n 1,\n 0.4\n ]\n }\n });\n });\n }", "title": "" }, { "docid": "2ff85f70f380887c2eb33d7ddf22bd62", "score": "0.65366155", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 43.658757, lng: -79.3797355},\n zoom: 12,\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n var infoWindow = new google.maps.InfoWindow({map: map});\n\n var input = document.getElementById('address');\n var autocomplete = new google.maps.places.Autocomplete(input,{types: ['(cities)']});\n google.maps.event.addListener(address, 'place_changed', function(){\n var place = address.getPlace();\n })\n\n\n // Try HTML5 geolocation.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n infoWindow.setPosition(pos);\n infoWindow.setContent('Location found.');\n map.setCenter(pos);\n showCords(pos);\n runWorker(pos);\n\n var geocoder = new google.maps.Geocoder();\n document.getElementById('submit').addEventListener('click', function() {\n geocodeAddress(geocoder, map);\n\n\n });\n\n document.getElementById('resetLocation').addEventListener('click', function(){\n map.setCenter(pos);\n showCords(pos);\n runWorker(pos);\n });\n\n\n\n }, function() {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n}", "title": "" }, { "docid": "59050f57ed99b26dadc90b83654ab1d5", "score": "0.6511884", "text": "function showRoutes(){\n if(map.hasLayer(routes)){\n map.removeLayer(routes);\n };\n // Get CARTO selection as GeoJSON and Add to Map\n $.getJSON(\"https://mcmahoney3.carto.com/api/v2/sql?format=GeoJSON&q=\"+busQuery, function(data) {\n routes = L.geoJson(data,{\n\t\t\n onEachFeature: function (feature, layer) {\n\t\t\t layer.bindPopup('<p><b>' + feature.properties.route_name + '</b><br /><em>' + feature.properties.route__ + '</em><br />'+'<a href=\"http://ridegrtc.com/planning-your-trip/trip-planner/\" target=\"_blank\">Plan Your Ride</a>' + '</p>');\n layer.cartodb_id=feature.properties.cartodb_id;\n }\n }).addTo(busRoutes);\n });\n}", "title": "" }, { "docid": "0cf3fb44da75a4d84d1ce8fb2616fc8f", "score": "0.6501941", "text": "function showWaypoints()\n{\n if (waypointsArray.length > 0)\n {\n document.getElementById('routeWaypoints').innerHTML = \"Waypoints Saved\";\n }\n // remove existing layer\n if (routeCreationMap.getLayer('pathBetweenWaypoints') != undefined)\n {\n routeCreationMap.removeLayer(\"pathBetweenWaypoints\");\n routeCreationMap.removeSource(\"pathBetweenWaypoints\");\n }\n // adding markers for the ports of arrival and departure\n sourceMarker.addTo(routeCreationMap);\n sourcePopup.addTo(routeCreationMap);\n\n destinationMarker.addTo(routeCreationMap);\n destinationPopup.addTo(routeCreationMap);\n // adding markers for waypoints\n for (i = 0; i < markerArray.length; i++)\n {\n markerArray[i].addTo(routeCreationMap);\n }\n // generating lines between markers\n routeCreationMap.addLayer({\n id: \"pathBetweenWaypoints\",\n type: \"line\",\n source: lineObject,\n layout: { \"line-join\": \"round\", \"line-cap\": \"round\" },\n paint: { \"line-color\": \"#888\", \"line-width\": 6 }\n });\n // zooming map to show full route\n boundaryCoordinates = [];\n boundaryCoordinates.push(sourcePortCoords);\n for (i = 0; i < waypointsArray.length; i++) // creating array of coordinates\n {\n boundaryCoordinates.push(waypointsArray[i].getCoordinates());\n }\n boundaryCoordinates.push(destinationPortCoords);\n bounds = boundaryCoordinates.reduce(function(bounds, boundaryCoordinates) {\n return bounds.extend(boundaryCoordinates);\n }, new mapboxgl.LngLatBounds(boundaryCoordinates[0], boundaryCoordinates[0]));\n\n routeCreationMap.fitBounds(bounds, {\n padding: 60\n });\n}", "title": "" }, { "docid": "fecd2b926c0672fff7486e11e347c8bf", "score": "0.6498724", "text": "function show_map(e) {\n\n $('#map').spin({lines: 12, length: 0, width: 8, radius: 12});\n\n var filename = '/static/json/chicago.topojson';\n\n $.getJSON($SCRIPT_ROOT + filename, function(data) {\n console.log('got topojson');\n\n var which_feature = 0;\n map_layer = L.geoJson(topojson.feature(data, data.objects['BlockGroupsTIGER2010']), {\n style: empty_style,\n onEachFeature: function(feature, layer) {\n feature.properties.num = which_feature;\n var content = 'GEOID10: ' + feature.properties.GEOID10;\n layer.bindLabel(content);\n layer.on('click', clickHandler);\n which_feature++;\n }\n });\n\n $('#map').spin(false);\n\n map_layer.addTo(map);\n });\n }", "title": "" }, { "docid": "5ee2a91a1db76da1dcaed3e7f33f3a87", "score": "0.64906454", "text": "onOpen() {\n this.mapClickHandler = on(this.sceneView, 'click', (evt) => {\n if (evt.hasOwnProperty('graphic')) {\n // we clicked on a grpahic so do an identify\n this.showGraphicInWidget(evt.graphic.id);\n } else {\n // didn't click on a graphic. do another query.\n parkWhiz.getLocations(evt.mapPoint.latitude, evt.mapPoint.longitude, this.config.apiKey).then((locations) => {\n if(locations.locations > 0 && locations.parking_listings && locations.parking_listings.length > 0) {\n this.mapLocations(locations.parking_listings);\n } else {\n // no locations. remove current items from map\n this.removeGraphicsLayer();\n }\n });\n }\n });\n \n this.own(this.mapClickHandler);\n }", "title": "" }, { "docid": "c160da02047f2f6493e2eedcb12f3408", "score": "0.6462313", "text": "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 12,\n center: {lat: 23.159526, lng: 79.913076},\n styles: [\n {\n elementType: 'geometry',\n stylers: [{color: '#fefefe'}]\n },\n {\n elementType: 'labels.icon',\n stylers: [{visibility: 'off'}]\n },\n {\n elementType: 'labels.text.fill',\n stylers: [{color: '#616161'}]\n },\n {\n elementType: 'labels.text.stroke',\n stylers: [{color: '#f5f5f5'}]\n },\n {\n featureType: 'administrative.land_parcel',\n elementType: 'labels.text.fill',\n stylers: [{color: '#bdbdbd'}]\n },\n {\n featureType: 'poi',\n elementType: 'geometry',\n stylers: [{color: '#eeeeee'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#757575'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#e5e5e5'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9e9e9e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#eee'}]\n },\n {\n featureType: 'road.arterial',\n elementType: 'labels.text.fill',\n stylers: [{color: '#3d3523'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#eee'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#616161'}]\n },\n {\n featureType: 'road.local',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9e9e9e'}]\n },\n {\n featureType: 'transit.line',\n elementType: 'geometry',\n stylers: [{color: '#e5e5e5'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'geometry',\n stylers: [{color: '#000'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#c8d7d4'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#b1a481'}]\n }\n ]\n });\n\n var image = 'images/marker.png';\n var beachMarker = new google.maps.Marker({\n position: {lat: 23.159526, lng: 79.913076},\n map: map,\n icon: image\n });\n }", "title": "" }, { "docid": "ba7457a0cb3077771a861a14fa4ef833", "score": "0.6436649", "text": "didReceiveAttrs(){\n this._super(...arguments)\n let details = this.get('content')\n let mapsidebar = mapUtil.create(); //yeah created an object that u shall invoke functions\n if (details.questionType === 'GEOSHAPE') {\n this.set('showingShape', true)\n //time to set these geocordinates.\n this.set('lat',0.3262600)\n this.set('lng', 32.6149900)\n this.set('zoom', 10)\n //test also whether geometry , is polygon or lineString or multipoint.\n //let geoshapeObject = details.stringValue; //u need to parse this data first .. that is why is undefined\n \n let geoshapeObject = mapsidebar.FLOW_parseJson(details.stringValue, 'features')\n let geoshapeCoordinatesArray, points = [], \n geoShapeObjectType = geoshapeObject['features'][0]['geometry']['type'];\n if (geoShapeObjectType === 'Polygon') {\n this.set('showPolygon', true)\n //the same should apply for the line geometry line\n geoshapeCoordinatesArray = geoshapeObject['features'][0]['geometry']['coordinates'][0];\n //console.log(geoshapeCoordinatesArray)\n //u need to create the geopoints on the map.\n for (var i = 0; i < geoshapeCoordinatesArray.length; i++) {\n //array[i]\n // points.push([geoshapeCoordinatesArray[j][1], geoshapeCoordinatesArray[j][0]]);\n //what is [lat, lng] ==> the above shows the other way round\n points.push([geoshapeCoordinatesArray[i][0], geoshapeCoordinatesArray[i][1]])\n }\n //this.set('locationPoints', geoshapeCoordinatesArray)\n //this.set('locationPoints', points) //n monday start here.. solving the problem\n }else {\n //it is a lineString or something else.\n this.set('showLine', true)\n geoshapeCoordinatesArray = geoshapeObject['features'][0]['geometry']['coordinates']\n }\n \n }\n }", "title": "" }, { "docid": "e22c30bcfc4f9e61056d2f4db5cda115", "score": "0.64325225", "text": "function initMap() {\n var styles = [\n {\n featureType: 'water',\n stylers: [\n {\n color: '#29b2ea'\n }\n ]\n }, {\n featureType: 'administrative',\n elementType: 'labels.text.stroke',\n stylers: [\n {\n color: '#ffffff'\n },\n {\n weight: 4\n }\n ]\n }, {\n featureType: 'administrative',\n elementType: 'labels.text.fill',\n stylers: [\n {\n color: '#e85113'\n }\n ]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [\n {\n color: '#efe9e4'\n },\n {\n lightness: -40\n }\n ]\n }, {\n featureType: 'transit.station',\n stylers: [\n {\n weight: 9\n },\n {\n hue: '#13c7e8'\n }\n ]\n }, {\n featureType: 'road.highway',\n elementType: 'labels.icon',\n stylers: [\n {\n visibility: 'off'\n }\n ]\n }, {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [\n {\n lightness: 100\n }\n ]\n }, {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [\n {\n lightness: -100\n }\n ]\n }, {\n featureType: 'poi',\n elementType: 'geometry',\n stylers: [\n {\n visibility: 'on'\n },\n {\n color: '#f0e4d3'\n }\n ]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.fill',\n stylers: [\n {\n color: '#efe9e4'\n },\n {\n lightness: -35\n }\n ]\n }\n ];\n\n var mapOptions = {\n zoom: 11,\n center: new google.maps.LatLng(37.387474, -122.057543),\n mapTypeControl: true,\n scrollwheel: true,\n disableDefaultUI: false,\n styles: styles,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n streetViewControl: true\n };\n\n //Creates a new infowindow\n var infowindow = new google.maps.InfoWindow();\n\n // Changes the marker style.\n var defaultIcon = makeMarkerIcon('0091ff');\n\n // Changes the marker style to \"highlighted \" marker by mouseover.\n var highlightedIcon = makeMarkerIcon('07eee6');\n\n //Sets the Knockout.js observables\n var Place = function (data, foursquare, map) {\n var self = this;\n this.name = ko.observable(data.name);\n this.lat = ko.observable(data.lat);\n this.lng = ko.observable(data.lng);\n this.city = ko.observable(data.city);\n this.url = ko.observable(data.url);\n this.geekyPlaces = ko.observableArray([]);\n this.marker = ko.observable();\n this.rating = ko.observable();\n this.checkinCount = ko.observable();\n this.state = ko.observable();\n this.postCode = ko.observable();\n this.country = ko.observable();\n this.localWeather = ko.observable();\n };\n\n\n\n var ViewModel = function () {\n var self = this;\n\n this.placeList = ko.observableArray([]);\n\n\n //Creates objects for each item in the Location Array\n geekyPlaces.forEach(function (locationItem) {\n self.placeList.push(new Place(locationItem));\n });\n\n\n self.placeList()\n .forEach(function (locationItem) {\n\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(locationItem.lat(), locationItem.lng()),\n map: map,\n animation: google.maps.Animation.DROP,\n icon: defaultIcon,\n title: locationItem.name()\n });\n locationItem.marker = marker;\n\n\n //JSON get foursquaredata\n\n var foursquareUrl = 'https://api.foursquare.com/v2/venues/explore?limit=1&ll=' +\n locationItem.lat() + ',' + locationItem.lng() +\n '&intent=self&query=' + locationItem.name() +\n '&client_id=PBLIDC53NETDZSL1OEND4SCI1AOPHG4MMTQ2PYV3O4I4EWDO&client_secret=I0IE4GRUSALOGYMYFQGF2IMSNMJJ52TH4AVLADMJAP5N01XJ&v=20140806';\n $.getJSON(foursquareUrl, function (data) {\n results = data.response.groups[0].items[0].venue;\n locationItem.name = (results.name);\n locationItem.rating = results.rating ? results.rating : \"Rating unavailable\";\n locationItem.checkinCount = results.stats.checkinsCount;\n locationItem.rcheckinCount = results.stats.checkinsCount ? results.stats.checkinsCount : \"Check ins unavailable\";\n })\n .fail(function (jqxhr, textStatus, error) {\n alert('There was an errors when retrieving the data. Please try refresh page or try again later.');\n });\n\n\n // Two event listeners - one for mouseover, one for mouseout,\n // to change the colors back and forth.\n marker.addListener('mouseover', function () {\n this.setIcon(highlightedIcon);\n });\n marker.addListener('mouseout', function () {\n this.setIcon(defaultIcon);\n });\n\n //Toggles the bounce animation on the marker\n function toggleBounce() {\n if (locationItem.marker.getAnimation() !== null) {\n locationItem.marker.setAnimation(null);\n } else {\n locationItem.marker.setAnimation(google.maps.Animation.BOUNCE);\n }\n }\n\n\n\n // By click animate the marker and then show the infowindow\n google.maps.event.addListener(locationItem.marker, 'click', function () {\n toggleBounce();\n setTimeout(toggleBounce, 2000);\n setTimeout(function () {\n infowindow.setContent('<h3>' + locationItem.name +\n '</h3>\\n<h5>FourSquare-Infos:</h5>\\n<p><span class=\"glyphicon glyphicon-thumbs-up\"></span> <span>: </span>' +\n locationItem.rating +\n '</p>\\n<p><span class=\"glyphicon glyphicon-home\"></span> <span>: </span>' +\n locationItem.checkinCount);\n infowindow.open(map, locationItem.marker);\n map.setZoom(14);\n }, 200);\n });\n });\n\n\n //opens the marker if clicked\n self.show_info = function (locationItem) {\n google.maps.event.trigger(locationItem.marker, 'click');\n };\n\n infowindow.addListener('closeclick', function () {\n infowindow.marker = null;\n map.setZoom(12);\n });\n\n\n\n self.filterText = ko.observable(\"\");\n\n self.filteredList = ko.computed(function () {\n var filterText = self.filterText()\n .toLowerCase();\n if (self.filterText()\n .length > 0) {\n return ko.utils.arrayFilter(self.placeList(), function (location) {\n console.log(location.name);\n var name = location.name.toLowerCase();\n var shouldVisible = name.indexOf(filterText) > -1;\n location.marker.setVisible(shouldVisible);\n return shouldVisible;\n });\n } else {\n self.placeList()\n .forEach(function (location) {\n location.marker.setVisible(true);\n });\n return self.placeList();\n }\n });\n }\n\n\n // This function takes in a color, and then creates a new marker\n function makeMarkerIcon(markerColor) {\n var markerImage = new google.maps.MarkerImage(\n 'http://chart.googleapis.com/chart?chst=d_map_spin&chld=1.15|0|' + markerColor +\n '|40|_|%E2%80%A2',\n new google.maps.Size(21, 34),\n new google.maps.Point(0, 0),\n new google.maps.Point(10, 34),\n new google.maps.Size(21, 34));\n return markerImage;\n }\n\n google.maps.event.addDomListener(window, 'resize', function () {\n map.setCenter(new google.maps.LatLng(37.387474, -122.057543));\n });\n\n\n $.ajax({\n url: \"http://api.wunderground.com/api/e6f14835285d1ad3/conditions/q/CA/San_Francisco.json\",\n dataType: \"json\",\n success: function (url) {\n console.log(url);\n var location = 'Silicon Valley';\n var temp_c = url.current_observation.temp_c;\n $(\".conditions\")\n .html(\"Current temperature is: \" + temp_c + \"ºC\");\n },\n error: function (url) {\n alert(\"Try to refresh the page, weather information could not be load\");\n }\n });\n\n map = new google.maps.Map(document.getElementById('map'), mapOptions);\n\n\n // binding handler that init the ViewModel\n ko.applyBindings(new ViewModel());\n}", "title": "" }, { "docid": "ee0432225c574e8b80f0b1bce65cea3f", "score": "0.6401953", "text": "function routeB() {\n var map = new google.maps.Map(document.getElementById(\"map\"), {\n mapTypeControlOptions: {\n\t\tmapTypeIds: ['Styled']\n\t},\n center: new google.maps.LatLng(54.2585, -6.959),\n zoom: 7,\n mapTypeId: 'Styled'\n });\n var infoWindow = new google.maps.InfoWindow;\n \n var styles = [\n\t{\n\t\tfeatureType: 'water', // set the water color\n\t\telementType: 'geometry.fill', // apply the color only to the fill\n\t\tstylers: [\n\t\t\t{ color: '#63a2e5' }\n\t\t]\n\t},{\n\t\tfeatureType: 'landscape.natural', // set the natural landscape\n\t\telementType: 'all',\n\t\tstylers: [\n\t\t\t{ hue: '#64bb30' },\n//\t\t\t{ lightness: 1 }\n\t\t]\n\t}\n\t,{\n\t\tfeatureType: 'poi', // set the point of interest\n\t\telementType: 'geometry',\n\t\tstylers: [\n\t\t\t{ hue: '#f9e0b7' },\n\t\t\t{ lightness: 30 }\n\t\t]\n\t},{\n\t\tfeatureType: 'road', // set the road\n\t\telementType: 'geometry',\n\t\tstylers: [\n\t\t\t{ hue: '#d5c18c' },\n\t\t\t{ lightness: 14 }\n\t\t]\n\t},{\n\t\tfeatureType: 'road.local', // set the local road\n\t\telementType: 'all',\n\t\tstylers: [\n\t\t\t{ hue: '#ffd7a6' },\n\t\t\t{ saturation: 100 },\n\t\t\t{ lightness: -12 }\n\t\t]\n\t}\n];\n // Change this depending on the name of your PHP file\n downloadUrl(\"../wp-content/themes/areview-child/scripts/maps2.xml\", function(data) {\n var xml = data.responseXML;\n var markers = xml.documentElement.getElementsByTagName(\"marker\");\n for (var i = 0; i < markers.length; i++) {\n var name = markers[i].getAttribute(\"stop\");\n// var address = markers[i].getAttribute(\"address\");\n// var type = markers[i].getAttribute(\"type\");\n var point = new google.maps.LatLng(\n parseFloat(markers[i].getAttribute(\"lat\")),\n parseFloat(markers[i].getAttribute(\"lng\")));\n var html = \"<b>\" + name + \"</b> <br/>\";//+ address\n var icon = customIcons[name] || {};\n var styledMapType = new google.maps.StyledMapType(styles, { name: 'John McGinley Coach Travel' });\n map.mapTypes.set('Styled', styledMapType);\n var marker = new google.maps.Marker({\n map: map,\n position: point,\n icon: icon.icon\n });\n bindInfoWindow(marker, map, infoWindow, html);\n }\n });\n \n downloadUrl(\"../wp-content/themes/areview-child/scripts/polylines/route12_polyline.xml\", function(data) {\n var xml = data.responseXML;\n var routes = xml.documentElement.getElementsByTagName(\"route\");\n var path = [];\n for (var i = 0; i < routes.length; i++) {\n var lat = parseFloat(routes[i].getAttribute(\"lat\"));\n var lng = parseFloat(routes[i].getAttribute(\"lng\"));\n var point = new google.maps.LatLng(lat,lng);\n path.push(point);\n }//finish loop\n\n var polyline = new google.maps.Polyline({\n path: path,\n geodesic : true,\n strokeColor: \"#f48208\",\n strokeOpacity: 1.0,\n strokeWeight: 4\n });\n polyline.setMap(map);\n\n}); //end download url\n }", "title": "" }, { "docid": "244b5a7c53025b5dadd1e33aea6db844", "score": "0.6392873", "text": "function main() {\n\n geocoding($(\"#Start\").val(), \"pointA\");\n\n standortMarker.setLatLng([Points.pointA.features[0].geometry.coordinates[1], Points.pointA.features[0].geometry.coordinates[0]]);\n map.setView([Points.pointA.features[0].geometry.coordinates[1], Points.pointA.features[0].geometry.coordinates[0]]);\n standortMarker.setOpacity(1)\n\n requestData(Points.pointA.features[0].geometry.coordinates);\n}", "title": "" }, { "docid": "35991f32cd810d0a307ea4535766317f", "score": "0.6388039", "text": "function initialMapGeneralView() {\n var generalStockList = [\n {\n \"geo\": [123.365597,41.662011]\n },\n {\n \"geo\": [122.974751,39.659973]\n },\n {\n \"geo\": [122.974751,39.659973]\n },\n {\n \"geo\": [119.781302,39.99436]\n },\n {\n \"geo\": [116.607627,38.594747]\n },\n {\n \"geo\": [118.530234,37.617913]\n },\n {\n \"geo\": [120.123252,37.330184]\n },\n {\n \"geo\": [122.515525,37.212158]\n },\n {\n \"geo\": [120.673941,36.360906]\n },\n {\n \"geo\": [120.146489,33.763313]\n },\n {\n \"geo\": [118.487554,32.400984]\n },\n {\n \"geo\": [119.772954,31.88004]\n },\n {\n \"geo\": [121.345372,31.937163]\n },\n {\n \"geo\": [120.922399,31.343233]\n },\n {\n \"geo\": [114.215245,31.268139]\n },\n {\n \"geo\": [113.138585,29.734724]\n },\n {\n \"geo\": [116.045591,29.887244]\n },\n {\n \"geo\": [119.566709,26.336658]\n },\n {\n \"geo\": [118.855345,25.82354]\n },\n {\n \"geo\": [119.297544,25.533928]\n },\n {\n \"geo\": [112.980406,24.38854]\n },\n {\n \"geo\": [113.364927,22.767481]\n },\n {\n \"geo\": [114.496519,23.192288]\n },\n {\n \"geo\": [110.552427,21.464736]\n },\n {\n \"geo\": [110.178892,24.298454]\n },\n {\n \"geo\": [107.344419,22.868747]\n },\n {\n \"geo\": [105.421812,30.818678]\n },\n {\n \"geo\": [102.840025,29.756186]\n },\n {\n \"geo\": [108.672219,34.824096]\n },\n {\n \"geo\": [102.245217,37.152796]\n },\n {\n \"geo\": [103.893166,30.818678]\n },\n {\n \"geo\": [119.427834,34.589274]\n },\n {\n \"geo\": [118.526955,34.208542]\n },\n {\n \"geo\": [117.889748,33.148048]\n },\n {\n \"geo\": [120.437912,30.714315]\n },\n {\n \"geo\": [121.369676,30.132051]\n },\n {\n \"geo\": [122.202649,30.076423]\n }];\n\n jQuery.each(generalStockList, function(index, item) {\n new SimpleMarker({\n // Point URL definition\n iconStyle: {\n src: 'images/stockingpoint.png',\n style: {\n width: '70px'\n }\n },\n\n // Base point offset\n offset: new AMap.Pixel(-35, -35),\n\n map: map,\n autoSetFitView: false,\n\n showPositionPoint: false,\n position: item.geo,\n zIndex: 100,\n });\n });\n }", "title": "" }, { "docid": "b77d9c63e0af2d0859dd4f8fb56a5716", "score": "0.6375316", "text": "function onMapClick(e) {\r\n var latitude =e.latlng.lat;\r\n var longitude =e.latlng.lng;\r\n\r\n var query=`PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\r\n PREFIX ns: <http://www.owl-ontologies.com/unnamed.owl#>\r\n\r\n SELECT ?name ?adress ?latitude ?longitude ?type\r\n WHERE `;\r\n query += createQueryAdress(latitude,longitude);\r\n layerGroup.clearLayers();\r\n getData(query).then(function(results){\r\n console.log(\"Buildings :\",results);\r\n results.forEach(function (building){\r\n //Add marker on the map\r\n addMarker(building);\r\n })\r\n popup\r\n .setLatLng(e.latlng)\r\n .setContent(`${results.length} Buildings around !`)\r\n .openOn(mymap);\r\n });\r\n displayWeatherAQI(latitude,longitude);\r\n}", "title": "" }, { "docid": "941a9c73d2de88a923b9f943d799330e", "score": "0.6371499", "text": "function initMap() {\n directionService = new google.maps.DirectionsService;\n directionDisplay = new google.maps.DirectionsRenderer;\n\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 7,\n center: {lat: 41.879, lng: -87.624}, // Center the map on Chicago, USA.\n styles: [\n {\n elementType: \"geometry\",\n stylers: [{ color: \"#f5f5f5\" }]\n },\n {\n elementType: \"labels.icon\",\n stylers: [{ visibility: \"off\" }]\n },\n {\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#616161\" }]\n },\n {\n elementType: \"labels.text.stroke\",\n stylers: [{ color: \"#f5f5f5\" }]\n },\n {\n featureType: \"administrative.land_parcel\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#bdbdbd\" }]\n },\n {\n featureType: \"poi\",\n elementType: \"geometry\",\n stylers: [{ color: \"#eeeeee\" }]\n },\n {\n featureType: \"poi\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#757575\" }]\n },\n {\n featureType: \"poi.park\",\n elementType: \"geometry\",\n stylers: [{ color: \"#e5e5e5\" }]\n },\n {\n featureType: \"poi.park\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#9e9e9e\" }]\n },\n {\n featureType: \"road\",\n elementType: \"geometry\",\n stylers: [{ color: \"#ffffff\" }]\n },\n {\n featureType: \"road.arterial\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#757575\" }]\n },\n {\n featureType: \"road.highway\",\n elementType: \"geometry\",\n stylers: [{ color: \"#dadada\" }]\n },\n {\n featureType: \"road.highway\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#616161\" }]\n },\n {\n featureType: \"road.local\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#9e9e9e\" }]\n },\n {\n featureType: \"transit.line\",\n elementType: \"geometry\",\n stylers: [{ color: \"#e5e5e5\" }]\n },\n {\n featureType: \"transit.station\",\n elementType: \"geometry\",\n stylers: [{ color: \"#eeeeee\" }]\n },\n {\n featureType: \"water\",\n elementType: \"geometry\",\n stylers: [{ color: \"#c9c9c9\" }]\n },\n {\n featureType: \"water\",\n elementType: \"geometry.fill\",\n stylers: [{ color: \"#a3a3a3\" }]\n },\n {\n featureType: \"water\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#9e9e9e\" }]\n }\n ]\n }); \n\n //draws a polyline\n poly = new google.maps.Polyline({\n strokeColor: \"#ff0000\",\n strokeOpacity: 1.0,\n strokeWeight: 3\n });\n poly.setMap(map);\n\n //Add a listener for the click event\n if(window.location.pathname.indexOf(\"/new/\") != -1)\n map.addListener('click', addLatLng);\n}", "title": "" }, { "docid": "c474761ddd6315c9740167ac5802e306", "score": "0.6341564", "text": "function initMapInteractive() {\n var uluru = { lat: -34.916467, lng: -56.154272 };\n var map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 15,\n center: uluru\n });\n\n // var geocoder = new google.maps.Geocoder();// creo que no la usamos para nada\n //var infowindow = new google.maps.InfoWindow;\n // Evento que escucha el click y llama a la funcion addMarkersAndAll() cuando sucede.\n google.maps.event.addListener(map, \"click\", function(event) {\n if (markers.length <= 1)\n //Limito a 2 marcadores maximo.\n addMarkersAndAll(event.latLng, map);\n //printablevalues=parseSearchString();\n });\n\n poly = new google.maps.Polyline({\n strokeColor: \"#000000\",\n strokeOpacity: 1.0,\n strokeWeight: 3\n });\n}", "title": "" }, { "docid": "e14345d56c5a50fc8a11d81453836d40", "score": "0.63398623", "text": "function initialize() {\n var center = new google.maps.LatLng(37.850033, -99.6500523);\n var mapOptions = {\n zoom: 3,\n center: center,\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ],\n mapTypeId: google.maps.MapTypeId.TERRAIN\n };\n\n map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n for (i = 0; i < markers1.length; i++) {\n addMarker(markers1[i]);\n }\n}", "title": "" }, { "docid": "cf345e7708c4118e4ceed15d32c0e590", "score": "0.63168913", "text": "function newgetPopup(coordinate,LogDvalue,Nvalue,CSRvalue,RnSvalue,BnTvalue,Cetinvalue,InYvalue,state) {\n // console.log (\"Working on the new popup\");\n // console.log (LogDvalue);\n // console.log (CSRvalue);\n // console.log (Nvalue);\n // console.log (RnSvalue);\n // console.log (BnTvalue);\n // console.log (Cetinvalue);\n // console.log (InYvalue);\n\n var view = map.getView();\n var viewResolution = view.getResolution();\n\n var dec = ol.proj.transform(coordinate, 'EPSG:3857', 'EPSG:4326');\n var declon = parseFloat(dec[0]).toFixed(5);\n var declat = parseFloat(dec[1]).toFixed(5);\n\n content.innerHTML = '<p><b>Location:</b><br>'+ declon +', ' +declat + '</p>';\n content.innerHTML += '<p><i><b>CSR(%)<sup>ref</sup></b>: ' + (parseFloat(CSRvalue).toFixed(2)) + '</i></p>';\n content.innerHTML += '<p><i><b>N<sub>req</sub><sup>ref</sup></b>: ' + (parseFloat(Nvalue).toFixed(2)) + '</i></p>';\n content.innerHTML += '<p><i><b>&epsilon;<sub>v,Cetin</sub>(%)<sup>ref</sup></b>: ' + (parseFloat(RnSvalue).toFixed(2)) + '</i></p>';\n content.innerHTML += '<p><i><b>&epsilon;<sub>v,I&Y%</sub>(%)<sup>ref</sup></b>: ' + (parseFloat(BnTvalue).toFixed(2)) + '</i></p>';\n if (state == 'Alaska') {\n content.innerHTML += '<p><i><b>Log D<sub>h</sub><sup>ref</sup></b> (lateral spread is based on USGS 2002 data): ' + (parseFloat(LogDvalue).toFixed(4)) + '</i></p>';\n }\n else {\n content.innerHTML += '<p><i><b>Log D<sub>h</sub><sup>ref</sup></b>: ' + (parseFloat(LogDvalue).toFixed(4)) + '</i></p>';\n }\n content.innerHTML += '<p><i><b>D<sub>R&S</sub><sup>ref</sup></b>: ' + (parseFloat(Cetinvalue).toFixed(2)) + '</i></p>';\n content.innerHTML += '<p><i><b>D<sub>B&T</sub><sup>ref</sup></b>: ' + (parseFloat(InYvalue).toFixed(2)) + '</i></p>';\n content.innerHTML += '<button id=\"Add_values\" onclick=\"Add_values('+declon+','+declat+','+LogDvalue+','+Nvalue+','+CSRvalue+','+Cetinvalue+','+InYvalue+','+RnSvalue+','+BnTvalue+')\">Add</button>';\n \n overlay.setPosition(coordinate);\n}", "title": "" }, { "docid": "aa1f5479f1de1ce461ee708af4ee61f3", "score": "0.63113594", "text": "function initialize(){\n directionsDisplay = new google.maps.DirectionsRenderer({suppressMarkers: true, polylineOptions: {strokeColor: '#464646'}});\n var toronto = new google.maps.LatLng(43.652527, -79.381961);\n var mapOptions={\n zoom: 10,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: toronto\n }\n var walkMapStyles = [\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n { \"color\": \"#efeee4\" }\n ]\n },{\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n { \"color\": \"#f0652f\" },\n { \"weight\": 1.2 }\n ]\n },{\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n { \"color\": \"#f0652f\" }\n ]\n },{\n \"featureType\": \"road.local\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n { \"color\": \"#689aca\" }\n ]\n },{\n \"featureType\": \"water\",\n \"stylers\": [\n { \"color\": \"#464646\" }\n ]\n },{\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n { \"color\": \"#b8b4c1\" }\n ]\n },{\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n { \"weight\": 3.7 }\n ]\n }\n];\n walkMap = new google.maps.Map(document.getElementById(\"map-canvas\"), mapOptions);\n walkMap.setOptions({styles: walkMapStyles});\n panorama = new google.maps.StreetViewPanorama(document.getElementById(\"pano\"));\n directionsDisplay.setMap(walkMap);\n directionsDisplay.setPanel(document.getElementById('directions_box'));\n mapRoute();\n\n\n\n\n}", "title": "" }, { "docid": "87ec585aeefdb1f761f3db71bb2d684d", "score": "0.6303336", "text": "function contactMap() {\n \n var loc = {name:\"NCI\",lat:53.348925,long:-6.242578};\n \n props = {\n center:new google.maps.LatLng(loc.lat,loc.long),\n zoom:10,\n options: {\n gestureHandling: 'greedy'\n },\n mapTypeControl:false,\n streetViewControl:false,\n fullscreenControl:false,\n styles: [\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#b6e3db'}]\n }\n ]\n };\n \n var map = new google.maps.Map(document.getElementById('hubmap'),props);\n\n var marker = new google.maps.Marker({position: props.center});\n marker.setMap(map);\n \n }", "title": "" }, { "docid": "04b449a9e6d58984b56718f14bdc0836", "score": "0.62920064", "text": "function initializeMap() {\n //alert(\"initializing!\");\n var featureOpts = [{\n elementType: 'labels',\n stylers:[\n {visibility: 'off'}\n ]\n }];\n\n var mapCanvas = document.getElementById('map_canvas');\n var mapOptions = {\n center: uci,\n zoom: 13,\n mapTypeId: google.maps.MapTypeId.SATELLITE\n };\n\n map = new google.maps.Map(mapCanvas, mapOptions);\n\n// flightPath = new google.maps.Polyline({\n// strokeColor:\"#0000FF\",\n// strokeOpacity:0.8,\n// strokeWeight:2\n// });\n\n// flightPath.setMap(map);\n\n //Adds the click listener for ploting waypoints\n google.maps.event.addListener(map, 'click', function(event){\n if(editable){\n var len = activePath.getPath().getLength();\n activePath.getPath().push(event.latLng);\n cbridge.pointAddedToMap(event.latLng.lat(),event.latLng.lng(),len,activePathID);\n }\n });\n cbridge.finishedLoading();\n}", "title": "" }, { "docid": "1125dc9e1b2f7c267f880418cad25886", "score": "0.6255108", "text": "function transportMap() {\r\n\r\n var myLatLng = new google.maps.LatLng(36.169941,-115.139830);\r\n var mapProp = {\r\n center: myLatLng,\r\n zoom: 11,\r\n scrollwheel: false,\r\n mapTypeId: google.maps.MapTypeId.ROAD\r\n };\r\n\r\n var map = new google.maps.Map(document.getElementById(\"transport-location-map\"),mapProp);\r\n var marker = new google.maps.Marker({\r\n position:myLatLng,\r\n icon:'images/transport-map-marker.png'\r\n });\r\n\r\n marker.setMap(map);\r\n\r\n map.set('styles',\r\n [\r\n {\r\n \"featureType\": \"administrative\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"saturation\": \"-100\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative.province\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"visibility\": \"off\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"landscape\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"saturation\": -100\r\n },\r\n {\r\n \"lightness\": 65\r\n },\r\n {\r\n \"visibility\": \"on\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"saturation\": -100\r\n },\r\n {\r\n \"lightness\": \"50\"\r\n },\r\n {\r\n \"visibility\": \"simplified\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"saturation\": \"-100\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"visibility\": \"simplified\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.arterial\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"lightness\": \"30\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.local\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"lightness\": \"40\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"transit\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"saturation\": -100\r\n },\r\n {\r\n \"visibility\": \"simplified\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"hue\": \"#ffff00\"\r\n },\r\n {\r\n \"lightness\": -25\r\n },\r\n {\r\n \"saturation\": -97\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"labels\",\r\n \"stylers\": [\r\n {\r\n \"lightness\": -25\r\n },\r\n {\r\n \"saturation\": -100\r\n }\r\n ]\r\n }\r\n ]\r\n ); \r\n }", "title": "" }, { "docid": "a374276b67bd66f18d698ddaa778404f", "score": "0.6253597", "text": "function showFeature(e) {\n //map.fitBounds(e.target.getBounds());\n highlightFeature(e);\n}", "title": "" }, { "docid": "b8c28861546e8d2e8dfdb3dcd86e5742", "score": "0.6244543", "text": "getEachRouteFeature(feature, layer) {\n\t\tif (feature.properties && feature.properties.Nimi) {\n\t\t\tif (feature.properties.url.length > 0) {\n\t\t\t\tlet s = '<div class=\"map-route-info-popup-wrapper\">';\n\t\t\t\ts += '<p class=\"map-feature-title\"><a href=\"'+feature.properties.url+'\" target=\"_blank\">'+feature.properties.Nimi+'</a></p>';\n\t\t\t\ts += 'Tyyppi: '+feature.properties.tyyppi+'<br/>Pituus: '+feature.properties.length+'km</div>';\n\t\t\t\tlayer.bindPopup(s);\n\t\t\t} else {\n\t\t\t\tlet s = '<div class=\"map-route-info-popup-wrapper\">';\n\t\t\t\ts += '<p class=\"map-feature-title\">'+feature.properties.Nimi+'</p>';\n\t\t\t\ts += 'Tyyppi: '+feature.properties.tyyppi+'<br/>Pituus: '+feature.properties.length+'km</div>';\n\t\t\t\tlayer.bindPopup(s);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "b2fc4b8eabc3978a3ef961dd36adecdc", "score": "0.62347305", "text": "function setModal(data,userGEO=LIBGEO){\n var modal = document.querySelector(\".modal\");\n var head = modal.querySelector(\".modal-header\");\n var body = modal.querySelector(\".modal-body\");\n if(userGEO){\n\n userGEO = {\n lat: userGEO.coords.latitude,\n lng: userGEO.coords.longitude\n }\n\n }\n\n console.log(\"userdg\",userGEO,LIBGEO);\n\n var markerArray = [];\n console.log(\"hello\");\n befaft=[userGEO,LIBADDR];// before and after coordinates\n // Instantiate a directions service.\n var directionsService = new google.maps.DirectionsService;\n var map = new google.maps.Map(document.getElementById('map-modal'), {\n zoom: 20,\n center: LIBGEO\n });\n // Create a renderer for directions and bind it to the map.\n var directionsDisplay = new google.maps.DirectionsRenderer({map: map});\n\n // Instantiate an info window to hold step text.\n var stepDisplay = new google.maps.InfoWindow;\n var marker = new google.maps.Marker({\n position: userGEO,\n label: \"YOU ARE HERE\",\n map: map\n });\n\n // Display the route between the initial start and end selections.\n calculateAndDisplayRoute(befaft,\n directionsDisplay, directionsService, markerArray, stepDisplay, map);\n}", "title": "" }, { "docid": "c04f24d5c3e9b092949c5f557ae611ed", "score": "0.6230515", "text": "function initialize() {\n var mapOptions = {\n center: new google.maps.LatLng(43.67390, -79.34085),\n zoom: 15,\n disableDefaultUI: true,\n keyboardShortcuts: false,\n scrollwheel: false,\n styles: [\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 17\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 17\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 29\n },\n {\n \"weight\": 0.2\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 18\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 16\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 21\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 16\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"saturation\": 36\n },\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 40\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 19\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 17\n },\n {\n \"weight\": 1.2\n }\n ]\n }\n ]\n };\n var map = new google.maps.Map(document.getElementById(\"ct-bg\"), mapOptions);\n }", "title": "" }, { "docid": "4b843b8352c75e20a3161f8cec746180", "score": "0.62210995", "text": "function projectTo(latlng){\n\tif (latlng) \n\t{\n\t//added by lavanya satuluri 2-oct 2014 for wcb\n\tif(audeSelect == 1){\n\t var outSR = new esri.SpatialReference({ wkid: 4326});\n\t\t GEOMETRY_SVC.project([latlng], outSR, function(features) {\n\t\t\t//console.log(features);\n\t\t\tvar point = new esri.geometry.Point(features[0].x,features[0].y,new esri.SpatialReference({ wkid: 4326 }));\t\n\t\t\taddMarker(point,2);\n\t\t\taddInfowindow(point,'Location','You are here!');\n\t\t\tmap.setZoom(12);\n\t\t map.centerAt(point);\n map._params.maxZoom = 18;\t\t\t\t\t\t \n\t\t});\n\t}\n\telse{\n\t//end lavanya satuluri 2- oct-2014 \n\t\t var outSR = new esri.SpatialReference({ wkid: 3414});\n\t\t GEOMETRY_SVC.project([latlng], outSR, function(features) {\n\t\t\t//console.log(features);\n\t\t\tvar point = features[0];\n\t\t\taddMarker(point,2);\n\t\t\taddInfowindow(point,'Location','You are here!');\n\t\t\tmap.setZoom(6);\n\t\t\tpointTest = new esri.geometry.Point( {'x':point.x, 'y':point.y,'spatialReference': {'wkt': 'PROJCS[\"WGS_1984_Transverse_Mercator\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",28001.642],PARAMETER[\"False_Northing\",38744.572],PARAMETER[\"Central_Meridian\",103.8333333333333],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",1.366666666666667],UNIT[\"Meter\",1.0]]'} }); \t\t\n\t\t\tmap.centerAt(pointTest);\t\t\t\t\t\t \n\t\t});\n\t\t} //added by lavanya satuluri 2-oct 2014 for wcb\n\t}\n\t}", "title": "" }, { "docid": "9308d8fa92042a4a864f8bc7c38cffcf", "score": "0.61989534", "text": "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 6,\n center: initCenter,\n mapTypeControl: false,\n streetViewControl: false,\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n\n var granteeDataFULL = granteeData;\n var pocArray = [];\n var markerArray=[]; \n\n var icon = {\n url: 'http://www.arcencieldeco.com.tn/wp-content/uploads/2015/10/icon.png',\n scaledSize: new google.maps.Size(73, 50),\n origin: new google.maps.Point(0,0),\n anchor: new google.maps.Point(36.5,50)};\n\n var pocIcon = {\n url: 'http://www.arcencieldeco.com.tn/wp-content/uploads/2015/10/icon.png',\n scaledSize: new google.maps.Size(73, 50),\n origin: new google.maps.Point(0,0),\n anchor: new google.maps.Point(36.5,50)};\n\n var clusterIcon = {\n textColor: '#fff',\n //textSize: 14,\n url: 'https://raw.githubusercontent.com/googlemaps/v3-utility-library/master/markerclusterer/images/m1.png', \n height: 52, \n width: 53\n };\n\n var clusterStyles = [\n //3 different types of markers: small, medium, and large are all set to look the same\n clusterIcon, clusterIcon, clusterIcon\n ];\n var mcOptions = {\n styles: clusterStyles,\n maxZoom: 15,\n gridSize: 30,\n imageSizes: [50, 50, 50]\n };\n\n // I'm not using granteeDataFULL['marker'] bc you can't access a whole array \n // of just one array like that and I need to pass in an array to the map() method in addMarkers\n for(i=0;i<granteeDataFULL.length;i++){\n granteeDataFULL[i]['poly']=[];\n granteeDataFULL[i]['Geography'] = granteeDataFULL[i]['Geography'].split(\"; \");\n granteeDataFULL[i]['Year Grant Received'] = granteeDataFULL[i]['Year Grant Received'].split(\"; \");\n granteeDataFULL[i]['Type of Grant Received'] = granteeDataFULL[i]['Type of Grant Received'].split(\"; \");\n for(j=0;j<granteeDataFULL[i]['Type of Grant Received'].length;j++){\n if(granteeDataFULL[i]['Type of Grant Received'][j]==='CIG') granteeDataFULL[i]['Type of Grant Received'][j]='Community Innovation Grant';\n if(granteeDataFULL[i]['Type of Grant Received'][j]==='GP') granteeDataFULL[i]['Type of Grant Received'][j]='Giving Project';\n if(granteeDataFULL[i]['Type of Grant Received'][j]==='FSC') granteeDataFULL[i]['Type of Grant Received'][j]='Fund of the Sacred Circle';\n if(granteeDataFULL[i]['Type of Grant Received'][j]==='SCF') granteeDataFULL[i]['Type of Grant Received'][j]='Social Change Fund';\n if(granteeDataFULL[i]['Type of Grant Received'][j]==='EFBL') granteeDataFULL[i]['Type of Grant Received'][j]='Emergency Fund for Black Lives';\n }\n granteeDataFULL[i]['Description'] = granteeDataFULL[i]['Description'].split(\"; \");\n if(granteeDataFULL[i]['POC led?']==='TRUE') pocArray.push(granteeDataFULL[i]);\n }\n \n var markerClusterer = addMarkers(granteeDataFULL, map, markerArray, icon, mcOptions); \n addPolys(granteeDataFULL, map);\n setGranteeListBox(granteeDataFULL);\n addListeners(granteeDataFULL, markerClusterer.getMarkers(), map);\n addNameListeners(granteeDataFULL, markerClusterer.getMarkers(), map);\n\n /////////////////////////////////////////////////////////////////////////////////////////////////////\n /////////////// INIT BUTTONS /////////////\n /////////////////////////////////////////////////////////////////////////////////////////////////////\n\n var resetButtonControlDiv = document.createElement('div');\n var resetView = new ResetView(resetButtonControlDiv, map);\n resetButtonControlDiv.index = 1;\n map.controls[google.maps.ControlPosition.TOP_RIGHT].push(resetButtonControlDiv);\n\n\n var pocControlDiv = document.createElement('div');\n var pocMap = new PocMap(pocControlDiv, granteeDataFULL, pocArray, map, markerArray, markerClusterer, icon, pocIcon, mcOptions); \n pocControlDiv.index = 1;\n map.controls[google.maps.ControlPosition.TOP_RIGHT].push(pocControlDiv);\n}", "title": "" }, { "docid": "dfd37fee49a33915fabd23a738cf9f4e", "score": "0.61936504", "text": "function initMap(data, routeId) {\n console.log(routeId);\n let mapOptions = {\n center: new google.maps.LatLng(59.334591, 18.06324),\n zoom: 4,\n styles: [\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#444444\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#ff0000\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#fecd01\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"saturation\": -100\n },\n {\n \"lightness\": 45\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#006bab\"\n },\n {\n \"visibility\": \"on\"\n }\n ]\n },\n ]\n };\n\n map = new google.maps.Map(document.getElementById(\"go2SwedenMap\" + routeId), mapOptions);\n mapArray[routeId] = map;\n\n setPolylineStarterFunction(data, routeId);\n addPlaces(data.places, routeId);\n handlesBounds(data.places, routeId);\n\n if (!initZoom) {\n firstMapId = routeId;\n initZoom = true\n } else {\n mapArray[routeId].setZoom(mapArray[firstMapId].zoom);\n }\n}", "title": "" }, { "docid": "278d365430a24f5419b6e711d5fd525a", "score": "0.6192546", "text": "function init() {\n var locations = [\n ['Xirosoft', 23.810331, 90.412521, 3],\n ['Xirosoft', 23.9980797, 90.4229848],\n ['Xirosoft', 23.8780696, 90.2540589],\n ];\n\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 10,\n center: new google.maps.LatLng(23.810331, 90.412521),\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n\n\n styles: [{ \"featureType\": \"water\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#e9e9e9\" }, { \"lightness\": 17 }] }, { \"featureType\": \"landscape\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#f5f5f5\" }, { \"lightness\": 20 }] }, { \"featureType\": \"road.highway\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 17 }] }, { \"featureType\": \"road.highway\", \"elementType\": \"geometry.stroke\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 29 }, { \"weight\": 0.2 }] }, { \"featureType\": \"road.arterial\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 18 }] }, { \"featureType\": \"road.local\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 16 }] }, { \"featureType\": \"poi\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#f5f5f5\" }, { \"lightness\": 21 }] }, { \"featureType\": \"poi.park\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#dedede\" }, { \"lightness\": 21 }] }, { \"elementType\": \"labels.text.stroke\", \"stylers\": [{ \"visibility\": \"on\" }, { \"color\": \"#ffffff\" }, { \"lightness\": 16 }] }, { \"elementType\": \"labels.text.fill\", \"stylers\": [{ \"saturation\": 36 }, { \"color\": \"#333333\" }, { \"lightness\": 40 }] }, { \"elementType\": \"labels.icon\", \"stylers\": [{ \"visibility\": \"off\" }] }, { \"featureType\": \"transit\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#f2f2f2\" }, { \"lightness\": 19 }] }, { \"featureType\": \"administrative\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"color\": \"#fefefe\" }, { \"lightness\": 20 }] }, { \"featureType\": \"administrative\", \"elementType\": \"geometry.stroke\", \"stylers\": [{ \"color\": \"#fefefe\" }, { \"lightness\": 17 }, { \"weight\": 1.2 }] }]\n });\n\n var infowindow = new google.maps.InfoWindow();\n\n var marker, i;\n\n for (i = 0; i <= locations.length; i++) {\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(locations[i][1], locations[i][2]),\n map: map,\n icon: 'assets/img/home1.png',\n });\n\n google.maps.event.addListener(marker, 'click', (function (marker, i) {\n return function () {\n infowindow.setContent(locations[i][0]);\n infowindow.open(map, marker);\n }\n })(marker, i));\n }\n\n\n }", "title": "" }, { "docid": "8ea0b41a32bbd1623728893b61f94e8a", "score": "0.61885446", "text": "function onMapClick(e) {\r\n\t\tswitch (toolFunction) {\r\n\t\t\tcase 'marker':\r\n\t\t\tplaceMarker (e.latlng);\r\n\t\t\tbreak;\r\n\t\t\tcase 'measure':\r\n\t\t\t\tplaceMeasurePolyline(e.latlng);\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t//No default\r\n\t\t\t}\r\n\t}", "title": "" }, { "docid": "9c9eb0d853d5dafa4f299dcde94803e2", "score": "0.618739", "text": "function initMap(){\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n zoom: 10 ,\r\n center: nyuSternCoordenates\r\n\r\n });\r\n\r\n university_marker = new google.maps.Marker({\r\n position: nyuSternCoordenates,\r\n map: map\r\n });\r\n\r\n directionsService = new google.maps.DirectionsService();\r\n directionsRenderer = new google.maps.DirectionsRenderer();\r\n\r\n map.data.loadGeoJson(D_GEOSHAPES_URL);\r\n map.data.setStyle({\r\n fillColor: 'green',\r\n fillOpacity: 0.2,\r\n strokeColor: 'blue',\r\n strokeWeight: 1\r\n});}", "title": "" }, { "docid": "df80135f29886bb8a3cf0df0cd8f6741", "score": "0.6183221", "text": "function loadMapScenario() {\n\n // create map centered map of Hamilton\n map = new Microsoft.Maps.Map('#myMap', {\n center: new Microsoft.Maps.Location(43.254, -79.863),\n zoom: 12\n });\n\n\n //Load the directions module.\n Microsoft.Maps.loadModule('Microsoft.Maps.Directions', function () {\n //Create an instance of the directions manager.\n directionsManager = new Microsoft.Maps.Directions.DirectionsManager(map);\n //Specify where to display the route instructions.\n directionsManager.setRenderOptions({\n itineraryContainer: '#directionsItinerary'\n });\n //Specify the where to display the input panel\n directionsManager.showInputPanel('directionsPanel');\n });\n\n\n\n //Request the user's location\n function success(position) {\n loc = new Microsoft.Maps.Location(\n position.coords.latitude,\n position.coords.longitude);\n\n //Add a pushpin at the user's location.\n var pin = new Microsoft.Maps.Pushpin(loc, {\n color: 'green'\n });\n\n\n pin.metadata = {\n title: 'User',\n description: \"Longitude :\" + position.coords.longitude + \"<br> Latitude:\" + position.coords.latitude\n };\n\n\n //Add a click event handler to the pushpin.\n Microsoft.Maps.Events.addHandler(pin, 'click', pushpinClicked);\n\n\n map.entities.push(pin);\n\n //Center the map on the user's location.\n map.setView({\n location: loc,\n zoom: 12\n });\n\n All();\n\n }\n\n //error message if user denies location access\n function error(noPosition) {\n document.getElementById('error').innerHTML = \"PERMISSION_DENIED: The Location acquisition process <b>Failed</b> Because the Document does<br> not have permission to use the Location API\";\n pageScroll();\n map.setView({\n zoom: 15\n });\n }\n\n //Create an infobox at the center of the map but don't show it.\n infobox = new Microsoft.Maps.Infobox(loc, {\n visible: false\n });\n\n infobox.setMap(map);\n\n\n navigator.geolocation.getCurrentPosition(success, error); //check if user allow location access or not.\n\n }", "title": "" }, { "docid": "b4455172c1d0796bf0df1a3e70aecfba", "score": "0.61792284", "text": "function create_map_points() {\n // retreive the names and lat/lng of the campers on the bus\n\tlet elements = JSON.parse(String(document.getElementById(\"mapsection\").getAttribute(\"value\")));\n\tvar latitudes = elements.latitudes;\n\tvar longitudes = elements.longitudes;\n\tvar pointnames = elements.pointnames;\n\n // retreive the final destination of the bus (camp counselor/staff drop off)\n\tlet elements_final = JSON.parse(String(document.getElementById(\"hidden_value\").getAttribute(\"value\")));\n\tlet latitude_final = elements_final.latitudes;\n\tlet longitude_final = elements_final.longitudes;\n\tlet pointname_final = elements_final.pointnames;\n\tvar final_waypoint = L.Routing.waypoint(L.latLng(parseFloat(latitude_final[0].latitude), parseFloat(longitude_final[0].longitude)), pointname_final);\n\n // add the camper's names and destinations to waypoint array\n for (let i = 0, size=latitudes.length; i < size; i++)\n waypoints.push(L.Routing.waypoint(L.latLng(parseFloat(latitudes[i].latitude), parseFloat(longitudes[i].longitude)), pointnames[i].camper_name));\n\n // first point on the map is the starting location (determined by driver's current GPS device location)\n new_waypoint_ordering.push(start_waypoint);\n\n // reorder the waypoints\n reorder();\n\n // final point of the waypoint is controlled by admin input (once all counselors have been dropped)\n new_waypoint_ordering.push(final_waypoint);\n\n // for location control\n var geocoder = L.Control.Geocoder.nominatim();\n\n // alas, create the route!\n L.Routing.control({\n addWaypoints: false,\n plan: L.Routing.plan(new_waypoint_ordering, {\n\n // custom marker reference from https://gis.stackexchange.com/questions/236934/leaflet-routing-control-change-marker-icon\n createMarker: function (i, start, n){\n var marker_icon = null;\n if (i == 0) {\n marker_icon = startIcon;\n } else if (i == n -1) {\n marker_icon = harvardIcon;\n }\n else {\n marker_icon = childIcon;\n }\n var marker = L.marker (start.latLng, {\n draggable: false,\n bounceOnAdd: false,\n bounceOnAddOptions: {\n duration: 1000,\n height: 800,\n function(){\n (bindPopup(\"camper_point\").openOn(map));\n }\n },\n icon: marker_icon\n });\n return marker;\n },\n routeWhileDragging: false,\n draggableWaypoints: false,\n geocoder: geocoder\n })\n }).addTo(map);\n}", "title": "" }, { "docid": "e7316a0ace443dfa18adec89e7bfde77", "score": "0.61782104", "text": "function openStreetGeoSearch(){\n /* Initialize basic map */\n var map = L.map('cpdl-map').setView([52.0852378,5.3846249], 9);\n L.tileLayer(\n 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n }).addTo(map);\n\n /* Create searchcontrols */\n\n var GeoSearchControl = window.GeoSearch.GeoSearchControl;\n var OpenStreetMapProvider = window.GeoSearch.OpenStreetMapProvider;\n var provider = new OpenStreetMapProvider({});\n\n // Define search controls\n var searchControl = new GeoSearchControl({\n provider: provider,\n style: 'bar',\n showMarker: true,\n marker: {\n draggable: true\n },\n autoClose: true,\n keepResult: true,\n });\n \n // Add searchbar to the map\n map.addControl(searchControl);\n\n /* Create new layer for markers */\n map.on('geosearch/showlocation', function(e) {\n $('#listing_address').val(e.location.label);\n $(\"#lat\").val(e.location.y);\n $(\"#lng\").val(e.location.x);\n // add marker\n var markers = L.markerClusterGroup();\n var lcIcon = L.icon({ // Custom Icon \n iconUrl: 'images/logo.png',\n iconSize: [38, 95], // size of the icon\n }); \n var marker = L.marker(new L.LatLng(e.location.y, e.location.x), { title: e.location.label, icon: lcIcon });\n marker.bindPopup(e.location.label);\n markers.addLayer(marker);\n map.addLayer(markers);\n });\n\n /*map.on('click', function(e) {\n var newMarker = new L.marker(e.latlng).addTo(map);\n $(\"#lat\").val(e.location.y);\n $(\"#lng\").val(e.location.x);\n\n });\n */\n map.on('geosearch/marker/dragend', function(e) {\n $('#listing_address').val(e.location.label);\n $(\"#lat\").val(parseFloat(e.location.lat));\n $(\"#lng\").val(parseFloat(e.location.lng));\n });\n\n \n }", "title": "" }, { "docid": "fa96a8a019ef46efc5bb3620520e7688", "score": "0.61765337", "text": "function createFeatures(EQData) {\n function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }\n//4) Extract the radious size of the format multply for 20000 for format\n function radiusSize(magn) {\n return magn * 20000;\n }\n\n//5) Depending on their magnituted give them different colors\n function circleColor(magn) {\n if (magn < 1) {\n return \"purple\"\n }\n else if (magn < 2) {\n return \"blue\"\n }\n else if (magn < 3) {\n return \"green\"\n }\n else if (magn < 4) {\n return \"#ebff33\"\n }\n else if (magn < 5) {\n return \"#ebff33\"\n }\n else {\n return \"red\"\n }\n }\n//5) Estblished an earthque variable where you store the data and the latitude and longitude of the variables extract from the USG\n var earthquakesdata = L.geoJSON(EQData, {\n pointToLayer: function(EQData, latlng) {\n return L.circle(latlng, {\n radius: radiusSize(EQData.properties.mag),\n color: circleColor(EQData.properties.mag),\n fillOpacity: 1\n });\n },\n onEachFeature: onEachFeature\n });\n createMap(earthquakesdata);\n}", "title": "" }, { "docid": "f3490062ae2ebc39755dd2e0e83abe51", "score": "0.61573106", "text": "function click_handler(event) {\r\n var feature = event.feature;\r\n var content;\r\n cleanupExistingOverlay();\r\n\r\n // gather available info and render it\r\n var name = feature.getProperty('name');\r\n if (name !== undefined && name !== null) {\r\n content = \"<div><lr><b>\" + name + \"</b></lr><hr/></div>\";\r\n }\r\n var name_aka = feature.getProperty('name-aka');\r\n if (name_aka !== undefined && name_aka !== null) {\r\n var data3 = \"Also known as: \" + name_aka;\r\n content += \"<div>\" + data3 + \"</div>\"\r\n }\r\n // for city, add any other info\r\n var pointType = feature.getProperty('type');\r\n if (pointType !== undefined && pointType !== null) {\r\n if (pointType === 'city') {\r\n var capital = feature.getProperty('capital');\r\n if (capital !== undefined && capital !== null) {\r\n var data1 = \"Capital of <b>\" + capital + \"</b>\";\r\n content = content + \"<div>\" + data1 + \"</div>\"\r\n }\r\n }\r\n var river = feature.getProperty('river');\r\n if (river !== undefined && river !== null) {\r\n var data2 = \"On banks of \" + river;\r\n content += \"<div>\" + data2 + \"</div>\"\r\n }\r\n }\r\n // get info\r\n info = event.feature.getProperty('info');\r\n if (info !== undefined && info !== null) {\r\n content += \"<div><lr><p>\" + info + \"</p></lr></div>\"\r\n }\r\n // get info-link\r\n var info_link = feature.getProperty('info-link');\r\n if (info_link !== undefined && info_link !== null) {\r\n content += \"<hr><font size=\\\"1\\\"><a href=\\\"\" + info_link + \"\\\">More info</a></font></hr>\";\r\n }\r\n if (content !== undefined && content !== null) {\r\n // for point, retrieve exact position\r\n if (feature.getGeometry().getType() === \"Point\") {\r\n position = feature.getGeometry().get();\r\n }\r\n else {\r\n position = event.latLng;\r\n }\r\n cleanupExistingOverlay();\r\n var popup_div = getElementForOverlay();\r\n popup_div.innerHTML = content;\r\n currentPopup = new Popup(position, popup_div);\r\n currentPopup.setMap(map);\r\n }\r\n}", "title": "" }, { "docid": "3fdadb492d87a22723684275c3ff4dba", "score": "0.6153651", "text": "function googleGeoSearch() {\n\n var markers = [];\n var map = new google.maps.Map(document.getElementById('cpdl-map'), {\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: {lat: 40.674, lng: -73.945},\n zoom: 12,\n mapTypeControl: true,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,\n position: google.maps.ControlPosition.BOTTOM_CENTER\n },\n zoomControl: true,\n zoomControlOptions: {\n position: google.maps.ControlPosition.LEFT_BOTTOM\n },\n scaleControl: true,\n streetViewControl: true,\n streetViewControlOptions: {\n position: google.maps.ControlPosition.RIGHT_BOTTOM\n },\n fullscreenControl: false,\n styles: [\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e9e9e9\"\n },\n {\n \"lightness\": 17\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 17\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 29\n },\n {\n \"weight\": 0.2\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 18\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 16\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n },\n {\n \"lightness\": 21\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#dedede\"\n },\n {\n \"lightness\": 21\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 16\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"saturation\": 36\n },\n {\n \"color\": \"#333333\"\n },\n {\n \"lightness\": 40\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f2f2f2\"\n },\n {\n \"lightness\": 19\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#fefefe\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#fefefe\"\n },\n {\n \"lightness\": 17\n },\n {\n \"weight\": 1.2\n }\n ]\n }\n ]\n });\n $('#cpdl-map').append(' <input id=\"pac-input\" class=\"form-control controls\" type=\"text\" placeholder=\"Search Box\">');\n // Create the search box and link it to the UI element.\n var input = document.getElementById('pac-input');\n var searchBox = new google.maps.places.SearchBox(input);\n map.controls[google.maps.ControlPosition.TOP].push(input);\n\n // Bias the SearchBox results towards current map's viewport.\n map.addListener('bounds_changed', function() {\n searchBox.setBounds(map.getBounds());\n });\n\n var markers = [];\n // Listen for the event fired when the user selects a prediction and retrieve\n // more details for that place.\n searchBox.addListener('places_changed', function() {\n var places = searchBox.getPlaces();\n\n if (places.length == 0) {\n return;\n }\n\n // Clear out the old markers.\n markers.forEach(function(marker) {\n marker.setMap(null);\n });\n markers = [];\n\n // For each place, get the icon, name and location.\n var bounds = new google.maps.LatLngBounds();\n places.forEach(function(place) {\n if (!place.geometry) {\n console.log(\"Returned place contains no geometry\");\n return;\n }\n var icon = {\n url: place.icon,\n size: new google.maps.Size(71, 71),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(17, 34),\n scaledSize: new google.maps.Size(25, 25)\n };\n\n // Create a marker for each place.\n markers.push(new google.maps.Marker({\n map: map,\n icon: icon,\n title: place.name,\n position: place.geometry.location\n }));\n\n $('#listing_address').val(place.formatted_address);\n $(\"#lat\").val(parseFloat(place.geometry.location.lat()));\n $(\"#lng\").val(parseFloat(place.geometry.location.lng()));\n\n if (place.geometry.viewport) {\n // Only geocodes have viewport.\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n });\n \n map.fitBounds(bounds);\n\n \n });\n }", "title": "" }, { "docid": "dc1ad3427ec03b0bda165a86bbe52f49", "score": "0.61485076", "text": "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 14,\n center: { lat: -33.9, lng: 151.2 },\n mapTypeControl: false,\n scrollwheel: false,\n styles: [{ 'featureType': 'water', 'elementType': 'geometry', 'stylers': [{ 'color': '#e9e9e9' }, { 'lightness': 17 }] }, { 'featureType': 'landscape', 'elementType': 'geometry', 'stylers': [{ 'color': '#f5f5f5' }, { 'lightness': 20 }] }, { 'featureType': 'road.highway', 'elementType': 'geometry.fill', 'stylers': [{ 'color': '#ffffff' }, { 'lightness': 17 }] }, { 'featureType': 'road.highway', 'elementType': 'geometry.stroke', 'stylers': [{ 'color': '#ffffff' }, { 'lightness': 29 }, { 'weight': 0.2 }] }, { 'featureType': 'road.arterial', 'elementType': 'geometry', 'stylers': [{ 'color': '#ffffff' }, { 'lightness': 18 }] }, { 'featureType': 'road.local', 'elementType': 'geometry', 'stylers': [{ 'color': '#ffffff' }, { 'lightness': 16 }] }, { 'featureType': 'poi', 'elementType': 'geometry', 'stylers': [{ 'color': '#f5f5f5' }, { 'lightness': 21 }] }, { 'featureType': 'poi.park', 'elementType': 'geometry', 'stylers': [{ 'color': '#dedede' }, { 'lightness': 21 }] }, { 'elementType': 'labels.text.stroke', 'stylers': [{ 'visibility': 'on' }, { 'color': '#ffffff' }, { 'lightness': 16 }] }, { 'elementType': 'labels.text.fill', 'stylers': [{ 'saturation': 36 }, { 'color': '#333333' }, { 'lightness': 40 }] }, { 'elementType': 'labels.icon', 'stylers': [{ 'visibility': 'off' }] }, { 'featureType': 'transit', 'elementType': 'geometry', 'stylers': [{ 'color': '#f2f2f2' }, { 'lightness': 19 }] }, { 'featureType': 'administrative', 'elementType': 'geometry.fill', 'stylers': [{ 'color': '#fefefe' }, { 'lightness': 20 }] }, { 'featureType': 'administrative', 'elementType': 'geometry.stroke', 'stylers': [{ 'color': '#fefefe' }, { 'lightness': 17 }, { 'weight': 1.2 }] }]\n });\n setMarkers(map);\n}", "title": "" }, { "docid": "2b23329ff803702f3d335c6a8e8aeecf", "score": "0.6145448", "text": "populateGeoPreviewBody(geoData = this.geoData) {\n if (this.geoMap == null) {\n this.geoMap = L.map('earthquake-preview-map');\n }\n this.geoMap.setView([this.currentLocation.latitude, this.currentLocation.longitude], 9);\n L.esri.basemapLayer('Topographic').addTo(this.geoMap);\n this.quakeLayer = this.getQuakeLayer(geoData).addTo(this.geoMap);\n this.geoMap.on('moveend', event => {\n // moveend is fired when the map is loaded for the first time,\n // ignore the first event trigger\n if (this.geoMapLoadEvent) {\n this.geoMapLoadEvent = false;\n return;\n }\n\n // get new map center coordinates and create object with correct format\n const _coords = event.target.getCenter();\n const newCenter = {\n latitude: _coords.lat,\n longitude: _coords.lng\n };\n\n // if distance moved was small (like centering on a nearby point),\n // do not update\n if (this.getDistance(this.geoMapLocation, newCenter) < (this.maxRadius / 3)) {\n return;\n } else {\n this.geoMapLocation = newCenter;\n }\n\n let startDate = new Date();\n startDate.setDate(startDate.getDate() - 14);\n\n const geoQuery = {\n format: 'geojson',\n starttime: startDate.toISOString(),\n latitude: newCenter.latitude,\n longitude: newCenter.longitude,\n maxradiuskm: this.maxRadius,\n eventtype: 'earthquake',\n limit: this.geoLimit,\n jsonerror: true\n };\n\n this.geoService.fetchGeoData(geoQuery)\n .then(geoData => {\n this.geoData = geoData.features;\n this.geoMap.removeLayer(this.quakeLayer);\n this.quakeLayer = this.getQuakeLayer(geoData).addTo(this.geoMap);\n })\n .catch(error => console.error(error));\n });\n }", "title": "" }, { "docid": "8bac85237988802d381802b88f6562c0", "score": "0.614018", "text": "function onMapClick(e)\n{\n // gives you coorindates of the location where the map is clicked\n let waypointCoordinates = e.lngLat;\n waypointsArray.push(new Point(waypointCoordinates.lng, waypointCoordinates.lat));\n // check if waypoint within appropriate range\n if (waypointsArray.length == 1) // check first waypoint against source\n {\n // if waypoint not in range, remove waypoint and alert\n if (sourcePort.coord.getDistance(waypointsArray[0]) > 1000 || sourcePort.coord.getDistance(waypointsArray[0]) < 10)\n {\n alert(\"Waypoint too close or too far from the last location\");\n waypointsArray.pop()\n }\n else // if in range, keep waypoint and add marker\n {\n // adding a marker at waypoint\n markerArray.push(new mapboxgl.Marker({ \"color\": \"#FF8C00\" }).setLngLat([waypointCoordinates.lng, waypointCoordinates.lat]).addTo(waypointMap));\n // remove old layer\n waypointMap.removeLayer(\"pathBetweenWaypoints\");\n waypointMap.removeSource(\"pathBetweenWaypoints\");\n // saving coordinates of waypoints into line object\n lineObject.data.geometry.coordinates = [sourcePortCoords, waypointsArray[0].getCoordinates(), destinationPortCoords];\n // adding layer - generating lines\n waypointMap.addLayer({\n id: \"pathBetweenWaypoints\",\n type: \"line\",\n source: lineObject,\n layout: { \"line-join\": \"round\", \"line-cap\": \"round\" },\n paint: { \"line-color\": \"#888\", \"line-width\": 6 }\n });\n // enable undo and confirm buttons if there are waypoints set\n document.getElementById(\"undoWaypointButton\").disabled = false;\n }\n }\n else // check against previous waypoint\n {\n if (waypointsArray[waypointsArray.length - 2].getDistance(waypointsArray[waypointsArray.length - 1]) > 1000 || waypointsArray[waypointsArray.length - 2].getDistance(waypointsArray[waypointsArray.length - 1]) < 10)\n {\n alert(\"Waypoint too close or too far from the last location\");\n waypointsArray.pop()\n }\n else\n {\n // adding a marker at waypoint\n markerArray.push(new mapboxgl.Marker({ \"color\": \"#FF8C00\" }).setLngLat([waypointCoordinates.lng, waypointCoordinates.lat]).addTo(waypointMap));\n // remove old layer\n waypointMap.removeLayer(\"pathBetweenWaypoints\");\n waypointMap.removeSource(\"pathBetweenWaypoints\");\n lineObject.data.geometry.coordinates = [];\n lineObject.data.geometry.coordinates.push(sourcePortCoords);\n for(let i = 0; i < waypointsArray.length; i++)\n {\n lineObject.data.geometry.coordinates.push(waypointsArray[i].getCoordinates());\n }\n lineObject.data.geometry.coordinates.push(destinationPortCoords);\n // adding layer - generating lines\n waypointMap.addLayer({\n id: \"pathBetweenWaypoints\",\n type: \"line\",\n source: lineObject,\n layout: { \"line-join\": \"round\", \"line-cap\": \"round\" },\n paint: { \"line-color\": \"#888\", \"line-width\": 6 }\n });\n // enable undo and confirm buttons if there are waypoints set\n document.getElementById(\"undoWaypointButton\").disabled = false;\n }\n }\n}", "title": "" }, { "docid": "4bf7eaea596507a4a37608b9a6bdd661", "score": "0.613849", "text": "function initMap() {\n console.log(document.getElementById(\"map\"));\n var myLatLng = { lat: 50.115126, lng: 8.538058 };\n var latlng = new google.maps.LatLng(50.115126, 8.538058);\n var map = new google.maps.Map(document.getElementById(\"map\"), {\n center: latlng,\n zoom: 16,\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n // The marker, positioned in FRA-Hoechst\n var marker = new google.maps.Marker({\n position: myLatLng,\n map: map,\n // title: \"my office\",\n animation: google.maps.Animation.DROP\n // icon: image\n });\n }", "title": "" }, { "docid": "86e78afa6133c16fc0b2c03eccae1c22", "score": "0.61375445", "text": "function map() {\r\n var myLatLng = new google.maps.LatLng(40.6700, -73.9400);\r\n var mapProp = {\r\n center: myLatLng,\r\n zoom: 11,\r\n scrollwheel: false \r\n };\r\n\r\n var map = new google.maps.Map(document.getElementById(\"event-location-map\"),mapProp);\r\n var marker = new google.maps.Marker({\r\n position:myLatLng,\r\n icon:'images/events/map-marker.png'\r\n });\r\n\r\n var contentString = '<div id=\"map-details\">'+\r\n '<div class=\"body-content\">' +\r\n '<h4>East CS Auditorium</h4>'+\r\n '<p>Outreach Operations, 1111 West Jackson Avenue <br />Oxford, MS 38655 </p>'+\r\n '</div>'+\r\n '</div>';\r\n\r\n var infowindow = new google.maps.InfoWindow({\r\n content: contentString\r\n });\r\n\r\n infowindow.open(map,marker);\r\n marker.setMap(map);\r\n\r\n map.set('styles',\r\n [\r\n {\r\n \"featureType\": \"all\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"saturation\": 36\r\n },\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 40\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"all\",\r\n \"elementType\": \"labels.text.stroke\",\r\n \"stylers\": [\r\n {\r\n \"visibility\": \"on\"\r\n },\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 16\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"all\",\r\n \"elementType\": \"labels.icon\",\r\n \"stylers\": [\r\n {\r\n \"visibility\": \"off\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative\",\r\n \"elementType\": \"geometry.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 20\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative\",\r\n \"elementType\": \"geometry.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 17\r\n },\r\n {\r\n \"weight\": 1.2\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"landscape\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 20\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 21\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"geometry.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 17\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"geometry.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 29\r\n },\r\n {\r\n \"weight\": 0.2\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.arterial\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 18\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.local\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 16\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"transit\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 19\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 17\r\n }\r\n ]\r\n }\r\n ] \r\n ); \r\n }", "title": "" }, { "docid": "afbe48d8f6f34755f78a7e1bdb709298", "score": "0.61338127", "text": "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h2><center> Location <br></h2>\" + feature.properties.place +\n \"<hr><center><h2>Magnitude<br></h2>\"+feature.properties.mag);\n }", "title": "" }, { "docid": "c4d938030de608529e3ec44383a58728", "score": "0.6128203", "text": "function get_click_latlng(_click_event_lat, _click_event_lng) {\n\n\n if (_mapclick_in_use) {\n\n\n // --- current use 2X2 grid boundary (as click event latlong is on center point), you can use 3x3 grid or adjust house length to make larger/smaller select area. \n var _square_house_length = 0.0004;\n\n\n SWlong = _click_event_lng - _square_house_length;\n SWlat = _click_event_lat - _square_house_length;\n NElong = _click_event_lng + _square_house_length;\n NElat = _click_event_lat + _square_house_length;\n\n\n\n //var _url_click_event = base_url + 'api/loadall/' + $(\"#areaID\").val() + '/' + $(\"#subjectID\").val() + '/' + SWlong + '/' + SWlat + '/' + NElong + '/' + NElat + '/';\n var _url_click_event = \"/api/geojson/feature/\" + $(\"#areaID\").val() + '/' + $(\"#subjectID\").val() + \"/\" + SWlong + \"/\" + SWlat + \"/\" + NElong + \"/\" + NElat + \"/\";\n\n document.getElementById(\"ajaxload\").style.display = \"block\";\n ajax_GeoJSON(map, _url_click_event, true);\n\n }\n\n\n}", "title": "" }, { "docid": "078551cc554114be74b5964bd11af610", "score": "0.61246973", "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": "0a93db497758769d202d4fe11e8e1731", "score": "0.61224294", "text": "function initialize() {\n// handleResize();\n loadCurrentMap(); \n// var ge = new GoogleEarth(map);\n ////////////////////////////////////////////////////\n ////\n drawingManager.setMap(map);\n/////////////////////////////////////////////////////////////\n displayGeoPanel();\n var searchoptions = {\n \ttypes: ['geocode']\n };\n searchGoogle = document.getElementById('geocodetxt');\n autocomplete = new google.maps.places.Autocomplete(searchGoogle,searchoptions);\n autocomplete.bindTo('bounds',map); \n\n panoramioLayer = new google.maps.panoramio.PanoramioLayer({\n\t suppressInfoWindows: true\n});\n setPhotoWidget();\n \n var tag = document.getElementById('tag');\n var button = document.getElementById('filter-button');\n google.maps.event.addDomListener(button, 'click', function() {\n panoramioLayer.setTag(tag.value);\n });\n map.controls[google.maps.ControlPosition.TOP].push(\n document.getElementById('filter')); \n markerFrom = new google.maps.Marker({\n map: map,\n shadow: shadow,\n icon: purpleimageA,\n shape: shape,\n });\n markerTo = new google.maps.Marker({\n \t map: map,\n shadow: shadow,\n icon: purpleimageB,\n shape: shape\n });\n markerFrom.setVisible(false);\n markerTo.setVisible(false);\n locationFrom=null;\n locationTo=null;\n directionsDisplayOptions = {\n \t map: map,\n \t preserveViewport: true,\n \t suppressInfoWindows: true,\n \t suppressMarkers: true\n };\n directionsDisplay = new google.maps.DirectionsRenderer(directionsDisplayOptions);\n// directionsDisplay.setMap(map);\n directionsDisplay.setPanel(document.getElementById(\"sidebar\"));\n// directionsDisplay.setPanel(document.getElementById(\"directionsPanel\"));\n//////////////////////////////////////////////////////////////\n listTracks();\n listMarkers();\n listCircles();\n listRectangles();\n listPolygons();\n listPolylines();\n// google.maps.event.addListener(map,'click',function(event){\n// createTrackInfoWindow(event.latLng);}); \n google.maps.event.addListener(map,'mousemove',function(event){\n displayLatLong(event.latLng);}); \n google.maps.event.addListener(drawingManager, 'overlaycomplete', function(event) {\n switch(event.type) {\n case google.maps.drawing.OverlayType.CIRCLE :\n var geoscircle;\n \t displayCircleHook(event.overlay,null);\n \t var formValues=$(\"form#hookcirclepanel\").serialize();\n $.ajax({\n \t async: false,\n \t type: \"POST\",\n\t url: \"createcircle\",\n\t data: formValues,\n dataType: \"json\",\n success: function(data, status){\n \tgeoscircle = data.geoscircle;\n \tdisplayCircleHook(event.overlay,geoscircle); \n \t \tsetEventsOnCircle(event.overlay,geoscircle); \t\n \t } // end on success\n\t }); // end of the new Ajax.Request() call\n break;\n case google.maps.drawing.OverlayType.MARKER :\n var geosmarker;\n\n \t displayMarkerHook(event.overlay,\"\",null);\n \t var formValues=$(\"form#hookmarkerpanel\").serialize();\n $.ajax({\n \t async: false,\n \t type: \"POST\",\n\t url: \"createmarker\",\n\t data: formValues,\n dataType: \"json\",\n success: function(data, status){ \n \tgeosmarker = data.geosmarker;\n \tdisplayMarkerHook(event.overlay,\"\",geosmarker); \n \t \tsetEventsOnMarker(event.overlay,geosmarker); \t\n \t } // end on success\n\t }); // end of the new Ajax.Request() call\n \t break;\n case google.maps.drawing.OverlayType.RECTANGLE :\n var geosrectangle;\n \t displayRectangleHook(event.overlay,null);\n \t var formValues=$(\"form#hookrectanglepanel\").serialize();\n $.ajax({\n \t async: false,\n \t type: \"POST\",\n\t url: \"createrectangle\",\n\t data: formValues,\n dataType: \"json\",\n success: function(data, status){\n \t geosrectangle = data.geosrectangle;\n \t displayRectangleHook(event.overlay,geosrectangle); \n \t \t setEventsOnRectangle(event.overlay,geosrectangle); \t\n } // end on success\n\t }); // end of the new Ajax.Request() call\n \t break;\n case google.maps.drawing.OverlayType.POLYLINE :\n var geospolyline;\n \t displayPolylineHook(event.overlay,null);\n \t var formValues=$(\"form#hookpolylinepanel\").serialize();\n $.ajax({\n \t async: false,\n \t type: \"POST\",\n\t url: \"createpolyline\",\n\t data: formValues,\n dataType: \"json\",\n success: function(data, status){\n \t geospolyline = data.geospolyline;\n \t displayPolylineHook(event.overlay,geospolyline); \n \t \t setEventsOnPolyline(event.overlay,geospolyline); \t\n } // end on success\n\t }); // end of the new Ajax.Request() call\n\n \t break; \t \n case google.maps.drawing.OverlayType.POLYGON :\n var geospolygon;\n \t displayPolygonHook(event.overlay,null);\n \t var formValues=$(\"form#hookpolygonpanel\").serialize();\n $.ajax({\n \t async: false,\n \t type: \"POST\",\n\t url: \"createpolygon\",\n\t data: formValues,\n dataType: \"json\",\n success: function(data, status){\n \t geospolygon = data.geospolygon;\n \t displayPolygonHook(event.overlay,geospolygon); \n \t \t setEventsOnPolygon(event.overlay,geospolygon); \t\n } // end on success\n\t }); // end of the new Ajax.Request() call\n \t break; \t \n \t default:\n } //switch\n });\n }", "title": "" }, { "docid": "3debb53e477c7ea5892e6261f242383b", "score": "0.6114267", "text": "function initialize() {\n var centre = new google.maps.LatLng(13.0503, 80.2235);\n var mapOptions = {\n center: centre,\n zoom: 14,\n //mapTypeId: google.maps.MapTypeId.ROADMAP,\n // ULTRA LIGHT: style: [{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#e9e9e9\"},{\"lightness\":17}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f5f5f5\"},{\"lightness\":20}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":17}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":18}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f5f5f5\"},{\"lightness\":21}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#dedede\"},{\"lightness\":21}]},{\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#333333\"},{\"lightness\":40}]},{\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f2f2f2\"},{\"lightness\":19}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":17},{\"weight\":1.2}]}]\n style: [{\"featureType\":\"landscape\",\"stylers\":[{\"visibility\":\"simplified\"},{\"color\":\"#2b3f57\"},{\"weight\":0.1}]},{\"featureType\":\"administrative\",\"stylers\":[{\"visibility\":\"on\"},{\"hue\":\"#ff0000\"},{\"weight\":0.4},{\"color\":\"#ffffff\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"labels.text\",\"stylers\":[{\"weight\":1.3},{\"color\":\"#FFFFFF\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f55f77\"},{\"weight\":3}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f55f77\"},{\"weight\":1.1}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f55f77\"},{\"weight\":0.4}]},{},{\"featureType\":\"road.highway\",\"elementType\":\"labels\",\"stylers\":[{\"weight\":0.8},{\"color\":\"#ffffff\"},{\"visibility\":\"on\"}]},{\"featureType\":\"road.local\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels\",\"stylers\":[{\"color\":\"#ffffff\"},{\"weight\":0.7}]},{\"featureType\":\"poi\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi\",\"stylers\":[{\"color\":\"#6c5b7b\"}]},{\"featureType\":\"water\",\"stylers\":[{\"color\":\"#f3b191\"}]},{\"featureType\":\"transit.line\",\"stylers\":[{\"visibility\":\"on\"}]}]\n };\n // Get the HTML DOM element that will contain your map \n // We are using a div with id=\"map\" seen below in the <body>\n var mapElement = document.getElementById('map');\n\n // Create the Google Map using our element and options defined above\n var map = new google.maps.Map(mapElement, mapOptions);\n\n // Let's also add a marker while we're at it\n var marker = new google.maps.Marker({\n position: centre,\n map: map,\n title: 'MealBasket'\n }); \n\n /*var rad = 2000;\n\n var circle = new google.maps.Circle({\n center: centre,\n radius: rad,\n strokeColor: \"#F29500\",\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: \"#D9B700\",\n fillOpacity: 0.3,\n map: map\n });*/\n }", "title": "" }, { "docid": "799fad40c25bd2382c70760c2bd428f1", "score": "0.6102992", "text": "function LinkGeoData() {\r\n // HTML5/W3C Geolocation\r\n if (navigator.geolocation) {\r\n updateCulturePOI();\r\n updateCultureMemoryPOI();\r\n updateBikeMapPOI();\r\n navigator.geolocation.getCurrentPosition(UserLocation);\r\n //sort_POI_by_distance();\r\n }\r\n // Default to Washington, DC\r\n else\r\n NearestPOI(0, 0);\r\n}", "title": "" }, { "docid": "8b83ff6f2c9ff5f121357928abd8e902", "score": "0.610002", "text": "function displayRoute()\n{\n let coordinates = [];//initialise coordinates array\n let originPoint = [route.origin.lng, route.origin.lat];\n coordinates.push(originPoint);//first point is the origin.\n if (route.wayPoints.length > 0)\n {\n for (let i = 0; i < route.wayPoints.length; i++)//add all way points in order.\n {\n let point = [route.wayPoints[i].lng, route.wayPoints[i].lat];\n coordinates.push(point);\n }\n }\n let destPoint = [route.destination.lng, route.destination.lat];\n coordinates.push(destPoint);//last point is the destination.\n pointList = coordinates;\n\n geoObject.data.geometry.coordinates = coordinates;\n\n if (layerState == true) //if layer already exists, remove layer.\n {\n map.removeLayer(\"route\");\n map.removeSource(\"route\");\n }\n\n removeMarkers(); // Remove, then add all markers.\n setMarkers();\n\n map.addLayer({\n id: \"route\",\n type: \"line\",\n source: geoObject,\n layout: { \"line-join\": \"round\", \"line-cap\": \"round\" },\n paint: { \"line-color\": \"#888\", \"line-width\": 6 }\n });\n layerState = true; //layer now exists on map.\n}", "title": "" }, { "docid": "bdfd4f5627077d7baff99bd719627fa0", "score": "0.60973096", "text": "function showDetails(e, d) {\n\n // determine this feature's: \n // 1) path length\n // 2) area in pixels\n // 3) boundary box as two pixel coordinates\n // 4) center point as a pixel coordinate\n let pathLength = geoGenerator.measure(d);\n let area = geoGenerator.area(d);\n let bounds = geoGenerator.bounds(d);\n let centerPoint = geoGenerator.centroid(d);\n\n // show current country name\n d3.select('#content .info .name').text( d.properties.name );\n\n // show current country details\n // you can add custom data directly to your geoJSON\n // or in an additional file\n d3.select('#content .info .details')\n .html( \n \"<span>Area: \" + area.toFixed(1) + \"</span>\"\n + \"<span>Path Length: \" + pathLength.toFixed(1) + \"</span>\"\n + \"<span>Center Point: \" + centerPoint[0].toFixed(1) + \", \" + centerPoint[1].toFixed(1) + \"</span>\"\n );\n\n // draw center point of the current country\n d3.select('#content .centroid')\n .style('display', 'inline')\n .attr('transform', 'translate(' + centerPoint + ')');\n\n // draw bounding box of the current country\n d3.select('#content .bounding-box rect')\n .attr('x', bounds[0][0])\n .attr('y', bounds[0][1])\n .attr('width', bounds[1][0] - bounds[0][0])\n .attr('height', bounds[1][1] - bounds[0][1]);\n\n}", "title": "" }, { "docid": "dbb5ff0757c4337f5fd8870673a0c300", "score": "0.6095706", "text": "function loadMap(houses) {\n map.on('load', function() {\n map.addSource('places', {\n type: 'geojson',\n data: {\n type: 'FeatureCollection',\n features: houses\n }\n });\n map.addLayer({\n id: 'places',\n type: 'symbol',\n source: 'places',\n layout: {\n 'icon-image': '{icon}-15',\n 'icon-size': 1.5,\n 'text-field': '{storeId}',\n 'text-font': ['Open Sans Semibold', 'Arial Unicode MS Bold'],\n 'text-offset': [0, 0.9],\n 'text-anchor': 'top'\n }\n });\n // When a click event occurs on a feature in the places layer, open a popup at the\n // location of the feature, with description HTML from its properties.\n map.on('click', 'places', function(e) {\n var coordinates = e.features[0].geometry.coordinates.slice();\n var description = e.features[0].properties.description;\n var address = e.features[0].properties.Address;\n var img = e.features[0].properties.image;\n var price = e.features[0].properties.price;\n // Ensure that if the map is zoomed out such that multiple\n // copies of the feature are visible, the popup appears\n // over the copy being pointed to.\n while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {\n coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;\n }\n\n new mapboxgl.Popup()\n .setLngLat(coordinates)\n .setHTML('<img src=\"/img/' + img + ' \" alt=\"\" style =\"max-width:100%;\"> <br> <h1 style=\"font-size: 22px;\">' + address + ' </h1> <br><p>'+description+'</p> <h4><b>'+price+'$</b>/day</h4>')\n .addTo(map);\n });\n\n // Change the cursor to a pointer when the mouse is over the places layer.\n map.on('mouseenter', 'places', function() {\n map.getCanvas().style.cursor = 'pointer';\n });\n\n // Change it back to a pointer when it leaves.\n map.on('mouseleave', 'places', function() {\n map.getCanvas().style.cursor = '';\n });\n });\n}", "title": "" }, { "docid": "b2666993bf0027315b3fcabb8f3a3b91", "score": "0.60903883", "text": "function initMap() {\n //The api is loaded at this step\n //L'api est chargée à cette étape\n\n // add translations\n translate();\n\n //options for creating viewer:\n var options= {\n // default value\n // valeur par défaut\n //mode:'normal',\n // default value\n // valeur par défaut\n //territory:'FXX',\n // default value\n // valeur par défaut\n //displayProjection:'IGNF:RGF93G'\n // only usefull when loading external resources\n // utile uniquement pour charger des resources externes */\n proxy:'/geoportail/api/xmlproxy'+'?url='\n };\n\n // viewer creation of type <Geoportal.Viewer>\n // création du visualiseur du type <Geoportal.Viewer>\n // HTML div id, options\n viewer= new Geoportal.Viewer.Default('viewerDiv', OpenLayers.Util.extend(\n options,\n // API keys configuration variable set by\n // <Geoportal.GeoRMHandler.getConfig>\n // variable contenant la configuration des clefs API remplie par\n // <Geoportal.GeoRMHandler.getConfig>\n window.gGEOPORTALRIGHTSMANAGEMENT===undefined? {'apiKey':'nhf8wztv3m9wglcda6n6cbuf'} : gGEOPORTALRIGHTSMANAGEMENT)\n );\n if (!viewer) {\n // problem ...\n OpenLayers.Console.error(OpenLayers.i18n('new.instance.failed'));\n return;\n }\n\n //Loading of data layers\n //Chargement des couches de données\n viewer.addGeoportalLayers([\n 'ORTHOIMAGERY.ORTHOPHOTOS',\n 'GEOGRAPHICALGRIDSYSTEMS.MAPS'],\n {});\n\n //Adding a KML layer: centers of territories\n //Ajout d'une couche KML : les centres des territoires\n viewer.getMap().addLayer(\"KML\",\n {\n /**\n * layer_name parameter\n * holds the text that will be displayed by the layers switcher\n * contient le texte qui sera affiché dans le gestionnaire de couches\n */\n 'places.kml.name':\n {\n 'de':\"Bemerkenswerte Orte\",\n 'en':\"Outstanding places\",\n 'es':\"Lugares destacables\",\n 'fr':\"Lieux remarquables\",\n 'it':\"Luoghi di notevole\"\n }\n },\n /**\n * url_to_kml parameter\n * holds the path to the KML resource\n * Chemin d'accès aux données KML\n */\n\n \"../data/territories_centers.kml\",\n {\n /**\n * kml_options\n * optional: holds information about the KML layer behavior\n * optionnel: contient les informations permettant d'affiner le comportement de la couche KML\n */\n //layer's projection. By default, it is set to the map's projection\n projection:OpenLayers.Projection.CRS84,//always set projection when setting maxExtent\n\n //The maximum viewable extent for the layer\n //Emprise visible maximale de la couche\n maxExtent:new OpenLayers.Bounds(-180, -90, 180, 90),\n /**\n * minZoomLevel\n * smallest scale. Defaults to 0 (world zoom)\n * échelle la plus petite d'affichage. Par défaut, c'est 0 (échelle monde entier)\n */\n\n minZoomLevel:0,\n /**\n * maxZoomLevel\n * highest scale. Defaults the zoom mapped with the base layers' highest scale;\n * échelle la plus grande d'affichage. Par défaut, c'est le zoom correspondant à l'échelle maximale de la carte de base;\n */\n\n maxZoomLevel:10\n }\n /**\n * options_popup\n * optional: holds information about the KML popup behavior\n * optionnel: contient les informations permettant d'affiner le comportement des popups associées à la couche KML\n */\n\n );\n\n //Adding a KML layer: territories\n //Ajout d'une couche KML : les territoires\n\n viewer.getMap().addLayer(\"KML\",\n {\n 'territories.kml.name':\n {\n 'de':\"Gebiete\",\n 'en':\"Territories\",\n 'es':\"Territorios\",\n 'fr':\"Territoires\",\n 'it':\"Territori\"\n }\n },\n \"../data/territories.kml\",\n {//kml_options:\n /**\n * In order to customize the display and behavior of the KML popups, one has to overload the following options:\n * Pour modifier le rendu et le comportement par défaut des fiches KML, il faut surcharger les options:\n * preFeatureInsert, onFeatureInsert, onSelect, onUnselect, et, éventuellement, hover.\n */\n\n preFeatureInsert:\n\n /**\n * Add a label styling on feature's style.\n * Only applied when OpenLayers >= 2.8\n * Parameters:\n * f - {OpenLayers.Feature} the newly created feature.\n */\n\n function(f) {\n if (f) {\n // default Geoportal API : cursor pointer on hover ...\n Geoportal.Popup.setPointerCursorForFeature(f);\n // See. http://code.google.com/intl/fr/apis/kml/documentation/kmlreference.html#labelstyle\n OpenLayers.Util.extend(f.style, {\n label: f.attributes.name,\n labelAlign: \"rb\",\n fontColor: \"yellow\",\n fontWeight: \"bold\",\n fontSize: \"12px\",\n fontFamily: \"Courier New, monospace\"\n });\n }\n },\n projection:OpenLayers.Projection.CRS84,//always set projection when setting maxExtent\n maxExtent:new OpenLayers.Bounds(-180, -90, 180, 90),\n minZoomLevel: 0,\n maxZoomLevel:10\n },\n {//options_popup\n onSelect:openWikipediaPopup,\n onUnselect:function(f){},//default OpenLayers : do nothing\n handlersOptions:{\n feature:{\n stopDown:false//allow pan map when drag in feature\n }\n }\n });\n //Adding a KML layer: 1/100,000th scale maps\n //Ajout d'une couche KML : la série 1:100 000\n\n //on hover => highlight the sheet's name (TITRE_COMP)\n //au survol => mettre en évidence le nom de la feuille (TITRE_COMP)\n\n var s100Style= new OpenLayers.StyleMap({\n \"default\": new OpenLayers.Style({\n strokeColor:'#ffffff',\n strokeWidth:2,\n fillColor:'#000000',\n fillOpacity:0.5\n }),\n \"temporary\": new OpenLayers.Style({\n strokeColor:'#00ff00',\n strokeWidth:2,\n fillColor:'#00ff00',\n fillOpacity:0.5,\n //see context object below\n label: \"${getTITRE_COMP}\",\n labelAlign: \"rb\",\n labelBackgroundColor: \"yellow\",\n labelBorderColor: \"black\",\n labelBorderSize: \"1px\",\n fontColor: \"black\",\n fontWeight: \"bold\",\n fontSize: \"12px\",\n fontFamily: \"Courier New, monospace\"\n },{\n\n /**\n * The context object contains a function which is referenced in the symbolizer\n * This function will be called with the feature as an argument when using the appropriate style(\"temporary\")\n *\n * L'objet contexte contient une fonction appelée dans le symboliseur\n * Cette fonction qui prend comme argument feature ,sera appelée lors de l'utilisation du style \"temporary\"\n */\n\n context:{\n getTITRE_COMP: function(f) {\n return f.attributes['TITRE_COMP'].value;\n }\n }\n }),\n \"select\": new OpenLayers.Style({\n strokeColor:'#ff0000',\n strokeWidth:2,\n fillColor:'#ff0000',\n fillOpacity:0.5\n })\n });\n\n var s100= viewer.getMap().addLayer(\"KML\",\n {\n 'top100.kml.name':\n {\n 'de':\"1/100000 Maßstab Karten\",\n 'en':\"1/100,000th scale maps\",\n 'es':\"Mapas a escala 1/100000\",\n 'fr':\"Cartes 1:100 000ième\",\n 'it':\"Mappe in scala 1/100000\"\n }\n },\n \"../data/S_TOP100.kml\",\n {\n projection:OpenLayers.Projection.CRS84,//always set projection when setting maxExtent\n // don't give maxExtent, let the API compute it ...\n minZoomLevel: 0,\n maxZoomLevel:10,\n opacity: 0.75,\n styleMap:s100Style,\n eventListeners:{\n /**\n * beforefeaturehighlighted: function(e){},//e.feature to get access to the feature\n * featurehighlighted: function(e){},\n * featureunhighlighted: function(e){}\n */\n\n }\n },\n {\n\n /**\n * extractStyles:\n * eading indicator of KML styles\n * By default, it is set to true. If it is set to false, it is up to the developper to add the styles\n *\n * indicateur de lecture des styles KML\n * Par défaut, il est mis à true. Si mis à false, c'est au développeur d'ajouter les styles\n */\n\n formatOptions:{\n extractStyles:false //styles deactivation\n },\n hover:true,\n\n // Permet de mettre en évidence les données\n highlightOnly:true,\n //name of the style to be applied\n //Nom du style à appliquer\n renderIntent:\"temporary\",\n onSelect: function(f){},//do nothing\n onUnselect: function(f){},//do nothing\n handlersOptions:{\n feature:{\n stopDown:false//allow pan map when drag in feature\n }\n }\n });\n /**\n * getPopupDefaults:\n * Builds popup feature default behaviours for:\n * Crée une popup avec des comportements par défaut pour:\n * select, unselect and hover callbacks.\n *\n * We create a popup object which values are:\n * On crée un objet popup dont les valeurs sont :\n *\n {\n multipleKey: null,\n toggleKey: null,\n multiple: false,\n clickout: true,\n toggle: true,\n hover: false,\n highlightOnly: false,\n box: false,\n onBeforeSelect: function() {},\n onSelect: Geoportal.Control.selectFeature,\n onUnselect: Geoportal.Control.unselectFeature,\n scope: null,\n geometryTypes: null,\n callbacks: null,\n handlersOptions: null,\n selectStyle: null,\n renderIntent: \"select\"\n }\n */\n\n var selectS100Opts= OpenLayers.Util.extend( viewer.getMap().getPopupDefaults('KML'), {\n handlersOptions:{\n feature:{\n stopDown:false//allow pan map when drag in feature\n }\n }\n });\n\n //The object that is created is used to make a selection control\n //L'objet crée est utilisé pour faire un contrôle de sélection\n\n var selectS100= new OpenLayers.Control.SelectFeature(s100, selectS100Opts);\n viewer.getMap().addControl(selectS100);\n /**\n * onVisibilityChange:\n * Activate or Deactivate the select control of a layer or layers.\n * When all layers are not visible, the control is deactivated, otherwise it is activated.\n */\n\n viewer.getMap().events.on({\"changelayer\":Geoportal.Map.onVisibilityChange, scope:selectS100});\n\n viewer.getMap().setCenterAtLonLat(3.00, 36.25, 2);\n // cache la patience - hide loading image\n viewer.div.style[OpenLayers.String.camelize('background-image')]= 'none';\n}", "title": "" }, { "docid": "4812eebed4bfe65b1335ead69f2b2bd1", "score": "0.6088504", "text": "function initMap() {\n \n // Creates the Google Map 'gMap'\n gMap = new google.maps.Map(document.getElementById('gmap'), {\n center: {lat: 37.0902, lng: -95.7129},\n zoom: 5,\n zoomControl: true,\n mapTypeControl: false,\n //mapTypeId: 'terrain',\n scaleControl: true,\n streetViewControl: false,\n rotateControl: true,\n fullscreenControl: false,\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n \n \n // Adds a listener to close the info-window\n gMap.addListener('click', function() {\n $(\"#info-window\").hide();\n });\n \n // Creates applicable markers\n LoadMarkers();\n getLocation(); // DEBUG\n \n } // End function initMap()", "title": "" }, { "docid": "ce13380d663c0ed05342fe922f7f454f", "score": "0.608561", "text": "function showAddress (e) {\n var geocodeService = new L.esri.Geocoding.Services.Geocoding();\n\n geocodeService.reverse().latlng(e.latlng).run(function(error, result) {\n //append address of coordinates to the \"Access Index\" sidebar\n $('#features').append('<div class=\"panel-heading coordinate\"> Address: ' + result.address.Match_addr + '</div>');\n //place marker & popup with address on coordinates selected\n L.marker(result.latlng).addTo(map).bindPopup(result.address.Match_addr).openPopup();\n });\n\n}", "title": "" }, { "docid": "3086211753563ae68ef08989ba6cbc59", "score": "0.60802203", "text": "configMapClick() {\n // Listen for a map click, get the features under the pointer\n // and pass them to a \"clickMap\" action that might update our UI\n // or highlight the feature in the stylesheet:\n this.map.on('click', event => {\n const features = this.map.queryRenderedFeatures(event.point);\n\n // Send a specific feature to the action/reducer:\n const selectedFeature = features.filter(f => f.layer.id === NODES_LAYER)[0];\n\n var data = null;\n if (selectedFeature !== undefined) {\n data = selectedFeature;\n } else {\n data = {\n type: \"mapClick\",\n lng: event.lngLat.lng,\n lat: event.lngLat.lat,\n }\n }\n this.props.clickMap(data);\n\n // We can also use the native mapbox popup if the clickMap\n // action sets some html to show and passes it as a prop:\n if(this.props.showPopUp && this.props.popup != null) {\n new mapboxgl.Popup({className: 'popup'})\n .setLngLat(event.lngLat)\n .setHTML(this.props.popup)\n .addTo(this.map);\n }\n });\n }", "title": "" }, { "docid": "d2dfda7f477824a8a0712bac51a9e9bd", "score": "0.60802054", "text": "function GetMap( position ) {\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(GetMap);\n }\n else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n\n\n fetch('../washingpoints').then(function(response) {\n return response.json();\n }).then(function(myJson) {\n console.log(myJson);\n\n // Create a new map\n var map = new atlas.Map(\"myMap\", {\n //Add your Azure Maps subscription key to the map SDK. Get an Azure Maps key at https://azure.com/maps\n authOptions: {\n authType: 'subscriptionKey',\n subscriptionKey: 'yxBj4IKqdo6W7Hs9TDwIpMVUkiYRQXvMUdp5wBLKJqs'\n }\n });\n map.events.add(\"load\", function () {\n // Add Traffic Flow to the Map\n\n /*map.setTraffic({\n flow: \"relative\"\n });\n */\n\n //Create a data source and add it to the map.\n datasource = new atlas.source.DataSource();\n map.sources.add(datasource);\n //Add a layer for rendering the route lines and have it render under the map labels.\n map.layers.add(new atlas.layer.LineLayer(datasource, null, {\n strokeColor: ['get', 'strokeColor'],\n strokeWidth: ['get', 'strokeWidth'],\n lineJoin: 'round',\n lineCap: 'round',\n filter: ['==', '$type', 'LineString']\n }), 'labels');\n //Add a layer for rendering point data.\n map.layers.add(new atlas.layer.SymbolLayer(datasource, null, {\n iconOptions: {\n image: ['get', 'icon'],\n allowOverlap: true\n },\n textOptions: {\n textField: ['get', 'title'],\n offset: [0, 1.2]\n },\n filter: ['==', '$type', 'Point']\n }));\n //Create the GeoJSON objects which represent the start and end point of the route.\n\n /**/\n var marker = {style : '<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"30\" height=\"37\" viewBox=\"0 0 30 37\" xml:space=\"preserve\"><rect x=\"0\" y=\"0\" rx=\"8\" ry=\"8\" width=\"30\" height=\"30\" fill=\"{color}\"/><polygon fill=\"{color}\" points=\"10,29 20,29 15,37 10,29\"/><text x=\"15\" y=\"20\" style=\"font-size:16px;font-family:arial;fill:#ffffff;\" text-anchor=\"middle\">{text}</text></svg>',\n color : 'Red'};\n // var user = {name: \"You\", position: {long = position.coords.longitude, lat = position.coords.latitude}};\n var user = {name: \"You\", position: {long : 26.070248, lat : 44.475976}};\n // var startPoint = new atlas.data.Feature(new atlas.data.Point([position.coords.longitude, position.coords.latitude]), {\n\n var startPoint = {pin: new atlas.data.Feature(new atlas.data.Point([user.position.long, user.position.lat]),\n {\n title: user.name,\n icon: 'pin-round-red'\n }),\n marker: new atlas.HtmlMarker({\n htmlContent: marker.style,\n text: user.name,\n color: marker.color,\n position: [user.position.long, user.position.lat],\n popup: new atlas.Popup({\n content: '<a href=\"https://www.w3schools.com\"> You </a>',\n pixelOffset: [0, -30]\n })\n })\n };\n\n //Create array with every Washing Point\n\n // console.log(myJson.result.length);\n /*Database informations*/\n washing_points_info = [];\n\n for(let i = 0; i < myJson.result.length; i++){\n washing_points_info.push({name: myJson.result[i].name, position: {long: myJson.result[i].longitude, lat: myJson.result[i].latitude}, link: \" http://localhost:3000/homepage.html\"});\n }\n /*\n washing_points_info.push({name: \"1\", position: {long: 26.102194, lat: 44.432511}, link: \"https://www.w3schools.com\"});\n washing_points_info.push({name: \"2\", position: {long: 26.056066, lat: 44.445172}, link: \"https://www.w3schools.com\"});\n washing_points_info.push({name: \"3\", position: {long: 26.089901, lat: 44.432660}, link: \"https://www.w3schools.com\"});\n */\n\n var washing_points = [];\n\n for(let i = 0; i < washing_points_info.length; i++) {\n let cont = '<a width=\"200\" href=\"http://localhost:3000/homepage.html\">' + washing_points_info[i].name + '</a>';\n\n // console.log(washing_points_info[i].name);\n // console.log(washing_points_info[i].position);\n // console.log(cont);\n // console.log(marker);\n\n washing_points.push({pin: new atlas.data.Feature(new atlas.data.Point([washing_points_info[i].position.long, washing_points_info[i].position.lat]),\n {\n title: washing_points_info[i].name,\n icon: 'pin-round-red'\n }),\n distance:0,\n marker: new atlas.HtmlMarker({\n htmlContent: marker.style,\n text: i+1,\n color: marker.color,\n position: [washing_points_info[i].position.long, washing_points_info[i].position.lat],\n popup: new atlas.Popup({\n content: cont,\n pixelOffset: [0, -30]})\n })\n });\n }\n\n // Use SubscriptionKeyCredential with a subscription key\n var subscriptionKeyCredential = new atlas.service.SubscriptionKeyCredential(atlas.getSubscriptionKey());\n // Use subscriptionKeyCredential to create a pipeline\n var pipeline = atlas.service.MapsURL.newPipeline(subscriptionKeyCredential);\n // Construct the RouteURL object\n var routeURL = new atlas.service.RouteURL(pipeline);\n\n\n //Start and end point input to the routeURL\n routes_promises = [];\n\n\n for(let i = 0; i < washing_points.length; i++){\n washing_points[i].coords = [[startPoint.pin.geometry.coordinates[0], startPoint.pin.geometry.coordinates[1]], [washing_points[i].pin.geometry.coordinates[0], washing_points[i].pin.geometry.coordinates[1]]];\n routes_promises[i] = routeURL.calculateRouteDirections(atlas.service.Aborter.timeout(10000), washing_points[i].coords);\n }\n\n // Calculate every route to washing points and save distance\n Promise.all(routes_promises).then((directions) => {\n for(let i = 0; i < washing_points.length; i++){\n washing_points[i].distance = directions[i].routes[0].summary.lengthInMeters;\n washing_points[i].directions = directions[i];\n }\n //Sort washing points by shortest distance\n washing_points.sort(function(a, b){ return a.distance - b.distance});\n\n for(let i = washing_points.length - 1; i >= 0; i--){\n //Get data features from response\n var data = washing_points[i].directions.geojson.getFeatures();\n //Get the route line and add some style properties to it.\n var routeLine = data.features[0];\n if(i == 0) {\n // Shortest path\n routeLine.properties.strokeColor = '#f02e15';\n } else {\n // Other paths\n routeLine.properties.strokeColor = '#2272B9';\n }\n console.log(routeLine);\n routeLine.properties.strokeWidth = 5;\n //Add the route line to the data source. We want this to render below the car route which will likely be added to the data source faster, so insert it at index 0.\n datasource.add(routeLine);\n }\n\n //Fit the map window to the bounding box defined by the start and end positions.\n map.setCamera({\n bounds: atlas.data.BoundingBox.fromData([startPoint.pin, washing_points[washing_points.length-1].pin]),\n padding: 130\n });\n\n //Add the data to the data source.\n\n //datasource.add(startPoint);\n map.markers.add(startPoint.marker);\n for(let i = 0; i < washing_points.length; i++){\n map.markers.add(washing_points[i].marker);\n // Activate Pop-UP on marker click\n map.events.add('click',washing_points[i].marker, () => {\n washing_points[i].marker.togglePopup();\n });\n //datasource.add(washing_points[i].pin);\n }\n });\n });\n });\n\n //==================== Log IN Section =================================\n\n // Get the modal\n var modalLogin = document.getElementById('id01');\n var modalSignUp = document.getElementById('id02');\n\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function(event) {\n if (event.target == modalLogin) {\n modalLogin.style.display = \"none\";\n }\n if (event.target == modalSignUp) {\n modalSignUp.style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "cec55b5c763c17260fc9f896c7bb001f", "score": "0.60796374", "text": "function move_to_new_layer(features) {\n if (features.length>0 && indiciaData.layerLocationTypes.length > 0) {\n get_map_hierarchy_for_current_position(features[0].id,features[0].attributes.location_type_id);\n }\n}", "title": "" }, { "docid": "02015b02b09150a63dc540713414757b", "score": "0.6075684", "text": "function init_map() {\n\tgoogle_map = new google.maps.Map(document.getElementById('google_map'), {\n\t\tzoom: default_zoom,\n\t\tcenter: default_lat_lng\n\t});\n\n\tvar transitLayer = new google.maps.TransitLayer();\n\ttransitLayer.setMap(google_map);\n\n\t// dynamic color assignment\n\tgoogle_map.data.setStyle(function(feature) {\n\t\tvar custom_color = feature.getProperty('color');\n\t\t\n\t\treturn /** @type {google.maps.Data.StyleOptions} */({\n\t\t fillColor: (custom_color ? custom_color : default_map_color),\n\t\t fillOpacity: 0.6,\n\t\t strokeColor: '#8A8A8A',\n\t\t strokeOpacity: 0.8,\n\t\t strokeWeight: 1\n\t\t});\n\t});\n\n\t// mouseover pop-up\n\tgoogle_map.data.addListener('click', function(event) {\n\t\t// close existing pop-up\n\t\tif(google_map_infowindow) { google_map_infowindow.close(); }\n\n\t\tvar zip = event.feature.getProperty('zip');\n\t\tvar filtered = Perspectives.filter(function(d) { return d['id'] === select_value; })[0];\n\t\tif (filtered.type === 'line') {\n\t\t\tupdate_line_chart(zip);\n\t\t} else if (filtered.type === 'bar') {\n\t\t\tupdate_bar_chart(zip);\n\t\t}\n\t\tvar label = filtered.map_label;\n\t\tvar format = get_nice_format(filtered.format);\n\n\t\tvar datum = event.feature.getProperty('datum');\n\n\t\tgoogle_map_infowindow = new google.maps.InfoWindow({\n\t\t\tcontent: 'Zip Code: ' + zip +\n\t\t\t\t'<br/>City/Place: ' + event.feature.getProperty('place') +\n\t\t\t\t'<br/>County: ' + event.feature.getProperty('county') +\n\t\t\t\t'<br/>'+label+': '+(datum ? format(datum) : 'N/A'),\n\t\t\tposition: event.latLng\n\t\t});\n\t\tgoogle.maps.event.addListener(google_map_infowindow, 'closeclick', function(){\n\t\t reset_series_line_chart();\n\t\t reset_bar_chart();\n\t\t});\n\t\tgoogle_map_infowindow.open(google_map);\n\t});\n\n\t// load map geojson\n\td3.json('/data/GeoJSON/bay_area_zips_full2.geo.json', assign_geo_data);\n}", "title": "" }, { "docid": "85a593caa71ed5d43a7dbdf458477d32", "score": "0.60740113", "text": "function routeIt() {\n\t//find narrative for route on success\n\tdir = MQ.routing.directions()\n\t\t.on('success', function(data) {\n\t\t\tvar legs = data.route.legs,\n\t\t\t\thtml = '',\n\t\t\t\tmaneuvers,\n\t\t\t\ti;\n\n\t\t\tif (legs && legs.length) {\n\t\t\t\tmaneuvers = legs[0].maneuvers;\n\n\t\t\t\tfor (i=0; i < maneuvers.length; i++) {\n\t\t\t\t\thtml += (i+1) + '. ';\n\t\t\t\t\thtml += maneuvers[i].narrative + '<br>';\n\t\t\t\t}\n\n\t\t\t\tL.DomUtil.get('route-narrative').innerHTML = html;\n\t\t\t}\n\t\t});\n\t\t\n\t//get src and dst from map search bars\n\tif(src && dst)\n\t{\t\n\t\tdir.route({\n\t\t\tlocations: [\n\t\t\t\t{latLng: {lat: src.lat, lng: src.lng}},\n\t\t\t\t{latLng: {lat: dst.lat, lng: dst.lng}}\n\t\t\t\t//'28.671023, 77.15017',\n\t\t\t\t//'28.47978, 77.095177'\n\t\t\t\t// 28.671023 ; 77.15017 ; Raghav\n\t\t\t\t// 28.47978 ; 77.095177 ; Cheenu\n\t\t\t\t// 28.673561 ; 77.140227 ; Punjabi Chowk Coordinates. \n\t\t\t],\n\t\t\toptions: {\n\t\t\t\trouteControlPointCollection: controlPointsData\n\t\t\t}\n\t\t});\n\t\tsrc = dst = undefined;\n\t}\n\t//else get src and dst values from input boxes of our page as names\n\t//and lets its geocoder find coordinates by itself in finding route\n\telse\n\t{\n\t\tsrc = document.getElementById('src').value;\n\t\tdst = document.getElementById('dst').value;\n\t\t\n\t\tdir.route({\n\t\t\tlocations: [\n\t\t\t\tsrc,\n\t\t\t\tdst\n\t\t\t\t//{latLng: {lat: src.lat, lng: src.lng}},\n\t\t\t\t//{latLng: {lat: dst.lat, lng: dst.lng}}\n\t\t\t\t//'28.671023, 77.15017',\n\t\t\t\t//'28.47978, 77.095177'\n\t\t\t\t// 28.671023 ; 77.15017 ; Raghav\n\t\t\t\t// 28.47978 ; 77.095177 ; Cheenu\n\t\t\t\t// 28.673561 ; 77.140227 ; Punjabi Chowk Coordinates. \n\t\t\t],\n\t\t\toptions: {\n\t\t\t\trouteControlPointCollection: controlPointsData\n\t\t\t}\n\t\t});\n\t\tsrc = dst = undefined;\n\t}\n\n\tif (rl) {\n\t\tmap.removeLayer(rl);\n\t}\n\n\trl = MQ.routing.routeLayer({\n\t\tdirections: dir,\n\t\tfitBounds: true\n\t}); \n\tmap.addLayer(rl);\n\tconsole.log(\"Direction Set and layer added.\");\n}", "title": "" }, { "docid": "5315ff7f930c8cbe48dea2537a0f0e04", "score": "0.6073399", "text": "function getData(map){\n\n//load the data\n\n$.ajax(\"data/hotspotData.geojson\", {\n\ndataType: \"json\",\n\nsuccess: function(response){\n\n\n//create a Leaflet GeoJSON layer and add it to the map\n\ngeojson = L.geoJson(response, {\n\n\nstyle: function (feature) {\n\nif(feature.properties.TYPE === 'hotspot_area'){\n\nreturn {color: '#de2d26' ,\n\nweight: 2,\n\nstroke: 1};\n\n} else if(feature.properties.TYPE === 'outer_limit'){\n\nreturn { color: '#fc9272',\n\nweight: 2,\n\nstroke: 0,\n\nfillOpacity: .5 };\n\n}\n\n},\n\n\nonEachFeature: function (feature, layer) {\n\nvar popupContent = \"\";\n\nif (feature.properties) {\n\n//loop to add feature property names and values to html string\n\n\npopupContent += \"<p>\" + \"Region\" + \": \" + feature.properties.NAME + \"</p>\";\n\nif (feature.properties.TYPE ===\"hotspot_area\"){\n\npopupContent += \"<p>\" + \"Type: \" + \"Hotspot\" + \"</p>\";\n\n}\n\n\nif (feature.properties.TYPE ===\"outer_limit\"){\n\npopupContent += \"<p>\" + \"Type: \" + \"Hotspot Outer Limit\" + \"</p>\";\n\n}\n\n\nlayer.bindPopup(popupContent);\n\n};\n\n\nlayer.on({\n\nmouseover: highlightFeature,\n\nmouseout: resetHighlight,\n\nclick: panelInfo,\n\nclick: zoomToFeature\n\n});\n\n\n\n\n\n}\n\n\n\n}).addTo(map);\n\n\n//create option to have no biodiversity overlay\n\nvar noneUrl = 'img/.jpg',\n\nnoneBounds = [];\n\nvar none = L.imageOverlay(noneUrl, noneBounds);\n\n\nvar amphibianUrl = 'img/amphibian_richness_10km_all.png',\n\namphibianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar amphibians = L.imageOverlay(amphibianUrl, amphibianBounds);\n\n\nvar caecilianUrl = 'img/caecilian_richness_10km.png',\n\ncaecilianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar caecilians = L.imageOverlay(caecilianUrl, caecilianBounds);\n\n\nvar anuraUrl = 'img/frog_richness_10km.png',\n\nanuraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar anura = L.imageOverlay(anuraUrl, anuraBounds);\n\n\nvar caudataUrl = 'img/salamander_richness_10km.png',\n\ncaudataBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar caudata = L.imageOverlay(caudataUrl, caudataBounds);\n\n\nvar psittaciformesUrl = 'img/psittaciformes_richness.png',\n\npsittaciformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar psittaciformes = L.imageOverlay(psittaciformesUrl, psittaciformesBounds);\n\n\nvar passeriformesUrl = 'img/passeriformes_richness.png',\n\npasseriformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar passeriformes = L.imageOverlay(passeriformesUrl, passeriformesBounds)\n\n\nvar songbirdsUrl = 'img/songbirds_richness.png',\n\nsongbirdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n\nvar songbirds = L.imageOverlay(songbirdsUrl, songbirdsBounds);\n\n\n\n//category names for toggle layers\n\nvar animals = {\n\n\"Overlays Off\": none,\n\n\"All Amphibians\": amphibians,\n\n\"Caecilian\": caecilians,\n\n\"Anura\": anura,\n\n\"Caudata\": caudata,\n\n\"Psittaciformes\": psittaciformes,\n\n\"Passeriformes\": passeriformes,\n\n\"Songbirds\": songbirds\n\n};\n\n\n//\n\nvar overlay = {\n\n\"Hotspots\" : geojson\n\n};\n\n\n//add heatmaps and hotspot to map\n\nL.control.layers(animals, overlay).addTo(map);\n\n\n}\n\n});\n\n}", "title": "" }, { "docid": "1926a81717fdd7ddfcfb4e27de16076b", "score": "0.60724914", "text": "function showPosition() {\n var map = null\n var geocodeService = L.esri.Geocoding.geocodeService();\n map = L.map('map').fitWorld();\n L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {\n attribution: '&copy; <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors'\n }).addTo(map);\n map.locate({setView: true, maxZoom: 16});\n function onLocationFound(e) {\n var radius = e.accuracy;\n console.log(e);\n geocodeService.reverse().latlng(e.latlng).run(function (error, result) {\n if (error) {\n return;\n }\n console.log(result);\n L.marker(result.latlng).addTo(map).bindPopup(result.address.City + \",\" + result.address.Region).openPopup();\n locationUser = result.address.City + \",\" + result.address.Region;\n updateImages();\n });\n\n L.circle(e.latlng, radius).addTo(map);\n }\n\n map.on('locationfound', onLocationFound);\n}", "title": "" }, { "docid": "187d42e0c534b6dd1c1d14e1fe23e99c", "score": "0.60715675", "text": "function onEachFeature(feature, layer) {\n layer.on({\n click: highlightRoute,\n mouseover: highlightRoute,\n mouseout: resetHighlight,\n });\n layer.on({\n click: zoomToFeature\n });\n // does this feature have a property named popupContent?\n if (feature.properties && feature.properties.ROUTE) {\n layer.bindPopup(feature.properties.ROUTE);\n }\n}", "title": "" }, { "docid": "4260bf1b3ec812dfa39ae869bf28288a", "score": "0.60706824", "text": "function showOSMAP() {\n var lat = dms2decimal($('.ep_eprint_latitude').val());\n var lng = dms2decimal($('.ep_eprint_longitude').val());\n var lat2 = dms2decimal($('.ep_eprint_latitude_2').val());\n var lng2 = dms2decimal($('.ep_eprint_longitude_2').val());\n\n if (typeof lat !== 'undefined' && typeof lng !== 'undefined') {\n if (typeof lat2 === 'undefined') lat2 = lat;\n if (typeof lng2 === 'undefined') lng2 = lng;\n \n // Carte interactive\n $('div#localisation-osmap').css({display:'inline-block', width:'960px', height:'400px'});\n var latCentre = (lat + lat2) / 2;\n var lngCentre = (lng + lng2) / 2;\n var map = L.map('localisation-osmap', {minZoom:1,maxZoom:18}).setView([latCentre, lngCentre], 5);\n\n // Ajout du bouton fullscreen\n var fsControl = new L.Control.FullScreen();\n map.addControl(fsControl);\n\n // detect fullscreen toggling\n /*\n map.on('enterFullscreen', function(){\n if(window.console) window.console.log('enterFullscreen');\n });\n map.on('exitFullscreen', function(){\n if(window.console) window.console.log('exitFullscreen');\n });\n */\n\n // https://www.mapbox.com/api-documentation/#maps\n // https://wiki.openstreetmap.org/wiki/Tiles\n if (1 == 0)\n {\n L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {\n attribution: 'Map data &copy; <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"https://www.mapbox.com/\">Mapbox</a>',\n maxZoom: 18,\n id: 'mapbox.outdoors',\n accessToken: 'pk.eyJ1IjoiY2lyYWQiLCJhIjoiY2psYno0YWJ2MmY1ZzNsbnR1MTcxNHN2aSJ9.sIhfY983ewdfW0E_ZOvgNQ'\n }).addTo(map);\n }\n else\n {\n /* Si on ne veut pas utiliser MAPBOX, on peut rester sur OSM */\n L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: 'Map data &copy; <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>',\n maxZoom: 18\n }).addTo(map);\n }\n\n if (lat === lat2 && lng === lng2) {\n var marker = L.marker([latCentre, lngCentre]).addTo(map);\n }\n if (lat !== lat2 || lng !== lng2) {\n var zoneCoords = [\n [ lat, lng ],\n [ lat, lng2 ],\n [ lat2, lng2 ],\n [ lat2, lng ],\n [ lat, lng ]\n ];\n var polygon = L.polygon(zoneCoords, {fill:false}).addTo(map);\n }\n }\n }", "title": "" }, { "docid": "bbbd50562ba72d34b4512ddf9cc19d43", "score": "0.6061788", "text": "function showPosition(position) {\n\n mylat = position.coords.latitude;\n mylon = position.coords.longitude;\n\n // mylat = -29.538502;\n //mylon = 30.278805;\n\n var prox = 0.02;\n \n\n // get points is defined in points.js\n // due to security restrictions in Chrome, AJAX requests cannot be made against local files\n // which is why the data is being loaded as a JavaScript file\n points = getRoutes();\n // alert('getRoute..');\n // show loc on the map\n\n mapAssist.flyTo({\n center: [mylon, mylat],\n pitch: 60, // pitch in degrees\n bearing: -10, // bearing in degrees\n zoom: 12,\n speed: 0.8,\n curve: 1,\n\n });\n\n\n\n // add a new marker for each address\n\n for (pointIndex = 0; pointIndex < points.length && pointIndex < 6000; pointIndex++) {\n point = points[pointIndex];\n // var marker = new tomtom.Marker([point.lat, point.lon], null, { draggable: true });\n // var MyMarker = new tomtom.Marker([point.lat, point.lon]);\n //var markup = point.lat + \", \" + point.lon;\n var mrk = point.Route;\n // var morebtn = \"<img style='text-align:center' src='images/more-icons.png' width='60' height='18' onclick='listToggle()' >\";\n //alert(pointIndex);\n //alert(\"dist\" + dist);\n // var pnlside = \"<div style='border-bottom:1px dashed #b0aeae; display:block;'><br>\" + \" Route Marker: \" + desc + \"<br></div>\";\n if (prox > dist) {\n //document.getElementById(\"sidePnl\").innerHTML += pnlside;\n }\n //alert(\"dist\" + dist);\n\n\n //Distance calc\n var lat1 = mylat;\n var lon1 = mylon;\n var lat2 = point.lat;\n var lon2 = point.lon;\n //alert(\"distXXX\");\n var radlat1 = Math.PI * lat1 / 180;\n var radlat2 = Math.PI * lat2 / 180;\n var radlon1 = Math.PI * lon1 / 180;\n var radlon2 = Math.PI * lon2 / 180;\n var theta = lon1 - lon2;\n var radtheta = Math.PI * theta / 180;\n var dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n dist = Math.acos(dist);\n dist = dist * 180 / Math.PI;\n dist = dist * 60 * 1.1515;\n dist = dist * 1.609344\n var resultcalc = prox - dist;\n\n var desc = \"<strong>Chainge: \" + point.Chainge + \"</strong>\" + \"<br> Route Name: \" + mrk + \"<br>\" + \"Distance: \" + dist.toFixed(2) + \"kms\" + \"<br>\";\n //document.getElementById(\"assistbtn\").src = \"images/sendbigBtn.png\";\n\n if (mrk == \"My Location\") {\n\n mapAssist.addLayer({\n id: 'myLocAssist2',\n type: 'circle',\n paint: {\n 'circle-radius': 15,\n 'circle-color': '#d80909'\n },\n source: {\n type: 'geojson',\n data: {\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: [mylon, mylat] //[30.394778, -29.588352]\n }\n }\n }\n });\n //geo>>>>\n // var geocoder = new tomtom.services.GeocodingService();\n\n // execute the reverse geocoding call\n // geocoder.reverseGeocode(marker.getLatLng(), function (response) {\n\n // var contentAdd = \"No address found.\";\n\n // if (response && response.reverseGeoResponse && response.reverseGeoResponse.reverseGeoResult\n // && response.reverseGeoResponse.reverseGeoResult[0]\n // && response.reverseGeoResponse.reverseGeoResult[0].formattedAddress)\n // contentAdd = response.reverseGeoResponse.reverseGeoResult[0].formattedAddress;\n\n // document.getElementById(\"rest\").innerHTML += \"Address: \" + contentAdd + \"<br>YOUR Co-Ords: \" + \"<br>Latitude: \" + mylat + \"<br> Longitude: \" + mylon;\n\n // });\n\n\n //geo>>>>\n } //else{ iconUrl: \"accomodationxxx.png\";\n\n\n // if (mrk == \"N0304\" && prox > dist) {\n\n if (prox > dist) {\n markerCnt++;\n //marker.bindPopup(desc + \"<br>\" + morebtn, { showOnMouseOver: true });\n\n // map.addLayer(marker);tomtom\n //\n\n mapAssist.addLayer({\n id: 'routMarkAssist',\n type: 'circle',\n paint: {\n 'circle-radius': 15,\n 'circle-color': '#3bc2d0'\n },\n source: {\n type: 'geojson',\n data: {\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: [mylon, mylat] //[30.394778, -29.588352]\n }\n }\n }\n });\n\n // document.getElementById(\"rest\").innerHTML = \"<div>CLOSEST ROUTE MARKER</div>\" + desc + \"<br>\";\n document.getElementById(\"markerCode\").innerHTML = \"<div>CLOSEST ROUTE MARKER</div>\" + desc + \"<br>\";\n //alert(desc);\n } //else{ iconUrl: \"accomodationxxx.png\";\n\n //document.getElementById(\"acc\").innerHTML = markerCnt + \" \" + \"Route Markers\" ;\n\n\n };\n\n }", "title": "" }, { "docid": "84c6d31fbc8dc00640bb3f13dd24f331", "score": "0.6058188", "text": "function initMap() {\n //position where the map will be centered on\n var pos = { lat: -46.426585, lng: 168.373375 };\n map = new google.maps.Map(document.getElementById('map'),\n {\n streetViewControl: false,\n zoom: 15,\n center: pos\n });\n //checks for when the user clicks on the map\n if (Registered) { map.addListener('click', function (f) { clicked(f.latLng) }); }\n var direction = new google.maps.DirectionsService();\n var direction = new google.maps.DirectionsService();\n direction.route(\n {\n origin: { lat: 0, lng: 0 },\n destination: { lat: 0, lng: 0 },\n travelMode: google.maps.TravelMode.WALKING\n },\n function () { initpoly(); })\n}", "title": "" }, { "docid": "9f55974630f8f8b1989f4271f442f58d", "score": "0.60566264", "text": "function geomap(){\n // Margins and SVG dimensions\n let margin = {top: 0, right: 0, bottom: 0, left: 0},\n geomapWidth = $('#geomapContainer').width() - margin.left - margin.right,\n geomapHeight = $('#geomapContainer').height() - margin.top - margin.bottom;\n\n // Append SVG to geomapBody div\n let svgGeomap = d3.select(\"#geomapBody\")\n .append(\"svg\")\n .attr('class', 'world geomap')\n .attr(\"width\", geomapWidth)\n .attr(\"height\", geomapHeight)\n .append('g')\n .attr('class', 'map');\n\n // Append appropriate event listenrs to toggle between world map and US map\n geomapEvents();\n\n // Display World map first\n $('[geomap=\"world\"]').click();\n geomapWorld();\n\n // // Display US map first\n // $('[geomap=\"states\"]').click();\n // geomapStates();\n\n}", "title": "" }, { "docid": "4563ad7c2766de84f891b86751f64cee", "score": "0.60523874", "text": "function locate() {\n mymap.locate({ setView: false, maxZoom: 16 }); \n }", "title": "" }, { "docid": "0a2ac3c78478222afd384af001f566cf", "score": "0.6052117", "text": "function initMap() {\n\n // load the map\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 40, lng: -123},\n zoom: 7,\n styles: [{\n 'stylers': [{'visibility': 'off'}]\n }, {\n 'featureType': 'road.highway',\n 'stylers': [{'visibility': 'simplified'}]\n }, {\n 'featureType': 'administrative',\n 'stylers': [{'visibility': 'on'}]\n }, {\n 'featureType': 'water',\n 'elementType': 'geometry',\n 'stylers': [{'visibility': 'simplified'}]\n }\n ]\n });\n\n\n // set up the style rules and events for google.maps.Data\n map.data.setStyle(styleFeature);\n map.data.addListener('mouseover', mouseInToRegion);\n map.data.addListener('mouseout', mouseOutOfRegion);\n\n // state polygons only need to be loaded once, do them now\n loadMapData();\n\n initControls();\n}", "title": "" }, { "docid": "ba398a3a30a02bf2f86c882a6418559f", "score": "0.60518044", "text": "function initMap() {\n var directionsService = new google.maps.DirectionsService();\n var directionsRenderer = new google.maps.DirectionsRenderer();\n var iconBase =\n 'https://developers.google.com/maps/documentation/javascript/examples/full/images/';\n\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 18,\n center: {lat: 10.762666, lng: 106.682352},\n mapTypeId: google.maps.MapTypeId.HYBRID\n });\n var khtnMaker = new google.maps.Marker({\n position:{lat: 10.762666, lng: 106.682352},\n map: map,\n icon: iconBase + 'beachflag.png',\n title: \"University Of Science :^)\",\n })\n\n directionsRenderer.setMap(map);\n\n var onChangeHandler = function() {\n calculateAndDisplayRoute(map,directionsService, directionsRenderer);\n };\n document.getElementById('btn').addEventListener('click', onChangeHandler);\n}", "title": "" }, { "docid": "6a875f76e6587dd18e591dc646dcf804", "score": "0.604318", "text": "function initialize(location){\n// Geolocates the user using the latitude and longitude of the ip address or cell signal\n var currentLocation = new google.maps.LatLng(location.coords.latitude, location.coords.longitude);\n var mapOptions = {\n center: currentLocation, //Sets the center of the screen as the postion of the user\n zoom: 15, // The higher the number the closer the zoom\n mapTypeId: google.maps.MapTypeId.ROADMAP //Map type\n };\n map = new google.maps.Map(document.getElementById(\"map\"), mapOptions);\n// Directions And Route Creation\n var directionsService = new google.maps.DirectionsService;\n var directionsDisplay = new google.maps.DirectionsRenderer;\n var input = (document.getElementById(\"address1\")); //Links the first text area to the input variable\n var input2 = (document.getElementById(\"address2\")); //Links the second text area to the input variable\n var autoComplete1 = new google.maps.places.Autocomplete(input); //Add the autocomplete functionality to the text areas\n var autoComplete2 = new google.maps.places.Autocomplete(input2);\n directionsDisplay.setMap(map) //Renders the route on the map if there is two points\n\n function calculateAndDisplayRoute(directionsService, directionsDisplay){ //Calculates the distance on an actual route on the map and finds the midpoint\n var selectedMode = document.getElementById('mode').value;\n directionsService.route({\n origin: input.value, //Address 1 point\n destination: input2.value, // Address 2 Point\n travelMode: google.maps.TravelMode[selectedMode]\n }, function(response, status){\n if (status === google.maps.DirectionsStatus.OK) { //If there is an actual route\n var bounds = new google.maps.LatLngBounds();\n directionsDisplay.setDirections(response); // Render the directions and route\n var route = response.routes[0];\n radius = parseInt(document.getElementById(\"radius\").value)\n var path = response.routes[0].overview_path;\n var middleOfArray = Math.floor(path.length/2);\n var lat = path[middleOfArray].lat();\n var lng = path[middleOfArray].lng();\n midpoint = {lat: lat, lng: lng};\n\n var image = {url: \"/imgs/midpoint-marker.png\",\n scaledSize: new google.maps.Size(38, 60)\n }\n//Drops custom marker on the midpoint\n var midpointMarker = new google.maps.Marker({\n position: midpoint,\n map: map,\n icon: image\n });\n//Creates a circle on the map for a visual radius limit\n var radialBounds = new google.maps.Circle({\n strokeColor: '#12a643',\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: '#66ff99',\n fillOpacity: 0.35,\n map: map,\n center: midpoint,\n radius: radius\n });\n// Searches for the specific name within the specified radius\n function performSearch(){\n var request = {\n radius: radius / 1.5,\n location: midpoint,\n name: (document.getElementById(\"activity\").value)\n }\n activity.nearbySearch(request, handleSearchResults);\n $('input').val(''); //Resets the address fields after submission to the map\n }\n//Searches for the specified activity through Google Places within the radius\n activity = new google.maps.places.PlacesService(map);\n google.maps.event.addListenerOnce(map, 'center_changed', performSearch)\n }\n });\n }\n var onChangeHandler = function() { //Handles the changes of the address1 and address2 fields\n calculateAndDisplayRoute(directionsService, directionsDisplay);\n };\n document.getElementById('address_submit').addEventListener('click', onChangeHandler); //Sets button to be able to fire the function\n}", "title": "" }, { "docid": "dfacc2d54fc7e79df9c0c1bdbe80bc62", "score": "0.6037354", "text": "function initialize() {\n // EDIT: map latitude and longitude\n var myLatlng = new google.maps.LatLng(34.052235, -118.243683);\n // EDIT: map marker\n var imagePath = \"img/location-icon.png\";\n var mapOptions = {\n scrollwheel: false,\n zoom: 12,\n center: myLatlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n styles: [{\n featureType: \"administrative\",\n elementType: \"all\",\n stylers: [{\n saturation: \"-100\"\n }]\n }, {\n featureType: \"administrative.province\",\n elementType: \"all\",\n stylers: [{\n visibility: \"off\"\n }]\n }, {\n featureType: \"landscape\",\n elementType: \"all\",\n stylers: [{\n saturation: -100\n }, {\n lightness: 65\n }, {\n visibility: \"on\"\n }]\n }, {\n featureType: \"poi\",\n elementType: \"all\",\n stylers: [{\n saturation: -100\n }, {\n lightness: \"50\"\n }, {\n visibility: \"simplified\"\n }]\n }, {\n featureType: \"road\",\n elementType: \"all\",\n stylers: [{\n saturation: \"-100\"\n }]\n }, {\n featureType: \"road.highway\",\n elementType: \"all\",\n stylers: [{\n visibility: \"simplified\"\n }]\n }, {\n featureType: \"road.arterial\",\n elementType: \"all\",\n stylers: [{\n lightness: \"30\"\n }]\n }, {\n featureType: \"road.local\",\n elementType: \"all\",\n stylers: [{\n lightness: \"40\"\n }]\n }, {\n featureType: \"transit\",\n elementType: \"all\",\n stylers: [{\n saturation: -100\n }, {\n visibility: \"simplified\"\n }]\n }, {\n featureType: \"water\",\n elementType: \"geometry\",\n stylers: [{\n hue: \"#ffff00\"\n }, {\n lightness: -25\n }, {\n saturation: -97\n }]\n }, {\n featureType: \"water\",\n elementType: \"labels\",\n stylers: [{\n lightness: -25\n }, {\n saturation: -100\n }]\n }]\n }\n // EDIT: map address\n var contentString = \"<strong>The One</strong><br>ex Inc. Touchdown Dr<br>1176 Los Angeles, CA\";\n var infowindow = new google.maps.InfoWindow({\n content: contentString,\n maxWidth: 300\n });\n var map = new google.maps.Map(document.getElementById(\"map\"), mapOptions);\n var marker = new google.maps.Marker({\n position: myLatlng,\n map: map,\n icon: imagePath,\n // EDIT: map title\n title: \"The One\"\n });\n google.maps.event.addListener(marker, \"click\", function() {\n infowindow.open(map, marker);\n });\n infowindow.open(map, marker);\n google.maps.event.addDomListener(window, \"resize\", function() {\n var center = map.getCenter();\n google.maps.event.trigger(map, \"resize\");\n map.setCenter(center);\n });\n}", "title": "" }, { "docid": "5a7498ba0936561c577799aa3f732c9e", "score": "0.6036512", "text": "function showAreas(){\n if(map.hasLayer(areas)){\n map.removeLayer(areas);\n };\n // Get CARTO selection as GeoJSON and Add to Map\n $.getJSON(\"https://mcmahoney3.carto.com/api/v2/sql?format=GeoJSON&q=\"+areaQuery, function(data) {\n trails = L.geoJson(data,{\n\t\t\tstyle: areaStyle,\n onEachFeature: function (feature, layer) {\n\t\t\t layer.bindPopup('<p><b>' + feature.properties.parkname + '</b><br /><em>' + feature.properties.parktype + '</em></p>');\n layer.cartodb_id=feature.properties.cartodb_id;\n }\n }).addTo(boundary);\n });\n}", "title": "" }, { "docid": "70e2bc8729099c219cda883f36a829da", "score": "0.60352325", "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": "54330fab25b49bafe038b13afef1099c", "score": "0.60333914", "text": "function chooseAddr(lat1, lng1, lat2, lng2, osm_type) {\n\tvar loc1 = new L.LatLng(lat1, lng1);\n\tvar loc2 = new L.LatLng(lat2, lng2);\n\tvar bounds = new L.LatLngBounds(loc1, loc2);\n\n\tif (feature) {\n\t\tmap.removeLayer(feature);\n\t}\n\tif (osm_type == \"node\") {\n\t\tfeature = L.circle( loc1, 25, {color: 'green', fill: false}).addTo(map);\n\t\t//feature = L.polyline( [loc1, loc4, loc2, loc3, loc1], {color: 'red'}).addTo(map); \n\t\tmap.fitBounds(bounds);\n\t\tmap.setZoom(18);\n\t} else {\n\t\tvar loc3 = new L.LatLng(lat1, lng2);\n\t\tvar loc4 = new L.LatLng(lat2, lng1);\n\n\t\tfeature = L.polyline( [loc1, loc4, loc2, loc3, loc1], {color: 'red'}).addTo(map);\n\t\tmap.fitBounds(bounds);\n map.setZoom(18);\n\t}\n}", "title": "" }, { "docid": "ae1aa122eca2a021545bb2b68c816a04", "score": "0.6032621", "text": "function generateMap() {\n var appliedFilters = nav.getFilters();\n queries.addHeatMap(appliedFilters['state-select']);\n currentWellData = queries.addWellData(appliedFilters);\n}", "title": "" }, { "docid": "feff619dd667e478a029ec607d181c14", "score": "0.6031855", "text": "renderMapStepFive(map) {\n\n map.on('draw.create', this.onChangeAggregationDrawing.bind(this));\n map.on('draw.update', this.onChangeAggregationDrawing.bind(this));\n map.on('draw.delete', function (e) {\n this.props.onSelectFeaturesByPolygon([]);\n }.bind(this))\n\n\n // OpenEI Farm events for testing and debuggin\n map.on('click', 'openei-farms', this.whenOEIFarmClicked);\n map.on('click', 'noaa-stations', this.whenOEIFarmClicked);\n\n // Handle the relevant events on the windfarms layer\n map.on('click', 'windfarms-symbol', this.whenFeatureClicked);\n map.on('click', 'windfarms-selected-symbol', this.whenFeatureClicked);\n map.on('click', 'windfarms-suspect-data-symbol', this.whenFeatureClicked);\n\n // Change the cursor to a pointer when the mouse is over the places layer.\n map.on('mouseenter', 'windfarms-symbol', this.whenFeatureMouseOver);\n map.on('mouseenter', 'windfarms-selected-symbol', this.whenFeatureMouseOver);\n map.on('mouseenter', 'windfarms-suspect-data-symbol', this.whenFeatureMouseOver);\n\n // Change it back to a pointer when it leaves.\n map.on('mouseleave', 'windfarms-symbol', this.whenFeatureMouseOut);\n map.on('mouseleave', 'windfarms-selected-symbol', this.whenFeatureMouseOut);\n map.on('mouseleave', 'windfarms-suspect-data-symbol', this.whenFeatureMouseOut);\n\n // All the events that might change the visible extent are encapsulated in\n // the moveend event\n map.on('moveend', this.onChangeVisibleExtent);\n\n this.renderMapStepSix(map);\n }", "title": "" }, { "docid": "82845ebb0a31fc5f20ae4a52d792b0dc", "score": "0.6031558", "text": "function addMapFeature(feature , layer)\n{\n // console.log(\"mapFeature\")\n layer.on({\n // When a user's mouse touches a map feature, the mouseover event calls this function, that feature's opacity changes to 90% so that it stands out\n mouseover: function(event) {\n layer = event.target;\n layer.setStyle({\n fillOpacity: 0.75\n });\n },\n // When the cursor no longer hovers over a map feature - when the mouseout event occurs - the feature's opacity reverts back to 50%\n mouseout: function(event) {\n layer = event.target;\n layer.setStyle({\n fillOpacity: 0.5\n });\n },\n });\n // Giving each feature a pop-up with information pertinent to it\n layer.bindPopup(\"<h3> Country: \" + feature.properties.name + \"</h3> <hr> <h4> Confirmed cases: \" + feature.num_cases + \"</h4>\" + \"<h4> Population: \" + feature.population + \"</h4>\" + \"<h4> Cases/100K Population: \" + feature.num_cases_100k + \"</h4>\");\n}", "title": "" }, { "docid": "284bed05dd7c70d123e23c87e83f1734", "score": "0.60312104", "text": "_handleSubmit(e) {\r\n if (e.target.id == \"mapId\") {\r\n const mapid = this._mapId.value;\r\n if (mapid !== undefined) {\r\n const coord = getCoord([mapid]);\r\n var geoCoords = dofusCoordsToGeoCoords([coord[0].x, coord[0].y]);\r\n geoCoords.latlng = geoCoords;\r\n map.flyTo(geoCoords, 4);\r\n }\r\n } else {\r\n const x = this._inputX.value; // L.NumberFormatter.createValidNumber(this._inputX.value, this.options.decimalSeperator);\r\n const y = this._inputY.value; // L.NumberFormatter.createValidNumber(this._inputY.value, this.options.decimalSeperator);\r\n if (x !== undefined && y !== undefined) {\r\n var geoCoords = dofusCoordsToGeoCoords([x, y]);\r\n geoCoords.latlng = geoCoords;\r\n map.flyTo(geoCoords, 4);\r\n // L.HighlightMap.drawDofusMapBoundsOnMouseMove(geoCoords);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "ef1ff44b1a3779c46ee200f33f9959b9", "score": "0.6028013", "text": "function initMapPA(PArea) {\n\n var map = new google.maps.Map(document.getElementById('mapPA'), {\n center: PArea.mapPosition,\n zoom: 16,\n mapTypeId: 'satellite'\n });\n\n for (i = 0; i < PArea.properties.length; i++) {\n number = PArea.properties[i].propertyNumber;\n outlines = PArea.properties[i].outline;\n price = PArea.properties[i].price;\n availability = PArea.properties[i].availability;\n perimiter = PArea.properties[i].perimiter;\n // gives the property area color based on their availability\n switch (availability) {\n case \"available\":\n color = \"#5B965B\";\n break;\n case \"sold\":\n color = \"#C84646\";\n break;\n case \"reserved\":\n color = \"#FFA500\";\n }\n // Construct the polygon.\n plot = new google.maps.Polygon({\n paths: outlines,\n strokeColor: '#000',\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: color,\n fillOpacity: 0.7,\n number: number,\n availability: availability,\n price: price,\n perimiter: perimiter\n });\n\n plot.setMap(map);\n\n plot.addListener('click', infoWindowPA);\n var infoWindow = new google.maps.InfoWindow;\n plot.addListener('mouseover', mouseover);\n plot.addListener('mouseout', mouseout);\n\n }\n\n /*\n We are aware that having functions within functions is bad practise,\n yet we did not find another way to transfer the right data from coordinates\n outside of the map function. There are some restrictions to the Google API\n when it comes to using polygons.\n */\n\n function infoWindowPA(event) {\n for (i = 0; i < PArea.properties.length; i++) {\n // if the property area is not available..\n if (this.availability !== \"available\") {\n // the infoWindow will show its property area number and say it is not available.\n var contentString = '<strong>Tomt nr. ' + this.number + ' er utilgjengelig</strong>';\n // if it is available..\n } else {\n // the infoWindow will show additional info about the property area.\n var contentString = '<strong>Tomt nr.: ' + this.number + '</strong><br>Pris: ' + this.price + ' kr <br>Areal: ' + this.perimiter + ' kvm';\n }\n }\n\n infoWindow.setContent(contentString);\n infoWindow.setPosition(event.latLng);\n infoWindow.open(map);\n }\n // opacity of color changes on the event of mouseover\n function mouseover(event) {\n for (i = 0; i < PArea.properties.length; i++) {\n this.setOptions({\n fillOpacity: 1\n });\n }\n }\n // changes the color back to what it was before on the event of mouseout\n function mouseout(event) {\n for (i = 0; i < PArea.properties.length; i++) {\n switch (this.availability) {\n case \"available\":\n // color and its opacity for the available property areas\n this.setOptions({\n fillColor: \"#5B965B\"\n });\n this.setOptions({\n fillOpacity: 0.7\n });\n break;\n case \"sold\":\n // color and its opacity for the sold property areas\n this.setOptions({\n fillColor: \"#C84646\"\n });\n this.setOptions({\n fillOpacity: 0.7\n });\n break;\n case \"reserved\":\n // color and its opacity for the reserved property areas\n this.setOptions({\n fillColor: \"#FFA500\"\n });\n this.setOptions({\n fillOpacity: 0.7\n });\n }\n }\n }\n} // End function initMapPA", "title": "" }, { "docid": "777e9a1cc0d7f5bf540ecfc882b4c6df", "score": "0.60226905", "text": "function mapLoadedHandler(maploadEvent){\n\n //create a layer definition for the gps points\n var layerDefinition = {\n \"objectIdField\": \"OBJECTID\",\n \"trackIdField\": \"TrackID\",\n \"geometryType\": \"esriGeometryPoint\",\n \"timeInfo\": {\n \"startTimeField\": \"DATETIME\",\n \"endTimeField\": null,\n \"timeExtent\": [1277412330365],\n \"timeInterval\": 1,\n \"timeIntervalUnits\": \"esriTimeUnitsMinutes\"\n },\n \"fields\": [\n {\n \"name\": \"OBJECTID\",\n \"type\": \"esriFieldTypeOID\",\n \"alias\": \"OBJECTID\",\n \"sqlType\": \"sqlTypeOther\"\n },\n {\n \"name\": \"TrackID\",\n \"type\": \"esriFieldTypeInteger\",\n \"alias\": \"TrackID\"\n },\n {\n \"name\": \"DATETIME\",\n \"type\": \"esriFieldTypeDate\",\n \"alias\": \"DATETIME\"\n }\n ]\n };\n\n var featureCollection = {\n layerDefinition: layerDefinition,\n featureSet: null\n };\n featureLayer = new FeatureLayer(featureCollection);\n\n //setup a temporal renderer\n var sms = new SimpleMarkerSymbol().setColor(new Color([255, 0, 0])).setSize(8);\n var observationRenderer = new SimpleRenderer(sms);\n var latestObservationRenderer = new SimpleRenderer(new SimpleMarkerSymbol());\n var infos = [\n {\n minAge: 0,\n maxAge: 1,\n color: new Color([255, 0, 0])\n }, {\n minAge: 1,\n maxAge: 5,\n color: new Color([255, 153, 0])\n }, {\n minAge: 5,\n maxAge: 10,\n color: new Color([255, 204, 0])\n }, {\n minAge: 10,\n maxAge: Infinity,\n color: new Color([0, 0, 0, 0])\n }\n ];\n\n var ager = new TimeClassBreaksAger(infos, TimeClassBreaksAger.UNIT_MINUTES);\n var sls = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,\n new Color([255, 0, 0]), 3);\n var trackRenderer = new SimpleRenderer(sls);\n var renderer = new TemporalRenderer(observationRenderer, latestObservationRenderer,\n trackRenderer, ager);\n featureLayer.setRenderer(renderer);\n map.addLayer(featureLayer);\n\n gl = new GraphicsLayer();\n map.addLayer(gl);\n \n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(zoomToLocation, locationError);\n navigator.geolocation.watchPosition(showLocation, locationError);\n console.log(\"geolocation!\");\n } else {\n console.log(\"No geolocation.\");\n }\n }", "title": "" }, { "docid": "febabf0a07e2ad49359a797754294818", "score": "0.6012603", "text": "function initialize() {\n var myLatlng = new google.maps.LatLng(45.000, -63.000);\n var mapOptions = {\n zoom: 7,\n center: myLatlng,\n scrollwheel: false\n };\n\n\n\n//Create new map\nvar map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\n\n \n\n //Geolocation Prompt\n if(navigator.geolocation) {\n browserSupportFlag = true;\n navigator.geolocation.getCurrentPosition(function(position) {\n initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);\n map.setCenter(initialLocation);\n }, function() {\n handleNoGeolocation(browserSupportFlag);\n });\n } \n\n\n\n/**************************************Regions************************************************************/ \n var wkt = new Wkt.Wkt();\n\n var nsregions = [];\nif($('#map-canvas').attr('data-main')){\n //Loops through all of regions array\n //creates polygons\n for(var i=0; i<regions.length; i++){\n \n var polyvalues = wkt.read(regions[i][2]);\n var polycoords = [];\n for(var j=0; j < polyvalues[0].length; j++){\n polycoords.push(new google.maps.LatLng(polyvalues[0][j].x, polyvalues[0][j].y));\n }\n\n nsregions[i] = new google.maps.Polygon({\n paths: polycoords,\n strokeColor: '#00FF00',\n strokeOpacity: 0.0,\n strokeWeight: 3,\n fillColor: '#00FF00',\n fillOpacity: 0.0\n });\n nsregions[i].setMap(map);\n\n google.maps.event.addListener(nsregions[i], 'mouseover',function(){\n this.setOptions({fillOpacity:0.4});\n });\n\n google.maps.event.addListener(nsregions[i], 'mouseout',function(){\n this.setOptions({fillOpacity:0.0});\n });\n\n }\n\n //The polygon clicking functions\n //Must be called separately\n google.maps.event.addListener(nsregions[0], 'click', function(){\n polyClick(regions[0][1]);\n });\n\n google.maps.event.addListener(nsregions[1], 'click', function(){\n polyClick(regions[1][1]);\n });\n\n google.maps.event.addListener(nsregions[2], 'click', function(){\n polyClick(regions[2][1]);\n });\n\n google.maps.event.addListener(nsregions[3], 'click', function(){\n polyClick(regions[3][1]);\n });\n\n google.maps.event.addListener(nsregions[4], 'click', function(){\n polyClick(regions[4][1]);\n });\n\n google.maps.event.addListener(nsregions[5], 'click', function(){\n polyClick(regions[5][1]);\n });\n\n google.maps.event.addListener(nsregions[6], 'click', function(){\n polyClick(regions[6][1]);\n });\n\n google.maps.event.addListener(nsregions[7], 'click', function(){\n polyClick(regions[7][1]);\n });\n\n google.maps.event.addListener(nsregions[8], 'click', function(){\n polyClick(regions[8][1]);\n });\n\n google.maps.event.addListener(nsregions[9], 'click', function(){\n polyClick(regions[9][1]);\n });\n\n google.maps.event.addListener(nsregions[10], 'click', function(){\n polyClick(regions[10][1]);\n });\n\n google.maps.event.addListener(nsregions[11], 'click', function(){\n polyClick(regions[11][1]);\n });\n\n google.maps.event.addListener(nsregions[12], 'click', function(){\n polyClick(regions[12][1]);\n });\n\n google.maps.event.addListener(nsregions[13], 'click', function(){\n polyClick(regions[13][1]);\n });\n\n google.maps.event.addListener(nsregions[14], 'click', function(){\n polyClick(regions[14][1]);\n });\n\n google.maps.event.addListener(nsregions[15], 'click', function(){\n polyClick(regions[15][1]);\n });\n\n google.maps.event.addListener(nsregions[16], 'click', function(){\n polyClick(regions[16][1]);\n });\n\n google.maps.event.addListener(nsregions[17], 'click', function(){\n polyClick(regions[17][1]);\n });\n}\n\n\n/*******************************************Markers*******************************************************/\n //Loops through all of markerpoints array\n for(var i=0; i<markerpoints.length; i++){\n\n \n\n //Get latitude and longitude for each marker\n var markerLatlng= new google.maps.LatLng(markerpoints[i][1], markerpoints[i][2]);\n\n\n\n //Create new marker for each iteration\n var marker = new google.maps.Marker({\n position: markerLatlng,\n map: map\n });\n \n \n\n\n //Creates an inforwindow for each iteration of the loop, setting content and open function\n var infowindow = new google.maps.InfoWindow();\n google.maps.event.addListener(marker, 'mouseover', (function(marker, i) {\n return function(){\n infowindow.setContent('<a href=\"../assets/'+ markerpoints[i][3] +'\">'+markerpoints[i][0]+'</a>');\n infowindow.open(map, marker);\n $('#' + (markerpoints[i][3])).mouseover(function(){\n google.maps.event.trigger(marker, 'mouseover');});\n }\n\n })(marker, i));\n\n \n //Function to prvent multiple windows\n google.maps.event.addListener(marker, 'mouseout', (function(marker, i) {\n return function(){\n infowindow.close();}}));\n\n\n if(markerpoints.length < 2 && markerpoints[0][4]==\"true\"){\n map.setCenter(new google.maps.LatLng(markerpoints[0][1], markerpoints[0][2]));\n map.setZoom(10);\n } \n }\n}", "title": "" }, { "docid": "7f701b50083aad7724133ce26e074686", "score": "0.60125244", "text": "function clickFeature(event) {\n myMap.fitBounds(event.target.getBounds())\n}", "title": "" }, { "docid": "dda422910b35fcfcf42fc2397c68e5f7", "score": "0.6011882", "text": "function translate(routeid, measure, x, y, attributes){\n esriRequest(\"https://giswebnew.dotd.la.gov/arcgis/rest/services/Transportation/State_LRS_Route_Networks/MapServer/exts/LRSServer/networkLayers/0/translate?f=json&locations=[{'routeId':'\"+routeid+\"','measure':'\"+measure+\"'}]&targetNetworkLayerIds=1\",{\n responseType: \"json\"\n }).then(function(response){\n var json = response.data;\n var location = json.locations[\"0\"].translatedLocations[\"0\"].routeId;\n var n = location.substr(location.length - 5);\n var slice = n.slice(0,1);\n if (slice != 1){\n var location2 = json.locations[\"0\"].translatedLocations[\"1\"].routeId;\n console.log(location2);\n esriRequest(\"https://giswebnew.dotd.la.gov/arcgis/rest/services/Transportation/Roads_and_Highways/FeatureServer/14/query?where=RouteId+%3D+%27\"+location2+\"%27&objectIds=&time=&geometry='x':\"+x+\",'y':\"+y+\"&geometryType=esriGeometryPoint&inSR=102100&spatialRel=esriSpatialRelIntersects&distance=10&units=esriSRUnit_Foot&relationParam=&outFields=RouteId%2C+FederalFundingStatus&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&resultOffset=&resultRecordCount=&f=pjson\",{\n responseType: \"json\"\n }).then(function(response){\n var fedAidResponse2 = response.data;\n var fundingStatus2 = fedAidResponse2.features[\"0\"].attributes.FederalFundingStatus;\n if (fundingStatus2 == \"1\"){\n attributes[\"FedAid\"] = \"I\";\n $(\"#fedAids\").val(\"I\");\n } else if (fundingStatus2 == \"2\" || fundingStatus2 == \"4\" || fundingStatus2 == \"5\"){\n attributes[\"FedAid\"] = \"Z\";\n $(\"#fedAids\").val(\"Z\");\n } else if (fundingStatus2 == \"3\"){\n attributes[\"FedAid\"] = \"O\";\n $(\"#fedAids\").val(\"O\");\n }\n });\n } else {\n esriRequest(\"https://giswebnew.dotd.la.gov/arcgis/rest/services/Transportation/Roads_and_Highways/FeatureServer/14/query?where=RouteId+%3D+%27\"+location+\"%27&objectIds=&time=&geometry='x':\"+x+\",'y':\"+y+\"&geometryType=esriGeometryPoint&inSR=102100&spatialRel=esriSpatialRelIntersects&distance=10&units=esriSRUnit_Foot&relationParam=&outFields=RouteId%2C+FederalFundingStatus&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&resultOffset=&resultRecordCount=&f=pjson\",{\n responseType: \"json\"\n }).then(function(response){\n var fedAidResponse = response.data;\n var fundingStatus = fedAidResponse.features[\"0\"].attributes.FederalFundingStatus;\n if (fundingStatus == \"1\"){\n attributes[\"FedAid\"] = \"I\";\n $(\"#fedAids\").val(\"I\");\n } else if (fundingStatus == \"2\" || fundingStatus == \"4\" || fundingStatus == \"5\"){\n attributes[\"FedAid\"] = \"Z\";\n $(\"#fedAids\").val(\"Z\");\n } else if (fundingStatus == \"3\"){\n attributes[\"FedAid\"] = \"O\";\n $(\"#fedAids\").val(\"O\");\n }\n })\n }\n });\n return attributes;\n }", "title": "" }, { "docid": "5fb62df20af2f06157397a76b3e3d68d", "score": "0.6011305", "text": "function showLocatorResults(candidate) \n {\n\t map.graphics.clear();\n\t console.log(\"get here?\");\n\t // var candidate;\n var symbol = new esri.symbol.SimpleMarkerSymbol();\n // var infoTemplate = new esri.InfoTemplate(\"Location\", \"Address: ${address}<br />Score: ${score}<br />Source locator: ${locatorName}\");\n\n symbol.setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE);\n symbol.setColor(new dojo.Color([153, 0, 51, 0.75]));\n\n var graphic, newPoint;\n\t\t// new code for Google geocoder\n\t\t// connvert LatLong from Google locator to NAD NY/LI StatePlane coordinate system\n \t \n var lat = candidate.lat();\n var lng = candidate.lng();\n console.log (lat, lng);\n \t \n var pt = new esri.geometry.Point(lng, lat, new esri.SpatialReference({ wkid: 4326 }));\n \tvar nysp = new esri.SpatialReference({ wkid: 2263 });\n \tgsvc.project([pt], nysp, function (projectedPoint) {\n var locX = projectedPoint[0].x;\n var locY = projectedPoint[0].y;\n \n console.log(\"projPoint : \" + locX + \" \" + locY);\n \n \tnewPoint = new esri.geometry.Point(locX, locY, nysp);\n\t\t\t\tconsole.log(newPoint);\n \tgraphic = new esri.Graphic(newPoint, symbol); \n // add a graphic to the map at the geocoded location\n map.graphics.add(graphic);\n\n var attributes = { address: candidate.address, score: candidate.score, locatorName: candidate.Loc_name };\n \n // graphic = new esri.Graphic(locPoint, symbol); //attributes\n // add a graphic to the map at the geocoded location\n // map.graphics.add(graphic);\n //add a text symbol to the map listing the location of the matched address.\n var displayText = candidate.address;\n // var font = new esri.symbol.Font(\"16pt\", esri.symbol.Font.STYLE_NORMAL, esri.symbol.Font.VARIANT_NORMAL, esri.symbol.Font.WEIGHT_BOLD, \"Helvetica\");\n // var textSymbol = new esri.symbol.TextSymbol(displayText, font, new dojo.Color(\"#666633\"));\n // textSymbol.setOffset(0, 8);\n // map.graphics.add(new esri.Graphic(geom, textSymbol));\n // return false; //break out of loop after one candidate with score greater than 80 is found.\n\n \t\t\tvar xmin = newPoint.x - .001;\n \t\tvar ymin = newPoint.y - .001;\n \t\tvar xmax = newPoint.x + .001;\n \t\tvar ymax = newPoint.y + .001; \n \n \t\tvar pointExtent = new esri.geometry.Extent(xmin, ymin, xmax, ymax, map.spatialReference);\n\t\t\t\tmap.setExtent(pointExtent);\n \t\t\t//}// do nothing\n \n \t\t}); // end GSRV function\n\t\t\n } // end showLocatorResults", "title": "" }, { "docid": "bfc95458f0ec605337f48fe7b88235f6", "score": "0.6008222", "text": "function calculateAndDisplayRoute(f, t)\n{\n alert(\"for start to destination routing....\");\n alert(\"Inside calculateAndDisplayRoute we have waypoints as : \"+ way_points[0].location);\n var selectedMode=document.getElementById('mode').value;\n directionsService.route({\n origin: f,\n destination: t,\n travelMode: google.maps.TravelMode[selectedMode]\n //optimizeWaypoints: true\n /*waypoints: [\n {location: way_points[0].position, stopover: false},\n {location: way_points[1].position, stopover: false},\n {location: way_points[2].position, stopover: true},\n ]*/\n \n , function(response, status)\n {\n if (status === 'OK')\n {\n directionsDisplay.setDirections(response);\n }\n else\n {\n window.alert('Directions request failed due to ' + status);\n }\n }\n });\n}", "title": "" }, { "docid": "73caeb4e15642c5794b3b9bcca80111e", "score": "0.60066766", "text": "function createFeatures (earthquakeData){\r\n function onEachFeature(feature,layer){\r\n layer.bindPopup(\"<h3>\"+feature.properties.place + \"</h3>\"+ //Popup with Place info\r\n \"<hr><p>\" + new Date(feature.properties.time)+\"</p>\"+ //Popup with Date info\r\n \"<p>\" + \"Magnitude: \"+feature.properties.mag + \"</p>\") //Popup with Magnitude info\r\n } \r\n \r\n//geoJSON layer\r\n var earthquakes=L.geoJSON(earthquakeData,{\r\n\r\n pointToLayer: function(earthquakeData, latlng) {\r\n return L.circle(latlng, {\r\n radius: earthquakeData.properties.mag*70000,\r\n color: color(earthquakeData.properties.mag),\r\n fillOpacity: 0.5,\r\n stroke: false\r\n });\r\n },\r\n onEachFeature:onEachFeature\r\n });\r\n createMap(earthquakes); //Call createMap Function\r\n\r\n}", "title": "" }, { "docid": "c61af182b9fb8ae10781b1d2ad075e02", "score": "0.60002965", "text": "function calculateRoute() {\n GetLatlong_B()\n GetLatlong_A();\n\n var myOptions = {\n zoom: 15,\n center: lat_lng_A,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n // Draw the map\n var mapObject = new google.maps.Map(document.getElementById(\"map_display\"), myOptions);\n\n var directionsService = new google.maps.DirectionsService();\n var directionsRequest = {\n origin: fir_loc,\n destination: sec_loc,\n travelMode: google.maps.DirectionsTravelMode.DRIVING,\n unitSystem: google.maps.UnitSystem.METRIC\n };\n directionsService.route(\n directionsRequest,\n function (response, status) {\n if (status == google.maps.DirectionsStatus.OK) {\n new google.maps.DirectionsRenderer({\n map: mapObject,\n directions: response\n });\n } else\n $(\"#lblError\").append(\"Unable To Find Root\");\n }\n );\n\n\n $(\"select\").change(function () {\n var point_of_interest = \"\";\n $(\"select option:selected\").each(function () {\n point_of_interest = $(this).val();\n });\n\n if ($(\"#drop_down_loc option:selected\").text() === fir_loc) {\n map = new google.maps.Map(document.getElementById('map_display'), {\n //changing this will work to change point of interest location\n center: lat_lng_A,\n zoom: 15\n });\n infowindow = new google.maps.InfoWindow();\n var service = new google.maps.places.PlacesService(map);\n\n service.nearbySearch({\n //changing this will work to change point of interest location\n location: lat_lng_A,\n radius: 50000,\n type: [point_of_interest]\n }, callback);\n\n function callback(results, status) {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n for (var i = 0; i < results.length; i++) {\n createMarker(results[i]);\n }\n }\n }\n\n function createMarker(place) {\n var marker = new google.maps.Marker({\n map: map,\n position: place.geometry.location\n });\n\n google.maps.event.addListener(marker, 'click', function () {\n infowindow.open(map, this);\n infowindow.setContent(\"<button class = add_btn> Add to Places to Visit </button> \" + '<div><strong>' + place.name + '</strong><br>' + place.vicinity + \"</div>\");\n // console.log(place);\n\n $(\".add_btn\").on(\"click\", function () {\n if (places_added.includes(place.name)) {\n alert(\"Already Added\");\n return;\n } else {\n places_added.push(place.name);\n let list_display = $(\"#list_display\");\n list_display.append(\"<ul><li><img id=place_img src=\" + place.photos[0].getUrl() + \"><strong>\" + place.name + \" - Address is: \" + place.vicinity + \"</strong><button id=close class=btn-danger>X</button></li></ul>\")\n $(\".btn-danger\").on(\"click\", function () {\n places_added.pop(place.name)\n this.parentNode.remove();\n });\n }\n });\n\n });\n }\n } else if ($(\"#drop_down_loc option:selected\").text() === sec_loc) {\n // console.log(\"false\")\n map = new google.maps.Map(document.getElementById('map_display'), {\n //changing this will work to change point of interest location0\n\n center: lat_lng_B,\n zoom: 15\n });\n\n infowindow = new google.maps.InfoWindow();\n var service = new google.maps.places.PlacesService(map);\n // console.log(Coords)\n\n service.nearbySearch({\n //changing this will work to change point of interest location\n location: lat_lng_B,\n radius: 50000,\n type: [point_of_interest]\n }, callback);\n\n function callback(results, status) {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n for (var i = 0; i < results.length; i++) {\n createMarker(results[i]);\n }\n }\n }\n\n function createMarker(place) {\n // var placeLoc = place.geometry.location;\n var marker = new google.maps.Marker({\n map: map,\n position: place.geometry.location\n });\n google.maps.event.addListener(marker, 'click', function () {\n infowindow.setContent(\"<button class = add_btn> Add to Places to Visit </button> \" + '<div><strong>' + place.name + '</strong><br>' + place.vicinity + \"</div>\");\n infowindow.open(map, this);\n $(\".add_btn\").on(\"click\", function () {\n if (places_added.includes(place.name)) {\n alert(\"Already Added\");\n return;\n } else {\n places_added.push(place.name);\n // console.log(places_added);\n let list_display = $(\"#list_display\");\n list_display.append(\"<ul><li><img id=place_img src=\" + place.photos[0].getUrl() + \"><strong>\" + place.name + \" - Address is: \" + place.vicinity + \"</strong><button id=close class=btn-danger>X</button></li></ul>\")\n $(\".btn-danger\").on(\"click\", function () {\n places_added.pop(place.name)\n this.parentNode.remove();\n });\n }\n });\n });\n }\n }\n })\n\n}", "title": "" }, { "docid": "511caca94f6e8b0667f3a93af4c665a8", "score": "0.5996051", "text": "function initMap() {\n var startPoint = {\n lat: -37.8153467,\n lng: 144.9583246\n };\n var map = new google.maps.Map(document.getElementById('map'), {\n center: startPoint,\n zoom: 10,\n scrollwheel: false,\n styles: [{\n 'featureType': 'administrative',\n 'elementType': 'all',\n 'stylers': [{\n 'saturation': '-100'\n }]\n }, {\n 'featureType': 'administrative.province',\n 'elementType': 'all',\n 'stylers': [{\n 'visibility': 'on'\n }]\n }, {\n 'featureType': 'landscape',\n 'elementType': 'all',\n 'stylers': [{\n 'saturation': -100\n }, {\n 'lightness': 65\n }, {\n 'visibility': 'on'\n }]\n }, {\n 'featureType': 'poi',\n 'elementType': 'all',\n 'stylers': [{\n 'saturation': -100\n }, {\n 'lightness': '50'\n }, {\n 'visibility': 'simplified'\n }]\n }, {\n 'featureType': 'road',\n 'elementType': 'all',\n 'stylers': [{\n 'saturation': '-100'\n }]\n }, {\n 'featureType': 'road.highway',\n 'elementType': 'all',\n 'stylers': [{\n 'visibility': 'simplified'\n }]\n }, {\n 'featureType': 'road.arterial',\n 'elementType': 'all',\n 'stylers': [{\n 'lightness': '30'\n }]\n }, {\n 'featureType': 'road.local',\n 'elementType': 'all',\n 'stylers': [{\n 'lightness': '40'\n }]\n }, {\n 'featureType': 'transit',\n 'elementType': 'all',\n 'stylers': [{\n 'saturation': -100\n }, {\n 'visibility': 'simplified'\n }]\n }, {\n 'featureType': 'water',\n 'elementType': 'geometry',\n 'stylers': [{\n 'hue': '#ffff00'\n }, {\n 'lightness': -25\n }, {\n 'saturation': -97\n }]\n }, {\n 'featureType': 'water',\n 'elementType': 'labels',\n 'stylers': [{\n 'lightness': -25\n }, {\n 'saturation': -100\n }]\n }]\n });\n var im = '/images/bluedot.png';\n var marker = new google.maps.Marker({\n icon: im,\n map: map\n });\n var infoWindow = new google.maps.InfoWindow({\n map: map,\n pixelOffset: new google.maps.Size(0,-33)\n });\n\n // Try HTML5 geolocation.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n infoWindow.setPosition(pos);\n infoWindow.setContent('Your location');\n marker.setPosition(pos);\n map.setCenter(pos);\n }, function() {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n}", "title": "" }, { "docid": "40b685e705871e31002991ddeb4a4976", "score": "0.59946185", "text": "function forEachFeaturetolls(feature, layer){\r\n layer.on({\r\n click: function(){\r\n lat = feature.properties.LATITUDE;\r\n long = feature.properties.LONGITUDE;\r\n marker = L.marker([lat,long], {icon: symbol}).addTo(selectedTolls);\r\n a1 = a1 + feature.properties.CL1_OP_CT_EZ_FULL;\r\n a2 = a2 + feature.properties.CL1_PK_CT_EZ_FULL;\r\n a3 = a3 + feature.properties.CL2_OP_CT_FULL;\r\n a4 = a4 + feature.properties.CL2_PK_CT_FULL;\r\n a5 = a5 + feature.properties.CL3_OP_CT_FULL;\r\n a6 = a6 + feature.properties.CL3_PK_CT_FULL;\r\n b1 = b1 + feature.properties.CL1_OP_CT_EZ_FREQ;\r\n b2 = b2 + feature.properties.CL1_PK_CT_EZ_FREQ;\r\n c1 = c1 + feature.properties.CL1_OP_OS_EZ_B;\r\n c2 = c2 + feature.properties.CL1_PK_OS_EZ_B;\r\n c3 = c3 + feature.properties.CL2_OP_OS_EZ_B;\r\n c4 = c4 + feature.properties.CL2_PK_OS_EZ_B;\r\n c5 = c5 + feature.properties.CL3_OP_OS_EZ_B;\r\n c6 = c6 + feature.properties.CL3_PK_OS_EZ_B;\r\n d1 = d1 + feature.properties.CL1_OP_VID_REG;\r\n d2 = d2 + feature.properties.CL1_PK_VID_REG;\r\n d3 = d3 + feature.properties.CL2_OP_VID_REG;\r\n d4 = d4 + feature.properties.CL2_PK_VID_REG;\r\n d5 = d5 + feature.properties.CL3_OP_VID_REG;\r\n d6 = d6 + feature.properties.CL3_PK_VID_REG;\r\n e1 = e1 + feature.properties.CL1_OP_VID_UNREG;\r\n e2 = e2 + feature.properties.CL1_PK_VID_UNREG;\r\n e3 = e3 + feature.properties.CL2_OP_VID_UNREG;\r\n e4 = e4 + feature.properties.CL2_PK_VID_UNREG;\r\n e5 = e5 + feature.properties.CL3_OP_VID_UNREG;\r\n e6 = e6 + feature.properties.CL3_PK_VID_UNREG;\r\n\r\n $(\"#mytable\").html(\"<table><tr><th id = 'payment' rowspan = '3'>Payment Type</th><th id = 'carclass' colspan = '2'>Class 1</th>\" + \r\n \"<th id = 'carclass' colspan = '2'>Class 2</th><th id = 'carclass' colspan = '2'>Class 3</th></tr>\" + \r\n \"<tr><th id = 'carclass' colspan = '2'>Passenger Vehicles</th><th id = 'carclass' colspan = '2'>Medium Trucks, Buses</th>\" +\r\n \"<th id = 'carclass' colspan = '2'>Heavy Trucks</th></tr>\" +\r\n \"<tr><td>Off-Peak</td><td>Peak</td><td>Off-Peak</td><td>Peak</td><td>Off-Peak</td><td>Peak</td></tr>\" +\r\n \"<tr id = 'cost'><td>CT E-Z Pass (30% discount off base rates)</td><td>$\"+ a1.toFixed(2) + \"</td><td>$\" + a2.toFixed(2) +\r\n \"</td><td>$\" + a3.toFixed(2) + \"</td><td>$\" + a4.toFixed(2) + \"</td><td>$\" + a5.toFixed(2) + \"</td><td>$\" +\r\n a6.toFixed(2) + \"</td></tr>\" +\r\n \"<<tr id = 'cost'><td>CT E-Z Pass (with 20% commuter discount)</td><td>$\"+ b1.toFixed(2) + \"</td><td>$\" + b2.toFixed(2) +\r\n \"</td><td>---</td><td>---</td><td>---</td><td>---</td>\" +\r\n \"<<tr id = 'cost'><td>Out of State E-Z Pass (base rate)</td><td>$\"+ c1.toFixed(2) + \"</td><td>$\" + c2.toFixed(2) +\r\n \"</td><td>$\" + c3.toFixed(2) + \"</td><td>$\" + c4.toFixed(2) + \"</td><td>$\" + c5.toFixed(2) + \"</td><td>$\" +\r\n c6.toFixed(2) + \"</td></tr>\" +\r\n \"<<tr id = 'cost'><td>Pre-Registered Plate (25% higher than base)</td><td>$\"+ d1.toFixed(2) + \"</td><td>$\" + d2.toFixed(2) +\r\n \"</td><td>$\" + d3.toFixed(2) + \"</td><td>$\" + d4.toFixed(2) + \"</td><td>$\" + d5.toFixed(2) + \"</td><td>$\" +\r\n d6.toFixed(2) + \"</td></tr>\" +\r\n \"<<tr id = 'cost'><td>Unregistered Plate (50% higher than base)</td><td>$\"+ e1.toFixed(2) + \"</td><td>$\" + e2.toFixed(2) +\r\n \"</td><td>$\" + e3.toFixed(2) + \"</td><td>$\" + e4.toFixed(2) + \"</td><td>$\" + e5.toFixed(2) + \"</td><td>$\" +\r\n e6.toFixed(2) + \"</td></tr>\"\r\n );\r\n }\r\n });\r\n}", "title": "" }, { "docid": "33e34193325eac54643da1e1872ad6c5", "score": "0.5992683", "text": "function ExampleApp() {\n var map = L.map('map', {\n zoomControl: false\n }).fitWorld();\n\n if (MAPBOX_ACCESS_TOKEN) {\n L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}{r}.png?access_token=' + MAPBOX_ACCESS_TOKEN, {\n maxZoom: 23,\n attribution: 'Map data &copy; OpenStreetMap contributors, ' +\n 'CC-BY-SA, ' +\n 'Imagery © Mapbox',\n id: 'mapbox.light',\n detectRetina: true\n }).addTo(map);\n }\n\n // fix Leaflet zooming bugs\n var zoomOngoing = false;\n map.on('zoomstart', function () {\n zoomOngoing = true;\n });\n map.on('zoomend', function () {\n zoomOngoing = false;\n });\n\n var accuracyCircle = null;\n var lastPosition = null;\n var wayfindingController = null;\n var blueDotMarker = null;\n var wayfindingController = new WayfindingController(map);\n var geofenceController = new GeofenceController(map);\n\n this.onFloorChange = function () {\n if (lastPosition) this.onLocationChanged(lastPosition);\n if (wayfindingController) {\n wayfindingController.setCurrentFloor(floorPlanSelector.getFloorNumber());\n }\n if (geofenceController) {\n geofenceController.setCurrentFloor(floorPlanSelector.getFloorNumber());\n }\n };\n\n var floorPlanSelector = new FloorPlanSelector(map, this.onFloorChange.bind(this));\n\n var self = this;\n map.on('mouseup', function (event) {\n // tap routes to pressed location\n var floor = floorPlanSelector.getFloorNumber();\n if (floor !== null) {\n IndoorAtlas.requestWayfindingUpdates({\n latitude: event.latlng.lat,\n longitude: event.latlng.lng,\n floor: floor\n }, this.onWayfindingUpdate.bind(this));\n }\n IndoorAtlas.lockIndoors(true); // also lock indoors on click\n });\n\n wayfindingController.setCurrentFloor(floorPlanSelector.getFloorNumber());\n\n this.onTriggeredGeofences = function(transitionType, geofence) {\n geofenceController.updateTriggeredGeofences(transitionType, geofence);\n };\n\n this.onLocationChanged = function(position) {\n lastPosition = position;\n\n // updating graphics while zooming does not work in Leaflet\n if (zoomOngoing) return;\n\n var center = [position.coords.latitude, position.coords.longitude];\n var rotationAngle = position.coords.heading;\n\n function setBlueDotProperties() {\n accuracyCircle.setLatLng(center);\n accuracyCircle.setRadius(position.coords.accuracy);\n\n blueDotMarker.setLatLng(center);\n blueDotMarker.setRotationAngle(rotationAngle);\n\n if (floorPlanSelector.getFloorNumber() !== position.coords.floor) {\n\n accuracyCircle.setStyle({ color: 'gray' });\n if (map.hasLayer(blueDotMarker)) {\n blueDotMarker.remove();\n }\n } else {\n accuracyCircle.setStyle({ color: 'blue' });\n if (!map.hasLayer(blueDotMarker)) {\n blueDotMarker.addTo(map);\n }\n }\n }\n\n if (!accuracyCircle) {\n // first location\n accuracyCircle = L.circle([0,0], { radius: 1, opacity: 0 });\n blueDotMarker = L.marker([0,0], {\n icon: L.icon({\n iconUrl: 'img/blue_dot.png',\n iconSize: [30, 30],\n iconAnchor: [15, 15]\n })\n });\n\n setBlueDotProperties();\n\n accuracyCircle.addTo(map);\n blueDotMarker.addTo(map);\n\n var ZOOM_LEVEL = 19;\n map.setView(center, ZOOM_LEVEL);\n } else {\n setBlueDotProperties();\n }\n };\n\n this.onWayfindingUpdate = function(route) {\n wayfindingController.updateRoute(route);\n if (wayfindingController.routeFinished()) {\n console.log(\"wayfinding finished!\");\n wayfindingController.hideRoute();\n IndoorAtlas.removeWayfindingUpdates();\n IndoorAtlas.lockIndoors(false); // also release indoor lock when stopping WF\n }\n };\n\n IndoorAtlas.initialize({ apiKey: IA_API_KEY })\n .watchPosition(this.onLocationChanged.bind(this))\n .watchFloorPlan(floorPlanSelector.onFloorPlanChange.bind(floorPlanSelector))\n .watchVenue(floorPlanSelector.onVenueChange.bind(floorPlanSelector))\n .watchGeofences(this.onTriggeredGeofences.bind(this))\n .lockIndoors(true)\n .onStatusChanged(console.log)\n .getTraceId(console.log);\n}", "title": "" }, { "docid": "7923bd039b6c05250f79b80c5d06c223", "score": "0.59908617", "text": "function initialize() {\n\n //https://snazzymaps.com/style/60/blue-gray\n var styles = [{ featureType: \"water\", stylers: [{ visibility: \"on\" }, { color: \"#b5cbe4\" }] }, {\n featureType: \"landscape\",\n stylers: [{ color: \"#efefef\" }]\n }, { featureType: \"road.highway\", elementType: \"geometry\", stylers: [{ color: \"#83a5b0\" }] }, {\n featureType: \"road.arterial\",\n elementType: \"geometry\",\n stylers: [{ color: \"#bdcdd3\" }]\n }, { featureType: \"road.local\", elementType: \"geometry\", stylers: [{ color: \"#ffffff\" }] }, {\n featureType: \"poi.park\",\n elementType: \"geometry\",\n stylers: [{ color: \"#e3eed3\" }]\n }, {\n featureType: \"administrative\",\n stylers: [{ visibility: \"on\" }, { lightness: 33 }]\n }, { featureType: \"road\" }, {\n featureType: \"poi.park\",\n elementType: \"labels\",\n stylers: [{ visibility: \"on\" }, { lightness: 20 }]\n }, {}, { featureType: \"road\", stylers: [{ lightness: 20 }] }];\n var map;\n var markers = [];\n var infowindow = [];\n var mapOptions = {\n zoom: 6,\n styles: styles,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\n map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n var bound = new google.maps.LatLngBounds();\n\n for (var i = 0; i < markerData.length; i++) {\n markers.push(\n new google.maps.Marker({\n position: new google.maps.LatLng(markerData[i].lat, markerData[i].lng),\n title: markerData[i].title,\n map: map,\n id: i,\n icon: normalIcon()\n })\n );\n bound.extend(markers[i].getPosition());\n\n infowindow[i] = new google.maps.InfoWindow({\n content: markerData[i].title\n });\n\n google.maps.event.addListener(markers[i], 'click', function () {\n id = this.id\n infowindow[id].open(map, markers[id]);\n })\n }\n\n map.fitBounds(bound, 50);\n\n // center google map on window resize\n google.maps.event.addDomListener(window, \"resize\", function () {\n var center = map.getCenter();\n google.maps.event.trigger(map, \"resize\");\n map.setCenter(center);\n });\n}", "title": "" }, { "docid": "4a777408c66eadec51674c3463b34a00", "score": "0.59887445", "text": "function zoom_to_area(features,clickedFeature) {\n var featuresToZoom = [];\n featuresToZoom = features;\n //If the user clicks on a feature, that feature becomes the parent feature to display, so we need to include it when zooming.\n if (clickedFeature) {\n featuresToZoom.push(clickedFeature);\n }\n \n var bounds = new OpenLayers.Bounds();\n var boundsOfAllObjects = new OpenLayers.Bounds();\n \n //Each location is inside a square shape called the bounds.\n //There is an east,south,west,north side (right,bottom,left,top) side to each of the bounds\n //All we need to do is cycle through all the features are find the most northerly, easterly, westerly, and southerly\n //bounds. We then have a square containing all the features, we can then automatically zoom into this square.\n $.each(featuresToZoom, function (idx, feature) {\n bounds = feature.geometry.getBounds()\n //Store the left most boundary if it is further west than current stored furthest west boundary\n if (!boundsOfAllObjects.left || boundsOfAllObjects.left > bounds.left) {\n boundsOfAllObjects.left = bounds.left;\n }\n //As above for south\n if (!boundsOfAllObjects.bottom || boundsOfAllObjects.bottom > bounds.bottom) {\n boundsOfAllObjects.bottom = bounds.bottom;\n }\n //As above for east\n if (!boundsOfAllObjects.right || boundsOfAllObjects.right < bounds.right) {\n boundsOfAllObjects.right = bounds.right;\n }\n //As above for north\n if (!boundsOfAllObjects.top || boundsOfAllObjects.top < bounds.top) {\n boundsOfAllObjects.top = bounds.top;\n } \n });\n //Zoom and center\n //if showing something small, don't zoom in too far\n if (indiciaData.mapdiv.map.getZoomForExtent(bounds) > indiciaData.mapdiv.settings.maxZoom) { \n indiciaData.mapdiv.map.setCenter(bounds.getCenterLonLat(), div.settings.maxZoom);\n } else {\n zoom = indiciaData.mapdiv.map.getZoomForExtent(boundsOfAllObjects);\n indiciaData.mapdiv.map.setCenter(boundsOfAllObjects.getCenterLonLat(), zoom); \n }\n}", "title": "" } ]
3f062d1ed4b09d097d249b83067bc449
Updates the summary tab based on the current settings
[ { "docid": "ff0bb2301a93b0acc91097feb5dd7e03", "score": "0.64121604", "text": "updateSummary() {\n if (!this.summary)\n return;\n this.summary.innerHTML = 'Flags: ' + this.flagsEl.value + \"\\n\";\n this.summary.innerHTML += 'Seed: ' + this.seedEl.value + \"\\n\";\n let state;\n let name;\n for (let i=0; i < this.inputs.length; i++) {\n let input = this.inputs[i];\n if (input.tagName == 'INPUT') {\n let input = this.inputs[i];\n if (input.indeterminate) {\n state = 'Maybe';\n } else if (input.checked) {\n state = 'Yes';\n } else {\n state = 'No';\n }\n }\n else if (input.tagName == 'SELECT') {\n state = input.selectedOptions[0].innerText;\n }\n this.summary.innerHTML += input.dataset.label + ': ' + state + \"\\n\";\n }\n let spriteBox = $('#sprite-box')\n if (spriteBox)\n this.summary.innerHTML += 'Player Sprite: ' + spriteBox.getValue();\n }", "title": "" } ]
[ { "docid": "019fdc9a47a7984c8904c2f92d5fca90", "score": "0.70843774", "text": "function updateSummary() {\r\n\t\tvar url = app.urls.summaryRefreshURL;\r\n\t\tvar summary = $(\"#secondary.summary\");\r\n\t\t// indicate progress\r\n\t\tapp.progress.show(summary);\r\n\r\n\t\t// load the updated summary area\r\n\t\tsummary.load( url, function () {\r\n\t\t\t// hide edit shipping method link\r\n\t\t\tsummary.fadeIn(\"fast\");\r\n\t\t\tsummary.find('.checkout-mini-cart .minishipment .header a').hide();\r\n\t\t\tsummary.find('.order-totals-table .order-shipping .label a').hide();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "10d7881cf1b1a505e52fb81ecb28e6f4", "score": "0.69216055", "text": "function updateSummary() {\r\n return root.html(self.summarize());\r\n }", "title": "" }, { "docid": "0ea4a1a9e09d732eae23be68ae92273d", "score": "0.6714492", "text": "function updateSummary() {\n let goalSplit = savedData.books[savedData.currentBook].endDate.split(\"-\");\n $(\"#summary\").text(`You will be finished reading \"${\n savedData.books[savedData.currentBook].bookTitle}\" on ${\n calendarLabels.allMonths[goalSplit[1]]} ${goalSplit[2]}, ${\n goalSplit[0]}, reading ${\n savedData.books[savedData.currentBook].goalPages} page(s) every time marked in the calendar.`);\n $(\"#print-summary\").html(`Reading Plan \"${savedData.books[savedData.currentBook].bookTitle}\", until ${\n calendarLabels.allMonths[goalSplit[1]]} ${goalSplit[2]}, ${goalSplit[0]}`);\n}", "title": "" }, { "docid": "98ac9f98817bd76d4281d5b494622ab0", "score": "0.65741116", "text": "function updateSummary() {\r\n displayNumItems();\r\n var subtotal = sumSubtotal();\r\n displaySubtotal(subtotal);\r\n displayQST(subtotal);\r\n displayGST(subtotal);\r\n displayTotal(subtotal);\r\n}", "title": "" }, { "docid": "b18c8129c7ba528b4993f03057413992", "score": "0.64478254", "text": "function setDashboardStats(statsSummary) {\r\n var totalActive = statsSummary.total - statsSummary.discharged - statsSummary.deaths;\r\n\r\n $('#totalCases').html(JSON.stringify(statsSummary.total));\r\n $('#totalActive').html(totalActive);\r\n $('#cic').html(JSON.stringify(statsSummary.confirmedCasesIndian));\r\n $('#cfc').html(JSON.stringify(statsSummary.confirmedCasesForeign));\r\n $('#discharged').html(JSON.stringify(statsSummary.discharged));\r\n $('#deaths').html(JSON.stringify(statsSummary.deaths));\r\n $('#clu').html(JSON.stringify(statsSummary.confirmedButLocationUnidentified));\r\n}", "title": "" }, { "docid": "f63e163a3896b442b9b48b30863169cf", "score": "0.6310169", "text": "function fillEditSummaries() {\n \n\tif ( !$( '#wpSummaryLabel' ).length ) {\n\t\treturn;\n\t}\n \n\t$.get( mw.config.get( 'wgScript' ), { title: 'Template:Stdsummaries', action: 'raw', ctype: 'text/plain' } ).done( function( data ) {\n\t\tvar\t$summaryOptionsList,\n\t\t\t$summaryLabel = $( '#wpSummaryLabel' ),\n\t\t\tlines = data.split( '\\n' ),\n\t\t\t$wrapper = $( '<div>').addClass( 'edit-widemode-hide' ).text( 'Standard summaries: ' );\n \n\t\t$summaryOptionsList = $( '<select />' ).attr( 'id', 'stdEditSummaries' ).change( function() {\n\t\t\tvar editSummary = $( this ).val();\n\t\t\tif ( editSummary !== '' ) {\n\t\t\t\t$( '#wpSummary' ).val( editSummary );\n\t\t\t}\n\t\t} );\n \n\t\tfor ( var i = 0; i < lines.length; i++ ) {\n\t\t\tvar editSummaryText = ( lines[i].indexOf( '-- ' ) === 0 ) ? lines[i].substring(3) : '';\n\t\t\t$summaryOptionsList.append( $( '<option>' ).val( editSummaryText ).text( lines[i] ) );\n\t\t}\n \n\t\t$summaryLabel.prepend( $wrapper.append( $summaryOptionsList ) );\n\t} );\n \n}", "title": "" }, { "docid": "7e93cadae4eacd21bf4df0da973ca3b0", "score": "0.62916714", "text": "function summaryUpdate(){\n\n\tvar summaryDiv = document.getElementById(\"summary\");\n\n for(var j = 0; j < allKeys.length; j++){\n\n var sumItem = summaryDiv.children[j];\n\n var f_Object = Object.assign(new feature_object(\"\", 0, \"\", true), JSON.parse(sessionStorage.getItem(allKeys[j])));\n\n sumItem.children[0].textContent = allKeys[j];\n\n sumItem.children[1].textContent = f_Object.getName();\n\n }\n\n var mobileSummaryDiv = document.getElementById(\"mobile-summary\");\n\n for(var j = 0; j < allKeys.length; j++){\n\n var sumItem = mobileSummaryDiv.children[j];\n\n var f_Object = Object.assign(new feature_object(\"\", 0, \"\", true), JSON.parse(sessionStorage.getItem(allKeys[j])));\n\n sumItem.children[0].textContent = allKeys[j];\n\n sumItem.children[1].textContent = f_Object.getName();\n\n }\n\n}", "title": "" }, { "docid": "2824b09049a26bc50da63f7840e869f4", "score": "0.62246114", "text": "function fillEditSummaries() {\n\tif ( !$( '#wpSummaryLabel' ).length ) {\n\t\treturn;\n\t}\n\t$.get( mw.config.get( 'wgScript' ), { title: 'Template:Stdsummaries', action: 'raw', ctype: 'text/plain' } ).done( function( data ) {\n\t\tvar\t$summaryOptionsList,\n\t\t\t$summaryLabel = $( '#wpSummaryLabel' ),\n\t\t\tlines = data.split( '\\n' ),\n\t\t\t$wrapper = $( '<div>').addClass( 'edit-widemode-hide' ).text( 'Standard summaries: ' );\n\t\t$summaryOptionsList = $( '<select />' ).attr( 'id', 'stdEditSummaries' ).change( function() {\n\t\t\tvar editSummary = $( this ).val();\n\t\t\tif ( editSummary !== '' ) {\n\t\t\t\t$( '#wpSummary' ).val( editSummary );\n\t\t\t}\n\t\t} );\n\t\tfor ( var i = 0; i < lines.length; i++ ) {\n\t\t\tvar editSummaryText = ( lines[i].indexOf( '-- ' ) === 0 ) ? lines[i].substring(3) : '';\n\t\t\t$summaryOptionsList.append( $( '<option>' ).val( editSummaryText ).text( lines[i] ) );\n\t\t}\n\t\t$summaryLabel.prepend( $wrapper.append( $summaryOptionsList ) );\n\t} );\n}", "title": "" }, { "docid": "d37ea565975a080f7deb3e23776bbb24", "score": "0.60441196", "text": "function fillEditSummaries() {\n\n\tif( !$( '#wpSummaryLabel' ).length ) {\n\t\treturn;\n\t}\n\tvar\tsummaryOptionsHtml = '',\n\t\t$summaryOptionsList;\n\n\t$.get( wgScript, { title: 'Template:Stdsummaries', action: 'raw', ctype: 'text/plain' }, function( data ) {\n\t\tvar lines = data.split( '\\n' );\n\t\tfor( var i = 0; i < lines.length; i++ ) {\n\t\t\tvar value = ( lines[i].indexOf( '-- ' ) === 0 ) ? lines[i].substring(3) : \"\";\n\t\t\tsummaryOptionsHtml += '<option value=\"' + value + '\">' + lines[i] + '</option>';\n\t\t}\n\t\t$summaryOptionsList = $( '<select />' ).attr( 'id', 'stdEditSummaries' ).html( summaryOptionsHtml ).change( function() {\n\t\t\tvar value = $( this ).val();\n\t\t\tif ( value !== '' ) {\n\t\t\t\tif( skin === 'oasis' ) {\n\t\t\t\t\t$( '#wpSummary' ).text( value );\n\t\t\t\t} else {\n\t\t\t\t\t$( '#wpSummary' ).val( value );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\t$( '#wpSummaryLabel' ).prepend( 'Standard summaries: ', $summaryOptionsList, '<br />' );\n\t} );\n\n}", "title": "" }, { "docid": "799ec07dca9c079933aee4bf3169aca1", "score": "0.6032957", "text": "function updateOverview() {\n // console.log(\"updateOverview:\", currentItemData);\n $scope.overview = currentItemData;\n $scope.isOverviewDark = false;\n }", "title": "" }, { "docid": "2d3d3a1f427d672a7bef61950dc8554a", "score": "0.600941", "text": "function updateStatisticsView() {\n // Get reference to html element with id \"win-count\"\n const winCount = document.querySelector('#win-count');\n winCount.innerHTML = `${statsResult.amountOfWon}/${statsResult.totalThrows}`;\n\n // Get reference to html element with id \"result-history\"\n const resultHistory = document.querySelector('#result-history');\n resultHistory.innerHTML =\n `<strong>Flips</strong>: ${statsResult.resultHistory.flips.join(', ')} \n <br>\n <strong>User choices</strong>: ${statsResult.resultHistory.userChoices.join(', ')}`;\n\n // Get reference to html element with id \"head-count\"\n const headCount = document.querySelector('#head-count');\n headCount.textContent = statsResult.amountOfHead;\n\n // Get reference to html element with id \"reverse-count\"\n const reverseCount = document.querySelector('#reverse-count');\n reverseCount.textContent = statsResult.amountOfReverse;\n}", "title": "" }, { "docid": "93b462285af6e6717abde717ede75b0e", "score": "0.597448", "text": "function displaySettings() {\n settingString = settingString + 'Count ' + numberOfTimes + '- ' + Office.context.document.settings.get(numberOfTimes.toString()) + \"\\n\";\n writeToPage(settingString);\n numberOfTimes++;\n }", "title": "" }, { "docid": "04068f273754453e9db42e1f0115ad67", "score": "0.5926838", "text": "function updateSystemSummaryDisplay(summary) {\n\n //document.getElementById('currentPower').innerHTML = toKGMW(summary.current_power);\n //document.getElementById('dailyEnergy').innerHTML = toKGMWh(summary.energy_today);\n document.getElementById('weeklyEnergy').innerHTML = toKGMWh(summary.energy_week);\n document.getElementById('monthlyEnergy').innerHTML = toKGMWh(summary.energy_month);\n document.getElementById('lifetimeEnergy').innerHTML = toKGMWh(summary.energy_lifetime);\n \n // The date returned in summary is actually really coarse. Oh well.\n //var date = new Date();\n //date.setISO8601(summary.summary_date);\n //document.getElementById('dataTime').innerHTML = date.toLocaleString();\n}", "title": "" }, { "docid": "21c722410ff98ad55ebfd06d62156ea2", "score": "0.5890152", "text": "function refreshSummary() {\n var counts = aggregate(data, testCount, { \"global\":global, \"byStatus\":byStatus }, currentFilter);\n var times = aggregate(data, totalTime, { \"global\":global, \"byForkedJvm\":byForkedJvm }, currentFilter);\n\n var $summary = $(\"#summary\").html(\"\").attr(\"class\", \"\");\n if ((counts.global || 0) == 0) {\n return;\n }\n\n $(\"<p />\").html(tmpl(\"\\\n #{tests} executed in\\\n #{time} ms on\\\n <a href='#'>#{forkedJvms}</a>.\", {\n tests: countText(counts.global || 0, \"test\"),\n time: times.global,\n forkedJvms: countText(keys(times.byForkedJvm).length, \"forked JVM\")\n })).appendTo($summary);\n\n var html = \"\";\n if (!(counts.byStatus[FAILURE] > 0 || counts.byStatus[ERROR] > 0)) {\n if (counts.byStatus[OK] == counts.global) {\n html = \"All tests passed.\";\n } else if ((counts.byStatus[OK] || 0) > 0) {\n html = tmpl(\"No failures, #{passed} passed, #{ignored} ignored.\", {\n passed:countText(counts.byStatus[OK], \"test\"),\n ignored:countText((counts.byStatus[IGNORED] || 0) + (counts.byStatus[IGNORED_ASSUMPTION] || 0), \"test\")\n });\n }\n } else {\n var h = [];\n if (counts.byStatus[FAILURE] > 0) {\n h.push(counts.byStatus[FAILURE] + \" failed\");\n }\n if (counts.byStatus[ERROR] > 0) {\n h.push(countText(counts.byStatus[ERROR], \"error\"));\n }\n if (counts.byStatus[IGNORED] > 0 || counts.byStatus[IGNORED_ASSUMPTION] > 0) {\n h.push((counts.byStatus[IGNORED] || 0) + (counts.byStatus[IGNORED_ASSUMPTION] || 0) + \" ignored\");\n }\n if (counts.byStatus[OK] > 0) {\n h.push(counts.byStatus[OK] + \" passed\");\n }\n html = h.join(\", \");\n }\n $(\"<p />\").html(html).appendTo($summary);\n\n // Status bar\n $summary.append($(statusbar(counts.byStatus, counts.global)));\n }", "title": "" }, { "docid": "48d2680198a4110288f4d606bfba8ca1", "score": "0.5877937", "text": "function updateTestStats(){\n if (localStorage.rightQuestionTest == \"\" || localStorage.rightQuestionTest == undefined) {\n localStorage.rightQuestionTest = 0;\n }\n\n if (localStorage.totalQuestionTest == \"\" || localStorage.totalQuestionTest == undefined) {\n localStorage.totalQuestionTest = 0;\n }\n\n $(\"#testStats\").text(\"Note cumulative tests : \"+ localStorage.rightQuestionTest + \"/\" + localStorage.totalQuestionTest);\n}", "title": "" }, { "docid": "1eba3e4e82db7230c6503beecacf925b", "score": "0.5844776", "text": "function editsummOnCannedSummarySelected() {\n var newSummary = editsummOriginalSummary;\n if(newSummary.length!=0) newSummary += \" - \";\n \n var idx = editsummDropdown.selectedIndex;\n var canned = editsummDropdown.options[idx].value;\n newSummary += canned;\n document.forms.editform.wpSummary.value = newSummary;\n }", "title": "" }, { "docid": "1eba3e4e82db7230c6503beecacf925b", "score": "0.5844776", "text": "function editsummOnCannedSummarySelected() {\n var newSummary = editsummOriginalSummary;\n if(newSummary.length!=0) newSummary += \" - \";\n \n var idx = editsummDropdown.selectedIndex;\n var canned = editsummDropdown.options[idx].value;\n newSummary += canned;\n document.forms.editform.wpSummary.value = newSummary;\n }", "title": "" }, { "docid": "1eba3e4e82db7230c6503beecacf925b", "score": "0.5844776", "text": "function editsummOnCannedSummarySelected() {\n var newSummary = editsummOriginalSummary;\n if(newSummary.length!=0) newSummary += \" - \";\n \n var idx = editsummDropdown.selectedIndex;\n var canned = editsummDropdown.options[idx].value;\n newSummary += canned;\n document.forms.editform.wpSummary.value = newSummary;\n }", "title": "" }, { "docid": "c85fee50f437ba28560e0a902d28f71f", "score": "0.58437735", "text": "function initSummaryPage() {\n\t_presentPageSummary=1;\n\n\tshowPageNoSummary();\n}", "title": "" }, { "docid": "94001392fdf4b136d74acf971a377f79", "score": "0.584127", "text": "function updateSettings() {\n let panelConsole = $('#console');\n if (MonitoringConsole.Model.Settings.isDispayed()) {\n if (!panelConsole.hasClass('state-show-settings')) {\n panelConsole.addClass('state-show-settings'); \n }\n let singleSelection = MonitoringConsole.Model.Page.Widgets.Selection.isSingle();\n let groups = [];\n groups.push(createGlobalSettings(singleSelection));\n groups.push(createColorSettings());\n groups.push(createPageSettings());\n if (singleSelection) {\n groups = groups.concat(createWidgetSettings(MonitoringConsole.Model.Page.Widgets.Selection.first()));\n }\n $('#Settings').replaceWith(Components.createSettings({id: 'Settings', groups: groups }));\n } else {\n panelConsole.removeClass('state-show-settings');\n }\n }", "title": "" }, { "docid": "0084f96733810f8a9d48be60d693569b", "score": "0.57609653", "text": "function onSettingsUpdate(update) {\n if (update.key === \"_nbArticle\") {\n $scope.quantity = update.value;\n }\n $scope.$apply();\n }", "title": "" }, { "docid": "4de31886ce5d1eed68d2d8f2ee78da9a", "score": "0.57510793", "text": "function summaryButton(event,sectionName) {\n console.log(\"clicked summary\");\n $(event).addClass(\"active\");\n $(event).prev().removeClass(\"active\");\n //show the SVG hide responses\n $(event).parent().parent().nextAll(\".display_box_for_all_responses:first\").hide();\n if (sectionName=='BPSC'||sectionName=='PPSC'||sectionName=='Development Milestones'||sectionName=='Emotional Changes With A New Baby'){\n \t\t$(event).parent().parent().nextAll(\"svg:first\").show();\n\t\t}else{\n\t\t\t$(event).parent().parent().nextAll(\".displayBox:first\").show();\n\t\t}\n\n\n\t}", "title": "" }, { "docid": "db350ab7dea3d2f4d23e12b5aa30916b", "score": "0.5732946", "text": "function updateDisplay() {\r\n dates.all(); // update the date chart\r\n days.all(); // update the day-of-week chart\r\n hours.all(); // update the hour-of-day chart\r\n amounts.all(); // update the amount histogram\r\n all.value(); // update the summary totals\r\n date.top(40); // update the payment list\r\n ++k; // count frame rate\r\n}", "title": "" }, { "docid": "ff7b4f9fb7eaf734a01cb1fa8bf05ea5", "score": "0.5716351", "text": "function setSummary(input) {\n $(\"#summary\").text(input);\n}", "title": "" }, { "docid": "e9b0346ab036498fccc15258e3c6668e", "score": "0.56866133", "text": "function settingsSectionLoad () {\n console.log('*** settingsSectionLoad ***')\n // $('#survey-response-recent').val('222')\n// $('.separator').click(() => { toggleTopbar() })\n// getLastUpdate()\n// drawChart()\n}", "title": "" }, { "docid": "9ef8a013195074a5e2ddfa75b5376df7", "score": "0.5673098", "text": "function updateShoppingCartSummary() {\n vm.summary.subtotal = 0;\n angular.forEach(vm.shoppingCartItems, function (value) {\n vm.summary.subtotal += value.subtotal;\n });\n\n // Once we have the subtotal, we calculate the tax and shipping\n vm.summary.shipping = vm.summary.subtotal * 0.10;\n vm.summary.tax = vm.summary.subtotal * 0.15;\n vm.summary.total = vm.summary.subtotal + vm.summary.tax + vm.summary.shipping;\n }", "title": "" }, { "docid": "af874dc38bf823b4c11949ba8b37b3eb", "score": "0.56671375", "text": "function loadAndDisplaySummaries(){\r\n chrome.tabs.getSelected(null, function(tab){\r\n pageURL = tab.url;\r\n var randomizer = Math.floor(Math.random()*10000); // prevents server caching issues\r\n\r\n $.ajax({\r\n url: tldrURL+\"/api/summaries?url=\"+pageURL+\"&rand=\"+randomizer,\r\n type: \"GET\",\r\n dataType: \"json\",\r\n beforeSend: function(){\r\n $(\"#summaries\").html(\"\"); // empty the current summaries\r\n $(\"#loading_box\").show();\r\n },\r\n complete: function(){\r\n $(\"#loading_box\").hide();\r\n },\r\n success: function(json){\r\n var summaries = json.summaries;\r\n var webpage = json.webpage;\r\n\r\n if(summaries.length == 0){\r\n // no summaries\r\n $(\"#summaries\").html(\"<p class=\\\"box\\\">It seems there aren't any summaries for this page yet. Be the first to write one!</p>\");\r\n return true;\r\n }\r\n\r\n // run through the array to show the summaries\r\n for(var i = 0; i < summaries.length; i++){\r\n var box_summary_string = '<div class=\"box summary\">';\r\n box_summary_string += '<p class=\"content\">'+summaries[i].content.replace(/\\n/g,'<br />')+'</p>';\r\n if(summaries[i].author == null){\r\n box_summary_string += '<p class=\"about\">by Anonymous</p>';\r\n } else {\r\n box_summary_string += '<p class=\"about\">by '+summaries[i].author+'</p>';\r\n }\r\n box_summary_string += '</div>';\r\n\r\n $(\"#summaries\").append($(box_summary_string));\r\n }\r\n\r\n // if there are more summaries than those displayed\r\n if(webpage.summaries_count > summaries.length){\r\n\r\n var total_difference = webpage.summaries_count - summaries.length;\r\n var read_more_string = \"<p><em>\";\r\n if(total_difference == 1){\r\n read_more_string += \"There is one more summary.\";\r\n } else {\r\n read_more_string += \"There are \"+total_difference+\" more summaries.\";\r\n }\r\n read_more_string += ' <a href=\"'+tldrURL+'/'+webpage.handle+'\" target=\"_blank\">Read all summaries</a></em></p>';\r\n\r\n $(\"#summaries\").append($(read_more_string));\r\n }\r\n\r\n },\r\n error: function(){\r\n $(\"#summaries\").html(\"<p><em>An error occurred while retrieving the summaries for this URL. Please try again later.</em></p>\");\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "5f47213d61c7c7951bed738b0b3d219d", "score": "0.56608987", "text": "function updateAverageCounters() {\n\n $(\".granularity\").each(function() {\n $(this).html(data_summary_type);\n });\n\n if (data_summary_type == 'daily') {\n\n $('.average-daily').each(function() {\n $(this).show();\n });\n\n $('.average-weekly').each(function() {\n $(this).hide();\n });\n\n $('.average-monthly').each(function() {\n $(this).hide();\n });\n\n $('.average-yearly').each(function() {\n $(this).hide();\n });\n\n } else if (data_summary_type == 'weekly') {\n\n $('.average-daily').each(function() {\n $(this).hide();\n });\n\n $('.average-weekly').each(function() {\n $(this).show();\n });\n\n $('.average-monthly').each(function() {\n $(this).hide();\n });\n\n $('.average-yearly').each(function() {\n $(this).hide();\n });\n\n } else if (data_summary_type == 'monthly') {\n\n $('.average-daily').each(function() {\n $(this).hide();\n });\n\n $('.average-weekly').each(function() {\n $(this).hide();\n });\n\n $('.average-monthly').each(function() {\n $(this).show();\n });\n\n $('.average-yearly').each(function() {\n $(this).hide();\n });\n\n } else {\n\n $('.average-daily').each(function() {\n $(this).hide();\n });\n\n $('.average-weekly').each(function() {\n $(this).hide();\n });\n\n $('.average-monthly').each(function() {\n $(this).hide();\n });\n\n $('.average-yearly').each(function() {\n $(this).show();\n });\n\n }\n\n}", "title": "" }, { "docid": "e6bc388ed34e3d588a9c787516d7dfaa", "score": "0.5648415", "text": "function showSummaryScreen() {\n summaryScreen.style.display = \"block\";\n showQuestion.style.display = \"none\";\n showChoices.style.display = \"none\";\n main.style.display = \"none\";\n}", "title": "" }, { "docid": "8ea772f54e8834199c1bb2e7c5402e8b", "score": "0.56388617", "text": "addSummaryTab(name) {\n let tab = this.create('tab');\n tab.innerText = name;\n tab.id = name + '-tab';\n tab.click(function(event) {\n ui.setActiveTab(this.innerText);\n });\n this.tabBar.append(tab);\n let content = this.create('tabcontent', null, {\n 'padding': '0',\n 'grid-template-columns': '100%',\n 'grid-template-rows': 'calc(250px + 6em)'\n });\n this.summary = this.create('pre', null, {\n 'margin': '0',\n 'padding': '1em',\n 'font-size': '14px',\n 'overflow-y': 'scroll',\n 'user-select': 'text'\n });\n this.tabContainer.append(content);\n content.append(this.summary);\n this.tabs[name] = {\n 'tab': tab,\n 'content': content\n }\n }", "title": "" }, { "docid": "b1dbee5562c3a5df5feb5cb08497405c", "score": "0.563721", "text": "function open_settings() {\n let config = {\n script_id: script_id,\n title: 'Heatmap',\n on_save: _=>applied = true,\n on_close: reload_on_change,\n content: {tabs: {type: 'tabset', content: {\n general: {\n type: 'page', label: 'General', hover_tip: 'Settings pertaining to the general functions of the script', content: {\n control: {type: 'group', label: 'Control', content: {\n position: {type: 'dropdown', label: 'Position', default: 2, hover_tip: 'Where on the dashboard to install the heatmap', content: {0: \"Top\", 1: \"Below forecast\", 2: \"Below SRS\", 3: \"Below panels\", 4: \"Bottom\"}, path: '@general.position'},\n start_date: {type: 'text', label: 'Start date', default: '2012-01-01', hover_tip: 'All data before this date will be ignored', path: '@general.start_date', },\n week_start: {type: 'dropdown', label: 'First day of the week', default: 0, hover_tip: 'Determines which day of the week is at the top of the heatmaps', content: {0: \"Monday\", 1: \"Tuesday\", 2: \"Wednesday\", 3: \"Thursday\", 4: \"Friday\", 5: \"Saturday\", 6: \"Sunday\"}, path: '@general.week_start', },\n day_start: {type: 'number', label: 'New day starts at', default: 0, placeholder: '(hours after midnight)', hover_tip: 'Offset for those who tend to stay up after midnight. If you want the new day to start at 4 AM, input 4.', path: '@general.day_start', },\n session_limit: {type: 'number', label: 'Session time limit (minutes)', default: 10, placeholder: '(minutes)', hover_tip: 'Max number of minutes between review/lesson items to still count within the same session', path: '@general.session_limit', },\n theme: {type: 'dropdown', label: 'Theme', default: \"dark\", hover_tip: 'Changes the background color and other things', content: {\"light\": \"Light\", \"dark\": \"Dark\", \"breeze-dark\": \"Breeze Dark\",}, path: '@general.theme', },\n },},\n layout: {type: 'group', label: 'Layout', content: {\n reverse_years: {type: 'checkbox', label: 'Reverse year order', default: false, hover_tip: 'Puts the most recent years on the bottom instead of the top', path: '@general.reverse_years', },\n segment_years: {type: 'checkbox', label: 'Segment year', default: true, hover_tip: 'Put a gap between months', path: '@general.segment_years', },\n zero_gap: {type: 'checkbox', label: 'No gap', default: false, hover_tip: `Don't display any gap between days`, path: '@general.zero_gap', },\n day_labels: {type: 'checkbox', label: 'Day of week labels', default: true, hover_tip: 'Adds letters to the left of the heatmaps indicating which row represents which weekday', path: '@general.day_labels', },\n month_labels: {type: 'dropdown', label: 'Month labels', default: \"all\", hover_tip: 'Display month labels above each month', content: {all: \"All\", top: \"Only at the top\", none: \"None\"}, path: '@general.month_labels', },\n },},\n indicators: {type: 'group', label: 'Indicators', content: {\n now_indicator: {type: 'checkbox', label: 'Current day indicator', default: true, hover_tip: 'Puts a border around the current day', path: '@general.now_indicator', },\n level_indicator: {type: 'checkbox', label: 'Level-up indicators', default: true, hover_tip: 'Puts borders around the days on which you leveled up', path: '@general.level_indicator', },\n color_now_indicator: {type: 'color', label: 'Color for current day', hover_tip: 'The border around the current day will have this color', default: '#ff0000', path: '@general.color_now_indicator', },\n color_level_indicator: {type: 'color', label: 'Color for level-ups', hover_tip: 'The borders around level-ups will have this color', default: '#ffffff', path: '@general.color_level_indicator', },\n },},\n },},\n reviews: {type: 'page', label: 'Reviews', hover_tip: 'Settings pertaining to the review heatmaps', content: {\n reviews_settings: {type: 'group', label: 'Review Settings', content: {\n reviews_section: {type: 'section', label: 'Intervals', },\n reviews_auto_range: {type: 'checkbox', label: 'Auto range intervals', default: true, hover_tip: 'Automatically decide what the intervals should be', path: '@reviews.auto_range', },\n reviews_gradient: {type: 'checkbox', label: 'Use gradients', default: false, hover_tip: 'Interpolate colors based on the exact number of items on that day', path: '@reviews.gradient', },\n reviews_generate: {type: 'button', label: 'Generate colors', text: 'Generate', hover_tip: 'Generate new colors from the first and last non-zero interval', on_click: generate_colors, },\n reviews_section2: {type: 'section', label: 'Other', },\n reload_button: {type: 'button', label: 'Reload review data', text: 'Reload', hover_tip: 'Deletes review cache and starts a new fetch', on_click: ()=>review_cache.reload().then(reviews=>reload(reviews)), },\n },},\n },},\n lessons: {type: 'page', label: 'Lessons', hover_tip: 'Settings pertaining to the lesson heatmaps', content: {\n lessons_settings: {type: 'group', label: 'Lesson Settings', content: {\n lessons_section: {type: 'section', label: 'Intervals', },\n lessons_auto_range: {type: 'checkbox', label: 'Auto range intervals', default: true, hover_tip: 'Automatically decide what the intervals should be', path: '@lessons.auto_range', },\n lessons_gradient: {type: 'checkbox', label: 'Use gradients', default: false, hover_tip: 'Interpolate colors based on the exact number of items on that day', path: '@lessons.gradient', },\n lessons_generate: {type: 'button', label: 'Generate colors', text: 'Generate', hover_tip: 'Generate new colors from the first and last non-zero interval', on_click: generate_colors, },\n lessons_section2: {type: 'section', label: 'Other', },\n lessons_count_zeros: {type: 'checkbox', label: 'Include zeros in streak', default: false, hover_tip: 'Counts days with no lessons available towards the streak', path: '@lessons.count_zeros', },\n recover_lessons: {type: 'checkbox', label: 'Recover reset lessons', default: false, hover_tip: 'Allow the Heatmap to guess when you did lessons for items that have been reset', path: '@lessons.recover_lessons', },\n },},\n },},\n forecast: {type: 'page', label: 'Review Forecast', hover_tip: 'Settings pertaining to the forecast', content: {\n forecast_settings: {type: 'group', label: 'Forecast Settings', content: {\n forecast_section: {type: 'section', label: 'Intervals', },\n forecast_auto_range: {type: 'checkbox', label: 'Auto range intervals', default: true, hover_tip: 'Automatically decide what the intervals should be', path: '@forecast.auto_range', },\n forecast_gradient: {type: 'checkbox', label: 'Use gradients', default: false, hover_tip: 'Interpolate colors based on the exact number of items on that day', path: '@forecast.gradient', },\n forecast_generate: {type: 'button', label: 'Generate colors', text: 'Generate', hover_tip: 'Generate new colors from the first and last non-zero interval', on_click: generate_colors, },\n },},\n },},\n },},},\n };\n let dialog = new wkof.Settings(config);\n config.pre_open = elem=>{dialog.refresh(); modify_settings(elem);}; // Refresh to populate settings before modifying\n delete wkof.settings[script_id].wkofs_active_tabs; // Make settings dialog always open in first tab because it is so much taller\n dialog.open();\n }", "title": "" }, { "docid": "a35918bffa35b44188370e9e995b1cc7", "score": "0.56355685", "text": "function setStats(stat, index) {\n var storedStat = localStorage.getItem(stat);\n var statSelector = $(`#${stat}`);\n if (storedStat) {\n statSelector.text(localStorage.getItem(stat));\n statSelector.prop('title', 'Exp: ' + localStorage.getItem(stat + 'XP'));\n }\n}", "title": "" }, { "docid": "91a229dcdd79eb7e371b741ca8b090ba", "score": "0.56261057", "text": "function handleShowSettings () {}", "title": "" }, { "docid": "d00d4e28b7d6168f792fc867c5cfc6cf", "score": "0.5616001", "text": "function open_settings() {\n let config = {\n script_id: script_id,\n title: 'Heatmap',\n on_save: (_) => (applied = true),\n on_close: reload_on_change,\n content: {\n tabs: {\n type: 'tabset',\n content: {\n general: {\n type: 'page',\n label: 'General',\n hover_tip: 'Settings pertaining to the general functions of the script',\n content: {\n control: {\n type: 'group',\n label: 'Control',\n content: {\n position: {\n type: 'dropdown',\n label: 'Position',\n default: 2,\n hover_tip: 'Where on the dashboard to install the heatmap',\n content: {\n 0: 'Top',\n 1: 'Below forecast',\n 2: 'Below SRS',\n 3: 'Below panels',\n 4: 'Bottom',\n },\n path: '@general.position',\n },\n start_date: {\n type: 'input',\n subtype: 'date',\n label: 'Start date',\n default: '2012-01-01',\n hover_tip: 'All data before this date will be ignored',\n path: '@general.start_date',\n },\n week_start: {\n type: 'dropdown',\n label: 'First day of the week',\n default: 0,\n hover_tip: 'Determines which day of the week is at the top of the heatmaps',\n content: {\n 0: 'Monday',\n 1: 'Tuesday',\n 2: 'Wednesday',\n 3: 'Thursday',\n 4: 'Friday',\n 5: 'Saturday',\n 6: 'Sunday',\n },\n path: '@general.week_start',\n },\n day_start: {\n type: 'number',\n label: 'New day starts at',\n default: 0,\n placeholder: '(hours after midnight)',\n hover_tip:\n 'Offset for those who tend to stay up after midnight. If you want the new day to start at 4 AM, input 4.',\n path: '@general.day_start',\n },\n session_limit: {\n type: 'number',\n label: 'Session time limit (minutes)',\n default: 10,\n placeholder: '(minutes)',\n hover_tip:\n 'Max number of minutes between review/lesson items to still count within the same session',\n path: '@general.session_limit',\n },\n theme: {\n type: 'dropdown',\n label: 'Theme',\n default: 'dark',\n hover_tip: 'Changes the background color and other things',\n content: { light: 'Light', dark: 'Dark', 'breeze-dark': 'Breeze Dark' },\n path: '@general.theme',\n },\n },\n },\n layout: {\n type: 'group',\n label: 'Layout',\n content: {\n reverse_years: {\n type: 'checkbox',\n label: 'Reverse year order',\n default: false,\n hover_tip: 'Puts the most recent years on the bottom instead of the top',\n path: '@general.reverse_years',\n },\n segment_years: {\n type: 'checkbox',\n label: 'Segment year',\n default: true,\n hover_tip: 'Put a gap between months',\n path: '@general.segment_years',\n },\n zero_gap: {\n type: 'checkbox',\n label: 'No gap',\n default: false,\n hover_tip: `Don't display any gap between days`,\n path: '@general.zero_gap',\n },\n day_labels: {\n type: 'checkbox',\n label: 'Day of week labels',\n default: true,\n hover_tip:\n 'Adds letters to the left of the heatmaps indicating which row represents which weekday',\n path: '@general.day_labels',\n },\n month_labels: {\n type: 'dropdown',\n label: 'Month labels',\n default: 'all',\n hover_tip: 'Display month labels above each month',\n content: { all: 'All', top: 'Only at the top', none: 'None' },\n path: '@general.month_labels',\n },\n },\n },\n indicators: {\n type: 'group',\n label: 'Indicators',\n content: {\n now_indicator: {\n type: 'checkbox',\n label: 'Current day indicator',\n default: true,\n hover_tip: 'Puts a border around the current day',\n path: '@general.now_indicator',\n },\n level_indicator: {\n type: 'checkbox',\n label: 'Level-up indicators',\n default: true,\n hover_tip: 'Puts borders around the days on which you leveled up',\n path: '@general.level_indicator',\n },\n color_now_indicator: {\n type: 'color',\n label: 'Color for current day',\n hover_tip: 'The border around the current day will have this color',\n default: '#ff0000',\n path: '@general.color_now_indicator',\n },\n color_level_indicator: {\n type: 'color',\n label: 'Color for level-ups',\n hover_tip: 'The borders around level-ups will have this color',\n default: '#ffffff',\n path: '@general.color_level_indicator',\n },\n },\n },\n },\n },\n reviews: {\n type: 'page',\n label: 'Reviews',\n hover_tip: 'Settings pertaining to the review heatmaps',\n content: {\n reviews_settings: {\n type: 'group',\n label: 'Review Settings',\n content: {\n reviews_section: { type: 'section', label: 'Intervals' },\n reviews_auto_range: {\n type: 'checkbox',\n label: 'Auto range intervals',\n default: true,\n hover_tip: 'Automatically decide what the intervals should be',\n path: '@reviews.auto_range',\n },\n reviews_gradient: {\n type: 'checkbox',\n label: 'Use gradients',\n default: false,\n hover_tip:\n 'Interpolate colors based on the exact number of items on that day',\n path: '@reviews.gradient',\n },\n reviews_generate: {\n type: 'button',\n label: 'Generate colors',\n text: 'Generate',\n hover_tip: 'Generate new colors from the first and last non-zero interval',\n on_click: generate_colors,\n },\n reviews_section2: { type: 'section', label: 'Other' },\n reload_button: {\n type: 'button',\n label: 'Reload review data',\n text: 'Reload',\n hover_tip: 'Deletes review cache and starts a new fetch',\n on_click: () => review_cache.reload().then((reviews) => reload(reviews)),\n },\n },\n },\n },\n },\n lessons: {\n type: 'page',\n label: 'Lessons',\n hover_tip: 'Settings pertaining to the lesson heatmaps',\n content: {\n lessons_settings: {\n type: 'group',\n label: 'Lesson Settings',\n content: {\n lessons_section: { type: 'section', label: 'Intervals' },\n lessons_auto_range: {\n type: 'checkbox',\n label: 'Auto range intervals',\n default: true,\n hover_tip: 'Automatically decide what the intervals should be',\n path: '@lessons.auto_range',\n },\n lessons_gradient: {\n type: 'checkbox',\n label: 'Use gradients',\n default: false,\n hover_tip:\n 'Interpolate colors based on the exact number of items on that day',\n path: '@lessons.gradient',\n },\n lessons_generate: {\n type: 'button',\n label: 'Generate colors',\n text: 'Generate',\n hover_tip: 'Generate new colors from the first and last non-zero interval',\n on_click: generate_colors,\n },\n lessons_section2: { type: 'section', label: 'Other' },\n lessons_count_zeros: {\n type: 'checkbox',\n label: 'Include zeros in streak',\n default: false,\n hover_tip: 'Counts days with no lessons available towards the streak',\n path: '@lessons.count_zeros',\n },\n recover_lessons: {\n type: 'checkbox',\n label: 'Recover reset lessons',\n default: false,\n hover_tip:\n 'Allow the Heatmap to guess when you did lessons for items that have been reset',\n path: '@lessons.recover_lessons',\n },\n },\n },\n },\n },\n forecast: {\n type: 'page',\n label: 'Review Forecast',\n hover_tip: 'Settings pertaining to the forecast',\n content: {\n forecast_settings: {\n type: 'group',\n label: 'Forecast Settings',\n content: {\n forecast_section: { type: 'section', label: 'Intervals' },\n forecast_auto_range: {\n type: 'checkbox',\n label: 'Auto range intervals',\n default: true,\n hover_tip: 'Automatically decide what the intervals should be',\n path: '@forecast.auto_range',\n },\n forecast_gradient: {\n type: 'checkbox',\n label: 'Use gradients',\n default: false,\n hover_tip:\n 'Interpolate colors based on the exact number of items on that day',\n path: '@forecast.gradient',\n },\n forecast_generate: {\n type: 'button',\n label: 'Generate colors',\n text: 'Generate',\n hover_tip: 'Generate new colors from the first and last non-zero interval',\n on_click: generate_colors,\n },\n },\n },\n },\n },\n },\n },\n },\n }\n let dialog = new wkof.Settings(config)\n config.pre_open = (elem) => {\n dialog.refresh()\n modify_settings(elem)\n } // Refresh to populate settings before modifying\n delete wkof.settings[script_id].wkofs_active_tabs // Make settings dialog always open in first tab because it is so much taller\n dialog.open()\n }", "title": "" }, { "docid": "1bd1bc4a53664305bfb62f2e7189d27c", "score": "0.55955243", "text": "function populateOverview() {\n\t\t// Are we per/unit or Total for whole years sales?\n\t\tswitch($(\"#GRANULARITY\").val()) { \n\t\t\tcase 'annual': \n\t\t\t\tvar multiplier = CC.totalUnitsSold;\n\t\t\t\tbreak;\n\t\t\tcase 'thousand':\n\t\t\t\tvar multiplier = 1000;\n\t\t\t\tbreak\n\t\t\tcase 'unit':\n\t\t\tdefault:\n\t\t\t\tvar multiplier = 1;\n\t\t};\n\t\t// Loop thought and populate the table. Perhaps this would be better in a Mustache template?\n\t\t_.each(CC.sumData, function(datum, key) {\n\t\t\t_.each(datum, function(value, subkey) {\n\t\t\t\tif(_.isNumber(value)) {\n\t\t\t\t\tvar rounded = (multiplier > 1)\n\t\t\t\t\t\t\t? CC.abbrNumber(value * multiplier, 2)\t// big numbers\n\t\t\t\t\t\t\t: !_.isNumber(value) || (Math.round(value * 100) / 100).toFixed(2), // small numbers\n\t\t\t\t\t\tunit = (subkey == \"TotalCost\")? \"$ \": datum.unit\n\t\t\t\t\t;\n\t\t\t\t\t$(\"#SUMMARY .\" + key + \" .\" + subkey).text((unit === \"$ \")? unit + rounded: rounded + unit);\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t\t// Total Units sold\n\t\t$(\"#SUMMARY .Sales span.Total\").text(CC.abbrNumber(CC.totalUnitsSold, 2));\n\t}", "title": "" }, { "docid": "80f983cdaf0e2e2eae7f0d40fdc47404", "score": "0.55937314", "text": "function showStats() {\n store.getStats(function(stats) {\n view.render(view.commands.showStats, stats);\n view.render(view.commands.toggleAll, (stats.completed === stats.total));\n });\n\t}", "title": "" }, { "docid": "a870ae90bfadfc7b5155fc9c07a30b57", "score": "0.5584047", "text": "function updatePageStatus(){\n\t\tdisplayCorrectCohortInputType();\n\t\ttoggleSearchButton();\n\t}", "title": "" }, { "docid": "5d1dc4789f1bb22e036a7f20edab41d0", "score": "0.5565803", "text": "function showSummary() {\n $(\".header\").hide();\n $(\".quiz\").hide();\n $(\".progress\").hide();\n $(\".summary\").show();\n $(\".summary p\").text(\n \"Congratulations! You got \" +\n score +\n \" out of \" +\n questionList.length +\n \" correct!\"\n );\n}", "title": "" }, { "docid": "0fa862285b421ffcd95902b4b3e082d1", "score": "0.55647147", "text": "function clickStatistics(activeView) {\n model.activeView = activeView;\n show();\n}", "title": "" }, { "docid": "a3357fd4f4e8ea706a83a06722420e98", "score": "0.55507237", "text": "function updateStats(){\n\t\t\t\tvar header = \"\", table = \"\", i = 0, displayData,\n\t\t\t\t\tcty = (state.selCty[\"clicked\"] || state.selCty[\"highlight\"]) || \"All\";\n\t\t\t\tif(cty===\"All\" && state.selCty[\"highlight\"]){\n\t\t\t\t\tcty = state.selCty[\"highlight\"];\n\t\t\t\t}\n\t\t\t\theader = cty;\n\t\t\t\tdisplayData = dataByCounty[cty];\n\n\t\t\t\t$(\"#statsHeader\").html(header);\n\t\t\t\tif(displayData===undefined){\n\t\t\t\t\tdisplayData=dataByCounty[\"All\"];\n\t\t\t\t}\n\t\t\t\tupdateTable(displayData);\n\t\t\t}", "title": "" }, { "docid": "759e0bc8483005443dbaba02d8ea25ba", "score": "0.55382365", "text": "function SummariesAssistant() { }", "title": "" }, { "docid": "85fa3826833e80b485767b8105b82ac3", "score": "0.5518903", "text": "function toolSetting() {\n\tpaginationSetting();\n\t$('#metadata').css('display', 'block');\n\t$('#stat').css('display', 'block');\n\tdisplayList(_metadatalist, 'metadatalist');\n\tdisplayList(_taglist, 'taglist');\n}", "title": "" }, { "docid": "9995bcb795bcd49e8da3f3a52472891e", "score": "0.5501575", "text": "showReportedSettings() {}", "title": "" }, { "docid": "9fb73aedb941bb16af5c4614bd23e21a", "score": "0.546102", "text": "function refreshManageDataUI() {\n // show the manage Visit UI and hide the other UIs\n document.getElementById(\"Visit-M\").style.display = \"block\";\n document.getElementById(\"Visit-C\").style.setProperty(\"display\", \"none\", \"important\")\n document.getElementById(\"Visit-R\").style.setProperty(\"display\", \"none\", \"important\")\n document.getElementById(\"Visit-U\").style.setProperty(\"display\", \"none\", \"important\")\n document.getElementById(\"Visit-D\").style.setProperty(\"display\", \"none\", \"important\")\n}", "title": "" }, { "docid": "a79fc2cd0b3e1b4c28ff22337a19b160", "score": "0.54502475", "text": "function update() {\n headText.text = currentTask.summary;\n descText.text = currentTask.desc;\n infoBar.setProps(\n TodoAssetsService.getIcon(currentTask.type, TodoAssetsService.types.black)\n , currentTask.type\n , currentTask.creationDate\n );\n // SMFConsole.dir(currentTask);\n alarmRuleComp.setProps(currentTask.alarmRule, (currentTask.status != \"completed\"));\n if(currentTask.status == \"completed\" && currentTask.isAlarmSet == false){\n alarmRuleComp._view.visible = false;\n }\n }", "title": "" }, { "docid": "48fa1bf860ab00c53282ebe1cbac48ec", "score": "0.54333824", "text": "function setIndividualInfo() {\n $('#userNameProfile').html(user.name); //sets label of bottom tabbar profile-icon to user' s name according to his profile\n $('#MyProgramTab').html(user.studiengang); //sets MyProgram-tabbar-text to user' s program of stud according to his profile\n}", "title": "" }, { "docid": "e6c6842dc730fdb78c92e4b5cbc4beb7", "score": "0.5424121", "text": "function updateShowCounter() {\n const showCounter = $(\"#show_counter_checkbox\").prop(\"checked\");\n\n chrome.runtime.sendMessage({\n type: \"updateSettings\",\n data: { showCounter }\n }, () => {\n // Refresh display for each tab's PB badge.\n chrome.tabs.query({}, function(tabs) {\n tabs.forEach(function(tab) {\n chrome.runtime.sendMessage({\n type: \"updateBadge\",\n tab_id: tab.id\n });\n });\n });\n });\n}", "title": "" }, { "docid": "20a11209578861b8263b7e495df8bded", "score": "0.54223454", "text": "function updateStats(){\r\n\t$(\"#undertakerHealth\").text(undertaker.health + \" HP\");\r\n\t$(\"#bretHealth\").text(darkbret.health + \" HP\");\r\n\t$(\"#seanHealth\").text(darksean.health + \" HP\");\r\n\t$(\"#hulkHealth\").text(darkhulk.health + \" HP\");\r\n}", "title": "" }, { "docid": "4a303a1569a0b5ccc44bf6dbd4c0825e", "score": "0.5418267", "text": "function updatePageLayout() {\n $('#total-score').text(totalScore)\n $('#total-wins').text(winScore)\n $('#total-losses').text(loseScore)\n $('#random-number').text(randomNumber)\n}", "title": "" }, { "docid": "8c2fe557d7b8d13a55b66bd04d839e6f", "score": "0.5401086", "text": "function displayMetrics() {\n $(\"trackName\").setContentText(currentTrack.getName());\n $(\"trackOwner\").setContentText(currentTrack.getOwner());\n $(\"trackDate\").setContentText(new Date(currentTrack.getTime()).toDateString());\n $(\"trackLength\").setContentText(Math.roundPrecision(currentTrack.calculateLength() / 1000, 2));\n if (currentTrack.hasElevationData()) {\n $(\"trackAccHeight\").setContentText(Math.roundPrecision(currentTrack.calculateAccumulatedHeight(), 2));\n $(\"trackMaxHeight\").setContentText(Math.roundPrecision(currentTrack.calculateMaximumHeight(), 2));\n } else {\n $(\"trackAccHeight\").setContentText(\"No elevation data available.\");\n $(\"trackMaxHeight\").setContentText(\"No elevation data available.\");\n }\n if (currentTrack.hasTimeData()) {\n $(\"trackAvrgSpeed\").setContentText(Math.roundPrecision(Math.metersPerSecondToKilometersPerHour(currentTrack.calculateAverageSpeed()), 2));\n $(\"trackMaxSpeed\").setContentText(Math.roundPrecision(Math.metersPerSecondToKilometersPerHour(currentTrack.calculateMaximumSpeed()), 2));\n } else {\n $(\"trackAvrgSpeed\").setContentText(\"No time data available.\");\n $(\"trackMaxSpeed\").setContentText(\"No time data available.\");\n }\n DIAGRAM_HELPER.reloadAll();\n }", "title": "" }, { "docid": "176c41f9c2c917a9891345932463296b", "score": "0.5398838", "text": "function set_summary_info( $booking_wrapper ) {\n\t\tif ( $booking_wrapper.find( '.hb-accom-list .hb-accom' ).length > 1 ) {\n\t\t\t$booking_wrapper.find( '.hb-summary-change-accom' ).show();\n\t\t} else {\n\t\t\t$booking_wrapper.find( '.hb-summary-change-accom' ).hide();\n\t\t}\n\t\t$booking_wrapper.find( '.hb-summary-check-in' ).html( $booking_wrapper.find( '.hb-check-in-date' ).val() );\n\t\t$booking_wrapper.find( '.hb-summary-check-out' ).html( $booking_wrapper.find( '.hb-check-out-date' ).val() );\n\t\t$booking_wrapper.find( '.hb-summary-nights' ).html( $booking_wrapper.find( '.hb-booking-nb-nights' ).html() );\n\t\t$booking_wrapper.find( '.hb-summary-adults' ).html( $booking_wrapper.find( 'select.hb-adults' ).val() );\n\t\t$booking_wrapper.find( '.hb-summary-children' ).html( $booking_wrapper.find( 'select.hb-children' ).val() );\n\t\tvar accom_title = '';\n\t\tif ( $booking_wrapper.find( '.hb-accom-selected .hb-accom-title a' ).length ) {\n\t\t\taccom_title = $booking_wrapper.find( '.hb-accom-selected .hb-accom-title a' ).html();\n\t\t} else {\n\t\t\taccom_title = $booking_wrapper.find( '.hb-accom-selected .hb-accom-title' ).html();\n\t\t}\n\t\tvar accom_id = $booking_wrapper.find( '.hb-accom-selected' ).data( 'accom-id' );\n\t\tvar accom_num_name = '';\n\t\tif (\n\t\t\t$booking_wrapper.find( '.hb-select-accom-' + accom_id + '-num' ).length &&\n\t\t\t( $booking_wrapper.find( '.hb-select-accom-' + accom_id + '-num input' ).length > 1 )\n\t\t) {\n\t\t\tvar selected_num = $booking_wrapper.find( 'input[name=\"hb-accom-' + accom_id + '-num\"]:checked' ).val();\n\t\t\taccom_num_name = $booking_wrapper.find( 'label[for=\"hb-accom-' + accom_id + '-' + selected_num + '\"]' ).html();\n\t\t}\n\t\tvar accom_price = $booking_wrapper.find( '.hb-accom-selected' ).find( '.hb-accom-price-raw' ).val();\n\t\taccom_price = format_price( accom_price );\n\t\t$booking_wrapper.find( '.hb-summary-accom' ).html( accom_title );\n\t\t$booking_wrapper.find( '.hb-summary-accom-num-name' ).html( accom_num_name );\n\t\tif ( accom_num_name ) {\n\t\t\t$booking_wrapper.find( '.hb-summary-accom-num-name-wrap' ).show();\n\t\t} else {\n\t\t\t$booking_wrapper.find( '.hb-summary-accom-num-name-wrap' ).hide();\n\t\t}\n\t\t$booking_wrapper.find( '.hb-summary-accom-price > span' ).html( accom_price );\n\t}", "title": "" }, { "docid": "324af13f5c9a3619deb3c43ad2815108", "score": "0.5397866", "text": "function rSummary() {\n var alldone = $('<h2>').html('These are your results: <br><br>');\n var canswers = $('<p>').html('Correct answers: ' + gcount);\n var wanswers = $('<p>').html('Incorrect answers: ' + wcount);\n var cunanswered = $('<p>').html('Unanswered: ' + unanswered);\n //adding a play again button\n var pagain = $('<button type=\"button\" class=\"btn btn-success btn-lg btn-block\" id=\"pagain\">');\n pagain.text('Play again?');\n var newDiv = $('<div class=\"col-lg-4 col-lg-offset-4 text-center\" id=\"summary\">');\n newDiv.append(alldone);\n newDiv.append(canswers);\n newDiv.append(wanswers);\n newDiv.append(cunanswered);\n newDiv.append(pagain);\n $('.row:nth(2)').append(newDiv);\n\n // Reload page if player cliques on pagain button\n $('#pagain').on('click', function() {\n location.reload();\n });\n }", "title": "" }, { "docid": "8efe36c1e25c64ca7398bcb666ffa9b7", "score": "0.5380918", "text": "function updateDashboard() {\n removeGraph();\n updateData(popularity_metric, curr_genre);\n createFlowGraph();\n}", "title": "" }, { "docid": "f7bc32262a4d278f3ec3e797b669cc0d", "score": "0.5379284", "text": "function renderSummary() {\n document.getElementById(\"status-table\").innerHTML = resultTable.innerHTML;\n // Set inner HTML of the status field to the result table\n}", "title": "" }, { "docid": "3af516e5974ee59844ee58f99ed89c50", "score": "0.5376198", "text": "function refresh() {\n setP(goal.current, goal.total);\n document.getElementById(\"pageTitle\").innerText = goal.name;\n document.getElementById(\"titleText\").innerText = goal.name;\n let UI_currentText = document.getElementById(\"UI_currentText\");\n UI_currentText.innerText = goal.current;\n let UI_goalAmountText = document.getElementById(\"UI_goalAmountText\");\n UI_goalAmountText.innerText = goal.total;\n}", "title": "" }, { "docid": "bd598fe036ebc51baaa1970f44232ed8", "score": "0.53761435", "text": "function updateSummaryText(gridId, copyTextId) {\n $(\"#\" + gridId + \" .summary\").css('display', 'none');\n $(\"#\" + copyTextId).empty();\n $(\"#\" + copyTextId).append($(\"#\" + gridId + \" .summary\"));\n $(\"#\" + copyTextId + \" .summary\").css('display', 'block');\n// $(\".clientSearch #\" + copyTextId).val($(\"#\" + gridId).html($(\"#\" + gridId + \" .summary\").text()));\n}", "title": "" }, { "docid": "bb2ddac8d79ee7a123df61b92a42f212", "score": "0.5366528", "text": "function updateSettings() {\n updateSpeechBubble();\n trimChatLog();\n updateChatPage();\n }", "title": "" }, { "docid": "ff68ca58f1ea9058ec4c3fb31352fe76", "score": "0.5354987", "text": "function open_settings() {\n let config = {\n script_id: 'mrmr',\n name: 'mrmr',\n title: 'Multiple Readings/Meanings Retention',\n on_save: settings_saved,\n content: {\n tabs: { type: 'tabset',\n content: {\n pgMain: { type: 'page', label: 'Substance', hover_tip: 'Configure answer settings for Reviews',\n content: {\n grp_main: { type:'group', label:'Answer Requirements', hover_tip: 'Set primary settings\\nfor multi-answer items.',\n content:{\n requirements: {type:'dropdown', label:'Number Required', hover_tip: 'Choose how many of the possible\\nanswers are required.',\n default: settings.requirements,\n content: {\n 'showOnly': 'Only 1 Answer, Show the Rest',\n 'requireAll': 'All Possible Answers',\n 'minRequire': 'Specific Number',\n 'srsBased': 'Base On SRS Level'\n },\n on_change: config_settings\n },\n answerFormat: {type:'dropdown', label:'Answer Format', hover_tip: 'Set how you want to submit\\non multi-answer items.',\n default: 'multiEntry',\n content: {\n 'oneEntry': 'All In One Go (semicolon separated)',\n 'multiEntry': 'One At A Time'\n },\n on_change: config_settings\n },\n tolerance: {type:'dropdown', label:'Accuracy Tolerance', hover_tip: 'Control how lenient you want WK to be with accuracy.',\n default: settings.tolerance,\n content: {\n 0: 'Relaxed',\n 1: 'Moderate',\n 2: 'Strict'\n }\n },\n disallowClose: {type:'checkbox', label:'Refuse \\'Close\\' Answers', hover_tip: 'Refuses correct, but inaccurate, answers\\nand allows you to re-submit them.',\n default: settings.disallowClose\n },\n mrmrLessons: {type:'checkbox', label:'Start With Lessons', hover_tip: 'If a lesson item has more than one answer,\\nrequire them all to progress.',\n default: settings.mrmrLessons\n },\n strict: {type:'checkbox', label:'Strict Mode', hover_tip: 'Removes safety nets for on\\'yomi/kun\\'yomi reading\\nexceptions, and blank or duplicate submissions.',\n default: settings.strict\n }\n }\n },\n grp_particulars: {type:'group', label:'Particulars', hover_tip: 'Choose specifics for further customization.',\n content: {\n showNumPossible: {type:'checkbox', label:'Show Total Required', hover_tip: 'Checked will display how many possible\\nanswers an item has during reviews.\\nUpdates for \"One At A Time\" on each submission.',\n default: settings.showNumPossible\n },\n showRest: {type: 'checkbox', label: 'Show Remaining Answers', hover_tip: 'Show remaining correct answers\\nafter submitting minimum guesses.\\n(overrides Lightning Mode if more\\nanswers than submissions)',\n default: settings.showRest\n },\n minRequire: {type:'dropdown', label: 'Max Required Answers', hover_tip: 'How many of an items meanings/readings\\nyou need to get correct.',\n default: settings.minRequire,\n content: {'1':'1','2':'2','3':'3','4':'4','5':'5','all':'All'},\n on_change: config_settings\n },\n grp_srsReq: {type:'group', label: 'SRS Level Requirements', hover_tip: 'Set number of answers required\\nfor each SRS level.',\n content: {\n apprentice: {type:'dropdown', label:'Apprentice', hover_tip:'Set requirement for Apprentice Level items.',\n default:settings.apprentice,\n content: {'1':'1','2':'2','3':'3','4':'4','5':'5','all':'All'}\n },\n guru: {type:'dropdown', label:'Guru', hover_tip: 'Set requirement for Guru Level items.',\n default:settings.guru,\n content: {'1':'1','2':'2','3':'3','4':'4','5':'5','all':'All'}\n },\n master: {type:'dropdown', label:'Master', hover_tip: 'Set requirement for Master Level items.',\n default:settings.master,\n content: {'1':'1','2':'2','3':'3','4':'4','5':'5','all':'All'}\n },\n enlightened: {type:'dropdown', label:'Enlightened', hover_tip: 'Set requirement for Enlightened Level items.',\n default:settings.enlightened,\n content: {'1':'1','2':'2','3':'3','4':'4','5':'5','all':'All'}\n }\n }\n }\n }\n }\n }\n },\n pgColors: { type:'page', label:'Style', hover_tip:'Configure background and text colors',\n content: {\n grp_colors: { type: 'group', label: 'Colors',\n content: {\n themeName: {type:'dropdown', label:'Theme', hover_tip:'Choose a theme to user pre-set colors\\nor customize your own below.',\n default: settings.theme.themeCode,\n content: {'wanikani':'WaniKani', 'dark':'Dark', 'colorful':'Colorful', 'cbLight':'Colorblind Light', 'cbDark':'Colorblind Dark', 'cbColorful':'Colorblind ...colorful', 'custom':'Custom'},\n on_change:updateStyle\n },\n bgCorrectColor: {type:'color', label:'Background Correct', hover_tip:'Background color for whole answer bar.',\n default: settings.bgCorrectColor,\n on_change:updateStyle},\n bgIncorrectColor: { type:'color', label: 'Background Incorrect', hover_tip:'Background color for whole answer bar.',\n default: settings.bgIncorrectColor,\n on_change:updateStyle},\n defaultColor: {type:'color',label:'Default Text', hover_tip:'Text color for regular text\\n(neither correct nor incorrect).',\n default: settings.defaultColor,\n on_change:updateStyle},\n correct: {type:'color',label:'Correct (on Correct BG)', hover_tip:'Text color for correct answers.',\n default: settings.correct,\n on_change:updateStyle},\n incorrect: {type:'color',label:'Correct (on Incorrect BG)', hover_tip:'Text color for correct answers in untimately\\nwrong \"All At Once\" submissions.',\n default: settings.incorrect,\n on_change:updateStyle},\n incorrectColor: {type:'color',label:'Incorrect', hover_tip:'Text color for incorrect answers.',\n default: settings.incorrectColor,\n on_change:updateStyle}\n }\n }\n }\n }\n }\n }\n }\n };\n\n settings_dialog = new wkof.Settings(config);\n settings_dialog.open();\n config_settings();\n }", "title": "" }, { "docid": "29b125a8f5f2e27726c1573a623cc1b5", "score": "0.53544813", "text": "function updateTotals() {\n var totals = subscription.calculateTotals();\n\n $form.find('.plan .recurring_cost .cost').text('' + totals.plan);\n $form.find('.due_now .cost').text('' + totals.stages.now);\n $form.find('.coupon .discount').text('' + (totals.coupon || ''));\n $form.find('.vat .cost').text('' + (totals.vat || ''));\n\n $form.find('.add_ons .add_on').each(function() {\n var addOn = $(this).data('add_on');\n if($(this).hasClass('selected')) {\n var cost = totals.addOns[addOn.code];\n $(this).find('.cost').text('+ '+cost);\n }\n else {\n $(this).find('.cost').text('+ '+addOn.cost);\n }\n });\n }", "title": "" }, { "docid": "2790c011003253f2b8e1ee767618c50b", "score": "0.532891", "text": "function inner_view_processing(tab) {\n\n // LT wanted the page title to reflect what's on the page :)\n document.title = $('#nd_device-name').text()\n +' - '+ $('#'+ tab + '_link').text();\n\n // used for contenteditable cells to find out whether the user has made\n // changes, and only reset when they submit or cancel the change\n var dirty = false;\n\n // activate modals, tooltips and popovers\n $('.nd_modal').modal({show: false});\n $(\"[rel=tooltip]\").tooltip({live: true});\n $(\"[rel=popover]\").popover({live: true});\n }", "title": "" }, { "docid": "29f85184c1a7b78463d4bbd635281705", "score": "0.5323701", "text": "function updateRealTimeStats(updateCount) {\n let secondsPerIncrement = \n JSON.parse(localStorage.getItem(\"secondsPerIncrement\"));\n let odometerCategories = \n JSON.parse(localStorage.getItem(\"odometerCategories\"));\n for (var key in secondsPerIncrement) {\n if (secondsPerIncrement.hasOwnProperty(key)) {\n if (updateCount % secondsPerIncrement[key] == 0) {\n var odometers = odometerCategories[key];\n odometers.forEach(odometer => {\n var elemOdometer = document.getElementById(odometer);\n var newValue = parseInt(elemOdometer.getAttribute(\"value\")) + 1;\n elemOdometer.innerHTML = newValue;\n elemOdometer.setAttribute(\"value\", newValue);\n });\n }\n }\n }\n}", "title": "" }, { "docid": "58e7f5105ba4539c118294f1eb5b1b0f", "score": "0.531519", "text": "function updateInputProgress()\n {\n if ( $('#basic-info-tab').hasClass('show') || $('#basic-info-tab').hasClass('active') ) {\n $(\"#progress-inputs .progress-bar\").attr(\"aria-valuenow\", '25%').width('25%').find(\".sr-only\").html('Stage 1');\n } else if ( $('#ingredients-tab').hasClass('show') || $('#ingredients-tab').hasClass('active') ) {\n $(\"#progress-inputs .progress-bar\").attr(\"aria-valuenow\", '50%').width('50%').find(\".sr-only\").html('Stage 2');\n } else if ( $('#method-tab').hasClass('show') || $('#method-tab').hasClass('active') ) {\n $(\"#progress-inputs .progress-bar\").attr(\"aria-valuenow\", '75%').width('75%').find(\".sr-only\").html('Stage 3');\n } else {\n $(\"#progress-inputs .progress-bar\").attr(\"aria-valuenow\", '100%').width('100%').find(\".sr-only\").html('Stage 4');\n }\n }", "title": "" }, { "docid": "439234125455ad8fb8fb56ce11ba1a64", "score": "0.5305363", "text": "setSummary(summary) {\n this.summary = summary;\n return this;\n }", "title": "" }, { "docid": "3d3bc56694fc880c54278313cfc40a6e", "score": "0.530358", "text": "updateSettings (settingspanel) {\n\t\t\tvar settings = {};\n\t\t\tfor (var input of settingspanel.querySelectorAll(BDFDB.dotCN.switchinner)) {\n\t\t\t\tsettings[input.value] = input.checked;\n\t\t\t}\n\t\t\tBDFDB.saveAllData(settings, this, \"settings\");\n\t\t\tthis.updateDetails = true;\n\t\t}", "title": "" }, { "docid": "0d0bf54cda8a6e825f723ffd356c0f30", "score": "0.53033656", "text": "function updateUI() {\n var zprop = current_setsel.strings.zprop || T_DEFAULT_ZPROP;\n $(\"#cellinfo th:last-child\").text(zprop);\n $(\"#dsdesc\").html(\"<h4>Dataset <em>\" + //current_setsel.parent.label + '</em> &gt; <em>' + \n current_setsel.strings.label + \"</em></h4>\" + \"<p>\" + current_setsel.strings.desc + \"</p>\");\n var showDsDesc = function() {};\n $(\"#widget-area\").css(\"margin-top\", -$(\"#menu-launcher\").outerHeight());\n updateFilterUI();\n}", "title": "" }, { "docid": "1bfa8ca03e60ce116820362392261b2b", "score": "0.5289272", "text": "function updateOverview() {\n\n\t\t// var vmin = Math.min( window.innerWidth, window.innerHeight );\n\t\t// var scale = Math.max( vmin / 10, 5 ) / vmin;\n\t\t// var translateX = -indexh;\n\t\t// var translateY = -indexv;\n\n\t\tconst hIndices = getSlidesAttributes().map(slide => slide[\"data-index-h\"]);\n\t\tvar hcount = Math.max.apply(null,hIndices)+1;\n\t\tfunction elementsFreq(a) { return new Map([...new Set(a)].map(\n\t\t\tx => [x, a.filter(y => y === x).length]\n\t\t))};\n\t\tvar slidesPerSection = elementsFreq(hIndices);\n\t\tvar vcount = Math.max.apply(null,Array.from(slidesPerSection.values()));\n\t\tvar scale = Math.min( 1/(hcount+1), 1/(vcount+1) ) ;\n\t\tvar translateX = -(hcount-1)/2;\n\t\tvar translateY = -(vcount-1)/2;\n\n\t\ttransformSlides( {\n\t\t\toverview: [\n\t\t\t\t'scale('+ scale +')',\n\t\t\t\t'translateX('+ ( translateX * overviewSlideWidth ) +'px)',\n\t\t\t\t'translateY('+ ( translateY * overviewSlideHeight ) +'px)'\n\t\t\t].join( ' ' )\n\t\t} );\n\n\t}", "title": "" }, { "docid": "83c5c3d1ae7a45b940a305443e850105", "score": "0.5283722", "text": "function changeSectionToDisplay(coinsSection,liveGraphsSection,aboutSection) {\r\n $('#coinsCatalogMain')[0].style.display = coinsSection;\r\n $('#graphReportsMain')[0].style.display = liveGraphsSection;\r\n $('#aboutMain')[0].style.display = aboutSection;\r\n}", "title": "" }, { "docid": "1ceacd6baccf4de5c9225f653906c117", "score": "0.5279163", "text": "function toggleStats(){\n if (!displayStats){\n $(stats).css(\"display\", \"flex\");\n displayStats = true;\n }\n else {\n $(stats).css(\"display\", \"none\");\n displayStats = false;\n }\n }", "title": "" }, { "docid": "bbf618bc94cfb5a2b460c52098288378", "score": "0.52635396", "text": "function updateStats(){\n\tdocument.querySelector(\"#current-score\").innerHTML = world.score.current;\n\tdocument.querySelector(\"#high-score\").innerHTML = world.score.high;\n}", "title": "" }, { "docid": "a55f83b29fe9156a3aa4fb7686455458", "score": "0.52591294", "text": "function modify_settings(dialog) {\n // Make start-date a jQuery datepicker\n window.jQuery(dialog[0].querySelector('#'+script_id+'_start_date')).datepicker({dateFormat: \"yy-mm-dd\",changeYear: true,yearRange: \"2012:+0\"});\n // Add apply button\n applied = false;\n let apply = create_elem({type: 'button', class: 'ui-button ui-corner-all ui-widget', child: 'Apply', onclick: e=>{applied = true; reload();}});\n dialog[0].nextElementSibling.getElementsByClassName('ui-dialog-buttonset')[0].insertAdjacentElement('afterbegin', apply);\n // Updates the color labels with new hex values\n let update_label = function(input) {\n if (!input.nextElementSibling) input.insertAdjacentElement('afterend', create_elem({type: 'div', class: 'color-label', child: input.value}));\n else input.nextElementSibling.innerText = input.value;\n if (!Math.round(hex_to_rgb(input.value).reduce((a,b)=>a+b/3, 0)/255-0.15)) input.nextElementSibling.classList.remove('light-color');\n else input.nextElementSibling.classList.add('light-color');\n };\n // Add color settings\n dialog[0].querySelectorAll('#'+script_id+'_general ~ div .wkof_group > div:nth-of-type(2)').forEach((elem, i) => {\n let type = [\"reviews\", \"lessons\", \"forecast\"][i];\n // Update the settings object with data from the settings dialog\n let update_color_settings = _=>{\n wkof.settings[script_id][type].colors = [];\n elem.nextElementSibling.children[1].children.forEach((child, i) => {\n wkof.settings[script_id][type].colors.push([child.children[0].children[0].value, child.children[1].children[0].value]);\n });\n };\n // Creates a new interval setting\n let create_row = (value, color)=>create_elem({type: 'div', class: 'row', children: [\n create_elem({type: 'div', class: 'text', child: create_elem({type: 'input', input: 'number', value: value})}),\n create_elem({type: 'div', class: 'color', child: create_elem({type: 'input', input: 'color', value: color, callback: e=>e.addEventListener('change', _=>update_label(e))}), callback: e=>update_label(e.children[0])}),\n create_elem({type: 'div', class: 'delete', child: create_elem({type: 'button', onclick: e=>{e.target.closest('.row').remove(); update_color_settings();}, child: create_elem({type: 'i', class: 'icon-trash'})})}),\n ]});\n // Creates the interface for color settings\n let panel = create_elem({type: 'div', class: \"right\", children: [\n create_elem({type: 'button', class: \"adder\", onclick: e=>{e.target.nextElementSibling.append(create_row(0, '#ffffff')); update_color_settings();}, child: 'Add interval'}),\n create_elem({type: 'div', class: \"row panel\"}),\n ]});\n // Update the settings when they change\n panel.addEventListener('change', update_color_settings);\n // Add the existing settings\n for (let [value, color] of wkof.settings[script_id][type].colors) panel.children[1].append(create_row(value, color));\n // Make sure that reviews and forecast have the same zero-color\n if (i == 0 || i == 2) panel.children[1].children[0].addEventListener('change', e=>{\n let input = e.target.closest('#'+script_id+'_tabs').querySelector('#'+script_id+'_'+(i==0?'forecast':'reviews')+' .panel > .row:first-child .color input');\n if (input.value != e.target.value) {\n input.value = e.target.value;\n input.dispatchEvent(new Event('change'));\n wkof.settings[script_id][i==0?'forecast':'reviews'].colors[0][1] = e.target.value;\n }\n });\n // Install\n elem.insertAdjacentElement('afterend', panel);\n });\n // Disable the first interval's bound input so that it can't be changed from 0\n dialog[0].querySelectorAll('#'+script_id+'_general ~ div .panel .row:first-child .text input').forEach(elem=>elem.disabled=true);\n // Add labels to all color inputs\n dialog[0].querySelectorAll('#'+script_id+'_general input[type=\"color\"]').forEach(input=>{\n input.addEventListener('change', ()=>update_label(input));\n update_label(input);\n });\n }", "title": "" }, { "docid": "a9d5c18fb825ad72bf32d8881589d7c6", "score": "0.52553576", "text": "function refreshManageDataUI() {\n // show the manage visitor UI and hide the other UIs\n document.getElementById(\"Visitor-M\").style.display = \"block\";\n document.getElementById(\"Visitor-C\").style.setProperty(\"display\", \"none\", \"important\")\n document.getElementById(\"Visitor-R\").style.setProperty(\"display\", \"none\", \"important\")\n document.getElementById(\"Visitor-U\").style.setProperty(\"display\", \"none\", \"important\")\n document.getElementById(\"Visitor-D\").style.setProperty(\"display\", \"none\", \"important\")\n}", "title": "" }, { "docid": "2cd0049e2f6dd6d70e71e4d3de6fed5b", "score": "0.52388257", "text": "function showOverallAnalytics(){\r\n\t$('#Individual').hide();\r\n\t$('#Author').hide();\r\n\t$('#Overall').show();\r\n}", "title": "" }, { "docid": "9701c66b4f7fecc1aac58f9c5cb95209", "score": "0.523765", "text": "function modify_settings(dialog) {\n // Make start-date a jQuery datepicker\n //window.jQuery(dialog[0].querySelector('#'+script_id+'_start_date')).datepicker({dateFormat: \"yy-mm-dd\",changeYear: true,yearRange: \"2012:+0\"});\n // Add apply button\n applied = false\n let apply = create_elem({\n type: 'button',\n class: 'ui-button ui-corner-all ui-widget',\n child: 'Apply',\n onclick: (e) => {\n applied = true\n reload()\n },\n })\n dialog[0].nextElementSibling\n .getElementsByClassName('ui-dialog-buttonset')[0]\n .insertAdjacentElement('afterbegin', apply)\n // Updates the color labels with new hex values\n let update_label = function (input) {\n if (!input.nextElementSibling)\n input.insertAdjacentElement(\n 'afterend',\n create_elem({ type: 'div', class: 'color-label', child: input.value }),\n )\n else input.nextElementSibling.innerText = input.value\n if (!Math.round(hex_to_rgb(input.value).reduce((a, b) => a + b / 3, 0) / 255 - 0.15))\n input.nextElementSibling.classList.remove('light-color')\n else input.nextElementSibling.classList.add('light-color')\n }\n // Add color settings\n dialog[0]\n .querySelectorAll('#' + script_id + '_general ~ div .wkof_group > div:nth-of-type(2)')\n .forEach((elem, i) => {\n let type = ['reviews', 'lessons', 'forecast'][i]\n // Update the settings object with data from the settings dialog\n let update_color_settings = (_) => {\n wkof.settings[script_id][type].colors = []\n elem.nextElementSibling.children[1].children.forEach((child, i) => {\n wkof.settings[script_id][type].colors.push([\n child.children[0].children[0].value,\n child.children[1].children[0].value,\n ])\n })\n }\n // Creates a new interval setting\n let create_row = (value, color) =>\n create_elem({\n type: 'div',\n class: 'row',\n children: [\n create_elem({\n type: 'div',\n class: 'text',\n child: create_elem({ type: 'input', input: 'number', value: value }),\n }),\n create_elem({\n type: 'div',\n class: 'color',\n child: create_elem({\n type: 'input',\n input: 'color',\n value: color,\n callback: (e) => e.addEventListener('change', (_) => update_label(e)),\n }),\n callback: (e) => update_label(e.children[0]),\n }),\n create_elem({\n type: 'div',\n class: 'delete',\n child: create_elem({\n type: 'button',\n onclick: (e) => {\n e.target.closest('.row').remove()\n update_color_settings()\n },\n child: create_elem({ type: 'i', class: 'fa fa-trash' }),\n }),\n }),\n ],\n })\n // Creates the interface for color settings\n let panel = create_elem({\n type: 'div',\n class: 'right',\n children: [\n create_elem({\n type: 'button',\n class: 'adder',\n onclick: (e) => {\n e.target.nextElementSibling.append(create_row(0, '#ffffff'))\n update_color_settings()\n },\n child: 'Add interval',\n }),\n create_elem({ type: 'div', class: 'row panel' }),\n ],\n })\n // Update the settings when they change\n panel.addEventListener('change', update_color_settings)\n // Add the existing settings\n for (let [value, color] of wkof.settings[script_id][type].colors)\n panel.children[1].append(create_row(value, color))\n // Make sure that reviews and forecast have the same zero-color\n if (i == 0 || i == 2)\n panel.children[1].children[0].addEventListener('change', (e) => {\n let input = e.target\n .closest('#' + script_id + '_tabs')\n .querySelector(\n '#' +\n script_id +\n '_' +\n (i == 0 ? 'forecast' : 'reviews') +\n ' .panel > .row:first-child .color input',\n )\n if (input.value != e.target.value) {\n input.value = e.target.value\n input.dispatchEvent(new Event('change'))\n wkof.settings[script_id][i == 0 ? 'forecast' : 'reviews'].colors[0][1] = e.target.value\n }\n })\n // Install\n elem.insertAdjacentElement('afterend', panel)\n })\n // Disable the first interval's bound input so that it can't be changed from 0\n dialog[0]\n .querySelectorAll('#' + script_id + '_general ~ div .panel .row:first-child .text input')\n .forEach((elem) => (elem.disabled = true))\n // Add labels to all color inputs\n dialog[0].querySelectorAll('#' + script_id + '_general input[type=\"color\"]').forEach((input) => {\n input.addEventListener('change', () => update_label(input))\n update_label(input)\n })\n }", "title": "" }, { "docid": "ead838201282baa05d2ef4fc4f305055", "score": "0.5235198", "text": "function displayStats() {\n\t$('#HP-Current').html(Stats.HP);\n\t$('#MP-Current').html(Stats.MP);\n\t$('#Monster-HP').html(Monster.HP);\n}", "title": "" }, { "docid": "94a09d395cae8267396fdb3dc71cd58d", "score": "0.52334756", "text": "function showSettings() {\n let save = () => {\n Storage.setWidgetsSettings(widgetsSettings, _this.desc.dashboard, Connector.getNamespace());\n $window.location.reload();\n };\n // Create settings if not exists\n if (!widgetsSettings[_this.desc.name]) {\n widgetsSettings[_this.desc.name] = {};\n }\n // Create theme if not exists\n if (!widgetsSettings[_this.desc.name].themeColors) {\n widgetsSettings[_this.desc.name].themeColors = {};\n }\n ngDialog.open({template: 'src/views/settings.html', data: {isWidgetSettings: true, widgetSettings: widgetsSettings[_this.desc.name], saveWidgetSettings: save}, controller: \"settings\", disableAnimation: dsw.mobile, showClose: true, className: \"ngdialog-theme-default wnd-settings\" });\n }", "title": "" }, { "docid": "1396c70ce076e1aa193b59b664caa2c3", "score": "0.523243", "text": "function updateSectionStatus() {\n var lessonStatusObject = _.countBy( _.pluck($scope.contents.currentSection.lessons, 'isadded'), function(value) {\n return value === true ? 'true' : 'false';\n });\n $scope.contents.currentSection.isadded = (lessonStatusObject.true > 0);\n }", "title": "" }, { "docid": "4e4f381b56c7def3a7ef9e775fcf6600", "score": "0.5231242", "text": "function updateTotals(index) {\n if (!isNaN(index)) {\n var di = covid_total_timeline[index];\n var date = new Date(di.date);\n currentDate = date;\n \n updateCountryName();\n \n var position = dateAxis.dateToPosition(date);\n position = dateAxis.toGlobalPosition(position);\n var x = dateAxis.positionToCoordinate(position);\n \n if (lineChart.cursor) {\n lineChart.cursor.triggerMove({ x: x, y: 0 }, \"soft\", true);\n }\n for (var key in buttons) {\n var count = Number(lineChart.data[index][key])\n if (!isNaN(count)) {\n buttons[key].label.text = capitalizeFirstLetter(key) + \": \" + numberFormatter.format(count, '#,###');\n }\n }\n currentIndex = index;\n }\n }", "title": "" }, { "docid": "8b254c407c76dd7041952661da855de3", "score": "0.52287734", "text": "function updateStatus() {\n var account_data = getAccountData();\n \n if (settings && settings.account) {\n if (settings.account.visible !== account_data.visible) {\n $('body').css({display: (+account_data.visible ? 'block' : 'none')});\n }\n } else {\n $('body').css({display: (+account_data.visible ? 'block' : 'none')});\n }\n \n settings.account = account_data;\n}", "title": "" }, { "docid": "0b75088d241c1b651bfac29438d2c588", "score": "0.5218861", "text": "function updateSummaryHeader() {\n\tvar summary = document.getElementById(\"summaryHeader\");\t\t// Gets and assigns the summary header into summary.\n\t// Concatenate the Summary with numTickets and tripOne or tripTwo. Gets RoundTrip by Default.\n\tif (summaryArray[2] != null) {\n\t\tsummary.innerHTML = (\"Staying for \" + (summaryArray[2] >= 1 ? (summaryArray[2] + \" Night\") : \"0 Nights.</br>Please select your Stay Dates.\"));\n\t\tsummary.innerHTML += ((summaryArray[2] > 1 ? \"s.</br>\" : \".</br>\"));\n\t}\n\tif (summaryArray[3] != null) {\n\t\tsummary.innerHTML += (\"You'll be staying in \" + summaryArray[3] + \", \");\n\t} else {\n\t\tsummary.innerHTML += \"Please select a district to visit.</br>\";\n\t}\n\tif (summaryArray[4] != null) {\n\t\tsummary.innerHTML += (\"in \" + summaryArray[4] + \".\");\n\t} else {\n\t\tsummary.innerHTML += \"Please select a room for your stay.</br>\";\n\t}\n}", "title": "" }, { "docid": "28ad5e14f3e5f1776e92e08fa5e31012", "score": "0.52173674", "text": "function summary(state0, state1) {\n summaries = summaries.update(state0, new Set(), Set_add(state1));\n }", "title": "" }, { "docid": "11e4fff5e186823800b1d535e6b3e44c", "score": "0.5216324", "text": "function showStats() {\n\t\tproductionItemsPanel.Hide();\n\t\tproductionStatsPanel.Reveal();\n\t\tproductionEmployeesPanel.Hide();\n\t}", "title": "" }, { "docid": "b5ce69df20975c1197f11c91f0ff3e8e", "score": "0.5209231", "text": "function settingsUpdateTable(table)\n{\n var appData = getApplicationDataModel();\n\n //\n // Get the latest readings to fill in the default values.\n //\n appData.getSettingsDisplayValues(function (error, settingsObject) {\n\n if (error != null) {\n updateStatusBar(\"Error: \" + error + \" at \" + new Date().toISOString());\n return;\n }\n\n table.UpdateDataTableFromObject(settingsObject);\n });\n}", "title": "" }, { "docid": "1b0d409ae3d2343ab2885d08a16382d5", "score": "0.5209088", "text": "function um_groups_update_tab_count(){\n\t\tvar requested_users_count = jQuery('li[class^=um-groups-tab-slug_].active').find('.count');\n\t\tif ( requested_users_count ) {\n\t\t\tvar c = parseInt( requested_users_count.text() ) - 1;\n\t\t\trequested_users_count.text( c );\n\n\t\t\tif ( c <= 0 ) {\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "b96fe3744e6d7e9d3e24709db80f2625", "score": "0.5201548", "text": "function fillSummary() {\n var currDate = moment().format(\"MM/DD/YYYY\");\n summaryLoc.textContent = currLoc.name + \" (\" + currDate + \")\";\n\n var tempEl = document.querySelector(summary[0].id);\n tempEl.textContent = summary[0].name + summary[0].value + summary[0].units;\n\n var humidityEl = document.querySelector(summary[1].id);\n humidityEl.textContent = summary[1].name + summary[1].value + summary[1].units;\n\n var windSpeedEl = document.querySelector(summary[2].id);\n windSpeedEl.textContent = summary[2].name + summary[2].value + summary[2].units;\n\n var skyEl = document.querySelector(summary[4].id);\n skyEl.textContent = summary[4].name + summary[4].value;\n} // End of function fillSummary();", "title": "" }, { "docid": "0b3265f484979f47728269212c636445", "score": "0.51975495", "text": "function onSettingsChanged(event) {\n\ttry {\n\t\tvar options = JSON.parse(localStorage.options);\n\t\tdisplayCurrency = options.displayCurrency;\n\t\tlastBetDateTime = new Date(1970,0,0,0,0,0);\n\t\t$(\"#betsScroller #scrollContainer\").replaceWith(\"<div id=\\\"scrollContainer\\\"></div>\");\n\t\tgetLeaderboardData();\n\t} catch (err) {\n\t\talert (err);\n\t}\n}", "title": "" }, { "docid": "739cdb1a6a5aa2118a4b19081a25ee3c", "score": "0.51948655", "text": "function statsView() {\n $('#round').text(round);\n $('#wins').text(wins);\n $('#loses').text(loses);\n $('#tie').text(ties);\n }", "title": "" }, { "docid": "3505903177142ff1f595d1582e26314e", "score": "0.51938653", "text": "function InitDetailsSummary() {\n $('html').addClass(/*$.fn.details.support ? */'details'/* : 'no-details'*/);\n\n\t $('html.details summary').each(function () {\n\t\tif(!$(this).next('.detailwrap').length) {\n\t\t\t$(this).nextAll().wrapAll('<div class=\"detailwrap\"></div>');\n\t\t\t$(this).click(function (e) {\n\t\t\t\t//if($.fn.details.support) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t$(this).siblings('div.detailwrap').slideToggle(\"fast\", function () {\n\t\t\t\t\t\t$(this).parent('details').toggleClass('open');\n\t\t\t\t\t});\n\t\t\t\t//}\n\t\t\t});\n\t\t}\n });\n\t\n\t$('html.details details').attr('open', '').find('.detailwrap').css('display', 'none');\n}", "title": "" }, { "docid": "e3dccff36472ec2044e14dd95bb44df1", "score": "0.5188637", "text": "function updateCurrentStatistics(){\ndocument.getElementById(\"tabs-4data\").innerHTML=\"<div id='reporttabs' class=\\\"vtab\\\"><ul><li id='reportbutton-0'><br /><br /><span>Node Report</span></li><li id='reportbutton-1'><br /><br /><span>Current Statistics</span></li></ul><div id='nodereportdata' > <div style='margin-left:25px;'><p>Start Date: <input type='text' id='datepicker'>&nbsp;&nbsp;&nbsp;&nbsp;For:&nbsp;&nbsp;<select id='daynum'><option value='1'>1 day</option> <option value='3'>3 days</option><option value='7'>1 week</option></select> &nbsp;&nbsp; <button type='button' style='margin-left: 5px; margin-right: 5px; margin-top: 10px; \tpadding: 2px; padding-top:4px;\ttext-align: center;\tfont-family: Gill Sans,Arial,sans-serif;\tfont-size: 16px;\tbackground-image: url(\\\"../jquery/jquery-ui-1.8.20.custom/css/hot-sneaks/images/ui-bg_diagonals-small_40_db4865_40x40.png\\\");\tbackground-repeat: repeat; -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px; cursor: pointer;' onclick='javascript:getNodeGraph();'>Bring Report!</button></p></div></br></br></br><div id='nodereportdatain'></div> </div><div id='currentstatisticsdata' ></br><h3>General Node Status</h3><table border='1'><tr><td><div id='generalpie' style='width: 600px; height: 300px; align:center; -webkit-transform: translateZ(1000);'></div></td></tr></table></div></div>\";\n\n//***********************\n//*****GET INITIAL DATE\n \n $.getJSON('../../cgi-bin/slurm/SLURMUI_init',function(data){\n\n\n\n \t\t$.each(data, function(key, val) {\n\n\n $( \"#datepicker\" ).datepicker({dateFormat: 'yy-mm-dd', minDate: val, defaultDate: -1});\n\n}); \n\n});\n\n\n var $items = $('#reporttabs>ul>li');\n $items.click(function() {\n $items.removeClass('selected');\n $(this).addClass('selected');\n\t\tlastTab = $(this).attr('id').split('-')[1];\n\n var index = $items.index($(this));\n $('#reporttabs>div').hide().eq(index).show();\n });\t\t\t\t\n\t$(\"#reportbutton-\" + lastTab).click();\t\n\n\n\n//********************************************************************\n//DRAW CURRENT STATISTICS*********************************************\n//********************************************************************\n\n\n\nvar i = 0;\n $.getJSON('../../cgi-bin/slurm/SLURMUI_current_statistics',function(data){\n\nvar chartArray = new Array();\nvar arrayindex = 0;\n\nvar chartDataArray = new Array();\nvar dataindex = 0;\n \t$.each(data, function(key, val) { \n if(key == \"General\")\n\t\t {\tvar count = 0;\n\t\t\tvar myData=new Array();\n\t\t\t$.each(val, function(keydetail, valdetail) { \n\t\t\t\tmyData[count] = keydetail;\n\t\t\t\tcount++;\n\t\t\t\tmyData[count] = valdetail;\n\t\t\t\tcount++;\n\t\t\t});\t\t\n\t\t\t var gen_chartData = [{title:myData[0],value:myData[1]},{title:myData[2],value:myData[3]},{title:myData[4],value:myData[5]},{title:myData[6],value:myData[7]}];\t\n\n \t\t\tvar generalchart = new AmCharts.AmPieChart();\n\t\t\tgeneralchart.valueField = \"value\";\n\t\t\tgeneralchart.titleField = \"title\";\n\t\t\tgeneralchart.dataProvider = gen_chartData;\n\t\t\tgeneralchart.write(\"generalpie\");\n\n\t\t}\n\t\telse\n\t\t{\n\t\t document.getElementById(\"currentstatisticsdata\").innerHTML += \"<h3>Partition Name: \"+key + \"</h3><table border='1'><tr><td>Node Status</td><td>Job Status</td></tr><tr><td><div id='nodepie-\"+i+\"' style='width: 380px; height: 300px; -webkit-transform: translateZ(1000);'></div></td><td><div id='jobpie-\"+i+\"' style='width: 380px; height: 300px; -webkit-transform: translateZ(1000);'></div></td></tr></table></br>\";\n\n\t\t\tvar new_myData = new Array();\n\t\t\tvar newcount = 0;\n\n\t\t\t$.each(val, function(keydetail, valdetail) {\n\t\t\t new_myData[newcount] = keydetail;\n\t\t\t\tnewcount++;\n\t\t\t\tnew_myData[newcount] = valdetail;\n\t\t\t\tnewcount++;\n });\n\n\t\t\tif(new_myData[1] == 0 && new_myData[3] == 0 && new_myData[5] == 0 && new_myData[7] == 0 )\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"nodepie-\"+i).innerHTML = \"</br></br><div style='margin-left:25px;'>Currently, there are no nodes in this partition.</div>\"; \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tchartDataArray[dataindex] = [{title:new_myData[0],value:new_myData[1]},{title:new_myData[2],value:new_myData[3]},{title:new_myData[4],value:new_myData[5]},{title:new_myData[6],value:new_myData[7]}];\t\n\n \t\t\t\tchartArray[arrayindex] = new AmCharts.AmPieChart();\n\t\t\t\tchartArray[arrayindex].valueField = \"value\";\n\t\t\t\tchartArray[arrayindex].titleField = \"title\";\n\t\t\t\tchartArray[arrayindex].dataProvider = chartDataArray[dataindex];\n\t\t\t\tchartArray[arrayindex].write(\"nodepie-\"+i);\n\t\t\t}\n\t\t\tdataindex++;\n\t\t\tarrayindex++;\n\n\t\t\tif(new_myData[9] == 0 && new_myData[11] == 0 && new_myData[13] == 0 )\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"jobpie-\"+i).innerHTML = \"</br></br><div style='margin-left:25px;'>Currently, there are no jobs in this partition.</div>\"; \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\n\t\t\t\tchartDataArray[dataindex] = [{title:new_myData[8],value:new_myData[9]},{title:new_myData[10],value:new_myData[11]},{title:new_myData[12],value:new_myData[13]}];\t\n\t\t\t \t chartArray[arrayindex] = new AmCharts.AmPieChart();\n\t\t\t\tchartArray[arrayindex].valueField = \"value\";\n\t\t\t\tchartArray[arrayindex].titleField = \"title\";\n\t\t\t\tchartArray[arrayindex].dataProvider = chartDataArray[dataindex];\n\t\t\t\tchartArray[arrayindex].write(\"jobpie-\"+i);\n\t\t\t}\n\t\t\ti++;\t\n\t\t\tdataindex++;\n\t\t\tarrayindex++;\n\t\t}\n\n }); \n \t\n\n });\n\n\n\n}", "title": "" }, { "docid": "fd97321f664bad3fa6b59f8dcb235fe2", "score": "0.5188157", "text": "function updateThisGroup() {\n if (params.expanded == 'true') {\n var i;\n var hash = '#';\n \n chrome.tabs.getAllInWindow(null, function(tabs) {\n \t // locate this tab in the tabs array\n\t var thisTabIndex;\n\t for (thisTabIndex = 0; thisTabIndex < tabs.length; thisTabIndex++) {\n\t if (tabs[thisTabIndex].url == location.href) {\n\t \t // we have found this tab\n console.log(\"Update Group Param ID : \" + params.id);\n\n // same divider id as in hash already\n hash += 'id=' + params.id + DELIMITER;\n console.log(\"Id writting : \" + params.id);\n\t \t \n\t \t // same group title as in hash already\n hash += 'grouptitle=' + params.grouptitle + DELIMITER;\n\n // same color index\n hash += 'colorindex=' + params.colorindex + DELIMITER;\n\n // we have already filtered for expandedness\n hash += 'expanded=' + 'true' + DELIMITER;\n \n var numtabs = 0;\n for (i = thisTabIndex + 1; i < tabs.length && !isGroupTab(tabs[i]); i++) {\n hash += 'tabtitle=' + tabs[i].title + DELIMITER;\n hash += 'taburl=' + tabs[i].url + DELIMITER;\n hash += 'tabfavicon=' + tabs[i].favIconUrl + DELIMITER;\n numtabs++;\n }\n\n hash += 'numtabs=' + numtabs;\n var key = 'divider_' + params.id;\n\n setHash(hash); // triggers updateUI\n\n // DARQUE: addition for non-url based storage.\n chrome.storage.local.set({ [key] : hash }, function() { updateUI(); });\n\n break;\n\t }\n\t }\n });\n }\n}", "title": "" }, { "docid": "c8535960d645fbf73d567a09a6ab81b2", "score": "0.5187347", "text": "function showAll() {\n updateUI(sst);\n}", "title": "" }, { "docid": "565072a143f7b40450358c7456285194", "score": "0.51767117", "text": "function change_tab_info() {\n\tif ($(\".purchases-tab\").hasClass(\"active\")) {\n\t\t$(\".purchases-container\").show();\n\t\t$(\".payments-container\").hide();\n\t} else {\n\t\t$(\".purchases-container\").hide();\n\t\t$(\".payments-container\").show();\n\t}\n}", "title": "" }, { "docid": "70d3b1ef52e6235eeed7762c26c361e4", "score": "0.5173485", "text": "applyStatistics(){\n\t\tthis.hideOrShowComponents(false);\n\t}", "title": "" }, { "docid": "e93f8439e4308c99478cb385b5bec638", "score": "0.51716614", "text": "function updateOtherDisplays() {\n $(\"span\").text(\"Start New Game\");\n // $(\".scoreList\").empty();\n //after 3 seconds, update the header back to Simon\n setTimeout(function() {\n $(\"#title-text\")\n .text(\"SIMON\")\n .css(\"color\", \"black\");\n }, 3000);\n }", "title": "" }, { "docid": "1e4d4ec0255da4eda0c237a184d5b468", "score": "0.5166688", "text": "function Update() {\n\t\tif(menuIsShowing) {\n\t\t\tmodel.setStatsTexts();\n\t\t}\n\t}", "title": "" }, { "docid": "1a45f2c28e884db5e78dd922b18f6af1", "score": "0.51633966", "text": "refreshStats() {\n this.pointsText.text = this.score;\n this.batteryText.text = this.playerEnergy;\n }", "title": "" }, { "docid": "21a8b07066815a92c904edcac98a5c1a", "score": "0.5163063", "text": "notify() {\n this.displaySettings();\n }", "title": "" }, { "docid": "7719c756041ba40d0fc27f22f524a340", "score": "0.5154553", "text": "function updateOverview() {\n\n\t\tvar vmin = Math.min( window.innerWidth, window.innerHeight );\n\t\tvar scale = Math.max( vmin / 5, 150 ) / vmin;\n\n\t\ttransformSlides( {\n\t\t\toverview: [\n\t\t\t\t'scale('+ scale +')',\n\t\t\t\t'translateX('+ ( -indexh * overviewSlideWidth ) +'px)',\n\t\t\t\t'translateY('+ ( -indexv * overviewSlideHeight ) +'px)'\n\t\t\t].join( ' ' )\n\t\t} );\n\n\t}", "title": "" }, { "docid": "063c3bcb90fbe71736cd22f686f646ed", "score": "0.51451343", "text": "function updateResults() {\n $(settings.resultSelector).html(settings.currentResults.length == 0 ? settings.noResults : \"\");\n showMoreResults();\n}", "title": "" }, { "docid": "a2cef19c7daa03d732602414384397e3", "score": "0.51444334", "text": "function storeSettings(chartSettings){\r\n settingsArray[window.currentID] = chartSettings;\r\n //remove the current footer\r\n $('#panel'+window.currentID +' .panel-heading').children().remove();\r\n var newHeading = $('<div>'+chartSettings.ChartType+'</div>');\r\n newHeading.appendTo($('#panel'+window.currentID +' .panel-heading'));\r\n //update information and append new footer to the panel\r\n var newFooter = $('<div class=\"panel-footer\"></div>');\r\n if(chartSettings.OSSelection){\r\n var info=\"OS:\" + chartSettings.OSSelection.toString();\r\n var newLine=$('<p>'+info+'</p>');\r\n newLine.appendTo(newFooter)\r\n }\r\n if(chartSettings.DeviceSelection){\r\n var info=\" Devices:\" + chartSettings.DeviceSelection.toString();\r\n var newLine=$('<p>'+info+'</p>');\r\n newLine.appendTo(newFooter)\r\n }\r\n if(chartSettings.AssetSelection){\r\n var info=\" Assets:\" + chartSettings.AssetSelection.toString();\r\n var newLine=$('<p>'+info+'</p>');\r\n newLine.appendTo(newFooter)\r\n }\r\n if(chartSettings.StartTime && chartSettings.EndTime){\r\n var info = chartSettings.StartTime.toString() + \" to \" + chartSettings.EndTime.toString();\r\n var newLine=$('<p>'+info+'</p>');\r\n newLine.appendTo(newFooter)\r\n }\r\n newFooter.appendTo($('#panel'+window.currentID));\r\n}", "title": "" }, { "docid": "2090c12b05d13df31590d294757523a4", "score": "0.5136475", "text": "updateInformations()\n {\n let gamePlayer = RPM.game.teamHeroes[this.windowChoicesTabs\n .currentSelectedIndex];\n if (this.selectedEquipment === -1)\n {\n this.list = [];\n } else\n {\n let item = this.windowChoicesList.getCurrentContent();\n if (item === null)\n {\n this.list = [];\n } else\n {\n let result = gamePlayer.getEquipmentStatsAndBonus(item.item, RPM\n .datasGame.battleSystem.equipmentsOrder[this\n .windowChoicesEquipment.currentSelectedIndex]);\n this.list = result[0];\n this.bonus = result[1];\n }\n }\n this.windowInformations.content = new GraphicEquipStats(gamePlayer, this\n .list);\n }", "title": "" } ]
ac85d4052bf2738857d922456f756e95
join user to chat
[ { "docid": "bcf7fcf5789cbcc900a9c63f2b2efcb7", "score": "0.0", "text": "function userJoin(id, username) {\n const user = {id , username};\n\n users.push(user)\n\n return user\n}", "title": "" } ]
[ { "docid": "68be713255491c7c499853c460976741", "score": "0.8008059", "text": "joinChat() {\n this\n .socket\n .emit('join', {user: this.state.username})\n }", "title": "" }, { "docid": "d69d53cedd167685c238808522da684d", "score": "0.77356815", "text": "joinChat() {\n let user = {\n user: this.state.username,\n room: this.state.room\n };\n if (this.state.username && this.state.room) {\n try {\n this.socket.emit(\"joinNewUser\", user);\n this.setState({\n isLoggedIn: true // Joined chat.\n });\n } catch (e) {\n console.log(`Error: Unable to join the channel. More: ${e}`);\n }\n }\n }", "title": "" }, { "docid": "9d9976d608525ed5e193c5b3a89d0cee", "score": "0.7603802", "text": "function joinRoom() {\n\t\tvar userName = inputUserName.value;\n\n\t\tif (userName.length > 0) {\n\t\t\tbuttonJoinRoom.disabled = true;\n\t\t\terrorUserName.innerHTML = \"\";\n\t\t\t$('#containerChat').show();\n\t\t\t$('#containerJoin').hide();\n\t\t\tcontainerChatHistory.innerHTML = \"\";\n\t\t\ttextAreaMessage.value = \"\";\n\t\t\thasJoined = true;\n\t\t\teb.send(\"user/join\", userName);\n\t\t}\n\t\telse {\n\t\t\terrorUserName.innerHTML = \n\t\t\t\t\"Error: The user name should take at least one character\";\n\t\t}\n\t}", "title": "" }, { "docid": "433cee13c5d2569f8ee6d5452af5e160", "score": "0.74074036", "text": "function joinRoom() {\n socket.emit('join_room', ({ userName, userRoom }))\n }", "title": "" }, { "docid": "7187b232da6451a0ce7d92f002ceb28c", "score": "0.7315084", "text": "function joinRoom(room){\n socket.emit('join', {\n 'username' : username,\n 'room' : room\n })\n document.querySelector('#display-message').innerHTML = \"\"\n document.querySelector('#user-message').focus()\n }", "title": "" }, { "docid": "9719098a4ec20d0ea65f82aad60fc269", "score": "0.71906084", "text": "function joinChat() {\n\tlet joinArea = document.querySelector(\"#join-chat\");\n\tlet nameInput = document.querySelector(\"#join-chat input\");\n\tif (nameInput.value.length >= 3) {\n\t\tjoinArea.hidden = true;\n\t\tsocket.emit(\"userJoined\", nameInput.value.substring(0, 20));\n\t} else {\n\t\tthrow new Error(\n\t\t\t\"User name is less than the required 3 characters long\"\n\t\t);\n\t}\n}", "title": "" }, { "docid": "e09904870b3439c9eebc57f81820506e", "score": "0.71563464", "text": "openChatWith(userToChetWith) {\n // clear the messages after i changing user to talk with him\n this.setState({messages: []})\n if (userToChetWith.username === this.state.username) {\n alert('You cannot talk with yourself...')\n\n } else {\n // changes in state the current user & aemit him message\n this.setState({CurrentUserToChatWIth: userToChetWith});\n this\n .socket\n .emit('openChatWith', {\n chatWith: userToChetWith.socketid,\n me: this.state.username\n });\n this.setState({openChat: true});\n }\n\n }", "title": "" }, { "docid": "a03f6061a64e8e39647a31eb7422cd87", "score": "0.71487457", "text": "function userJoin(nick, timestamp) {\n\t//put it in the stream\n\t//addMessage(nick, \"joined\", timestamp, \"join\");\n\t$(\"#last\").text(nick + \" <<\");\n\tuserscount ++;\n\tupdateUsersLink();\n}", "title": "" }, { "docid": "95059c1978985148085891386a151ba8", "score": "0.70932806", "text": "function join_chatroom(chat_name, chat_kind){\r\n var index = finding_tab_byname(chat_name); \r\n if(-1== index){ //If we aren't already part of the chat\r\n //alert(chat_name);\r\n //WARNING we should not send our username here\r\n socket.emit(\"newChatRoom\", {user:username, room:chat_name,kind: chat_kind,password:\"\"});\r\n }else{\r\n \tdialog_on_click(tabs[index].id_name); // adds the focus to the tab \r\n\t\tmoveToTab(tabs[index].tab_name); // displays the tab\r\n }\r\n}", "title": "" }, { "docid": "ed23489a606648e18d43da9dcf8bf69f", "score": "0.7023472", "text": "function userJoin(nick, timestamp, id) {\r\n //put it in the stream\r\n addMessage(nick, \"joined\", timestamp, \"join\");\r\n \r\n //if we already know about this user, ignore it\r\n for (var i = 0; i < nicks.length; i++) {\r\n \tif (nicks[i].nick == nick) return;\r\n }\r\n \r\n //otherwise, add the user to the list\r\n nicks.push({nick: nick, id: id});\r\n \r\n //update the UI\r\n updateUsersLink();\r\n}", "title": "" }, { "docid": "e8a966ecb70a5f260bc021b8f1ef6caa", "score": "0.696965", "text": "function joinChatRoom(dataArr, client)\n{\n\tvar joinedRoom = false;\n\tvar joinedMsg = \"* New user has joined chat: \" + client.userName;\n\tif (dataArr.length == 2)\n\t{\n\t\tif (client.chatroom == dataArr[1] && client.chatroom != chatRooms[0].roomname)\n\t\t{\n\t\t\tclient.write(\"* You are already in chatroom: \" + dataArr[1] + \"\\n\");\n\t\t\treturn;\n\t\t}\n\n\t\t// check for proper chatroom entry\n\t\t// change user chatroom name and increase number of users in the room\n\t\tfor (var i = 1; i < chatRooms.length; ++i)\n\t\t{\n\t\t\t\tif (dataArr[1] == chatRooms[i].roomname)\n\t\t\t\t{\n\t\t\t\t\tclient.chatroom = chatRooms[i].roomname;\n\t\t\t\t\tchatRooms[i].users += 1;\t\n\t\t\t\t\tclient.write(\"* Entering chatroom: \" + chatRooms[i].roomname + \"\\n\");\n\t\t\t\t\tbroadcast(joinedMsg, client);\n\t\t\t\t\tjoinedRoom = true;\n\t\t\t\t}\n\t\t}\n\n\t\tif(!joinedRoom)\n\t\t{\n\t\t\tclient.write(\"* That chatroom does not exist \\n\");\n\t\t}\n\n\t}\n\telse\n\t{\n\t\tclient.write(\"* Sorry, that is not proper usage\\n\"+\n\t\t\t\t\t \" Proper usage: /join roomName\\n\");\n\t}\n\n\t// set chatroom in array of clients\n\tif (joinedRoom)\n\t{\n\t\tfor (var i = 0; i < clientList.length; ++i)\n\t\t{\n\t\t\tif (client.name == clientList[i].name)\n\t\t\t{\n\t\t\t\tclientList[i].chatroom = client.chatroom;\n\t\t\t}\n\t\t}\n\n\t\tlistChatRoomMembers(client);\n\t}\n}", "title": "" }, { "docid": "383d623984d48cc36ec9f5bca5ac5681", "score": "0.6960905", "text": "function startChat(chat) {\n _.each(chat.user_ids, function(userId) {\n User.getOnlineSockets(userId, function (socketIds) {\n _.each(socketIds, function (socketId) {\n var socket = io.sockets.connected[socketId];\n if (socket) {\n socket.joinChatRoom(chat);\n }\n })\n });\n });\n }", "title": "" }, { "docid": "e888ec6408bf1de2c462769038de4b93", "score": "0.69269997", "text": "startchat () {\n this.toggleModal()\n\n Actions.chat({ data: this.props.user })\n }", "title": "" }, { "docid": "561cb08c9881ff041a9dbfb339fe523c", "score": "0.6873609", "text": "function mtgJoinGame(game,username){\n socket.join(game);\n io.sockets.in(game).emit('mtg:game:joined', username);\n }", "title": "" }, { "docid": "6f590105741aab81c34ae21dc3ca1fe7", "score": "0.6867386", "text": "function joinChat() {\n if (app.chatType === 'create') {\n popup('Creating your chat ...');\n $.getJSON(\"GhostChatServlet?action=createGroupChat&chatname=\" + app.chatname + \"&ownername=\" + app.username + \"&country=\" + app.location.country + \"&showlocation=\" + app.showLocation + \"&listed=\" + app.listed, function(data) {\n enterChat();\n });\n } else {\n $.getJSON(\"GhostChatServlet?action=usernameExists&chatname=\" + app.chatname + \"&username=\" + app.username, function(data) {\n if (data.usernameexists === false) {\n $.getJSON(\"GhostChatServlet?action=joinGroupChat&chatname=\" + app.chatname + \"&ownername=\" + app.username + \"&country=\" + app.location.country + \"&showlocation=\" + app.showLocation, function(data) {\n enterChat();\n });\n } else {\n popup('This username already exists in this chat, please pick another one ...');\n }\n });\n }\n}", "title": "" }, { "docid": "6790cd2732f57497919a4685a976c0af", "score": "0.683245", "text": "function joinMessage(chatName, chatId, privateMessage) {\n var htmlMessage;\n if (privateMessage) {\n htmlMessage = '<div class=\"chat-ln\">New message from ' + chatName + '</div>';\n $('#' + chatId).append(htmlMessage);\n }\n else {\n htmlMessage = '<div class=\"chat-ln\">You have joined ' + chatName + ' chat</div>';\n $('#' + chatId).append(htmlMessage);\n }\n\n}", "title": "" }, { "docid": "323d94681e3ed05c017151154bead278", "score": "0.6817879", "text": "function addToChat(user) {\n connection.send(\"/inv \" + user);\n $(\"#online\"+user).removeClass(\"noGroup\");\n $(\"#online\"+user).addClass(\"inGroup\");\n $(\"#online\"+user).onclick = \"removeFromChat(\" + user + \")\";\n}", "title": "" }, { "docid": "89683387abe412d40c680cdf468f9558", "score": "0.68127906", "text": "joinRoom(room) {\n this.client.send((() => {\n this.robot.logger.debug(`Joining ${room.jid}/${this.robot.name}`);\n\n // prevent the server from confusing us with old messages\n // and it seems that servers don't reliably support maxchars\n // or zero values\n const el = new Stanza('presence', {to: `${room.jid}/${this.robot.name}`});\n const x = el.c('x', {xmlns: 'http://jabber.org/protocol/muc'});\n x.c('history', {seconds: 1} );\n\n if (room.password) {\n x.c('password').t(room.password);\n }\n return x;\n }\n )());\n\n if (process.env.HUBOT_XMPP_UUID_ON_JOIN != null) {\n // send a guid message and ignore any responses until that's been received\n const room_id = uuid();\n const params = {\n to: room.jid,\n type: 'groupchat'\n };\n this.robot.logger.info(`Joining ${room.jid} with ${room_id}`);\n this.joining[room_id] = room.jid;\n this.client.send(new Stanza('message', params).c('body').t(room_id));\n }\n }", "title": "" }, { "docid": "982308b50661f21581f07b8db91caa51", "score": "0.6795961", "text": "function joinUserToRoom(room, username) {\n if (getAllRooms().includes(username)) {\n let socketId = Object.keys(io.sockets.adapter.rooms[ username ].sockets)[ 0 ];\n io.sockets.sockets[ socketId ].join(room);\n }\n}", "title": "" }, { "docid": "b1374bdc7c388cfb729d2c96eb6c74d5", "score": "0.67922896", "text": "function joinRoom(e){\n const room = e.target.value;\n if (room === currentRoom){\n return;\n }\n\n // If user is already in a room, leave this room before joining a new one\n if (currentRoom) {\n socket.emit(\"leave\", currentRoom);\n }\n updateCurrentRoom(room);\n socket.emit(\"join\", room);\n }", "title": "" }, { "docid": "62a5a899ba32a1c42c0d251b5eb852b6", "score": "0.6786052", "text": "function join() {\n // Close old connection\n if (conn) {\n conn.close();\n }\n\n // Create connection to destination peer specified in the input field\n receiverId = recvIdInput.value || key;\n conn = peer.connect(receiverId, {\n reliable: true\n });\n\n conn.on('open', function () {\n status.innerHTML = \"Connected to: \" + conn.peer;\n console.log(\"Connected to: \" + conn.peer);\n\n // Check URL params for comamnds that should be sent immediately\n var command = getUrlParam(\"command\");\n if (command)\n conn.send(command);\n startChat();\n });\n }", "title": "" }, { "docid": "0fcdbfafb98b708026dc53743a84cb93", "score": "0.6781926", "text": "function joinroom(){\n socket.emit('requestjoin',\n $('#joinUsernameInput').val(),\n $('#joinRoomName').val()\n );\n}", "title": "" }, { "docid": "8a2a90b606da0971c15ab2f2fa7f8ee1", "score": "0.67332196", "text": "function when_user_join(user) {\n var socket = user.connection;\n\n socket.on(\"logout\", function (data) {\n manager.user_leave(user.session_id);\n });\n\n socket.on(\"disconnect\", function (data) {\n manager.user_leave(user.session_id);\n });\n\n socket.on(\"room:join\", function (data) {\n if(!data.room_id) {\n console.log(\"invalid join:room packet =\", data);\n return;\n }\n manager.room_join(user.session_id, data.room_id, function(err) {\n if(err) {\n return socket.emit(\"error\", {error: \"join-room-refused\", message: err.message});\n }\n });\n });\n\n socket.on(\"room:leave\", function (data) {\n if(!data.room_id) {\n console.log(\"invalid leave:room packet =\", data);\n return;\n }\n manager.room_leave(user.session_id, data.room_id);\n });\n\n socket.on(\"room:message\", function (data) {\n if(!data.room_id || !data.text) {\n console.log(\"invalid room:message packet =\", data);\n return;\n }\n manager.room_message(user.session_id, data.room_id, data.text);\n });\n\n socket.on(\"room:private\", function (data) {\n if(!data.username) {\n console.log(\"invalid private packet =\", data);\n return;\n }\n var tuser = manager.get_username(data.username);\n\n //if (!tuser || tuser.server_id !== user.server_id) {\n if (!tuser) {\n return socket.emit(\"error\", {error: \"user-is-not-online\", message: \"\"});\n }\n\n var room_id;\n if (tuser.session_id.localeCompare(user.session_id) == 1) {\n room_id = tuser.server_id + \"/\" + tuser.session_id + \"/\" + user.session_id;\n } else {\n room_id = tuser.server_id + \"/\" + user.session_id + \"/\" + tuser.session_id;\n }\n\n manager.create_room(tuser.server_id, room_id, \"tmp-room-001\", \"welcome to tmp room 01\", {\n destroy_on_empty: true,\n is_public: false\n }, function(err, room_id) {\n if(err) {\n return socket.emit(\"error\", {error: \"join-room-refused\", message: err.message});\n } else {\n manager.room_join(tuser.session_id, room_id);\n manager.room_join(user.session_id, room_id);\n }\n });\n });\n }", "title": "" }, { "docid": "283250d2d3cd08be27324f0d708407cb", "score": "0.67328393", "text": "function joinChatGet(socket, message){\n var chatId = message.chatId;\n var pubKey = message.pubKey;\n var access_id = message.access_id;\n verifyTokenManually(access_id, (accepted, data) => {\n if (accepted){\n // Check if chat exists\n // TODO, combine with next SQL query for users, just get founderId and users\n executeSQLQuery(`SELECT founderId FROM chats WHERE chatId =\"${chatId}\";`, (error, results) => {\n if (error) throw error;\n // TODO add error checking if chat doesn't exist\n var joinerId = data.user_id;\n var founderId = results[0].founderId;\n // TODO ---Send request to user to join, including the pubKye and user name---\n var response = {\"requestToJoinChat\": {\"joinerId\": joinerId, \"pubKey\": pubKey, \"chatId\": chatId}};\n var address = serverConnection.usersAndAddressPort[founderId];\n\n // Checks if users is connected, else put message in invites buffer\n if (address != undefined){\n serverConnection.addressPortAndSocket[address].write(JSON.stringify(response));\n console.log(\"Sending message : \" + JSON.stringify(response) + \" to \" + address);\n } else {\n var query = `INSERT INTO invitesBuffer (destinationUser, messageToSend) VALUES (\"${founderId}\", '${JSON.stringify(response)}')`;\n executeSQLQuery(query, (error, result)=>{\n if (error) throw error;\n console.log(\"Added message to invites buffer\");\n });\n }\n\n });\n } else {\n socket.write(JSON.stringify({\"error\": \"Invalid Token\"}));\n }\n });\n\n}", "title": "" }, { "docid": "ab6d0b87d7757b926d634015d1005877", "score": "0.6691548", "text": "function joinedRoomListener () {\n displayChatMessage(\"Welcome to iLand!\");\n msgManager.sendUPC(UPC.SEND_MESSAGE_TO_ROOMS, \"CHAT_MESSAGE\", roomID, \"true\", \"\", username+\" has joined.\");\n\n}", "title": "" }, { "docid": "0e5c0765d932e996ca06903fd4928d67", "score": "0.6686795", "text": "function enterRoom() {\n connection.userid = userid;\n connection.extra.username = username;\n connection.openOrJoin(roomid);\n}", "title": "" }, { "docid": "b260017cf12f4880b74966ed75fd0dd1", "score": "0.66726154", "text": "joinRoom(){\n\t\tif (this.isConnected)\n\t\t\tthis.client.joinRoom(this.roomName)\n\t}", "title": "" }, { "docid": "cf5e21f372bd3785e6aa924ebaca52ec", "score": "0.66402835", "text": "function handleJoin(chatroomName, callback) {\n // console.log(\"JOIN handler called for \", chatroomName)\n const createEntry = () => ({ event: `joined ${chatroomName}` })\n\n handleEvent(chatroomName, createEntry)\n .then(function (chatroom) {\n // add member to chatroom\n chatroom.addUser(client)\n\n // send chat history to client\n callback(null, chatroom.getChatHistory())\n })\n .catch(callback)\n }", "title": "" }, { "docid": "83f85b5607af25a7ec1d0b17ee4cc99c", "score": "0.66310984", "text": "function joinRoom(userid,socketId, partnerSocketId,msg,res){\n var room = userid;\n io.sockets.connected[socketId].join(room);\n io.sockets.connected[partnerSocketId].join(room);\n for(var i = 0; i<allSockets.length;i++){\n if(allSockets[i].id == socketId){\n allSockets.splice(i,1);\n }\n }\n for(var i = 0; i<allSockets.length;i++){\n if(allSockets[i].id == partnerSocketId){\n allSockets.splice(i,1);\n }\n }\n usersModel.findOne({socketId:partnerSocketId},function(err, partnerUser){\n usersModel.update({_id:userid},{$set:{\"connected\":true,}},function(err){});\n // change the status of partner to connected\n usersModel.update({_id:partnerUser._id},{$set:{\"connected\":true}},function(err){});\n // send ids\n res.json({userId:userid,partnerId:partnerUser._id,room:room,msg:msg});\n io.sockets.in(room).emit('partnersConnected',{connection:'connected',msg:msg,room:room});\n })\n}", "title": "" }, { "docid": "7e0396d15a07c28e152347558daff5de", "score": "0.66268146", "text": "function sendJoin() {\n\tconst input = document.getElementById(\"input\");\n\tconst name = document.getElementById(\"name\");\n\tconst join = document.getElementById(\"join\");\n\tlet jsonstr;\n\tif (name.value.length > 0) {\n\t\t/* Create a message as a JavaScript object */\n\t\tlet joinMsg = {};\n\t\tjoinMsg.type = \"join\";\n\t\tjoinMsg.name = name.value;\n\t\t/* Convert the message to JSON */\n\t\tjsonstr = JSON.stringify(joinMsg);\n\t\t/* Send the JSON text */\n\t\twsocket.send(jsonstr);\n\t\t/* Disable join controls */\n\t\tname.disabled = true;\n\t\tjoin.disabled = true;\n\t\tinput.disabled = false;\n\t\tuserName = name.value;\n\t\t/* Update the Websocket console area */\n\t\twsconsole.value += \"<- \" + jsonstr + \"\\n\";\n\t\twsconsole.scrollTop = 999999;\n\t}\n}", "title": "" }, { "docid": "33c52b855f71c7f6c2392d7c9de8d4e9", "score": "0.6615821", "text": "async joinPublicChat(chatId) {\n var res = await axios.post(`/chat/api/room/${chatId}/join`);\n if (res.status == 200) return true;\n else return false;\n }", "title": "" }, { "docid": "930ce4e00c6c7da04555d9546d73090b", "score": "0.65852916", "text": "function joinRoom(room){\n socket.emit('join_room', room)\n}", "title": "" }, { "docid": "e564d0d1bc4070104c15f5cb7cc33b58", "score": "0.65611666", "text": "joinRoom(room) {\n let allRooms = this.state.allRooms.filter((r) =>\n r._id !== room._id);\n let joinedRooms = [\n ...this.state.joinedRooms,\n room,\n ];\n // Join the chat room;\n this.socket.emit('room', room._id, this.props.userName, UID);\n if (!this.roomInfo[room._id]) this.roomInfo[room._id] = {\n messages: [],\n };\n Actions[this.getChatRoom()]({\n socket: this.socket,\n room: room,\n name: room.name,\n roomId: room._id,\n messages: this.roomInfo[room._id].messages,\n userName: this.props.userName,\n iconName: this.props.iconName,\n });\n this.updateRoom(allRooms, joinedRooms);\n setTimeout(() => {\n this.refreshRoomList();\n }, 500); // Refresh chat room and user number.\n }", "title": "" }, { "docid": "3690126bc1232f0489dcd5d259ab2459", "score": "0.6542379", "text": "joinRoom() {\n this.ws.send(JSON.stringify({ action: 'join-room', message: this.roomInput }));\n this.roomInput = \"\";\n }", "title": "" }, { "docid": "bd1f122e1cd9c690a1d4242f40cee99c", "score": "0.65328246", "text": "chat (message)\n {\n chat(message);\n }", "title": "" }, { "docid": "4896aea9a6da338c01c182ac66738f7f", "score": "0.65288484", "text": "joinRoom(roomName, socket) {\n // we join the socket named after the concat of the user emails, with the first name in alphabetical order first\n socket.join(roomName);\n // // we use the email of the recipient to find the recipient's id\n // db.getId(info.email2).then(rId => {\n // // we take the sender's id off the info object, the user_id off the recipient db call response,\n // // and then emit the messages on the socket\n // db.getMessages(info.user_id, rId.user_id).then(messages => {\n // socket.emit(\"messages\", messages);\n // });\n // });\n // }\n }", "title": "" }, { "docid": "9f56d5bdd6cde89d6e17505d8a1229dc", "score": "0.6528761", "text": "joinChatRoom(room) {\n Actions[this.getChatRoom()]({\n socket: this.socket,\n room: room,\n name: room.name,\n roomId: room._id,\n messages: this.roomInfo[room._id].messages,\n userName: this.props.userName,\n iconName: this.props.iconName,\n });\n }", "title": "" }, { "docid": "479f9ce03601faae6bd16de3dc85048f", "score": "0.6525724", "text": "function joinRoom(room) {\n if (room === '') {\n alert('Entrez un numéro de salle pour pouvoir continuer')\n } else {\n\t roomId = room\n socket.emit('join', room)\n\t showVideoConference()\n\n\t}\n }", "title": "" }, { "docid": "cfafb97276e9928ee9d62c1b848754bd", "score": "0.65232325", "text": "function joinChat(i)\n {\n if(DEBUG_VERBOSE)\n console.log('joinChat(' + i + ')');\n\n var RecXML = new XMLHttpRequest();\t\t\t\t\t\t// IE 7+, Firefox, Chrome, Opera, Safari\n var params = 'sendRequest=LEMMEIN';\t\t\t\t\t\t// Gratuitous complication\n params += '&uname=' + uname;\t\t\t\t\t\t\t// Build parameter string\n params += '&pword=' + pword;\n params += '&i=' + i;\n\n RecXML.open(\"POST\", 'obj/sess/chat/join.php', true);\n RecXML.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n RecXML.onreadystatechange = function()\n {\n if(RecXML.readyState == 4 && RecXML.status == 200)\n {\n if(RecXML.responseText == '')\t\t\t\t\t// Null string\n {\n }\n else\n {\n var ret = RecXML.responseText.split('|');\n if(ret[0] == 'error')\t\t\t\t\t\t// Error with explanation\n {\n }\n else if(ret[0] == 'denied')\t\t\t\t\t// Valid (cogent) request, access denied\n {\n console.log('You have requested access to a chat for which you do not have permission.');\n }\n else if(ret[0] == 'ok')\n {\n \t\t\t\t\t\t\t\t\t\t// Rewrite page asynchronously (cut past 'ok|')\n document.body.innerHTML = RecXML.responseText.substring(3, RecXML.responseText.length);\n currentStation = SHOPTALK_IN_SESSION;\n enableDrawing();\n }\n else\t\t\t\t\t\t\t\t\t\t// Anything other than what we expect\n {\n }\n }\n }\n };\n RecXML.send(params);\n }", "title": "" }, { "docid": "29c9cd2f7e167ce839d72494bb6b0bae", "score": "0.6522665", "text": "function userJoin(id, name, role, room) {\r\n const user = {\r\n id,\r\n name,\r\n role,\r\n room,\r\n };\r\n const index = users.findIndex((user) => user.id === id);\r\n // check to see if participant is already in the room so that duplicates don't occur\r\n index >= 0 ? console.log(\"participant already in room\") : users.push(user);\r\n\r\n updateSession(\"participants\", users.length);\r\n console.log({ user });\r\n return user;\r\n}", "title": "" }, { "docid": "1cf11da7dcc775e342d2e9c8769cb537", "score": "0.6511216", "text": "function joinRoom(socket, roomName, callback) {\n getRoom(roomName, function (error, room) {\n if (error) {\n callback(error)\n }\n join(socket, room, function (error, user) {\n console.log('join success : ' + user.id);\n });\n });\n}", "title": "" }, { "docid": "f3d1954bf6ba844a799fc5442d86c422", "score": "0.6509554", "text": "function joinChannel(msg){\r\n\tif(typeof VoiceConnection === 'undefined' || !VoiceConnection ){\r\n\t\tconsole.log(\"connecting to channel\")\r\n\t\tconst userVoiceID = msg.member.voiceChannelID;\r\n\t\tuserVoice = msg.guild.channels.get(userVoiceID);\r\n\t\trefreshUser();\r\n\t\tuserVoice.join().then(connection => {\r\n\t\t\tVoiceConnection = connection;\r\n\t\t});\r\n\t}\r\n}", "title": "" }, { "docid": "4c8db7bba48ea11fcc472c1c8e49dcd6", "score": "0.6501456", "text": "function join_room(e) {\n var room_name = $('#room').val();\n socket.emit('join room', room_name);\n }", "title": "" }, { "docid": "d026b719bd47b3229f89f934f931ecd5", "score": "0.6494954", "text": "function enterChat() {\n if (app.joinedChat === false) {\n hidePopup();\n view('chat-group');\n $(\"#view-chat-group .view-title\").html(app.chatname);\n app.chatTimer = setInterval(updateChat, 2000);\n app.lastMessageCount = 0;\n app.lastOnlineUsersCount = 0;\n app.joinedChat = true;\n }\n}", "title": "" }, { "docid": "2c0eab36ca40dc61f4f4e50c272f94cf", "score": "0.64809245", "text": "function joinRoom() {\n backendAPI.joinRoom({\n room_id: sharedRoomData.roomId,\n user_id: sharedRoomData.userId,\n password: sharedRoomData.password,\n }).success(function(data) {\n if (data.status === 'OK') {\n console.log('OK backendAPI.joinRoom', data);\n getSongQueue();\n } else {\n if (data.message === \"The correct password was not provided.\") { // TODO: reuse this code below?\n sharedRoomData.passwordProtected = true;\n sharedRoomData.password = window.prompt(\"Enter the password:\");\n $cookies.put(sharedRoomData.roomId, sharedRoomData.password);\n joinRoom();\n }\n console.log('NOT OK backendAPI.joinRoom', data);\n }\n }).error(function(error) {\n console.log('ERROR backendAPI.joinRoom', error);\n });\n }", "title": "" }, { "docid": "e9dd8da900bbca1cdc6c311fc04fc8ae", "score": "0.6479329", "text": "function joinRoom(socket, room) {\n\n // enter into room\n\n socket.join(room);\n\n // detection of user in the room\n currentRoom[socket.id] = room;\n\n // alarming user that his is in the new room\n socket.emit('joinResult', {room: room});\n\n // alarming of over users about of new guest in the room\n\n socket.broadcast.to(room).emit('message', {\n text: nickNames[socket.id] + 'has joined' + room + '.'\n });\n\n // identification over users are in the same room\n // var usersInRoom = io.sockets.clients(room);\n\n // todo case 1 checked form github decision sth with version of socetio\n\n var usersInRoom = io.of('/').in(room).clients;\n\n\n\n\n // if over users is in this room , count them\n\n if (usersInRoom.length > 1){\n\n var usersInRoomSummary = 'Users currently in ' + room + ':';\n\n for (var index in usersInRoom) {\n var userSocketId = usersInRoom[index].id;\n if (userSocketId != socket.id) {\n if (index > 0){\n usersInRoomSummary += ', ';\n }\n\n usersInRoomSummary += nickNames[userSocketId];\n }\n\n }\n\n usersInRoomSummary += '.';\n\n // render report about over users in the room\n\n socket.emit('message', {text: usersInRoomSummary});\n }\n\n\n\n}", "title": "" }, { "docid": "b6543e549cb8a1c2e50edde2cc279449", "score": "0.64692605", "text": "function joinButtonClicked(msg) {\n console.log(\"Join! was clicked\");\n socket.emit('reply', \"A surprise guest will join: \" + msg);\n}", "title": "" }, { "docid": "4dc431c9b825ecc54d868bb569dc3a04", "score": "0.64659697", "text": "function userJoin(id, username, room) {\n const user = { id, username, room };\n var count = 0;\n if (users.indexOf(user) == -1) users.push(user);\n\n return user;\n}", "title": "" }, { "docid": "f482f73198e37640b48ef3edfd9e074a", "score": "0.6458248", "text": "function joinRoom() {\n backendAPI.joinRoom({\n room_id: sharedRoomData.roomId,\n user_id: sharedRoomData.userId,\n password: sharedRoomData.password\n }).success(function (data) {\n if (data.status === 'OK') {\n console.log('OK backendAPI.joinRoom', data);\n getSongQueue();\n } else {\n if (data.message === \"The correct password was not provided.\") {\n // TODO: reuse this code below?\n sharedRoomData.passwordProtected = true;\n sharedRoomData.password = window.prompt(\"Enter the password:\");\n $cookies.put(sharedRoomData.roomId, sharedRoomData.password);\n joinRoom();\n }\n console.log('NOT OK backendAPI.joinRoom', data);\n }\n }).error(function (error) {\n console.log('ERROR backendAPI.joinRoom', error);\n });\n }", "title": "" }, { "docid": "711e90b5b2cccf259a4529cf8071c18f", "score": "0.6430353", "text": "function joinRoom(roomName, onMessages) {\n if (!whisper.getWhisperID()) whisper.setWhisperID(rpcInterface.shh.newIdentity());\n if (!whisper.getFilter(roomName)) {\n whisper.setFilter(roomName, rpcInterface.shh.newFilter({\n topics: [abi.prefix_hex(abi.encode_hex(roomName))]\n }), setInterval(function () {\n getNewMessages(roomName, function (err, messages) {\n if (err) return console.error(err);\n onMessages(messages);\n });\n }, POLL_INTERVAL));\n }\n rpcInterface.shh.getMessages(whisper.getFilter(roomName).id, function (messages) {\n onMessages(parseMessages(messages));\n });\n}", "title": "" }, { "docid": "5e2fe8fd344d7a9241e97d65878553d4", "score": "0.6422265", "text": "function onUserJoined(user, socket) {\n try {\n console.log('user joined roomName', user.roomName);\n //join user to their roomName as well as join to public roomName\n socket.join(user.roomName);\n socket.join('public');\n _sendExistingMessages(socket, user.roomName);\n\n } catch (err) {\n console.err(err);\n }\n}", "title": "" }, { "docid": "a618ccac711ab7cfc55f54414c7fdbbe", "score": "0.6409681", "text": "function joinRoom(){\n\n document.title = `${document.location.href.substring(document.location.href.length - 6, document.location.href.length)}`;\n let matchURL = document.title.substring(document.title.indexOf('#') + 1, document.title.length);\n\n //Join the socket.io room\n client.emit('inMatch', matchURL, client.id);\n}", "title": "" }, { "docid": "d8866ce7d87c5e8d52c9114e74d7b62d", "score": "0.6396309", "text": "function updateChat(msg) {\n var data = JSON.parse(msg.data);\n if(data.userMessage == \"usernameIsTaken\") {\n alert(\"Username has already been taken\");\n changeUsername();\n return;\n }\n insert(\"chat\", data.userMessage);\n id(\"userlist\").innerHTML = \"\";\n data.userlist.forEach(function (user) {\n insert(\"userlist\", \"<li>\" + user + \"</li>\");\n });\n // clear list of channels\n id(\"channellist\").innerHTML = \"\";\n // create list of channels from scratch\n data.channelList.forEach(function (channel) {\n var element = document.createElement('button');\n element.onclick = function () {joinChannel (channel);}\n element.style.width=\"150px\";\n var node = document.createTextNode(channel);\n \telement.appendChild(node);\n \tvar list = id(\"channellist\");\n \tlist.appendChild(element);\n });\n}", "title": "" }, { "docid": "97c837b91f7797613c91c6a2dcaf71ea", "score": "0.63927495", "text": "function userJoin(id, username, room) {\n const user = { id, username, room };\n\n roomUsers.push(user);\n\n return user;\n}", "title": "" }, { "docid": "719efb6c06343b49f22bf6a842f718f1", "score": "0.6384631", "text": "function join() {\n // Close old connection\n if (conn) {\n conn.close();\n }\n\n // when the connect button is pressed get the video and audio and call connectToNewUser()\n const audio = document.querySelector('audio');\n navigator.mediaDevices.getUserMedia({\n video: true,\n audio: true\n })\n .then(stream => {connectToNewUser(video, stream)})\n .catch();\n \n // Create connection to destination peer specified in the input field\n conn = peer.connect(recvIdInput.value, {\n reliable: true\n });\n\n conn.on('open', function () {\n status.innerHTML = \"Connected to: \" + conn.peer;\n console.log(\"Connected to: \" + conn.peer);\n });\n\n\n // Handle incoming data (messages only since this is the signal sender)\n conn.on('data', function (data) {\n console.log('received:',data);\n addMessage(\"<span class=\\\"peerMsg\\\">Peer:</span> \" + data);\n });\n \n conn.on('close', function () {\n status.innerHTML = \"Connection closed\";\n });\n }", "title": "" }, { "docid": "043c68e0ad0d9da2c7da5840338e0819", "score": "0.63795704", "text": "function join(socket, room, callback) {\n // create user session\n var userSession = userRegistry.getById(socket.id);\n userSession.setRoomName(room.name);\n\n room.pipeline.create('WebRtcEndpoint', function (error, outgoingMedia) {\n if (error) {\n console.error('no participant in room');\n // no participants in room yet release pipeline\n if (Object.keys(room.participants).length == 0) {\n room.pipeline.release();\n }\n return callback(error);\n }\n outgoingMedia.setMaxVideoRecvBandwidth(100);\n outgoingMedia.setMinVideoRecvBandwidth(20);\n userSession.outgoingMedia = outgoingMedia;\n\n // add ice candidate the get sent before endpoint is established\n var iceCandidateQueue = userSession.iceCandidateQueue[socket.id];\n if (iceCandidateQueue) {\n while (iceCandidateQueue.length) {\n var message = iceCandidateQueue.shift();\n console.error('user : ' + userSession.id + ' collect candidate for outgoing media');\n userSession.outgoingMedia.addIceCandidate(message.candidate);\n }\n }\n\n userSession.outgoingMedia.on('OnIceCandidate', function (event) {\n console.log(\"generate outgoing candidate : \" + userSession.id);\n var candidate = kurento.register.complexTypes.IceCandidate(event.candidate);\n userSession.sendMessage({\n id: 'iceCandidate',\n sessionId: userSession.id,\n candidate: candidate\n });\n });\n\n // notify other user that new user is joining\n var usersInRoom = room.participants;\n var data = {\n id: 'newParticipantArrived',\n new_user_id: userSession.id\n };\n\n // notify existing user\n for (var i in usersInRoom) {\n usersInRoom[i].sendMessage(data);\n }\n\n var existingUserIds = [];\n for (var i in room.participants) {\n existingUserIds.push(usersInRoom[i].id);\n }\n // send list of current user in the room to current participant\n userSession.sendMessage({\n id: 'existingParticipants',\n data: existingUserIds,\n roomName: room.name\n });\n\n // register user to room\n room.participants[userSession.id] = userSession;\n\n //MP4 has working sound in VLC, not in windows media player,\n //default mediaProfile is .webm which does have sound but lacks IE support\n var recorderParams = {\n mediaProfile: 'MP4',\n uri: \"file:///tmp/file\"+userSession.id+ \".mp4\"\n };\n\n room.pipeline.create('RecorderEndpoint', recorderParams, function(error, recorderEndpoint){\n userSession.outgoingMedia.recorderEndpoint = recorderEndpoint;\n outgoingMedia.connect(recorderEndpoint);\n });\n\n callback(null, userSession);\n });\n}", "title": "" }, { "docid": "0bf536cdafb60d8b2a8f0732372785ee", "score": "0.63767654", "text": "function joinPlayer(username) {\n game.onPlayerJoin(this, username);\n}", "title": "" }, { "docid": "8e516e64608757184a43de76cc923979", "score": "0.6371842", "text": "function sendInvite(fchat, userid, roomid) {\r\n fchat.inviteUser(userid, roomid);\r\n}", "title": "" }, { "docid": "986f687e0f1af361f20f6ba45b75272b", "score": "0.6367237", "text": "join (username, meta) {\n log('Room::joining as', username);\n\n this.socket.emit('join', username, meta || {});\n\n if (this.state.needsSettingUp) {\n this.socket.on('offer', this.onReceivedOffer.bind(this));\n this.socket.on('answer', this.onReceivedAnswer.bind(this));\n this.socket.on('candidate', this.onReceivedRemoteCandidate.bind(this));\n this.socket.on('peer-list', this.onPeerList.bind(this));\n this.socket.on('peer-disconnected', this.onPeerDisconnected.bind(this));\n\n this.socket.on('join-error', this.callbacks.joinError.bind(this));\n\n this.state.needsSettingUp = false;\n }\n }", "title": "" }, { "docid": "b7cffe5eb322859e3ea350a754f8ecfe", "score": "0.6347327", "text": "onJoin(client, options, auth) {\n console.log('join!');\n this.handleAction({\n type: 'JoinGameAction',\n userId: client.sessionId,\n userName: options.userName || 'inspector no name'\n });\n }", "title": "" }, { "docid": "f992343986505d416cd322de43af4600", "score": "0.63423824", "text": "function startChat(username) {\n console.log(username);\n let id = null;\n getJWTToken(function (token) {\n apiClient\n .conversationsGet({}, null, { headers: { Authorization: token } })\n .then(function (result) {\n if (result.data !== null) {\n result.data.forEach(function (conv) {\n if (conv.participants.includes(username)) {\n id = conv.id;\n }\n });\n }\n if (id === null) {\n apiClient\n .conversationsPost({}, [username], {\n headers: { Authorization: token },\n })\n .then(function (result) {\n id = result.data;\n })\n .catch(function (err) {\n console.log(err);\n });\n }\n if(id !== null){\n location.href = \"chats.html#\" + id;\n }\n })\n .catch(function (err) {\n console.log(err);\n });\n });\n}", "title": "" }, { "docid": "9bb7961d5a6dfc5844a3fba3bb70b30c", "score": "0.6333462", "text": "function userJoin(id, username, room){\n const user = {id, username, room}\n users.push(user)\n return user\n}", "title": "" }, { "docid": "a4763410ad5b049f91f144c1f333d4eb", "score": "0.6313249", "text": "function userJoin(id, username, room){\n const user = {id , username, room};\n\n users.push(user);\n\n return user;\n}", "title": "" }, { "docid": "0b910913a25b86974d381b80c9189802", "score": "0.6306935", "text": "function joinRoom (data, nickname) {\n var s = data.split(' ');\n var roomname = s[1];\n console.log(roomname);\n var existRoom = _.findWhere(rooms, {'name': roomname});\n if(existRoom!==undefined){ //already exists, so join\n if (nickname === existRoom.owner) {\n users[nickname].port.write(\" You are the owner of this room and you have already been joined.\");\n } else {\n if (_.contains((existRoom.people), nickname)) {\n users[nickname].port.write(\" You have already joined this room.\");\n }\n else{\n users[nickname].port.write('\\n\\r Entering room: '+roomname);\n existRoom.addPerson(nickname);\n users[nickname].inroom = existRoom.id;\n //console.log(users[nickname].inroom);\n listUsersInRoom(existRoom, nickname);\n broadcast(existRoom.id,'\\n\\r > new user joined the room: ' + nickname, nickname);\n }\n }\n }\n else{ //create a new room\n if(users[nickname].inroom){\n users[nickname].port.write(\"You are in a room. Please leave it first to create your own.\");\n return;\n }\n var id = uuid.v4(); //global unique identifier for a room\n var room1 = new Room(roomname, id, nickname); //create a room object\n rooms[id] = room1;\n rooms[id].addPerson(nickname);\n users[nickname].inroom = id;\n users[nickname].port.write('\\n\\r Entering room: '+roomname);\n listUsersInRoom(room1, nickname);\n //console.log(users[nickname].inroom);\n users[nickname].owns = id;\n }\n \n }", "title": "" }, { "docid": "176be045490522d1a7bdace86d9cd8d6", "score": "0.63057274", "text": "async handleChat(text) {\n\n if (text === \"/joke\") {\n //return a joke\n try {\n const joke = await Joke.getJoke();\n\n this.send(JSON.stringify({ type: \"get-joke\", text: joke }));\n\n } catch (error) {\n //if can't get a joke back\n this.send(JSON.stringify({ type: \"get-joke\", text: \"no joke for you\" }));\n }\n } else if (text === \"/members\") {\n //list all members\n this.send(JSON.stringify({ type: \"members\", text: this.room.getMemberNames() }));\n\n } else if (text.startsWith(\"/name \")) {\n //change username\n const msgParts = text.split(\" \");\n const username = msgParts[1];\n const oldname = this.name;\n this.name = username;\n\n this.room.broadcast({\n type: \"note\",\n text: `${oldname} has been changed to ${username}`\n });\n\n } else if (text.startsWith(\"/priv \")) {\n //send to one user only\n const msgParts = text.split(\" \");\n const username = msgParts[1];\n const msg = `${text.substring(6 + username.length)}(Private message)`;\n\n const member = this.room.getMember(username);\n\n if (member != null) {\n const data = {\n name: this.name,\n type: \"chat\",\n text: msg\n };\n this.send(JSON.stringify(data));\n member.send(JSON.stringify(data));\n } else {\n this.send(JSON.stringify({\n type: \"note\",\n text: `can't find member with username ${username}`\n }));\n }\n\n } else {\n\n this.room.broadcast({\n name: this.name,\n type: 'chat',\n text: text\n });\n }\n\n }", "title": "" }, { "docid": "721c0d762c15a4a90aacc022a2a4dfa1", "score": "0.63031596", "text": "function entrar_a_chat()\n{\nconsole.log(\"a entrar_a_chat\")\nsocket_client.emit(\"pedir usuario en chat\", socket_client.id);\n}//click tab chat", "title": "" }, { "docid": "bd995f337df84d39949c7a30340beb00", "score": "0.6299284", "text": "function sendJoin() {\n var input = document.getElementById(\"input\");\n //var name = document.getElementById(\"name\");\n var join = document.getElementById(\"join\");\n var jsonstr;\n //if (name.value.length > 0) {\n /* Create a message as a JavaScript object */\n var joinMsg = {};\n joinMsg.type = \"join\";\n joinMsg.name = \"\";\n /* Convert the message to JSON */\n jsonstr = JSON.stringify(joinMsg);\n /* Send the JSON text */\n wsocket.send(jsonstr);\n /* Disable join controls */\n // name.disabled = true;\n join.disabled = true;\n input.disabled = false;\n userName = \"\";\n /* Update the Websocket console area */\n wsconsole.value += \"<- \" + jsonstr + \"\\n\";\n wsconsole.scrollTop = 999999;\n //}\n}", "title": "" }, { "docid": "fbcde102262a1d1cee26f4ec355e5813", "score": "0.62637466", "text": "function join(call, callback) {\n const id = uuid.v4();\n users[id] = call;\n\n call.write({ sender: 'CACHE', id: id, type: 'SET_SESSION_ID' });\n broadCast({ sender: 'CACHE', id: id, type: 'WELCOME_NEW_USER_JOINED' });\n}", "title": "" }, { "docid": "642921dec91a5b81ebf23d16c7b61dd5", "score": "0.625897", "text": "function checkWhetherToJoin(props) {\n if (!props.chat) {\n redirectLocation(\"/chat\");\n return;\n }\n if (!props.isLoggedIn) return;\n const chat_id = props.id;\n if (props.isNeedLoad)\n props.dispatch(chatJoin(chat_id));\n}", "title": "" }, { "docid": "e96de8c72986dca442a01505c066cbd2", "score": "0.6254449", "text": "async function joinMtg_Owner() {\n // callFrame.join() returns a promise. so we can use\n // then() and catch(), or await on it.\n try {\n await callFrame.join({\n url: MEETING_URL,\n token: MEETING_OWNER_TOKEN,\n cssFile: 'moderated-demo-owner.css'\n });\n } catch (e) {\n console.error('ERROR while joining meeting', e);\n }\n\n // check and make sure we are a meeting owner, otherwise remote audio\n // mute/unmute won't work\n if (!callFrame.participants().local.owner) {\n console.error('OOPS local participant is not a meeting owner');\n }\n // we're in the meeting now, so we'll have participant data about\n // ourselves, and any other participants in the call so far. update\n // the ui.\n updateUI();\n}", "title": "" }, { "docid": "f6e9443bdd1a728134454ed0ee532028", "score": "0.625399", "text": "function send_chat_message(msg) {\n\tif (selected !== null) {\n\t\tminecraft.servers[selected].send_chat(msg);\n\t} else {\n\t\tconsole_out(color(\"You are not currently attached to a server. Use /attach [id] first.\", \"red\"));\n\t}\n}", "title": "" }, { "docid": "1b62bcb804e91b1c0183a10d1fce4829", "score": "0.6250626", "text": "function sendNewQueueUser(username,length, phone_number, email) {\n socket.emit(\"join\", username, length, phone_number, email);\n }", "title": "" }, { "docid": "b194fe8ce1abb85130b4135b3bb0081d", "score": "0.6246667", "text": "sendToUser(id, message) {\n if (!this._users.hasOwnProperty(id) || !this._users[id].hasOwnProperty('connection')) {\n console.log(('(sendToUser) user with id: ' + id + ' probably left before answer arrived'));\n return;\n }\n const user = this._users[id].connection;\n if (user.readyState === WebSocket.OPEN) {\n user.send(JSON.stringify(message));\n }\n }", "title": "" }, { "docid": "954a9c99128d9735bcdd750fdebd1880", "score": "0.624212", "text": "function join() {\n\tvar room = prompt(\"Room name\");\n\n\tif (room != null) {\n\t\tvar player = prompt(\"Your name\");\n\n\t\tif (player != null) {\n\t\t\tif (player.length > MAX_NAME_LENGTH) {\n\t\t\t\talert(\"Please input a name less than or equal to \"+ MAX_NAME_LENGTH + \" characters.\");\n\t\t\t\tgetName(roomName);\n\t\t\t} else {\n\t\t\t\tvar postParameters = {\n\t\t\t\t\t\t\"room\" : room,\n\t\t\t\t\t\t\"player\" : player\n\t\t\t\t};\n\n\t\t\t\t$.post(\"/join\", postParameters, function(responseJSON) {\n\t\t\t\t\tvar roomExists = JSON.parse(responseJSON).roomExists;\n\t\t\t\t\tvar roomFull = JSON.parse(responseJSON).roomFull;\n\t\t\t\t\tvar duplicateIp = JSON.parse(responseJSON).duplicateIp;\n\n\t\t\t\t\tif (roomExists && !roomFull && !duplicateIp) {\n\t\t\t\t\t\t//brings user to the lobby\n\t\t\t\t\t\twindow.location.href = \"http://\" + window.location.hostname + \":\" + window.location.port + \"/lobby/\" + room;\n\t\t\t\t\t} else if (duplicateIp) {\n\t\t\t\t\t\talert(\"You are already participating in this game in another window.\");\n\t\t\t\t\t} else if (!roomExists) {\n\t\t\t\t\t\talert(\"No room by this name exists. Please enter a new room name.\");\n\t\t\t\t\t\tjoin();\n\t\t\t\t\t} else if (roomFull) {\n\t\t\t\t\t\talert(\"This room is full. Please enter a new room name.\");\n\t\t\t\t\t\tjoin();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5205680fb6d1609b1732010aa0b55d26", "score": "0.6230022", "text": "function writeInChat(message, type) {\n\t\tif (hasJoined) {\n\t\t\tvar typo = \"text-muted\";\n\n\t\t\tswitch (type){\n\t\t\t\tcase MessageType.Join:\n\t\t\t\t\ttypo = \"text-success\"; break;\n\t\t\t\tcase MessageType.Join:\n\t\t\t\t\ttypo = \"text-muted\"; break;\n\t\t\t\tcase MessageType.Leave:\n\t\t\t\t\ttypo = \"text-warning\"; break;\n\t\t\t}\n\n\t\t\tcontainerChatHistory.innerHTML += \n\t\t\t\t\"<p \" + 'class=\"' + typo + '\">' + message + \"</p>\";\n\t\t}\n\t}", "title": "" }, { "docid": "ac093b4158b8c75fb53bf32771f5f48e", "score": "0.6218337", "text": "function joinGroup () {\n userClient.join({\n id: 'everyone'\n }).then(function (group) {\n everyoneGroup = group;\n everyoneGroup.listen('join', onMemberJoin);\n group.getMembers().then(renderGroup);\n });\n }", "title": "" }, { "docid": "8a6eb87b43328e1b3c50d635421ee550", "score": "0.6217", "text": "doChat(userId) {\n // if the cuurent user tap route to the profile page\n if (userId === this.currentUserId) {\n this.router.navigateByUrl(\"/profile\");\n }\n else {\n // route to chat message\n this.router.navigate(['/do-chat', { 'userId': userId }]);\n }\n }", "title": "" }, { "docid": "2e8a34d7a2d77c18d6ee9743b76ae7e0", "score": "0.6213936", "text": "handleJoin(name) {\n this.name = name;\n this.room.join(this);\n this.room.broadcast({\n type: 'note',\n text: `${this.name} joined \"${this.room.name}\".`\n });\n }", "title": "" }, { "docid": "1a1075907e7a489ab2781d907cc42f14", "score": "0.6213705", "text": "function joinRoom(socket, id) {\n log.verbose(\"room.socket#JoinRoom\", id);\n socket.room = id;\n\n getRoom(socket, id, function(room, user) {\n\n if (_.isEmpty(room)) {\n log.verbose(\"Room is empty for now\");\n socket.emit('updateRoom', null);\n return;\n }\n //管理员默认在room.users里面, 如果这句话放倒if中,管理员将得不到房间的消息通知.\n socket.join(socket.room);\n if (!_.find(room.users, {'id': socket.uid})) {\n roomService.join(room, user).then(function(room) {\n return userService.setRoom(socket.uid, room.id).then(function() {\n sendRoomMessage(socket, '用户' + user.username + '加入房间', true);\n });\n }).then(function() {\n updateRooms(socket);\n });\n } else {\n log.verbose(\"User already in room \", room.id);\n sendRoomMessage(socket, '用户' + user.username + '加入房间', true);\n }\n });\n}", "title": "" }, { "docid": "a1f2b692c4edb2949d6df56792ff436f", "score": "0.6212535", "text": "onJoin(client, options, auth) {\n console.log(`Client ${client.id} joined!`)\n this.sendMessage(`Player ${client.id} joined`)\n }", "title": "" }, { "docid": "bfb74ede5e2e7161be1287729fe36464", "score": "0.620961", "text": "join(room) {\n networkBridge.addMembershipToRoom(this, room);\n }", "title": "" }, { "docid": "194c0e40859d45575ba415ec1687a281", "score": "0.62093145", "text": "function joinGame(username) {\n game.addPlayer(this, username);\n}", "title": "" }, { "docid": "3a9a81feb45c4d50c91762a48be60284", "score": "0.6209115", "text": "async function joinChat() {\n try {\n /* Check screen Width to apply responsive page */\n let screenWidth = $(document).width();\n if (screenWidth < 1300) {\n responsiveMobileDisplay()\n } else {\n responsiveDesktopDisplay();\n }\n joinedRoomName = window.event.target.id; // get room name\n avatar_url = window.event.target.getAttribute(\"data\"); // get avatar URL to serve chat profile image\n others = document.getElementById(joinedRoomName).innerHTML; // Talk with this person\n document.getElementById('message').value = ''; // Remove chat Input form data\n document.getElementsByClassName('msg_history')[0].innerHTML = ''; // Remove chat data\n /* Room join Socket */\n socket.emit('JoinRoom', {\n joinedRoomName,\n leave: current,\n receiver: userId\n });\n current = joinedRoomName;\n /* Get previsous chat data */\n await fetch(`/admin/mypage/chat/${joinedRoomName}`).then(res => res.json()).then(result => {\n result.map((data) => {\n let date = data.chatCreated;\n if (data.chatSender != userId) {\n $('.msg_history').append(`<div class=\"incoming_msg\"><div class=\"incoming_msg_img\"><img src=\"${avatar_url}\" alt=\"sunil\"></div><div class=\"received_msg\"><div class=\"received_withd_msg\"><p>${data.chatMessage}</p><span class=\"time_date\">${date}</span></div></div></div>`);\n } else {\n $('.msg_history').append(`<div class=\"outgoing_msg\"><div class=\"sent_msg\"><p>${data.chatMessage}</p><span class=\"time_date\">${date}</span></div></div>`);\n }\n })\n /* Room Join Check SweetAlert function */\n const Toast = Swal.mixin({\n toast: true,\n position: 'top-end',\n showConfirmButton: false,\n timer: 2000,\n timerProgressBar: true,\n didOpen: (toast) => {\n toast.addEventListener('mouseenter', Swal.stopTimer)\n toast.addEventListener('mouseleave', Swal.resumeTimer)\n }\n })\n Toast.fire({\n icon: 'success',\n title: `Room ${others} Joined!`,\n })\n Scroll(); // Scroll to bottom\n })\n } catch (err) {\n throw err;\n }\n}", "title": "" }, { "docid": "358e9d127dac0bbaf77f0d04e88128d1", "score": "0.62081105", "text": "function onJoin(){\n\tclientMessage(Player.getName(getPlayerEnt()) + \" joined :)\");\n}", "title": "" }, { "docid": "731aa04c0481e0256312f1dc297e808a", "score": "0.62034523", "text": "function sendChat(message) {\n bot.sendChat(message);\n }", "title": "" }, { "docid": "b97bbe40962055c100e48bd59e05a982", "score": "0.61992544", "text": "function ifJoinRoom(room_name, player_name) {\n if(canJoinRoom(room_name)) {\n room = room_name;\n player = createPlayer(room, client.id, player_name);\n client.join(room);\n // Add player to room\n joinRoom(room, player);\n // Notify client\n client.emit('joined_room', {player, room_name});\n } else {\n client.emit('could_not_join_room');\n }\n }", "title": "" }, { "docid": "339bd1e333da89840c2314d20a75d111", "score": "0.6198302", "text": "function chatin() {\n\tvar chat = input.value();\n\n\tvar time = +new Date;\n\tvar data = {\n\t\tname: blobsdict[socket.id].name,\n\t\tchat: chat,\n\t\ttime: time\n\t};\n\t\n\tsocket.emit('chat', data);\n\n\tinput.value('');\n}", "title": "" }, { "docid": "f377d2e13d47d3395409e63d6d3b283c", "score": "0.6196499", "text": "function joinGame() {\n ch_gameroom(state.gameName, state.userName);\n }", "title": "" }, { "docid": "74242db001c10840cc973b6d2f519561", "score": "0.6191013", "text": "function onUserJoined(userId, socket) {\n \n users[socket.id] = userId;\n _sendExistingMessages(socket);\n \n \n \n}", "title": "" }, { "docid": "093964ebd2fb6a8a720aa333b82e4a57", "score": "0.6187268", "text": "addLoginMessage(name, me) {\n console.log(`${name} joined`);\n \n this.appendMessage(\n `<b>${(me) ? '</b>You have' : (name.length < 1) ? GLOBAL.PLACEHOLDER_NAME : name + '</b> has'} joined the room!`,\n 'join'\n );\n }", "title": "" }, { "docid": "0d504dd11123692daf1dca338cb90ea6", "score": "0.61778724", "text": "function joinChatRoom(){\n // get chat room field content\n var roomToJoin = q( \"#room_field\" ).value;\n // if a chat room name has been set ...\n if( roomToJoin ){\n // ... join the room\n bc.joinRoom( roomToJoin );\n }\n else{\n // otherwise, display an alert\n alert( \"you must enter a room name !\" );\n }\n}", "title": "" }, { "docid": "6ba43acf80a347a1939c6c096621f919", "score": "0.61750835", "text": "_joined(user) {\n // add user\n if (this.users.length < 4){\n if (this.users.length == 0){\n this.owner = user;\n }\n this.users.push(user);\n }\n else\n this.__report(1, \"No seat left for the game.\")\n \n // call back\n if (this.onJoin){\n this.onJoin(user)\n }\n //gameEvent.emitEvent(EVT_NEWUSER, user)\n }", "title": "" }, { "docid": "64295af269d9ec4306c28814c1856f5b", "score": "0.6173287", "text": "function initiateChat(sid1, sid2) {\n\t\tioConnected.to(`${sid1}`).emit('chat_started', {u1: users[sid1]['username'], u2: users[sid2]['username']})\n\t\tioConnected.to(`${sid2}`).emit('chat_started', {u1: users[sid2]['username'], u2: users[sid1]['username']})\n\t}", "title": "" }, { "docid": "b54bb05913bb2acdc665599fd9e98a46", "score": "0.61707145", "text": "async handlerJoin(check) {\n if (check !== \"okay\") {\n return alert(\"비밀번호가 일치하지 않습니다.\")\n }\n const result = await UserApi.userJoin(this.user);\n alert(result.message); \n window.location.replace(\"/\");\n }", "title": "" }, { "docid": "f6805f292f53c1dbf64c80a3c6dc373b", "score": "0.61448205", "text": "function joinOrLeaveChatRoom(chatRoom,uid,res,next,join,callback){\n if(!chatRoom || chatRoom.length==0){\n next(new BadRequest(\"Bad Request: must contains a chat room id\"));\n }else{\n var updateRequest = {}; \n var operator = join? \n addOperator({\n chatRoomStatus: new entities.ChatRoomStatus(chatRoom)\n }):\n removeOperator({\n chatRoomStatus:{\n rid: chatRoom\n }\n });\n db.user.update({\n _id: mongojs.ObjectId(uid)\n },\n operator,\n function(error,userUpdatedResult){\n if(error){\n next(new ServerError(error));\n }else if(userUpdatedResult.nMatched==0){\n next(new BadRequest(\"no chat room found\"));\n }\n else{\n var operator = join? \n addOperator({\n users: uid\n }):\n removeOperator({\n users: uid\n });\n db.chat_room.update({\n _id: mongojs.ObjectId(chatRoom)\n },operator,function(error,chatRoomUpdatedResult){\n if(error){\n next(new ServerError(error));\n }else{\n if(callback) \n callback();\n else\n res.json(new UpdateOperationResponse(join? \"join\":\"leave\"));\n }\n });\n }\n });\n }\n}", "title": "" }, { "docid": "ee82c1b228a17132fb6dcc66438b69d9", "score": "0.6143344", "text": "function userJoin(id, username, room,\n ones,\n onesDone,\n twos,\n twosDone,\n threes,\n threesDone,\n fours,\n foursDone,\n fives,\n fivesDone,\n sixes,\n sixesDone,\n bonus,\n threeOfAKind,\n threeOfAKindDone,\n fourOfAKind,\n fourOfAKindDone,\n smallStraight,\n smallStraightDone,\n largeStraight,\n largeStraightDone,\n fullHouse,\n fullHouseDone,\n chance,\n chanceDone,\n yatzy,\n yatzyDone,\n total,\n dices,\n rolls,\n active\n) {\n const user = { id, username, room, ones,\n onesDone,\n twos,\n twosDone,\n threes,\n threesDone,\n fours,\n foursDone,\n fives,\n fivesDone,\n sixes,\n sixesDone,\n bonus,\n threeOfAKind,\n threeOfAKindDone,\n fourOfAKind,\n fourOfAKindDone,\n smallStraight,\n smallStraightDone,\n largeStraight,\n largeStraightDone,\n fullHouse,\n fullHouseDone,\n chance,\n chanceDone,\n yatzy,\n yatzyDone,\n total,\n dices,\n rolls,\n active };\n\n users.push(user);\n\n return user;\n}", "title": "" }, { "docid": "4b86f6ed9732b14a28337ff9a830172d", "score": "0.6141087", "text": "function userJoin(){\n//adding username,roll,id in users array\n}", "title": "" }, { "docid": "924a6cfe615dac73761291aa22685193", "score": "0.61382645", "text": "doJoin (callback) {\n\t\tthis.path = '/users/me';\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'put',\n\t\t\t\tpath: '/companies/join/' + this.company.id,\n\t\t\t\ttoken: this.token\n\t\t\t},\n\t\t\t(error, response) => {\n\t\t\t\tif (error) { return callback(error); }\n\t\t\t\tthis.message = {\n\t\t\t\t\t...DeepClone(response),\n\t\t\t\t\trepos: [],\n\t\t\t\t\tusers: \n\t\t\t\t\t\tDeepClone(this.users.map(u => u.user)).sort((a, b) => {\n\t\t\t\t\t\t\treturn a.id.localeCompare(b.id)\n\t\t\t\t\t\t})\n\t\t\t\t};\n\t\t\t\tObject.assign(this.currentUser.user, response.user.$set);\n\t\t\t\tthis.currentUser.user.teamIds = [this.team.id];\n\t\t\t\tthis.currentUser.user.companyIds = [this.company.id];\n\t\t\t\tdelete this.message.team.companyMemberCount;\n\t\t\t\tthis.message.team.version++;\n\t\t\t\tcallback();\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "6f36101bedabeaeadd8ab0b1f9600811", "score": "0.61353993", "text": "function JoinGame(){\n socket.emit( \"join game up\", {'sessionId': sessionId});\n}", "title": "" }, { "docid": "7e5ea9fabfd47e59fc78a0e66aa532eb", "score": "0.61301744", "text": "function userJoin(id, username, roomId) {\n const user = { id, username, roomId };\n \n\n return user;\n}", "title": "" }, { "docid": "0d324e05749b4e28671bb0922ca1e977", "score": "0.61280257", "text": "startchat () {\n Actions.chat({ data: this.props.modalData.modalData })\n this.props.toggleOffProfilemodal({toggle: false})\n }", "title": "" } ]
cb6aa59c467dc00088ca3fa26a973080
This functions assumes that an element without notes has a datanotes value of "There are no notes for this event."
[ { "docid": "ef5eceb174d4d7f44186622aa3406f49", "score": "0.0", "text": "function editNotes(ele){\n\t\t\tvar formContainer = document.createElement(\"div\"),\n\t\t\t\tformContent = '',\n\t\t\t\theader = '<h3>Edit Notes</h3>',\n\t\t\t\tinputArea = '<textarea placeholder=\"Jot down some notes\" autofocus></textarea>',\n\t\t\t\tsubmitButton = '<input type=\"button\" value=\"Update\" onclick=\"BNB.calendar.Notes.submitEditNotes(this)\">',\n\t\t\t\tcloseButton = '<span class=\"close\" onclick=\"BNB.calendar.Notes.removeEditNotes(this.parentNode);\">X</span>';\n\n\t\t\t// If a dialog is already open, close it\n\t\t\tif(document.getElementsByClassName(\"edit-notes-form\")[0]){\n\t\t\t\tremoveEditNotes(document.getElementsByClassName(\"edit-notes-form\")[0]);\n\t\t\t}\n\n\t\t\t// Track the clicked element\n\t\t\tcurrentStepNode = ele.parentNode;\n\n\t\t\t// Add notes to the textarea if notes exist\n\t\t\tif(currentStepNode.getAttribute(\"data-notes\") != \"There are no notes for this event.\"){\n\t\t\t\tinputArea = '<textarea autofocus>' + \n\t\t\t\tcurrentStepNode.getAttribute(\"data-notes\") + \n\t\t\t\t'</textarea>';\n\t\t\t}\n\n\t\t\t// Assemble Notes dialog box\n\t\t\tformContent = header + inputArea + submitButton + closeButton;\n\n\t\t\t// Add a new \"Edit Notes\" dialog box to the page\n\t\t\tformContainer.className = \"edit-notes-form\";\n\t\t\tformContainer.innerHTML = formContent;\n\t\t\taddEditNotes(ele, formContainer);\n\t\t}", "title": "" } ]
[ { "docid": "8d157f83dda3bd30c7105c51af3d985c", "score": "0.62303257", "text": "function noteUnused(noteValue){\r\n console.log(\"noteUnused[\"+noteValue+\"] length: \" + noteValue.length);\r\n return notes[noteValue].length == 0 || ((typeof notes[noteValue]) == \"undefined\");\r\n}", "title": "" }, { "docid": "fd84784244f9b6aa9b156fceb4a99949", "score": "0.57866544", "text": "function _isNote(e){\n\t\t\t\t\treturn e.includes(note);\n\t\t\t\t}", "title": "" }, { "docid": "d4b79fa8ce18d01a7900ad2fa5480ffe", "score": "0.5702106", "text": "function collectNotes()\n{\n var notes = new Array();\n var divs = document.body.getElementsByTagName(\"div\");\n\n for (var i = 0; i < divs.length; ++i)\n {\n div = divs.item(i);\n\n if (hasClass(div, \"handout\"))\n {\n // add slide to collection\n notes[notes.length] = div;\n\n // hide handout notes as they are found\n div.style.display = \"none\";\n div.style.visibility = \"hidden\";\n }\n }\n\n return notes;\n}", "title": "" }, { "docid": "4bb05b97ebfab7dfbffa38631a706888", "score": "0.570138", "text": "function hideNotes() {\n while (noteContainer.firstChild) {\n noteContainer.removeChild(noteContainer.firstChild);\n }\n\n}", "title": "" }, { "docid": "c7770ee6bb2c6e012dc25725cdf3ba15", "score": "0.56508476", "text": "function clearNotes(ev)\n{\n if (!ev)\n {\t\t // browser is not W3C compliant\n\t\tev\t = window.event;\t// IE\n }\t \t// browser is not W3C compliant\n ev.stopPropagation();\n\n tinyMCE.get('note').setContent(\"\");\n}", "title": "" }, { "docid": "742d4ec4c3a3f1066307c798c220fce5", "score": "0.56400025", "text": "function e(e){return t(e,\"notes\")}", "title": "" }, { "docid": "289309cb88875af3a1ae5061dd8f122f", "score": "0.563436", "text": "function noNotes() {\n notesDatabase.notes.where({\n noteStatus: 1,\n notePinned: 0\n }).count().then(function (notes) {\n notesDatabase.notes.where({\n noteStatus: 1,\n notePinned: 1\n }).count().then(function (pinnedNotes) {\n if (notes > 0 || pinnedNotes > 0) {\n $('#noNotesInfo').hide();\n } else {\n $('#noNotesInfo').show();\n }\n });\n });\n}", "title": "" }, { "docid": "416b9c2c251a251be423fec7ea53f0bd", "score": "0.5604188", "text": "function checkEmpty() {\n if (notes.length === 0) {\n const untitled = docuement.createElement(\"option\");\n untitled.innerText = \"untitled\";\n notes.appendChild(untitled);\n }\n}", "title": "" }, { "docid": "caa38221f1788e311dec6241ac7d7350", "score": "0.55211323", "text": "removeInvalidNotes (danceChart, containers) {\n let invalidNotes = []\n // goes through all beats in the beat array\n editorConfig.beatArray.forEach((beat) => {\n let i = this.checkForMove(danceChart, beat)\n if (i !== -1) { // if there are moves for this beat\n // if no proto move with relevant information is part of the danceChart for this beat, this note is not valid\n if (editorConfig.pressedKey === 'z' && danceChart.moves[i][2] === 'X') {\n invalidNotes.push(beat)\n } else if (editorConfig.pressedKey === 'x' && danceChart.moves[i][3] === 'X') {\n invalidNotes.push(beat)\n }\n } else { // if no moves\n invalidNotes.push(beat)\n }\n })\n if (invalidNotes.length > 0) {\n invalidNotes.forEach((beat) => {\n let selectedHand = 'L'\n if (editorConfig.pressedKey === 'x') selectedHand = 'R'\n let noteToRemove = containers.auxiliary.noteElements.getChildByName(`${beat}${selectedHand}`)\n noteToRemove.destroy()\n containers.auxiliary.noteElements.removeChild(noteToRemove)\n })\n }\n }", "title": "" }, { "docid": "2beb1427232c5fd0398af2d68a0f20b5", "score": "0.5502847", "text": "function isNotSelectingDate(ev){\n return ev.target.querySelector(\".dates\")\n}", "title": "" }, { "docid": "0b9141f214fbea48f02ef03c946075f2", "score": "0.54973793", "text": "function getNotes() {\n let notesInputValue = notesInput.innerText;\n let titleInputValue = titleInput.innerText;\n if (notesInputValue == \"\" && titleInputValue == \"\") {\n console.log(\"Type a note please\");\n notePlacehold.classList.remove(\"d-none\");\n titlePlacehold.classList.remove(\"d-none\");\n } else {\n // console.log(notesInputValue);\n // console.log(titleInputValue);\n createDivNotes(titleInputValue, notesInputValue);\n addLocal(titleInputValue, notesInputValue);\n notePlacehold.classList.remove(\"d-none\");\n titlePlacehold.classList.remove(\"d-none\");\n }\n\n notesInput.textContent = \"\";\n titleInput.textContent = \"\";\n}", "title": "" }, { "docid": "73574e2dc207cc7b39b5317a983e1f63", "score": "0.5485235", "text": "createEmptyNote() {\n\n let nota = {\n title: \"\",\n description: \"\",\n tags: \"\"\n }\n\n return nota;\n }", "title": "" }, { "docid": "8a95612ea38bd97388db04dc0d5215d0", "score": "0.54398257", "text": "function noteInteraction(notesUsable) {\r\n if (notesUsable) {\r\n for (let note of document.getElementsByClassName(\"div--draggable\")) {\r\n note.style.pointerEvents = \"\";\r\n }\r\n } else {\r\n for (let note of document.getElementsByClassName(\"div--draggable\")) {\r\n note.style.pointerEvents = \"none\";\r\n }\r\n }\r\n}", "title": "" }, { "docid": "81e0b339a5e21039ca82d264956a8fce", "score": "0.5418281", "text": "function noteDowned(e) {\n Cu.reportError('note downed');\n var note = e.target.parentNode.hasAttribute('noteid') ? e.target.parentNode : e.target;\n var noteid = note.getAttribute('noteid');\n lastWidth[noteid] = e.target.style.width;\n lastHeight[noteid] = e.target.style.height;\n \n var note = e.target;\n while (!note.hasAttribute('noteid')) {\n note = note.parentNode;\n }\n var body = note.childNodes[0];\n var noteid = note.getAttribute('noteid');\n}", "title": "" }, { "docid": "1dde988d12986aaea03cdd4467dfe93a", "score": "0.54149705", "text": "function noteError(note, id) {\n if (verifNote(note)) {\n document.getElementById(id).innerHTML = \"\";\n\n } else {\n document.getElementById(id).innerHTML = \"Note invalid\";\n document.getElementById(id).style.color = \"red\";\n }\n}", "title": "" }, { "docid": "98c34609d6f85389daaecb8fcd1b6c18", "score": "0.5385065", "text": "function removeTag() {\r\n console.log(DOM.noteId);\r\n // If true, the tag form the specific note is removed\r\n if (DOM.noteId) {\r\n database.notes.forEach(note => {\r\n if (note.id === DOM.noteId) {\r\n note.tags.forEach(tag => tag === DOM.tagToBeRemoved ? note.removeTag(DOM.tagToBeRemoved) : false);\r\n };\r\n });\r\n DOM.tagToBeRemoved = '';\r\n DOM.noteId = false;\r\n DOM.update();\r\n\r\n } else { // If false, the note is removed completely\r\n database.notes.forEach(note => {\r\n note.tags.forEach(tag => tag === DOM.tagToBeRemoved ? note.removeTag(DOM.tagToBeRemoved) : false);\r\n });\r\n DOM.tagToBeRemoved = '';\r\n DOM.noteId = false;\r\n DOM.update();\r\n }\r\n database.storeNotes();\r\n}", "title": "" }, { "docid": "3c02145debf3ff7406c1dd96fb9dbe72", "score": "0.53646356", "text": "function validateNote(notes) {\n if (!notes.title || typeof notes.title !== 'string') {\n return false;\n }\n if (!notes.text || typeof notes.text !== 'string') {\n return false;\n }\n return true\n}", "title": "" }, { "docid": "a06d106bfc593cdb17a84fdb5f78a5e5", "score": "0.53602016", "text": "function i(e) { return !(!e || !e.nodeType) }", "title": "" }, { "docid": "52a885471c6ea07f5556628d54e9e13f", "score": "0.5350264", "text": "constructor() {\n this._parentEl = document.querySelector(`.no-notes-message`);\n }", "title": "" }, { "docid": "0b4266d44234b121dfd7bc802fc9b1b0", "score": "0.53435606", "text": "function getBaseNote(){\n var note = getSimpleEventNote();\n var stamp = note.getEventStamp(true);\n stamp.setStartDate(new cosmo.datetime.Date(2000,0,1,12,0));\n stamp.setEndDate(new cosmo.datetime.Date(2000,0,1,13,0));\n stamp.setRrule(new cosmo.model.RecurrenceRule({\n frequency: cosmo.model.RRULE_FREQUENCIES.FREQUENCY_DAILY\n }));\n return note;\n}", "title": "" }, { "docid": "5ca92d2c6d6cc6b9a183ebeff64a9e39", "score": "0.53418535", "text": "function event(a) {\r\n switch(a.getAttribute('d')) {\r\n case 'n': \r\n openNote(-1)\r\n return\r\n case 'r':\r\n removeNote()\r\n return\r\n case 's':\r\n saveNote()\r\n return\r\n case 'o':\r\n openNote(Number(a.getAttribute('i')))\r\n return\r\n }\r\n}", "title": "" }, { "docid": "9a4c1a73127ee0ab3e5a03753f12e917", "score": "0.53405094", "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": "65c0357e7e8bfc870c0b187b7ef76805", "score": "0.53286314", "text": "function cancelEditNote(note) {\n let noteToBeUpdated=note.parentNode;\n let prevText=\"\";\n prevNotes = prevNotes.filter(function( obj ) {\n if(obj.id === noteToBeUpdated.id)\n {prevText=obj.text;return false;}\n return true;\n });\n noteToBeUpdated.removeChild(noteToBeUpdated.getElementsByTagName(\"textarea\")[0]);\n noteToBeUpdated.removeChild(noteToBeUpdated.getElementsByTagName(\"button\")[0]);\n noteToBeUpdated.removeChild(noteToBeUpdated.getElementsByTagName(\"button\")[0]);\n let para=document.createElement(\"p\");\n para.innerText=prevText;\n noteToBeUpdated.appendChild(para);\n}", "title": "" }, { "docid": "b9ffe495a10e3b4535520def0b1adc81", "score": "0.53273696", "text": "function CheckIFActiveNote(note)\n{\n\tfor(obj in NoteExclusiveFunc)\n\t{\n\t\tif(NoteExclusiveFunc[obj] === note)\n\t\t{\n\t\t\t//NOW i need to know what this is and if its something specific and then trigger an event for the specific note. still need to build the click handle for setting my var objects.\n\t\t\tHandleNoteFunc(obj);\n\t\t\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a3a3d97a5e026d29c0fa104bcdd871d2", "score": "0.52986443", "text": "getSlideNotes() {}", "title": "" }, { "docid": "ba4196d80aef948c8d7cc06e9632e6c8", "score": "0.5286226", "text": "function renderNoteOpenMandatories(){\n\talert(\"At least one mandatory true. Please finish itemes.\");\n}", "title": "" }, { "docid": "8965ba0054303158a3bdc8c962396fc0", "score": "0.52761465", "text": "function commentsAvailable () {\n for(x of document.getElementsByTagName(\"ytd-live-chat-history-entry-renderer\")) {\n if(x.getAttribute(\"is-dismissed\") == null) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "25fd65932a361a23c04ab7468b0d4f5a", "score": "0.527567", "text": "function noteCheck() {\n if (noteBox.val() == \"\") {\n noteBox.val(\"General Notes...\");\n }\n }", "title": "" }, { "docid": "b541fa986eddca848279a76cc8917b7c", "score": "0.52752197", "text": "showNote(idx, noteObj) {\n let obj = this;\n\n let elem = document.getElementById('note-btn-' + idx);\n let note = elem.nextElementSibling;\n let noteBody = note.firstElementChild;\n if (note.style.maxHeight){\n note.style.maxHeight = null;\n //Post update if it changed\n let newContent = noteBody.innerHTML;\n //console.log(newContent.trim());\n //console.log(noteObj.desc.trim());\n if(noteObj.content.trim() !== newContent.trim()) {\n set(noteObj, 'desc', newContent);\n obj.postUpdateNote(noteObj);\n }\n\n } else {\n //note.style.maxHeight = note.scrollHeight + \"px\";\n note.style.maxHeight = obj.maxNoteHeight + \"px\";\n //console.log(noteBody);\n //console.dir(noteBody);\n //console.log('text is = ' + noteBody.textContent);\n //console.log(noteBody.innerHTML);\n }\n //console.log(obj.notes);\n }", "title": "" }, { "docid": "7327ae6ee2c0725552bcbaa572123328", "score": "0.5271863", "text": "getNoteIfExists() {\n\n let id = this.props.location.pathname.replace('/note-form/', '').split('/')[2] || 0;\n if (id === 0) {\n return [false, 0, '', ''];\n } else {\n //stops program from throwing an error if the page is reloaded and context needs to be refilled\n if (this.context.notes.length !== 0) {\n const note = this.context.notes.filter(note => note.id === parseInt(id));\n if(note.length ===0){\n return [false, 0, '', ''];\n }\n const title = note[0].title;\n const contents = note[0].contents;\n id = note[0].id;\n const exists = true;\n return [exists, id, title, contents];\n }\n return [false, 0, '', ''];\n }\n }", "title": "" }, { "docid": "5ac58f3b315a3816666e4beca1a3e344", "score": "0.5271202", "text": "function nodeadded(event) {\n if( event.relatedNode.nodeName == \"SECTION\" && event.relatedNode.className == \"blocks-lesson\") {\n processNotes();\n }\n }", "title": "" }, { "docid": "15fba709a12d2fc6e4c423db8db0cd6d", "score": "0.52613324", "text": "function checkTheNotes(divBlock, date, curentDay) {\n var isDataPresentForCurrentDat = data[new Date(date.getFullYear(), date.getMonth(), curentDay)];\n if (isDataPresentForCurrentDat) {\n divBlock.innerHTML = isDataPresentForCurrentDat;\n var inp = divBlock.querySelector(\"input\");\n inp.addEventListener(\"blur\", noteFocusOut);\n inp.addEventListener(\"keydown\", addNote);\n inp.parentElement.parentElement.style.textDecoration = \"underline \";\n }\n}", "title": "" }, { "docid": "3770db9bb9b1c74a0373f2390854a60d", "score": "0.5244126", "text": "function extractNotes () {\n slides = slides.map(function (slide) {\n var res = slide.match(/\\s+>.*/)\n if (!res || !res.index) {\n notes.push('')\n return slide\n }\n var idx = res.index\n notes.push(slide.substring(idx))\n return slide.substring(0, idx)\n })\n}", "title": "" }, { "docid": "b9c4ef4d9183e3ab79bfccf12f54d0f0", "score": "0.52328867", "text": "function setupNotes() {\n for (const [dismissalSetting, note] of Object.entries(notes)) {\n const ctaId = `${note.id}-cta`;\n const dismissId = `${note.id}-dismiss`;\n document.getElementById(ctaId).addEventListener(\"click\", note.cta);\n document.getElementById(dismissId).addEventListener(\"click\", function () {\n browser.storage.sync.set({\n [dismissalSetting]: true,\n });\n });\n }\n browser.storage.onChanged.addListener(function (changes) {\n for (const dismissalState in defaultDismissalStates) {\n changes.hasOwnProperty(dismissalState) &&\n showOrHideNote(\n notes[dismissalState],\n changes[dismissalState].newValue\n );\n }\n });\n browser.storage.sync.get(defaultDismissalStates, function (items) {\n for (const dismissalState in defaultDismissalStates) {\n notes.hasOwnProperty(dismissalState) &&\n showOrHideNote(notes[dismissalState], items[dismissalState]);\n }\n });\n }", "title": "" }, { "docid": "0479983b9501c22ec7576f05a1f5fc7e", "score": "0.5224281", "text": "function grabNotes(index) {\n parent = document.getElementById(\"note\" + index)\n childrenTitle = parent.children[0];\n childrenText = parent.children[1];\n document.getElementById(\"disableViewBtn\").classList.remove(\"disabled\");\n // console.log(` text${index} is title `+ childrenTitle.innerHTML);\n // console.log(` text${index} is text `+ childrenText.innerHTML);\n $(\"#notetitle\").html(childrenTitle.innerHTML);\n $(\"#notecontent\").html(childrenText.innerHTML);\n $(\"#disableViewBtn\").css(\"display\", \"list-item\");\n $(\"#addBtn\").css(\"display\", \"none\");\n $(\"#notetitle\").prop(\"disabled\", \"true\");\n $(\"#notecontent\").prop(\"disabled\", \"true\");\n}", "title": "" }, { "docid": "5285f682ff2c1c485dc5913f1a0374fb", "score": "0.5218817", "text": "notReported(el, name) {\n return !this.reported.has(el, name);\n }", "title": "" }, { "docid": "cc2803acb0a241736a47dceb798a4f0a", "score": "0.52154624", "text": "function _displayNotes()\n{\n // Get the element from the \"all\" collection\n element = document.all['pageNotes'];\n \n // If we have that element, copy notes here [4+]\n if (element) {\n element.innerHTML = parent.nbuff.document.body.innerHTML;\n // RAQ : Wednesday, 16 March 2005 01:58 pm : Bring the notes into view\n // if the hash has been supplied\n if (location.hash == '#userNotes')\n {\n setTimeout('element.scrollIntoView(true);',200);\n }\n } else {\n alert(\"Error in user note inclusion\");\n }\n}", "title": "" }, { "docid": "a618dd3136e14237346f2035860af292", "score": "0.52104974", "text": "function showNotes(){\n\n\tvar A = NotesArray;\n\n\tvar root = document.getElementById(\"NotesCollection\");\n\n\troot.innerHTML = \"\";\n\n\tfor(i=A.length-1; i>=0; i--){\t\t\n\n\t\tvar mynote = A[i];\n\n\t\tvar noteDiv = document.createElement('div');\n\t\tnoteDiv.id = mynote[\"id\"];\n\n\t\tnoteDiv.className = \"col-sm-3 well \"+getNotificationClass(mynote[\"date\"]);\n\n\n\t\t\n\n\n\t\t//==============Text===========\t\t\n\t\tvar noteTitleP = document.createElement('p');\n\t\tvar noteTextP = document.createElement('p');\n\n\n\t\tnoteTitleP.innerHTML = mynote[\"title\"];\n\t\tif(mynote[\"text\"]){\n\t\t\tnoteTextP.innerHTML = replaceHtmlCheckbox(mynote[\"text\"], i);\n\t\t}\n\t\t\n\n\t\tnoteDiv.appendChild(noteTitleP);\n\t\tnoteDiv.appendChild(document.createElement(\"hr\"));\n\t\tnoteDiv.appendChild(noteTextP);\n\t\tnoteDiv.appendChild(document.createElement(\"br\"));\n\n\n\t\t//==========================\n\n\n\t\tvar noteDateP = document.createElement('span');\n\t\tnoteDateP.className = \"pull-right\";\n\n\t\tif(mynote[\"date\"]){\n\t\t\tmynote[\"date\"]= mynote[\"date\"].replace(\"undefined\", \"\");\n\t\t}\n\n\n\t\t\n\t\tnoteDateP.innerHTML = mynote[\"date\"];\n\t\tnoteDiv.appendChild(noteDateP);\n\n\t\tif(mynote[\"located\"]){\n\t\t\tmynote[\"located\"]= mynote[\"located\"].replace(\"undefined\", \"\");\n\t\t}\n\t\telse{\n\t\t\tmynote[\"located\"]=\"\";\n\t\t}\n\t\tvar noteLocatedP = document.createElement('span');\n\t\tnoteLocatedP.innerHTML = mynote[\"located\"].split(\"&\")[1];\n\t\tnoteDiv.appendChild(noteLocatedP);\n\n\n\t\t\n\t\tnoteDiv.appendChild(document.createElement(\"br\"));\n\t\tnoteDiv.appendChild(document.createElement(\"br\"));\n\n\t\t//===========Butttons==========\n\n\t\tvar noteDeleteButton = document.createElement('input');\n\t\tvar noteEditButton = document.createElement('input');\n\n\t\tnoteDeleteButton.type = \"button\";\n\t\tnoteEditButton.type = \"button\";\n\n\t\tnoteDeleteButton.value = \"Delete\";\n\t\tnoteEditButton.value = \"Edit\";\n\n\t\tnoteEditButton.className = \"btn btn-default\";\n\t\tnoteDeleteButton.className = \"pull-right btn btn-default\";\n\n\t\tnoteDeleteButton.onclick = function(id){\n\t\t\treturn function(){\n\t\t\t\tremoveNote(id);\n\t\t\t}\n\t\t}(mynote[\"id\"]);\n\n\n\t\t\n\n\t\tnoteEditButton.onclick = function(id, title, text, date){\n\t\t\treturn function(){\n\t\t\t\teditNote(id, title, text, date);\n\t\t\t}\n\t\t}(mynote[\"id\"],mynote[\"title\"],mynote[\"text\"], mynote[\"date\"]);\n\n\t\tnoteDiv.appendChild(noteEditButton);\n\t\tnoteDiv.appendChild(noteDeleteButton);\n\t\t\n\n\t\t//=================\n\n\t\tvar noteCopyButton = document.createElement('input');\n\n\t\tnoteCopyButton.type = \"button\";\n\n\t\tnoteCopyButton.value = \"Fork\";\n\n\t\tnoteCopyButton.className = \"pull-right btn btn-default \";\n\n\t\tnoteCopyButton.onclick = function(id){\n\t\t\treturn function(){\n\t\t\t\tcloneNote(id);\n\t\t\t}\n\t\t}(mynote[\"id\"]);\n\n\n\n\t\tnoteDiv.appendChild(noteCopyButton);\n\n\n\n\t\t//=================\n\n\n\t\tif(mynote[\"located\"].length > 5){\n\t\t\tvar noteMapLocationButton = document.createElement('a');\n\n\t\t\tnoteMapLocationButton.href = \"http://maps.google.com/?q=\" + mynote[\"located\"].replace(\"|\",\",\").split(\"&\")[0];\n\n\t\t\tnoteMapLocationButton.target=\"_blank\"\n\n\t\t\tnoteMapLocationButton.value = \"Map\";\n\n\t\t\tnoteMapLocationButton.className = \"pull-right btn btn-default glyphicon glyphicon-map-marker\";\n\n\t\t\tnoteDiv.appendChild(noteMapLocationButton);\n\n\t\t}\n\t\t\n\t\t\n\n\n\n\t\t\n\n\t\t\n\n\t\t//===========================\n\n\n\t\troot.appendChild(noteDiv);\t\n\n\t}\n}", "title": "" }, { "docid": "6859d872189efba503347d232674c436", "score": "0.5207581", "text": "function showAllNotes(){\r\n\r\n //checking if array has not any node\r\n if(notes.length<=0){\r\n console.log(\"No Note entered!...\");\r\n return;\r\n }\r\n \r\n for(i=0;i<notes.length;i++)\r\n console.log(\"Note with the ID: \" +notes[i][\"noteId\"]+\" has Note : \"+notes[i][\"note\"]);\r\n \r\n}", "title": "" }, { "docid": "bdbbe17b8aa60ca525c37287bf612d5f", "score": "0.51805294", "text": "function is_ignorable( nod )\r\n{\r\n return ( nod.nodeType == 8) || // A comment node\r\n ( nod.nodeType == 3); // a text node\r\n}", "title": "" }, { "docid": "caf168023ce23ff2cfd30a680535ba0e", "score": "0.5169246", "text": "function isNotEmptyElement(e) {\n return e !== null;\n }", "title": "" }, { "docid": "7e388dce034f1ea614cd3f1c88ed742e", "score": "0.516863", "text": "function dismissNote() { // Declare function\n document.body.removeChild(elNote); // Remove the note\n}", "title": "" }, { "docid": "7e388dce034f1ea614cd3f1c88ed742e", "score": "0.516863", "text": "function dismissNote() { // Declare function\n document.body.removeChild(elNote); // Remove the note\n}", "title": "" }, { "docid": "c433eedd11c1cd756c8c46e15b789528", "score": "0.51646775", "text": "function getAllNotes() {\n\t// get all the unique values in an array\n\tapp.possibleNotes = currSong.seq.unique().remove(0);\n\tutil.log('all possible notes are: ' + app.possibleNotes.toString());\n\tapp.availableNotes = app.possibleNotes;\n\tutil.log('all available notes are: ' + app.availableNotes.toString());\n}", "title": "" }, { "docid": "7ac4c3a9a9426d28f56d27422bcd3100", "score": "0.51426893", "text": "function showFullNote(newLI) {\n let elementId = newLI.path[0].id;\n var fullNote = note.getText(elementId);\n alert(fullNote);\n }", "title": "" }, { "docid": "daa8fcf3bcafee753494ba5af4aecc64", "score": "0.51405567", "text": "function validateNote(note) {\n if (!note.title || typeof note.title !== 'string') {\n return false;\n }\n if (!note.text || typeof note.text !== 'string') {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "daa8fcf3bcafee753494ba5af4aecc64", "score": "0.51405567", "text": "function validateNote(note) {\n if (!note.title || typeof note.title !== 'string') {\n return false;\n }\n if (!note.text || typeof note.text !== 'string') {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "a8f0f1dbaac5801189b3a80b7b9b039e", "score": "0.51388294", "text": "function clickNote(e) {\n var elNote = e.target;\n while (elNote && elNote.tagName != \"LI\") {\n elNote = elNote.parentNode;\n }\n \n if (elNote) {\n onClickNote && onClickNote(elNote.dataset.noteId, currentNotebook);\n } else if (TIME_FOR_NEW_NOTE_DOUBLECLICK) {\n if (currentNotebook && (createNoteOnTap || el.classList.contains(EMPTY_CONTENT_CLASS))) {\n App.newNote(currentNotebook);\n } else {\n createNoteOnTap = true;\n window.setTimeout(function(){\n createNoteOnTap = false;\n }, TIME_FOR_NEW_NOTE_DOUBLECLICK);\n }\n }\n }", "title": "" }, { "docid": "c7a2beeded4a6eb0e5417b3aa0ee2f1d", "score": "0.51341856", "text": "function n(a){return!!a&&\"undefined\"!=typeof a.text}", "title": "" }, { "docid": "c7a2beeded4a6eb0e5417b3aa0ee2f1d", "score": "0.51341856", "text": "function n(a){return!!a&&\"undefined\"!=typeof a.text}", "title": "" }, { "docid": "061ffd2ff88ef28e61b645c625f8040b", "score": "0.5122508", "text": "function grabNotes(index) {\n parent = document.getElementById(\"note\" + index)\n childrenTitle = parent.children[0];\n childrenText = parent.children[1];\n document.getElementById(\"disableViewBtn\").classList.remove(\"disabled\");\n $(\"#notetitle\").html(childrenTitle.innerHTML);\n $(\"#notecontent\").html(childrenText.innerHTML);\n $(\"#disableViewBtn\").css(\"display\", \"list-item\");\n $(\"#addBtn\").css(\"display\", \"none\");\n $(\"#notetitle\").prop(\"disabled\", \"true\");\n $(\"#notecontent\").prop(\"disabled\", \"true\");\n}", "title": "" }, { "docid": "163e3ce88efc9878a28dd7652110e4a0", "score": "0.5121134", "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": "20fc055763a89f1ad9990f86647dc8bf", "score": "0.5113141", "text": "function noteBlurred(note){\r\n var parent_node = note.parentNode;\r\n var temp_note = note.parentNode.removeChild(note);\r\n var day = parent_node .textContent; // zapisz numer dnia\r\n parent_node.appendChild(temp_note); // dolacz usuniety wezel, przywroc strukture dom\r\n // jesli zedytowano lub dodano nowy wpis\r\n if(!note.textContent.isEmpty() && note.textContent !== sessionStorage.getItem('noteContent')){\r\n console.log(\"wpis przed edycja: \" + sessionStorage.getItem('noteContent') );\r\n // pobranie numeru edytowanego dnia\r\n\r\n // wyslanie nowego wpisu na serwer\r\n $.ajax({\r\n type: \"POST\",\r\n url: 'index.php',\r\n data:\"action=editNote\"+\"&day=\"+day+\"&newNote=\"+note.textContent,\r\n success:function(data){\r\n console.log(\"edycja/dodawanie w porzadku\");\r\n window.location.reload();\r\n document.write(data);\r\n }\r\n });\r\n }\r\n // jesli tresc wpisu zostala skasowana z poziomu pola edycyjnego\r\n else if(note.textContent===\"\" && (note.textContent !== sessionStorage.getItem('noteContent'))){\r\n // wyslanie zapytania o usuniecie wpisu\r\n $.ajax({\r\n type: \"POST\",\r\n url: 'index.php',\r\n data:\"action=deleteNote\"+\"&day=\"+day,\r\n success:function(data){\r\n console.log(\"usuwanie w porzadku\");\r\n window.location.reload();\r\n document.write(data);\r\n }\r\n });\r\n }\r\n}", "title": "" }, { "docid": "adaa8efc3c83e5d77c82871a36674c3d", "score": "0.5108945", "text": "function makeNote(comments) {\n if (comments.length === 0) { return; }\n for (var i = 0; i < comments.length; i++) {\n var comment = comments[i];\n if (!comment.t) {\n continue;\n }\n return comment.t;\n }\n}", "title": "" }, { "docid": "5098ad923d992ae16d9a084050494db2", "score": "0.50981635", "text": "function dismissNote(){ // Declare function\n document.body.removeChild(elNote); //Remove the note\n}", "title": "" }, { "docid": "5078d621b110b7aeeec567ab82d48b71", "score": "0.50970227", "text": "function setupNotes() {\n\n\tnotes = document.querySelector( '.speaker-controls-notes' );\n\tnotesValue = document.querySelector( '.speaker-controls-notes .value' );\n }", "title": "" }, { "docid": "15ce3595bf30b0549dab8df6d433176a", "score": "0.5078723", "text": "function showNotes() {\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesobj = []\n } else {\n notesobj = JSON.parse(notes)\n }\n let html = \"\";\n notesobj.forEach(function (element, index) {\n html += ` <div class=\"notecard my-2 mx-2\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${element.title}</h5>\n <p class=\"card-text\">${element.text}</p>\n <button id=\"${index}\"onclick=\"deletnote(this.id)\" class=\"btn btn-primary\">delete notes</button>\n </div>\n </div>`\n });\n let notelm = document.getElementById('notes');\n if (notesobj.length != 0) {\n notelm.innerHTML = html;\n } else {\n notelm.innerHTML = `if you want take a Anynotes \"Check the above section and crate the notes\"`;\n \n }\n}", "title": "" }, { "docid": "f18611d03ed1204bacb5ce6519997216", "score": "0.50777763", "text": "function createNote(data) {\n //object for wrapper html for note\n var $note = $('<p class=\"flex-item\">');\n //create delete button\n var $delete_button = createButton(\"note-delete\", \"delete\");\n //note input field to clear\n var $note_text = $(\".note-input input\");\n //conditional check for data\n if (data !== \"\") {\n //set content for note\n $note.html(data);\n //append delete button to each note\n $note.prepend($delete_button);\n //hide new note to setup fadeIn...\n $note.hide();\n //hide delete button until user selects note\n $delete_button.hide();\n //append note text to note-output\n $(\".note-output\").append($note);\n //fadeIn hidden new note\n $note.fadeIn(\"slow\");\n //clear note value\n $note_text.val(\"\");\n //check visibility of note controls\n if (checkVisible($(\".note-controls\")) === true) {\n console.log(\"not visible\");\n $(\".note-controls\").fadeIn();\n } else {\n console.log(\"visible\");\n }\n\n }\n }", "title": "" }, { "docid": "76d62d5f951bb73e53cd5353c5639b46", "score": "0.50683016", "text": "function dismissNote() {\n // Declare function\n document.body.removeChild(elNote); // Remove the note\n}", "title": "" }, { "docid": "5127230fceb28b1f12fcbefd2f6d50eb", "score": "0.505503", "text": "function allNotesOff() {\n heldNotes.forEach(function (obj) {\n noteCtrlOut(obj.equalPitch, 0);\n });\n heldNotes = [];\n}", "title": "" }, { "docid": "d6bd674fda620fc42549b13e867b8f4a", "score": "0.50486434", "text": "function setupNotes() {\n\n notes = document.querySelector('.speaker-controls-notes');\n notesValue = document.querySelector('.speaker-controls-notes .value');\n\n }", "title": "" }, { "docid": "275e4a79942fb4a4291fee700ee09000", "score": "0.5042947", "text": "function pop_notes(){\n\tvar notes = [];\n\t$(\".notes\").each(function(){\n\t\tnotes.push($(this).text().trim());\n\t});\n\treturn notes;\n}", "title": "" }, { "docid": "164918d312a7ae028bb797a4d6de2280", "score": "0.50387293", "text": "removeNote (containers, beat, hand) {\n let note = containers.auxiliary.noteElements.getChildByName(`${beat}${hand}`)\n note.destroy()\n containers.auxiliary.noteElements.removeChild(note)\n }", "title": "" }, { "docid": "e9e5c9dc9541bae8c1b8657d0ce85932", "score": "0.50248516", "text": "function openNote(e) {\n var isNote = e.target.querySelector(\".note\");\n if (isNote) {\n displayNote(isNote);\n } else {\n addNewNote(e);\n }\n}", "title": "" }, { "docid": "6d31c07f3eddd04bffc3c16fbcc23908", "score": "0.5022456", "text": "function createNoteElements(notes) {\n return notes.map(function (note) {\n var element = document.createElement('li');\n element.className = 'note';\n element.setAttribute('contenteditable', true);\n element.textContent = note.content;\n element.addEventListener('blur', function () {\n note.content = this.textContent\n if (note.content == \"\") {\n if (note._id) {\n deleteNote(selectedUserID, note, function () {\n document.getElementById('notes').removeChild(element);\n });\n } else {\n document.getElementById('notes').removeChild(element);\n }\n } else if (!note._id) {\n postNewNote(selectedUserID, {\n content: this.textContent\n }, function (newNote) {\n note._id = newNote._id;\n });\n } else {\n putNote(selectedUserID, note, function () {\n\n });\n }\n });\n// this is an event listener that listens for a enter to change the behavior.\n element.addEventListener('keydown', function (e) {\n if (e.keyCode == 13) {\n e.preventDefault();\n if (element.nextSibling.className == 'add-note') {\n element.nextSibling.click();\n }\n else {\n element.nextSibling.focus();\n }\n }\n\n });\n return element;\n });\n return notes;\n }", "title": "" }, { "docid": "2e1c5ef098be2447b449faef12244d37", "score": "0.50189775", "text": "function validateNote(note) {\n if (!note.title || typeof note.title !== 'string') {\n return false;\n }\n if (!note.text || typeof note.text !== 'string') {\n return false;\n }\n if (!note.id || typeof note.id !== 'string') {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "3d3bd4c882f46facdfd6c91da2d34840", "score": "0.5018653", "text": "function isNotSpreadElement(e) {\n return !t.isSpreadElement(e);\n }", "title": "" }, { "docid": "d3575f73ccf10a7ffdd65e255cb0a97f", "score": "0.5018602", "text": "function addNote(nota, event, isOnPiano)\n{\n if(isRec){ // Go trough this only if REC. mode is enabled\n if (whereNextNote>38500)\n {\n alert(\"You exceeded the max size of the piano roll. Delete some note to add a new one.\");\n }\n else\n {\n var noteSheet = document.getElementById(\"corpoPrincipale\"); // Get the piano roll\n var nuovaNota = document.createElement(\"span\"); // Create a new note element\n var noteLength = document.getElementById(\"noteLength\").innerHTML; // Get the length from the span that contains the numerical length of note\n\n // Show the note graphically\n if (nota.id==0) // ID = 0 -> User pressed the red box that adds a rest, rather than a note...\n {\n nuovaNota.className = \"rest\";\n nuovaNota.style.top = 0; // ....so yeah, add the note, put it vertically on top, so that it covers all the piano roll\n }\n else // If it wasn't a rest, then add a true note!\n {\n nuovaNota.className = \"nota\";\n if (!isOnPiano) // Place the note on the piano roll, but behave differently, depending on where user clicked the note from\n {\n nuovaNota.style.top = nota.offsetTop + \"px\"; // This is the .top value of new note, if user clicked on the piano roll note...\n }\n else\n {\n var riga = document.getElementById(nota.id);\n nuovaNota.style.top = riga.offsetTop + \"px\"; // ...while this is the .top value if user clicks on the horizontal piano.\n }\n\n if (noteLength != 32) // Since 32th notes are tiny, I have no room to add text inside them...\n {\n nuovaNota.innerHTML = nota.innerHTML; // ...so, write note's value and octave IF it's not a 32th.\n }\n }\n nuovaNota.id = nota.id; // Set ID of new note (we said that ID of notes contain the value of the note they play)\n nuovaNota.name = noteLength; // Put the length in the note's name\n nuovaNota.setAttribute(\"onclick\",\"javascript: playNote(this)\"); // Every inputted note on the piano roll can be played if touched\n nuovaNota.style.left = whereNextNote + \"px\"; // Place the new note horizontally\n\n // Now... fun begins: set the width of the note depending on its length.\n // I really tried making this in a for cycle rather than having this dumb chain of ifs, but visually, notes always looked off.\n // So yeah, tl;dr: give a fixed width depending on note length...\n if (noteLength == 1)\n {\n nuovaNota.style.width = 472 + \"px\";\n whereNextNote += 472 + 8 ;\n }\n else if (noteLength == 2)\n {\n nuovaNota.style.width = 232 + \"px\";\n whereNextNote += 232 + 8;\n }\n else if (noteLength == 4)\n {\n nuovaNota.style.width = 112 + \"px\";\n whereNextNote += 112 + 8;\n }\n else if (noteLength == 8)\n {\n nuovaNota.style.width = 52 + \"px\";\n whereNextNote += 52 + 8;\n }\n else if (noteLength == 16)\n {\n nuovaNota.style.width = 22 + \"px\";\n whereNextNote += 22 + 8;\n }\n else if (noteLength == 32)\n {\n nuovaNota.style.width = 9 + \"px\";\n whereNextNote += 7 + 8;\n }\n // ...till here.\n\n // Finally, append new note in body\n noteSheet.appendChild(nuovaNota);\n\n // Put the music values in our global arrays\n music.push(nota.id); // Push the note value\n lengths.push(32/noteLength); // Push the length. Mind the 32/x: thanks to this, we can smartly revert big numbers as short lengths.\n // For example, 32/16th -> 2, this means 16th notes have a length in seconds of 2....\n // ... 32/1th -> 32, aka 1th note has a length of 32.\n // If we don't do this division, a 16th would last more than a 1th, and this isn't true!\n numOfNotes++; // Increase note counter\n }\n }\n}", "title": "" }, { "docid": "8dde51d41d9a4c31079669324e08c71f", "score": "0.5015244", "text": "function nuclearNuke()\n{\n if (numOfNotes==0) // Warn users they can't remove void, function won't work if there are no notes in the sheet.\n {\n alert(\"You didn't input any note!\");\n }\n else // If there are notes, instead....\n {\n // Ask for a confirm first. We don't want to nuke everything for a misclick on the bin.\n var doubleCheck = confirm(\"Are you sure you want to delete ALL the notes you inputted?\");\n if (doubleCheck==true) // If user truly wants to nuke all the notes inputted so far...\n {\n while (numOfNotes!=0) // ...then nuke all notes visually\n { \n doUndo();\n } \n }\n }\n}", "title": "" }, { "docid": "66c660bf31273f022c7a9866fe6c3315", "score": "0.5012332", "text": "function removeEditNotes(ele){\n\n\t\t\t// Hide notes form\n\t\t\t$(ele).fadeOut(100, function(){\n\t\t\t\tele.parentNode.removeChild(ele);\n\t\t\t});\n\n\t\t\t// Unset editing attribute\n\t\t\tcurrentStepNode.setAttribute(\"data-editing\", \"false\");\n\n\t\t\t// Clear reference\n\t\t\tcurrentStepNode = null;\n\t\t}", "title": "" }, { "docid": "a8787aea635cf4e17c37b44307d80b9a", "score": "0.50110656", "text": "function createNoteElement(id, content) {\n const noteEl = document.createElement(\"textarea\");\n noteEl.classList.add(\"note\");\n noteEl.value = content;\n noteEl.placeholder = \"Empty Sticky Note\";\n\n noteEl.addEventListener(\"change\", () => {\n updateNote(id, noteEl.value);\n });\n noteEl.addEventListener(\"dblclick\", () => {\n const doDelete = confirm(\"Are you sure you want to delete this note?\");\n doDelete ? deleteNote(id, noteEl) : \"\";\n });\n return noteEl;\n}", "title": "" }, { "docid": "b346c76d008a5d1007e500aaa7998c68", "score": "0.5005679", "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": "df8bf9586640a530ded4761698c8083c", "score": "0.49977386", "text": "function createNoteElements(notes) {\n return notes.map(function(note) {\n //this will hold the note\n var element = document.createElement('li');\n element.className = 'note';\n element.setAttribute('contenteditable', true);\n element.textContent = note.content;\n element.addEventListener('blur', function() {\n note.content = this.textContent;\n if (note.content == \"\"){\n if (note._id){\n deleteNote(selectedUserId, note, function(){\n document.getElementById('notes').removeChild(element);\n });\n }\n else {\n document.getElementById('notes').removeChild(element);\n }\n }\n else if (!note._id){\n postNewNote(selectedUserId, {\n content: this.textContent\n }, function(newNote) {\n note._id = newNote._id;\n });\n }\n else {\n putNote(selectedUserId, note, function(){\n\n });\n }\n });\n element.addEventListener('keydown', function(e) {\n //code of the key that got fired\n if (e.keyCode == 13) {\n e.preventDefault();\n //if the next sibling is the add note button\n //this makes it that when you are done typing and press enter it will go to the next note\n if (element.nextSibling.className == 'add-note') {\n element.nextSibling.click();\n }\n else {\n element.nextSibling.focus();\n }\n }\n });\n return element;\n });\n return notes;\n }", "title": "" }, { "docid": "8ba36fa91c51890f7a53b7c38267f116", "score": "0.4970849", "text": "function DeleteNote(event) {\n const itemIndex = Number(event.target.value);\n setValue((prevalue) => {\n return prevalue.filter((element, index) => {\n return itemIndex !== index;\n });\n });\n }", "title": "" }, { "docid": "73483b9bbd64504f7364b65cb9f721bf", "score": "0.4970167", "text": "function updateNote (e) {\n\t\tsb.stopPropagationOfEvent(e);\n\t\tvar updatedTitle = title.value,\n\t\t\tupdatedDescription = description.value;\n\t\t\tupdatedNote = {\n\t\t\t\tid : noteObj.id,\n\t\t\t\ttitle : updatedTitle,\n\t\t\t\tdescription : updatedDescription\n\t\t\t}\n\t\tsb.notify({\n\t\t\ttype : \"note-updated\",\n\t\t\tdata : updatedNote\n\t\t});\n\t}", "title": "" }, { "docid": "4d91283f4c058e54fff20e30fbfcb41f", "score": "0.49610132", "text": "function removeNote(note) {\n for (var i = 0; i < noteSequence.length; i++) {\n if (noteSequence[i].note.noteId === note.noteId &&\n noteSequence[i].note !== note) {\n noteSequence.splice(i, 1);\n return;\n }\n }\n }", "title": "" }, { "docid": "5737e0c2a57d8276e972e634f57fbdcb", "score": "0.49608275", "text": "function noteElementClick(y, m, d, note, i, j) {\n\t\tif (typeof j != \"undefined\") {\n\t\t\tremoveExpandPanel();\n\t\t\tinsertEditPanel(j);\n\t\t}\n\t\tupdateInputs(y, m, d, note);\n\t\tupdateSIndex(y, m, d, i);\n\t\tupdateColourButtons(note.getColour());\n\t}", "title": "" }, { "docid": "63284cff1a39e01d9baa1b96130bebce", "score": "0.4960202", "text": "function findTitleAtribute(allEll,obj){\n for (var i = 0; i < allEll.length; i++) {\n if(allEll[i].getAttribute(\"title\") != null){\n var note = allEll[i].getAttribute(\"title\").toString();\n obj.notes.push({\"id\":i.toString(),\"note\":note,\"color\":\"white\",\"date\":\"unkown\"});\n createIcon(i,allEll,obj);\n }\n }\n}", "title": "" }, { "docid": "66c3e21a812b83380d3ce13e4ce3f28f", "score": "0.4953039", "text": "function parseNotesFunction() {\r\n let parsedNotes;\r\n return parsedNotes;\r\n}", "title": "" }, { "docid": "b2659612a9696cda9a1802d7f70ed5f9", "score": "0.49484214", "text": "function post( event ) {\n\n\t\t\tvar slideElement = Reveal.getCurrentSlide(),\n\t\t\t\tnotesElement = slideElement.querySelector( 'aside.notes' ),\n\t\t\t\tfragmentElement = slideElement.querySelector( '.current-fragment' );\n\n\t\t\tvar messageData = {\n\t\t\t\tnamespace: 'reveal-notes',\n\t\t\t\ttype: 'state',\n\t\t\t\tnotes: '',\n\t\t\t\tmarkdown: false,\n\t\t\t\twhitespace: 'normal',\n\t\t\t\tstate: Reveal.getState()\n\t\t\t};\n\n\t\t\t// Look for notes defined in a slide attribute\n\t\t\tif( slideElement.hasAttribute( 'data-notes' ) ) {\n\t\t\t\tmessageData.notes = slideElement.getAttribute( 'data-notes' );\n\t\t\t\tmessageData.whitespace = 'pre-wrap';\n\t\t\t}\n\n\t\t\t// Look for notes defined in a fragment\n\t\t\tif( fragmentElement ) {\n\t\t\t\tvar fragmentNotes = fragmentElement.querySelector( 'aside.notes' );\n\t\t\t\tif( fragmentNotes ) {\n\t\t\t\t\tnotesElement = fragmentNotes;\n\t\t\t\t}\n\t\t\t\telse if( fragmentElement.hasAttribute( 'data-notes' ) ) {\n\t\t\t\t\tmessageData.notes = fragmentElement.getAttribute( 'data-notes' );\n\t\t\t\t\tmessageData.whitespace = 'pre-wrap';\n\n\t\t\t\t\t// In case there are slide notes\n\t\t\t\t\tnotesElement = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for notes defined in an aside element\n\t\t\tif( notesElement ) {\n\t\t\t\tmessageData.notes = notesElement.innerHTML;\n\t\t\t\tmessageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string';\n\t\t\t}\n\n\t\t\tnotesPopup.postMessage( JSON.stringify( messageData ), '*' );\n\n\t\t}", "title": "" }, { "docid": "7f3bce2c82c8c59c766a7908ffcaf8cd", "score": "0.49467525", "text": "static async updateNoteNotification(noteOrId, isDeleted = false) {\n\t\tlet note = null;\n\t\tlet noteId = null;\n\n\t\tif (typeof noteOrId === 'object') {\n\t\t\tnote = noteOrId;\n\t\t\tnoteId = note.id;\n\t\t} else {\n\t\t\tnote = await Note.load(noteOrId);\n\t\t\tnoteId = note ? note.id : null;\n\t\t}\n\n\t\tif (!note && !isDeleted) return;\n\n\t\tconst driver = this.driver();\n\n\t\tlet alarm = noteId ? await Alarm.byNoteId(noteId) : null;\n\t\tlet clearAlarm = false;\n\n\t\tif (isDeleted ||\n\t\t !Note.needAlarm(note) ||\n\t\t (alarm && alarm.trigger_time !== note.todo_due))\n\t\t{\n\t\t\tclearAlarm = !!alarm;\n\t\t}\n\n\t\tif (!clearAlarm && alarm) { // Alarm already exists and set at the right time\n\n\t\t\t// For persistent notifications (those that stay active after the app has been closed, like on mobile), if we have\n\t\t\t// an alarm object we can be sure that the notification has already been set, so there's nothing to do.\n\t\t\t// For non-persistent notifications however we need to check that the notification has been set because, for example,\n\t\t\t// if the app has just started the notifications need to be set again. so we do this below.\n\t\t\tif (!driver.hasPersistentNotifications() && !driver.notificationIsSet(alarm.id)) {\n\t\t\t\tconst notification = await Alarm.makeNotification(alarm, note);\n\t\t\t\tthis.logger().info('Scheduling (non-persistent) notification for note ' + note.id, notification);\n\t\t\t\tdriver.scheduleNotification(notification);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (clearAlarm) {\n\t\t\tthis.logger().info('Clearing notification for note ' + noteId);\n\t\t\tawait driver.clearNotification(alarm.id);\n\t\t\tawait Alarm.delete(alarm.id);\n\t\t}\n\n\t\tif (isDeleted || !Note.needAlarm(note)) return;\n\n\t\tawait Alarm.save({\n\t\t\tnote_id: note.id,\n\t\t\ttrigger_time: note.todo_due,\n\t\t});\n\n\t\t// Reload alarm to get its ID\n\t\talarm = await Alarm.byNoteId(note.id);\n\n\t\tconst notification = await Alarm.makeNotification(alarm, note);\n\t\tthis.logger().info('Scheduling notification for note ' + note.id, notification);\n\t\tawait driver.scheduleNotification(notification);\n\t}", "title": "" }, { "docid": "8ddd690c1b8bbe29054fb76c15cebae9", "score": "0.4934389", "text": "function updateCalendarNotes() {\n\t\tclearCalendar();\n\t\tlet date = new Date();\n\t\tlet y = currYear;\n\t\tlet m = currMonth;\n\t\tfor (j=0; j<42; j++) {\n\t\t\t\n\t\t\tlet dateStr = gridSpacesList[j][0].innerHTML;\n\t\t\tif (dateStr.length > 2)\n\t\t\t dateStr = dateStr.charAt(dateStr.length - 1).toString();\n\t\t\tif (!(isNaN(parseInt(dateStr)))) {\n\t\t\t\tlet d = parseInt(dateStr);\n\t\t\t\tlet noteDate = getNoteDate(y, m, d);\n\t\t\t\tif (noteDate != null) {\n\t\t\t\t\tlet noteList = noteDate.getNoteList();\n\t\t\t\t\tfor (k=0; k<noteList.length; k++) {\n\t\t\t\t\t\tlet space = gridSpacesList[j][k+1];\n\t\t\t\t\t\tlet gSLL = gridSpacesList[j].length;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (k + 1 == gSLL - 2 && noteList.length > gSLL - 2) {\n\t\t\t\t\t\t\tlet diff = noteList.length - (gSLL - 1) + 2;\n\t\t\t\t\t\t\tspace.innerHTML = diff.toString() + \" more\";\n\t\t\t\t\t\t\tspace.style.color = \"#000000\";\n\t\t\t\t\t\t\tspace.style.backgroundColor = \"#FFFFFF\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet text = noteList[k].getText();\n\t\t\t\t\t\tif (text == \"\")\n\t\t\t\t\t\t space.innerHTML = \"(No title)\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t space.innerHTML = noteList[k].getText();\n\t\t\t\t\t\tspace.style.color = \"#FFFFFF\";\n\t\t\t\t\t\tspace.style.backgroundColor = noteList[k].getColour();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "04607073b853635317c91677b80ae510", "score": "0.49287507", "text": "function isAMusicNote() {\n if (\n currentTonic.tonic.toUpperCase() !== \"A\" &&\n currentTonic.tonic.toUpperCase() !== \"B\" &&\n currentTonic.tonic.toUpperCase() !== \"C\" &&\n currentTonic.tonic.toUpperCase() !== \"D\" &&\n currentTonic.tonic.toUpperCase() !== \"E\" &&\n currentTonic.tonic.toUpperCase() !== \"F\" &&\n currentTonic.tonic.toUpperCase() !== \"G\"\n ) {\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "27be3a01a065e3da236b48fd278ab5ad", "score": "0.49231598", "text": "function addMissingEventListeners(placeholder) {\n questionPage.markCorrectEvent(placeholder.firstElementChild);\n}", "title": "" }, { "docid": "0c17c7b828581b298a5d2785ba27f364", "score": "0.49212697", "text": "function initCurrentNote () {\n // title\n var noteTitle = document.getElementById('noteTitleInput'); \n getCurrentNoteTitle();\n \n // body\n var noteBody = document.getElementById('noteBody');\n getCurrentNoteBody();\n}", "title": "" }, { "docid": "5c6d11c0b69b932ea078832c64faed7e", "score": "0.4913089", "text": "function filterSlideTagElements(element) {\n if (element.tagName === undefined) {\n return false;\n }\n\n return titleTagSelector.indexOf(element.tagName.toLowerCase()) >= 0 && element.textContent !== \"\";\n }", "title": "" }, { "docid": "1e947c37497a3935a9a0c4011900b55b", "score": "0.49109352", "text": "function deleteNoteFromList() {\n while (noteBox.firstChild) {\n noteBox.removeChild(noteBox.firstChild);\n }\n browser.storage.local.clear(); // clear all\n}", "title": "" }, { "docid": "574e55530af6d03da19ebf1e3c923b44", "score": "0.49076608", "text": "_markOneRead (e) {\n let counter = this.querySelector('.panel-counter');\n counter.textContent = (window.parseInt(counter.textContent) - 1) + ' New Events';\n\n if (counter.textContent.indexOf('0') === 0) {\n pfUtil.removeNodes(this.querySelector('.mark-all-read').parentNode);\n this.dispatchEvent(new CustomEvent('pf-notification-drawer.markallread', { 'bubbles': true, 'detail': { 'source': this }}));\n }\n }", "title": "" }, { "docid": "26501253ad2f8df049cf2f404cd220b4", "score": "0.4899057", "text": "function showNotes() {\n let notesArr;\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesArr = [];\n } else {\n notesArr = JSON.parse(notes);\n }\n\n let html = \"\";\n notesArr.forEach(function (element, index) {\n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">Note ${index + 1}</h5>\n <p class=\"card-text\">${element}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Node</button>\n </div>\n </div>`;\n });\n\n let notesElem = document.getElementById(\"notes\");\n if (html !== \"\") {\n notesElem.innerHTML = html;\n }\n else{\n notesElem.innerHTML = `<b>Nothing to show! Use <span style=\"color: blue\">\"Add a Note\" </span>section above to add notes.</b>` ;\n console.log(\"hello\");\n }\n}", "title": "" }, { "docid": "7455ab08827df8e873ad7ba40303b598", "score": "0.48986644", "text": "function removeNoDataMessage() {\n if (noDataDiv) {\n\tnoDataDiv.remove();\n }\n}", "title": "" }, { "docid": "58e1df9bdf735d99f97eb8f71365ef1b", "score": "0.4893865", "text": "function validationComment(e, msg){\n\tvar element = id(e);\n\tif(element.value.length == 0 ){\n\t\tcreateErrorMessage(e, msg);\n\t\treturn false\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "52cf439a5d1989dd04b4bb95ae2c3256", "score": "0.4890945", "text": "function n(e){return!(!e||!(\"function\"==typeof Node?e instanceof Node:\"object\"==typeof e&&\"number\"==typeof e.nodeType&&\"string\"==typeof e.nodeName))}", "title": "" }, { "docid": "52cf439a5d1989dd04b4bb95ae2c3256", "score": "0.4890945", "text": "function n(e){return!(!e||!(\"function\"==typeof Node?e instanceof Node:\"object\"==typeof e&&\"number\"==typeof e.nodeType&&\"string\"==typeof e.nodeName))}", "title": "" }, { "docid": "52cf439a5d1989dd04b4bb95ae2c3256", "score": "0.4890945", "text": "function n(e){return!(!e||!(\"function\"==typeof Node?e instanceof Node:\"object\"==typeof e&&\"number\"==typeof e.nodeType&&\"string\"==typeof e.nodeName))}", "title": "" }, { "docid": "9b7cd945b1e9613c644f3a769c92af50", "score": "0.48889127", "text": "function isNotInShow(name) {\n return name.tvSeries[0] == \"\";\n}", "title": "" }, { "docid": "339997596eb25284d3d582e069d8ebff", "score": "0.48877266", "text": "function checkForMissingTags(target){\n numberWayPoints = $(target).find('wpt').length;\n numberTrackPoints = $(target).find('trkpt').length;\n\n response = []\n if(numberWayPoints == 0 && numberTrackPoints == 0){\n response.push(\"The map does not have markers nor pointers. Please Upload a valid tour.\");\n response.push(false);\n }\n else if(numberWayPoints == 0){\n response.push(\"The map does not have markers. Only the path will be displayed.\");\n }else if(numberTrackPoints == 0){\n response.push(\"The map does not have a path. Only markers will be displayed.\");\n }\n\n return response;\n\n}", "title": "" }, { "docid": "33fbf0af81d6e966977a8cecf9980701", "score": "0.4880446", "text": "function itemEmpty(elt) {\n return elt.msgstr.length < 1 || // probably an error actually\n (elt.msgstr.length === 1 && elt.msgstr[0] === \"\");\n}", "title": "" }, { "docid": "b06cb93bf37507708742760a4882e137", "score": "0.48765007", "text": "function clearNotes() {\n allNotesOff();\n}", "title": "" }, { "docid": "0df6228cfe9ba1f3f698da7b80d892c6", "score": "0.48763922", "text": "function confirmALMDataDisplayed() {\n if(confirmed_ids != null) {\n for(a = 0; a < confirmed_ids.length; a++) {\n for(b = 0; b < ids.length; b++) {\n if(confirmed_ids[a] == ids[b]) {\n ids.remove(b);\n }\n }\n }\n }\n\n //if any ids are left. We know there is no data\n //Make note of that now.\n for(a = 0; a < ids.length; a++) {\n var nodeList = $(\"li[data-doi='\" + ids[a] + \"']\");\n var pubDate = $(nodeList[0]).data(\"pdate\");\n\n //If the article is less then two days old and there is no data,\n //it's not really an error, alm is a few days behind\n if(pubDate > ((new Date().getTime()) - 172800000)) {\n makeALMSearchWidgetError(ids[a],\n \"Metrics unavailable for recently published articles. Please check back later.\");\n } else {\n makeALMSearchWidgetError(ids[a],\n \"<img src=\\\"../images/icon_error.png\\\"/>&nbsp;Metrics unavailable. Please check back later.\");\n }\n }\n}", "title": "" }, { "docid": "859531784f982741a381ae14b25b0a92", "score": "0.4874105", "text": "function loadMedicalNotes(ID) {\n // If the booking is empty, do leave blank\n if(ID==\"false\") {\n $(\"medNotesContainer\").innerHTML = \"\"\n }\n else {\n // Fetch the notes\n db.collection(\"patients\").doc(ID).get().then((doc) => {\n $(\"medNotesContainer\").innerHTML = \"\"\n // If the length of the array is 0 (hence, no notes exist), display a message\n if(doc.data().medicalNotes.length == 0) {\n $(\"medNotesContainer\").innerHTML = \"<i>No Prior Medical Notes Found...</i>\"\n } else {\n // Otherwise, go through each medical note and place it in the DOM\n doc.data().medicalNotes.forEach((element, index) => {\n let x = document.createElement(\"div\");\n let title = document.createElement(\"h4\");\n let symptoms = document.createElement(\"p\");\n let diagnosis = document.createElement(\"p\");\n let treatments = document.createElement(\"p\");\n title.innerHTML = doc.data().medicalNotes[index].datetime + \"<br>\"\n symptoms.innerHTML = \"<b>Symptoms: </b>\"+doc.data().medicalNotes[index].symptoms\n diagnosis.innerHTML = \"<b>Diagnosis: </b>\"+doc.data().medicalNotes[index].diagnosis\n treatments.innerHTML = \"<b>Treatment: </b>\"+doc.data().medicalNotes[index].treatments\n x.style.border = \"thin solid black\"\n x.appendChild(title)\n x.appendChild(symptoms)\n x.appendChild(diagnosis)\n x.appendChild(treatments)\n $(\"medNotesContainer\").appendChild(x)\n });\n }\n })\n}\n}", "title": "" }, { "docid": "68cd16987d786a0f326362799f6128a4", "score": "0.48732814", "text": "function saveData(d) {\n var daysArr = d.querySelectorAll(\".realDay\");\n daysArr.forEach((e) => {\n var isNote = e.querySelector(\".note\");\n if (isNote) {\n var newD = new Date(newDate.getFullYear(), newDate.getMonth(), e.innerText);\n data[newD] = isNote.parentElement.innerHTML;\n }\n })\n}", "title": "" } ]
68f6144b174ac88c40df02e883812448
Display button retry button transcode file and delete button
[ { "docid": "6544be460f6f0f6a27dd99102a8cba7c", "score": "0.58389306", "text": "function retryButton($parent, $urlRetry, $urlDelete) {\n var $buttonRetry = \"<div class=\\\"control-group\\\"><a href=\\\"\" + $urlRetry + \"\\\" class=\\\"btn btn-info\\\">Retry</a><a href=\\\"\" + $urlDelete + \"\\\" class=\\\"btn btn-danger\\\">Delete</a></div>\";\n $parent.append($buttonRetry);\n }", "title": "" } ]
[ { "docid": "bd12853406ad05b0bfcb048f8f9b15d6", "score": "0.61052996", "text": "encryptFileButton() {\n let buttonState, buttonText;\n let isLoading = this.state.fileState === FileState.ENCRYPTING;\n switch (this.state.fileState) {\n case FileState.NOT_ENCRYPTED:\n buttonState = \"default\";\n buttonText = \"Encrypt File\";\n break;\n case FileState.ENCRYPTING:\n buttonState = \"default\";\n buttonText = \"Encrypting File..\";\n break;\n case FileState.ENCRYPTED:\n buttonState = \"success\";\n buttonText = \"File encrypted\";\n break;\n default:\n break;\n }\n return (\n <Button bsStyle={buttonState} disabled={isLoading || this.state.fileState === FileState.ENCRYPTED} block\n onClick={isLoading ? null : this.encryptFile}>{buttonText}</Button>);\n }", "title": "" }, { "docid": "cfb39d186563b9d019563726d21dc099", "score": "0.591646", "text": "function remove_pmw_image_btn_gen()\r\n {\r\n $( \".pmw-file-upload\" ).each( function ( e ) {\r\n if ( $( this ).find( \".file-value\" ).val() !== \"\" )\r\n {\r\n var remove_text = ($( this ).attr( \"upload-type\" ) === \"image\") ? \"حذف تصویر\" : \"حذف فایل\";\r\n $( '<input type=\"button\" class=\"basic ui button pmw-remove-upload-button\" upload-type=\"' + $( this ).attr( \"upload-type\" ) + '\" value=\"' + remove_text + '\">' ).insertAfter( $( this ).find( \".pmw-upload-button\" ) );\r\n }\r\n } );\r\n }", "title": "" }, { "docid": "607eed5dee92ffd6ff93215567ef3ae7", "score": "0.5895485", "text": "function checkFile() {\n progressBar(false);\n fileVerified = true;\n config.openFileBtnEle.classList.remove('disabled');\n}", "title": "" }, { "docid": "fd3ab3ca29c566052a23e22693724056", "score": "0.58397114", "text": "function startDeleteFile(button, fileId) {\n button.style.backgroundColor = \"#CD6053\";\n button.onclick = function() { deleteFile(fileId); };\n}", "title": "" }, { "docid": "4a24e8cc2c4f549b539b8c3b2662a8b3", "score": "0.5801912", "text": "function showUploadAgain() {\n $('.upload-button').hide();\n $('.upload-again').show();\n}", "title": "" }, { "docid": "de18697b619588574d24e0261e6c5791", "score": "0.5801281", "text": "function onclickDeleteFile(form){\n\tvar buttonClasses = form.children[0].getAttribute(\"class\").split(\" \");\n\tvar isInactive = false;\n\tfor(var i = 0; i < buttonClasses.length; i++){\n\t\tif(buttonClasses[i] === \"inactive_icon\"){\n\t\t\tisInactive = true;\n\t\t}\n\t}\n\t\n\tif(!isInactive){\n\t\tvar b = confirm(\"Are you sure that you want to delete the file?\");\n\t\tif (b == true) {\n\t\t\t//make delete file button unavailable\n\t\t\tdeactivateButton(\"icon_delete_file\");\n\t\t\tdeactivateButton(\"icon_download\");\n\t\t\t\n\t\t\tform.submit();\n\t\t} else {\n\t\t\talert(\"Deletion of file cancelled.\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8d92846889eee6c2e0be0c77fc251f44", "score": "0.56920993", "text": "function prep_file_delete(file_id) {\n\twindow.prep_file_delete_id = file_id;\n\t$('#deleteFileConfirm').modal();\n}", "title": "" }, { "docid": "6432646a16383dcab541eb8115b8cff9", "score": "0.5674325", "text": "function hideUploadAgain() {\n $('.upload-again').hide();\n $('.upload-button').show();\n //$('#new-file-counter').hide();\n}", "title": "" }, { "docid": "52cf7057ad4a15aed53c22dcfe20498f", "score": "0.5660608", "text": "function updateButtons()\n\t\t{\t\n\t\t\t'save run'.split(' ').forEach(function(id)\n\t\t\t{\n\t\t\t\tfields[id].style.display = scripts.length ? 'inline' : 'none';\n\t\t\t});\n\t\t\tfields.list.style.visibility = scripts.length == 0 \n\t\t\t\t\t\t\t\t\t\t ? 'hidden' : 'visible';\n\t\t\t//update test count\n\t\t\tvar testCount = scripts.length;\n\t\t\tif (testCount == 0)\n\t\t\t\tfields.testCount.innerHTML = '';\n\t\t\telse\n\t\t\t\tfields.testCount.innerHTML = testCount + ' ';\n\t\t\tfields.save.value = 'download ' + testCount + ' scripts';\n\t\t\t\n\t\t\t// update text displayed on last button\n\t\t\t/*\n\t\t\tif (!testdata && scripts.length > 0)\n\t\t\t{\n\t\t\t\tfields.last.value = 'discard test scripts'\n\t\t\t\tfields.last.style.visibility = 'visible';\n\t\t\t}\n\t\t\telse\n\t\t\t*/\n\t\t\t{\n\t\t\t\tvar idx = findIndex(testdata);\n\t\t\t\tfields.last.value = !testdata \t\t ? 'waiting for results'\t//hidden?\n\t\t\t\t\t\t\t\t : testdatas.script ? 'delete test script'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t : 'create test script'\n\t\t\t\tfields.last.style.visibility = testdata ? 'visible' : 'hidden';\n\t\t\t\t//fields.last.disabled = /wait/i.test(fields.last.value);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ce71acda416c6aacaedac09667799073", "score": "0.562434", "text": "function cancelFileForm() {\n toggleAddFileFormVisibility();\n}", "title": "" }, { "docid": "c42ae12528b13d1dbb90631d4228167d", "score": "0.5609011", "text": "function generateBackendButton(filename, callback, cssClass, text, title, version = \"\", refreshCallback) {\n const button = document.createElement(\"button\")\n button.setAttribute(\"class\", cssClass)\n button.textContent = text\n button.title = title\n button.value = version\n button.onclick = () => {\n if (version === \"\") {\n createConfirmWindow(\"Do you really wish to delete this photo?\", () =>{\n callback(filename, refreshCallback)\n })\n } else {\n callback(filename, version)\n }\n\n }\n return button\n}", "title": "" }, { "docid": "f97e093a77026860601343ecc2796393", "score": "0.55883723", "text": "function itemUploadOutput() {\r\n makeLoadingHidden();\r\n makeButtonVisible();\r\n document.getElementById(\"itemUploadOutput\").innerHTML = outputMessage + \"You have Successfully generated \" + (lines.length - 2 - error) + \" Items!\";\r\n outputMessage = \"\";\r\n error = 0;\r\n}", "title": "" }, { "docid": "46ff7c51b6a38e9546bd3340e08c861e", "score": "0.5581444", "text": "function successButton($parent, $urlDownload, $urlDelete) {\n var $buttonSuccess = \"<div class=\\\"control-group\\\"><a href=\\\"\" + $urlDownload + \"\\\" class=\\\"btn btn-primary\\\">Download</a><a href=\\\"\" + $urlDelete + \"\\\" class=\\\"btn btn-danger\\\">Delete</a></div>\";\n $parent.append($buttonSuccess);\n }", "title": "" }, { "docid": "df08fe855106c60ac6522976c0b3f37c", "score": "0.55777025", "text": "function notDelete() {\r\n\t\tdocument.getElementById(\"file\").style.display = \"initial\";\r\n\t\tdocument.getElementById(\"choice\").style.display = \"none\";\r\n\t}", "title": "" }, { "docid": "48c6994ef8168d4b87e2a5cf1b1ca599", "score": "0.55501574", "text": "function cancel() {\n\t\ttoggleButtons();\n\t\tdocument.getElementById('formUpload').reset();\n\t}", "title": "" }, { "docid": "d9ee0bbe81846d2aee8aaaaad0c8e6b5", "score": "0.55449915", "text": "function handleDeletePress() {\n if (file.status === 'new') {\n // it hasn't been uploaded yet, just delete it\n deleteFile(file)\n } else {\n setShowConfirmDeleteModal(true)\n }\n }", "title": "" }, { "docid": "11aab0387aee966f5a53b8dc37510089", "score": "0.5538688", "text": "imageButtonClickHandler() {\n this.loadNativeFileSelector(fileList => {\n inputRichTextLibrary.uploadAndInsertSelectedFile(\n this.quill,\n fileList[0],\n this.shareWithEntityId\n );\n });\n }", "title": "" }, { "docid": "431c4fdd6eb32926caff5a15eb2f542e", "score": "0.54935044", "text": "function undoerror_msg() {\n swal({\n title: \"Undo Successful\",\n text: \"This student is already in a project\",\n type: \"info\",\n confirmButtonText: \"Okay\",\n allowOutsideClick: true,\n timer: 7000,\n }, function () {\n }\n );\n }", "title": "" }, { "docid": "d5385ac729b39f9a892d69ccd13329b0", "score": "0.54795015", "text": "function flRenameCancel(){\n\t\n\trunning_action = '';\n\tvar $tr = $('#filelist tr.active');\n\t\n\t$tr\n\t\t.find('td.name input[type=\"text\"]').remove().end()\n\t\t.find('td.name a').show().end()\n\t\t.removeClass('active');\n\t\n}", "title": "" }, { "docid": "a9e7d4c0b8172d39417057640f90f788", "score": "0.5469899", "text": "function checkCallBack(result) {\n if (result) {\n showHideBrowseButton();\n alert('You have already updated this document.');\n uploader.deleteFileInputAt(selectedFileIndex);\n uploader.updateClientState();\n showHideBrowseButton();\n }\n}", "title": "" }, { "docid": "f9050d5661b9f111eae8b99f6ac7973e", "score": "0.5466865", "text": "function undoerror2_msg() {\n swal({\n title: \"Undo Successful\",\n text: \"This student is already in a different project\",\n type: \"info\",\n confirmButtonText: \"Okay\",\n allowOutsideClick: true,\n timer: 7000,\n }, function () {\n }\n );\n }", "title": "" }, { "docid": "e64d5d0e658e35ccc41c7908f5d72802", "score": "0.54646444", "text": "function fin(){\r\n document.getElementById(\"numero\").disabled=true; // deshabilitamos el casilla de entrar el numero, y el boton enviar\r\n document.getElementById(\"btnEnviar\").disabled=true;\r\n //añadimos un boton de recarga para volver a jugar\r\n document.getElementById(\"recarga\").innerHTML=\"<button onclick='window.location.href=window.location.href'>Recargar</button>\";\r\n document.getElementById(\"recarga\").innerHTML+=\"<button onclick='href=index.html'>Volver al indice</button>\";\r\n }", "title": "" }, { "docid": "c851db1d5f85de67ad1c13f3b8a81418", "score": "0.5463667", "text": "function fileOp(operation) {\n hideMenu();\n\t$(\"#bottomstatus\").empty();\n var newvalue = $(\"#fileslist\").val();\n if (operation==\"saveAs\") {\n var answer = prompt (\"Save as:\", $(\"#curfileid\").html());\n if (answer!=null) {\n newvalue = answer;\n } else {\n return;\n }\n } else if (operation==\"new\") {\n var answer = prompt (\"New:\", $(\"#fileslist\").val());\n if (answer!=null) {\n newvalue = answer;\n $(\"#curfileid\").html(answer);\n } else {\n return;\n }\n } else if (operation==\"browse\" || operation==\"load\") {\n newvalue = $(\"#fileslist\").val();\n } else if (operation==\"open\") {\n $(\"#curfileid\").html( $(\"#fileslist\").val() );\n $(\"#tbhints\").css(\"display\",\"inline\");\n } \n\tif ( confirmFileOp(operation) == false ) {\n\t\treturn;\n\t} \n var valor = $(\"#curfileid\").html();\n updateTitle();\n\tvar ob = $(\"<button operation='\" + operation + \"' value='\" + valor + \"' newvalue='\" + newvalue + \"'>\" + operation + \"</button>\").get(0);\n sendRequestToServer(\"fileoperation\", ob);\n}", "title": "" }, { "docid": "7077b3e1b114fd92150c1a4f1aeb06ec", "score": "0.5424825", "text": "function showUploadFile() {\n $('.select-file').hide();\n $('.upload-file').show();\n //makes delete button visable to remove selected file\n $('.remove-button').show();\n}", "title": "" }, { "docid": "960b6893e766171bde66c6674784e7b4", "score": "0.5422663", "text": "function undoerror3_msg() {\n swal({\n title: \"Undo Successful\",\n text: \"This student is not in a project\",\n type: \"info\",\n confirmButtonText: \"Okay\",\n allowOutsideClick: true,\n timer: 7000,\n }, function () {\n }\n );\n }", "title": "" }, { "docid": "fd882fad8f1985abc5acfe0994fc4279", "score": "0.5414292", "text": "function handleDeleteFileClick(id) {\n if (confirm(\"Are you sure?\")) {\n deleteFile(id);\n }\n}", "title": "" }, { "docid": "7e99b9547ac1853130752809fd39d9a9", "score": "0.54139394", "text": "function volverPantalla3(){\n //Screen\n uploadBtn.style.display = 'none';\n recordBtn.style.display = 'flex';\n //Repeat button\n repeatRecording.style.display = 'none';\n}", "title": "" }, { "docid": "6485bc4aa734d64e2fb91fd0a706046b", "score": "0.54069", "text": "function onPostSuccess(result) {\n\t//enable the Save and Delete buttons\n\t$('#btn-save').removeClass('disabled');\n\t$('#btn-delete').removeClass('disabled');\n\n\tgetResource(selectedContentType, selectedFile);\n}", "title": "" }, { "docid": "c3a5e4f7f21fb06fef856db8c846d958", "score": "0.53877604", "text": "function whenUploadFinish(responseData) {\n var count = 0;\n var isFiled = true;\n var canHiddeAll = true;\n $('#bank-statement-table').find('tr').each(function (i, v) {\n $(v).find('.sorting_1').each(function (ii, vv) {\n $.each(responseData, function (num, object) {\n if ($.trim(object.transactionHash) === $.trim(vv.innerText) &&\n $.trim(object.id) === \"-1\") {\n count++;\n isFiled = false;\n canHiddeAll = false;\n }\n });\n if (isFiled) {\n $(v).hide();\n }\n });\n isFiled = true;\n });\n\n $(\"#step-four\").show(200);\n $(\"#step-five\").show(200);\n\n $(\"#bank-statement-table\").unbind();\n $(\"#btnCancelOrSave\").hide();\n $(\"#uniqueSuccessDiv\").removeClass(\"hidden\");\n if (count > 0) {\n $('#uniqueSuccessHeader').append(\"Save successfully.But have \" + count + \" uploads failed.\");\n } else {\n $('#uniqueSuccessHeader').append(\"Save successfully.\");\n\n }\n $(\"#btnImportAnother\").removeAttr(\"style\");\n $(\"#btnViewUpload\").removeAttr(\"style\");\n $('html').scrollTop(0);\n\n if (canHiddeAll) {\n $(\"#bank-statement-table_wrapper\").hide();\n } \n }", "title": "" }, { "docid": "f63197eef933d75cc5b5d8c599fa7f11", "score": "0.5381165", "text": "function cancel() {\n //debugger; sirve para poner un break point\n toggleButtons();\n //ademas debo de formatear el form\n document.getElementById('formUpload').reset();\n }", "title": "" }, { "docid": "f0042298c9665fee862a2e5b91ca84cf", "score": "0.5376386", "text": "function deleteFile(ev) {\n ev.stopPropagation();\n\n new CustomConfirm(\n 'Borrar elemento',\n '¿Estás seguro de borrar el elemento seleccionado?',\n (confirmation) => {\n if (confirmation === false) {\n return;\n }\n\n const folder = this.getAttribute('data-remove');\n\n const data = new FormData();\n data.append('folder', folder);\n\n const init = {\n method: 'POST',\n credentials: 'same-origin',\n body: data\n };\n\n const url = \"./php/deleteFile.php\";\n\n fetch(url, init)\n .then(data => data.text())\n .then(txt => console.log(txt))\n .then(() => getFolderFiles(getCurrentFolder()))\n .catch(err => new CustomAlert(\"Error\", \"Lo sentimos, no ha sido posible conectar con la base de datos\"));\n }\n );\n}", "title": "" }, { "docid": "e74eb310a2e9d6f22b9e50af8fd510b5", "score": "0.5371002", "text": "function jfu_ui_update($target) {\n var ui = $target.data(\"ui\");\n var mediaData = $target.data('media_data') || {}\n \n var upload_count = jfu_upload_count($target);\n var download_count = jfu_download_count($target);\n var send_count = $target.data('send-count');\n\n $target.data(\"upload-count\", upload_count || 0);\n $target.data(\"download-count\", download_count || 0);\n \n $('[data-toggle=\"confirmation\"]').confirmation({\n //'singleton':true \n });\n \n if(ui != \"full\") return; \n \n var $upload_button = $target.find('BUTTON.upload-all');\n var $cancel_button = $target.find('BUTTON.cancel-all');\n var $check_all = $target.find('INPUT.check-all');\n var $view_buttons = $target.find('.jfu-switch-view');\n\n $file_cont = $target.parent().find('.file-table tbody');\n $checkboxes = $file_cont.find('INPUT.toggle');\n\n if(send_count > 1) {\n $cancel_button.removeClass(\"hidden\").show(); \n } else {\n $cancel_button.addClass(\"hidden\").hide(); \n } \n \n var show_view_buttons = false;\n\n \n\n \n if(download_count > 1) { // if more than one, make sortable and show Delete-all button on top\n $check_all.removeClass(\"hidden\").show(); \n $checkboxes.removeClass(\"hidden\").show();\n show_view_buttons = true;\n } else {\n //console.log(\"hiding delete button\");\n // $delete_button.addClass(\"hidden\").hide(); \n $check_all.addClass(\"hidden\").hide(); \n $checkboxes.addClass(\"hidden\").hide(); \n }\n\n if(upload_count) show_view_buttons = false;\n \n if(upload_count > 1) { // if more than one, show upload-all button on top\n $upload_button.removeClass(\"hidden\").show(); \n } else {\n $upload_button.addClass(\"hidden\").hide(); \n }\n \n if(show_view_buttons) {\n var view = $target.data(\"view\");\n $view_buttons.removeClass(\"hidden\").show();\n if(view) $(\".jfu-switch-view.jfu-view-\" + view).removeClass(\"btn-default\").addClass(\"btn-positive\");\n \n } else {\n $view_buttons.addClass(\"hidden\").hide(); \n }\n\n var view = $target.data(\"view\") || 'list';\n \n var download_count = $target.data(\"download-count\");\n if(download_count > 1) {\n var sortable_options = {'handle': '.handle'};\n var handler_options = $target.data('handler_options') || {};\n var handler = handler_options.handler || $target.data('handler') || '';\n sortable_options.handler = handler; \n sortable_options.handler_options = handler_options;\n var $parent = $target.parent();\n if(view == 'list') {\n sortable_options.helper = fixHelper; // needed so table row won't shrink\n $file_cont = $parent.find('.file-table tbody');\n } else { // grid view\n //sortable_options.helper = fixHelper;\n $file_cont = $parent.find('.file-table UL.file-container');\n }\n \n if(mediaData.inline) {\n sortable_options.inline = 1;\n sortable_options.obj_type = mediaData.parent_type;\n sortable_options.obj_id = mediaData.parent_id;\n sortable_options.obj_field = mediaData.parent_field;\n }\n\n if(upload_count > 0) {\n //$(\"html, body\").animate({ scrollTop: $(document).height() }, \"fast\");\n if(0) { // swap upload/download template\n $(\".template-upload\").insertBefore(\"#template-download-row\");\n } else { // scroll to download template\n $('html, body').animate({\n scrollTop: $(\"#template-download-row\").offset().top + $(\"#template-download-row\").height() \n }, 100); \n console.log(\"Scrolling to download row len=\" + $(\"#template-download-row\").length + \" upload_count=\" + upload_count + \"top=\" + $(\"#template-download-row\").offset().top + \" height=\" + $(\"#template-download-row\").height());\n } \n }\n \n console.log(\"Target:\" + $target.attr('id') + \" parent=\" + $parent.attr('class') + \" dl count=\" + download_count + \" file_cont=\" + $file_cont.length);\n //console.log(\"Media Data:\", mediaData);\n //console.log(\"Sortable options:\", sortable_options);\n sortable_object_list($file_cont, sortable_options);\n } \n}", "title": "" }, { "docid": "00f04ee24c452771dc6086e2fecd7f15", "score": "0.5366667", "text": "function deleteUploadFile(showfile,showname,showbtn,inputToSend,choice){\n $('#'+showfile).attr('href','');\n $('#'+showbtn).addClass('d-none');\n $('#'+showname).remove();\n $('#'+choice).removeClass('d-none');\n $('#'+inputToSend).attr(\"value\",'');\n}", "title": "" }, { "docid": "1f308d9c194def73745514d9885c9c40", "score": "0.5361004", "text": "onRetryClick_() {\n this.setUIStep(UIState.LOADING);\n this.$.retryButton.focus();\n this.loadWebviews_();\n }", "title": "" }, { "docid": "db31432757ce7a21cc0ad3ae6ad28702", "score": "0.53576", "text": "function onFinish(txt,currF,up,ab)\n\t\t\t {\n\t\t\t\t\tfileCount--;//count upload files\n\n\t\t\t\t\tup.attr('disabled',false);\n\t\t\t\t\tsettings.success(txt,currF);\n\t\t\t\t\tif(fileCount==0)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar filesArr=new Array();\n\t\t\t\t\t\t$(_this).find('.ax-file-name').each(function(){\n\t\t\t\t\t\t\tfilesArr.push($(this).attr('title'));\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfileCount=totalFiles;\n\t\t\t\t\t\tsettings.finish(txt,filesArr);\n\t\t\t\t\t\tuploadAll.attr('disabled',false);\n\t\t\t\t\t}\n\t\t\t }", "title": "" }, { "docid": "0c6c41ddecff65cd44765ffbc7087594", "score": "0.53565764", "text": "uiButtons() {\n // toggle dropdown handler\n let toggleDropdown = (selector) => {\n let dropdown = document.querySelector(selector);\n\n if (dropdown.className === \"menu-option-dropdown lsn\") {\n dropdown.className += \" show\";\n } else {\n dropdown.className = \"menu-option-dropdown lsn\";\n }\n };\n\n // file button handler\n let fileButton = () => {\n let fileButton = document.querySelector(\"#file-button\");\n let openInput = document.querySelector(\"#file-open-input\");\n let dropDownVisible = false;\n\n let fileButtonDropdownToggle = (e) => {\n if (dropDownVisible) {\n if (\n e.target.parentElement.id === \"file-button-dropdown\" ||\n e.target.parentElement.id === \"file-button-dropdown-open\"\n ) {\n return;\n }\n document.removeEventListener(\"mousedown\", fileButtonDropdownToggle);\n }\n\n toggleDropdown(\"#file-button-dropdown\");\n dropDownVisible = !dropDownVisible;\n };\n\n // dropdown for file\n fileButton.addEventListener(\"click\", (e) => {\n fileButtonDropdownToggle();\n document.addEventListener(\"mousedown\", fileButtonDropdownToggle);\n });\n\n // openInput\n openInput.addEventListener(\n \"change\",\n (e) => {\n const reader = new FileReader();\n\n reader.onload = () => {\n this.setup(reader.result);\n };\n reader.readAsDataURL(openInput.files[0]);\n },\n false\n );\n };\n\n // insert button handler\n let insertButton = () => {\n let imageButton = document.querySelector(\"#image-button\");\n let imageDropdown = document.querySelector(\"#image-button-dropdown\");\n let insertInput = document.querySelector(\"#image-insert-input\");\n let dropDownVisible = false;\n\n imageDropdown.style.left =\n imageButton.getBoundingClientRect().left + \"px\";\n\n let imageButtonDropDownToggle = (e) => {\n if (dropDownVisible) {\n if (\n e.target.id === \"image-button-rotate\" ||\n e.target.id === \"image-button-resize\" ||\n e.target.parentElement.id === \"image-button-dropdown-insert\"\n ) {\n return;\n }\n document.removeEventListener(\"mousedown\", imageButtonDropDownToggle);\n }\n toggleDropdown(\"#image-button-dropdown\");\n dropDownVisible = !dropDownVisible;\n };\n\n imageButton.addEventListener(\"click\", () => {\n imageButtonDropDownToggle();\n document.addEventListener(\"mousedown\", imageButtonDropDownToggle);\n });\n\n // insert image handler\n insertInput.addEventListener(\n \"change\",\n (e) => {\n let reader = new FileReader();\n\n reader.onloadend = () => {\n this.addNewLayer(reader.result);\n };\n reader.readAsDataURL(insertInput.files[0]);\n },\n false\n );\n };\n\n // resize image handler\n let resizeImage = () => {\n resizeButton.addEventListener(\"click\", () => {\n this.toolCallback(this.toolManager.resizeTool);\n });\n };\n\n let rotateImage = () => {\n rotateButton.addEventListener(\"click\", () => {\n this.toolCallback(this.toolManager.rotateTool);\n });\n };\n\n let saveImage = () => {\n saveButton.addEventListener(\"click\", () => {\n this.toolManager.ExportTool.export(this.layerManager.myLayers);\n });\n };\n\n fileButton();\n insertButton();\n resizeImage();\n rotateImage();\n saveImage();\n }", "title": "" }, { "docid": "2a5082a1c7bed559dbee72d3125db43f", "score": "0.53563946", "text": "function initReplayButton(){\n\tvar button = $(\"#matchSubmitReplay\");\n\tvar disabled = button.hasClass(\"disabled\");\n\n\tif(!disabled){\n\t\tbutton.click(function(){\n\t\t\tl(\"init replay button\");\n\t\t\tvar match_id = getLastPartOfUrl();\n\t\t\tretHTML = getReplayModalHTML();\n\t\t\tretHTML.success(function(html_data){\n\t\t\t$(\"#generalModal div.modal-content\").html(html_data.html);\n\n\t\t\t$('#replayUpload').fileupload({\n\t\t dataType: 'json',\n\t\t acceptFileTypes: /(zip)|(rar)$/i, // Allowed File Types\n\t\t disableValidation: false,\n\t\t done: function (e, data) {\n\t\t \t$(\"#progressReplay\").hide();\n\t\t \tl(data);\n\t\t $.each(data.files, function (index, file) {\n\t\t \t$(\"#replayUploaded\").html(file.name);\n\t\t });\n\t\t fileUploaded = data.files[0];\n\t\t \t$.ajax({\n\t\t\t \t\turl: ARENA_PATH+'/match/moveReplayFile',\n\t\t\t \t\ttype: \"POST\",\n\t\t\t \t\tdataType: 'json',\n\t\t\t \t\tdata: {match_id:match_id, fileName: fileUploaded.name},\n\t\t\t \t\tsuccess: function(result2) {\n\t\t\t \t\t\tl(result2);\n\t\t\t \t\t\t$('#generalModal').modal('hide');\n\t\t\t \t\t\t\n\t\t\t \t\t\tif(result2.status == \"fuckYou\"){\n\t\t\t \t\t\t\t$('#replayUploadModal').modal('hide');\n\t\t\t \t\t\t\ttext = \"<div align='center'><h4>Sorry, your zip-file is broken or not in the right format</h4> \"\n\t\t\t\t\t\t\t\t\t\t+ \"<p>please read the tutorial for uploading a zip-file with parsed replay-files in it.</p>\";\n\t\t\t\t\t\t\t\tbootbox.alert(text);\n\t\t\t \t\t\t}\n\t\t\t \t\t\t\n\t\t\t \t\t\tif(result2.status == \"replayInDB\"){\n\t\t\t \t\t\t\t$('#replayUploadModal').modal('hide');\n\t\t\t \t\t\t\ttext = \"<div align='center'><h4>Sorry</h4> \"\n\t\t\t\t\t\t\t\t\t\t+ \"<p>An other player uploaded the replay-files faster than you. The statistics are already there for this match!</p>\";\n\t\t\t\t\t\t\t\tbootbox.alert(text, function() {\n\t\t\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t\t\t});\n\t\t\t \t\t\t}\n\t\t\t \t\t\t\n\t\t\t \t\t\tif(result2.status == \"wrongReplay\"){\n\t\t\t \t\t\t\t$('#replayUploadModal').modal('hide');\n\t\t\t \t\t\t\ttext = \"<div align='center'><h4>Warning!</h4> \"\n\t\t\t\t\t\t\t\t\t\t+ \"<p>You tried to upload a wrong replay. Next time be sure you submit the right one!</p>\";\n\t\t\t\t\t\t\t\tbootbox.alert(text, function() {\n\t\t\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t\t\t});\n\t\t\t \t\t\t}\n\t\t\t \t\t\t\n\t\t\t \t\t\tif(result2.status == true){\n\t\t\t \t\t\t\t$('#replayUploadModal').modal('hide');\n\t\t\t \t\t\t\ttext = \"<div align='center'><h4>You successfully uploaded the replay-files</h4> \"\n\t\t\t\t\t\t\t\t\t\t+ \"<p>As a reward you get <strong class='text-success'>+1</strong> Credit-Point</p>\";\n\t\t\t\t\t\t\t\t\tbootbox.alert(text, function() {\n\t\t\t\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t\t\t\t});\n\t\t\t \t\t\t}\n\t\t\t \t\t\t\n\t\t\t \t\t}\n\t\t\t \t\n\t\t\t });\n\t\t \n\t\t },\n\t\t add:function(e, data){\n\t\t \tvar file = data.files[0];\n\t\t \tl(file);\n\t\t \tif(file.type == \"application/zip\" || file.type == \"application/x-zip-compressed\" || file.type == \"\"){\n\t\t \t\tdata.submit();\n\t\t \t}\n\t\t else{\n\t\t \talert(\"wrong documenttype for upload. Just zip-files allowed!\");\n\t\t }\n\t\t },\n\t\t\t\tprogressall: function (e, data) {\n\t\t\t\t\t$(\"#progressReplay\").show();\n\t\t\t\t\tl(data.loaded);\n\t\t\t var progress = parseInt(data.loaded / data.total * 100, 10);\n\t\t\t $('#progressReplay .progress-bar').css(\n\t\t\t 'width',\n\t\t\t progress + '%'\n\t\t\t );\n\t\t\t }\n\t\t });\n\t\t\t\n\t\t\t$('#generalModal').modal('show');\n\t\t\t});\n\t\t});\n\t}\n}", "title": "" }, { "docid": "add27baf88d0f08b2d8d6ea56bd841b3", "score": "0.5353315", "text": "function updateFileElements()\n {\n var count = files.length;\n if (count > 0)\n {\n var validCount = count - $fileList.find(\".ilFileUploadError\").size();\n\n $fileList.show();\n $submitButton.prop(\"disabled\", validCount == 0);\n if (validCount > 0)\n $fileCount.text(fileCountText.replace(\"%s\", validCount)).show();\n else\n $fileCount.hide();\n }\n else\n {\n $fileList.hide();\n $submitButton.prop(\"disabled\", true);\n $fileCount.hide();\n }\n }", "title": "" }, { "docid": "18466009441b576b1265a7d2f8ad222d", "score": "0.5343257", "text": "function userUploadOutput() {\r\n makeLoadingHidden();\r\n makeButtonVisible();\r\n document.getElementById(\"userUploadOutput\").innerHTML = outputMessage +\r\n \"You have Successfully generated \" + (lines.length - 2 - error) + \" Users!\";\r\n outputMessage = \"\";\r\n error = 0;\r\n}", "title": "" }, { "docid": "985076303a57c5073bc64d5cbcb233e9", "score": "0.5336351", "text": "displayChangeLocalFileModal(espBtn, btnName) {\n\n this.currentBtnToSet = {\n espBtn: espBtn,\n name: btnName\n };\n\n $('#localBtnNameToChange').text(btnName);\n $('#localUrlToDownload').val('');\n\n $('#changeLocalFileModal').modal('open');\n }", "title": "" }, { "docid": "c4391c03443c660b935cc902df70bcf2", "score": "0.53302866", "text": "function confirmCancelButton() {\n __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({\n title: 'Are you sure?',\n text: \"You won't be able to revert this!\",\n type: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#0CC27E',\n cancelButtonColor: '#FF586B',\n confirmButtonText: 'Yes, delete it!',\n cancelButtonText: 'No, cancel!',\n confirmButtonClass: 'btn btn-success btn-raised mr-5',\n cancelButtonClass: 'btn btn-danger btn-raised',\n buttonsStyling: false\n }).then(function () {\n __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()('Deleted!', 'Your imaginary file has been deleted.', 'success');\n }, function (dismiss) {\n // dismiss can be 'overlay', 'cancel', 'close', 'esc', 'timer'\n if (dismiss === 'cancel') {\n __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()('Cancelled', 'Your imaginary file is safe :)', 'error');\n }\n });\n}", "title": "" }, { "docid": "fc935dd1b5092c60f608ea6aa5220bb0", "score": "0.5328172", "text": "function updatePreUploadStyle() {\n for (i = 0; i < files.length; i++) {\n if (files[i].status === 'ok') {\n styleFilesTableRow(i, '');\n }\n else if (files[i].status === 'possible_dupe') {\n styleFilesTableRow(i, 'preupload_possible_dupe');\n }\n else {\n // 'error' status\n styleFilesTableRow(i, 'preupload_error');\n }\n }\n }", "title": "" }, { "docid": "ae4c25f4216c4c58c158ed9e07bbff05", "score": "0.5307375", "text": "function display(element) {\r\n\t\t\r\n\t\tvar button = document.querySelectorAll('button');\r\n\t\tvar CheckBox = document.getElementById(\"checked\");\r\n\t\t//var input_file_button = document.querySelector('div');\r\n\t\tvar input_file_button = document.querySelector(\".upload-btn-wrapper\");\r\n\r\n\t\tCheckBox.onchange = function (){\r\n\t\t\t//unchecked toggle button\r\n\t\t\tif(CheckBox.checked == false)\r\n\t\t\t{\t\t\t\t\r\n\t\t\t\tbutton[0].style.display = 'none';\r\n\t\t\t\tbutton[1].style.display = 'none';\r\n\t\t\t\tbutton[2].style.display = 'none';\r\n\t\t\t\tbutton[3].style.display = 'none';\r\n\t\t\t\tdocument.getElementById('button1').style.backgroundColor = '';\r\n\t\t\t\tdocument.getElementById('button1').style.color = '';\r\n\t\t\t\tdocument.getElementById('button2').style.backgroundColor = '';\r\n\t\t\t\tdocument.getElementById('button2').style.color = '';\r\n\t\t\t\tinput_file_button.style.display = 'inline';\r\n\r\n\t\t\t\t// Save it using the Chrome extension storage API.\r\n\t\t\t\tchrome.storage.sync.set({'Open': \"Off\"}, function() {\r\n\t\t\t\t\t// Notify that we saved.\r\n\t\t\t\t\r\n\t\t\t\t});\r\n\r\n\t\t\t\tchrome.storage.sync.set({'markReq': \"Off\"}, function() {\r\n\t\t\t\t \r\n\t\t\t\t});\r\n\t\t\r\n\t\t\t\tchrome.storage.sync.set({'markDesign': \"Off\"}, function() {\r\n\t\t\t\t \r\n\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t//checked toggle button and start function\r\n\t\t\telse\r\n\t\t\t{\t\t\t\t\r\n\t\t\t\tbutton[0].style.display = 'inline';\r\n\t\t\t\tbutton[1].style.display = 'inline';\r\n\t\t\t\tbutton[2].style.display = 'inline';\r\n\t\t\t\tbutton[3].style.display = 'inline';\t\r\n\t\t\t\t\r\n\t\t\t\tinput_file_button.style.display = 'none';\r\n\r\n\t\t\t\t// Save it using the Chrome extension storage API.\r\n\t\t\t\tchrome.storage.sync.set({'Open': \"On\"}, function() {\r\n\t\t\t\t\t// Notify that we saved.\r\n\t\t\t\t\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\r\n\t\t\t\t//add function\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "title": "" }, { "docid": "ab454bdbca1eead77b090244c25f5508", "score": "0.53012884", "text": "function enable_header_btnOptions() {\n newFile_btn_click();\n newFolder_btn_click();\n}", "title": "" }, { "docid": "1aca726874c4a172a05e8d9ff1f7430f", "score": "0.52938586", "text": "function uploadPhaseDone(){\n $(\"#uploadPhaseIcon\").html(\"done\");\n $(\"#uploadPhaseButton\").removeClass(\"pulse\");\n $(\"#uploadPhaseButton\").removeClass(\"brown\");\n}", "title": "" }, { "docid": "937bb5fc1817519e704b868e41964711", "score": "0.5291569", "text": "function confirmDeleteAction(barcode) {\n\tconfText = '<span><b>wirklich löschen?</b> ';\n\tconfText += '<a href=\"#\" onClick=\"delFire('+barcode+')\" class=\"btn-flat right waves-effect waves-red right\">OK</a> '; \n\tconfText += '<a href=\"#\" onClick=\"hideConfMess('+barcode+')\" class=\"btn-flat right waves-effect waves-red right\">Abbrechen</a></span> ';\n\t$(\"#\"+barcode).html(confText);\n\t$(\"#\"+barcode).show();\n\t//'+performCustomAction(currentItem['barcode']['value'] ,action)+'\n\t//performCustomAction(currentItem['barcode']['value'] ,1);\n}", "title": "" }, { "docid": "b7ff5c284e66e99b8f740d60dbc0d99f", "score": "0.52837586", "text": "function confirmDelete () {\n var _template = $templateCache.get('recent-invoice-collection-tpls/confirm-msg-tpl.html');\n $origTemplate = element.html(); // temp\n\n element.html(_template);\n countdown(); // show timer confirm\n }", "title": "" }, { "docid": "9be366958b1693094b98594ddfec6204", "score": "0.5282563", "text": "create_file_button(filename)\n { \n let ul = document.getElementById(\"open-files-list\");\n let li = document.createElement(\"li\");\n let file_button = document.createElement(\"input\");\n let close_button = document.createElement(\"a\");\n li.className = \"open-files-list-item\";\n close_button.innerText = \"x\";\n close_button.className = \"close-button\"\n close_button.onclick = function()\n {\n this.close_file(filename);\n }.bind(this);\n file_button.type =\"submit\";\n file_button.className =\"file-title-button\";\n file_button.value =filename;\n file_button.onclick = function()\n {\n // First save the old file.\n this.save_current_file();\n this.activate_file_by_name(filename);\n this.navigator.enable_menu_of_kind(\"EDITOR\");\n // Save the new file.\n this.save_current_file();\n }.bind(this);\n li.appendChild(file_button);\n li.appendChild(close_button);\n ul.appendChild(li);\n this.make_button_active(filename);\n return li;\n }", "title": "" }, { "docid": "e34205b79b0f453495a995873019ab68", "score": "0.52821374", "text": "function fail_delete(error) { console.log(\"file could not be deleted\"); }", "title": "" }, { "docid": "9f28834f34ef2e82f7e7d55689edd11f", "score": "0.5280027", "text": "function onDeleteSuccess(result) {\n\n\t//need to do this to refresh the file tree.\n\twindow.location.reload();\n\n}", "title": "" }, { "docid": "07479486b6e46270e33e1efb18cdc660", "score": "0.5276599", "text": "updateButtons() {\n this._super(...arguments);\n this.$buttons.find('.o_list_export_xlsx').hide();\n }", "title": "" }, { "docid": "56e842142c3e72f4dca5732f37fc2d28", "score": "0.5274263", "text": "function card1UploadMsg() {\n\tshowUploadMsg(\"card1File\", \"card1UploadMsg\");\n}", "title": "" }, { "docid": "a621859ab689d85d0617685909ca2e5e", "score": "0.52729297", "text": "function deleteFile(fileid) \n{\n fetch('/actions/deletefile.php?fileid=' + fileid)\n .then(response => response.json())\n .then(data => {\n displayProgress('File ' + fileid + ' deleted');\n })\n}", "title": "" }, { "docid": "4f90a0d8624c2fbc1c5a70c93362b277", "score": "0.52672654", "text": "function button_show(){\n $('#upload').click();\n}", "title": "" }, { "docid": "290d3dbe19494a403cc825840ae7847c", "score": "0.52649474", "text": "function deletePreview(btn){\n try{\n var id = $(btn).attr('id-img');\n //delete image preview\n $(btn).parents('.item-img').remove();\n //delete image crop\n $('.crop-item' + id).remove();\n //if not have file then reset\n if($('.item-img').length == 0){\n $('.div-upload').removeClass('had-file');\n $('.file').val('');\n $('#title-thumb').addClass('hidden');\n }\n //delete info of file\n for(var i = 0, length = mainImg.length; i < length; i++){\n if(mainImg[i].id + '' == id){\n mainImg.splice(i, 1);\n break;\n }\n }\n }\n catch(e){\n alert('deletePreview: ' + e.message);\n }\n}", "title": "" }, { "docid": "c29de73c3bff1f8783500c5e64f32c4a", "score": "0.52635074", "text": "function retrySelection(buttonId) {\n if (buttonId == 'tryAgain') {\n controlsWrapper.style = '';\n controlsWrapper.style.display = 'block';\n }\n wheelWrapper.innerHTML = '';\n vehicleImage.src = '';\n mediaWrapper.style.display = 'none';\n mediaWrapper.classList = '';\n controlsWrapper.style = '';\n uploadDescription.style.display = 'block';\n errorWrapper.style.display = 'none';\n promptWrapper.style = '';\n appWrap.classList.add('getStarted');\n appWrap.classList.remove('confirmPage');\n\n promptUser();\n }", "title": "" }, { "docid": "5907b6aa4c6ea866eab675f930130a70", "score": "0.52600616", "text": "function postAddFileSlidein() {\r\n \r\n if(feedViewHasFile) {\r\n if (!confirm(\"Warning: Modifing the file requires re-uploading the file. Press OK to continue.\"))\r\n return; \r\n }\r\n $(\"#feedFileClicked\").val(\"true\");\r\n $(\"#feed_toggle_file_button\").text(\"Click to cancel\");\r\n $(\"#feed_toggle_file_button\").attr(\"onclick\", \"postRemoveFileSlidein();\");\r\n $(\"#feed_file_upload_div\").css(\"display\", \"inline\");\r\n $(\"#feed_file_upload_div\").animate({opacity: \"1\"}, {queue: false, duration: 200});\r\n}", "title": "" }, { "docid": "71a58c1b8eecd0313d0dbf735cadea40", "score": "0.525992", "text": "async clickTransferCreditBtn() {\n await I.waitForElement(this.buttons.transferCredit, 20);\n I.click(this.buttons.transferCredit);\n I.waitForText(\"crédit transféré avec succès\",20);\n }", "title": "" }, { "docid": "e4ead8531094c7d7c85fb95a8ecf0dd7", "score": "0.5255813", "text": "function doUploadFiles() {\n // No files left - print 'reboot' message\n if (fileContents.length==0) {\n Puck.write(`\\x10E.showMessage('Hold BTN3\\\\nto reload')\\n`,(result) => {\n if (result===null) return reject(\"\");\n resolve(app);\n });\n return;\n }\n var f = fileContents.shift();\n console.log(`Upload ${f.name} => ${JSON.stringify(f.content)}`);\n // Chould check CRC here if needed instead of returning 'OK'...\n // E.CRC32(require(\"Storage\").read(${JSON.stringify(app.name)}))\n Puck.write(`\\x10${f.cmd};Bluetooth.println(\"OK\")\\n`,(result) => {\n if (!result || result.trim()!=\"OK\") return reject(\"Unexpected response \"+(result||\"\"));\n doUploadFiles();\n }, true); // wait for a newline\n }", "title": "" }, { "docid": "7d90f2b004d433cbfb89db76e0c77cf0", "score": "0.52533805", "text": "function BtnClick_btcancel_Handler(){\r\n\t//Function to be called on Cancel Button Click\r\n//\tdiv_status = unsafeWindow.document.getElementById('st_curr');\r\n\t\r\n\tvar old_state = state;\r\n\tstate = '';\r\n\tvar operation = '';\r\n\t\r\n\tswitch(old_state)\r\n\t{\r\n\tcase 'SHARE':\r\n\t\toperation = 'Shared';\r\n\tbreak;\r\n\r\n\tcase 'DELETE':\r\n\t\toperation = 'Deleted';\r\n\tbreak;\r\n\r\n\tdefault:\r\n\t} // End switch\t\r\n\t\r\n\tdiv_status = d_status;\t\r\n\tshowStatus('Cancelled operation : ' + operation + ' ' + count + ' items');\r\n\thideModal();\r\n}", "title": "" }, { "docid": "d3d057ec6bbe616715400a393fd7be18", "score": "0.5248032", "text": "onUploadClick() {\n var self = this;\n return function() {\n $('#modal').modal('hide');\n self.job.uploadFiles();\n $('#jobPackage').hide();\n }\n }", "title": "" }, { "docid": "e167f3c1a638d061472f850b3c21b4b2", "score": "0.5245436", "text": "function onCancelUpload() {\n //debugger;\n if (attachmentType == \"videocapupload\") {\n $(\"#vidCaptureLoader_\" + currCapVideoObjId).css(\"display\", \"none\");\n } else if (attachmentType == \"imagecapupload\") {\n $(\"#imgCaptureLoader_\" + currCapImageObjId).css(\"display\", \"none\");\n }\n\t\t\n\t\tif (isTimeline().toLowerCase() == \"yes\") {\n\t\t onPlayClick();\n }\n }", "title": "" }, { "docid": "2e55c786d6dab9671d5f0816c2894d38", "score": "0.5244559", "text": "function card3UploadMsg() {\n\tshowUploadMsg(\"card3File\", \"card3UploadMsg\");\n}", "title": "" }, { "docid": "c275a69cbedf077034e1232cd423472e", "score": "0.5236105", "text": "function checkFile(btn, e){\n try{\n var files = e.target.files || e.dataTransfer.files;\n if (!files.length) {\n $('#' + $(btn).attr('id-view')).val('');\n msg_err_file[$(btn).attr('err-idx')] = 22;\n $('#' + $(btn).attr('id-view')).errorStyle(_text[22]);\n return;\n }\n if(files[0].size/1024/1024 > MAX_SIZE_FILE_IMAGE){\n msg_err_file[$(btn).attr('err-idx')] = 23;\n $('#' + $(btn).attr('id-view')).errorStyle(_text[23]);\n }\n else{\n msg_err_file[$(btn).attr('err-idx')] = 0;\n readImage(files[0],'size' + $(btn).attr('err-idx'),'img_preview' + $(btn).attr('err-idx'));\n }\n $('#' + $(btn).attr('id-view')).val(files[0].name);\n } catch (e) {\n alert('checkFile: ' + e.message);\n }\n}", "title": "" }, { "docid": "1366642f3bddc9faacc33094ce8b135a", "score": "0.52347285", "text": "onConfirmDeleteFile(){\n var that = this;\n var file = this.state.remove || {};\n if ( !file.id ) { return; }\n axios.post(RefUtils.apiUrl() + 'ReferenceFile?action=editFile',\n { \n file: {id: file.id},\n remove: true\n }, {\n ttl: 360,\n headers: RefUtils.apiHeaders(),\n timeout: 20000,\n }\n ).then((res) => {\n that.clearAndFetch();\n }).catch((thrown) => { //Error with Request\n if (!axios.isCancel(thrown)) { //Not Cancelled\n that.setState({\n loading: false,\n requestError: thrown\n });\n console.error('onConfirmDeleteFile Error\\n',thrown);\n }\n });\n //console.log(\"Delete \"+id);\n }", "title": "" }, { "docid": "62958ebb45cc7ee0b55c2ad93f8079d2", "score": "0.5233508", "text": "function to_upload(){\n document.getElementById(\"file\").value = 0;\n document.getElementById(\"progress-container\").style.display = \"block\";\n document.getElementById(\"prog-lbl\").innerHTML = \"Uploading... \";\n document.getElementById(\"bw-images\").innerHTML = '<a></a>';\n document.getElementById(\"output\").innerHTML = \"Loading...\";\n Dropzone.forElement('.dropzone').processQueue()\n}", "title": "" }, { "docid": "588ebcb5f39a40e36b85434ec29f6d6c", "score": "0.52329236", "text": "getSelectedFiletoDelete(event, encrypted_file_name) {\n swal({\n title: \"Are you sure you want delete this document?\",\n icon: \"warning\",\n buttons: [true, \"Yes\"],\n dangerMode: true,\n })\n .then((willDelete) => {\n if (willDelete !== null) {\n swal(\"File Deleted\", \"\", \"success\")\n axios.post('/api/getFileToDelete', {\n file_id: encrypted_file_name\n }\n ).then((res) => { console.info(\"The file has been deleted\"); })\n .catch(err => { console.error(\"Could not delete the file: \" + err); });\n window.location.reload();\n }\n });\n }", "title": "" }, { "docid": "a8e949d6a8c02aa5c379b3b90a8f14ec", "score": "0.5229953", "text": "function uploadOK(total) {\n\tdocument.getElementById(\"status2\").style.display = \"none\";\n\tdocument.form2.file.value = \"\";\n\tdocument.form2.submit.disabled = false;\n\talert(\"Se cargaron exitosamente \" + total + \" registros.\");\n\tdocument.form2.file.focus();\n\tredirect();\n}", "title": "" }, { "docid": "a8e949d6a8c02aa5c379b3b90a8f14ec", "score": "0.5229953", "text": "function uploadOK(total) {\n\tdocument.getElementById(\"status2\").style.display = \"none\";\n\tdocument.form2.file.value = \"\";\n\tdocument.form2.submit.disabled = false;\n\talert(\"Se cargaron exitosamente \" + total + \" registros.\");\n\tdocument.form2.file.focus();\n\tredirect();\n}", "title": "" }, { "docid": "2419543ff2131091d24796f9fd1389c5", "score": "0.5229088", "text": "function cerrarVentanaCarga(message){\n $('#texto_carga').text('Upload...OK');\n $('.fb').hide();\n $('.fbback').hide();\n $('body').css('overflow','auto');\n window.location='./visualizar_inspecciones.html';\n}", "title": "" }, { "docid": "b8767e660d900280dccad69458ebbd37", "score": "0.522554", "text": "function fileRows() {\n var fileRow = \n '<div class=\"d-flex align-items-center file-wrap mt-1\">' +\n '<input class=\"form-control\" type=\"file\" id=\"\" name=\"\">' +\n '<button type=\"button\" class=\"btn btn-danger\" data-toggle=\"row-delete\">삭제</button>' +\n '</div>';\n\n $(document).on('click', '[data-toggle=\"row-add\"]', function(){\n var add = $(this),\n rows = add.parent('.file-wrap'),\n rowSibling = rows.siblings().length,\n wrap = rows.parent('.multi-file-wrap'),\n max = wrap.data('max-count');\n\n if ( rowSibling + 1 > max - 1 ) {\n alert('최대 '+max+'개까지 첨부 가능합니다.');\n return;\n }\n\n wrap.append(fileRow);\n });\n $(document).on('click', '[data-toggle=\"row-delete\"]', function(){\n var btn = $(this),\n rows = btn.parent('.file-wrap');\n\n rows.remove();\n });\n}", "title": "" }, { "docid": "eaa98de79846491b0655e1783924ec32", "score": "0.5219239", "text": "function delete_file_success_info(data){\n if(!data)\n data = \" the file\";\n swal(\"Successfully Deleted!\", \"You just deleted the \"+data+\"!\", \"success\");\n}", "title": "" }, { "docid": "92f2b6146708d8a02c4b5b110f50af43", "score": "0.5214633", "text": "function retryBtnDisplay() {\n replayBox.style.display = 'inline';\n}", "title": "" }, { "docid": "efe1248c3d3c96fec8dd1f596d09c654", "score": "0.5211634", "text": "function displayFileIsLoaded(e) {\n // Extract the name of the file from the input\n let fileName;\n try {\n fileName = e.target.value.match(/[^\\\\/:*?\"<>|\\r\\n]+$/);\n } catch (error) {\n fileName = e.target.value.match(/[\\/\\\\]([\\w\\d\\s\\.\\-\\(\\)]+)$/)[1];\n }\n //change the style of the input to show the file is loaded\n fileInputLabel.style.backgroundColor = \"#00cc44\";\n fileInputMessage.style.opacity = 0;\n fileInputIcon.style.opacity = 0;\n fileInputMessage.innerText = fileName;\n fileInputIcon.innerText = \"file_download_done\";\n fileInputMessage.style.opacity = 1;\n fileInputIcon.style.opacity = 1;\n submitInput.style.visibility = \"visible\";\n submitInput.style.opacity = 1;\n}", "title": "" }, { "docid": "a58c015bc2d92b4876d4add1c4e505a0", "score": "0.52097154", "text": "function del_file(file) {\n\t$.ajax({\n\t\turl: 'controller/puente.php',\n\t\ttype: 'POST',\n\t\tdataType: 'json',\n\t\tdata: {option: '19',file:file},\n\t\tasync:false,\n\t\tcache:false,\n\t})\n\t.done(function(response) {\n\t\t$('#file_'+file).hide(3000);\n\t})\n\t.fail(function(jqXHR,textStatus,errorThrown) {\n\t\talerta('am_quejoso','error',jqXHR.responseText,'modal_add_quejoso');\n\t});\t\n\treturn false;\n}", "title": "" }, { "docid": "5ddc3122f3f30a8865de544bef190bfb", "score": "0.5206725", "text": "function IconAndFileUpload(config) {\n var isOrder = _.where(config.context.record.data.assetManager, { state : false , srcAttr : config.srcAttr}).length,\n\t\t\tdisableClass = '';\n\n\t\tif(config.isMultiNarration){\n\t\t\tvar locale = config.srcAttr.split('.')[1];\n\t\t\tif(!config.context.record.data.multiNarrations[locale]){\n\t\t\t\tdisableClass= 'disabled';\n\t\t\t}\n\n\t\t}else{\n\t\t\tif(!config.context.record.data[config.repoItemName] || _.isEmpty(config.context.record.data[config.repoItemName])) {\n\t\t\t\tdisableClass= 'disabled';\n\t\t\t}\n\t\t}\n\n\n\t\t\n\t\tthis.data = {\tinitiator: config.context,\n\t\t\t\t\t\tcallback: config.callback,\n\t\t\t\t\t\ticonClass: config.type + \"_icon\",\n iconId: \"icon_\" + config.repoItemName,\n\t\t\t\t\t\tButtonId: \"Button_upload_\" + config.repoItemName,\n\t\t\t\t\t\ticonDisabledClass:disableClass,\n\t\t\t\t\t\ticonOrderClass : isOrder? 'ordered': '',\n\t\t\t\t\t\tsrcAttr: config.srcAttr\n\t\t\t\t\t};\n\t\tif (!(config.itemId instanceof $)) {\n\t\t\tconfig.itemId = $(config.itemId);\n\t\t}\n\t\tthis.itemId = config.itemId;\n\n\t\t//append item to scrren\n\t\tconfig.itemId.append(Mustache.render(_template, this));\n\n\t\tvar options = {};\n\t\tswitch(config.type) {\n\t\t\tcase 'sound':\n\t\t\tcase 'narration':\n\t\t\t\toptions = FileUpload.params.audio;\n\t\t\t\tbreak;\n\t\t\tcase 'video':\n\t\t\t\toptions = FileUpload.params.video;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//init file upload button\n\t\tnew FileUpload({\n\t\t\tactivator: config.itemId.find(\".\" + this.data.ButtonId),\n\t\t\toptions: options,\n\t\t\tcallback: this.afterFileUpload,\n\t\t\tcontext: this,\n\t\t\trecordId: config.recordId,\n\t\t\tsrcAttr: config.srcAttr,\n\t\t\tenableAssetManager: config.enableAssetManager,\n\t\t\tenableDelete: config.enableDelete,\n\t\t\tenableEdit: config.enableEdit,\n\t\t\tisNarration: config.isNarration,\n\t\t\tisMultiNarration: config.isMultiNarration\n\t\t});\n\t}", "title": "" }, { "docid": "3216469e4e6fae50462e0fa4a14345c1", "score": "0.5205139", "text": "function displayUploadBtn() {\n var sendUrl = textInElement(\"form\", \"\", main);\n var inputUrl = textInElement(\"input\", null, sendUrl);\n var inputSubmit = textInElement(\"input\", \"submit\", sendUrl);\n sendUrl.setAttribute(\"action\", \"\");\n sendUrl.setAttribute(\"method\", \"GET\");\n inputUrl.setAttribute(\"type\", \"url\");\n inputUrl.setAttribute(\"required\", \"required\");\n inputSubmit.setAttribute(\"type\", \"submit\");\n inputSubmit.setAttribute(\"value\", \"send\");\n inputSubmit.setAttribute(\"class\", \"btn btn-light btn-lg border\");\n onSubmitForm(sendUrl);\n\n if (!isGalleryFull()) {\n var btn = textInElement(\"button\", \"upload\", main);\n btn.setAttribute(\"class\", \"btn btn-light btn-lg border\");\n btn.addEventListener(\"click\", function (event) {\n inputFile.click();\n });\n inputFile.addEventListener(\"change\", function (event) {\n onChangeFile(event, inputFile.files[0]);\n });\n return;\n }\n textInElement(\"b\", \"Gallery is full\", main);\n }", "title": "" }, { "docid": "96e378612229dad5d957cc5b56f7d886", "score": "0.5203781", "text": "onclick(e) {\n const message = i18n._t(\n 'VersionedEditForm.ARCHIVE_CONFIRM_MESSAGE',\n 'Warning: This record will be unpublished before being sent to the archive.\\n\\nAre you sure you want to proceed?'\n );\n\n if (confirm(message)) { // eslint-disable-line no-alert\n // Add a loading indicator and continue\n this.parents('form:first').addClass('loading');\n\n return this._super(e);\n }\n\n return false;\n }", "title": "" }, { "docid": "a6b5cb1020b596b2001133182218ab2a", "score": "0.5194565", "text": "function handleUpload(){\r\n\t\t\r\n\t/*Solange confirmCloseWin true ist, bedeutet das, dass ein Upload stattfindet und daher die Seite nicht verlassen werden sollte.*/\r\n \r\n\t\tconfirmCloseWin = true;\r\n\t\t\r\n\t/*Läuft momentan kein Upload (zu ladene Bytes und geladene Bytes sind gleich gross), dann muss zunächst die Statusanzeige für den Upload eingeblendet werden.*/\r\n \r\n\t\tif(arrayAdd(UPtotal) == arrayAdd(UPgeladen)){\r\n\t\t\t$('.status').css('right', '-164px');\r\n\t\t}\r\n\t\t\r\n\t/*Für jeden Upload wird eine Zahl vergeben, damit die verschiedenen Uploads unterschieden werden können*/\r\n \r\n\t\tvar zahlfix=zahl;\r\n\t\tzahl++;\t\r\n\t\t\r\n\t/*Files aus Upload-Formular auslesen und aktuellen Ordnerpfad einlesen und FormDate (Container/Objekt zum übertragen diverser Datentypen per Ajax) hinzufügen*/\r\n\t\r\n\t\tvar fileInput = document.getElementById('upfile');\r\n\t\tvar upOrdner = $('#upOrdner').val();\r\n\t\tvar data = new FormData();\t\t\r\n\t\tdata.append('ajax', true);\r\n\t\tdata.append('upOrdner', upOrdner);\t\t\r\n\t\tfor (var i = 0; i < fileInput.files.length; ++i){\r\n\t\t\tdata.append('upfile[]', fileInput.files[i]);//Files Array in FormData hinzufügen\r\n\t\t\t\r\n\t/*Hier werden die einzelnen Datein zur Liste in der Statusbar hinzugefügt. Zunächst wird die Dateigrösse in ein leserlichen Einheit umgeformt. Danach werden die Informationen in HTML-Markup gepackt*/\r\n\t \r\n\t\t\tvar sizeFile;\r\n\t\t\tif (fileInput.files[i].size > 1000000){\r\n\t\t\t\tsizeFile = (Math.round(fileInput.files[i].size/100000)/10) + \"MB\";\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tsizeFile = (Math.round(fileInput.files[i].size/100)/10) + \"KB\";\r\n\t\t\t}\r\n\t\t\t$('.status > div:last-child').prepend(\r\n\t\t\t'<div class=\"d'+i+'\"><div>am Laden:</div> <div>'+fileInput.files[i].name+ //'d+1: zum Unterscheiden der Files innerhalb eines Uploads\r\n\t\t\t'</div><div>Size: '+sizeFile+'; Type: '+\r\n\t\t\tfileInput.files[i].type+'</div><div class=\"UpNum'+zahlfix+'\"></div></div>');//'UpNum'+Zahlfix: zum Unterscheiden der Uploads nötig\r\n\t\t}\r\n\t\r\n\t/*Ajax: neuer Request (für Upload)*/\r\n\t\r\n\t\tvar request = new XMLHttpRequest();\r\n\t\t\r\n\t/*Event-Handler für Uploadprogress*/\r\n\t\r\n\t\trequest.upload.addEventListener('progress', function(event){\r\n\t\t\tif(event.lengthComputable){//falls verfügbar...\r\n\t\t\t\r\n\t/*Die Gesammtgrösse und die zum Zeitpunkt des Uploads geladenen Bytes werden in die jeweiligen Arrays gespeichert. Danach wird ausgerechnet, wieviel Prozent bereits hochgeladen wurden. Mit diesen Werten wird der Eintrag in der Statusbar aktualisiert*/\r\n\t\r\n\t\t\t\tUPgeladen[zahlfix]=event.loaded;\r\n\t\t\t\tUPtotal[zahlfix]=event.total;\t\t\t\t\t\t\t\r\n\t\t\t\tvar percent = arrayAdd(UPgeladen) / arrayAdd(UPtotal); \r\n\t\t\t\tvar percentP = (100 * event.loaded / event.total );\r\n\t\t\t\tvar percentPcent = percentP + \"%\";\t\t\t\t\r\n\t\t\t\t$('.status > div:first-child > div:first-child').empty();\r\n\t\t\t\t$('.status > div:first-child > div:first-child').append('<div>&#xe012;</div> '+(Math.round(percent * 1000)/10) + '%');\r\n\t\t\t\tvar hohe = (percent*120);\r\n\t\t\t\t$('.status > div:first-child > div:last-child').css('height', hohe);\r\n\t\t\t\t$('.status > div:last-child > div > .UpNum'+zahlfix).css('width', percentPcent);\r\n\t\t\t\t$('.status > div:last-child > div > .UpNum'+zahlfix).empty();\r\n\t\t\t\t$('.status > div:last-child > div > .UpNum'+zahlfix).append(Math.round(percentP * 1000)/1000 + '%');\r\n\t\t\t}\r\n\t\t\t\r\n\t/*Während eines Uploads blinkt das Favicon im Tab orange-blau. So bekommt der Nutzer auch ein Feedback, wenn er in anderen Tabs arbeitet.\r\n\t *Die Farbe ändert zweimal pro drei Progress-Events.*/\r\n\t\r\n\t\t\tif(icon<1){\r\n\t\t\t\t$('.favicon').replaceWith('<link class=\"favicon\" rel=\"icon\" href=\"../icon1.ico\" type=\"image/png\" />');\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$('.favicon').replaceWith('<link class=\"favicon\" rel=\"icon\" href=\"../icon.ico\" type=\"image/png\" />');\r\n\t\t\t}\r\n\t\t\ticon++;\r\n\t\t\tif(icon == 2){\r\n\t\t\t\ticon=0;\r\n\t\t\t}\r\n\t\t}, false);\t\r\n\t\t\r\n\t/*Event-Handler, wenn die Dateien hochgeladen sind.*/\r\n\t\r\n\t\trequest.upload.addEventListener('load', function(event){\r\n\t\t\t\tUPgeladen[zahlfix] = UPtotal[zahlfix];\r\n\t\t\t\t\r\n\t/*Wenn es der letzte Upload gewesen ist, also die Anzahl geladene Bytes mit der Gesammtzahl Bytes übereinstimmt, verschwindert die Statusbar wieder und die beiden Arrays werden zurückgesetz (nicht auf 0, da es sonst zu einer Division durch 0 kommen kann).*/\r\n\t\t\r\n\t\t\t\tif(arrayAdd(UPtotal) == arrayAdd(UPgeladen)){\r\n\t\t\t\t\t$('.status').css('right', '-200px');\r\n\t\t\t\t\tfor (var i = 0; i < UPgeladen.length; ++i){\r\n\t\t\t\t\t\tUPgeladen[i] = 0.001;\r\n\t\t\t\t\t\tUPtotal[i] = 0.001;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconfirmCloseWin = false;//Upload beendet\r\n\t\t\t\t}\r\n\t\t\t\t$('.favicon').replaceWith('<link class=\"favicon\" rel=\"icon\" href=\"../icon.ico\" type=\"image/png\" />');//Standard-Favicon\r\n\t\t}, false);\r\n\t\t\r\n\t/*Event-Handler für ein Fehler-Event*/\r\n\t\r\n\t\trequest.upload.addEventListener('error', function(event){\r\n\t\t\talert('Upload fehlgeschlagen! Versuchen Sie es noch einmal.'); //Warnmeldung\r\n\t\t\tUPgeladen[zahlfix] = 0.01; //Werte in Array für diesen Upload zurücksetzen\r\n\t\t\tUPtotal[zahlfix] = 0.01;\t\r\n\t\t\t\t\r\n\t/*Wenn es der letzte Upload gewesen ist, also die Anzahl geladene Bytes mit der Gesammtzahl Bytes übereinstimmt, verschwindert die Statusbar wieder.*/\r\n\t\t\r\n\t\t\tif(arrayAdd(UPtotal) == arrayAdd(UPgeladen)){\r\n\t\t\t\t$('.status').css('right', '-200px');\r\n\t\t\t}\r\n\t\t\tconfirmCloseWin = false;//Upload beendet\r\n\t\t\t$('.favicon').replaceWith('<link class=\"favicon\" rel=\"icon\" href=\"../icon.ico\" type=\"image/png\" />');//Standard-Favicon\r\n\t\t}, false);\r\n\t\t\r\n\t/*Event-Handler für Statusänderung*/\r\n\t\r\n\t\trequest.addEventListener('readystatechange', function(event){\r\n\t\t\tif(this.readyState == 4){//Status: Antwort gesendet (=4)\r\n\t\t\t\r\n\t/*Ist alles OK, wird die Antwort ausgelesen und ausgewertet.*/\r\n\t\r\n\t\t\t\tif(this.status == 200){//Wenn alles OK...\r\n\t\t\t\t\tvar links = $('.status > div:last-child');\r\n\t\t\t\t\tif(this.response != 0){\r\n\t\t\t\t\t\tvar uploaded = eval(this.response);//Antwort auslesen\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(arrayAdd(UPtotal) == arrayAdd(UPgeladen)){//wenn kein anderer Upload mehr\r\n\t\t\t\t\t $('.status').css('right', '-200px');//Statusbar ausblenden\r\n\t\t\t\t\t\tconfirmCloseWin = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar div, a;\r\n\t\t\t\t\t\r\n\t/*Das Array mit den Antworten wird abgearbeitet: Die Antworten werden jeweils auf Fehlermeldungen überprüft.\r\n\t *Gibt es keinen Fehler, wird mit dem übergebenen Pfad ein Icon angefordert.*/\r\n\t\r\n\t\t\t\t\tfor(var i = 0; i < uploaded.length; i++){\r\n\t\t\t\t\t\tif(uploaded[i].slice(0,10)!='*#fehler-+' && uploaded[i].slice(-9)!='qrs.dd*db'){//Auf Fehler überprüfen\r\n\t\t\t\t\t\t\tvar dName = uploaded[i].slice(uploaded[i].lastIndexOf('/')+1); //Dateiname aus Antwort extrahieren\r\n\t\t\t\t\t\t\t$('.status > div:last-child > div.d'+i+' > .UpNum'+zahlfix).parent().replaceWith('<div class=\"UpFertig\">Fertig: '+ dName +'</div>'); //Status anpassen\r\n\t\t\t\t\t\t\tif(document.getElementById('upOrdner').value==upOrdner){//Falls im richtigen Ordner\r\n\t\t\t\t\t\t\t\txhr[i] = new XMLHttpRequest();//Icon anfordern\r\n\t\t\t\t\t\t\t\txhr[i].open(\"POST\", \"../php/icon.php\", true);\r\n\t\t\t\t\t\t\t\txhr[i].setRequestHeader(\"Content-Type\", \"application/x-WWW-form-urlencoded\");\r\n\t\t\t\t\t\t\t\txhr[i].send(\"&dName=\"+dName+\"&upOrdner=\"+upOrdner);\r\n\t\t\t\t\t\t\t\txhr[i].addEventListener('readystatechange', function(event){\r\n\t\t\t\t\t\t\t\t\tif(this.readyState == 4 && this.status == 200){\r\n\t\t\t\t\t\t\t\t\t\tif((document.getElementById('upOrdner').value)==upOrdner){\r\n\t\t\t\t\t\t\t\t\t\t\t$('#inhalt').append(this.responseText); //Antwort (Icon) einfügen\r\n\t\t\t\t\t\t\t\t\t\t\tpsdInhHi();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{//bei Fehler\r\n\t\t\t\t\t\t\tvar ende = uploaded[i].slice(11)\r\n\t\t\t\t\t\t\tende = ende.slice(0,-9);\r\n\t\t\t\t\t\t\tif(uploaded[i].slice(0,11)=='*#fehler-+0'){\r\n\t\t\t\t\t\t\t\talert('Die Datei \"'+ende+'\" konnte nicht gespeichert werden. Möglicherweise ist die Datei zu gross oder hat einen ungültigen Dateinamen oder Dateityp!');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(uploaded[i].slice(0,11)=='*#fehler-+1'){\r\n\t\t\t\t\t\t\t\talert('\"'+ende+'\" ist eine leere Datei! Leere Dateien werden nicht hochgeladen. (Eventuell ist die Datei auch zu gross.)');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(uploaded[i].slice(0,11)=='*#fehler-+2'){\r\n\t\t\t\t\t\t\t\talert('\"'+ende+'\" konnte nicht gespeichert werden, da nicht genügend Speicherplatz zur Verfügung steht.');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$('.status > div:last-child > div.d'+i+' > .UpNum'+zahlfix).parent().replaceWith('<div class=\"UpFehler\">Fehler: '+ende +'</div>');//Status anpassen\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{//Irgend ein Fehler (nicht im Skript)\r\n\t\t\t\t\talert('Upload fehlgeschlagen! Versuchen Sie es noch einmal');\r\n\t\t\t\t\tfor (var i = 0; i < fileInput.files.length; ++i){\r\n\t\t\t\t\t\t$('.status > div:last-child > div > .UpNum'+zahlfix).parent().replaceWith('<div class=\"UpFehler\">Fehler!</div>'); //Status anpassen\r\n\t\t\t\t\t\tconfirmCloseWin = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, false);\t\r\n\t\t\r\n\t/**\r\n\t *Hier weden die Parameter für den Request eingestellt und dann der Request abgesendet.\r\n\t */\r\n\t \t\r\n\t\trequest.open('POST', '../php/upload.php', true);\r\n\t\trequest.setRequestHeader('Cache-Control', 'no-cache')\r\n\t\trequest.send(data);\r\n\t}", "title": "" }, { "docid": "92038092444c23c0aa3f8d1d7669e59d", "score": "0.5187849", "text": "function delete_indication(data, button_id) {\n //not successful\n if (! data.success) return;\n\n //hide the row containing the button, when animation finished remove it\n $('#' + button_id).parents('tr').hide('fast', function() {$(this).remove()});\n}", "title": "" }, { "docid": "288d22d18706b001106f62d7c1287d41", "score": "0.51806337", "text": "handleRemoveSelectedFile(path) {\n document.querySelector(\".file-reference-verbiage\").innerHTML = path;\n const modal = document.querySelector('#removeFilesConfirmationModal');\n modal.setAttribute('data-details', path);\n window.removeSelectedFiles();\n }", "title": "" }, { "docid": "9a7656c599ed584548aa27fb1afc2089", "score": "0.51798874", "text": "function btnincre() {}", "title": "" }, { "docid": "88a045888f052a6dd56a95db09036e4c", "score": "0.5177689", "text": "handleButtonPerformChecks() {\n this.openPerformChecksModalEditor();\n }", "title": "" }, { "docid": "bcc2401cb52f333162a47e476013df32", "score": "0.51718974", "text": "function onComplete(){\n\t\t//console.log('Ladowanie plikow zakonczone');\n\t}", "title": "" }, { "docid": "9763d77eea4391a427f1d8dfd7afc926", "score": "0.5168601", "text": "function remove_upload(func) {\n\n\tvar new_event_string = '';\n\tnew_event_string += '<label for=\"'+func+'-image\">';\n new_event_string += '<input type=\"file\" name = \"image\" id= \"'+func+'-image\" accept= \".csv\" class= \"file_upload\" style=\"display:none;\" onchange=\"check_file(\\''+func+'\\')\">';\n new_event_string += '<img src= \"/static/images/upload icon.png\" alt=\"upload pic\" style=\"\">';\n new_event_string += '</label>';\n $(\"#\"+func+\"-upload\").html(new_event_string);\n $(\"#\"+func+\"-up_vol\").html(\"Upload Volunteer Profiles\");\n}", "title": "" }, { "docid": "006afdbae393db1bbaabfca14ae90442", "score": "0.5158108", "text": "function cancelButton(){\nunHide(\"movie-list-container\");\n reHide(\"delete-form\");\n unHide(\"new-movie-form\");\n unHide(\"delete-a-movie\");\n unHide(\"edit-button\");\nreHide(\"cancel-button\");\nreHide(\"edit-form\");\nreHide(\"edit-submit-form\");\nreHide(\"edit-another\");\ndisableButton(\"confirm-edit-button\");\ndisableButton(\"edit-this-movie\");\ndisableButton(\"delete-this-movie\");\n changeHelloAgain()\n}", "title": "" }, { "docid": "371b3b76aeaf14292daa840bac38f61d", "score": "0.5157742", "text": "function onAllImportFailure() {\n hidePleaseWait();\n alert(\"Sorry, couldn't import products from the file.\\nIt is possible the file is invalid or empty.\");\n location.reload();\n}", "title": "" }, { "docid": "9cd6a116d7e7013cc2e9d2bb2442290f", "score": "0.5155825", "text": "function cardClienteAdicionarBtnAction() {\n //BTN CLOSE PRINCIPAL\n $('#cardClienteAdicionarBtnBack').on('click', function () {\n $(this).blur();\n controllerCardClienteAdicionarAnimation.setCloseAnimation();\n });\n $('#cardClienteAdicionarBtnSubmit').on('click', async function () {\n $(this).blur();\n if (!$('#cardClienteAdicionarForm').valid()) {\n if ($('#cardClienteAdicionarPanelGeral').find('.error').length) {\n $('#cardClienteAdicionarTabGeral').click();\n } else if ($('#cardClienteAdicionarPanelEndereco').find('.error').length) {\n $('#cardClienteAdicionarTabEndereco').click();\n }\n toastr.error('Corrija os erros de validação do formulário', 'Operação Negada', {'showMethod': 'slideDown', 'hideMethod': 'fadeOut', 'positionClass': 'toast-bottom-right', timeOut: '2000'});\n controllerCardClienteAdicionarAnimation.setErrorAnimation();\n return false;\n }\n //SUBMIT\n await setCardClienteAdicionarSubmit();\n });\n $('#cardClienteAdicionarEnderecoBtn').on('click', function () {\n controllerCardClienteAdicionar.setPesquisarCep();\n });\n}", "title": "" }, { "docid": "959437644ae6c387c4fcf9c768c4c350", "score": "0.5152032", "text": "_handleSuccessMsg() {\n this._notificationSuccess.text = 'Seu download está pronto...';\n }", "title": "" }, { "docid": "e2ae9add91f2ad27b23bf4b71a751a50", "score": "0.51507556", "text": "function toggleButtons() {\n \t\tdocument.getElementById('fileName').classList.toggle('hide');\n\t\tdocument.getElementById('btnUpload').classList.toggle('hide');\n\t\tdocument.getElementById('btnCancel').classList.toggle('hide');\n \t}", "title": "" }, { "docid": "34089af8aadc79b76269419cdfa2719d", "score": "0.5146625", "text": "function onConfirm(button) {\r\n if(button == 2) {\r\n window.plugins.inAppPurchaseManager.restoreCompletedTransactions();\r\n // $('#popupPadded h2').addClass('loader');\r\n }\r\n }", "title": "" }, { "docid": "56ad6ddf8ad15e61639e5b504466be5e", "score": "0.5146435", "text": "function old_changelist_batch_success(response_text) {\n var $dialog = $('<div id=\"confirmation-wrapper\">');\n $dialog.html(response_text).find('.cancel').click(function() {\n $dialog.remove();\n $('#content').show();\n });\n $('#content').hide().before($dialog);\n}", "title": "" }, { "docid": "f73dda5cbb2ab52344789029e7f6d4f0", "score": "0.5143825", "text": "function cancelDeleteTask(event) {\n cancelDelete.classList.remove('show-cancel-delete');\n cancelingTask.style.display = 'block';\n}", "title": "" }, { "docid": "95b2fa5385f962a6910962720dde6139", "score": "0.5135662", "text": "get fileUploadButton() { return $(\"\"); }", "title": "" }, { "docid": "52c7e569889a7c334d9938b05a011b53", "score": "0.5131936", "text": "function clickedButton(e) {\n // WHEN DONE:\n if (listOfIds.length !== 0) {\n // each calibration button is popped out of the list one-by-one.\n // it is set to fade in.\n $('#' + listOfIds.pop()).show();\n } else {\n if (!dataIsSent) {\n activity.stopCollectingGazerData();\n }\n showVideoPage();\n }\n\n //hide progress after click\n $('#cal-progress').hide();\n }", "title": "" }, { "docid": "7945b6eb648469141c0a76d3028f89c6", "score": "0.51316446", "text": "function showButtonRegister(rowNumber){\n let tabla = document.getElementById('tablaEventos');\n // Inscription button\n let btn1 = tabla.rows.item(rowNumber).cells[3].childNodes[0].childNodes[0];\n // Download button\n let btn2 = tabla.rows.item(rowNumber).cells[4].childNodes[0];\n // Change inscription button with register button\n btn1.innerHTML = \"Registrar\";\n btn1.href = \"../Registro/registro.html\"\n // Hide download button\n btn2.style.display = \"none\";\n}", "title": "" }, { "docid": "d277e3ce4d5b84d5b2bd4e8e3afac5c0", "score": "0.5130223", "text": "function esconderMsjAniadirCarrito(){\n \n mensajeAniadidoCarrito.style.display=\"none\";\n\n\n for (btns of btn){\n\n btns.disabled=false;\n btns.textContent=`AÑADIR `;\n const iconoAniadir = document.createElement('i');\n iconoAniadir.classList.add(\"fas\");\n iconoAniadir.classList.add(\"fa-cart-plus\");\n iconoAniadir.classList.add(\"iconoAniadirCarrito\");\n btns.appendChild(iconoAniadir);\n\n \n }\n\n \n\n \n mensajeAniadidoCarrito.innerHTML=\"\";\n \n\n }", "title": "" }, { "docid": "3d24a875d71a57e3194e1cd9d0038ef9", "score": "0.5129721", "text": "function rename() {\r\n\t\tdocument.getElementById(\"fileName\").style.display = \"initial\";\r\n\t\tdocument.getElementById(\"confirm\").style.display = \"initial\";\r\n\t\tdocument.getElementById(\"back\").style.display = \"initial\";\r\n\t\tdocument.getElementById(\"fileName\").value = \"\";\r\n\t}", "title": "" }, { "docid": "40b8c3813573bf4c1cf990077bd390e0", "score": "0.5128476", "text": "function terminarPartida(){\n if(fichasMarcadas === sumaAciertoActual){\n btnConfirmar.disabled = true;\n }\n}", "title": "" }, { "docid": "cc519271306ea3aee63b71f82aca864c", "score": "0.5127398", "text": "_reset(){const that=this;if(this.element.value){// This discombulated line is to help the i18next parser pick up all 3 keys.\nconst item=this.props.type==='signature'?t('drawwidget.signature'):this.props.type==='drawing'?t('drawwidget.drawing'):t('drawwidget.annotation');gui.confirm(t('filepicker.resetWarning',{item})).then(confirmed=>{if(!confirmed){return;}that.pad.clear();that.cache=null;// Only upon reset is loadedFileName removed, so that \"undo\" will work\n// for drawings loaded from storage.\ndelete that.element.dataset.loadedFileName;delete that.element.dataset.loadedUrl;that.element.dataset.filenamePostfix='';jquery(that.element).val('').trigger('change');// Annotate file input\nthat.$widget.find('input[type=file]').val('').trigger('change');that._updateDownloadLink('');that.disable();that.enable();});}}", "title": "" } ]
528e9caab6f0f4d631cc03ca510d8907
Get bottom neighbor for node at position (r, c)
[ { "docid": "74b5974c53c62a9049659e9229474a2b", "score": "0.76154304", "text": "getBottomNode(r, c) {\n if (r < this.numberOfRows - 1)\n return this.getNode(r + 1, c);\n return null;\n }", "title": "" } ]
[ { "docid": "625f67bc02e0dedef08c20bc7fdb5921", "score": "0.8594921", "text": "getBottomNeighborOfNode(r, c) {\n if (r < this.numberOfRows - 1)\n return this.getNode(r + 1, c).isWall ? null : this.getNode(r + 1, c);\n return null;\n }", "title": "" }, { "docid": "c75adc5e60c4016ef349abea94a3a8c1", "score": "0.74962854", "text": "getTopNeighborOfNode(r, c) {\n if (r > 0)\n return this.getNode(r - 1, c).isWall ? null : this.getNode(r - 1, c);\n return null;\n }", "title": "" }, { "docid": "eeefedb49160381724f36d37de02bc3a", "score": "0.6935424", "text": "getRightNeighborOfNode(r, c) {\n if (c < this.numberOfColumns - 1)\n return this.getNode(r, c + 1).isWall ? null : this.getNode(r, c + 1);\n return null;\n }", "title": "" }, { "docid": "28327edd61039af5257f95bfe5dba53c", "score": "0.6706799", "text": "function getBottomNeighbor(existingTile) {\n if (!existingTile.isTile) {return;}\n if (!existingTile.parent.isTile) {return;}\n\n var currentTile = existingTile;\n\n // Climb up\n while (!currentTile.isTop&& currentTile.parent.isTile)\n {\n currentTile = currentTile.parent\n }\n // There is nothing to the right\n if (!currentTile.isTop) {return existingTile; }\n\n // Climb down, while staying as far left and up as possible\n currentTile = currentTile.sibling\n while (currentTile.isSplitVertically || currentTile.isSplitHorizontally)\n {\n // Take the upper child\n if (currentTile.isSplitVertically) { currentTile = currentTile.firstChild }\n // Take the left child\n else { currentTile = currentTile.firstChild }\n\n }\n return currentTile\n}", "title": "" }, { "docid": "ac9c5d82d19826cc968677f23caba0d2", "score": "0.662823", "text": "getNeighborsForNode(r, c) {\n return [this.getTopNeighborOfNode(r, c), this.getRightNeighborOfNode(r, c), this.getBottomNeighborOfNode(r, c), this.getLeftNeighborOfNode(r, c)];\n }", "title": "" }, { "docid": "d44d4f75e81be766a364d9666aafc64f", "score": "0.64891464", "text": "getNeighbor(dx, dy){\r\n return getTile(this.x + dx, this.y + dy)\r\n }", "title": "" }, { "docid": "844187c4d4b52c7d2b806e9c48482267", "score": "0.622836", "text": "function getNeighbors(r, c, s) {\n neighbors = [];\n var R = parseInt(r);\n var C = parseInt(c);\n\n if (R>0) {\n neighbors.push({row: R-1, col: C});\n // neighbors.push({row: r-1, col: c+1});\n if (c>0) {\n neighbors.push({row: R, col: C-1});\n neighbors.push({row: R-1, col: C-1});\n }\n if (c < s-1) {\n neighbors.push({row: R, col: C+1});\n neighbors.push({row: R-1, col: C+1});\n }\n } else {\n if (c>0) {\n neighbors.push({row: R, col: C-1});\n }\n if (c < s-1) {\n neighbors.push({row: R, col: C+1});\n }\n }\n\n if (r < s-1 ) {\n neighbors.push({row: R+1, col:C});\n\n if (c>0) {\n neighbors.push({row: R+1, col: C-1});\n }\n if (c < s-1) {\n neighbors.push({row: R+1, col: C+1});\n }\n }\n\n return neighbors;\n }", "title": "" }, { "docid": "2f7517e20927a537f85c9343d2d02b6b", "score": "0.617883", "text": "function heyNeighbor(row, col, lastRow, lastCol) {\n let nw = [row - 1, col - 1],\n n = [row - 1, col],\n ne = [row - 1, col + 1],\n e = [row, col + 1],\n w = [row, col - 1],\n sw = [row + 1, col - 1],\n s = [row + 1, col],\n se = [row + 1, col + 1];\n\n // Handle top and bottom edge neighbors\n if (row === 0) {\n // Handle northwest and northeast corner cells\n switch (col) {\n case 0: // Northwest corner cell\n nw = [lastRow, lastCol];\n ne = [lastRow, col + 1];\n break;\n case lastCol: // Northeast corner cell\n nw = [lastRow, col - 1];\n ne = [lastRow, 0];\n break;\n default:\n // Everybody else\n nw = [lastRow, col - 1];\n ne = [lastRow, col + 1];\n break;\n }\n\n n = [lastRow, col];\n } else if (row === lastRow) {\n //Handle southwest and southeast corner cells\n switch (col) {\n case 0: // Southwest corner cell\n sw = [0, lastCol];\n se = [0, col + 1];\n break;\n case lastCol: // Southeast corner cell\n sw = [0, col - 1];\n se = [0, 0];\n break;\n default:\n // Everybody else\n sw = [0, col - 1];\n se = [0, col + 1];\n break;\n }\n\n s = [0, col];\n }\n\n // Handle left and right edge neighbors\n if (col === 0) {\n // Handle northwest and southwest corner cells\n switch (row) {\n case 0: // Northwest corner cell\n sw = [row + 1, lastCol];\n break;\n case lastRow: // Southwest corner cell\n nw = [row - 1, lastCol];\n break;\n default:\n // Everybody else\n sw = [row + 1, lastCol];\n nw = [row - 1, lastCol];\n break;\n }\n\n w = [row, lastCol];\n } else if (col === lastCol) {\n // Handle northeast and southeast corner cells\n switch (row) {\n case 0: // Northeast corner cell\n se = [row + 1, 0];\n break;\n case lastRow: // Southeast corner cell\n ne = [row - 1, 0];\n break;\n default:\n // Everybody else\n se = [row + 1, 0];\n ne = [row - 1, 0];\n break;\n }\n\n e = [row, 0];\n }\n\n return [nw, n, ne, e, w, sw, s, se];\n}", "title": "" }, { "docid": "d4e1f19e2c900c83fe993d7605c74937", "score": "0.61134595", "text": "function nextNeighbor(elt, dir) {\n var drow = 0, dcol = 0;\n if (dir == \"none\") {\n return null;\n } else {\n var offset = directions[dir];\n return {r: elt.r + offset[0], c: elt.c + offset[1]};\n }\n }", "title": "" }, { "docid": "fb66486492b4e5be9693f3ddcc05babf", "score": "0.60743386", "text": "getTopNode(r, c) {\n if (r > 0)\n return this.getNode(r - 1, c);\n return null;\n }", "title": "" }, { "docid": "1601586e070d734303d10c4dca8b7b66", "score": "0.60686713", "text": "getNeighborTileLoc(row, col, direction) {\n return {row: row + direction.r, col: col + direction.c};\n }", "title": "" }, { "docid": "7c9cd359fadd52579e0f6700426e777d", "score": "0.6001263", "text": "findNeighbors(node) {\n const neighbors = [];\n // above\n if (node.y - 1 >= 0) {\n neighbors.push([this.nodes[`${node.x},${node.y - 1}`], \"above\"]);\n }\n\n // right\n if (node.x + 1 < this.width) {\n neighbors.push([this.nodes[`${node.x + 1},${node.y}`], \"right\"]);\n }\n\n // below\n if (node.y + 1 < this.length) {\n neighbors.push([this.nodes[`${node.x},${node.y + 1}`], \"below\"]);\n }\n\n // left\n if (node.x - 1 >= 0) {\n neighbors.push([this.nodes[`${node.x - 1},${node.y}`], \"left\"]);\n }\n return neighbors;\n }", "title": "" }, { "docid": "02fd853a2ce00053184d3734ad0024a6", "score": "0.59885436", "text": "getLeftNeighborOfNode(r, c) {\n if (c > 0)\n return this.getNode(r, c - 1).isWall ? null : this.getNode(r, c - 1);\n return null;\n }", "title": "" }, { "docid": "3a9d39ff0386c6bdfdb84b92fc244789", "score": "0.59883046", "text": "neighbors (x, y) {\n let neighbors = []\n if (this.map[x - 1] && this.map[x - 1][y]) {\n neighbors.push(this.map[x - 1][y]) // left\n }\n if (this.map[x + 1] && this.map[x + 1][y]) {\n neighbors.push(this.map[x + 1][y]) // right\n }\n if (this.map[x][y - 1]) {\n neighbors.push(this.map[x][y - 1]) // top\n }\n if (this.map[x][y + 1]) {\n neighbors.push(this.map[x][y + 1]) // bottom\n }\n if (this.map[x - 1] && this.map[x - 1][y - 1]) {\n neighbors.push(this.map[x - 1][y - 1]) // top-left\n }\n if (this.map[x - 1] && this.map[x - 1][y + 1]) {\n neighbors.push(this.map[x - 1][y + 1]) // bottom-left\n }\n if (this.map[x + 1] && this.map[x + 1][y + 1]) {\n neighbors.push(this.map[x + 1][y + 1]) // top-right\n }\n if (this.map[x + 1] && this.map[x + 1][y - 1]) {\n neighbors.push(this.map[x + 1][y - 1]) // bottom-right\n }\n return neighbors\n }", "title": "" }, { "docid": "93102e1f89ead171be628295e15a1897", "score": "0.594103", "text": "function getNeighbours(node) {\r\n var parent = node.parentNode,\r\n data = DataGraphics.getData(node);\r\n\r\n return {\r\n prev: data.prev ? DataPointUtils.find(parent, data.prev) : undefined,\r\n next: data.next ? DataPointUtils.find(parent, data.next) : undefined\r\n };\r\n }", "title": "" }, { "docid": "f2361906c9d9b2ac0a9967527c8bfbe2", "score": "0.5917364", "text": "function get_neighbours(grid,r,c){\n var n = new Array();\n var l = grid.length;\n for (let i = 0; i < neighbour_delta.length; i++){\n var new_r = r + neighbour_delta[i][0];\n var new_c = c + neighbour_delta[i][1];\n\n if ((new_r >= l) || (new_c >= l) || (new_r < 0) || (new_c < 0)){\n continue;\n }\n n.push([new_r,new_c]);\n }\n return n;\n}", "title": "" }, { "docid": "7de9dbbf33b2d1e941486f1efdeaed1f", "score": "0.59074086", "text": "bottom(x, y) {\r\n if (!this.matrix[x][y].length) return null;\r\n return this.matrix[x][y][0];\r\n }", "title": "" }, { "docid": "211ff1555c8057d60ea90cf090b0ac35", "score": "0.58642906", "text": "function getTopNeighbor(existingTile) {\n if (!existingTile.isTile) {return;}\n if (!existingTile.parent.isTile) {return;}\n\n var currentTile = existingTile;\n\n // Climb up\n while (!currentTile.isBottom && currentTile.parent.isTile)\n {\n currentTile = currentTile.parent\n }\n // There is nothing to the right\n if (!currentTile.isBottom) {return existingTile; }\n\n // Climb down, while staying as far left and down as possible\n currentTile = currentTile.sibling\n while (currentTile.isSplitVertically || currentTile.isSplitHorizontally)\n {\n // Take the bottom child\n if (currentTile.isSplitVertically) { currentTile = currentTile.secondChild }\n // Take the left child\n else { currentTile = currentTile.firstChild }\n\n }\n return currentTile\n}", "title": "" }, { "docid": "583d600253e1fd8a1a54ce143db042de", "score": "0.58213365", "text": "function getNeighbourCell(position, direction) {\n switch (direction) {\n case 'up': return position < width ? position + (width * (width - 1)) : position - width\n case 'right': return (position - (width - 1 )) % width === 0 ? position - (width - 1) : position + 1\n case 'down': return position > (width * (width - 1)) - 1 ? position - (width * (width - 1)) : position + width\n case 'left' : return position % width === 0 ? position + (width - 1) : position - 1\n }\n }", "title": "" }, { "docid": "419af9949b703024cfb5071ba1c624c4", "score": "0.57742083", "text": "getRightNode(r, c) {\n if (c < this.numberOfColumns - 1)\n return this.getNode(r, c + 1);\n return null;\n }", "title": "" }, { "docid": "de572be04e8ce599abeca89aa2bc7d37", "score": "0.5703637", "text": "function neighboring(a, b) {\n\t\treturn linkedByIndex[a.index + \",\" + b.index];\n\t}", "title": "" }, { "docid": "91473148c7f339b89321997cb4cbad9f", "score": "0.57017237", "text": "function findCell(r, c)\n{\n // In edge cases:\n if(r < 1 || r > 3 || c < 1 || c > 3) // If the row is outside of range:\n {\n return undefined;\n } // Else\n var tableRow = table.childNodes[r];\n var tableCell = tableRow.childNodes[c-1];\n return tableCell;\n}", "title": "" }, { "docid": "cab5264a0540c3308de08a3451a09ad5", "score": "0.5690452", "text": "function neighboring(a, b) {\r\n return linkedByIndex[a.index + \",\" + b.index];\r\n}", "title": "" }, { "docid": "c2c7b2020987b17b85c74ff1d67669af", "score": "0.5680981", "text": "function getRightNeighbor(existingTile) {\n if (!existingTile.isTile) {return;}\n if (!existingTile.parent.isTile) {return;}\n\n var currentTile = existingTile;\n\n // Climb up\n while (!currentTile.isLeft && currentTile.parent.isTile)\n {\n currentTile = currentTile.parent\n }\n // There is nothing to the right\n if (!currentTile.isLeft) {return existingTile; }\n\n // Climb down, while staying as far left and up as possible\n currentTile = currentTile.sibling\n while (currentTile.isSplitVertically || currentTile.isSplitHorizontally)\n {\n currentTile = currentTile.firstChild\n }\n return currentTile\n\n}", "title": "" }, { "docid": "dd53608ffdfb22357d2dc1105a3f47b4", "score": "0.5672427", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "title": "" }, { "docid": "7eb2278d6dbea3e4a3c7140e327b93e9", "score": "0.56719726", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n}", "title": "" }, { "docid": "4a375c776fe6952b63dd1f1ec30cd8b7", "score": "0.56635433", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n}", "title": "" }, { "docid": "97648fc667bbb9b1ca2858306c4e63fd", "score": "0.56609225", "text": "function neighboring(a, b) {\n\n return linkedByIndex[a.index + \",\" + b.index];\n }", "title": "" }, { "docid": "ddf06a134a368dbb38cc89112558eb0f", "score": "0.5637637", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "title": "" }, { "docid": "9d023cbd930f33e0bf86f0398a25f2ab", "score": "0.5630265", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "title": "" }, { "docid": "cf249a9f83a6d2e105bb06865cbf85e6", "score": "0.56226444", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + ',' + b.index];\n }", "title": "" }, { "docid": "5c91a5e16f67582cd7dba41b55daafc6", "score": "0.5592509", "text": "function neighboring(a, b) {\r\n return linkedByIndex[a.index + \",\" + b.index];\r\n }", "title": "" }, { "docid": "598b6fb17c67046e29e3a2c0b2b20399", "score": "0.5579532", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "title": "" }, { "docid": "598b6fb17c67046e29e3a2c0b2b20399", "score": "0.5579532", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "title": "" }, { "docid": "c6ed7a39582961ff9ecdf1c8b6920f72", "score": "0.55538356", "text": "function get(r,c) {\n if (r in maze) {\n return maze[r][c];\n } \n return undefined;\n }", "title": "" }, { "docid": "4bcc55b422ef5988220e5fd65de98ad3", "score": "0.55411386", "text": "function chekBottom(colIndex){\n var colorReport = returnColor(5,colIndex); //starting from index 5(last row)\n for (var row = 5; row > -1; row--) {\n colorReport = returnColor(row,colIndex);\n if (colorReport === 'rgb(128, 128, 128)') {\n return row;\n } \n }\n}", "title": "" }, { "docid": "04fdf841e219594f76ed68465293acf5", "score": "0.5532267", "text": "function getHeuristicDistance(node, endNode) {\n const { row, col } = node;\n const neighborHDistance =\n Math.abs(node.row - endNode.row) + Math.abs(node.col - endNode.col);\n\n return neighborHDistance;\n}", "title": "" }, { "docid": "e357f039db77a8880ebf074063454624", "score": "0.55180687", "text": "function neighbor ([x, y]) {\n return [[x, y - 1], [x + 1, y], [x, y + 1], [x - 1, y]].filter(isAvailable)\n}", "title": "" }, { "docid": "344674d8eaf48f4a9a3049c7d6c0003d", "score": "0.55171156", "text": "function getNeighbors(p) {\n let y = Math.floor(p / width);\n let x = p - y * width;\n\n return [-1, 0, 1].reduce((a, yo) => {\n return a.concat(\n [-1, 0, 1].reduce((ra, xo) => {\n let xs = x + xo, ys = y + yo;\n if ((x !== xs || y !== ys) && checkBounds(xs, ys))\n ra.push(xs + width * ys);\n return ra;\n }, [])\n );\n }, []);\n\n function checkBounds(x, y) {\n return x >= 0 && y >= 0 && x < width && y < height;\n }\n }", "title": "" }, { "docid": "4c8eaa9edfcfd5ce57d7c390ef18440a", "score": "0.5504192", "text": "getNode(r, c) {\n return this.nodes[r][c];\n }", "title": "" }, { "docid": "e5a042a960679e3813d4bd9228799f0d", "score": "0.550218", "text": "_setCellNeighbors() {\n for (let row of this.rows) {\n for (let cell of row.cells) {\n const cellCoordX = cell.coordinateX;\n const cellCoordY = cell.coordinateY;\n // Northern neighbors (if there is a row above)\n if (cellCoordY - 1 >= 0) {\n const northernRow = this.rows[cellCoordY - 1];\n // NORTHWESTERN NEIGHBOR (upleft)\n if (cellCoordX - 1 >= 0) {\n cell.neighbors.push(northernRow.cells[cellCoordX - 1]);\n }\n // NORTHERN NEIGHBOR (up, there is always a neighbor above)\n cell.neighbors.push(northernRow.cells[cellCoordX]);\n // NORTHEASTERN NEIGHBOR (upright)\n if (cellCoordX + 1 <= northernRow.width - 1) {\n cell.neighbors.push(northernRow.cells[cellCoordX + 1]);\n }\n }\n // EASTERN NEIGHBOR (right)\n if (cellCoordX + 1 <= this.width - 1) {\n cell.neighbors.push(row.cells[cellCoordX + 1]);\n }\n // Southern neighbors (if there is a row below)\n if (cellCoordY + 1 <= this.height - 1) {\n const southernRow = this.rows[cellCoordY + 1];\n // SOUTHEASTERN NEIGHBOR (downright)\n if (cellCoordX + 1 <= southernRow.width - 1) {\n cell.neighbors.push(southernRow.cells[cellCoordX + 1]);\n }\n // SOUTHERN NEIGHBOR (down, there is always a neighbor below)\n cell.neighbors.push(southernRow.cells[cellCoordX]);\n // SOUTHWESTERN NEIGHBOR (downleft)\n if (cellCoordX - 1 >= 0) {\n cell.neighbors.push(southernRow.cells[cellCoordX - 1]);\n }\n }\n // WESTERN NEIGHBOR (left)\n if (cellCoordX - 1 >= 0) {\n cell.neighbors.push(row.cells[cellCoordX - 1]);\n }\n }\n }\n }", "title": "" }, { "docid": "5d9de9c3f573353c5292cf2e44b3829b", "score": "0.5486054", "text": "function neighboring(a, b) {\r\n console.log(a, b);\r\n console.log(adjTable[a.index + \",\" + b.index]);\r\n return adjTable[a.index + \",\" + b.index];\r\n }", "title": "" }, { "docid": "bee13d7d342d72287a721845a69a497e", "score": "0.5478439", "text": "function getCell(m, c) {\n try {\n var maze = getMaze(m);\n return maze.cells['cell'+c];\n }\n catch(ex) {\n return undefined;\n }\n}", "title": "" }, { "docid": "6e4c8f0f4298f3c87e4f19d0d6001996", "score": "0.54755735", "text": "function getTopToBottom(grid, n, c, r) {\n if (r > grid.length - n) throw 'Invalid row: ' + n + ' rows not available'\n\n var arr = [];\n for (var i = 0; i < n; i++) {\n arr.push(grid[r + i][c]);\n }\n return arr;\n}", "title": "" }, { "docid": "53f399b60dd89d9c94cad7461c849ed4", "score": "0.5439243", "text": "function neighborsOf(board,a,b){ //This function, given 3 inputs: board, a (board \"row\") and b (board \"column\") will return a list of neighboring cells surrounding var board.\n\n//cells are returned in order of left to right, starting from top left working down each row\n if (a === 0 && b=== 0){\n neighbors = [board[0][1], board[1][0], board[1][1]]};\n if (a === 0 && b=== 1){\n neighbors = [board[0][0], board[0][2], board[1][0], board[1][1], board[1][2]]};\n if (a === 0 && b=== 2){\n neighbors = [board[0][1], board[1][1], board[1][2]]};\n if (a === 1 && b=== 0){\n neighbors = [board[0][0], board[0][1], board[1][1], board[2][0], board[2][1]]};\n if (a === 1 && b=== 1){\n neighbors = [board[0][0], board[0][1], board[0][2], board[1][0], board[1][2], board[2][0], board[2][1], board[2][2]]};\n if (a === 1 && b=== 2){\n neighbors = [board[0][1], board[0][2], board[1][1], board[2][1], board[2][2]]};\n if (a === 2 && b=== 0){\n neighbors = [board[1][0], board[1][1], board[2][1]]};\n if (a === 2 && b=== 1){\n neighbors = [board[1][0], board[1][1], board[1][2], board[2][0], board[2][2]]};\n if (a === 2 && b=== 2){\n neighbors = [board[1][1], board[1][2], board[2][1]]};\n\n return neighbors;\n}", "title": "" }, { "docid": "b96a9fda15bec3584d3e6f7ee7efe50b", "score": "0.5431591", "text": "function getNeighbor(current_cell_index, direction) {\n\n var new_cell_index;\n \n var temp = current_cell_index.split(\"x\");\n var row = Number(temp[0]);\n var col = Number(temp[1]);\n \n switch (direction) {\n case DIRECTION.N: // North\n {\n\t\t\t\tif ((row-1) >= 0 && (row-1) < maze_index.length) {\n\t\t\t\t\tif (col >= 0 && col < maze_index[0].length) {\n\t\t if (!visited_list.includes(maze_index[row-1][col])) {\n\t\t new_cell_index = maze_index[row-1][col];\n\t\t visited_list.push(new_cell_index);\n\t\t return new_cell_index;\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnew_cell_index = \"-1x-1\";\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\tnew_cell_index = \"-1x-1\";\n\t\t\t\t\t}\n } \n else { \n new_cell_index = \"-1x-1\";\n }\n return new_cell_index;\n break;\n }\n case DIRECTION.S: // South\n {\n\t\t\t\tif ((row+1) >= 0 && (row+1) < maze_index.length) {\n\t\t\t\t\tif (col >= 0 && col < maze_index[0].length) {\n\t\t if (!(visited_list.includes(maze_index[row+1][col]))) {\n\t\t new_cell_index = maze_index[row+1][col];\n\t\t\t\t\t\t\tvisited_list.push(new_cell_index);\n\t\t return new_cell_index;\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnew_cell_index = \"-1x-1\";\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\tnew_cell_index = \"-1x-1\";\n\t\t\t\t\t}\n } \n else { \n new_cell_index = \"-1x-1\";\n }\n return new_cell_index;\n break;\n }\n case DIRECTION.E: // East\n {\n\t\t\t\tif (row >= 0 && row < maze_index.length) {\n\t\t\t\t\tif ((col+1) >= 0 && (col+1) < maze_index[0].length) {\n\t\t if (!visited_list.includes(maze_index[row][col+1])) {\n\t\t new_cell_index = maze_index[row][col+1];\n\t\t visited_list.push(new_cell_index);\n\t\t return new_cell_index;\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnew_cell_index = \"-1x-1\";\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\tnew_cell_index = \"-1x-1\";\n\t\t\t\t\t}\n } \n else { \n new_cell_index = \"-1x-1\";\n }\n return new_cell_index;\n break;\n }\n case DIRECTION.W: // West\n {\n\t\t\t\tif (row >= 0 && row < maze_index.length) {\n\t\t\t\t\tif ((col-1) >= 0 && (col-1) < maze_index[0].length) {\n\t\t if (!visited_list.includes(maze_index[row][col-1])) {\n\t\t new_cell_index = maze_index[row][col-1];\n\t\t visited_list.push(new_cell_index);\n\t\t return new_cell_index;\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnew_cell_index = \"-1x-1\";\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\tnew_cell_index = \"-1x-1\";\n\t\t\t\t\t}\n } \n else { \n new_cell_index = \"-1x-1\";\n }\n return new_cell_index; \n break;\n }\n default: // Invalid input\n {\n new_cell_index = \"-1x-1\";\n }\n return new_cell_index;\n }\n\n}", "title": "" }, { "docid": "29a4c9fb8c154e42ed84166e67e3fa20", "score": "0.5420193", "text": "getNeighbors(cell) {\n var neighbors = new ArrayList();\n\n var s1 = this.getCell(cell.x, cell.y-1);\n var s2 = this.getCell(cell.x-1, cell.y);\n var s3 = this.getCell(cell.x+1, cell.y);\n var s4 = this.getCell(cell.x, cell.y+1);\n neighbors.add(s1);\n neighbors.add(s2);\n neighbors.add(s3);\n neighbors.add(s4);\n\n // Only consider diagonal neighbors that are not blocked on the straight sides\n if (s1 && s1.traversable && s2 && s2.traversable) {\n var d1 = this.getCell(cell.x-1, cell.y-1);\n neighbors.add(d1);\n }\n if (s1 && s1.traversable && s3 && s3.traversable) {\n var d2 = this.getCell(cell.x+1, cell.y-1);\n neighbors.add(d2);\n }\n if (s2 && s2.traversable && s4 && s4.traversable) {\n var d3 = this.getCell(cell.x-1, cell.y+1);\n neighbors.add(d3);\n }\n if (s3 && s3.traversable && s4 && s4.traversable) {\n var d4 = this.getCell(cell.x+1, cell.y+1);\n neighbors.add(d4);\n }\n\n // Removed any instances of undefined\n neighbors.remove(undefined);\n\n return neighbors;\n }", "title": "" }, { "docid": "a613953971435bdb1117ef9c5ab44ccf", "score": "0.5411385", "text": "bottom(row, cell, sprite) {\n return {\n row,\n cell,\n x: (cell * this.x) - sprite.width,\n y: ((row * this.y) + this.y) - sprite.height\n }\n }", "title": "" }, { "docid": "3b246b3932969f646b761178306281ee", "score": "0.54068494", "text": "function neighboring1(a, b) {\n return linkedByIndex1[a.id + \",\" + b.id];\n}", "title": "" }, { "docid": "610bf186900c092b530d355b5bdd3b0c", "score": "0.5399503", "text": "getNeighbors(x, y) {\n const neighbors = [];\n if (this.nodeCache[x] && this.nodeCache[x][y + 1]) {\n neighbors.push(this.nodeCache[x][y + 1]);\n }\n\n if (this.nodeCache[x + 1] && this.nodeCache[x + 1][y]) {\n neighbors.push(this.nodeCache[x + 1][y]);\n }\n\n if (this.nodeCache[x - 1] && this.nodeCache[x - 1][y]) {\n neighbors.push(this.nodeCache[x - 1][y]);\n }\n\n if (this.nodeCache[x] && this.nodeCache[x][y - 1]) {\n neighbors.push(this.nodeCache[x][y - 1]);\n }\n\n return neighbors;\n }", "title": "" }, { "docid": "f75d18dee76904fc48962caa3de345b4", "score": "0.5397214", "text": "checkNeighbors() {\n\t\tconst neighbors = [];\n\n\t\tfunction neighborsExists(neighbor) {\n\t\t\tif (neighbor && !neighbor.visited) neighbors.push(neighbor);\n\t\t}\n\n\t\tconst top = this.container.array[index(this.colId, this.rowId - 1, this.container)];\n\t\tconst right = this.container.array[index(this.colId + 1, this.rowId, this.container)];\n\t\tconst bottom = this.container.array[index(this.colId, this.rowId + 1, this.container)];\n\t\tconst left = this.container.array[index(this.colId - 1, this.rowId, this.container)];\n\n\t\t// check existence of neighbor cells\n\t\tneighborsExists(top);\n\t\tneighborsExists(right);\n\t\tneighborsExists(bottom);\n\t\tneighborsExists(left);\n\n\t\t// neighbor cell random selection from the existing neighbors array\n\t\tif (neighbors.length > 0) {\n\t\t\tconst r = Math.floor(Math.random() * neighbors.length);\n\t\t\treturn neighbors[r];\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t}", "title": "" }, { "docid": "d1e9743210114e6d9f32047d65fdbdf8", "score": "0.5394844", "text": "findNeighbour(dir) {\n return this.puzzle.pieces.find(({ row, col }) => row == (this.row+dir.drow) && col == (this.col+dir.dcol));\n }", "title": "" }, { "docid": "afb7c8d0441019095022ffef90a334a5", "score": "0.5386706", "text": "function getCellBelow() {\n var row = nextElement.call(this.parentNode);\n return row ? getCell.call(row, this.getPos()[1]) : null;\n }", "title": "" }, { "docid": "afd7615bc6bdb0c825ea6c7f7c45889b", "score": "0.53838336", "text": "function getNeighbours(grid, node) {\n var ret = [];\n var x = node.row;\n var y = node.col;\n if (isSafe(x - 1, y, grid)) {\n ret.push(grid[x - 1][y]);\n }\n if (isSafe(x + 1, y, grid)) {\n ret.push(grid[x + 1][y]);\n }\n if (isSafe(x, y - 1, grid)) {\n ret.push(grid[x][y - 1]);\n }\n if (isSafe(x, y + 1, grid)) {\n ret.push(grid[x][y + 1]);\n }\n return ret;\n}", "title": "" }, { "docid": "c00551083924be7643353059ba4cce72", "score": "0.53792167", "text": "getNeighborhood(elements, n) {\n if (n == 1) {\n return elements\n .nodes()\n .edgesWith(elements.nodes())\n .union(elements.nodes());\n } else {\n return this.getNeighborhood(\n elements.union(elements.neighborhood()),\n n - 1\n );\n }\n }", "title": "" }, { "docid": "4d0ac6cc72d9ca981cec376374858934", "score": "0.53715277", "text": "function get_neighbours(x,y,visited){\n var neighbours=[];\n var index=((y-1)*no_columns)+(x-1);\n visited[x+','+y]=true;\n //top neighbour\n if(y-1>0 && !grids[index-no_columns].classList.contains('obstacle') && visited[x+','+(y-1)]===undefined){\n neighbours.push([x,(y-1)]);\n visited[x+','+(y-1)]=true;\n };\n //right neighbour\n if(x+1<=no_columns && !grids[index+1].classList.contains('obstacle') && visited[(x+1)+','+y]===undefined){\n neighbours.push([(x+1),y]);\n visited[(x+1)+','+y]=true;\n };\n //bottom neighbour\n if(y+1<=no_rows && !grids[index+no_columns].classList.contains('obstacle') && visited[x+','+(y+1)]===undefined){\n neighbours.push([x,(y+1)]);\n visited[x+','+(y+1)]=true;\n };\n //left neighbour\n if(x-1>0 && !grids[index-1].classList.contains('obstacle') && visited[(x-1)+','+y]===undefined){\n neighbours.push([(x-1),y]);\n visited[(x-1)+','+y]=true;\n };\n return neighbours;\n }", "title": "" }, { "docid": "4f3aacedc4d9db91baefc5fbac8fc659", "score": "0.5369287", "text": "function getNeighbors(world, row, col) {\n\t\tvar row1 = row - 1;\n\t\tvar row2 = row;\n\t\tvar row3 = row + 1;\n\t\tvar col1 = col - 1;\n\t\tvar col2 = col;\n\t\tvar col3 = col + 1;\n\t\t// Wrap around\n\t\tif (row1 < 0)\n\t\t\trow1 = rows - 1;\n\t\tif (row3 >= rows)\n\t\t\trow3 = 0;\n\t\tif (col1 < 0)\n\t\t\tcol1 = cols - 1;\n\t\tif (col3 >= cols)\n\t\t\tcol3 = 0;\t\n\t\tvar neighbors = world[row1][col1] + world[row1][col2] + world[row1][col3] +\n\t\t world[row2][col1] + world[row2][col3] +\n\t\t world[row3][col1] + world[row3][col2] + world[row3][col3];\n\t\treturn neighbors;\n\t}", "title": "" }, { "docid": "0ed6b514e248d27751d278e981b62920", "score": "0.5343428", "text": "function getNextColour(grid, height, width, row, col, DP, CC) {\n let origColour = grid[row][col],\n visited = Array(height)\n .fill(0)\n .map(_ => Array(width).fill(false)),\n farEdge = undefined;\n\n (function visitCell(row, col) {\n // if this cell is outside the grid, we have already visited this cell, or it is not part\n // of the current block, skip it\n if (\n row < 0 ||\n col < 0 ||\n row >= height ||\n col >= width ||\n visited[row][col] ||\n grid[row][col] != origColour\n ) {\n return;\n }\n visited[row][col] = true; // mark this cell as visited\n\n // check if we are on an edge in the direction of DP\n switch (DP) {\n // right\n case 0:\n if (col + 1 == width || grid[row][col + 1] != origColour) {\n if (\n // no edge previously found\n !farEdge ||\n // this edge is further than the previous in the direction of DP\n col + 1 > farEdge[1] ||\n // same distance in direction of DP, and further in direction of CC\n // (right => uppermost block, or left => lowermost block)\n (col + 1 == farEdge[1] &&\n ((CC && row > farEdge[0]) || (!CC && row < farEdge[0])))\n ) {\n farEdge = [row, col + 1];\n }\n }\n break;\n // down\n case 1:\n if (row + 1 == height || grid[row + 1][col] != origColour) {\n if (\n // no edge previously found\n !farEdge ||\n // this edge is further than the previous in the direction of DP\n row + 1 > farEdge[0] ||\n // same distance in direction of DP, and further in direction of CC\n // (right => leftmost block, or left => rightmost block)\n (row + 1 == farEdge[0] &&\n ((CC && col < farEdge[1]) || (!CC && col > farEdge[1])))\n ) {\n farEdge = [row + 1, col];\n }\n }\n break;\n // left\n case 2:\n if (col == 0 || grid[row][col - 1] != origColour) {\n if (\n // no edge previously found\n !farEdge ||\n // this edge is further than the previous in the direction of DP\n col - 1 < farEdge[1] ||\n // same distance in direction of DP, and further in direction of CC\n // (right => uppermost block, or left => lowermost block)\n (col - 1 == farEdge[1] &&\n ((CC && row < farEdge[0]) || (!CC && row > farEdge[0])))\n ) {\n farEdge = [row, col - 1];\n }\n }\n break;\n // up\n case 3:\n if (row == 0 || grid[row - 1][col] != origColour) {\n if (\n // no edge previously found\n !farEdge ||\n // this edge is further than the previous in the direction of DP\n row - 1 < farEdge[0] ||\n // same distance in direction of DP, and further in direction of CC\n // (right => rightmost block, or left => leftmost block)\n (row - 1 == farEdge[0] &&\n ((CC && col > farEdge[1]) || (!CC && col < farEdge[1])))\n ) {\n farEdge = [row - 1, col];\n }\n }\n break;\n }\n\n // visit neighbours\n visitCell(row, col + 1);\n visitCell(row + 1, col);\n visitCell(row, col - 1);\n visitCell(row - 1, col);\n })(row, col);\n\n return farEdge;\n}", "title": "" }, { "docid": "c376279d94a849b15c7dc9109d7e05eb", "score": "0.5336096", "text": "function right(node, n) {\n return n - 1 - node.height;\n }", "title": "" }, { "docid": "67c3d0d9b97ebadb59e5f18722667376", "score": "0.5330358", "text": "function getNeighbours(x, y) {\n var result = [];\n if(x > 0 && world[x -1][y] != undefined) {\n result.push(world[x -1][y]);\n }\n if(world[x][y + 1] != undefined) {\n result.push(world[x][y + 1]);\n }\n if(x < GRID_SIZE-1 && world[x + 1][y] != undefined) {\n result.push(world[x + 1][y]);\n }\n if(world[x][y - 1] != undefined) {\n result.push(world[x][y - 1]);\n }\n return result;\n}", "title": "" }, { "docid": "938ff54976f67a30b5643ef80de004a6", "score": "0.5322057", "text": "function findNeighbour(current){\r\n var open=new Object();\r\n var id=0;\r\n var skip=false;\r\n for(var i= current[0]-1;i<=current[0]+1;i++){\r\n for(var j= current[1]-1;j<=current[1]+1;j++) {\r\n if(i==current[0]&&j==current[1]){\r\n continue;\r\n }\r\n for(var node in closedList){\r\n if(i==closedList[node][0] && j==closedList[node][1]){\r\n skip=true;\r\n }\r\n }\r\n if(skip){\r\n skip=false;\r\n continue;\r\n }\r\n if(i>=0 && j>=0 && i<map.length && j<map[0].length){\r\n if(map[i][j]==1) {\r\n open[id] = [i, j];\r\n open[id].parent=current;\r\n ctx.fillStyle = \"green\";\r\n ctx.fillRect(hashMap[(map[i].length*i)+j][0], hashMap[(map[i].length*i)+j][1], cellsize-1, cellsize-1);\r\n ctx.fillStyle = \"#FF0000\";\r\n ctx.fillRect(hashMap[(map[source[0]].length*source[0])+source[1]][0], hashMap[(map[source[0]].length*source[0])+source[1]][1], cellsize-1, cellsize-1);\r\n ctx.fillStyle = \"blue\";\r\n ctx.fillRect(hashMap[(map[goal[0]].length*goal[0])+goal[1]][0], hashMap[(map[goal[0]].length*goal[0])+goal[1]][1], cellsize-1, cellsize-1);\r\n id++;\r\n }\r\n }\r\n }\r\n }\r\n return open;\r\n}", "title": "" }, { "docid": "1c46e31b34bba9319df331fd6516e30b", "score": "0.53157973", "text": "findNeighboors(cellX, cellY) {\n let neighboors = new Array();\n\n for (let x=-1; x<=1; x++) {\n for (let y=-1; y<=1; y++) {\n if (Math.abs(x) != Math.abs(y)) {\n let newX = (cellX-1) + x;\n let newY = (cellY-1) + y;\n if (newX >= 0 && newX < 6 && newY >= 0 && newY < 6 ) {\n neighboors.push({x:newX+1, y:newY+1});\n }\n }\n }\n }\n\n return neighboors;\n }", "title": "" }, { "docid": "0d1f5eb25c9c6360d34b4ccbeda74638", "score": "0.5311771", "text": "function findCell(cells, c) {\n var lo = 0, hi = cells.length - 1, r = -1;\n while (lo <= hi) {\n var mid = lo + hi >> 1, s = compareCells(cells[mid], c);\n if (s <= 0) {\n if (s === 0) {\n r = mid;\n }\n lo = mid + 1;\n } else if (s > 0) {\n hi = mid - 1;\n }\n }\n return r;\n }", "title": "" }, { "docid": "46e8b27dfed6b6251982c03ca587c34c", "score": "0.5308788", "text": "neighbors(i) {\n var firstRow = this.firstRow(i)\n var lastRow = this.lastRow(i)\n var firstColumn = this.firstColumn(i)\n var lastColumn = this.lastColumn(i)\n\n // if neighbors are already determined return them.\n if (this.spots[i].neighbor_blocks) {\n return this.spots[i].neighbor_blocks\n }\n\n var neighbor_blocks = []\n if (!firstRow && !firstColumn) {\n neighbor_blocks.push(i - this.width - 1)\n }\n if (!firstRow) {\n neighbor_blocks.push(i - this.width)\n }\n if (!firstRow && !lastColumn) {\n neighbor_blocks.push(i - this.width + 1)\n }\n if (!firstColumn) {\n neighbor_blocks.push(i - 1)\n }\n if (!lastColumn) {\n neighbor_blocks.push(i + 1)\n }\n if (!lastRow && !firstColumn) {\n neighbor_blocks.push(i + this.width - 1)\n }\n if (!lastRow) {\n neighbor_blocks.push(i + this.width)\n }\n if (!lastRow && !lastColumn) {\n neighbor_blocks.push(i + this.width + 1)\n }\n this.spots[i].neighbor_blocks = neighbor_blocks\n return this.spots[i].neighbor_blocks\n }", "title": "" }, { "docid": "6861f78a6658b69e47a14a790d0827b2", "score": "0.52970606", "text": "function findCell(cells, c) {\n var lo = 0\n , hi = cells.length-1\n , r = -1\n while (lo <= hi) {\n var mid = (lo + hi) >> 1\n , s = compareCells(cells[mid], c)\n if(s <= 0) {\n if(s === 0) {\n r = mid\n }\n lo = mid + 1\n } else if(s > 0) {\n hi = mid - 1\n }\n }\n return r\n }", "title": "" }, { "docid": "97c169e21dd4a926eaa96574c18826c4", "score": "0.529515", "text": "function getNeighbors(grid, node) {\n const neighbors = [];\n const { col, row } = node;\n if (row > 0) neighbors.push(grid[row - 1][col]);\n if (row < grid.length - 1) neighbors.push(grid[row + 1][col]);\n if (col > 0) neighbors.push(grid[row][col - 1]);\n if (col < grid[0].length - 1) neighbors.push(grid[row][col + 1]);\n return neighbors;\n}", "title": "" }, { "docid": "811c86780b2d61608f3f9fc1de044a63", "score": "0.529433", "text": "function checkBottom(){\n var colorReport = returnColor(5,colIndex);\n for (var row = 5; row>-1;row--){\n colorReport=returnColor(row,colIndex);\n if (colorReport==='rgb(255, 255, 255)'){\n return row;\n }\n }\n}", "title": "" }, { "docid": "7482f8c4e188d1e207d493611c8abce0", "score": "0.5288851", "text": "getEndNode() {\n for (var row = 0; row < this.numberOfRows; row++) {\n for (var column = 0; column < this.numberOfColumns; column++) {\n if (this.nodes[row][column] != null && this.nodes[row][column].isEndNode) {\n return this.nodes[row][column];\n }\n }\n }\n return null;\n }", "title": "" }, { "docid": "2c697dd6a81862381f7324c04bb0e40d", "score": "0.52886224", "text": "function getNeighbours(x, y) {\n return _.filter([ [x+1, y], [x-1, y], [x, y+1], [x, y-1] ], function(f) {\n return (f[0] >= 0 && f[0] <= 7 && f[1] >= 0 && f[1] <= 7);\n });\n}", "title": "" }, { "docid": "6df22c7f79063e8532a634ac769a37e4", "score": "0.52677536", "text": "function getNeighbors(h, w) {\n let output = [];\n let dirs = [[0, -1], [-1, -1], [-1, 0], [1, -1]]; \n for (let i = 0; i < dirs.length; i++) {\n if (grid[dirs[i][1] + h] && \n grid[dirs[i][1] + h][dirs[i][0] + w]) {\n output.push(grid[dirs[i][1] + h][dirs[i][0] + w]);\n }\n }\n return output;\n}", "title": "" }, { "docid": "f962890fd9cb6f0dbec5b7874e5b3cf1", "score": "0.5266315", "text": "function findNeighbours_dfs(node){\n let row = node.i;\n let col = node.j;\n //Left neighbour\n if(row >= 0 && col-1 >= 0){\n let left = grid[row][col-1];\n let temp = unvisited_stack.indexOf(left)\n if(temp == -1 && !left.isVisited && !left.isWall){\n left.prev = node;\n unvisited_stack.push(left);\n }\n }\n //Bottom neighbour\n if(row+1 < grid.length && col >= 0){\n let bottom = grid[row+1][col]\n let temp = unvisited_stack.indexOf(bottom);\n if(temp == -1 && !bottom.isVisited && !bottom.isWall){\n bottom.prev = node;\n unvisited_stack.push(bottom);\n }\n }\n //Right Neighbour\n if(row >= 0 && col+1 < grid[0].length){\n let right = grid[row][col+1];\n let temp = unvisited_stack.indexOf(right)\n if(temp == -1 && !right.isVisited && !right.isWall){\n right.prev = node;\n unvisited_stack.push(right);\n }\n }\n //Top neighbour\n if(row-1 >= 0 && col < grid[0].length){\n let top = grid[row-1][col];\n let temp = unvisited_stack.indexOf(top);\n if(temp == -1 && !top.isVisited && !top.isWall){\n top.prev = node;\n unvisited_stack.push(top);\n }\n }\n \n}", "title": "" }, { "docid": "1bee0b71fb98ad5b0c4067892a6145bc", "score": "0.52615386", "text": "function dfs(row, col) {\n let S = [];\n let Visited = [];\n S.push({ row, col, visited: false });\n let findNearest = false;\n let pointerDeg;\n\n while (S.length > 0) {\n let v = S.pop();\n let r = v.row;\n let c = v.col;\n if (Visited.filter(v => v === board[r][c]).length === 0) {\n Visited.push(board[r][c]);\n\n // direction to point to\n if (board[r][c].diamond && !board[r][c].clicked && !findNearest) {\n if (row > r && col === c) {\n // north\n pointerDeg = 0;\n } else if (row < r && col === c) {\n // south\n pointerDeg = 180;\n } else if (row > r && col > c) {\n // north west\n pointerDeg = 315;\n } else if (row < r && col > c) {\n // south west\n pointerDeg = 225;\n } else if (row < r && col < c) {\n // south east\n pointerDeg = 135;\n } else if (row > r && col < c) {\n // north east\n pointerDeg = 45;\n } else if (row === r && col < c) {\n // east\n pointerDeg = 90;\n } else {\n // west\n pointerDeg = 270;\n }\n\n findNearest = true;\n break;\n }\n\n // adjacent blocks in the board\n // up\n if (\n board[r - 1] &&\n Visited.filter(v => v === board[r - 1][c]).length === 0\n ) {\n S.push({ row: r - 1, col: c });\n }\n\n // down\n if (\n board[r + 1] &&\n Visited.filter(v => v === board[r + 1][c]).length === 0\n ) {\n S.push({ row: r + 1, col: c });\n }\n\n // left\n if (\n board[r][c - 1] &&\n Visited.filter(v => v === board[r][c - 1]).length === 0\n ) {\n S.push({ row: r, col: c - 1 });\n }\n\n // right\n if (\n board[r][c + 1] &&\n Visited.filter(v => v === board[r][c + 1]).length === 0\n ) {\n S.push({ row: r, col: c + 1 });\n }\n }\n }\n\n return pointerDeg;\n}", "title": "" }, { "docid": "1074b8909349032b29cdb0ad37c47db5", "score": "0.52477276", "text": "function findCell(cells, c) {\n var lo = 0\n , hi = cells.length-1\n , r = -1\n while (lo <= hi) {\n var mid = (lo + hi) >> 1\n , s = compareCells(cells[mid], c)\n if(s <= 0) {\n if(s === 0) {\n r = mid\n }\n lo = mid + 1\n } else if(s > 0) {\n hi = mid - 1\n }\n }\n return r\n}", "title": "" }, { "docid": "1074b8909349032b29cdb0ad37c47db5", "score": "0.52477276", "text": "function findCell(cells, c) {\n var lo = 0\n , hi = cells.length-1\n , r = -1\n while (lo <= hi) {\n var mid = (lo + hi) >> 1\n , s = compareCells(cells[mid], c)\n if(s <= 0) {\n if(s === 0) {\n r = mid\n }\n lo = mid + 1\n } else if(s > 0) {\n hi = mid - 1\n }\n }\n return r\n}", "title": "" }, { "docid": "1074b8909349032b29cdb0ad37c47db5", "score": "0.52477276", "text": "function findCell(cells, c) {\n var lo = 0\n , hi = cells.length-1\n , r = -1\n while (lo <= hi) {\n var mid = (lo + hi) >> 1\n , s = compareCells(cells[mid], c)\n if(s <= 0) {\n if(s === 0) {\n r = mid\n }\n lo = mid + 1\n } else if(s > 0) {\n hi = mid - 1\n }\n }\n return r\n}", "title": "" }, { "docid": "1074b8909349032b29cdb0ad37c47db5", "score": "0.52477276", "text": "function findCell(cells, c) {\n var lo = 0\n , hi = cells.length-1\n , r = -1\n while (lo <= hi) {\n var mid = (lo + hi) >> 1\n , s = compareCells(cells[mid], c)\n if(s <= 0) {\n if(s === 0) {\n r = mid\n }\n lo = mid + 1\n } else if(s > 0) {\n hi = mid - 1\n }\n }\n return r\n}", "title": "" }, { "docid": "1074b8909349032b29cdb0ad37c47db5", "score": "0.52477276", "text": "function findCell(cells, c) {\n var lo = 0\n , hi = cells.length-1\n , r = -1\n while (lo <= hi) {\n var mid = (lo + hi) >> 1\n , s = compareCells(cells[mid], c)\n if(s <= 0) {\n if(s === 0) {\n r = mid\n }\n lo = mid + 1\n } else if(s > 0) {\n hi = mid - 1\n }\n }\n return r\n}", "title": "" }, { "docid": "1074b8909349032b29cdb0ad37c47db5", "score": "0.52477276", "text": "function findCell(cells, c) {\n var lo = 0\n , hi = cells.length-1\n , r = -1\n while (lo <= hi) {\n var mid = (lo + hi) >> 1\n , s = compareCells(cells[mid], c)\n if(s <= 0) {\n if(s === 0) {\n r = mid\n }\n lo = mid + 1\n } else if(s > 0) {\n hi = mid - 1\n }\n }\n return r\n}", "title": "" }, { "docid": "1074b8909349032b29cdb0ad37c47db5", "score": "0.52477276", "text": "function findCell(cells, c) {\n var lo = 0\n , hi = cells.length-1\n , r = -1\n while (lo <= hi) {\n var mid = (lo + hi) >> 1\n , s = compareCells(cells[mid], c)\n if(s <= 0) {\n if(s === 0) {\n r = mid\n }\n lo = mid + 1\n } else if(s > 0) {\n hi = mid - 1\n }\n }\n return r\n}", "title": "" }, { "docid": "1074b8909349032b29cdb0ad37c47db5", "score": "0.52477276", "text": "function findCell(cells, c) {\n var lo = 0\n , hi = cells.length-1\n , r = -1\n while (lo <= hi) {\n var mid = (lo + hi) >> 1\n , s = compareCells(cells[mid], c)\n if(s <= 0) {\n if(s === 0) {\n r = mid\n }\n lo = mid + 1\n } else if(s > 0) {\n hi = mid - 1\n }\n }\n return r\n}", "title": "" }, { "docid": "e48486be0a19f1609dcf93dfe03c5efd", "score": "0.5246447", "text": "get_neighbors(i,j ){\r\n\t\t\r\n\tlet count = 0;\r\n let x = this.row;\r\n let y = this.col;\r\n \r\n \r\n //cell up-left\r\n\tif(i >0 && j > 0 &&(this.grid[i-1][j-1] == 1)) {\r\n \r\n\t\t\tcount++; \r\n\t\t\r\n\t}\r\n\t//cell up\r\n\tif(i > 0 && j >= 0 && j <= y &&(this.grid[i-1][j] == 1) ) {\r\n\r\n\t\t\tcount++; \r\n\t}\r\n\r\n\t//cell up-right\r\n\tif(i > 0 && j >= 0 &&(j+1) < y &&(this.grid[i-1][j+1] == 1)){ \r\n\t\t\r\n\t\t\t count++; \r\n\t}\r\n\r\n\t//cell left\r\n\tif(i >= 0 && j >0 && j < y &&(this.grid[i][j-1] == 1)) { \r\n\r\n\t\t\tcount++; \r\n\t}\r\n\r\n\t//cell right\r\n\tif(i >= 0 && j >= 0 && (j+1) < y &&(this.grid[i][j+1] == 1)) { \r\n\t\t\t\r\n\t\t\tcount++; \r\n\t}\r\n\r\n\t//cell down-left\r\n\tif(i >= 0 && j >0 && (i+1) < x &&(this.grid[i+1][j-1] == 1)) { \r\n\t\t\tcount++; \r\n\t}\r\n\r\n\t//cell down\r\n\tif(i >= 0 && j >= 0 && (i+1) < x && (this.grid[i+1][j] == 1)){ \r\n\r\n\t\t\tcount++; \r\n\t}\r\n\r\n\t//cell down-right\r\n\tif(i >= 0 && j >= 0 && (i+1) < x && (j+1) < y &&(this.grid[i+1][j+1] == 1)) {\r\n\r\n\t\t\tcount++; \r\n\t}\r\n\treturn count;\r\n}", "title": "" }, { "docid": "773562e983a8403e26246b800822d1da", "score": "0.5246015", "text": "function getNeighbors(node, grid) {\r\n const neighbors = [];\r\n const { col, row } = node;\r\n\r\n if (row > 0) neighbors.push(grid[row - 1][col]);\r\n if (row < grid.length - 1) neighbors.push(grid[row + 1][col]);\r\n if (col > 0) neighbors.push(grid[row][col - 1]);\r\n if (col < grid[0].length - 1) neighbors.push(grid[row][col + 1]);\r\n return neighbors;\r\n}", "title": "" }, { "docid": "d923b5ad19b2fd599a3b63d62ac8fbfb", "score": "0.52442276", "text": "function getNeighboringCell(cell)\n{\n // Gets the \"Faculty Table\" spreadsheet\n var url = facultyTableSheetURL\n var sheet = SpreadsheetApp.openByUrl(url)\n \n // Looks for a cell containing a specific text and finds its row and column\n var textFinder = sheet.createTextFinder(cell);\n var next = textFinder.findNext()\n var row = next.getRow()\n \n // Adds 1 to the column so you get the neighboring cell\n var column = next.getColumn() + 1\n \n // Gets the neighboring cell next to the text you found and returns it\n var neighbor = sheet.getActiveSheet().getRange(row, column)\n var recipient = neighbor.getValue()\n return recipient\n}", "title": "" }, { "docid": "37ef8133d37a497f51cf6703541c7738", "score": "0.5235865", "text": "GetNeighbor(index) {\n return this.neighbors_[index];\n }", "title": "" }, { "docid": "b4b358795b845f99ca1d5d74455b56ec", "score": "0.52318287", "text": "function findCell(cells, c) {\n\t var lo = 0\n\t , hi = cells.length-1\n\t , r = -1;\n\t while (lo <= hi) {\n\t var mid = (lo + hi) >> 1\n\t , s = compareCells(cells[mid], c);\n\t if(s <= 0) {\n\t if(s === 0) {\n\t r = mid;\n\t }\n\t lo = mid + 1;\n\t } else if(s > 0) {\n\t hi = mid - 1;\n\t }\n\t }\n\t return r\n\t}", "title": "" }, { "docid": "fea883ed0805890d7fa2d056b00bb587", "score": "0.5227767", "text": "function findCell(cells, c) {\n\t var lo = 0\n\t , hi = cells.length-1\n\t , r = -1\n\t while (lo <= hi) {\n\t var mid = (lo + hi) >> 1\n\t , s = compareCells(cells[mid], c)\n\t if(s <= 0) {\n\t if(s === 0) {\n\t r = mid\n\t }\n\t lo = mid + 1\n\t } else if(s > 0) {\n\t hi = mid - 1\n\t }\n\t }\n\t return r\n\t}", "title": "" }, { "docid": "fea883ed0805890d7fa2d056b00bb587", "score": "0.5227767", "text": "function findCell(cells, c) {\n\t var lo = 0\n\t , hi = cells.length-1\n\t , r = -1\n\t while (lo <= hi) {\n\t var mid = (lo + hi) >> 1\n\t , s = compareCells(cells[mid], c)\n\t if(s <= 0) {\n\t if(s === 0) {\n\t r = mid\n\t }\n\t lo = mid + 1\n\t } else if(s > 0) {\n\t hi = mid - 1\n\t }\n\t }\n\t return r\n\t}", "title": "" }, { "docid": "02e3e1f1663c159ede152ff62e17b9ee", "score": "0.5216948", "text": "function search(x, y) {\n var x0 = 0,\n y0 = 0,\n x3 = width,\n y3 = width,\n minDistance2 = Infinity,\n closestPoint;\n\n (function find(node, x1, y1, x2, y2) {\n var point;\n\n // stop searching if this cell can’t contain a closer node\n if (x1 > x3 || y1 > y3 || x2 < x0 || y2 < y0) return;\n\n // visit this point\n if (point = node.point) {\n var dx = x - point[0],\n dy = y - point[1],\n distance2 = dx * dx + dy * dy;\n if (distance2 < minDistance2) {\n var distance = Math.sqrt(minDistance2 = distance2);\n x0 = x - distance, y0 = y - distance;\n x3 = x + distance, y3 = y + distance;\n closestPoint = point;\n }\n }\n\n // bisect the current node\n var children = node.nodes,\n xm = (x1 + x2) * .5,\n ym = (y1 + y2) * .5,\n right = x > xm,\n below = y > ym;\n\n // visit closest cell first\n if (node = children[below << 1 | right]) find(node, right ? xm : x1, below ? ym : y1, right ? x2 : xm, below ? y2 : ym);\n if (node = children[below << 1 | !right]) find(node, right ? x1 : xm, below ? ym : y1, right ? xm : x2, below ? y2 : ym);\n if (node = children[!below << 1 | right]) find(node, right ? xm : x1, below ? y1 : ym, right ? x2 : xm, below ? ym : y2);\n if (node = children[!below << 1 | !right]) find(node, right ? x1 : xm, below ? y1 : ym, right ? xm : x2, below ? ym : y2);\n })(quadtree, x0, y0, x3, y3);\n\n return closestPoint;\n }", "title": "" }, { "docid": "047a3d407066011340b3252871542554", "score": "0.520347", "text": "function lineNeighbors(arr, i, j) {\n\tvar rowLimit = arr.length-1;\n\tvar colLimit = arr[0].length-1;\n\tvar neighbors = [];\n\t// up-\n\tfor (let x= Math.max(i-1, 0); x>=0 && x!=i; x--) {\n\t\tif (arr[x][j]== \"#\"|| arr[x][j]== \"L\") {\n\t\t\t// console.log(x, j);\n\t\t\tneighbors.push(arr[x][j]);\n\t\t\tbreak;\n\t\t} \n\t}\n\t\n\n \t// down-\n \tfor (let x=Math.min(i+1, rowLimit); x<=rowLimit && x!=i; x++) {\n \t\tif (arr[x][j]== \"#\"|| arr[x][j]== \"L\") {\n \t\t\t// console.log(x, j);\n \t\t\tneighbors.push(arr[x][j]);\n\t\t\tbreak;\n \t\t} \n \t}\n\n \t// left-\n \tfor (let y=Math.max(j-1, 0); y>=0 && y!=j; y--) {\n \t\tif (arr[i][y]==\"#\"|| arr[i][y]==\"L\") {\n \t\t\t// console.log(i, y);\n \t\t\tneighbors.push(arr[i][y]);\n \t\t\tbreak;\n \t\t} \n \t}\n \t\n \t// right-\n \tfor (let y=Math.min(j+1, colLimit); y<=colLimit && y!=j; y++) {\n \t\tif (arr[i][y]==\"#\"|| arr[i][y]==\"L\") {\n \t\t\t// console.log(i, y);\n \t\t\tneighbors.push(arr[i][y]);\n \t\t\tbreak;\n \t\t} \n \t}\n \t\n\n\n \t// up-left:\n \tfor (let x= Math.max(i-1, 0),y=Math.max(j-1, 0); x>=0 && x!=i && y>=0 && y!=j; x--,y--) {\n \t\t\tif (arr[x][y]==\"#\" || arr[x][y]==\"L\") {\n \t\t\t\t// console.log(x,y)\n \t\t\t\tneighbors.push(arr[x][y]);\n \t\t\t\tbreak;\n \t\t\t}\n \t}\n \t\n\n \t// up-right:\n \tfor (let x= Math.max(i-1, 0),y=Math.min(j+1, colLimit); x>=0 && x!=i && y<=colLimit && y!=j; x--, y++) {\n \t\t\tif (arr[x][y]==\"#\" || arr[x][y]==\"L\") {\n \t\t\t\t// console.log(x,y);\n \t\t\t\tneighbors.push(arr[x][y]);\n \t\t\t\tbreak;\n \t\t\t}\n \t}\n \t\n\n \t// down-left:\n \tfor (let x=Math.min(i+1, rowLimit), y=Math.max(j-1, 0); x<=rowLimit && x!=i && y>=0 && y!=j; x++, y--) {\n \t\t\tif (arr[x][y]==\"#\" || arr[x][y]==\"L\") {\n \t\t\t\t// console.log(x,y)\n \t\t\t\tneighbors.push(arr[x][y]);\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\n \t}\n \t\t \n \t\n\n \t// down-right:\n \tfor (let x=Math.min(i+1, rowLimit), y=Math.min(j+1, colLimit); x<=rowLimit && x!=i && y<=colLimit && y!=j; x++, y++) {\n \t\t\tif (arr[x][y]==\"#\" || arr[x][y]==\"L\") {\n \t\t\t\t// console.log(x,y);\n \t\t\t\tneighbors.push(arr[x][y]);\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\n \t}\n\n\treturn neighbors;\n}", "title": "" }, { "docid": "218fc2ee146b2669c26df39ce22a731d", "score": "0.5198216", "text": "neighbors(id) {\n // YOUR WORK HERE\n \n if(id in this.storage){\n \n return this.storage[id];\n \n \n }\n return null;\n \n}", "title": "" }, { "docid": "e1797ec135e244c569079812a6638159", "score": "0.51979804", "text": "function checkNeighbors(r, c, checkThis) {\n // keep count\n var total = 0;\n\n // check row above\n function topRow(r,c) {\n var neighbors = 0;\n if ( checkThis[r - 1] ) {\n if ( checkThis[r - 1][c - 1] === 1 ) {\n neighbors += 1;\n }\n if ( checkThis[r - 1][c] === 1) {\n neighbors += 1;\n }\n if ( checkThis[r - 1][c + 1] === 1) {\n neighbors += 1;\n }\n }\n return neighbors\n }\n // check sides\n function sides(r,c) {\n var neighbors = 0;\n if ( checkThis[r][c - 1] === 1 ) {\n neighbors += 1;\n }\n if ( checkThis[r][c + 1] === 1) {\n neighbors += 1;\n }\n return neighbors\n }\n // check row below\n function belowRow(r,c) {\n var neighbors = 0;\n if ( checkThis[r + 1] ) {\n if ( checkThis[r + 1][c - 1] === 1 ) {\n neighbors += 1;\n }\n if ( checkThis[r + 1][c] === 1) {\n neighbors += 1;\n }\n if ( checkThis[r + 1][c + 1] === 1) {\n neighbors += 1;\n }\n }\n return neighbors\n }\n\n total = topRow(r,c) + sides(r,c) + belowRow(r,c);\n return total\n}", "title": "" }, { "docid": "c1599e36f5d138a2e5c5d95c60e55aca", "score": "0.51906484", "text": "function getLeftNeighbor(existingTile) {\n if (!existingTile.isTile) {return;}\n if (!existingTile.parent.isTile) {return;}\n\n var currentTile = existingTile;\n\n // Climb up\n while (!currentTile.isRight && currentTile.parent.isTile)\n {\n currentTile = currentTile.parent\n }\n // There is nothing to the right\n if (!currentTile.isRight) {return existingTile; }\n\n // Climb down, while staying as far right and up as possible\n currentTile = currentTile.sibling\n while (currentTile.isSplitVertically || currentTile.isSplitHorizontally)\n {\n // Take the upper child\n if (currentTile.isSplitVertically) { currentTile = currentTile.firstChild }\n // Take the right child\n else { currentTile = currentTile.secondChild }\n\n }\n return currentTile\n}", "title": "" }, { "docid": "9868d5a185dd328287fca2e893ae9ef9", "score": "0.5189618", "text": "get_neighbors(territory, board) {\n function is_neighbor(other) {\n return Math.max(Math.abs(territory.location.column - other.location.column),\n Math.abs(territory.location.row - other.location.row)) == 1\n }\n return board.filter(is_neighbor);\n }", "title": "" }, { "docid": "3d0e12ad6384506be6b45ea10b69f107", "score": "0.5188138", "text": "function bottom_of_edge(data, edge) {\n if (edge.start_vertex == null) {\n return {\n x: edge.x,\n y: 0\n };\n }\n return {\n x: data.vertices[edge.start_vertex].x,\n y: data.vertices[edge.start_vertex].y,\n //y: edge.start_height\n };\n}", "title": "" }, { "docid": "8173c857dadd7f96ac392c62a722a66a", "score": "0.5180568", "text": "function getNeighbors(row, col) {\r\n\t\tvar neighbors = [];\r\n\t\t\r\n\t\tif (row > 0) {\r\n\t\t\t// add tile above\r\n\t\t\tneighbors.push(GRID_WIDTH * (row - 1) + col + \"_\" + 1);\r\n\t\t\t\r\n\t\t\t// add tile above and left\r\n\t\t\tif (col > 0) {\r\n\t\t\t\tneighbors.push(GRID_WIDTH * (row - 1) + col - 1 + \"_\" + .4);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// add tile above and right\r\n\t\t\tif (col < GRID_WIDTH - 1) {\r\n\t\t\t\tneighbors.push(GRID_WIDTH * (row - 1) + col + 1 + \"_\" + .4);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (col > 0) {\r\n\t\t\t// add tile left\r\n\t\t\tneighbors.push(GRID_WIDTH * row + col - 1 + \"_\" + 1);\r\n\t\t}\r\n\t\tif (col < GRID_WIDTH - 1) {\r\n\t\t\t// add tile right\r\n\t\t\tneighbors.push(GRID_WIDTH * row + col + 1 + \"_\" + 1);\r\n\t\t}\r\n\t\tif (row < GRID_HEIGHT - 1) {\r\n\t\t\t// add tile below\r\n\t\t\tneighbors.push(GRID_WIDTH * (row + 1) + col + \"_\" + 1);\r\n\t\t\t\r\n\t\t\t// add tile below and left\r\n\t\t\tif (col > 0) {\r\n\t\t\t\tneighbors.push(GRID_WIDTH * (row + 1) + col - 1 + \"_\" + .4);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// add tile below and right\r\n\t\t\tif (col < GRID_WIDTH - 1) {\r\n\t\t\t\tneighbors.push(GRID_WIDTH * (row + 1) + col + 1 + \"_\" + .4);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn neighbors;\r\n\t}", "title": "" }, { "docid": "aa7052920c8c04aaea57ed0f40702fa0", "score": "0.51798517", "text": "function neighbors(x, y) {\n var N = y - 1,\n S = y + 1,\n E = x + 1,\n W = x - 1,\n myN = N > -1 && canWalkHere(x, N),\n myS = S < CONSTANTS.BOARD_HEIGHT && canWalkHere(x, S),\n myE = E < CONSTANTS.BOARD_WIDTH && canWalkHere(E, y),\n myW = W > -1 && canWalkHere(W, y);\n\n var result = [];\n\n if (myN) result.push({x: x, y: N});\n if (myE) result.push({x: E, y: y});\n if (myS) result.push({x: x, y: S});\n if (myW) result.push({x: W, y: y});\n\n return result;\n }", "title": "" }, { "docid": "dfe1d620995880d90e3865ce316fbf96", "score": "0.51748365", "text": "function checkbottom(coli){\n var colorreport= returncolor(5,coli);\n for(var row=5;row>-1;row--){\n colorreport=returncolor(row,coli);\n if(colorreport==='rgb(128, 128, 128)'){\n return row;\n }\n }\n}", "title": "" }, { "docid": "1b86492f5cfed3e5e4872147a8639215", "score": "0.5173373", "text": "function findBorder(loc) {\n return [grid[loc - rows - 1], grid[loc - 1], grid[loc + rows - 1], \n grid[loc + rows], grid[loc + rows + 1], grid[loc + 1], \n grid[loc - rows + 1], grid[loc - rows]];\n}", "title": "" }, { "docid": "b2bb41eed562a196455e979e49c89559", "score": "0.51721495", "text": "function checkBottom(colIndex){\n var colorReport = returnColor(5,colIndex);\n for(var row = 5; row > -2; row--){\n colorReport = returnColor(row,colIndex);\n if(colorReport === 'rgb(135, 248, 229)'){\n return row \n }\n \n }\n}", "title": "" }, { "docid": "333c322ad6a09cee487fbf83134210f7", "score": "0.51627064", "text": "function forEachNeighbor(point, fn) {\n fn({x: point.x - 1, y: point.y});\n fn({x: point.x + 1, y: point.y});\n fn({x: point.x, y: point.y - 1});\n fn({x: point.x, y: point.y + 1});\n }", "title": "" } ]
157bef33fc6600325eec061219151b4f
function getSelectedObject(idpath) var idpath the CV idpath to the specific instance of a part or assembly returns = the part, which may be group
[ { "docid": "818bc88f4e7ccb6b9fbf1f224abd6874", "score": "0.793102", "text": "function getSelectedObject(idpath) {\n return getObjectByName(getScene(), idpath);\n }", "title": "" } ]
[ { "docid": "56ee7d7877ffa9c7e4fd7c8a25789eeb", "score": "0.6717384", "text": "function getSelectedObjects(idpath) {\n return getObjectsByName(getScene(), 'name', idpath);\n }", "title": "" }, { "docid": "89cd10f3e53d3b87f1e77e0ed02cf032", "score": "0.61390966", "text": "function selectedObject(e) {\n\t\t\t\tvar id = canvas.getObjects().indexOf(e.target);\n\t\t\t}", "title": "" }, { "docid": "4d8cc56a39a2d2d937a8fdfe6641de78", "score": "0.5870486", "text": "select(id) {\n if (this.graniteObjects[id]) return this.graniteObjects[id];\n return null;\n }", "title": "" }, { "docid": "f283276335c5f386415d29f518af859d", "score": "0.5820849", "text": "function selectDesignObj(imgID)\n{\n\t//debug(\"selectDesignObj \" + imgID);\n\t\n\tdwgCanvas.deactivateAll().renderAll();\n \n $('.desObjectsWrapper').hide();\n\tdesObjMenuOpen = false;\n\t\n closeDesMenuBtns();\n\t\n\t\n \n\tvar imgURL = \"resources/\" + imgID + \".png\";\n \n\tfabric.Image.fromURL(imgURL, function(img){\n\t\n\t\tvar scale = 0.5;\n\t\tvar pos = 750/2;\n\t\t\n\t\timg.set({\n\t\t\thasControls: true,\n\t\t\thasRotatingPoint: true,\n\t\t\thasBorders: true,\n\t\t\tcornerSize: 22,\n\t\t\tborderColor:'rgba(255,255,255,0.6)',\n\t\t\tcornerColor :'rgba(255,255,255,0.6)',\n\t\t\tborderOpacityWhenMoving :0, \n\t\t\tminScaleLimit:0.02,\n\t\t\tpadding:15, \n\t\t\ttransparentCorners:true,\n\t\t\toriginX: 'center',\n\t\t\toriginY: 'center',\n\t\t\tscaleX:scale,\n\t\t\tscaleY:scale,\n\t\t\ttop:pos,\n\t\t\tleft:pos\n\t\t});\n\t\t\n\t\t// add to drawing canvas\n\t\tdwgCanvas.add(img);\n\t\t\n\t\t// select last item added\n\t\tdwgCanvas.setActiveObject(dwgCanvas.item(dwgCanvas.getObjects().length - 1));\n\t\t\n\t\t// keep track of number of items added\n\t\tobjectCounter++;\n\n\t\tresetHistory();\n\t\n\t});\n}", "title": "" }, { "docid": "acf0bf618d67733afd67d09365d825c3", "score": "0.57006615", "text": "getSelected() {}", "title": "" }, { "docid": "a02397dd3161551be10a6abe20481ae9", "score": "0.56846166", "text": "function itemSelect(pid, scrollIntoView){\n\tif(scrollIntoView==null) scrollIntoView=false\n\tif(typeof pid==='string' && pid.length>=5){\n\t\t//assume pid is a path: img.path='c:/...'\n\t\tpid = items.find(function(el,ii,list){\n\t\t\tif(el.path===pid){\n\t\t\t\tpid = el.pid\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t})\n\t\tpid = (pid==undefined ?false :pid.pid)\n\t}\n\tif(itemselected==null || itemselected.pid!==pid) {\t//new item\n\t\tif(itemselected!==null) {\n\t\t\tvar ctrl = document.getElementById(`obj${itemselected.pid}`)\n\t\t\tif(ctrl != null)\t//if filtering ctrl may be null\n\t\t\t\tclassRemove(ctrl,'gridItemSelected')\n\t\t\titemselected=null\n\t\t}\n\t\tif(pid!==false) {\n\t\t\titemselected=items[pid]\n\t\t\tctrl = document.getElementById(`obj${pid}`)\n\t\t\tif(ctrl != null)\t//if filtering ctrl may be null\n\t\t\t\tclassAdd(ctrl,'gridItemSelected')\n\t\t\tif(itemselected.ctrl===undefined || itemselected.ctrl===null)\n\t\t\t\titemselected.ctrl = ctrl\n\t\t\t//return itemselected\n\t\t}\n\t}\n\tif(scrollIntoView===true){\n\t\tif(itemselected != null && itemselected.ctrl != null) {\n\t\t\titemselected.ctrl.scrollIntoView({\n\t\t\t\t behavior:'instant',\t// \"auto\" | \"instant\" | \"smooth\",\n\t\t\t\t block:'start'\n\t\t\t})\n\t\t}\n\t}\n\treturn itemselected\n}", "title": "" }, { "docid": "050bb7d663a72a8a1d747a839b15c45d", "score": "0.5682819", "text": "getPart(id) {\n let part = this.parts[id];\n if (!part) {\n console.error('part:', id);\n throw 'getPart: unknown part';\n }\n return part;\n }", "title": "" }, { "docid": "7c97a9e8615810bdad09ce5da6c30096", "score": "0.5671453", "text": "function selectPart(part) {\r\n\r\n\t// need to find the index of the element for which the part is being selected\r\n\tindex = $(part).closest('div.element').index();\r\n\r\n\t// find the div block that stores the part [class=part]\r\n\tvar divPart = $(part).closest('div.elemWrapper').find('div.part');\r\n\r\n\t// set the text for the code equal the the text of the selected part (part_id)\r\n\t// and bind the click event to the unselectPart function\r\n\t$(divPart).text($(part).text())\r\n\t .click(function() { unselectPart($(divPart)); } );\r\n\r\n\t// collapse the sub categories and parts sections using animation\r\n\tvar divElement = $('#thecontainer div.element').eq(index);\r\n\t$(divElement).find('div.parts').animate({height:\"toggle\", opacity: 1}, 200, \"linear\", function() { $(divElement).find('div.parts').hide();} );\r\n\t$(divElement).find('div.rules').animate({height:\"toggle\", opacity: 1}, 200, \"linear\", function() { $(divElement).find('div.rules').hide();} );\r\n\t\r\n\t// show the code div which displays the selected part\r\n\t$(divPart).text($(part).text());\r\n\t$(divPart).fadeIn();\r\n\r\n\t//update the elements array to indicate the selected part\r\n\telements[index].part = $(part).text();\r\n\telements[index].part_id = $(part).attr('id');\r\n\t\r\n\t// add a new step to the history panel\r\n\taddHistoryStep();\r\n\tcheckStatus();\r\n\r\n}", "title": "" }, { "docid": "0e735a9e6ceb6d1164d39baeaa031304", "score": "0.56652254", "text": "function selectObject(cellId){ \n\tmyJsGraphicsArray[cellId].clear();\n\t// update of the list of the object which should be drawn\n\tif(currentSelectedCells[cellId] == true) {currentSelectedCells[cellId] = false;}\n\telse {currentSelectedCells[cellId] = true;}\n\t// update the drawing of the contour\t \n\tpaint(cellId); \n\tdisplay();\t \n}", "title": "" }, { "docid": "414595e67ef5518a631f1574359eb234", "score": "0.56496596", "text": "function getSelectedGroupid(){\n return self.grouplist.find('.active').attr('id');\n}", "title": "" }, { "docid": "3e42e7072850f4b4f07bf27b7f491734", "score": "0.55942744", "text": "function fmdf_select($obj) {\n\tfmdf_unselect();\n\t$($obj).addClass('fmdselected');\n\tconsole.debug($($obj).attr('class'));\n\tfmdc.selection.selectedobj = $obj;\n\t//set status bar\n\tfmdf_setselectedstatus($obj);\n}", "title": "" }, { "docid": "76364bd204c79d4b5d9b74654ed2f3cc", "score": "0.5561408", "text": "object_selected(args) {\n var q = this.data.selected\n if (q) {\n // Check if current drawing is finished\n //let res = this.get_one(`${q}.settings`)\n //if (res && res.$state !== 'finished') return\n this.merge(`${q}.settings`, {\n $selected: false\n })\n this.remove_trash_icon()\n }\n this.tv.$set(this.data, 'selected', null)\n\n if (!args.length) return\n\n this.tv.$set(this.data, 'selected', args[2])\n this.merge(`${args[2]}.settings`, {\n $selected: true\n })\n\n this.add_trash_icon()\n }", "title": "" }, { "docid": "45d52926ceb78380b09f53f6fd6b85ec", "score": "0.5463467", "text": "function selectedGraphic(selected, who) {\n if(!selected || selected.length < 1) {\n sendWhisper(who, \"You need to have an image selected.\");\n return;\n } else if(selected.length > 1) {\n sendWhisper(who, \"Only one image can be selected.\");\n return;\n }\n \n var graphic = getObj(\"graphic\", selected[0]._id);\n \n if(!graphic) {\n sendWhisper(who, \"The selected object must be an image.\");\n return;\n }\n \n return graphic;\n }", "title": "" }, { "docid": "d38e422c10fa53dd5083de19b0b4f803", "score": "0.5432318", "text": "function selectBuoyInstance(buoyInstance) {\n stopEditing();\n selected.type = 'instance';\n selected.obj = buoyInstance;\n updateGroupBuoys();\n }", "title": "" }, { "docid": "48f4a048453f441056499b60a18e6b8e", "score": "0.54068726", "text": "selectShape(args) {\n const selectedController = (args && args.controller) ? args.controller : undefined;\n if (selectedController && (selectedController!==this.componentController)) {\n this.attachSelectionControllers(selectedController);\n this.setSelectedModel(selectedController.getModel());\n } else {\n this.detachSelectionControllers();\n this.setSelectedModel(undefined);\n }\n this.updateGraphics();\n }", "title": "" }, { "docid": "1f96361ad4ea611051c02d115a4614b5", "score": "0.53833014", "text": "get_selected(){\n //\n //Get the affected/selected entity that we want to alter. The altering \n //an entity can only happen if there is a selected element \n const selection = document.querySelector('[selected=true]');\n //\n //Test if the selection is a null or undefined and return a false if true \n if (selection===null|| selection===undefined){\n //\n //Return a false since no entity was selected \n return false;\n }\n //\n //Test if what was selected is an ellipse \n if (selection.nodeName !== \"ellipse\"){\n //\n //If the selected element is not an ellipse return a false \n return false ;\n }\n //\n //1. Get the selected entity's name\n const ename= selection.id; \n //\n //Derive the affected entity from the dbase\n const entity =this.dbase.entities[ename];\n // \n //Return the selected entity \n return entity;\n }", "title": "" }, { "docid": "e3bbe6671566f7018c017b8999985ac4", "score": "0.5353781", "text": "function getidselect(id) {\n return \"#\" + instanceid + \"-\" + id\n }", "title": "" }, { "docid": "b8160358c5c3080e6b4cce2c589bc027", "score": "0.5346915", "text": "function selectObject(theObj) {\n if (!theObj) return false; // if (currentObject3D) currentObject3D.material.blending = 1;\n window.lastSelectedObj = theObj;\n window.lastSelectedObj.lastPosition = window.lastSelectedObj.position.clone();\n window.lastSelectedObj.lastRotation = window.lastSelectedObj.rotation.clone();\n setCurrentObject3D( theObj ); // look at the object, I dont know how to do it\n // now also see the WATCH (useEffect for currentObject3D )\n }", "title": "" }, { "docid": "0a11eef5e75f7575d169cfe9f5cf4705", "score": "0.5265417", "text": "function getStorageObject(id) {\n // Retrieving object for given id\n if (id) {\n Dialog.showWait();\n var successCallback = function(filePath) {\n\n var fileViewer = new SMF.Utils.Fileviewer();\n fileViewer.openDocument(filePath);\n\n Dialog.removeWait();\n };\n\n var failureCallback = function(e) {\n console.log(id + ' cant retrieved ' + e);\n Dialog.removeWait();\n alert(e);\n }\n\n smfOracle.getStorageObject(Pages.pgFiles.myStorageCollection, id, successCallback, failureCallback)\n }\n else {\n Dialog.removeWait();\n alert('Please select a file to view');\n }\n }", "title": "" }, { "docid": "d377fdc69be961441174ab31d64ba671", "score": "0.52242917", "text": "function selectObject(obj) {\n SELECTED = obj || {};\n\n if (!$.isEmptyObject(obj)) {\n\n _enableObjectEditMenu(true);\n\n objects.forEach(function(o) {\n o.outlineMesh.visible = false;\n });\n\n if(obj.outlineMesh) {\n obj.outlineMesh.visible = true;\n }\n setObjectDialoguePosition(obj);\n\n transformControl.attach(obj);\n transformControl.name = 'TransformControl';\n\n scaleBeforeTransformX = obj.scale.x;\n scaleBeforeTransformY = obj.scale.y;\n scaleBeforeTransformZ = obj.scale.z;\n\n if(reactSrc.state.mode === 'rotate') {\n setRotateMode();\n }\n else {\n setScaleMode();\n }\n }\n else {\n transformMode = false;\n removeFromScene('TransformControl');\n _removeAllMeshOutline();\n _enableObjectEditMenu(false);\n reactSrc.setState({ openObjectDialogue: false });\n }\n render();\n }", "title": "" }, { "docid": "0b94a29836194691bcce544954f3e62d", "score": "0.51995647", "text": "function getSceneObject(paperObject)\r\n{\r\n var id = +paperObject.name.substring(1);\r\n for (var i in scene.children) // there should be a better way\r\n {\r\n if (scene.children[i].id == id) \r\n return(scene.children[i]);\r\n }\r\n return (null);\r\n}", "title": "" }, { "docid": "c91a0b29d7c7e55d5ba94728fec89965", "score": "0.5190593", "text": "function fnSelect(objId) {\r\n\tfnDeSelect();\r\n\tif (document.selection) {\r\n\tvar range = document.body.createTextRange();\r\n\t range.moveToElementText(document.getElementById(objId));\r\n\trange.select();\r\n\t}\r\n\telse if (window.getSelection) {\r\n\tvar range = document.createRange();\r\n\trange.selectNode(document.getElementById(objId));\r\n\twindow.getSelection().addRange(range);\r\n\t}\r\n}", "title": "" }, { "docid": "73b90397d7e88e685dacdc4f69d08830", "score": "0.5183148", "text": "function CTT_DoSelection( nodeid, nodepath )\r\n{\r\n\tif ( nodeid != oscriptValues.gCreate_OriginalCTTID )\r\n\t{\r\n\t\tdocument.CreateForm.CTT_ID.value = nodeid;\r\n\t\tdocument.CreateForm.CTT_Path.value = nodepath;\r\n\t\tdocument.CreateForm.CTT_PathSaved.value = nodepath;\r\n\r\n\t\toscriptValues.gCreate_OriginalCTTID = nodeid;\r\n\t\tSwitchParent( true );\r\n\t}\r\n}", "title": "" }, { "docid": "b7bb428ad07f5b5c409e2e6e91bd3107", "score": "0.5181589", "text": "function selectAccordingToSegment() {\n\t\tvar url = $.url();\n\t\tvar category = url.fsegment(1);\n\t\t\n\t\tswitch(category) {\n\t\tcase 'edit':\n\t\t var page = url.fsegment(2);\n\t\t \n\t\t if(typeof page != 'undefined') {\n\t\t\tvar chap = getChapterByURLTitle(page);\n\t\t\tif(chap && !chapterLocks[chap.id]) {\n\t\t\t $.booki.editor.editChapter(chap.id);\n\t\t\t}\n\t\t }\t\t \n\t\t break;\n\n\t\tcase 'attachments':\n\t\t $(\"#tabs\").tabs(\"select\", \"tabattachments\");\n\t\t break;\n\n\t\tcase 'history':\n\t\t $(\"#tabs\").tabs(\"select\", \"tabhistory\");\n\t\t break;\n\n\t\tcase 'versions':\n\t\t $(\"#tabs\").tabs(\"select\", \"tabversions\");\n\t\t break;\n\n\t\tcase 'notes':\n\t\t $(\"#tabs\").tabs(\"select\", \"tabnotes\");\n\t\t break;\n\n\t\tcase 'settings':\n\t\t $(\"#tabs\").tabs(\"select\", \"tabsettings\");\n\t\t break;\n\n\t\tcase 'export':\n\t\t $(\"#tabs\").tabs(\"select\", \"tabpublish\");\n\t\t break;\n\t\t}\t\t\n\t }", "title": "" }, { "docid": "a3d69d9d33d272297fac14169bed666a", "score": "0.5179112", "text": "function projectSelection(project){\n activeProject = project;\n\n\n}", "title": "" }, { "docid": "85d2964d1d811a3e948acfa75d724836", "score": "0.5175631", "text": "function getPaperObject(obj3)\r\n {\r\n var name = '_' + obj3.id;\r\n if (obj3.layers.mask == 4) // grid group\r\n return _gridGroup.children[name];\r\n\r\n return _paperGroup.children[name];\r\n }", "title": "" }, { "docid": "676a0164092fb776a2a87dc6b125cd02", "score": "0.51684695", "text": "function fmdf_findto(id1) {\n\tfmdc.popup_finddom.hide();\n\tvar $obj = $('.fmdcanvas #'+id1);\n\t//alert($obj);\n\tif ($obj.length) {\n\t\t$obj.focus();\n\t\t$obj.effect(\"highlight\", {}, 1000, function(){fmdf_select($obj);});\n\t} else {\n\t\tdhtmlx.message(fmd_i18n_msg_notfound);\n\t}\n}", "title": "" }, { "docid": "f4281496e9708bd0cf467befe9b735ca", "score": "0.5162268", "text": "getSelectedPipelineId() {\n\t\treturn this.objectModel.getSelectedPipelineId();\n\t}", "title": "" }, { "docid": "ad83a1ca76d4cd113bdf0472a34a3163", "score": "0.5160443", "text": "static selectChoiceById(id) {\n if (novelData.novel.currentScene.choices[id]) {\n return this.selectChoice(novelData.novel.currentScene.choices[id]);\n }\n }", "title": "" }, { "docid": "44e3168f1378310fa06e9f3446c7bdd6", "score": "0.51565117", "text": "onObjectSelected() {\n var index = this.page.panels.indexOf(this);\n $('.controls__menu--panels .controls__menu-item').eq(index).addClass('controls__menu-item--selected');\n }", "title": "" }, { "docid": "14c5b005184c406b3b2110f11996b77a", "score": "0.5124885", "text": "get selectedFeatureId() {\n const session = getSession(self)\n if (!session) return undefined\n const { selection } = session\n // does it quack like a feature?\n if (\n selection &&\n typeof selection.get === 'function' &&\n typeof selection.id === 'function'\n ) {\n // probably is a feature\n return selection.id()\n }\n return undefined\n }", "title": "" }, { "docid": "73819e2e0de1ffbd3a4cb07618e75b51", "score": "0.5108932", "text": "function selectionOBJ(elementID) { //remember to use css selectors in your argument so jquery will find the element\n this.idString = elementID;\n this.elementJQ = $(elementID);\n this.optionsJQ = $(elementID + ' option');\n this.currentVal = $(elementID).val();\n\n }", "title": "" }, { "docid": "0f827def866e436409bb72920a5ee636", "score": "0.510361", "text": "function OnShapeObjectSelection(evt) {\r\n \r\n var node = evt.target;\r\n if(bMove == true)\r\n \treturn ; \r\n \r\n if ((!gCurrentObjectSelected) || (gCurrentObjectSelected != node)) { \r\n \t if(gCurrentObjectSelected)\r\n \t {\r\n \t\t gCurrAttributeList = EL_getObjectAttributes(gCurrentObjectSelected); \r\n EL_CompareAndAddtoList(gPrevAttributeList, gCurrAttributeList, gObjectEditList, gCompactEditList); \t \r\n \t GX_UpdateObjectProperties(gCurrentObjectSelected, true);\r\n \t } \t\r\n \t GX_SetSelection(node, true);\r\n \t gPrevAttributeList = EL_getObjectAttributes(gCurrentObjectSelected);\r\n \t/* var JQSel = \".SVG_SHAPE_OBJECT\";\r\n \t $(JQSel).attr(\"opacity\", '0.4');\r\n \t JQSel = \"#\" + node.id; \r\n \t $(JQSel).attr(\"opacity\", '1.0');*/\r\n \t// evt.stopPropagation(); \r\n return;\r\n } \r\n }", "title": "" }, { "docid": "9cb549f7144c3bdb436bde284c3e6f3f", "score": "0.5101628", "text": "selectAsset(id) {\n if (this.can('assets:'+ this.container +':edit')) {\n this.$emit('asset-selected', id);\n }\n }", "title": "" }, { "docid": "1af283b6b784ddd8332c1c7f3a58f513", "score": "0.51001525", "text": "static getSelectedValue(id) {\n return this.getSelectedItem(id).value;\n }", "title": "" }, { "docid": "a4f1aed0be9ad55fb1b0ff5121ba5c96", "score": "0.50798297", "text": "function highlight_selected_id(selected_id) {\n var id = opt.elem_id_prefix + selected_id;\n move_in_front(id);\n $(\"circle[id^='\" + id + \"']\")\n .attr(\"fill\", opt.init_selected_point_color);\n}", "title": "" }, { "docid": "95f9f02399a14358ed0b2c2bec983bb6", "score": "0.50657487", "text": "function MEXQ_PartexSelect(tblRow, is_selected) {\n console.log(\"===== MEXQ_PartexSelect =====\");\n //console.log(\"tblRow\", tblRow);\n const partex_pk = get_attr_from_el(tblRow, \"data-pk\");\n //console.log(\"partex_pk\", partex_pk);\n // cluster_pk is number or 'new_1' when created\n mod_MEX_dict.sel_partex_pk = (!partex_pk) ? null :\n (Number(partex_pk)) ? Number(partex_pk) : partex_pk;\n\n// --- reset highlighted partex and highlight selected partex in both tables\n // el_MEXQ_tblBody_partex1 does not exist in MEXA, put that one last in list\n const tblBody_list = [];\n if (el_MEXQ_tblBody_partex2) { tblBody_list.push(el_MEXQ_tblBody_partex2) };\n if (el_MEXQ_tblBody_partex1) { tblBody_list.push(el_MEXQ_tblBody_partex1) };\n\n for (let j = 0, tblBody; tblBody = tblBody_list[j]; j++) {\n for (let i = 0, tblRow; tblRow = tblBody.rows[i]; i++) {\n const data_pk = get_attr_from_el_int(tblRow,\"data-pk\")\n const is_selected = (mod_MEX_dict.sel_partex_pk && data_pk === mod_MEX_dict.sel_partex_pk)\n add_or_remove_class(tblRow, \"bg_selected_blue\",is_selected )\n };\n };\n\n// - hide partex_input_elements\n MEXQ_ShowPartexInputEls(false);\n MEX_SetPages();\n // only show btn_pge when there are multiple pages\n MEXQ_show_btnpage();\n MEX_BtnPageClicked();\n\n console.log( \"MEXQ_PartexSelect >>>> MEXQ_FillPage ========= \");\n MEXQ_FillPage();\n\n //console.log(\"mod_MEX_dict\", mod_MEX_dict);\n\n }", "title": "" }, { "docid": "4c9fc23892b7abf4f86505c215652851", "score": "0.5064335", "text": "function getSelectedResource()\r\n{\r\n return $('#sel_res_id').attr('rid');\r\n}", "title": "" }, { "docid": "799234f2e062483c84f4a203ba4b3dc1", "score": "0.5064318", "text": "function getSelected( sidebar ) {\n\t\n\tlet selected = store.get( 'appInterface.selected' )\n\t\n\tif( selected ) {\n\t\t\n\t\tlet selectedbutton = $(`button[data-id=\"${selected}\"]`)\n\t\t\n\t\tselectedbutton.addClass('selected')\n\t\t\n\t\tlet above = aboveSelected( selectedbutton )\n\t\tabove.addClass( 'above-selected' )\n\t\t\n\t\tinsertDate()\n\t\tipcRenderer.send( 'update-titlebar', selectedbutton.data( 'title' ) )\n\t\t\n\t\tif( selectedbutton.length ) {\n\t\t\t\n\t\t\tipcRenderer.send( 'dock-update-openitem', true )\n\t\t}\n\t\t\n\t\tif( !sidebar ) {\n\t\t\t\n\t\t\tfetch.apiCall( 'single', selected, null, function( call, id, body, notes ) {\n\t\t\t\t\n\t\t\t\tfetchResult( call, id, body, notes )\n\t\t\t})\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f21a807ad3734d179770f48a1c1bbae6", "score": "0.50630087", "text": "function getObjectByName( obj, idpath ) {\n if ( obj.name === idpath ) {\n return obj;\n }\n for ( var i = 0; i < obj.children.length; i ++ ) {\n var found = getObjectByName( obj.children[ i ], idpath);\n if ( found !== null && found !== undefined) {\n return found;\n }\n }\n return null;\n }", "title": "" }, { "docid": "29b6621b1fea6089f4e9e4192d0fa0ff", "score": "0.5055639", "text": "function MEXA_PartexSelect(tblRow, is_selected) {\n //console.log(\"===== MEXA_PartexSelect =====\");\n\n const partex_pk = get_attr_from_el_int(tblRow, \"data-pk\");\n const partex_dict = mod_MEX_dict.partex_dict[partex_pk];\n\n// +++ make tblRow selected\n mod_MEX_dict.sel_partex_pk = (partex_pk) ? partex_pk : null;\n\n// --- highlight selected partex, deselect others\n const tblBody = el_MEXQ_tblBody_partex2;\n for (let i = 0, tblRow; tblRow = tblBody.rows[i]; i++) {\n const data_pk = get_attr_from_el_int(tblRow,\"data-pk\")\n const is_selected = (mod_MEX_dict.sel_partex_pk && data_pk === mod_MEX_dict.sel_partex_pk)\n add_or_remove_class(tblRow, \"bg_selected_blue\",is_selected )\n };\n\n// - hide partex_input_elements\n MEX_SetPages();\n // only show btn_pge when there are multiple pages\n MEXQ_show_btnpage();\n MEX_BtnPageClicked();\n MEXQ_FillPage();\n\n //console.log(\"mod_MEX_dict\", mod_MEX_dict);\n\n// - hide partex_input_elements\n\n }", "title": "" }, { "docid": "f4edd0e8b1727dc8e416144e9dd82496", "score": "0.5052964", "text": "function getCurrentComp() {\nvar comp = app.project.activeItem;\nif (comp instanceof CompItem) return comp;\nelse\n{\nalert(tr(\"Active composition not found.\\nPlease select a composition or activate the composition panel.\"));\nreturn null;\n}\n}", "title": "" }, { "docid": "483b78df4c17a19bcc63e8b7cd4e3d6b", "score": "0.5052373", "text": "isSelected (id) {\n\t\tconst index = this.contacts.findIndex(el => el.id === id);\n\t\treturn this.contacts[index];\n\t}", "title": "" }, { "docid": "898a28498c682f3efa7a848a0ab6ed89", "score": "0.50484073", "text": "_handleID(id, obj) {\n let match;\n if(id === \"SPAWN\") {\n obj.geometry.computeBoundingBox();\n let bbc = obj.geometry.boundingBox.getCenter(new THREE.Vector3());\n this.spawns.push(bbc);\n return null; //Delete this object\n }\n else if(match = id.match(/SUBWAY(\\d)/)) {\n //Handle the minimap representations of the subway\n let idx = parseInt(match[1])-1;\n let color = [0xFF0000, 0xFFFF00][idx];\n let mat = this._matCache[idx] = this._matCache[idx] || new THREE.MeshBasicMaterial({ color });\n obj.geometry.computeBoundingBox();\n let center = new THREE.Vector3();\n obj.geometry.boundingBox.getCenter(center);\n let c2 = center.clone().negate();\n obj.geometry.translate(c2.x, c2.y, c2.z);\n obj.material = mat;\n obj.position.copy(center);\n obj.position.setY(0); //Flatten\n return obj; //Return the object as is, don't process anything else about it\n }\n\n //Handle gas\n //TODO: Actually create the indicator on the minimap\n //TODO: Actually create interactable behavior\n //TODO: Nail down the specifics of the timing related to\n //the gas (go back to story to nail down how all this\n //ties in)\n //levelLoader.idMap[\"GAS1\"];\n }", "title": "" }, { "docid": "d4a0ca4e9d6d3e0c29a0fba6f8de958e", "score": "0.50461537", "text": "function selectAndCheckElement (element, path, id) {\n var desc = 'Select element ' + element + ', see if highlighted and if path is ' + path;\n if(id !== undefined){\n desc += ', id: ' + id;\n }\n it(desc, function () {\n Lib.scrollToElement(element, 'container');\n ST.component(element).click().wait(200);\n Lib.textInsideElement(bottomPanel, 'Selected: ' + path);\n ST.component(element).hasCls('x-treelist-item-selected');\n });\n }", "title": "" }, { "docid": "9f99ec89eb43001b8dce8b6ec724bd5e", "score": "0.5044223", "text": "function UcstarSelectObj(id,name,rootSelectname,sign,selectedid) {\n\tthis.id = id;\n\tthis.name = name;\n\tthis.rootSelectname = rootSelectname;\n\tthis.sign = sign;\n\tthis.selectedid = selectedid;\n\tthis.selectStr = \"\";\n\tthis.ucstaroptions = [];\n\tthis.ucstaroptionobjs = [];\n}", "title": "" }, { "docid": "bc90e19b3a04024bf94fb4417b7cf77c", "score": "0.5043413", "text": "setSelectedObjectId(newId) {\n if (this.selectedObject && !this.objects.find(o => o._jgf_editor_object.id === newId)) {\n this.selectedObject._jgf_editor_object.id = newId;\n }\n }", "title": "" }, { "docid": "212fbaeb0df4656b8015399983f01ca7", "score": "0.503681", "text": "togglePartSelection(state, action) {\n if (state.selectedPartAndObjectInformation\n && state.selectedPartAndObjectInformation.part.part_id === action.payload.part.part_id) {\n state.selectedPartAndObjectInformation = null;\n } else {\n state.selectedPartAndObjectInformation = action.payload;\n }\n }", "title": "" }, { "docid": "7947ba9ef5c9b278ef83eae3b50e116a", "score": "0.50317895", "text": "isSelected(id) {}", "title": "" }, { "docid": "2ae9318edf104fcbbfb2e6989969142a", "score": "0.50317836", "text": "function select(_obj) {\n console.log(\"Beginning select\");\n\n // we need to deselect the object\n if (selected != null) {\n deselect();\n }\n\n selected = _obj;\n\n // attach css\n selected.children().attr(\"stroke\", \"yellow\");\n selected.children().attr(\"stroke-width\", \"5\");\n\n\n }", "title": "" }, { "docid": "2ae9318edf104fcbbfb2e6989969142a", "score": "0.50317836", "text": "function select(_obj) {\n console.log(\"Beginning select\");\n\n // we need to deselect the object\n if (selected != null) {\n deselect();\n }\n\n selected = _obj;\n\n // attach css\n selected.children().attr(\"stroke\", \"yellow\");\n selected.children().attr(\"stroke-width\", \"5\");\n\n\n }", "title": "" }, { "docid": "6340a855f9b21a6cbcf40c60c1da2e23", "score": "0.5025865", "text": "function deleteSelectedObject(){\n\t\t\t\t\t\tif(canvas.getActiveObject()!=null)\n\t\t\t\t\t\tcanvas.remove(canvas.getActiveObject());\n\t\t\t\t\t}", "title": "" }, { "docid": "f786b2c5ba379d392d14d7b297a93362", "score": "0.5024682", "text": "function getPartitionObjectById(partition_id){\n \tvar partition_object=null;\n \t//gets the list of all partitions in this simulation\n \tvar partition_list=getAllPartitionObjects();\n \tfor (var i=0; i<partition_list.length;i++){\n \t\t//find the partition with the same id in the list\n \t\tif(partition_list[i]._id == partition_id){\n \t\t\tpartition_object=partition_list[i];\n \t\t}\n \t}\n \treturn partition_object;\n }", "title": "" }, { "docid": "25d1f7d45b5588f8d7e126885d2c7ba3", "score": "0.50119233", "text": "function getSelectedAppSolutionObject(solId) {\r\n \tvar sol = {};\r\n \tfor(var i = 0; i < $scope.solList.length; i++ ) {\r\n \t\tif($scope.solList[i].solutionId == solId) {\r\n \t\t\tsol = $scope.solList[i];\r\n \t\t\tbreak;\r\n \t\t}\r\n \t}\r\n \treturn sol;\r\n }", "title": "" }, { "docid": "c1285441fed4798d0cb266d5c69240e5", "score": "0.50103253", "text": "static getSelectedItem(id) {\n const el = document.getElementById(id);\n const selectedVal = el.options[el.selectedIndex];\n\n return selectedVal;\n }", "title": "" }, { "docid": "fc394e32060a8524cd554c1eb7410cce", "score": "0.50084543", "text": "getSelected() {\r\n // Nullish coalescing operator syntax highlighting is broken, so use the long form instead.\r\n const id = $(\".selected\").next().attr(\"id\");\r\n return id ? id.split(\"-\")[0] : null;\r\n }", "title": "" }, { "docid": "77b33ae3149440d3359bb8e718d892d9", "score": "0.49999538", "text": "get selection () {\n if (! this.elem.view) return null;\n var i = this.elem.view.selection.currentIndex;\n if (i == -1) return null;\n var row = this.elem.view.getResourceAtIndex(i);\n if (! row) return null;\n return row.Value.substr(this.itemPrefix.length);\n }", "title": "" }, { "docid": "430527063d567a964761014d616efd40", "score": "0.49947602", "text": "function select()\n{\n var\tbutton\t\t= this;\t\t// invoking button\n var\tsrcform\t\t= button.form;\n var\toption\t\t= null;\t\t// selected option\n var\tidir\t\t= -1;\t\t// selected IDIR\n\n // process selected option in <select name='individ'>\n var\tselect\t\t= srcform.individ;\n if (select.selectedIndex >= 0)\n {\t\t\t// item selected\n\t\toption\t\t= select.options[select.selectedIndex];\n\t\tidir\t\t= parseInt(option.value);\n }\t\t\t// item selected\n\n if (idir > 0)\n {\t\t\t\t// individual selected\n\t\tvar\topener\t= null;\n\t\tif (window.frameElement && window.frameElement.opener)\n\t\t opener\t= window.frameElement.opener;\n\t\telse\n\t\t opener\t= window.opener;\n\t\tif (opener != null)\n\t\t{\t\t\t// invoked from another window\n\t\t var callerDoc\t= opener.document;\n\n\t\t // process the parameters\n\t\t for (var key in args)\n\t\t {\t\t\t// loop through parameters\n\t\t\t\tvar\tval\t= args[key];\n\t\t\t\tswitch(key)\n\t\t\t\t{\t\t// act on specific parameters\n\t\t\t\t case 'callidir':\n\t\t\t\t {\t\t// explicit notification back to invoker\n\t\t\t\t\t\tvar callform\t= callerDoc.forms[val];\n\t\t\t\t\t\tif (callform)\n\t\t\t\t\t\t{\t\t// form found in opener\n\t\t\t\t\t\t // explicit notify\n\t\t\t\t\t\t callform.callidir(idir);\n\t\t\t\t\t\t}\t// form found in opener\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\t// form not found\n\t\t\t\t\t\t alert(\"chooseIndivid.js: select: \" +\n\t\t\t\t\t\t\t\t \"Could not find form id=\" + val +\n\t\t\t\t\t\t\t\t \" in opener\");\n\t\t\t\t\t\t}\t// form not found\n\t\t\t\t\t\tbreak;\n\t\t\t\t }\t\t// explicit notification back to invoker\n\n\t\t\t\t case 'idir':\n\t\t\t\t case 'name':\n\t\t\t\t {\t\t// handled by PHP\n\t\t\t\t\t\tbreak;\n\t\t\t\t }\t\t// handled by PHP\n\n\t\t\t\t case 'parentsidmr':\n\t\t\t\t {\t\t// request to add a child onto a family\n\t\t\t\t\t\tvar idmr\t= val;\n\t\t\t\t\t\tvar\tchildTable\t=\n\t\t\t\t\t\t callerDoc.getElementById('children');\n if (childTable == null)\n alert(\"chooseIndivid.js: select: \" + \n \"childTable is null, callerDoc=\" + callerDoc);\n\t\t\t\t\t\tvar\tgender\t= option.className;\n\t\t\t\t\t\tvar\tparms\t= { 'idir'\t : idir,\n\t\t\t\t\t\t\t\t\t\t'givenname'\t: option.givenname,\n\t\t\t\t\t\t\t\t\t\t'surname'\t: option.surname,\n\t\t\t\t\t\t\t\t\t\t'birthd'\t: option.birthd,\n\t\t\t\t\t\t\t\t\t\t'birthsd'\t: option.birthsd,\n\t\t\t\t\t\t\t\t\t\t'deathd'\t: option.deathd,\n\t\t\t\t\t\t\t\t\t\t'gender'\t: gender\n\t\t\t\t\t\t\t\t };\n\n\t\t\t\t\t\t// add row onto table on opener's web page\n\t\t\t\t\t\t// invoke the add method of the 'children' table\n\t\t\t\t\t\tchildTable.addChildToPage(parms,\n\t\t\t\t\t\t\t\t\t\t true);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t }\t\t// request to add a child onto a family\n\n\t\t\t\t case 'id':\n\t\t\t\t {\t\t// request to invoke changePerson method\n\t\t\t\t\t\tvar\telt\t= callerDoc.getElementById(val);\n\t\t\t\t\t\tvar\tparms\t= {\n\t\t\t\t\t\t\t\t 'idir'\t\t:idir,\n\t\t\t\t\t\t\t\t 'givenname'\t: option.givenname,\n\t\t\t\t\t\t\t\t 'surname'\t: option.surname,\n\t\t\t\t\t\t\t\t 'birthd'\t: option.birthd,\n\t\t\t\t\t\t\t\t 'deathd'\t: option.deathd};\n\t\t\t\t\t\tif (elt)\n\t\t\t\t\t\t elt.changePerson(parms);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t alert(\"chooseIndivid.js: select: \" +\n\t\t\t\t\t\t\t\t \"unable to locate element id='\" + val +\n\t\t\t\t\t\t\t\t \"' in calling page\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t }\t\t// request to invoke changePerson method\n\t\t\t\t}\t\t// act on specific parameters\n\t\t }\t\t\t// loop through parameters\n\n\t\t}\t\t\t// invoked from another window\n\t\telse\n\t\t alert(\"chooseIndivid.js: select: \" +\n\t\t\t\t \"not opened from another window\");\n }\t\t\t\t// individual selected\n\n // close the chooser window\n closeFrame();\n}\t\t// function select", "title": "" }, { "docid": "7ccdf737e6d881d614825b16428937c2", "score": "0.49916", "text": "function Selection(doc){this.doc=doc;this.hasP=false;this.textOnly=false;this.callback=null;this.selectedObjects=null;this.selectedTag=\"\";this.selectedFull=false;this.debug=false;this.getSelection=n_4;this.getRange=_p0;this.createRange=$9C;this.getParent=DfD8;this.clear=R5_5;this.getType=qK9h5;this.prepareTypeDetails=$v27;this.getSelectedHtml=N3205;this.insertHtml=L41;this.getSelectedText=j7483;this.getActiveObject=m0i;this.getSelectedObjects=IFP;this.prepareSelection=U9303;this.selectObject=n95k;this.setCursorToObject=a5c4;this.setCursorToText=WIT9;this.unselect=Hn1R;this.processEnter=nM1u2;this.Lb7=Bqy1;this.A3629=_2Bv;this.__getTagHierarchy=m41;this.__replace_text_object=C0i7;this.__replace_text_objects=P90Ow;this.__selection_divide=_$LK_;this.__selection_reset=__selection_reset;this.__replace_node=n_1e;this.__remove_node=_58;this.__setMarkers=Si9$;this.__iterate=s8MN;this.__iterate_node=hT4;this.__cb_selected_objects=PLV4;this.__cb_selection_prepare=S493;this.__prepare_paragraph=k29b;this._8475=(navigator.userAgent.toLowerCase().indexOf(\"msie\")!=-1);this.type=this.getType();this.initCallback=0;this.startSelectionNode=null;this.endSelectionNode=null;}", "title": "" }, { "docid": "123e84ca7ff0fcf8e21336094a92537d", "score": "0.4987382", "text": "getSelectedDishes(type) {\n //TODO Lab 1\n }", "title": "" }, { "docid": "8ed2e0736719a4b7add9fb899496faf8", "score": "0.49825028", "text": "removePartSelection(state) {\n state.selectedPartAndObjectInformation = null;\n }", "title": "" }, { "docid": "af72805a43e2804c1c60b140bca45eb4", "score": "0.49770433", "text": "function showSelected(selectedObject) {\n // logSelected(\"show\",selectedObject);\n if (typeof options !== \"undefined\") {\n options.selected = selectedObject.name;\n options.x = selectedObject.position.x;\n options.y = selectedObject.position.y;\n options.z = selectedObject.position.z;\n options.rx = rad2deg(selectedObject.rotation.x)\n options.ry = rad2deg(selectedObject.rotation.y)\n options.rz = rad2deg(selectedObject.rotation.z);\n }\n}", "title": "" }, { "docid": "ecdb3815b7601a50bf0d0c9eb5a1d65f", "score": "0.49699423", "text": "function getObjectFromIndex(page_index , obj_index,type){\n\tvar objectSelected=null; \n\tswitch(type) {\n\t\tcase 1: objectSelected = listPages[page_index].listObj[obj_index];\n\t\tbreak;\n\t\tcase 2:objectSelected = popupObjects[obj_index];\n\t\tbreak;\n\t\tcase 3:objectSelected = listPopObject[obj_index];\n\t\tbreak;\n\t}\n\treturn objectSelected;\n}", "title": "" }, { "docid": "7d2e8f19adb46635f65bb8af01aee3f1", "score": "0.49664235", "text": "selectProject(id) {\n for (var i=0; i < this.state.projects.length; i++) {\n if (this.state.projects[i].id === id) {\n return this.state.projects[i];\n }\n }\n }", "title": "" }, { "docid": "4cb41c6aed00914a25a769f75fef8fec", "score": "0.49617726", "text": "function isSelectedCripto(id) {\n return selectedCripto === id;\n }", "title": "" }, { "docid": "4cb41c6aed00914a25a769f75fef8fec", "score": "0.49617726", "text": "function isSelectedCripto(id) {\n return selectedCripto === id;\n }", "title": "" }, { "docid": "958c58e938dc1da542a3946cc6322743", "score": "0.4958975", "text": "selectId(id) {\n this.modifierIndex = this.modifierTabs.findIndex((mm) => mm.modifier.attrs.id === id);\n }", "title": "" }, { "docid": "f7389aef30a2050c8da87c249dc53be2", "score": "0.49588", "text": "function captureSelectionState() {\n\tvar originalContent = [];\n\tvar selected = paper.project.selectedItems;\n\tfor (var i = 0; i < selected.length; i++) {\n\t\tvar item = selected[i];\n\t\tif (item.guide) continue;\n\t\tvar orig = {\n\t\t\tid: item.id,\n\t\t\tjson: item.exportJSON({ asString: false }),\n\t\t\tselectedSegments: []\n\t\t};\n\t\toriginalContent.push(orig);\n\t}\n\treturn originalContent;\n}", "title": "" }, { "docid": "ef3ad496ad3c5f249136013e90829ed8", "score": "0.4950201", "text": "isInSelection(object){\n for(var i = 0; i < this.selected.length; i++) {\n if(this.selected[i] === object)\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "4edb97cf08078c73213fbbdb97c30e1b", "score": "0.49426267", "text": "extractPart (id) {\n return id.split('-').pop()\n }", "title": "" }, { "docid": "f95b58fb7260f139a479f1afa1d14ea6", "score": "0.49394655", "text": "function handleInstanceSelection(elem) {\n // children of the li can be clicked, we need to make sure the li is the one with focus here\n elem = elem.closest(\"li\");\n\n // If the user selects the instance that is already selected, do nothing\n if ($(elem).attr(\"selected-instance\")) {\n return;\n }\n\n // close the previous selection\n $(\"#instance-accordion li[selected-instance]\").removeAttr(\"selected-instance\");\n $(\"#instance-accordion li.bx--accordion__item--active\").removeClass(\"bx--accordion__item--active\");\n\n // open the next selection\n $(elem).attr(\"selected-instance\", \"\");\n $(elem).addClass(\"bx--accordion__item--active\");\n return $(elem).find(\".bx--accordion__title\").text().trim();\n}", "title": "" }, { "docid": "0fdb9d45b03c8d4e11b9b7e9ebaeed30", "score": "0.4921993", "text": "function filterByID(obj) {\n return obj.$id === selection;\n }", "title": "" }, { "docid": "4fa4df9fd5914c862b0cc7e131307124", "score": "0.49175853", "text": "function selectPageById(pid){\n\nfor (let i = 0;i<pages.length;i++){\n if (pages[i]._id === pid) {\n\treturn pages[i];\n\t\t\t}\n\t\t}\n\t\n}", "title": "" }, { "docid": "bea4e22b110dbbb25cef9f33ddba738d", "score": "0.490713", "text": "function Select(info, Vlt) {\n\t\tvar dispatch = {\n\t\t\t//'Idle.LeftMouseDown.Artifact': start,\n\t\t\t'Select1.Move.Artifact': move,\n\t\t\t'Select1.Move.Terrain': move,\n\t\t\t'Select1.LeftMouseUp': mouseup,\n\t\t\t'Select2.Move.Artifact': move,\n\t\t\t'Select2.Move.Terrain': move,\n\t\t\t'Select2.Wheel': spin,\n\t\t\t'Select2.LeftMouseDown.Terrain': stop,\n\t\t\t'Select2.LeftMouseDown.Artifact': stop\n\t\t}\n\t\tif (info.Action == 'Harvest') {\n\t\t\tfor (key in dispatch)\n\t\t\t\tinfo.Keys.push(key);\n\t\t\treturn;\n\t\t}\n\n\t\tlet View = Vlt.div.data(\"View\");\n\t\tif (info.Key in dispatch)\n\t\t\tdispatch[info.Key]();\n\n\t\tfunction start() {\n\t\t\tconsole.log('..select/start', info);\n\t\t\tvar mouse = Vew.Mouse;\n\t\t\tmouse.Mode = 'Select1';\n\t\t\tmouse.x = info.Mouse.x;\n\t\t\tmouse.y = info.Mouse.y;\n\t\t\tView.pidSelect = info.Pid;\n\t\t}\n\n\t\t// function mouseup() {\n\t\t// \tvar mouse = Vew.Mouse;\n\t\t// \tmouse.Mode = 'Select2';\n\t\t// }\n\n\t\t// function spin() {\n\t\t// \tvar q = {};\n\t\t// \tq.Cmd = 'Move';\n\t\t// \tq.Instance = Vew.pidSelect;\n\t\t// \tq.Spin = 6.0*info.Factor;\n\t\t// \tthat.send(q, Par.View);\n\t\t// }\n\n\t\t// function move() {\n\t\t// //\tconsole.log('..move', info);\n\t\t// \tif (!('Point' in info))\n\t\t// \t\treturn;\n\t\t// \tvar q = {};\n\t\t// \tq.Cmd = 'Move';\n\t\t// \tq.Instance = Vew.pidSelect;\n\t\t// \tvar loc = [];\n\t\t// \tloc.push(info.Point.x);\n\t\t// \tloc.push(info.Point.y);\n\t\t// \tloc.push(info.Point.z);\n\t\t// \tq.Loc = loc;\n\t\t// \tthat.send(q, Par.View);\n\t\t// }\n\n\t\tfunction stop() {\n\t\t\tVew.Mouse.Mode = 'Idle';\n\t\t\tvar q = {};\n\t\t\tq.Cmd = 'Save';\n\t\t\tq.Instance = Vew.pidSelect;\n\t\t\tthat.send(q, Par.View);\n\t\t}\n\t}", "title": "" }, { "docid": "cfd80fc1a03a2f8004b7aacbd53d36f7", "score": "0.49061045", "text": "function selectFeature(objectId) {\n // query feature from the server\n bookmarksLayer.queryFeatures({\n objectIds: [objectId],\n outFields: [\"*\"],\n returnGeometry: true\n }).then(function (results) {\n if (results.features.length > 0) {\n editFeature = results.features[0];\n // display the attributes of selected feature in the form\n featureForm.feature = editFeature;\n // highlight the feature on the mapview\n mapview.whenLayerView(editFeature.layer).then(function (layerView) {\n highlight = layerView.highlight(editFeature);\n });\n attributeEditing.style.display = \"block\";\n updateInstructionDiv.style.display = \"none\";\n }\n });\n }//duped", "title": "" }, { "docid": "223a1deba8f2e3a064e60ac36bf05e31", "score": "0.4899546", "text": "function getSelectedComp() {\n return selectedComp;\n }", "title": "" }, { "docid": "e6b3f475f2db4cfd4f7fa8ce968d2d67", "score": "0.48852074", "text": "function poem_selection() {\n var $selecteur = '.selection .content .img';\n poem_addBackgound($selecteur);\n}", "title": "" }, { "docid": "a86a7e264613f92467d47e4abcc8fbf9", "score": "0.48742887", "text": "get SelectedClient(){\n return this.env.pos.attributes.selectedClient.id\n }", "title": "" }, { "docid": "703952069df82db99ee8cf168c86f411", "score": "0.48643562", "text": "function onSequenceFrameSelected(ev) {\n\tvar id = $(this).attr('id');\n\t\n\t$('.sequenceFrame').removeClass('sequenceFrameSelected');\n\t$('.sequenceObject').removeClass('sequenceFrameSelected');\n\t$('.sequenceSequence').removeClass('sequenceFrameSelected');\n\t$('.sequenceItem').removeClass('sequenceFrameSelected');\n\t$(this).addClass('sequenceFrameSelected');\n\t\n\tvar fr = sequencesFrames[id];\n\tif (fr) {\n\t\tconsole.log('selected frame '+fr.sketchId+'/'+fr.elementId);\n\t\t\n\t\tvar sketch = sketchbook.sketches[fr.sketchId];\n\t\tif (sketch) {\n\t\t\tif (fr.elementId) {\n\t\t\t\tvar action = sketchbook.selectFrameAsSequenceItemAction(sketch.id, fr.elementId);\n\t\t\t\tdoAction(action);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// sketch\n\t\t\t\tvar action = sketchbook.selectSketchAsSequenceItemAction(sketch.id);\n\t\t\t\tdoAction(action);\n\t\t\t}\n\t\t}\n\t}\n\telse \n\t\tconsole.log('could not find sequencesFrames '+id);\n}", "title": "" }, { "docid": "211223af73a04b8b6d62b0fa229fbff1", "score": "0.48593038", "text": "static getSelectedText(id) {\n return this.getSelectedItem(id).text;\n }", "title": "" }, { "docid": "7516f2198568106a6ffe09555401a38e", "score": "0.48522153", "text": "function getObject(id){\n if(!isDHTML)\n return null;\n\n var which=null;\n if(isDOM)\n which=document.getElementById(id);\n else if (isIE4)\n which=document.all(id);\n else if (isNS4)\n which=document.layers[id];\n return which;\n}", "title": "" }, { "docid": "21b440c6417fe374b818499a62b46236", "score": "0.4847704", "text": "function logID() {\n console.log(\"clicked on a graphic - this one: \", this.id);\n this.classList.add(\"selected\");\n }", "title": "" }, { "docid": "735c5da913b4df3f4f82af0c23497662", "score": "0.4835447", "text": "function getSelected() {\n\n/*\n // Update Contextual Menu if some text have been selected\n $('#description').click(function(e) {\n selection = getSelected();\n if (selection != \"\")\n {\n //updateContextMenu(pathname, selection);\n\n }\n });\n*/\n\n if(window.getSelection) { return window.getSelection(); }\n else if(document.getSelection) { return document.getSelection(); }\n else\n {\n var selection = document.selection && document.selection.createRange();\n if(selection.text) { return selection.text; }\n return false;\n }\n return false;\n}", "title": "" }, { "docid": "bbc113f898e04198a3d96322baa0ff24", "score": "0.4834134", "text": "function getPiece(id){\n\treturn pieceArr[parseInt(id.substr((id.search(/\\_/)+1),1))][parseInt(id.substring((id.search(/\\|/)+1),id.length))];\n}", "title": "" }, { "docid": "d574cac814fa8f20fc74f204712524d0", "score": "0.48298448", "text": "function selectNode(obj) {\n var allNodes = document.getElementById(\"treePane\").getElementsByTagName(\"a\");\n for (var i = 0; i < allNodes.length; i++) {\n if (YAHOO.util.Dom.hasClass(allNodes[i], \"selected\")) {\n YAHOO.util.Dom.removeClass(allNodes[i], \"selected\");\n }\n }\n selectedFlag = obj.id;\n YAHOO.util.Dom.addClass(obj, \"selected\");\n}", "title": "" }, { "docid": "cf24bc341176608bf74880187719bc5a", "score": "0.4822788", "text": "function getUploadPlace(obj) {\nvar placeType=\"\";\n console.log($(\"#\"+obj.id).find('option:selected').val());\n var val = $(\"#\"+obj.id).find('option:selected').val();\n if(val == \"Space\")\nplaceType = \"space\";\nelse if(val == \"Group\")\nplaceType =\"group\";\nelse\nplaceType = \"project\";\nvar placeName = fromUploadSpaceRequest(obj.id,val,placeType);\n$(\"#\"+obj.id).find('option:first').attr('selected', 'selected');\nconsole.log(\"place name : \"+placeName);\n}", "title": "" }, { "docid": "e4609b0d69b3291038215b63a7891290", "score": "0.48178557", "text": "function SelectionRegion() {}", "title": "" }, { "docid": "5d7de2b42aaf4b1f0913f6856dac2128", "score": "0.48143265", "text": "function getSelectedOption(){\n\n}", "title": "" }, { "docid": "188cc627481a67ee671830541a9e5d3b", "score": "0.48120585", "text": "function hierarchySelect(ev) {\r\n\tkony.print('hierarchySelect: ' + objectdump(ev))\r\n\tkony.print('breadcrumbs: ' + objectdump(breadcrumb))\r\n\tkony.print('idOfUserSelection: ' + idOfUserSelection)\r\n\t\r\n\t// find the name of the selected item\r\n\tvar lvl = getKeyByValue(breadcrumb, idOfUserSelection)\r\n\tkony.print('level of ' + idOfUserSelection + ' in breadcrumb is ' + lvl)\r\n\t// find the data collection that matches the level\r\n\tvar data = levels[lvl].data\r\n\tkony.print('matching data is ' + objectdump(data))\r\n\tvar selection = _.where(data, {id:idOfUserSelection})\r\n\tkony.print('selection is ' + objectdump(selection))\r\n\t\r\n\t// set form field with name of selection\r\n\t// TODO use info to track which form you came from, so that you set the asset text on the correct form\r\n\ttry {\r\n\t\tfrmCreateWO.lblAsset.text = selection[0].name\r\n\t\t\r\n\t\t// determine whether to show or hide valve inspection section\r\n\t\tif( selection[0].name.indexOf('valve') > -1 ) {\r\n\t\t\tkony.print('this is a valve')\r\n\t\t\tfrmCreateWO.hbxValveInspection.isVisible = true\r\n\t\t} else {\r\n\t\t\tkony.print('this is not a valve')\r\n\t\t\tfrmCreateWO.hbxValveInspection.isVisible = false\r\n\t\t}\r\n\t\t\r\n\t} catch(e) { kony.print('exception occurred with selection[0].name ... selection: ' + objectdump(selection)) }\r\n\t\t\r\n\t// dismiss the popup\r\n\tcurrentPopup.dismiss()\r\n}", "title": "" }, { "docid": "69be30de6f68cacd24725c5f6e1a6eb5", "score": "0.48085243", "text": "getSelected() {\n return this.getAttribute('selected');\n }", "title": "" }, { "docid": "e2a145b00ee05d7fc0af9b10e0f22271", "score": "0.48064744", "text": "drawSelectedObject() {\n const { primativesPanelSelection } = this.props;\n switch (primativesPanelSelection) {\n case 'Rectangle':\n case 'Circle':\n case 'Polygon':\n case 'Sensor':\n this.drawSelectedBody.call(this);\n break;\n case 'Text':\n this.drawTemporaryText();\n default:\n break;\n }\n }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.47953823", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.47953823", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.47953823", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.47953823", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.47953823", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "8b8daf096002b81c59824c71a59cfb60", "score": "0.47949833", "text": "function selectThing1(event)\n{\n AdfPage.PAGE.setSelectedEditingComponents([AdfPage.PAGE.findComponentByAbsoluteId(\"selectable1\")]); \n event.cancel(); \n}", "title": "" }, { "docid": "339f2fba0be445ad74e8b99632047143", "score": "0.4794611", "text": "getSelected(tab) {\n for (let i = 0; i < this.props.routes.length; i+=1) {\n if (this.props.routes[i].path.indexOf(tab) === 0) {\n return style.TabContainerSelected;\n }\n }\n return \"\";\n }", "title": "" }, { "docid": "b0bf1919310749eb7871aa539d5d0442", "score": "0.4794564", "text": "function selected(){\n selectedTile = $(this).attr(\"id\");\n console.log(`selected tile id: ${selectedTile} classes: ${$(this).attr(\"class\")}`);\n // debugger;\n $(this).addClass(\"selected\");\n $.ajax({url: $SCRIPT_ROOT + '/api/legal', \n method:\"POST\",\n data: {\n 'start': $(this).attr(\"id\")\n },\n success: function(result){\n renderClickable(result);\n $(`#${result.startPoint}`).click(unselect);\n }});\n}", "title": "" }, { "docid": "f9673a9de882712c56d36a5bca88ee87", "score": "0.47871974", "text": "getSelectedGroup() {\n\t\t\treturn this.state.groups[this.state.selected_group];\n\t\t}", "title": "" } ]
f91a4e9c0f466bb7eeb00128142b9d8e
(protected) r = this^2, r != this (HAC 14.16)
[ { "docid": "3347e5f9aa9357120bd26bc0104ced0f", "score": "0.0", "text": "function bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2 * x.t;\n while (--i >= 0) r[i] = 0;\n for (i = 0; i < x.t - 1; ++i) {\n var c = x.am(i, x[i], r, 2 * i, 0, 1);\n if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {\n r[i + x.t] -= x.DV;\n r[i + x.t + 1] = 1;\n }\n }\n if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\n r.s = 0;\n r.clamp();\n}", "title": "" } ]
[ { "docid": "347014d23bd626a0d84c541d58bdbb45", "score": "0.64031166", "text": "function f2(b) {\n\t\tvar t = b[0] ^ b[1];\n\t\tb[0] = b[1];\t\t\t/* X[2]\t\t\t\t\t\t\t\t\t\t*/\n\t\tb[1] = b[2];\t\t\t/* X[2]\t\t\t\t\t\t\t\t\t\t*/\n\t\tb[2] = b[3];\t\t\t/* X[4]\t\t\t\t\t\t\t\t\t\t*/\n\t\tb[3] = t;\t\t\t\t/* X[1, 2]\t\t\t\t\t\t\t\t\t*/\n\t}", "title": "" }, { "docid": "7b203511e4b2492cefe89d88695d7e28", "score": "0.61375475", "text": "get Dual() {\n if (r) {\n return this.map(\n (x, i, a) => a[drm[i]] * drms[i]\n );\n }\n var res = new this.constructor();\n res[res.length - 1] = 1;\n return res.Mul(this);\n }", "title": "" }, { "docid": "47d3b9a7a156b99d13d8744152c9c56c", "score": "0.597163", "text": "_2rdiv(val) {\n this.__2rdiv = val;\n return this;\n }", "title": "" }, { "docid": "d568dc9313ff6303edaefda265170973", "score": "0.593143", "text": "function l$r(){return !0}", "title": "" }, { "docid": "d83bd1757d3cf1e4bf2db151ac0ff779", "score": "0.59110665", "text": "function Rc(a,b){return void 0===Je[a]?!1:void 0===b?Je[a]:(Je[a]=b,!0)}", "title": "" }, { "docid": "66b1bd2cb0d5ec19390ba0404ba682b6", "score": "0.5891932", "text": "function f1(b) {\n\t\tb[0] ^= b[2];\t\t\t/* X[1, 3]\t\t\t\t\t\t\t\t\t*/\n\t\tvar t = b[1];\n\t\tb[1] ^= b[3];\t\t\t/* X[2, 4]\t\t\t\t\t\t\t\t\t*/\n\t\tb[3] = b[2] ^ b[1];\t/* X[2, 3, 4]\t\t\t\t\t\t\t\t*/\n\t\tb[2] = b[0] ^ t;\t\t/* X[1, 2, 3]\t\t\t\t\t\t\t\t*/\n\t}", "title": "" }, { "docid": "5cd9e72c193bd6e9dbb0996524c64457", "score": "0.5821791", "text": "_2bias(val) {\n this.__2bias = val;\n return this;\n }", "title": "" }, { "docid": "e9247458246b55e8db4825f2ac189262", "score": "0.57876045", "text": "function z(){r.call(this)}", "title": "" }, { "docid": "5e1189b142d4c6588fa16e7c003f1fd8", "score": "0.56356806", "text": "static RIGHT() {\r\n return new Vector2(1, 0);\r\n }", "title": "" }, { "docid": "889879e75d195f2e543cb811f91b2c16", "score": "0.5620077", "text": "get r() { return Math.hypot(this.x, this.y); }", "title": "" }, { "docid": "ec29fbe4e7af6cbec63271286d61e75c", "score": "0.55661106", "text": "function g1(b) {\n\t\tvar t = b[0];\n\t\tb[0] = b[2];\t\t\t/* X[3]\t\t\t\t\t\t\t\t\t\t*/\n\t\tb[2] = b[1] ^ t;\t\t/* X[1, 2]\t\t\t\t\t\t\t\t\t*/\n\t\tt = b[1];\n\t\tb[1] = b[3];\t\t\t/* X[4]\t\t\t\t\t\t\t\t\t\t*/\n\t\tb[3] = b[0] ^ t;\t\t/* X[2, 3]\t\t\t\t\t\t\t\t\t*/\n\t}", "title": "" }, { "docid": "6f4980356ecbc9e235c610c03e897806", "score": "0.55513877", "text": "function bnpMultiplyTo(e,t){var n=this.abs(),s=e.abs(),o=n.t;for(t.t=o+s.t;0<=--o;)t[o]=0;for(o=0;o<s.t;++o)t[o+n.t]=n.am(0,s[o],t,o,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&BigInteger.ZERO.subTo(t,t)}// (protected) r = this^2, r != this (HAC 14.16)", "title": "" }, { "docid": "0e0cc7e4cfa0ef7594d5cb225eccf6d6", "score": "0.55469245", "text": "function nextPow2( v ) {\n v--;\n v |= v >> 1;\n v |= v >> 2;\n v |= v >> 4;\n v |= v >> 8;\n v |= v >> 16;\n v++;\n return v;\n}", "title": "" }, { "docid": "b312c31372f48f29c098961748e8764f", "score": "0.5467964", "text": "function bnpMultiplyTo(a, r) {\n var x = this.abs(),\n y = a.abs();\n var i = x.t;\n r.t = i + y.t;\n\n while (--i >= 0) r.data[i] = 0;\n\n for (i = 0; i < y.t; ++i) r.data[i + x.t] = x.am(0, y.data[i], r, i, 0, x.t);\n\n r.s = 0;\n r.clamp();\n if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n} // (protected) r = this^2, r != this (HAC 14.16)", "title": "" }, { "docid": "c0afe6fe0d029dbf037d5fc400665b1f", "score": "0.54661596", "text": "static get STEP_2 () {\n\n return 0.7071067811865475;\n }", "title": "" }, { "docid": "e9df151378a7ca5e645ded069d24c6f4", "score": "0.54608727", "text": "_2m(val) {\n this.__2m = val;\n return this;\n }", "title": "" }, { "docid": "7461f180cb466e359e4fb2986c6417f8", "score": "0.54555905", "text": "function f1(d, m, r) {\n var t = m + d;\n var I = t << r | t >>> 32 - r;\n return (sBox[0][I >>> 24] ^ sBox[1][I >>> 16 & 255]) - sBox[2][I >>> 8 & 255] + sBox[3][I & 255];\n }", "title": "" }, { "docid": "d67f1fed0cd37329b95fb38a4452b5ac", "score": "0.5454981", "text": "function r(t, e) { 0 }", "title": "" }, { "docid": "f3e7e8661de58fde59e831bb09c192a8", "score": "0.5451746", "text": "function r(r,o,a,q){e=r,t=a,n=-3*r+3*o-2*a-q,i=2*r-2*o+a+q}", "title": "" }, { "docid": "25bbb4961051f65ebb7adc90210e8bb9", "score": "0.54515845", "text": "function nextpow2(rr) {\n rr = Math.log2(rr);\n rr = Math.ceil(rr);\n rr = Math.pow(2, rr);\n return rr;\n}", "title": "" }, { "docid": "ac355031e922a8d971279f3c284f7e9d", "score": "0.5450203", "text": "function bnpMultiplyTo(a, r) {\n var x = this.abs(),\n y = a.abs();\n var i = x.t;\n r.t = i + y.t;\n\n while (--i >= 0) {\n r[i] = 0;\n }\n\n for (i = 0; i < y.t; ++i) {\n r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n }\n\n r.s = 0;\n r.clamp();\n if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n} // (protected) r = this^2, r != this (HAC 14.16)", "title": "" }, { "docid": "75475506dc846439df4738cf80c0d66a", "score": "0.54436743", "text": "xor(rhs) {\n const usingColor = this.index < rhs.index ? this.color : rhs.color;\n return new ImageMask({color: usingColor, bit: this.bit ^ rhs.bit});\n }", "title": "" }, { "docid": "ed8e312864ce1c52d548c915ff5f6406", "score": "0.5437057", "text": "get mod() {\n return Math.sqrt(this.real * this.real + this.imag * this.imag);\n }", "title": "" }, { "docid": "c2d9647e487cef23506427f3487e895d", "score": "0.5430081", "text": "function r(b) {\n return Math.log(-b + Math.sqrt(sq(b)+1));\n }", "title": "" }, { "docid": "c2d9647e487cef23506427f3487e895d", "score": "0.5430081", "text": "function r(b) {\n return Math.log(-b + Math.sqrt(sq(b)+1));\n }", "title": "" }, { "docid": "c2d9647e487cef23506427f3487e895d", "score": "0.5430081", "text": "function r(b) {\n return Math.log(-b + Math.sqrt(sq(b)+1));\n }", "title": "" }, { "docid": "46ae1d08a63a20bd1450aab5c4fe1602", "score": "0.54284346", "text": "function r(e,t){\n// SameValue algorithm\n// SameValue algorithm\nreturn e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}", "title": "" }, { "docid": "75e71b2a51ebe97ee7dd3d8613a69902", "score": "0.5424906", "text": "inverse() {\n return this.multiply(-1);\n }", "title": "" }, { "docid": "674c936ded9dc6b7cef75304a2b973de", "score": "0.54137003", "text": "function A(){r.call(this)}", "title": "" }, { "docid": "7bbd196d200926c8485b65a0110af7ef", "score": "0.53934014", "text": "function r(__) {\n const versor = __.versor;\n const v1 = versor.cartesian(__.proj.rotate(r0).invert(_.mouse)),\n q1 = versor.multiply(q0, versor.delta(v0, v1));\n _.r = versor.rotation(q1);\n }", "title": "" }, { "docid": "3bb9dc5db45b24d42e2ac3873e5f7ccb", "score": "0.5385261", "text": "get r() {\n return this._r;\n }", "title": "" }, { "docid": "ea5eb1fb1458935d5b949b372063dd7a", "score": "0.538467", "text": "function C(){r.call(this)}", "title": "" }, { "docid": "2c88c95bbc4d2349efa6f157f06fb609", "score": "0.53791887", "text": "function B0_2(t) { return (1 - t) * (1 - t); }", "title": "" }, { "docid": "2f8b85d30208e815eeb9f96f529dc30c", "score": "0.53743815", "text": "function bnpIsEven() {\n return (this.t > 0 ? this.data[0] & 1 : this.s) == 0;\n} // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)", "title": "" }, { "docid": "5a634e0cf8ab572f814329f760eb0e1e", "score": "0.53638226", "text": "get r() {\n return this._r\n }", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5360123", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5360123", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5360123", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5360123", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5360123", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5360123", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5360123", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5360123", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5360123", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5360123", "text": "function r(){}", "title": "" }, { "docid": "2757f5ddad9309a2718f1ddbf48affc5", "score": "0.53448206", "text": "function sc_bitUrsh(x, y) {\n return x >>> y;\n}", "title": "" }, { "docid": "e0fcbcb94be0b488296481cdcfb8bbc5", "score": "0.5343263", "text": "function qr(t) {\n switch (t) {\n case 0 /* Set */ :\n // fall through\n case 2 /* MergeSet */ :\n // fall through\n case 1 /* Update */ :\n return !0;\n\n case 3 /* Argument */ :\n case 4 /* ArrayArgument */ :\n return !1;\n\n default:\n throw ye();\n }\n}", "title": "" }, { "docid": "bd1359c2a6bd92f7f3255b313bb29f4e", "score": "0.5341288", "text": "rnorm() {\n const temp = this._0;\n this._0 = this._1;\n this._1 = -temp;\n return this;\n }", "title": "" }, { "docid": "c9b555e915f255205a1c9ce99d8a1a28", "score": "0.5334038", "text": "function f() {\n var x = 0;\n var y = 0;\n x ^= undefined;\n x /= 1;\n NaN;\n y %= 1;\n y = 1;\n f();\n y = -2;\n x >>= 1;\n 0;\n (y + (y + (y + ((y ^ x % 5) + y))) + (y + y) >> y) + y;\n}", "title": "" }, { "docid": "49d7d5b0cbdb688177962b8641308777", "score": "0.53269464", "text": "function r(t, e) {\n 0\n }", "title": "" }, { "docid": "49d7d5b0cbdb688177962b8641308777", "score": "0.53269464", "text": "function r(t, e) {\n 0\n }", "title": "" }, { "docid": "f45232623a9a7d666ac23328c715ec42", "score": "0.53108096", "text": "function r(t,n){0}", "title": "" }, { "docid": "f45232623a9a7d666ac23328c715ec42", "score": "0.53108096", "text": "function r(t,n){0}", "title": "" }, { "docid": "f45232623a9a7d666ac23328c715ec42", "score": "0.53108096", "text": "function r(t,n){0}", "title": "" }, { "docid": "f45232623a9a7d666ac23328c715ec42", "score": "0.53108096", "text": "function r(t,n){0}", "title": "" }, { "docid": "f45232623a9a7d666ac23328c715ec42", "score": "0.53108096", "text": "function r(t,n){0}", "title": "" }, { "docid": "f45232623a9a7d666ac23328c715ec42", "score": "0.53108096", "text": "function r(t,n){0}", "title": "" }, { "docid": "f45232623a9a7d666ac23328c715ec42", "score": "0.53108096", "text": "function r(t,n){0}", "title": "" }, { "docid": "f45232623a9a7d666ac23328c715ec42", "score": "0.53108096", "text": "function r(t,n){0}", "title": "" }, { "docid": "3dcc64d6899dc820763abb274008672a", "score": "0.53016865", "text": "get x2() { return this.x + this.width; }", "title": "" }, { "docid": "911936fc74a342beeb2a6c18a535467d", "score": "0.5300598", "text": "a2_dot(w2)\n {\n return w2;\n }", "title": "" }, { "docid": "26e3962cee74841e133712f0e5f4e722", "score": "0.52884305", "text": "function r(t, e) {\n 0\n }", "title": "" }, { "docid": "26e3962cee74841e133712f0e5f4e722", "score": "0.52884305", "text": "function r(t, e) {\n 0\n }", "title": "" }, { "docid": "26e3962cee74841e133712f0e5f4e722", "score": "0.52884305", "text": "function r(t, e) {\n 0\n }", "title": "" }, { "docid": "adc5ad27e9efe7d83336a99d38a9e3d5", "score": "0.52872914", "text": "setRealBits_() {\n if (this.bits > 8) {\n this.realBits_ = ((this.bits - 1) | 7) + 1;\n }\n }", "title": "" }, { "docid": "53b89682d0e8125c93e44fad728c4b35", "score": "0.5285549", "text": "function fatorialRecursivo(r) {\n if(r == 1) {\n return 1\n } else {\n return r * fatorialRecursivo(r - 1)\n }\n}", "title": "" }, { "docid": "e8e5bea50b18a7a62ceeb569b8603c58", "score": "0.528477", "text": "_refreshPOT()\n {\n this.isPowerOfTwo = isPow2(this.realWidth) && isPow2(this.realHeight);\n }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" }, { "docid": "9c07fffebebf5df907dd86ae4961b8ee", "score": "0.52777916", "text": "function op_xor(x,y) { return x^y; }", "title": "" } ]
ad09f9c3ed1a2bfa9484cac56836b874
Smooths incomming data, creates dataselect table
[ { "docid": "7befe1d9ac9aaac2ddba75c1d9ea7308", "score": "0.6421254", "text": "function InitTable() {\n if (!Exists(fileData)) { return; }\n tableData = [];\n tableCollumns = [];\t\n\t\n //get collums\n var keys = Object.keys(fileData[0]);\n keys.forEach(function (k) {\n if (!$.isArray(fileData[0][k])) {\n tableCollumns.push({ title: k });\n for (var j = 0; j < fileData.length; j++) {\n if (tableData.length == j) { tableData.push([]); }\n if (!Exists(fileData[j][k])) {\n fileData[j][k] = \"-\";\n }\n tableData[j].push(fileData[j][k])\n }\n\n }\n }, this);\n Reorder(\"filename\", \"name\");\n\n //do some horrible hack to copy\n selectedTableDataSource = JSON.parse(JSON.stringify(tableData));\n selectedTableCollumns = JSON.parse(JSON.stringify(tableCollumns));\n \n //create the selected table\n selectedDataTable = selectedTable.DataTable({\n data: selectedTableData,\n scrollX: true,\n paging: false,\n searching: false,\n columns: selectedTableCollumns,\n fnRowCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {\n console.log(aData);\n $('td', nRow).css(\"background\", 'linear-gradient(rgba(0,0,0,0),' + d3ColourToCss(d3.rgb(c10(Find(selectedTableData, aData[1], 1))), 0.5) + ')');\n }\n });\n\n //add in the select collumn\n for (var i = 0; i < tableData.length; i++) {\n tableData[i].unshift(\"\");\n }\n tableCollumns.unshift({ title: \"Select\" });\n\n table.html(\"\");\n dTable = table.DataTable({\n fnRowCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {\n if (inChart.length > 0) {\n if (DataParser.MatchingEvents(inChart[0], fileData[iDisplayIndexFull])) {\n $('td', nRow).removeClass('redbg');\n $('td', nRow).prop('disabled', false);\n } else {\n $('td', nRow).addClass('redbg');\n $('td', nRow).prop('disabled', true);\n }\n } else {\n $('td', nRow).removeClass('redbg');\n $('td', nRow).prop('disabled', false);\n }\n },\n data: tableData,\n //scrollX: true,\n // scrollY: \"500px\",\n // scrollCollapse: true,\n columns: tableCollumns,\n select: {\n style: 'multi',\n selector: 'td:first-child'\n },\n order: [[3, 'desc']],\n columnDefs: [\n {\n orderable: false,\n className: 'select-checkbox',\n targets: 0\n },\n {\n \"targets\": [1],\n \"width\": \"10px\"\n },\n {\n \"targets\": [4, 5, 6, 7, 8, 9, 10, 11],\n \"visible\": false,\n },\n ]\n });\n dTable\n .on('select', function (e, dt, type, indexes) {\n AddToChart(indexes[0]);\n })\n .on('deselect', function (e, dt, type, indexes) {\n RemoveFromChart(indexes[0]);\n });\n}", "title": "" } ]
[ { "docid": "446d0e43bdabecd0d426184a4ee8f380", "score": "0.6581067", "text": "function setData() {\n\tvar rows = db.execute('SELECT * FROM igreja where igreja.id NOT IN (SELECT pregacao.igreja FROM igreja INNER JOIN pregacao ON igreja.id = pregacao.igreja WHERE pregacao.sermao =\"' + idSermao + '\") ');\n\tvar dataArray = [];\n\twhile (rows.isValidRow()) {\n\t\tvar vnome = rows.fieldByName('nome');\n\t\tvar vid = rows.fieldByName('id');\n\t\tdataArray.push({\n\t\t\ttitle : vnome,\n\t\t\thasCheck : false,\n\t\t\tid : vid,\n\t\t});\n\n\t\trows.next();\n\t\ttableview.setData(dataArray);\n\t};\n\tdb.close();\n}", "title": "" }, { "docid": "e35ad4c7504f47da6f6bb8c2f4191763", "score": "0.6574984", "text": "function selectRows(data) {\n \t\n }", "title": "" }, { "docid": "3f7def7d6679249b82489fe113cce0b8", "score": "0.6374493", "text": "function dataProcess(data) {\n mydata = data;\n let listOfColumnNames = data.columns;\n for (name in listOfColumnNames) {\n if (listOfColumnNames[name] !== \"lat\" && listOfColumnNames[name]!==\"lng\"){\n addNameInSelect(listOfColumnNames[name]);\n }\n }\n $('select').formSelect();\n}", "title": "" }, { "docid": "bd2b25dde77a28e9f2587cc1dfa4b043", "score": "0.62798476", "text": "function populateDataTable(data) {\n console.log(\"populating data table...\");\n // clear the table before populating it with more data\n\n $(\"#cyber\").DataTable().clear();\n if(0 == data.length) {\n $(\"#cyber\").DataTable().draw();\n }\n for(let i of Object.keys(data)){\n var result = data[i];\n\n $('#cyber').dataTable().fnAddData( [\n i,\n result.Result\n ]);\n }\n }", "title": "" }, { "docid": "bb8074c2c7dace396f84122d657caf48", "score": "0.622828", "text": "function generate_dt_local(data) {\n $(\"#iSearch\").val(\"\");\n $(\"#iSearch\").unbind();\n $('.table').html(\"\");\n $(\"#table_length\").html(\"\");\n $( \".DTTT\" ).html(\"\");\n $('.dt-panel').show();\n ocultar_capas();\n $('.table').html(data);\n $('#example').DataTable();\n $(\"#iSearch\").focus();\n}", "title": "" }, { "docid": "91f7f34876c5b1de8bf64a61dedc6eef", "score": "0.60836595", "text": "function show_bike_table() {\n\t\n\t// station selected\n\tvar station_selected = document.getElementById(\"station_id_dd\");\n\tvar strUser1 = station_selected.options[station_selected.selectedIndex].value;\n\tstrUser1 = parseInt(strUser1)\n\t\n\t// date selected\n\tvar date_selected = document.getElementById(\"date_dd\");\n\tvar strUser2 = date_selected.options[date_selected.selectedIndex].value;\n\tstrUser2 = parseInt(strUser2)\n\t\n\t// time selected\n\tvar time_selected = document.getElementById(\"time_id_dd\");\n\tvar strUser3 = time_selected.options[time_selected.selectedIndex].value;\n\tstrUser3 = parseInt(strUser3)\n\t\n\t// get data from DB with arguments: station and timestamps (composed from selections above)\n\tget_station_dynamic(strUser1, (strUser2+strUser3), (strUser2+strUser3+3599));\n\t\n}", "title": "" }, { "docid": "107d8584322d177d7154e849731aa16d", "score": "0.60726213", "text": "function fetch(){\n\tlet DataFrame = dfjs.DataFrame;\n var vals = document.getElementById(\"datasets\");\n currentLoadedData = vals.options[vals.selectedIndex].value;\n DataFrame.fromCSV(currentLoadedData).then(df => \n {\n data = df.toJSON('HousingJSON.json'); \n\t\tdatasetToDisplay = data;\t\t\n\t\tverticalSelection = df.toArray();\n\t\tcolumn = df.listColumns();\n\t\tvar div = document.getElementById('table');\n\t\tmakeTableStyle(div);\n\tif(div)\n\t{\n\t\tdiv.innerHTML = \"\";\n\t}\n\tvar displayTable = \"<table id='dataTable' class='table table-striped table-bordered' align='left' style=' display:block; overflow: auto; overflow-x: visible;' cellspacing='0' width=100% height='500'><thead><tr>\";\n\tfor (var i =0; i < column.length; i++) {\n\t\tdisplayTable+= \"<th>\" +column[i]+ \"</th>\";\n\t}\n\tdisplayTable+= \"</tr></thead>\";\n\tdisplayTable+= \"<tbody>\";\n\tfor (var i = 1; i < verticalSelection.length; i++) {\n\t\tdisplayTable+= \"<tr>\";\n\t\tfor(var j=0;j<verticalSelection[i].length;j++){\n\t\tdisplayTable+= \"<td>\" +verticalSelection[i][j]+\" </td>\";\n\t\t}\n\t\tdisplayTable+=\"</tr>\";\n\t}\n\t\n\tdisplayTable+=\"</table>\";\n\tvar Columns = makeColumnHeaderForTable(verticalSelection);\n\tmakeFilterElements();\n makeObjects(column);\n\t\t\t\n\tdiv.innerHTML = displayTable;\n\t\n\t\t\t$('#dataTable').DataTable({\n\t\t\t\t\"paging\": true,\n\t\t\t\t\"ordering\": true,\n\t\t\t\t\"info\": false,\n\t\t\t\t\"lengthMenu\": [[10, 25, 50, -1], [10, 25, 50, \"All\"]]\n\t\t\t\t\n\t\t\t});\t\t\n });\n}", "title": "" }, { "docid": "a4e3d6a29c5367d2a78dfe667f663863", "score": "0.6059803", "text": "function MSM_FillSelectTable() {\n //console.log( \"===== MSM_FillSelectTable ========= \");\n\n // check if school has multiple departments, needed for allowed_clusters\n let school_has_multiple_deps = false;\n if (setting_dict.sel_school_depbases ){\n const depbase_arr = setting_dict.sel_school_depbases.split(\";\");\n school_has_multiple_deps = depbase_arr && depbase_arr.length > 1;\n };\n //console.log( \" setting_dict.sel_school_depbases: \", setting_dict.sel_school_depbases);\n //console.log( \" school_has_multiple_deps: \", school_has_multiple_deps);\n\n // cluster has no base table\n const base_pk_field = \"id\"\n const caption_none = loc.No_ + loc.Clusters.toLowerCase();\n\n let tblBody_select = el_MSM_tblbody_select;\n tblBody_select.innerText = null;\n\n let has_selected_rows = false;\n\n// --- loop through data_rows\n // data_array contains a list of strings with cluster_id's\n console.log( \" mod_MSM_dict.allowed_clusters: \", mod_MSM_dict.allowed_clusters);\n const allowed_clusters_pk_arr = (mod_MSM_dict.allowed_clusters_pk_arr) ? mod_MSM_dict.allowed_clusters_pk_arr : [];\n\n // PR2023-05-29 filter allowed subjects\n const allowed_subjbase_pk_arr = (mod_MSM_dict.allowed_subjbase_pk_list) ? mod_MSM_dict.allowed_subjbase_pk_list : [];\n\n //console.log( \" allowed_clusters_pk_arr: \", allowed_clusters_pk_arr);\n\n for (const data_dict of Object.values(cluster_dictsNEW)) {\n\n const show_row = (allowed_subjbase_pk_arr && allowed_subjbase_pk_arr.length) ? (allowed_subjbase_pk_arr.includes(data_dict.subjbase_id)) : true;\n if (show_row){\n console.log( \" data_dict: \", data_dict)\n const pk_int = data_dict.id;\n const row_is_selected = (pk_int && allowed_clusters_pk_arr && allowed_clusters_pk_arr.includes(pk_int));\n\n console.log( \" pk_int: \", pk_int);\n console.log( \" ==== row_is_selected: \", row_is_selected);\n if(row_is_selected){\n has_selected_rows = true;\n };\n\n const row_index = -1;\n MSM_FillSelectRow(tblBody_select, data_dict, row_is_selected);\n };\n };\n\n //console.log( \" >>>>>>>>>> has_selected_rows: \", has_selected_rows);\n\n// --- add 'all' at the beginning of the list, with id = 0, make selected if no other rows are selected\n const data_dict = {};\n data_dict.id = -9;\n data_dict.name = \"<\" + loc.All_ + loc.Clusters.toLowerCase() + \">\"\n\n const row_index = 0;\n // select <All> when has_selected_rows = false;\n MSM_FillSelectRow(tblBody_select, data_dict, !has_selected_rows, true) // true = insert_at_index_zero\n\n } // MSM_FillSelectTable", "title": "" }, { "docid": "413c58656e7f22646ee0c6551e7aa9b4", "score": "0.6043188", "text": "function createDataTable() {\r\n $('#table1 tbody').html('');\r\n for (var i = 0; i < g_linedata.length; i++) {\r\n var x = g_linedata[i][0];\r\n var y = g_linedata[i][1];\r\n if (i == g_linedata.length - 1) var dataTo = toKm(g_all_result['maxdis']);\r\n else var dataTo = toKm(parseFloat(g_linedata[i + 1][0]));\r\n //var dataTo = toKm(parseFloat(x)+g_search_info_level2.kmfreq/1000.0);\r\n var htmlcode = \"<tr><td>\" + toKm(x) + \" - \" + dataTo + \"</td><td>\" + y + \"</td></tr>\";\r\n $('#table1 tbody').append(htmlcode);\r\n }\r\n //console.log($('.tablescroll_head'));\r\n if ($('.tablescroll').length === 0) $('#table1').tableScroll({\r\n height: 320,\r\n width: 290\r\n });\r\n }", "title": "" }, { "docid": "316f44536616a9ae79fbfc5aae8938bf", "score": "0.6040057", "text": "function populateTables(table, data) {\n if (data.length > 0) {\n var amountToShow = data.length > 10 ? 10 : data.length\n for (i = 0; i < amountToShow; i++) {\n $(`#${table}`).append(`\n <tr>\n <th scope=\"col\">${data[data.length - 1 - i].name}</th>\n <th scope=\"col\">${data[data.length - 1 - i].endLoc}</th>\n <th scope=\"col\">${moment(data[data.length - 1 - i].plannedOn).format(\"MM/DD/YYYY\")}</th>\n <th scope=\"col\">${moment(data[data.length - 1 - i].leaveDate).format(\"MM/DD/YYYY\")}</th>\n <th scope=\"col-auto\"><button class=\"btn btn-primary switch-element-btn\" id=\"loadSearchPage\" data-hide=\"selectionPage\" data-show=\"destinationPage\" data-search=\"${data.length - 1 - i}\" data-user=\"true\"><i class=\"fas fa-file-export\"></i></button></th>\n </tr>\n `)\n }\n }\n}", "title": "" }, { "docid": "4cd13169d6de19f097c48abc9651a7ee", "score": "0.60321194", "text": "function generateTable(data) {\n noResults.style('display', 'none');\n tableBody.html('');\n table.style('display', 'table');\n data.forEach(result => {\n var row = tableBody.append('tr');\n var date = row.append('td').text(result.datetime).attr('class', 'datetime').on('click', lookUp);\n var city = row.append('td').text(result.city).attr('class', 'city').on('click', lookUp);\n var state = row.append('td').text(result.state).attr('class', 'state').on('click', lookUp);\n var country = row.append('td').text(result.country).attr('class', 'country').on('click', lookUp);\n var shape = row.append('td').text(result.shape).attr('class', 'shape').on('click', lookUp);\n var duration = row.append('td').text(result.durationMinutes).attr('class', 'duration');\n var description = row.append('td').text(result.comments).attr('class', 'description');\n });\n}", "title": "" }, { "docid": "f9ed7942c013613333873e4405db15a5", "score": "0.60279506", "text": "function load_all_select() {\n\n tableData = data;\n filteredData = tableData\n // Get all inputElement values\n let inputValueDate = d3.select(\"#selectDate\").property(\"value\");\n let inputValueCity = d3.select(\"#selectCity\").property(\"value\");\n let inputValueState = d3.select(\"#selectState\").property(\"value\");\n let inputValueCountry = d3.select(\"#selectCountry\").property(\"value\");\n let inputValueShape = d3.select(\"#selectShape\").property(\"value\");\n\n console.log(inputValueDate);\n console.log(inputValueCity);\n console.log(inputValueState);\n console.log(inputValueCountry);\n console.log(inputValueShape);\n\n\n // For each inputElement where a value has been chosen from its dropdownlist, filter the \n if (inputValueDate != \"Select Date\") {var filteredData = tableData.filter(tableData => {return tableData.datetime == inputValueDate});};\n tableData = filteredData;\n if (inputValueCity != \"Select City\") {var filteredData = tableData.filter(tableData => {return tableData.city == inputValueCity});};\n tableData = filteredData;\n if (inputValueState != \"Select State\") {var filteredData = tableData.filter(tableData => {return tableData.state == inputValueState});}\n tableData = filteredData;\n if (inputValueCountry != \"Select Country\") {var filteredData = tableData.filter(tableData => {return tableData.country == inputValueCountry});};\n tableData = filteredData;\n if (inputValueShape != \"Select Shape\") {var filteredData = tableData.filter(tableData => {return tableData.shape == inputValueShape});};\n tableData = filteredData;\n\n console.log(filteredData.length);\n console.log(filteredData);\n tableData = filteredData;\n\n // Fill tbody with filteredData\n //###############################################################\n var tbody = d3.select(\"tbody\");\n\n tbody.html(\" \");\n\n filteredData.forEach((f) => {\n console.log(f);\n var row = tbody.append(\"tr\");\n Object.entries(f).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "42b5623c4a60f9728b40f5544198763f", "score": "0.59850025", "text": "function fill_table(_data){\n\n\tfor (var i = 0; i < _data.length; i++){\n\t\tvar row = create_row()\n\t\trow.append(\"td\").text(_data[i].datetime);\n\t\trow.append(\"td\").text(_data[i].city.replace( /\\b./g, function(a){ return a.toUpperCase(); } ));\n\t\trow.append(\"td\").text(_data[i].state.toUpperCase());\n\t\trow.append(\"td\").text(_data[i].country.toUpperCase());\n\t\trow.append(\"td\").text(_data[i].shape);\n\t\trow.append(\"td\").text(_data[i].durationMinutes);\n\t\trow.append(\"td\").text(_data[i].comments);\n\n\t}\n\n}", "title": "" }, { "docid": "76f2f293b54a012b8e414f63844af349", "score": "0.5973433", "text": "function fillData(selValue){\n // var getCity = tableData.filter(searcheCity => searcheCity.city);\n // console.log(getCity);\n var optionData = [];\n tableData.forEach((ufoData)=>{\n Object.entries(ufoData).forEach(([key,value])=>{\n if(key === selValue)\n optionData.push(value);\n });\n });\n var optionsArray = removeDuplicates(optionData);\n addSelect(selValue,optionsArray);\n}", "title": "" }, { "docid": "4f30a6239b46e34a345642c026c12a21", "score": "0.5967685", "text": "function FillTblRows() {\n console.log( \"===== FillTblRows === \");\n console.log( \" selected_btn: \", selected_btn);\n console.log( \" selected: \", selected);\n\n const tblName = get_tblName_from_selectedBtn() // tblName = userapproval, usercompensation or userdata\n const field_setting = field_settings[selected_btn];\n const data_dicts = get_datadicts_from_selectedBtn();\n\n// PR2023-07-11 show/hide sbr_select\n //add_or_remove_class(el_SBR_select_level.parentNode, cls_hide, (!selected.sel_depbase_pk || !selected.sel_lvl_req) )\n //if (el_SBR_select_department){\n // el_SBR_select_department.value = (selected.sel_depbase_pk) ?selected.sel_depbase_pk : \"-9\";\n //};\n //if (el_SBR_select_level){\n // el_SBR_select_level.value = (selected.sel_lvlbase_pk) ?selected.sel_lvlbase_pk : \"-9\";\n //};\n\n// --- get list of hidden columns\n const col_hidden = get_column_is_hidden();\n\n// --- reset table\n tblHead_datatable.innerText = null;\n tblBody_datatable.innerText = null\n\n// --- create table header and filter row\n CreateTblHeader(field_setting, col_hidden);\n\n// --- create table rows\n if(data_dicts){\n\n// --- loop through data_rows\n for (const data_dict of Object.values(data_dicts)) {\n\n // PR2023-07-11 filter on depbase and lvlbase, don't use sel_depbase_pk and sel_lvlbase_pk\n let show_row = false;\n if (selected_btn === \"btn_correctors\"){\n if (!selected.sel_depbase_pk){\n show_row = true;\n } else {\n if (!selected.sel_dep_level_req){\n show_row = (!data_dict.allowed_depbase_pk_arr ||\n data_dict.allowed_depbase_pk_arr.includes(-9) ||\n data_dict.allowed_depbase_pk_arr.includes(selected.sel_depbase_pk));\n } else {\n if (data_dict.allowed_depbase_pk_arr.includes(selected.sel_depbase_pk)){\n show_row = (!data_dict.allowed_lvlbase_pk_arr ||\n data_dict.allowed_lvlbase_pk_arr.includes(-9) ||\n data_dict.allowed_lvlbase_pk_arr.includes(selected.sel_lvlbase_pk));\n };\n };\n };\n } else if ([\"btn_usercompensation\", \"btn_usercomp_agg\"].includes(selected_btn)){\n if (!selected.sel_dep_level_req){\n if (!selected.sel_depbase_pk){\n show_row = true;\n } else {\n show_row = (data_dict.uc_depbase_id === selected.sel_depbase_pk);\n };\n } else {\n if (!selected.sel_depbase_pk){\n show_row = true;\n } else {\n if (!selected.sel_lvlbase_pk){\n show_row = (data_dict.uc_depbase_id === selected.sel_depbase_pk);\n } else {\n show_row = (data_dict.uc_lvlbase_id === selected.sel_lvlbase_pk);\n };\n };\n };\n\n } else if (selected_btn === \"btn_userdata\"){\n show_row = true;\n };\n if(show_row){\n CreateTblRow(tblName, field_setting, data_dict, col_hidden);\n };\n };\n };\n// --- filter tblRow\n if (tblBody_datatable.rows.length){\n t_Filter_TableRows(tblBody_datatable, filter_dict, selected, loc.Item, loc.Items);\n };\n }", "title": "" }, { "docid": "106fce64f43ceebbc6ce00ec4cd2b84a", "score": "0.5961297", "text": "function gotData_2(data) {\n\n remove_Table_2();\n createTable_2();\n\n table = document.getElementById('lampIN');\n\n let array = new Array();\n\n var lamps = data.val();\n var keys = Object.keys(lamps);\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n\n array[0] = lamps[k].date;\n array[1] = lamps[k].lampID;\n array[2] = lamps[k].lampName;\n array[3] = lamps[k].fixture;\n array[4] = lamps[k].qty;\n array[5] = lamps[k].pers;\n array[6] = lamps[k].location;\n array[7] = lamps[k].notes;\n\n // create a new row\n var newRow = table.insertRow(i + 1);\n\n for (var j = 0; j < 8; j++) {\n\n // create a new cell\n var cell = newRow.insertCell(j);\n\n // add value to the cell\n cell.innerHTML = array[j];\n }\n }\n // Hide first column of the table (with database keys)\n // for (var i = 0; i <= keys.length; i++) {\n // table.rows[i].cells[0].style.display = 'none';\n // }\n for (var i = 1; i <= keys.length; i++) {\n table.rows[i].cells[2].id = 'colName';\n table.rows[i].cells[3].id = 'colFxt';\n table.rows[i].cells[4].id = 'colQty';\n }\n let testMode = document.getElementsByName('test/real');\n if (testMode[0].checked) {\n table.classList.add('borderColorGrey');\n } else {\n table.classList.add('borderColorRed');\n }\n}", "title": "" }, { "docid": "eaf434f1e3b11e2b54a832b87e0f96d5", "score": "0.5959557", "text": "function tableBuild(data) {\n //used to clear current data on table\n tbody.html(\"\");\n //used forEach to itrate through each ro of data\n data.forEach((row) => {\n //created variable to create a new row on the table\n var dataRow = tbody.append('tr');\n //read values from each row of the dataset\n Object.values(row).forEach((value) => {\n //appened the new row in order to accept the values\n var cell = dataRow.append('td');\n //inserted the values into each corresponing cell on the table\n cell.text(value);\n })\n })\n}", "title": "" }, { "docid": "bceb8fa0ed6512f36c0a6f9d7987f1cc", "score": "0.59485984", "text": "function createAnzeige(data) {\n var e, i = 0, j, l = data.entries.length,\n lang = data.lang, id,\n barcode_present = ['&#10007;', '&#8730;'];\n createTableHeader(data.fields);\n\n\n\n\tvar tabledata = [];\n for ( var i=0 ; i<l; i++ ) {\n\t e = data.entries[i];\n\t tablerow = {};\n\n\t if (e.barcode != '0') {\n tablerow['DT_RowClass'] = 'has_barcode';\n }\n\n\t for (var j=0; j < data.fields.length; j++) {\n\t\tid = data.fields[j][0];\n\n if (id == 93) {\n tablerow[j] = barcode_present[e.barcode];\n } else if (id == 27) {\n tablerow[j] = e.species;\n } else if (id == 28) {\n tablerow[j] = e.vernacular;\n } else if (id == 19) {\n tablerow[j] = e.taxon;\n } else if (id == 22) {\n tablerow[j] = e.institute;\n } else {\n if (e.data[id]) {\n tablerow[j] = e.data[id];\n } else {\n tablerow[j] = '';\n }\n }\n\t }\n\t tabledata.push(tablerow);\n\t}\n\n\n\tvar tablecolumns = [];\n\n\tfor (var j=0; j < data.fields.length; j++) {\n\t // generate array of {tabledata: 'index'} objects \n\t tablecolumns.push({'data': j})\n\t}\n\n\n if (i > 0) {\n\n\t // set table generation parameters depending on row number\n\t var paging = false;\n\t var defrender = false;\n\t var scroller = false;\n\t if (i > 10000) {\n\t\tpaging = true;\n\t\tdefrender = true;\n\t\t//scroller = {\n\t\t// loadingIndicator: true \n\t\t//}\n\t\t// switch line break off in cells to enable scrollers.js deferred loading capabilities\n\t\t//$('.dataTable').css('white-space', 'nowrap');\n\t }\n\n\n var resulttable = $('#viewTable').DataTable({\n\t\t'data': tabledata,\n\t\t'columns': tablecolumns,\n\t\t// try scroller\n\t\t\"scroller\": scroller,\n\t\t\"deferRender\": defrender,\n \"pagingType\": \"full_numbers\",\n \"scrollX\": true,\n \"scrollY\": 200,\n \"scrollCollapse\": false,\n \"paging\": paging,\n\t\t\"lengthMenu\": [ 10, 50, 100, 500, 1000 ],\n\t\t//wait 400ms between each keypress adding a letter in search field \n\t\t\"searchDelay\": 400,\n\t\t// pageLength is set below because of performance problems when set here\n\t\t//\"pageLength\": \"100\",\n \"language\": {\n \"url\": \"/static/js/DataTables/\" + BOL.get_lang() + \".txt\"\n }\n //\"order\": [[1, \"asc\"]]\n });\n\n\t // setting pageLength in parameters kills performance when loading new pages\n\t resulttable.page.len(1000).draw;\n\n $(\"#viewTable\").removeClass('hidden');\n $(\"#viewCounter\").html(BOL.sentences(0) + i);\n }\n }", "title": "" }, { "docid": "c4799d68d27c8ebae38c5cb2d50486a0", "score": "0.5923736", "text": "function fetchData(type) {\n \n // Constant time interval for the incremental fetch case\n // in milliseconds\n var FETCH_TIME_INTERVAL = 2000000;\n \n var startRow;\n var stopRow;\n \n // if we perform an incremental fetch\n if(type == \"incFetch\"){\n var records = dataTable.getRecordSet().getRecords();\n startRow = parseInt(records[records.length-1].getData().id) + 1;\n stopRow = startRow + FETCH_TIME_INTERVAL;\n }\n // if we perform a filtering action \n else if (type == \"filter\"){\n startRow = Dom.get(\"startRowTextBox\").value\n stopRow = Dom.get(\"stopRowTextBox\").value\n \n // Zero-padding of the startRow and stopRow if the number of digits is\n // less than the one of the timestamp\n // TODO: find a more generic way of doing it. This one\n // assumes that timestamps are represented on 13 digits\n var l = startRow.length;\n if (l != 0){\n for(i = 0 ; i < 13-l ; i = i+1){\n startRow = \"0\" + startRow;\n }\n }\n Dom.get(\"startRowTextBox\").value = startRow;\n \n var l = stopRow.length;\n if (l != 0){\n for(i = 0 ; i < 13-l ; i = i+1){\n stopRow = \"0\" + stopRow;\n }\n }\n Dom.get(\"stopRowTextBox\").value = stopRow;\n }\n \n var responseSuccess = function(o) {\n // Get the JSON data from the server and parse it\n var data = JSON.parse(o.responseText);\n \n if (data.errors.length != 0){\n displayDisplayErrors(data.errors);\n }\n else{\n // If no rows are retrieved, we update the table anyway for\n // filtering actions.\n if (data.result.rows.length != 0 || type == \"filter\"){\n \n // Add the new columns to the table\n var columnNames = data.result.colNames;\n for(i = 0; i < columnNames.length ; i = i + 1){\n if(dataTable.getColumn(columnNames[i]) == null){\n dataTable.insertColumn({ key: columnNames[i], field: \"['columns']['\"+ columnNames[i] +\"']\", label: colNames[i].substr(3)+\"<input type='checkbox' style='margin-left: 5px; vertical-align: middle;'/>\"});\n dataTable.getDataSource().responseSchema.fields.push({ key: \"['columns']['\"+ columnNames[i] +\"']\" });\n }\n }\n \n // Populate the table depending on whether we are filtering or fetching\n rowsData['result'] = data.result.rows\n if(type == \"incFetch\"){\n dataTable.getDataSource().sendRequest(null,\n {success: dataTable.onDataReturnAppendRows},\n dataTable);\n }\n else if(type == \"filter\"){\n dataTable.getDataSource().sendRequest(null,\n {success: dataTable.onDataReturnInitializeTable},\n dataTable);\n // If succeeded filtering the data, we reactivate the fetching\n keepFetching = true;\n }\n \n }\n else{\n // If nothing is back, we reached the end of the table\n keepFetching = false;\n }\n }\n };\n \n var responseFailure = function(o) {\n keepFetching = false;\n displayDisplayErrors([\"Connection Manager Error: \" + o.statusText]);\n };\n \n var callback = {\n success:responseSuccess,\n failure:responseFailure,\n argument:[]\n };\n\n if(stopRow != \"\" && startRow != \"\"){\n // Perform the asynchronous request\n var transaction = YAHOO.util.Connect.asyncRequest('POST', '/updateTable/', callback, \"sensorName=\"+ sensorName +\"&startRow=\"+ startRow +\"&stopRow=\"+ stopRow +\"&precision=\"+ precision + \"&xhr=1\");\n }\n \n\n}", "title": "" }, { "docid": "7e7042479266b7e6feb87b2f284778a4", "score": "0.59170085", "text": "function selectFullData(){\n\n // bar chart\n var rates = getCheckedRadioValue('malware');\n listdatacollector(minTime,maxTime,rates);\n updatelist_data();\n //behavoiur graph\n bartobehavior(rates);\n // theread graph\n var temp = getDataForTimeFrame(minTemp,maxTemp);\n generateThreadGraph([temp],minTemp,maxTemp);\n\n}", "title": "" }, { "docid": "ad7587d87726ac9476b998f0389b699e", "score": "0.5916398", "text": "function populateDataSelect () {\n const options = dataVariables\n\n for (let i = 0; i < options.length; i++) {\n let opt = options[i].table + '/' + options[i].column\n let el = document.createElement('option')\n el.textContent = opt\n el.value = opt\n dataSelect.appendChild(el)\n }\n}", "title": "" }, { "docid": "7def507d80c358aa245a2464abd337fa", "score": "0.5915305", "text": "function tableTalk(activeData) {\n\n // We'll have to reset our table, which we can do by writing over our bodySelect with empty space\n bodySelect.html(\"\");\n\n activeData.forEach(ufoData => {\n\n // Creates the tr tag to place td tags and data inside\n var rowCreate = bodySelect.append(\"tr\");\n\n // For each object, we'll need loop through and create & write a td tag\n Object.entries(ufoData).forEach(([key, value]) => {\n var cellCreate = rowCreate.append(\"td\");\n cellCreate.text(value);\n });\n });\n}", "title": "" }, { "docid": "94c75467f1d24fbc90454f9fbfc52c11", "score": "0.59057873", "text": "function MSM_FillSelectRow(tblBody_select, data_dict, row_is_selected, insert_at_index_zero) {\n //console.log( \"===== MSM_FillSelectRow ========= \");\n //console.log(\"data_dict: \", data_dict);\n\n // cluster has no base table\n const pk_int = data_dict.id;\n const display_name = (data_dict.name) ? data_dict.name : \"-\";\n\n //console.log( \"display_name: \", display_name);\n\n const map_id = (data_dict.mapid) ? data_dict.mapid : null;\n\n// --- lookup index where this row must be inserted\n //const ob1 = (data_dict.dep_sequence) ? \"00000\" + data_dict.dep_sequence.toString() : \"\";\n const ob1 = (data_dict.name) ? data_dict.name.toLowerCase() : \"\";\n\n const row_index = (insert_at_index_zero) ? 0 :\n b_recursive_tblRow_lookup(tblBody_select, setting_dict.user_lang, ob1);\n\n// --- insert tblRow into tblBody at row_index\n const tblRow = tblBody_select.insertRow(row_index);\n tblRow.id = map_id\n\n tblRow.setAttribute(\"data-pk\", pk_int);\n tblRow.setAttribute(\"data-selected\", (row_is_selected) ? \"1\" : \"0\")\n\n// --- add data-sortby attribute to tblRow, for ordering new rows\n tblRow.setAttribute(\"data-ob1\", ob1);\n //tblRow.setAttribute(\"data-ob2\", ob2);\n\n// --- add EventListener to tblRow, not when 'no items' (pk_int is then -1, ''all clusters = -9\n if (pk_int !== -1) {\n tblRow.addEventListener(\"click\", function() {MSM_SelecttableClicked(tblRow)}, false )\n// --- add hover to tblRow\n add_hover(tblRow);\n }\n let td, el;\n\n// --- add select td to tblRow.\n td = tblRow.insertCell(-1);\n td.classList.add(\"mx-1\", \"tw_032\")\n\n// --- add a element to td., necessary to get same structure as item_table, used for filtering\n el = document.createElement(\"div\");\n el.className = (row_is_selected) ? \"tickmark_2_2\" : \"tickmark_0_0\";\n td.appendChild(el);\n\n// --- add td with display_name to tblRow\n td = tblRow.insertCell(-1);\n td.classList.add(\"mx-1\", \"tw_270\")\n// --- add a element to td., necessary to get same structure as item_table, used for filtering\n el = document.createElement(\"div\");\n el.innerText = display_name;\n td.appendChild(el);\n if (display_name) { tblRow.title = display_name};\n\n }", "title": "" }, { "docid": "6404757cb24a6748af719d5c2a15e2cc", "score": "0.59007156", "text": "function show_available_graphs(table_data, data_type, county) {\n \n var skip_labels = ['Record ID', 'View report']\n , skip_labels_table = ['Record ID']\n , headings = []\n , table_headings = []\n , skip_indexes = []\n , too_many = []\n , data_and_msg\n , graph_type;\n //table stuff here \n table_data.cols.forEach(function(col, index) {\n if(skip_labels.indexOf(col.label) < 0) {\n headings.push({label:col.label, index: index});\n // group_on({label:col.label, index: index});\n }\n if (skip_labels_table.indexOf(col.label) < 0){\n table_headings.push(col);\n }\n else {\n skip_indexes.push(index);\n }\n });\n headings.forEach(function(heading) {\n data_and_msg = group_on(heading.label, data_type, headings, table_data.rows);\n \n if(data_and_msg['msg']) {\n too_many.push(data_and_msg['msg']);\n }\n\n });\n var source = find_source(county, data_type, headings, table_data.rows);\n make_table(table_data, table_headings, skip_indexes);\n if(too_many.length > 0) {\n var msg = '<div class=\"dd-graphs\"><p><b>The following fields have too many unique values to reasonably graph:</b></p>' + too_many.join(\"\\n\") + '</div>';\n $('#open-nc-widget').append(msg);\n\n }\n $('.graph-option').click(function() {\n which_graph = $(this).data('which');\n var graph_config = graph_configs[which_graph];\n $('.dd-graphs').each(function(index, el) {\n if($(this).attr('id') !== ('holder-' + which_graph)) {\n $(this).hide('slow');\n }\n });\n $(this).after('<button class=\"btn btn-default graph-show-all\">Back to all graphs</button>');\n $(this).hide();\n $('.graph-show-all').after(' <button class=\"btn btn-default graph-show-code\" style\"margin-left: 5px\">Get code</button>');\n $('.graph-show-code').click(function(e) {\n e.preventDefault();\n var graph_type = graph_config['graph_type'];\n var output_template = '_graph';\n var height = parseInt($('#graph-height').val()) || 'auto';\n var width = parseInt($('#graph-width').val());\n var context = {width: width, height: height, source: source, data: JSON.stringify(graph_config['data']), options: JSON.stringify(graph_config['options']), viz_type: graph_type ,script: 'script'};\n if(graph_type !== 'Table'){\n context['array_to'] = 'arrayTo';\n }\n else {\n context['view'] = JSON.stringify(graph_config.view);\n output_template = '_table';\n \n }\n var code = fill_template('embed_output' + output_template,context);\n var embed_textarea = fill_template('embed_textarea',{});\n $('#' + which_graph).before(embed_textarea);\n $('#embed-code').val(code);\n $('#embed-code').on('click',function() {\n this.select();\n });\n });\n $('.graph-show-all').click( function(e) {\n e.preventDefault();\n if(graph_type !== graph_config['graph_type']) {\n graph_type = graph_config['graph_type'];\n show_graph(graph_config,which_graph);\n }\n $('#embed-code-row, .widget-form, .graph-show-code').remove(); \n $('.dd-graphs').show('slow');\n $(this).remove();\n $('.graph-option').show();\n $('#graph-change-form').remove();\n });\n\n //puts existing values in form\n var form_template = 'graph_widget_form';\n var context = {};\n if(graph_config['graph_type'] === 'Table') {\n form_template = 'table_widget_form';\n context['headings'] = graph_config['headings'];\n }\n var form = fill_template(form_template, context);\n $('#holder-' + which_graph).append(form);\n if(graph_config['graph_type'] === 'LineChart') {\n $('#graph-change-row').remove();\n }\n $('.graph-change-param').each(function(i, el) {\n var param = $(this).data('option');\n var form_type = $(this).attr('type');\n var val;\n if(param.indexOf('.') !== -1) {\n var keys = param.split('.');\n var val_obj = graph_config['options'];\n keys.forEach( function(key) {\n val_obj = val_obj[key];\n });\n val = val_obj;\n }\n else {\n if(param === 'colors') {\n val = graph_config['options'][param][0];\n }\n else {\n val = graph_config['options'][param]; \n }\n }\n if(form_type === 'radio' || form_type === 'checkbox') {\n if($(this).val() === val) {\n $(this).attr('checked','checked');\n }\n \n }\n else {\n $(this).val(val);\n }\n });\n $('.graph-type').click( function() {\n graph_type = $(this).val();\n var temp_config = graph_config;\n graph_config['graph_type'] = graph_type;\n show_graph(graph_config,which_graph);\n });\n //puts form values in option obj\n $('#graph-change-button').click( function(e) {\n e.preventDefault();\n $('.graph-change-param').each( function(i, el) {\n var data_type = $(el).attr('type');\n if(data_type === 'number') {\n val = parseInt($(el).val());\n }\n else if (data_type === 'radio' || data_type === 'checkbox') {\n if($(el).is(':checked')) {\n val = $(el).val();\n }\n }\n else {\n val = $(el).val();\n }\n var param = $(el).data('option');\n if(param === 'hAxis.title' && val !== '' && val && (graph_config['graph_type'] === 'ColumnChart' || graph_config['graph_type'] === 'LineChart')) {\n graph_config['data'][0][1] = val;\n }\n if(param === 'vAxis.title' && val !== '' && val && graph_config['graph_type'] === 'BarChart') {\n graph_config['data'][0][1] = val;\n }\n if(param.indexOf('.') !== -1) {\n var keys = param.split('.');\n var val_obj = {};\n var last = keys.length;\n var first = keys[0];\n for(var i = 1; i < keys.length; i++) {\n val_obj[keys[i]] = val;\n }\n graph_config['options'][first] = val_obj;\n }\n else {\n if(param === 'colors') {\n if(graph_config['options']['colors'][0] !== val) {\n \n graph_config['options']['colors'].unshift(val);\n }\n }\n else {\n graph_config['options'][param] = val; \n }\n }\n \n });\n if(graph_config['graph_type'] === 'Table') {\n var show_cols = [];\n $('.table-fields').each(function(i, el) {\n if($(el).is(':checked')) {\n show_cols.push(parseInt($(el).val()));\n }\n });\n graph_config['view'] = show_cols;\n }\n show_graph(graph_config,which_graph);\n $('#embed-code-row').remove(); \n });\n $('#graph-change-reset').click(function(e) {\n e.preventDefault();\n $('.graph-change-param').each(function(i, el) {\n var param = $(this).data('option');\n var form_type = $(this).attr('type');\n var val;\n if(param.indexOf('.') !== -1) {\n var keys = param.split('.');\n var val_obj = graph_config['options'];\n keys.forEach( function(key) {\n val_obj = val_obj[key];\n });\n val = val_obj;\n }\n else {\n if(param === 'colors') {\n val = graph_config['options'][param][0];\n }\n else {\n val = graph_config['options'][param]; \n }\n }\n if(form_type === 'radio' || form_type === 'checkbox') {\n if($(this).val() === val) {\n $(this).prop('checked',true);\n }\n else {\n $(this).prop('checked', false);\n }\n \n }\n else {\n $(this).val(val);\n }\n if(graph_type !== 'ColumnChart') {\n graph_type = 'ColumnChart';\n show_graph(graph_config,which_graph);\n }\n }); \n });\n });\n }", "title": "" }, { "docid": "f7fb32584f0a42b8d11ca7aa163842ea", "score": "0.5893293", "text": "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element and get the raw HTML node\n const idColmap = [{ id: \"#datetime\", col: \"datetime\" },\n { id: \"#city\", col: \"city\" },\n { id: \"#state\", col: \"state\" },\n { id: \"#country\", col: \"country\" },\n { id: \"#shape\", col: \"shape\" }];\n\n var filteredData = tableData;\n\n idColmap.forEach(entry => {\n //if the user selection is NOT blank, filter data to user selection.\n if (d3.select(entry.id).property(\"value\")) {\n filteredData = filteredData.filter(sighting =>\n sighting[entry.col] === d3.select(entry.id).property(\"value\"));\n }\n });\n\n //print the filtered data to the console\n console.log(filteredData);\n\n //overwrite table with filtered data\n var tbody = d3.select(\"tbody\");\n tbody.html(\"\"); // clears the table\n\n filteredData.forEach((UFOsighting_bydate) => {\n var row = tbody.append(\"tr\");\n Object.entries(UFOsighting_bydate).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n })\n}", "title": "" }, { "docid": "5173df1dfa5ef3d3b669b367589a16f8", "score": "0.589249", "text": "function _buildTable() {\n // _displayLoading(true);\n _addGradeRange();\n _renderSelects();\n var table = _setupDataTable(renderTable());\n renderFeatures();\n}", "title": "" }, { "docid": "133adc03bef84f0cb2fbe434ecb19b85", "score": "0.58841085", "text": "function MSM_FillSelectRow(tblBody_select, data_dict, row_is_selected, insert_at_index_zero) {\n //console.log( \"===== MSM_FillSelectRow ========= \");\n //console.log(\"data_dict: \", data_dict);\n\n // cluster has no base table\n const pk_int = data_dict.id;\n const display_name = (data_dict.name) ? data_dict.name : \"-\";\n\n //console.log( \"display_name: \", display_name);\n\n const map_id = (data_dict.mapid) ? data_dict.mapid : null;\n\n// --- lookup index where this row must be inserted\n const ob1 = (data_dict.dep_sequence) ? \"00000\" + data_dict.dep_sequence.toString() : \"\";\n const ob2 = (data_dict.name) ? data_dict.name.toLowerCase() : \"\";\n\n const row_index = (insert_at_index_zero) ? 0 :\n b_recursive_tblRow_lookup(tblBody_select, setting_dict.user_lang, ob1, ob2);\n\n// --- insert tblRow into tblBody at row_index\n const tblRow = tblBody_select.insertRow(row_index);\n tblRow.id = map_id;\n\n tblRow.setAttribute(\"data-pk\", pk_int);\n tblRow.setAttribute(\"data-selected\", (row_is_selected) ? \"1\" : \"0\")\n\n// --- add data-sortby attribute to tblRow, for ordering new rows\n tblRow.setAttribute(\"data-ob1\", ob1);\n tblRow.setAttribute(\"data-ob2\", ob2);\n// --- add EventListener to tblRow, not when 'no items' (pk_int is then -1, ''all clusters = -9\n if (pk_int !== -1) {\n tblRow.addEventListener(\"click\", function() {MSM_SelecttableClicked(tblRow)}, false )\n// --- add hover to tblRow\n add_hover(tblRow);\n }\n let td, el;\n\n// --- add select td to tblRow.\n td = tblRow.insertCell(-1);\n td.classList.add(\"mx-1\", \"tw_032\")\n\n// --- add a element to td., necessary to get same structure as item_table, used for filtering\n el = document.createElement(\"div\");\n el.className = (row_is_selected) ? \"tickmark_2_2\" : \"tickmark_0_0\";\n td.appendChild(el);\n\n// --- add td with display_name to tblRow\n td = tblRow.insertCell(-1);\n td.classList.add(\"mx-1\", \"tw_270\")\n// --- add a element to td., necessary to get same structure as item_table, used for filtering\n el = document.createElement(\"div\");\n el.innerText = display_name;\n td.appendChild(el);\n if (display_name) { tblRow.title = display_name};\n\n }", "title": "" }, { "docid": "82803f2ae50811cebcd10d15b979217b", "score": "0.5880996", "text": "function MSM_FillSelectTable() {\n console.log( \"===== MSM_FillSelectTable ========= \");\n\n // check if school has multiple departments, needed for allowed_clusters\n let school_has_multiple_deps = false;\n if (setting_dict.sel_school_depbases ){\n const depbase_arr = setting_dict.sel_school_depbases.split(\";\");\n school_has_multiple_deps = depbase_arr && depbase_arr.length > 1;\n };\n console.log( \" setting_dict.sel_school_depbases: \", setting_dict.sel_school_depbases);\n console.log( \" school_has_multiple_deps: \", school_has_multiple_deps);\n\n // cluster has no base table\n const base_pk_field = \"id\"\n const caption_none = loc.No_ + loc.Clusters.toLowerCase();\n\n let tblBody_select = el_MSM_tblbody_select;\n tblBody_select.innerText = null;\n\n let has_selected_rows = false;\n\n// --- loop through data_rows\n // data_array contains a list of strings with cluster_id's\n console.log( \" mod_MSM_dict.allowed_clusters: \", mod_MSM_dict.allowed_clusters);\n const allowed_clusters_pk_arr = (mod_MSM_dict.allowed_clusters_pk_arr) ? mod_MSM_dict.allowed_clusters_pk_arr : [];\n\n console.log( \" allowed_clusters_pk_arr: \", allowed_clusters_pk_arr);\n\n for (const data_dict of Object.values(cluster_dictsNEW)) {\n console.log( \" data_dict: \", data_dict)\n const pk_int = data_dict.id;\n const row_is_selected = (pk_int && allowed_clusters_pk_arr && allowed_clusters_pk_arr.includes(pk_int));\n\n console.log( \" pk_int: \", pk_int);\n console.log( \" ==== row_is_selected: \", row_is_selected);\n if(row_is_selected){\n has_selected_rows = true;\n };\n\n const row_index = -1;\n MSM_FillSelectRow(tblBody_select, data_dict, row_is_selected);\n };\n\n console.log( \" >>>>>>>>>> has_selected_rows: \", has_selected_rows);\n\n// --- add 'all' at the beginning of the list, with id = 0, make selected if no other rows are selected\n const data_dict = {};\n data_dict.id = -9;\n data_dict.name = \"<\" + loc.All_ + loc.Clusters.toLowerCase() + \">\"\n\n const row_index = 0;\n // select <All> when has_selected_rows = false;\n MSM_FillSelectRow(tblBody_select, data_dict, !has_selected_rows, true) // true = insert_at_index_zero\n\n } // MSM_FillSelectTable", "title": "" }, { "docid": "1e472c3487a01767c9246e5b76ccf6e0", "score": "0.5873885", "text": "function loadData(data) {\n\n tbody.selectAll(\"*\").remove()\n data.forEach(ufoSighting => {\n // console.log to make sure all objects were selected\n // console.log(ufoSighting);\n const row = tbody.append(\"tr\");\n Object.values(ufoSighting).forEach(value => {\n // Append a cell to the row for each value\n // in the ufo object\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "e69dadd1ed2409395bd9e70fd247901a", "score": "0.585523", "text": "function make_table(table_data, table_headings, skip_indexes){\n var table_data_rows = table_data.rows.map( function(row) {\n var new_row = [];\n row.c.forEach(function (data, index) {\n if(skip_indexes.indexOf(index) === -1){\n new_row.push(data);\n }\n row['c'] = new_row;\n });\n return row;\n });\n var filtered_table_data = {cols: table_headings, rows: table_data_rows};\n var headings = []\n ,view = [];\n table_headings.forEach( function(heading,index) {\n headings.push({label: heading.label, index: index});\n view.push(index);\n });\n var table_div = 'table-div-1';\n var table_holder = 'holder-' + table_div;\n $('#open-nc-widget').append('<div id=\"' + table_holder + '\" class=\"dd-graphs\"></div>');\n $('#' + table_holder).append('<div id=\"' + table_div + '\" class=\"dd-graph-div\"></div>');\n $('#' + table_holder).prepend('<button class=\"btn btn-default graph-option\" data-which=\"' + table_div + '\">Customize</button>');\n graph_configs[table_div] = {'data': filtered_table_data, 'options': table_options, 'graph_type': 'Table', 'headings': headings,'view':view}; \n show_graph(graph_configs[table_div],table_div);\n }", "title": "" }, { "docid": "d8cd2f61dcb22c061993c3699a305405", "score": "0.5849295", "text": "function renderTable() {\n tbody.innerHTML = \"\";\n for (var i = 0; i < filterData.length; i++) {\n // Get the current objects and its fields. Calling each dictionary object 'ovni'. This comes from the data.js database where\n //the object dataSet holds an array (list) of dictionaries. Each dictionary is an object and I'm calling it ovni. This will\n // loop through each dictionary/object from the variable dataSet and store their keys in the variable fields. \n\n var ovni = filterData[i];\n var fields = Object.keys(ovni);\n \n // Create a new row in the tbody, set the index to be i + startingIndex\n // fields are the columns\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 and set its inner text to be the current value at the current address's field\n // the variable field will gather the columns names. It will loop through the fields(columns). Example, fields index 0 is datetime.\n var field = fields[j];\n var cell = row.insertCell(j);\n // now i will pass to the cell the ovni object, field values.\n cell.innerText = ovni[field];\n }\n }\n}", "title": "" }, { "docid": "a806607d304264e46fbf665acd541d20", "score": "0.5849195", "text": "function gotData_3(data) {\n\n remove_Table_3();\n createTable_3();\n\n table = document.getElementById('lampOUT');\n\n let array = new Array();\n\n var lamps = data.val();\n var keys = Object.keys(lamps);\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n\n array[0] = lamps[k].date;\n array[1] = lamps[k].lampID;\n array[2] = lamps[k].lampName;\n array[3] = lamps[k].fixture;\n array[4] = lamps[k].qty;\n array[5] = lamps[k].pers;\n array[6] = lamps[k].location;\n array[7] = lamps[k].notes1;\n array[8] = lamps[k].notes2;\n\n // create a new row\n var newRow = table.insertRow(i + 1);\n\n for (var j = 0; j < 9; j++) {\n\n // create a new cell\n var cell = newRow.insertCell(j);\n\n // add value to the cell\n cell.innerHTML = array[j];\n }\n }\n // Hide first column of the table (with database keys)\n // for (var i = 0; i <= keys.length; i++) {\n // table.rows[i].cells[0].style.display = 'none';\n // }\n for (var i = 1; i <= keys.length; i++) {\n table.rows[i].cells[2].id = 'colName';\n table.rows[i].cells[3].id = 'colFxt';\n table.rows[i].cells[4].id = 'colQty';\n }\n let testMode = document.getElementsByName('test/real');\n if (testMode[0].checked) {\n table.classList.add('borderColorGrey');\n } else {\n table.classList.add('borderColorRed');\n }\n}", "title": "" }, { "docid": "a25f6760c0501db860b9ccf92e844c58", "score": "0.5835136", "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": "37857cac9f868f46dba57615f8137e17", "score": "0.58310366", "text": "function addSelectedData(data) {\n\n for (var i = 0; i < data.length; i++) {\n selectedData[selectedDataIndex] = data[i];\n selectedDataIndex += 1;\n }\n}", "title": "" }, { "docid": "c4d3c7f46a18df7bf3bc8aed7a301753", "score": "0.5807805", "text": "function createDataSet(dataRecieved){\n\n\n}", "title": "" }, { "docid": "f53359a2630ae85df7035c316224823a", "score": "0.5803604", "text": "function GenerateTableData_2(paramsObj) {\n var operationsAtFront = (paramsObj.operationsAtFront === undefined || paramsObj.operationsAtFront === null || paramsObj.operationsAtFront === \"\" || paramsObj.operationsAtFront === false) ? false : true;\n var startNumber = (paramsObj.startNumber === undefined || paramsObj.startNumber === null || paramsObj.startNumber === \"\") ? 0 : paramsObj.startNumber;\n var endNumber = (paramsObj.endNumber === undefined || paramsObj.endNumber === null || paramsObj.endNumber === \"\") ? Intern_ArrayOfValues.length : (paramsObj.endNumber > Intern_ArrayOfValues.length ? Intern_ArrayOfValues.length : paramsObj.endNumber);\n\n //debugger;\n\n var ret = \"\";\n var tempRet = \"\";\n var display;\n var i;\n\n var minVal, maxVal, maxLength;\n var includeEditText;\n var style;\n for (var i = startNumber; i < endNumber; i++){\n //$.each(Intern_ArrayOfValues, function (index, value) {\n $.each(Intern_TableFieldIDs, function (index1, value1) {\n\n //debugger;\n\n //*%* Note: Ludovick - ToDelete\n // BEGIN\n if (Intern_ArrTableFieldDesc[i] !== undefined && Intern_ArrTableFieldDesc[i] !== null) {\n if (Intern_ArrTableFieldDesc[i][value1] !== undefined && Intern_ArrTableFieldDesc[i][value1] !== null) {\n if (Intern_ArrTableFieldDesc[i][value1].Template !== undefined && Intern_ArrTableFieldDesc[i][value1].Template !== null) {\n display = Intern_ArrTableFieldDesc[i][value1].Template.replace(/\\*%dataColName%\\*/g, value1)\n .replace(/\\*%dataRowNum%\\*/g, i).replace(/\\*%dataValue%\\*/g, Intern_ArrayOfValues[i][value1]);\n }\n else if (Intern_ArrTableFieldDesc[i][value1].CellEditable !== undefined && Intern_ArrTableFieldDesc[i][value1].CellEditable !== null && Intern_ArrTableFieldDesc[i][value1].CellEditable === true) {\n if (Intern_ArrTableFieldDesc[i][value1].Type === \"number\") {\n minVal = (Intern_ArrTableFieldDesc[i][value1].minVal !== undefined && Intern_ArrTableFieldDesc[i][value1].minVal !== null && Intern_ArrTableFieldDesc[i][value1].minVal !== \"\") ? 'min=\"' + Intern_ArrTableFieldDesc[i][value1].minVal + '\"' : \"\";\n maxVal = (Intern_ArrTableFieldDesc[i][value1].maxVal !== undefined && Intern_ArrTableFieldDesc[i][value1].maxVal !== null && Intern_ArrTableFieldDesc[i][value1].maxVal !== \"\") ? 'max=\"' + Intern_ArrTableFieldDesc[i][value1].maxVal + '\"' : \"\";\n includeEditText = (Intern_ArrTableFieldDesc[i][value1].IncludeEditText !== undefined && Intern_ArrTableFieldDesc[i][value1].IncludeEditText !== null)\n ? ((Intern_ArrTableFieldDesc[i][value1].IncludeEditText !== \"\") ? '<a class=\"clsLink\" id=\"' + Intern_InstanceName + 'lnkEditCell_' + i + '\" >' + Intern_ArrTableFieldDesc[i][value1].IncludeEditText + '</a>' : '<span class=\"glyphicon glyphicon-edit\"></span>')\n : \"\";\n if (Setting_UseInputBoxForEditable)\n display = '<td dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" dataType=\"number\" >'\n + '<input class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" type=\"number\" ' + minVal + ' ' + maxVal + ' value=\"' + Intern_ArrayOfValues[i][value1] + '\" />'\n //+ '<input class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" type=\"number\" ng-change=InputFieldChanged() ' + minVal + ' ' + maxVal + ' value=\"' + Intern_ArrayOfValues[i][value1] + '\" />'\n + includeEditText //'<span class=\"glyphicon glyphicon-edit\"></span>'\n + '</td>';\n else\n display = '<td contenteditable class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" dataType=\"number\" ' + minVal + ' ' + maxVal + '>' + Intern_ArrayOfValues[i][value1] + '</td>'; \n \n }\n else if (Intern_ArrTableFieldDesc[i][value1].Type === \"text\") {\n maxLength = (Intern_ArrTableFieldDesc[i][value1].maxLength !== undefined && Intern_ArrTableFieldDesc[i][value1].maxLength !== null && Intern_ArrTableFieldDesc[i][value1].maxLength !== \"\") ? 'maxlength=\"' + Intern_ArrTableFieldDesc[i][value1].maxLength + '\"' : \"\";\n includeEditText = (Intern_ArrTableFieldDesc[i][value1].IncludeEditText !== undefined && Intern_ArrTableFieldDesc[i][value1].IncludeEditText !== null)\n ? ((Intern_ArrTableFieldDesc[i][value1].IncludeEditText !== \"\") ? '<a class=\"clsLink\" id=\"' + Intern_InstanceName + 'lnkEditCell_' + i + '\" >' + Intern_ArrTableFieldDesc[i][value1].IncludeEditText + '</a>' : '<span class=\"glyphicon glyphicon-edit\"></span>')\n : \"\";\n if (Setting_UseInputBoxForEditable)\n display = '<td dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" dataType=\"text\" >'\n + '<input class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" type=\"text\" ' + maxLength + ' value=\"' + Intern_ArrayOfValues[i][value1] + '\" />'\n //+ '<input class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" type=\"text\" ng-change=InputFieldChanged() ' + maxLength + ' value=\"' + Intern_ArrayOfValues[i][value1] + '\" />'\n + includeEditText //'<span class=\"glyphicon glyphicon-edit\"></span>'\n + '</td>';\n else\n display = '<td contenteditable class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" dataType=\"text\" ' + maxLength + '>' + Intern_ArrayOfValues[i][value1] + '</td>';\n \n //display = '<td contenteditable class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" dataType=\"text\" ' + maxLength + '>' + Intern_ArrayOfValues[i][value1] + '</td>';\n }\n else {\n display = '<td contenteditable class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\">' + Intern_ArrayOfValues[i][value1] + '</td>';\n }\n }\n else {\n display = '<td dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\">' + Intern_ArrayOfValues[i][value1] + '</td>';\n }\n }\n else {\n display = '<td dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\">' + Intern_ArrayOfValues[i][value1] + '</td>';\n }\n }\n else if (Intern_TableFieldDesc[value1] !== undefined && Intern_TableFieldDesc[value1] !== null) {\n if (Intern_TableFieldDesc[value1].Template !== undefined && Intern_TableFieldDesc[value1].Template !== null) {\n display = Intern_TableFieldDesc[value1].Template.replace(/\\*%dataColName%\\*/g, value1)\n .replace(/\\*%dataRowNum%\\*/g, i).replace(/\\*%dataValue%\\*/g, Intern_ArrayOfValues[i][value1]);\n }\n else if(Intern_TableFieldDesc[value1].CellEditable !== undefined && Intern_TableFieldDesc[value1].CellEditable !== null && Intern_TableFieldDesc[value1].CellEditable === true) {\n if (Intern_TableFieldDesc[value1].Type === \"number\") {\n minVal = (Intern_TableFieldDesc[value1].minVal !== undefined && Intern_TableFieldDesc[value1].minVal !== null && Intern_TableFieldDesc[value1].minVal !== \"\") ? 'min=\"' + Intern_TableFieldDesc[value1].minVal + '\"' : \"\";\n maxVal = (Intern_TableFieldDesc[value1].maxVal !== undefined && Intern_TableFieldDesc[value1].maxVal !== null && Intern_TableFieldDesc[value1].maxVal !== \"\") ? 'max=\"' + Intern_TableFieldDesc[value1].maxVal + '\"' : \"\";\n includeEditText = (Intern_TableFieldDesc[value1].IncludeEditText !== undefined && Intern_TableFieldDesc[value1].IncludeEditText !== null)\n ? ((Intern_TableFieldDesc[value1].IncludeEditText !== \"\") ? '<a class=\"clsLink\" id=\"' + Intern_InstanceName + 'lnkEditCell_' + i + '\" >' + Intern_TableFieldDesc[value1].IncludeEditText + '</a>' : '<span class=\"glyphicon glyphicon-edit\"></span>')\n : \"\";\n if (Setting_UseInputBoxForEditable) {\n display = '<td dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" dataType=\"number\" >'\n + '<input class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" type=\"number\" ' + minVal + ' ' + maxVal + ' value=\"' + Intern_ArrayOfValues[i][value1] + '\" />'\n //+ '<input class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" type=\"number\" ng-change=InputFieldChanged() ' + minVal + ' ' + maxVal + ' value=\"' + Intern_ArrayOfValues[i][value1] + '\" />'\n + includeEditText //'<span class=\"glyphicon glyphicon-edit\"></span>'\n + '</td>';\n\n //display = '<td contenteditable class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" dataType=\"number\" ' + minVal + ' ' + maxVal + '><input type=\"number\" value=\"' + Intern_ArrayOfValues[i][value1] + '\" /></td>';\n }\n else\n display = '<td contenteditable class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" dataType=\"number\" ' + minVal + ' ' + maxVal + '>' + Intern_ArrayOfValues[i][value1] + '</td>';\n \n }\n else if (Intern_TableFieldDesc[value1].Type === \"text\") {\n maxLength = (Intern_TableFieldDesc[value1].maxLength !== undefined && Intern_TableFieldDesc[value1].maxLength !== null && Intern_TableFieldDesc[value1].maxLength !== \"\") ? 'maxlength=\"' + Intern_TableFieldDesc[value1].maxLength + '\"' : \"\";\n includeEditText = (Intern_TableFieldDesc[value1].IncludeEditText !== undefined && Intern_TableFieldDesc[value1].IncludeEditText !== null)\n ? ((Intern_TableFieldDesc[value1].IncludeEditText !== \"\") ? '<a class=\"clsLink\" id=\"' + Intern_InstanceName + 'lnkEditCell_' + i + '\" >' + Intern_TableFieldDesc[value1].IncludeEditText + '</a>' : '<span class=\"glyphicon glyphicon-edit\"></span>')\n : \"\";\n if (Setting_UseInputBoxForEditable)\n display = '<td dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" dataType=\"text\" >'\n + '<input class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" type=\"text\" ' + maxLength + ' value=\"' + Intern_ArrayOfValues[i][value1] + '\" />'\n //+ '<input class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" type=\"text\" ng-change=InputFieldChanged() ' + maxLength + ' value=\"' + Intern_ArrayOfValues[i][value1] + '\" />'\n + includeEditText //'<span class=\"glyphicon glyphicon-edit\"></span>'\n + '</td>';\n else\n display = '<td contenteditable class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" dataType=\"text\" ' + maxLength + '>' + Intern_ArrayOfValues[i][value1] + '</td>';\n\n //display = '<td contenteditable class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\" dataType=\"text\" ' + maxLength + '>' + Intern_ArrayOfValues[i][value1] + '</td>';\n }\n else {\n display = '<td contenteditable class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\">' + Intern_ArrayOfValues[i][value1] + '</td>';\n }\n }\n else {\n display = '<td dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\">' + Intern_ArrayOfValues[i][value1] + '</td>';\n }\n }\n else if (Utilities_StringInArrayBinarySearch(value1, Intern_EditableFieldIDs)) {\n if(Setting_UseNgBlur) \n display = '<td contenteditable ng-blur=\"TableFieldChanged($event)\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\">' + Intern_ArrayOfValues[i][value1] + '</td>';\n else\n display = '<td contenteditable class=\"cellEditable\" dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\">' + Intern_ArrayOfValues[i][value1] + '</td>';\n }\n else {\n display = '<td dataColName=\"' + value1 + '\" dataRowNum=\"' + i + '\">' + Intern_ArrayOfValues[i][value1] + '</td>';\n }\n // END\n\n\n\n //display = '<td>' + Intern_ArrayOfValues[i][value1] + '</td>';\n tempRet = tempRet + display;\n });\n\n //debugger;\n\n style = \"\";\n if (Intern_ArrayOfValues[i] !== undefined && Intern_ArrayOfValues[i] !== null && Intern_ArrayOfValues[i] !== '')\n style = (Intern_ArrayOfValues[i].style === undefined || Intern_ArrayOfValues[i].style === null || Intern_ArrayOfValues[i].style === '') ? '' : 'style=\"' + Intern_ArrayOfValues[i].style + '\"';\n if (Intern_ArrayOfValues[i].paramRowMetaData_AddOperations === undefined || Intern_ArrayOfValues[i].paramRowMetaData_AddOperations === null \n || Intern_ArrayOfValues[i].paramRowMetaData_AddOperations === \"\" || Intern_ArrayOfValues[i].paramRowMetaData_AddOperations === true) {\n if (operationsAtFront) {\n tempRet = '<tr id=\"' + Intern_InstanceName + 'tableRow_' + i + '\" ' + style + ' >' + AddOperations(i) + tempRet;\n }\n else {\n tempRet = '<tr id=\"' + Intern_InstanceName + 'tableRow_' + i + '\" ' + style + ' >' + tempRet + AddOperations(i);\n }\n tempRet = tempRet + '</tr>';\n }\n else {\n if (AddOperations(i) === \"\")\n tempRet = '<tr id=\"' + Intern_InstanceName + 'tableRow_' + i + '\" ' + style + ' >' + tempRet + '</tr>';\n else\n tempRet = '<tr id=\"' + Intern_InstanceName + 'tableRow_' + i + '\" ' + style + ' >' + tempRet + '<td></td></tr>';\n }\n\n if (Setting_AddToTop)\n ret = tempRet + ret;\n else\n ret = ret + tempRet;\n tempRet = \"\";\n }\n\n /*\n $.each(Intern_ArrayOfValues, function (index, value) {\n $.each(Intern_TableFieldIDs, function (index1, value1) {\n display = '<td>' + value[value1] + '</td>';\n tempRet = tempRet + display;\n });\n if (operationsAtFront) {\n tempRet = '<tr id=\"' + Intern_InstanceName + 'tableRow_' + index + '\">' + AddOperations(index) + tempRet;\n }\n else {\n tempRet = '<tr id=\"' + Intern_InstanceName + 'tableRow_' + index + '\">' + tempRet + AddOperations(index);\n }\n tempRet = tempRet + '</tr>';\n\n if (Setting_AddToTop)\n ret = tempRet + ret;\n else\n ret = ret + tempRet;\n tempRet = \"\";\n });\n */\n return ret;\n }", "title": "" }, { "docid": "cee9c1e47231a23a8fef95d9e8790921", "score": "0.58030486", "text": "function processSelectionData()\n{\n\tdataAdded = new Array();\n\tlabelData = new Array();\n\tvar monthYear = \"October 2012\";\n\tvar descriptionText = monthYear;\t\n\n\tif(user.buslines.length == 0) //0 buslines\n\t{\n\t\tif(user.currentTime.days.length == 0) //0 days\n\t\t{\n\t\t\tif(user.currentTime.hours.length == 0) //0 buslines, 0 days, 0 hours\n\t\t\t{\t\t\n\t\t\t\tvar data = 0;\t\t\n\t\t\t\t\n\t\t\t\tfor(i = 0; i < busLineNames.length; i++)\t\n\t\t\t\t{\t\n\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\tdata += busLines[i].months[user.currentTime.month].boardings.total();\t\n\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\tdata += busLines[i].months[user.currentTime.month].boardings.boarding;\t\n\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\tdata += busLines[i].months[user.currentTime.month].boardings.deboarding;\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(data > 0)\n\t\t\t\t{\n\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\tlabelData.push(\"\");\n\t\t\t\t}\n\n\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\tdescriptionText = \"Total Boardings and Deboardings\";\t\n\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\tdescriptionText = \"Boardings\";\n\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\tdescriptionText = \"Deboardings\";\t\t\n\t\t\t\tdescriptionText += \" - \" + monthYear;\n\t\t\t}\n\t\t\telse if(user.currentTime.hours.length >= 1) //0 buslines, 0 days, 1/1+ hours(inclusive)\n\t\t\t{\n\t\t\t\tfor(i = 0; i < user.currentTime.hours.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar h = user.currentTime.hours[i];\n\t\t\t\t\tvar data = 0;\n\t\t\t\t\tfor(j = 0; j < busLineNames.length; j++)\t\n\t\t\t\t\t{\t\t\n\t\t\t\t\t\tfor(k = 1; k <= 31; k++)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdata += busLines[j].months[user.currentTime.month].days[k].hours[h].boardings.total();\n\t\t\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdata += busLines[j].months[user.currentTime.month].days[k].hours[h].boardings.boarding;\n\t\t\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdata += busLines[j].months[user.currentTime.month].days[k].hours[h].boardings.deboarding;\t\t\n\t\t\t\t\t\t\t// data += busLines[j].months[user.currentTime.month].days[k].hours[h].boardings.boarding; //add up all boardings for all lines at selected hour h\t\t\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\t\tlabelData.push(timeConverter(h));\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tdescriptionText = monthYear + \" (\" + hourFormatter() + \")\";\n\t\t\t}\n\t\t}\n\t\telse if(user.currentTime.days.length == 1) //1 day\n\t\t{\n\t\t\tif(user.currentTime.hours.length == 0) //0 buslines, 1 day, 0 hours\n\t\t\t{\n\t\t\t\tvar d = user.currentTime.days[0];\n\t\t\t\tvar data = 0;\n\t\t\t\t// document.getElementById(\"test\").innerHTML = \"day: \" + d;\n\t\t\t\tfor(i = 0; i < busLineNames.length; i++)\n\t\t\t\t{\t\n\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\tdata += busLines[i].months[user.currentTime.month].days[d].boardings.total();\n\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\tdata += busLines[i].months[user.currentTime.month].days[d].boardings.boarding;\n\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\tdata += busLines[i].months[user.currentTime.month].days[d].boardings.deboarding;\t\t\t\n\t\t\t\t\t// data += busLines[i].months[user.currentTime.month].days[d].boardings.boarding; //add up all boardings for all lines at selected hour h\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tif(data > 0)\n\t\t\t\t{\n\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\tlabelData.push(\"\");\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = dateConverter(d) + \" - October \" + d + \", 2012\";\n\t\t\t}\n\t\t\telse if(user.currentTime.hours.length >= 1) //0 buslines, 1 day, 1+ hours(inclusive)\n\t\t\t{\n\t\t\t\tvar d = user.currentTime.days[0];\n\n\t\t\t\tfor(i = 0; i < user.currentTime.hours.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar h = user.currentTime.hours[i];\n\t\t\t\t\tvar data = 0;\n\n\t\t\t\t\tfor(j = 0; j < busLineNames.length; j++)\t\n\t\t\t\t\t{\t\t\n\t\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[j].months[user.currentTime.month].days[d].hours[h].boardings.total();\n\t\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[j].months[user.currentTime.month].days[d].hours[h].boardings.boarding;\n\t\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[j].months[user.currentTime.month].days[d].hours[h].boardings.deboarding;\n\t\t\t\t\t\t// data += busLines[j].months[user.currentTime.month].days[d].hours[h].boardings.boarding; //add up all boardings for all lines at selected hour h\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\t\tlabelData.push(timeConverter(h));\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = dateConverter(d) + \" - October \" + d + \", 2012\" + \" (\" + hourFormatter() + \")\";\n\t\t\t}\n\t\t}\n\t\telse if(user.currentTime.days.length > 1) //1+ days\n\t\t{\n\t\t\tif(user.currentTime.hours.length == 0) //0 buslines, 1+ days, 0 hours\n\t\t\t{\n\t\t\t\tfor(i = 0; i < user.currentTime.days.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar d = user.currentTime.days[i];\n\t\t\t\t\tvar data = 0;\n\n\t\t\t\t\tfor(j = 0; j < busLineNames.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[j].months[user.currentTime.month].days[d].boardings.total();\n\t\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[j].months[user.currentTime.month].days[d].boardings.boarding;\n\t\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[j].months[user.currentTime.month].days[d].boardings.deboarding;\n\t\t\t\t\t\t// data += busLines[j].months[user.currentTime.month].days[d].boardings.boarding;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\t\tlabelData.push(dateConverter(d) + \" - Oct. \" + d);\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = monthYear;\n\t\t\t}\n\t\t\telse if(user.currentTime.hours.length >= 1) //0 buslines, 1+ days, 1+ hours\n\t\t\t{\n\t\t\t\tfor(i = 0; i < user.currentTime.days.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar d = user.currentTime.days[i];\n\t\t\t\t\tvar data = 0;\n\n\t\t\t\t\tfor(j = 0; j < user.currentTime.hours.length; j++)\t\t\t\t\t\n\t\t\t\t\t{\n\t\t\t\t\t\tvar h = user.currentTime.hours[j];\n\n\t\t\t\t\t\tfor(k = 0; k < busLineNames.length; k++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdata += busLines[k].months[user.currentTime.month].days[d].hours[h].boardings.total();\n\t\t\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdata += busLines[k].months[user.currentTime.month].days[d].hours[h].boardings.boarding;\n\t\t\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdata += busLines[k].months[user.currentTime.month].days[d].hours[h].boardings.deboarding;\n\t\t\t\t\t\t\t// data += busLines[k].months[user.currentTime.month].days[d].hours[h].boardings.boarding;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\t\tlabelData.push(dateConverter(d) + \" - Oct. \" + d);\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = monthYear + \" (\" + hourFormatter() + \")\";\n\t\t\t}\n\t\t}\n\t}\n\telse if(user.buslines.length == 1) //1 buslines \n\t{\n\t\tif(user.currentTime.days.length == 0) //0 days\n\t\t{\n\t\t\tif(user.currentTime.hours.length == 0) //1 busline, 0 days, 0 hours\n\t\t\t{\n\t\t\t\tvar b = busLineNames.indexOf(user.buslines[0]);\n\t\t\t\t\n\t\t\t\tvar data = 0;\n\n\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].boardings.total();\n\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].boardings.boarding;\n\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].boardings.deboarding;\n\t\t\t\t// data = busLines[b].months[user.currentTime.month].boardings.boarding;\n\n\t\t\t\tif(data > 0)\n\t\t\t\t{\n\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\tlabelData.push(\"\");\n\t\t\t\t\t// document.getElementById(\"descriptionText\").innerHTML = buslineLetter + \" \" + buslineNumber + \" \" + data;\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = user.buslines[0] + \" Line - \" + monthYear;\n\t\t\t}\n\t\t\telse if(user.currentTime.hours.length >= 1) //1 busline, 0 days, 1/1+ hour\n\t\t\t{\n\t\t\t\tvar b = busLineNames.indexOf(user.buslines[0]); //get the single busline\n\n\t\t\t\tfor(i = 0; i < user.currentTime.hours.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar h = user.currentTime.hours[i];\n\t\t\t\t\tvar data = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\tfor(j = 1; j <= 31; j++)\t\n\t\t\t\t\t{\n\t\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[j].hours[h].boardings.total();\n\t\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[j].hours[h].boardings.boarding;\n\t\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[j].hours[h].boardings.deboarding;\n\t\t\t\t\t\t// data += busLines[b].months[user.currentTime.month].days[j].hours[h].boardings.boarding; //add up all boardings for all lines at selected hour h\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\t\tlabelData.push(timeConverter(h));\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = user.buslines[0] + \" Line - \" + monthYear + \" (\" + hourFormatter() + \")\";\n\t\t\t}\n\t\t}\n\t\telse if(user.currentTime.days.length == 1) //1 day\n\t\t{\n\t\t\tif(user.currentTime.hours.length == 0) //1 busline, 1 day, 0 hours\n\t\t\t{\n\t\t\t\tvar b = busLineNames.indexOf(user.buslines[0]);\n\t\t\t\tvar d = user.currentTime.days[0];\n\n\t\t\t\tvar data = 0;\n\n\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].days[d].boardings.total();\n\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].days[d].boardings.boarding;\n\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].days[d].boardings.deboarding;\n\t\t\t\t// data = busLines[b].months[user.currentTime.month].days[d].boardings.boarding;\n\n\t\t\t\tif(data > 0)\n\t\t\t\t{\n\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\tlabelData.push(\"\");\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = user.buslines[0] + \" Line - \" + dateConverter(d) + \", October \" + d + \", 2012\";\n\t\t\t}\n\t\t\telse if(user.currentTime.hours.length >= 1) //1 busline, 1 day, 1/1+ hour\n\t\t\t{\n\t\t\t\tvar b = busLineNames.indexOf(user.buslines[0]); //get the single busline\n\t\t\t\tvar d = user.currentTime.days[0];\n\n\t\t\t\tfor(i = 0; i < user.currentTime.hours.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar h = user.currentTime.hours[i];\n\t\t\t\t\tvar data = 0;\n\t\t\t\t\t\n\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.total();\n\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.boarding;\n\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.deboarding;\t\n\t\t\t\t\t// data = busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.boarding; //add up all boardings for all lines at selected hour h\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\t\tlabelData.push(timeConverter(h));\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = user.buslines[0] + \" Line - \" + dateConverter(d) + \", October \" + d + \", 2012\" + \" (\" + hourFormatter() + \")\";\n\t\t\t}\n\t\t}\n\t\telse if(user.currentTime.days.length > 1) //1+ days\n\t\t{\n\t\t\tif(user.currentTime.hours.length == 0) //1 busline, 1+ days, 0 hours\n\t\t\t{\n\t\t\t\tvar b = busLineNames.indexOf(user.buslines[0]);\n\n\t\t\t\tfor(i = 0; i < user.currentTime.days.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar d = user.currentTime.days[i];\n\t\t\t\t\tvar data = 0;\n\n\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].days[d].boardings.total();\n\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].days[d].boardings.boarding;\n\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].days[d].boardings.deboarding;\n\t\t\t\t\t// data = busLines[b].months[user.currentTime.month].days[d].boardings.boarding;\n\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\t\tlabelData.push(dateConverter(d) + \", Oct. \" + d);\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = user.buslines[0] + \" Line - \" + monthYear;\t\t\t\n\t\t\t}\n\t\t\telse if(user.currentTime.hours.length >= 1) //1 busline, 1+ days, 1/1+ hour\n\t\t\t{\n\t\t\t\tvar b = busLineNames.indexOf(user.buslines[0]);\n\n\t\t\t\tfor(i = 0; i < user.currentTime.days.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar d = user.currentTime.days[i];\n\t\t\t\t\tvar data = 0;\n\n\t\t\t\t\tfor(j = 0; j < user.currentTime.hours.length; j++)\t\t\t\t\t\n\t\t\t\t\t{\n\t\t\t\t\t\tvar h = user.currentTime.hours[j];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.total();\t\n\t\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.boarding;\t\n\t\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.deboarding;\t\n\t\t\t\t\t\t// data += busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.boarding;\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\t\tlabelData.push(dateConverter(d) + \", Oct. \" + d);\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = user.buslines[0] + \" Line - \" + monthYear + \" (\" + hourFormatter() + \")\";\n\t\t\t}\n\t\t}\n\t}\n\telse if(user.buslines.length > 1) //1+ buslines\n\t{\n\t\tif(user.currentTime.days.length == 0) //0 days\n\t\t{\n\t\t\tif(user.currentTime.hours.length == 0) //1+ buslines, 0 days, 0 hours\n\t\t\t{\n\t\t\t\tfor(i = 0; i < user.buslines.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar b = busLineNames.indexOf(user.buslines[i]);\n\t\t\t\t\t\n\t\t\t\t\tvar data = 0;\n\n\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].boardings.total();\t\n\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].boardings.boarding;\n\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].boardings.deboarding;\t\n\t\t\t\t\t// data = busLines[b].months[user.currentTime.month].boardings.boarding;\n\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\t\tlabelData.push(user.buslines[i]);\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\tdescriptionText = monthYear;\n\t\t\t}\n\t\t\telse if(user.currentTime.hours.length >= 1) //1+ buslines, 0 days, 1/1+ hours\n\t\t\t{\n\t\t\t\tfor(i = 0; i < user.buslines.length; i++)\n\t\t\t\t{\t\n\t\t\t\t\tvar b = busLineNames.indexOf(user.buslines[i]);\n\t\t\t\t\tvar data = 0;\n\n\t\t\t\t\tfor(j = 0; j < user.currentTime.hours.length; j++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tvar h = user.currentTime.hours[j];\n\t\t\t\t\t\tfor(k = 1; k <= 31; k++)\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[k].hours[h].boardings.total();\t\n\t\t\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[k].hours[h].boardings.boarding;\n\t\t\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[k].hours[h].boardings.deboarding;\n\t\t\t\t\t\t\t// data += busLines[b].months[user.currentTime.month].days[k].hours[h].boardings.boarding; //add up all boardings for all lines at selected hour h\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\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tdataAdded.push(data);\t\t\t\t\t\t\n\t\t\t\t\t\tlabelData.push(user.buslines[i]);\n\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = monthYear + \" (\" + hourFormatter() + \")\";\n\t\t\t}\n\t\t}\n\t\telse if(user.currentTime.days.length == 1) //1 day\n\t\t{\n\t\t\tif(user.currentTime.hours.length == 0) //1+ buslines, 1 day, 0 hours\n\t\t\t{\n\t\t\t\tvar d = user.currentTime.days[0];\n\n\t\t\t\tfor(i = 0; i < user.buslines.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar b = busLineNames.indexOf(user.buslines[i]);\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tvar data = 0;\n\n\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].days[d].boardings.total();\t\n\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].days[d].boardings.boarding;\n\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\tdata = busLines[b].months[user.currentTime.month].days[d].boardings.deboarding;\n\t\t\t\t\t// data = busLines[b].months[user.currentTime.month].days[d].boardings.boarding;\n\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\t\tlabelData.push(user.buslines[i]);\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\tdescriptionText = dateConverter(d) + \" - October \" + d + \", 2012\";\n\t\t\t}\n\t\t\telse if(user.currentTime.hours.length >= 1) //1+ buslines, 1 day, 1/1+ hour\n\t\t\t{\n\t\t\t\tvar d = user.currentTime.days[0];\n\n\t\t\t\tfor(i = 0; i < user.buslines.length; i++)\n\t\t\t\t{\t\n\t\t\t\t\tvar b = busLineNames.indexOf(user.buslines[i]);\n\t\t\t\t\tvar data = 0;\n\n\t\t\t\t\tfor(j = 0; j < user.currentTime.hours.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar h = user.currentTime.hours[j];\t\n\n\t\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.total();\n\t\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.boarding;\n\t\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.deboarding;\t\t\t\t\n\t\t\t\t\t\t// data += busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.boarding; //add up all boardings for all lines at selected hour h\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\n\t\t\t\t\t}\n\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tdataAdded.push(data);\t\t\t\t\t\t\n\t\t\t\t\t\tlabelData.push(user.buslines[i]);\n\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = dateConverter(d) + \" - October \" + d + \", 2012\" + \" (\" + hourFormatter() + \")\";\n\t\t\t}\n\t\t}\n\t\telse if(user.currentTime.days.length > 1) //1+ days\n\t\t{\n\t\t\tif(user.currentTime.hours.length == 0) //1+ buslines, 1+ day, 0 hours\n\t\t\t{\t\t\t\t\n\t\t\t\tfor(i = 0; i < user.buslines.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar b = busLineNames.indexOf(user.buslines[i]);\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tvar data = 0;\n\n\t\t\t\t\tfor(j = 0; j < user.currentTime.days.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar d = user.currentTime.days[j];\n\n\t\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[d].boardings.total();\n\t\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[d].boardings.boarding;\n\t\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[d].boardings.deboarding;\n\t\t\t\t\t\t// data += busLines[b].months[user.currentTime.month].days[d].boardings.boarding;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdataAdded.push(data);\n\t\t\t\t\t\tlabelData.push(user.buslines[i]);\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\tdescriptionText = \"October \" + user.currentTime.days + \", 2012\";\n\t\t\t}\n\t\t\telse if(user.currentTime.hours.length >= 1) //1+ buslines, 1+ days, 1/1+ hour\n\t\t\t{\n\t\t\t\tfor(i = 0; i < user.buslines.length; i++)\n\t\t\t\t{\t\n\t\t\t\t\tvar b = busLineNames.indexOf(user.buslines[i]);\n\t\t\t\t\tvar data = 0;\n\n\t\t\t\t\tfor(j = 0; j < user.currentTime.days.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar d = user.currentTime.days[j];\t\n\n\t\t\t\t\t\tfor(k = 0; k < user.currentTime.hours.length; k++)\t\n\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\tvar h = user.currentTime.hours[k];\n\n\t\t\t\t\t\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.total();\n\t\t\t\t\t\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.boarding;\n\t\t\t\t\t\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdata += busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.deboarding;\n\t\t\t\t\t\t\t// data += busLines[b].months[user.currentTime.month].days[d].hours[h].boardings.boarding; //add up all boardings for all lines at selected hour h\t\t\n\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\n\t\t\t\t\t}\n\n\t\t\t\t\tif(data > 0)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tdataAdded.push(data);\t\t\t\t\t\t\n\t\t\t\t\t\tlabelData.push(user.buslines[i]);\n\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tdescriptionText = \"October \" + user.currentTime.days + \", 2012\" + \" (\" + hourFormatter() + \")\";\n\t\t\t}\n\t\t}\n\t}\n\n\tfor(i = 0; i < busLineNames.length; i++)\n\t{\n\t\tdocument.getElementById(busLineNames[i]).disabled = false;\n\t}\n\n\tif(dataAdded.length > 0)\n\t{\n\t\tdocument.getElementById(\"descriptionText\").innerHTML = descriptionText;\n\t\t\n\t\tif(user.boardingDeboarding == 3)\t\t\t\t\t\t\n\t\t\tboardingsDeboardings = \"Total\";\n\t\telse if(user.boardingDeboarding == 1)\t\t\t\t\t\t\n\t\t\tboardingsDeboardings = \"Boardings\";\n\t\telse if(user.boardingDeboarding == 2)\t\t\t\t\t\t\n\t\t\tboardingsDeboardings = \"Deboardings\";\n\t\t\n\t\tupdatePie();\n\t}\n\telse\n\t{\n\t\tdataAdded.push(1);\n\t\tdocument.getElementById(\"descriptionText\").innerHTML = \"\";\n\t\tupdatePie();\n\t\tboardDeboardLabel.text(\"No data available for the current selection.\");\n\n\t\tpaths = arcs.append(\"circle\")\n\t\t\t\t\t.attr(\"r\", r)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.delay(100)\n\t\t\t\t\t.duration(200)\n\t\t\t\t\t.attr(\"fill\", \"dimgray\");\t\t\t\t\t\n\t}\t\t\t\t\t\n}", "title": "" }, { "docid": "a01babfa477ba9476d3c1b171e6f7cec", "score": "0.5792335", "text": "function getdata() {\n d3.select(\"tbody\").html(\"\");\n d3.event.preventDefault();\n\n var dateTime = d3.select(\"#datetime\").property(\"value\");\n var selectCity = d3.select(\"#city\").property(\"value\");\n var selectState = d3.select(\"#state\").property(\"value\");\n var selectCountry = d3.select(\"#country\").property(\"value\");\n var selectShape = d3.select(\"#shape\").property(\"value\");\n\n // initialize tableData as filteredData\n filteredData = tableData;\n\n if (dateTime) {\n filteredData = filteredData.filter(record => record.datetime === dateTime);}\n\n if (selectCity) {\n filteredData = filteredData.filter(record => record.city === selectCity);}\n\n if (selectState) {\n filteredData = filteredData.filter(record => record.state === selectState);}\n\n if (selectCountry) {\n filteredData = filteredData.filter(record => record.country === selectCountry);}\n\n if (selectShape) {\n filteredData = filteredData.filter(record => record.shape === selectShape);}\n\n\n // Display the filtered dataset\n filteredData.forEach((ufoSightings) => {\n console.log(ufoSightings);\n\n var row = tbody.append('tr');\n\n Object.entries(ufoSightings).forEach(([key, value]) => {\n console.log(key, value);\n var cell = row.append('td');\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "a9fd24550476b682b41bae7f63fc503a", "score": "0.5758035", "text": "function buildTable(data) {\n // Clears out data table\n tbody.html(\"\");\n // Loop through each row of the data\n data.forEach((dataRow) => {\n // Append a row to the table body\n let row = tbody.append(\"tr\");\n // add code to loop through each field\n Object.values(dataRow).forEach((val) => {\n // create a variable to append data to a table\n let cell = row.append(\"td\");\n // add the values\n cell.text(val);\n });\n });\n }", "title": "" }, { "docid": "e691482f66ecaad1870a06ca72b7ff0a", "score": "0.5751331", "text": "function select_all_data(req, res, next) {\n 'use strict';\n\tvar __FUNCTION__ = \"select_all_data\";\n\tvar rows = [];\n\tvar rows2 = [];\n\tvar query;\n\tvar crud_info = {};\n\tdebug_2(\".1.views.m4.js\",__FUNCTION__,238,\"req:\"+JSON.stringify ( req.params ));\n\tvar table_name = req.params.table_name;\n\tvar valid_table = check_table_name ( table_name );\n\tvar fmt = \t( req.params.fmt ) ? req.params.fmt : \"raw\";\t\t\n\tvar stmt_saved = \"\";\n\tvar stmt_saved_no_limit = \"\";\n\n\tif ( valid_table.error ) {\n\t\treturn next(valid_table.error);\n\t}\n\tvar v = validate_data( 'select', table_name, req.params );\n\tif ( ! v.ok ) {\n \treturn next(new restify.MissingParameterError(\"Missing or invalid data;\"+v.msg));\t\t\n\t}\n \n\t// Xyzzy - query/where \n\tvar tp = find_table ( table_name, model );\n\tif ( model.tables[tp].predef && typeof model.tables[tp].select === \"undefined\" ) {\n \treturn next(new restify.MissingParameterError(\"select is not valid on this predefined table query;\"));\t\t\n\t} else if ( model.tables[tp].predef ) {\n// xyzzy - need to handle paging (limit)/(offset) at this point\n// xyzzy - what about count?\n// xyzzy - what about orderby\n\t\tcrud_info = gen_crud_info ( crud_info, 'predef', table_name, req.params, __FUNCTION__, __FILE__, 261 );\n\t\tquery = dn.runQuery ( stmt_saved = ts0( crud_info.select_stmt, crud_info ) );\n\t} else {\n\t\tcrud_info = gen_crud_info ( crud_info, 'select', table_name, req.params, __FUNCTION__, __FILE__, 264 );\n\t\tif ( crud_info.error ) {\n\t\t\treturn next(crud_info.error);\n\t\t}\n\t\tstmt_saved_no_limit = ts0( 'select %{log_comment%} %{select_projected_cols%} from %{table_name%} %{where_clause%} ', crud_info );\n\t\tquery = dn.runQuery ( stmt_saved = ts0( 'select %{log_comment%} %{select_projected_cols%} from %{table_name%} %{where_clause%} %{order_by_clause%} %{limit%} %{offset%} ', crud_info ) );\n\t}\n\tif ( $debug$.showQuery ) {\n\t\tconsole.log ( \"Query is:\\nFile: \"+ \".1.views.m4.js\" +\" Function:\"+ __FUNCTION__ + \" Line: \"+ 272 + \" \" + stmt_saved + \"\\n\\n\" );\n\t}\n\tquery.on('error',function(err) {\n\t\tdebug_2(\".1.views.m4.js\",__FUNCTION__,275,\"got on error <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\" );\n\t\tsend_result ( res, next, null, { \"status\":\"error\", \"msg\":\"invalid query\", \"raw\": JSON.stringify(err), \"query\":stmt_saved } );\n\t});\n\tquery.on('row', function(row) { //fired once for each row returned\n\t\t// Xyzzy - Send back after N rows\n\t\t// Xyzzy - Cache rest of data for X amount of time?\n\t\trows.push(row);\n\t});\n\tquery.on('end', function(result) {\n\t\t// fired once and only once, after the last row has been returned and after all 'row' events are emitted\n\t\t// in this example, the 'rows' array now contains an ordered set of all the rows which we received from postgres\n\t\t// debug_2(\".1.views.m4.js\",__FUNCTION__,286,result.rowCount + ' rows were received');\nconsole.log ( \"query.on.end: 275, fmt=\"+fmt+\" rows=\"+JSON.stringify ( rows ) );\n\t\tif ( fmt === \"raw\" ) {\nconsole.log ( \"query.on.end: Sending result - all done.\" );\n\t\t\tsend_result ( res, next, null, rows );\n\t\t} else {\t\t// if ( fmt === \"paged\" )\n\t\t\nconsole.log ( \"query.on.end: 280, fmt=\"+fmt );\n\t\t\tvar count_query = ( model.tables[tp].count_query ) ? model.tables[tp].count_query : \" select count(1) as cnt from ( %{query%} ) as t0 \";\n\t\t\tcount_query = ts0 ( count_query, { \"query\":stmt_saved_no_limit } );\n\t\t\tif ( $debug$.showQuery ) {\n\t\t\t\tconsole.log ( \"Count Query is:\\nFile: \"+ \".1.views.m4.js\" +\" Function:\"+ __FUNCTION__ + \" Line: \"+ 297 + \" \" + count_query + \"\\n\\n\" );\n\t\t\t}\n\nconsole.log ( \"query.on.end: 287, count_query=\"+count_query );\n\t\t\tvar query2 = dn.runQuery ( count_query );\n\t\t\tquery2.on('error',function(err) {\n\t\t\t\tdebug_2(\".1.views.m4.js\",__FUNCTION__,303,\"got on error on count <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\" );\n\t\t\t\tsend_result ( res, next, null, { \"status\":\"error\", \"msg\":\"invalid query2\", \"raw\": JSON.stringify(err), \"query\":count_query } );\n\t\t\t});\n\t\t\tquery2.on('row', function(row) { //fired once for each row returned\n\t\t\t\t// Xyzzy - Send back after N rows\n\t\t\t\t// Xyzzy - Cache rest of data for X amount of time?\n\t\t\t\trows2.push(row);\n\t\t\t});\n\t\t\tquery2.on('end', function(result) {\n\t\t\t\t//fired once and only once, after the last row has been returned and after all 'row' events are emitted\n\t\t\t\t//in this example, the 'rows' array now contains an ordered set of all the rows which we received from postgres\n\t\t\t\t// debug_2(\".1.views.m4.js\",__FUNCTION__,314,result.rowCount + ' rows were received');\n\t\t\t\tsend_result ( res, next, null, { \"total\":rows2[0].cnt, \"count\":rows.length, \"data\":rows } );\n\t\t\t});\nconsole.log ( \"query.on.end: 304\" );\n\t\t\t\n\t\t}\n\t});\n}", "title": "" }, { "docid": "eac8f87d34fa74ff1488c736b0accb5d", "score": "0.5747385", "text": "function poplulateTable(data){\n data.forEach(sightingData=>{\n const trow = tbody.append(\"tr\");\n columns= [\"datetime\", \"city\", \"state\", \"country\", \"shape\", \"durationMinutes\", \"comments\"];\n columns.forEach(key=>{\n trow.append(\"td\").text(sightingData[key]);\n })\n })\n}", "title": "" }, { "docid": "06735a724819932fa39ad94c2c44f023", "score": "0.5742707", "text": "function makeTableTumors(data) {\n\n $(document).ready(function () {\n $('#table_tumors').DataTable({\n data: data,\n columns: [\n {\n data: null\n },\n {\n data: 'cellLineName'\n },\n {\n data: 'primaryDisease'\n },\n {\n data: 'Subtype'\n },\n {\n data: 'level'\n },\n {\n data: 'RNAseq'\n },\n {\n data: 'tumorType'\n },\n {\n data: 'cancerType'\n },\n {\n data: 'treatmentHistory'\n },\n {\n data: 'gender'\n },\n {\n data: 'age'\n }\n ],\n // scrollY: 325,\n deferRender: true,\n // scroller: true,\n // dom: 'Bfrtip',\n // buttons: ['csv'],\n responsive: true,\n search: true,\n bSortClasses: false,\n columnDefs: [\n {\n classname: \"select-checkbox\",\n targets: 0,\n checkboxes: {\n selectRow: true\n }\n },\n {\n targets: 4,\n render: function (data) {\n // Progress Bar\n // return '<td data-order=\"' + data + '\"><progress value=\"' + data + '\" max=\"5\"></progress></td>'\n\n // Custom Levels\n return '<img src=\"images/step' + data + '.png\" style=\"height:10px;width:100px;\" />'\n }\n }\n ],\n 'select': {\n 'style': 'multi'\n }\n });\n\n // Handle form submission event \n $('#frm-example').on('submit', function (e) {\n var form = this;\n var rows_selected = table.column(0).checkboxes.selected();\n // Iterate over all selected checkboxes\n $.each(rows_selected, function (index, rowId) {\n // Create a hidden element \n $(form).append(\n $('<input>')\n .attr('type', 'hidden')\n .attr('name', 'id[]')\n .val(rowId)\n );\n });\n\n // Output form data to a console \n $('#example-console-rows').text(rows_selected.join(\",\"));\n\n // Output form data to a console \n $('#example-console-form').text($(form).serialize());\n\n // Remove added elements\n $('input[name=\"id\\[\\]\"]', form).remove();\n\n // Prevent actual form submission\n e.preventDefault();\n\n console.log(form)\n });\n\n\n // Use Search Bar '#searchCellLines' to Filter Table\n var table_tumors = $('#table_tumors').DataTable();\n $('#searchTumors').keyup(function () {\n table_tumors.search($(this).val()).draw();\n });\n });\n}", "title": "" }, { "docid": "111428d446072f6dcaee8907e941272a", "score": "0.57407564", "text": "function generateDataUpl() {\n var valuesTemp = [];//storing data paging\n var idxTemp = 0;\n //only show current page\n for(var idx = (currPageNoUpl-1)*resultPerPage; idx < (resultPerPage*currPageNoUpl) && idx < values.length; idx++)\n valuesTemp[idxTemp++] = values[idx];\n var listData = $(\"#upload-data table tbody\");\n var scope = listData.scope();\n scope.dataListUpl = valuesTemp;\n scope.$apply();\n listData.find(\"tr td\").each(function() {\n if($(this).index() > headers.length - 1 && $(this).children(\"button\").attr(\"id\") == null)\n $(this).hide();\n });\n //redefine paging and page status\n setPaginationUpl();\n switchPageStatusUpl();\n }", "title": "" }, { "docid": "dbfc8ca3dafdf9e7347afd9e50b2559a", "score": "0.57338244", "text": "function buildTable(data) {\r\n // first we want to clear table (i.e. remove filters) each time the function is called \r\n // tbody.html references the table from the html file, then (\"\") is a blank string \r\n tbody.html(\"\");\r\n\r\n //forEach function takes a function and applies it to each item in the loop\r\n //we are passing 'data' (our data.js file) as the item to loop through\r\n data.forEach((dataRow) => {\r\n // in our loop, we will append the item of the loop into the <tbody> html tag and add a table row (tr)\r\n let row = tbody.append(\"tr\");\r\n // Object.values tells JavaScript to reference one object from the array of ufo sightings in data\r\n // datarow means we want those objects to go into datarow \r\n // forEach((val) specifies that we want one object per row \r\n Object.values(dataRow).forEach((val) => {\r\n // then append the object into the table using the table data <td> tag\r\n let cell = row.append(\"td\");\r\n // extract just the text from the object, so that it is stored in the table as text \r\n cell.text(val);\r\n // this is essentially looping through each value in the table row from our data file\r\n // then storing/appending it to the table\r\n });\r\n });\r\n }", "title": "" }, { "docid": "3e493187d23f4c857c669838e5df7887", "score": "0.57242805", "text": "function populateTable(){\n \ttable.clear();\n \tfor(var a = 0; a < prItems.length; a++){\n \t\tif (prItems[a].disctype == 2) {\n \t\t\tdiscount = prItems[a].discamt + \"%\";\n \t\t}\n \t\telse {\n \t\t\tdiscount = accounting.formatMoney(prItems[a].discamt)\n \t\t}\n\t\t\tselectedDataarray = [\n prItems[a].itemid,\n prItems[a].itemname.toUpperCase(),\n accounting.formatMoney(prItems[a].qty),\n prItems[a].uomid,\n prItems[a].unit,\n accounting.formatMoney(prItems[a].price),\n discount,\n prItems[a].disctype,\n accounting.formatMoney(prItems[a].subtotal),\n accounting.formatMoney(prItems[a].total),\n \"<center><button class='btn btn-danger btnDelete btnTable' data-value='\" + a + \"'><i class='fa fa-trash-o'></i> Delete</button></center>\"\n ];// adding selected data to array \n\n \ttable.row.add(selectedDataarray); \n\t\t} \n table.draw();\n }", "title": "" }, { "docid": "161a74b1f85f5abbe083685e5d8acc2c", "score": "0.5712389", "text": "function GenerateTableData() {\n var ret = \"\";\n var tempRet = \"\";\n var display;\n var i;\n $.each(Intern_ArrayOfValues, function (index, value) {\n\n //debugger;\n\n tempRet = tempRet + '<tr id=\"' + Intern_InstanceName + 'tableRow_' + index + '\">';\n $.each(Intern_TableFieldIDs, function (index1, value1) {\n\n //debugger;\n\n i = Intern_InputFieldIds.indexOf(value1);\n if (Intern_InputFieldTypes === undefined || Intern_InputFieldTypes === null\n || Intern_InputFieldTypes[i] === undefined || Intern_InputFieldTypes[i] === null\n || Intern_InputFieldTypes[i] === \"\") {\n display = '<td>' + value[value1] + '</td>';\n }\n else if (Intern_InputFieldTypes[i] === \"checkbox\") {\n if (value[value1] === \"0\") {\n display = \"<td>false</td>\";\n }\n else {\n display = \"<td>true</td>\";\n }\n }\n else if (Intern_InputFieldTypes[i] === \"radio\") {\n if (value[value1] === null) {\n display = \"<td></td>\";\n }\n else {\n display = \"<td>\" + value[value1] + \"</td>\";\n }\n }\n else if (Intern_InputFieldTypes[i] === \"color\") {\n display = '<td style=\"background-color:' + value[value1] + '\"></td>';\n }\n else if (Intern_InputFieldTypes[i] === \"select\") {\n display = '<td>' + $('#' + Intern_InputFieldIds[i] + ' option[value=' + value[value1] + ']').text() + '</td>';\n }\n else {\n display = '<td>' + value[value1] + '</td>';\n }\n tempRet = tempRet + display;\n //i++;\n });\n tempRet = tempRet + AddOperations(index);\n tempRet = tempRet + '</tr>';\n\n if (Setting_AddToTop)\n ret = tempRet + ret;\n else\n ret = ret + tempRet;\n tempRet = \"\";\n //i = 0;\n });\n return ret;\n }", "title": "" }, { "docid": "503a81a3c0b7311ae93778091d7cc7bd", "score": "0.5699482", "text": "function showData(dList){\n var tr, td\n var tbody = document.getElementById('tBody') // tBody adalah id yang digunakan untuk set tbody yang berada diindex.html\n tbody.innerHTML = ''\n for(var i=0; i < dList.length; i++){ // melakukan perulangan data / loop\n tr = tbody.insertRow(tbody.rows.length);\n td = tr.insertCell(tr.cells.length);\n td.setAttribute(\"align\",\"center\");\n td.innerHTML = i+1\n td = tr.insertCell(tr.cells.length);\n td.innerHTML = dList[i].name;\n td = tr.insertCell(tr.cells.length);\n td.innerHTML = dList[i].rotation_period;\n td = tr.insertCell(tr.cells.length);\n td.innerHTML = dList[i].orbital_period\n td = tr.insertCell(tr.cells.length);\n td.innerHTML = dList[i].diameter\n td = tr.insertCell(tr.cells.length);\n td.innerHTML = dList[i].climate\n td = tr.insertCell(tr.cells.length);\n td.innerHTML = dList[i].gravity\n td = tr.insertCell(tr.cells.length);\n td.innerHTML = dList[i].terrain\n td = tr.insertCell(tr.cells.length);\n td.innerHTML = dList[i].surface_water\n td = tr.insertCell(tr.cells.length);\n td.innerHTML = dList[i].population\n }\n}", "title": "" }, { "docid": "46f74706b80b512adb50c98524c7fa0d", "score": "0.5698128", "text": "function filterData() {\n \n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Get filter input\n var dateFilter = d3.select(\"#datetime\").property(\"value\");\n\n // Filter tableData for selection\n var filteredData = tableData;\n if (dateFilter !== \"\") {\n var filteredData = filteredData.filter(sighting => sighting.datetime === dateFilter);\n };\n\n // remove existing table data\n d3.select(\"tbody\").remove();\n\n // add table body back\n table.append(\"tbody\");\n\n // reload table\n loadTable(filteredData);\n}", "title": "" }, { "docid": "26d96b75080db21b81bf873abe216ec1", "score": "0.56840837", "text": "function FillTblRows(skip_upload) {\n //console.log( \"===== FillTblRows === \");\n\n const tblName = get_tblName_from_selectedBtn();\n const data_dicts = get_data_dicts(tblName);\n\n const field_setting = field_settings[selected_btn];\n\n //console.log( \" selected_btn\", selected_btn);\n //console.log( \" tblName\", tblName);\n //console.log( \" data_dicts\", data_dicts);\n //console.log( \" field_setting\", field_setting);\n\n// --- show columns\n set_columns_hidden();\n //console.log( \"columns_hidden\", columns_hidden);\n\n// --- reset table\n tblHead_datatable.innerText = null;\n tblBody_datatable.innerText = null\n\n// --- create table header and filter row\n CreateTblHeader(field_setting);\n\n// --- loop through data_dicts\n if(data_dicts){\n for (const data_dict of Object.values(data_dicts)) {\n let tblRow = CreateTblRow(tblName, field_setting, data_dict);\n };\n };\n\n// --- filter tblRow\n // set filterdict isactive after loading page (then skip_upload = true)\n // const set_filter_isactive = skip_upload;\n Filter_TableRows(skip_upload)\n } // FillTblRows", "title": "" }, { "docid": "fa6bc34f09e16abe93f54adf8867e692", "score": "0.56760526", "text": "function buildTable(data){\n var tableData = data.results;\n\n //Clear the table if it has any records\n if( myTable.data().any() )\n {\n myTable.clear(); \n } \n\n //add dashes to the dates\n angular.forEach(tableData, function(obj, inx){\n if(obj.recall_initiation_date){\n obj.recall_initiation_date = $scope.addDashes(obj.recall_initiation_date);\n }\n });\n\n //Add rows to the table then redraw the table\n myTable.rows.add(tableData).draw();\n resizeTable();\n }", "title": "" }, { "docid": "7acf068a4f5c68ba9269831697d0a167", "score": "0.5663622", "text": "function loadDataset(form_name, flag_name, table_sorting) {\n if ($(form_name).data(flag_name) === false) {\n $(function () {\n $(form_name).submit();\n });\n }\n\n // convert HTML table into JS dataTable\n $('.synergy-datatable').dataTable({\n \"bPaginate\": true,\n \"bSort\": true,\n \"iDisplayLength\": 36,\n \"bLengthChange\": false,\n \"aaSorting\": table_sorting\n });\n\n}", "title": "" }, { "docid": "b6e528e1e12ef3e2f08e84e7d0285c9a", "score": "0.5658351", "text": "function gotData_1(data) {\n\n remove_Table_1();\n createTable_1();\n\n table = document.getElementById('lampStore');\n\n let array = new Array();\n\n var lamps = data.val();\n var keys = Object.keys(lamps);\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n\n array[0] = k;\n array[1] = lamps[k].lampID;\n array[2] = lamps[k].lampName;\n array[3] = lamps[k].partNumber;\n array[4] = lamps[k].fixture;\n array[5] = lamps[k].lifeTime;\n array[6] = lamps[k].power;\n array[7] = lamps[k].qty;\n array[8] = lamps[k].location;\n\n // create a new row\n var newRow = table.insertRow(i + 1);\n\n for (var j = 0; j < 9; j++) {\n\n // create a new cell\n var cell = newRow.insertCell(j);\n\n // add value to the cell\n cell.innerHTML = array[j];\n }\n }\n // Hide first column of the table (with database keys)\n for (var i = 0; i <= keys.length; i++) {\n table.rows[i].cells[0].style.display = 'none';\n }\n for (var i = 1; i <= keys.length; i++) {\n table.rows[i].cells[2].id = 'colName';\n table.rows[i].cells[4].id = 'colFxt';\n table.rows[i].cells[7].id = 'colQty';\n }\n let testMode = document.getElementsByName('test/real');\n if (testMode[0].checked) {\n table.classList.add('borderColorGrey');\n } else {\n table.classList.add('borderColorRed');\n }\n}", "title": "" }, { "docid": "a32224de3639b1f5ee67619e885e269b", "score": "0.56445783", "text": "function InitEventTable(JsonDatas) {\n MakeSelect2(\"\");\n MakeSelectForVenueList(\"\");\n var res = eval(\"(\" + JsonDatas + \")\");\n var resLength = res.length;\n for (var i = 0; i < resLength; i++) {\n if (i == 0) {\n var thisRow = $(\"#tableEvent\").find(\"tr\").eq(1);\n $(thisRow).find(\".selVenue\").val(res[i].Venue.split(\",\")).trigger(\"change\");\n if (res[i].EventType == \"会议\") {\n $(thisRow).find(\".selType\").val(res[i].EventType);\n $(thisRow).find(\".Dajianfei\").val(res[i].Dajianfei);\n $(thisRow).find(\".Changdifei\").val(res[i].Changdifei);\n $(thisRow).find(\".Huiyi\").css(\"display\", \"inline\");\n }\n else {\n $(thisRow).find(\".selType\").val(res[i].EventType);\n $(thisRow).find(\".selYongcan\").val(res[i].Yongcan);\n $(thisRow).find(\".canbiao\").val(res[i].canbiao);\n $(thisRow).find(\".shuliang\").eq(0).val(res[i].shuliangA);\n $(thisRow).find(\".ddDanwei\").eq(0).val(res[i].danweiA);\n $(thisRow).find(\".jiushui\").val(res[i].jiushui);\n $(thisRow).find(\".shuliang\").eq(1).val(res[i].shuliangB);\n $(thisRow).find(\".ddDanwei\").eq(1).val(res[i].danweiB);\n $(thisRow).find(\".Yongcan\").css(\"display\", \"inline\");\n\n }\n\n }\n else {\n AddRow();\n var thisRow = $(\"#tableEvent\").find(\"tr\").eq(i + 1);\n $(thisRow).find(\".selVenue\").val(res[i].Venue.split(\",\"));\n if (res[i].EventType == \"会议\") {\n $(thisRow).find(\".selType\").val(res[i].EventType);\n $(thisRow).find(\".Dajianfei\").val(res[i].Dajianfei);\n $(thisRow).find(\".Changdifei\").val(res[i].Changdifei);\n $(thisRow).find(\".Huiyi\").css(\"display\", \"inline\");\n }\n else {\n $(thisRow).find(\".selType\").val(res[i].EventType);\n $(thisRow).find(\".selYongcan\").val(res[i].Yongcan);\n $(thisRow).find(\".canbiao\").val(res[i].canbiao);\n $(thisRow).find(\".shuliang\").eq(0).val(res[i].shuliangA);\n $(thisRow).find(\".ddDanwei\").eq(0).val(res[i].danweiA);\n $(thisRow).find(\".jiushui\").val(res[i].jiushui);\n $(thisRow).find(\".shuliang\").eq(1).val(res[i].shuliangB);\n $(thisRow).find(\".ddDanwei\").eq(1).val(res[i].danweiB);\n $(thisRow).find(\".Yongcan\").css(\"display\", \"inline\");\n\n }\n }\n }\n $(\"#MainContent_hdTableEventJsons\").val(JsonDatas);\n CalculateTotalPrice(\"2\");\n}", "title": "" }, { "docid": "573a5ce3162487788a674538760342f6", "score": "0.56444806", "text": "function appendTable(std,selectVal,pageVal){\n for(let i=(pageVal-1)*selectVal;i<pageVal*selectVal;i++) \n {\n $(\"#tableData\").append(appendSortedTable(std[i]))\n }\n }", "title": "" }, { "docid": "91e2e30232709ed51aa37b827e2909f7", "score": "0.5640747", "text": "function handleChange(){\n\n //create new data table that is going to be filtered\n var filtered = data;\n \n //prevent page refresh!\n d3.event.preventDefault();\n\n //clear previous table\n tbody.text(\"\")\n\n //TEST\n if (input_date.property(\"value\")){\n var date = input_date.property(\"value\");\n //create new data object with filtered rows by input date\n filtered = data.filter(i => i.datetime == date);\n };\n\n //if a value is input for date filter the data\n if (input_date.property(\"value\")){\n var date = input_date.property(\"value\");\n //create new data object with filtered rows by input date\n filtered = data.filter(i => i.datetime == date);\n };\n\n //if a value is input for city filter the data\n if (input_city.property(\"value\")){\n var city = input_city.property(\"value\");\n //create new data object with filtered rows by input date\n filtered = filtered.filter(i => i.city == city);\n };\n\n //if a value is input for state filter the data\n if (input_state.property(\"value\")){\n var state = input_state.property(\"value\");\n //create new data object with filtered rows by input date\n filtered = filtered.filter(i => i.state == state);\n };\n\n //if a value is input for country filter the data\n if (input_country.property(\"value\")){\n var country = input_country.property(\"value\");\n //create new data object with filtered rows by input date\n filtered = filtered.filter(i => i.country == country);\n };\n\n //if a value is input for shape filter the data\n if (input_shape.property(\"value\")){\n var shape = input_shape.property(\"value\");\n //create new data object with filtered rows by input date\n filtered = filtered.filter(i => i.shape == shape);\n };\n\n\n //input this new data object into our function to output the table\n create_table(filtered);\n\n}", "title": "" }, { "docid": "3a9101f1d0309eed7d0d8a499c651b60", "score": "0.5638253", "text": "function drillTable(completion_status, title, graphType, isSearch, value) {\n\n /*dashBoardId=21&siteId=5851&managerId=12212358&groupByColumnName=CostCenter&groupByColumnValue=AP&completionStatus=pastDue\n &key=courseAssignmentDetailForPastDue pie chart\n dashBoardId=21&siteId=5851&managerId=12272056&\n groupByColumnName=HZip&groupByColumnValue=Job%20Family&completionStatus=completeOnTime&key=courseAssignmentDetail donut/chart2\n */\n var title = replaceSpecialCharacters(title);\n if (graphType == \"pie\")\n $(\"#jsonTablePie\").html(\"\");\n\n var groupByColumnName = getGroupbyValue();\n var managerId = getSelectedUserId();\n var showDrillTable = 0;\n var emptyTable = {};\n var data;\n var chartId;\n var finename;\n // data = {dashBoardId: dashBoardId, siteId: siteId, managerId: managerId, groupByColumnName: groupByColumnName, groupByColumnValue: title, completionStatus: completion_status, hasDashBoardConfig: hasDashBoardConfig, key: 'courseAssignmentDetailForPastDue'};\n\n switch (graphType) {\n case 'pie':\n showDrillTable = showDrillDownReport;\n if (showDrillTable == 1) {\n var tbl_id = \"jsonTablePie\";\n showMinus(graphType);\n $(\"#pieToggle\").slideDown();\n $(\"#pieDetail .dataTables_wrapper\").remove();\n $(\"#pieDetail .dtContainer\").append(prepareDataTableTemplate(tbl_id)).slideDown();\n chartId = 'pieDetail';\n finename = secondChartTitle;\n $(\"#pie_loader\").show();\n $(\"#pieDetail\").slideDown();\n data = {dashBoardId: dashBoardId, managerId: managerId, groupByColumnName: groupByColumnName, groupByColumnValue: title, completionStatus: completion_status, hasDashBoardConfig: hasDashBoardConfig, key: 'courseAssignmentDetailForPastDue', isExport: '0'};\n\n }\n break;\n case 'chart2':\n showDrillTable = showDrillDownReport;\n if (showDrillTable == 1) {\n var tbl_id = \"jsonTableChart2\";\n showMinus(graphType);\n $(\"#chart2Toggle\").slideDown();\n $(\"#chart2_loader\").show();\n $(\"#chart2Detail .dataTables_wrapper\").remove();\n $(\"#chart2Detail .dtContainer\").append(prepareDataTableTemplate(tbl_id)).slideDown();\n chartId = 'chart2Detail';\n finename = firstChartTitle;\n $(\"#chart2Detail\").slideDown();\n data = {dashBoardId: dashBoardId, managerId: managerId, groupByColumnName: groupByColumnName, groupByColumnValue: title, completionStatus: completion_status, key: 'courseAssignmentDetail', hasDashBoardConfig: hasDashBoardConfig, isExport: '0'};\n }\n break;\n case 'chart1':\n showDrillTable = showDrillDownUserSummaryDetailReport;\n if (showDrillTable == 1) {\n var tbl_id = \"jsonTableChart1\";\n showMinus(graphType);\n $(\"#chart1Toggle\").slideDown();\n $(\"#chart1Detail .dataTables_wrapper\").remove();\n $(\"#chart1Detail .dtContainer\").append(prepareDataTableTemplate(tbl_id)).slideDown();\n chartId = 'chart1Detail';\n finename = secondChartTitle;\n $(\"#chart1_loader\").show();\n $(\"#chart1Detail\").slideDown();\n data = {dashBoardId: dashBoardId, managerId: managerId, groupByColumnName: groupByColumnName, groupByColumnValue: title, completionStatus: completion_status, hasDashBoardConfig: hasDashBoardConfig, key: 'userAssignmentDetail', isExport: '0'};\n }\n break;\n case 'donut':\n showDrillTable = showDrillDownReport;\n if (showDrillTable == 1) {\n var tbl_id = \"jsonTableDonut\";\n showMinus(graphType);\n $(\"#donutToggle\").slideDown();\n $(\"#donutToggle .dataTables_wrapper\").remove();\n $(\"#donutDetail .dtContainer\").append(prepareDataTableTemplate(tbl_id)).slideDown();\n chartId = 'donutDetail';\n finename = fourthChartTitle;\n $(\"#donut_loader\").show();\n $(\"#donutDetail\").slideDown();\n data = {dashBoardId: dashBoardId, managerId: managerId, groupByColumnName: 'isNullValue', groupByColumnValue: 'isNullValue', completionStatus: completion_status, hasDashBoardConfig: hasDashBoardConfig, key: 'courseAssignmentDetail', isExport: '0'};\n }\n break;\n }\n\n if (typeof isSearch != undefined && isSearch === true) {\n $.extend(data, window[graphType + '_drillFilter']);\n }\n else {\n $('#' + graphType + '_columnName').html('');\n $('#' + graphType + '_searchText').val('');\n }\n\n $('#' + graphType + '_error').html('');\n if (showDrillTable == 1) {\n $('#' + tbl_id).html('');\n $.ajax({\n url: url + 'dashboard',\n dataType: 'json',\n data: data,\n type: 'GET',\n success: function (response) {\n if (response.error_code == 200) {\n if ($('#' + graphType + '_serachBox').length == 0) {\n $(\"#\" + chartId + ' .dtContainer').prepend('<div id=\"' + graphType + '_error\"></div><div id=\"' + graphType + '_serachBox\" class=\"searchBox\">'\n + '<input type=\"hidden\" id=\"' + graphType + '_completionStatus\" value=\"' + completion_status + '\"/>'\n + '<input type=\"hidden\" id=\"' + graphType + '_title\" value=\"' + title + '\"/>'\n + '<input type=\"hidden\" id=\"' + graphType + '_totalRecords\" value=\"' + value + '\"/>'\n + prepareSearchBox(graphType) + '</div>');\n } else {\n $('#' + graphType + '_completionStatus').val(completion_status);\n $('#' + graphType + '_title').val(title);\n $('#' + graphType + '_totalRecords').val(value);\n }\n drawTable(response.table, tbl_id, graphType, value, finename);\n /*if ($('#' + graphType+'_searchBtn').length == 0) {\n $('#' + graphType +'_serachBox').after('<div style=\"clear:both;margin-left:5px\"><input type=\"button\" id=\"'+graphType+'_searchBtn\" value=\"Search\" class=\"searchBtn\" graphType=\"'+graphType+'\"/></div>');\n }*/\n showHideGraphLoader(graphType);\n }\n else if (response.error_code == 402) {\n window.location.href = '/auth/logout';\n }\n else if (response.error_code == 401) {\n appendErrorMessage(response.error_code, response.error_msg);\n }\n else {\n drawTable(emptyTable, tbl_id, graphType);\n showHideGraphLoader(graphType);\n }\n\n }\n });\n }\n\n}", "title": "" }, { "docid": "e262d1177bd455ee83a6b56930aab887", "score": "0.562984", "text": "function fillTable(selector){\n\n $(\"#tableToFill\").empty();\n let timeStamp = $(selector.toString()).attr(\"data-timestamp\");\n\n \n for(let i = 0; i<16; i++){\n let tr = \"<tr id='tr\" + i + \"' class='time-item'></tr>\";\n $(\"#tableToFill\").append(tr);\n for(let j = 0; j<6; j++){\n let td = \"<td></td>\";\n let tdTime = \"<td>\" + times[i] + \"</td>\";\n if(j == 0){\n $(\"#tr\" + i).append(tdTime);\n }else{\n $(\"#tr\" + i).append(td);\n }\n }\n }\n /*\n //Takes the date timestamp at 12 AM and adds 9 hours * 3600 seconds\n //then adds the number of half hours (1800 seconds * i) to get the time\n let newTimeStamp = (Number(timeStamp) + (3600*9) + Number(1800*i) + Number(86400 * j));\n //Build row\n let tr = \"<tr id='tr' class='time-item'>\" +\n \"<td>\" + times[i] + \"</td>\" +\n \"<td id='td\" + newTimeStamp + \"'></td>\" +\n \"<td id='tdEquipment\" + newTimeStamp + \"'><span id='span\" + newTimeStamp + \"' data-badgeTimeStamp='\" + newTimeStamp + \"' class='badge badge-dark' hidden>16</span></td>\" +\n \"</tr>\";\n //Append Row\n $(\"#tableToFill\").append(tr);\n\n //Add a listener to the row\n //This handles filtering the elements\n $(\"tr[data-timestamp='\" + newTimeStamp + \"']\").click(function(){\n let has = $(\"tr[data-timestamp='\" + newTimeStamp + \"']\").hasClass(\"chosen\");\n if(has == true){\n //then remove this class\n //https://stackoverflow.com/questions/5767325/how-do-i-remove-a-particular-element-from-an-array-in-javascript\n chosen.splice((chosen.indexOf(newTimeStamp)), 1);\n $(\"tr[data-timestamp='\" + newTimeStamp + \"']\").removeClass(\"chosen\");\n console.log(chosen);\n }\n if(has == false){\n //then add the class\n chosen.push(newTimeStamp);\n $(\"tr[data-timestamp='\" + newTimeStamp + \"']\").addClass(\"chosen\");\n console.log(chosen);\n }\n });\n //This will handle filtering via the database\n filter(newTimeStamp);\n }\n */\n}", "title": "" }, { "docid": "d616e490fc503c6ce4b2e142aaf2f058", "score": "0.5624327", "text": "static fillRows(table, data, headers) {\n data.forEach(elem => {\n let row = table.insertRow(-1)\n let tds = []\n headers.forEach(el => {\n tds.push(row.insertCell(-1))\n tds[tds.length - 1].innerHTML = elem[el] ? elem[el] : ''\n tds[tds.length - 1].id = el\n })\n })\n }", "title": "" }, { "docid": "01feeec6db7bc481cc6f82f1bc237d6e", "score": "0.5623212", "text": "function bindIdsToTable() {\n dataTable = $(table).dataTable(\n {\n language: {\n url: \"localisation/datatables-\" + lang + \".json\",\n sSearch: \"Filter:\"\n },\n bLengthChange: false,\n bScrollCollapse: true,\n sScrollXInner: \"110%\",\n iDisplayLength : 20,\n aoColumns: [\n { mData: \"userId\" },\n { mData: \"email\" },\n { mData: \"dataGroups\" },\n { mData: \"role\" },\n { mData: \"lastMod\" }\n ]\n })\n }", "title": "" }, { "docid": "c0c8dd7e17986bc282690f4d3bcb10c1", "score": "0.5617602", "text": "function table_maker(datasets) {\n reset_table();\n for (var i = 0; i < datasets.length; i++) {\n $('#summary').append('<tr style=\"text-align: center\">' + data(datasets[i]) + '</tr>');\n }\n totals_row_maker(datasets);\n $('#table-div').slideDown();\n }", "title": "" }, { "docid": "7fc53aae44ef0efc1e34d93fa97615db", "score": "0.56041294", "text": "function buttonClick(){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Create & display new table with filtered/searched data\n var filtered_table = tableData.filter(ufo_sighting => ufo_sighting.datetime===dateInputText.property(\"value\"))\n displayData(filtered_table);\n}", "title": "" }, { "docid": "3ba203b25c039a8a2dfc32c462a46328", "score": "0.56039304", "text": "function populateTable() {\n tableData.forEach(item => {\n tablerow = d3.select(\"tbody\").append(\"tr\")\n tablerow.append(\"td\").text(item.datetime)\n tablerow.append(\"td\").text(item.city)\n tablerow.append(\"td\").text(item.state)\n tablerow.append(\"td\").text(item.country)\n tablerow.append(\"td\").text(item.shape)\n tablerow.append(\"td\").text(item.durationMinutes)\n tablerow.append(\"td\").text(item.comments)\n });\n}", "title": "" }, { "docid": "5fc8a1ed075f4a6dfe119a49d491f3b6", "score": "0.5599929", "text": "function renderData() {\n tableBody.innerHTML = \"\";\n for (var i = 0; i < tableData.length; i++) {\n var data = tableData[i];\n var rows = Object.keys(data);\n var input = tableBody.insertRow(i);\n for (var j = 0; j < rows.length; j++) {\n var field = rows[j];\n var cell = input.insertCell(j);\n cell.innerText = data[field];\n }\n }\n}", "title": "" }, { "docid": "8a26408e43002bb7444fdee9a238a63b", "score": "0.55886036", "text": "function setInputData(event) {\r\n\r\n\t\t\t\t\t\t// console.log($('#row'));\r\n\t\t\t\t\t\tclearFields();\r\n\t\t\t\t\t\tvar row = \"#\" + $(this).parent().parent().attr('id');\r\n\r\n\t\t\t\t\t\tconsole.log(row);\r\n\r\n\t\t\t\t\t\tvar idModelo = $(row).find(\"td:eq(0)\").text();\r\n\r\n\t\t\t\t\t\tvar descMarca = $(row).find(\"td:eq(1)\").text();\r\n\r\n\t\t\t\t\t\tvar descTipoV = $(row).find(\"td:eq(2)\").text();\r\n\r\n\t\t\t\t\t\tvar descModelo = $(row).find(\"td:eq(3)\").text();\r\n\r\n\t\t\t\t\t\tvar statusModelo = $(row).find(\"td:eq(4)\").text();\r\n\r\n\t\t\t\t\t\tconsole.log(\"Status: \" + statusModelo);\r\n\r\n\t\t\t\t\t\t$('#tf_Id').val(idModelo);\r\n\t\t\t\t\t\t$('#tf_Descricao').val(descModelo);\r\n\r\n\t\t\t\t\t\t// Define O Valor Do Status Como Numero Para\r\n\t\t\t\t\t\tif (statusModelo.toLowerCase() === \"ativo\") {\r\n\t\t\t\t\t\t\t$('#slc_Status').val(0);\r\n\t\t\t\t\t\t} else if (statusModelo.toLowerCase() === \"inativo\") {\r\n\t\t\t\t\t\t\t$('#slc_Status').val(1);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Define O Valor Da Marca No Select\r\n\t\t\t\t\t\t$.each($('#slc_Marca').children(), function(k, v) {\r\n\t\t\t\t\t\t\t// Define O Valor Do Option Para False Para Depois\r\n\t\t\t\t\t\t\t// Definir\r\n\t\t\t\t\t\t\t// Um Valor Como TRUE\r\n\t\t\t\t\t\t\t$(v).attr('selected', false);\r\n\r\n\t\t\t\t\t\t\t// Efetua A Comparação Para Ver Se O Valor Da Table\r\n\t\t\t\t\t\t\t// é igual\r\n\t\t\t\t\t\t\t// Ao valor do OPTION\r\n\t\t\t\t\t\t\tif ($(v).text().toLowerCase() === descMarca\r\n\t\t\t\t\t\t\t\t\t.toLowerCase()) {\r\n\r\n\t\t\t\t\t\t\t\t$(v).attr('selected', true);\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t// Define O Valor Do TipoVeiculo No Select\r\n\t\t\t\t\t\t$.each($('#slc_TipoVeiculo').children(),\r\n\t\t\t\t\t\t\t\tfunction(k, v) {\r\n\t\t\t\t\t\t\t\t\t// Define O Valor Do Option Para False Para\r\n\t\t\t\t\t\t\t\t\t// Depois\r\n\t\t\t\t\t\t\t\t\t// Definir\r\n\t\t\t\t\t\t\t\t\t// Um Valor Como TRUE\r\n\t\t\t\t\t\t\t\t\t$(v).attr('selected', false);\r\n\r\n\t\t\t\t\t\t\t\t\t// Efetua A Comparação Para Ver Se O Valor\r\n\t\t\t\t\t\t\t\t\t// Da Table\r\n\t\t\t\t\t\t\t\t\t// é igual\r\n\t\t\t\t\t\t\t\t\t// Ao valor do OPTION\r\n\t\t\t\t\t\t\t\t\tif ($(v).text().toLowerCase() === descTipoV\r\n\t\t\t\t\t\t\t\t\t\t\t.toLowerCase()) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t$(v).attr('selected', true);\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t// Acessa O Componente Filho Do Select(OPTION)\r\n\t\t\t\t\t\t// roda a funcao para separar o valor(value) do conteudo\r\n\t\t\t\t\t\t// do\r\n\t\t\t\t\t\t// OPTION\r\n\t\t\t\t\t\t$.each($('#slc_Status').children(), function(k, v) {\r\n\t\t\t\t\t\t\t// Define O Valor Do Option Para False Para Depois\r\n\t\t\t\t\t\t\t// Definir\r\n\t\t\t\t\t\t\t// Um Valor Como TRUE\r\n\t\t\t\t\t\t\t$(v).attr('selected', false);\r\n\r\n\t\t\t\t\t\t\t// Efetua A Comparação Para Ver Se O Valor Da Table\r\n\t\t\t\t\t\t\t// é igual\r\n\t\t\t\t\t\t\t// Ao valor do OPTION\r\n\t\t\t\t\t\t\tif ($(v).text().toLowerCase() === statusModelo\r\n\t\t\t\t\t\t\t\t\t.toLowerCase()) {\r\n\t\t\t\t\t\t\t\t$(v).attr('selected', true);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tvar button = $('#btn-operation');\r\n\t\t\t\t\t\tif ($('#tf_Id').val() != \"\") {\r\n\t\t\t\t\t\t\tbutton.val(\"Atualizar Modelo\");\r\n\t\t\t\t\t\t} else if ($('#tf_Id').val() == \"\") {\r\n\t\t\t\t\t\t\tbutton.val(\"Inserir Modelo\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}", "title": "" }, { "docid": "bfbb1b98081593d497c67022bda5bea6", "score": "0.55823123", "text": "function loadData() {\n loadTable();\n}", "title": "" }, { "docid": "ed3ad996e6d1b4ef0f9e72a558b42bfd", "score": "0.55816823", "text": "addToCrossing() {\n\n let selectedRow = this.state.selectedRow;\n //prompt user if no records are selected yet.\n if (selectedRow.length == 0) {\n this.promptNoRecords();\n return;\n }\n\n //extract only new records from selected records so that\n // merge can be done with old Crossing records if any\n let newRecords = [];\n if (this.state.crossingRecords.length)\n newRecords = selectedRow.filter((r) => {\n return this.state.crossingRecords.indexOf(r) == -1\n });\n else\n newRecords = selectedRow;\n\n //updating Crossing records for submision to server\n //and reset selectedRow\n let crossingRecords = this.state.crossingRecords.concat(newRecords)\n\n\n if (selectedRow.length == 0 || crossingRecords.length == 0) {\n return;\n }\n this.setState({\n crossingRecords: crossingRecords,\n selectedRow: []\n })\n\n //need to send data to server in tabular format to cutoff processing in server\n let crossingQuery = [], counter = 0;\n this.state.mainTableData.map((f) => {\n if (crossingRecords.indexOf(f.EZID) > -1) {\n crossingQuery.push('TempData[' + counter + '].ezid=' + f.EZID);\n crossingQuery.push('TempData[' + counter + '].etc=' + f.EntityTypeCode);\n crossingQuery.push('TempData[' + counter + '].name=' + f.Name);\n crossingQuery.push('TempData[' + counter + '].delete=false');\n counter++;\n }\n });\n\n crossingQuery.push('module=CRO');\n crossingQuery.push('CC=TO');\n crossingQuery.push('getCount=false');\n this.fetchData({type: \"SEND_RECORDS_TO_ACTION\", data: crossingQuery, module: \"CRO\"})\n }", "title": "" }, { "docid": "842ac2648f456d615df6d55a4d6e7e72", "score": "0.55755365", "text": "function buildTable(data) {\n // Clear existing data in table\n tbody.html(\"\");\n // Create forEach function to loop through the table\n data.forEach((dataRow) => {\n // Create a variable to add a row to the table\n let row = tbody.append(\"tr\");\n // Reference an object from the array of UFO sightings and put each sighting in its own row of data\n Object.values(dataRow).forEach((val) => {\n // Create a variable to add data to the row\n let cell = row.append(\"td\");\n // Add values \n cell.text(val);\n });\n });\n}", "title": "" }, { "docid": "5ceeab943f6b11ca349c27b074ab30ad", "score": "0.5572859", "text": "function multipleWellSelected() {\n let options = document.getElementById('multiple-site-filter').selectedOptions;\n // let options = d3.select('multiple-site-filter').node().value();\n let values = Array.from(options).map(({ value }) => value);\n // the value entered in the sitename filter becomes the value for the siteName variable\n //console.log(values);\n // set data be filtered to imported data (the data ready to be filtered)\n let filteredData = tableData;\n var requestedData = [];\n //console.log(filteredData);\n values.forEach((well) => {\n filteredData.forEach((row) => {\n {if (well == row[0]){requestedData.push(row)}}\n }) \n buildTable(requestedData); //BUILD TABLE WITH RequestedData ARRAY\n {if(values == []){buildTable(filteredData)}}; //SELECT DOESNT DETECT THAT THERE ISN'T ANYTHING SELECTED\n console.log(values);\n console.log(filteredData);\n})}", "title": "" }, { "docid": "e82c72c97d11efdf63ef166d5d14caf5", "score": "0.5567987", "text": "function requestTableData() {\n var sortParams = o.scope.sortParams,\n pp = fs.isO(o.scope.payloadParams),\n payloadParams = pp || {},\n p = angular.extend({}, sortParams, payloadParams, o.query);\n\n if (wss.isConnected()) {\n if (fs.debugOn('table')) {\n $log.debug('Table data REQUEST:', req, p);\n }\n wss.sendEvent(req, p);\n ls.start();\n }\n }", "title": "" }, { "docid": "9a553dcc70913a6e5d3a12ababe5caf1", "score": "0.5556801", "text": "function runFilter() {\r\n // jQuery method for emptying the existing table each time\r\n // a new query is performed\r\n $(\"#tbody\").empty();\r\n // Select the input element and get the raw HTML node\r\n var inputElement = d3.select(\"#datetime\");\r\n // Get the value property of the input element\r\n var inputValue = inputElement.property(\"value\");\r\n // Only return values that match with input date\r\n var filteredData = data.filter(data => data.datetime === inputValue);\r\n // Prevent the page from refreshing after form submission\r\n d3.event.preventDefault();\r\n // Function to add filtered data to table\r\n filteredData.forEach((runFilteredData) => {\r\n // Add a row for each key/value pair found in filtered dataset\r\n var row = tbody.append(\"tr\");\r\n // Append values found in filtered data set to appropriate columns\r\n Object.entries(runFilteredData).forEach(([key, value]) => {\r\n var cell = row.append(\"td\");\r\n cell.text(value);\r\n });\r\n });\r\n // jQuery method for emptying the input field after click\r\n $(\"#datetime\").val('');\r\n}", "title": "" }, { "docid": "4ec53c77f263107f93c8729ee2105640", "score": "0.5552935", "text": "function loadTable(inputFilter) {\n \n d3.select(\"tbody\")\n \n .selectAll(\"tr\")\n \n .data(inputFilter)\n \n .enter()\n \n .append(\"tr\")\n \n .html(function(d) {\n \n return `<td>${d.datetime}</td> <td>${d.city}</td> <td>${d.state}</td> <td>${d.country}</td>\n \n <td>${d.shape}</td> <td>${d.durationMinutes}</td> <td>${d.comments}</td> `;\n });\n }", "title": "" }, { "docid": "ea80e0310afb5a596afe513cc5520a14", "score": "0.55522007", "text": "function upload_me(dataText) {\n // parse data stream\n var data = [];\n d3.csv.parse(dataText, function(row) {\n data.push(row);\n });\n var max_size = data.length\n // populate the dropdown list\n ug=d3.select(\"#upload_search\").selectAll(\"option\").data(data, function(d, i) { return i+1+\": \"+d.value+\" \"+d.table; });\n ug.enter()\n .append(\"option\")\n .attr(\"value\", function(d, i) { return i; })\n .attr(\"search\", function(d) { return d.value; })\n .attr(\"table\", function(d) { return d.table; })\n .text(function(d, i) {\n idx=i+1;\n return \" \"+idx+\": \"+d.value+\" \"+d.table;\n });\n ug.exit().remove();\n $('.selectpicker').selectpicker('refresh');\n // hook up 'previous' button\n d3.select(\"#dd_previous\").on(\"click\", function() {\n current=parseInt(d3.select(\"ul.dropdown-menu.selectpicker\").select(\"li.selected\").attr(\"data-original-index\"))\n if (current>0) {\n dd_now=current-1;\n d3.select(\"#upload_search\").property(\"value\", dd_now)\n dd_change(d3.select(\"#upload_search\").select('option[value=\"'+dd_now+'\"]'));\n };\n });\n // hook up 'next' button\n d3.select(\"#dd_next\").on(\"click\", function() {\n current=parseInt(d3.select(\"ul.dropdown-menu.selectpicker\").select(\"li.selected\").attr(\"data-original-index\"))\n if (current<max_size-1) {\n dd_now=current+1;\n d3.select(\"#upload_search\").property(\"value\", dd_now)\n dd_change(d3.select(\"#upload_search\").select('option[value=\"'+dd_now+'\"]'));\n };\n });\n // this controls changed due to clicking on the lsit\n d3.select(\"ul.dropdown-menu.selectpicker\").selectAll('li').on(\"click\", function() {\n current=parseInt(d3.select(this).attr(\"data-original-index\"));\n if (current != dd_now) {\n dd_now=current;\n dd_change(d3.select(\"#upload_search\").select('option[value=\"'+current+'\"]'));\n }\n });\n // function to update node tree based on selected option\n function dd_change(selected_option) {\n $('.selectpicker').selectpicker('render');\n val = selected_option.attr(\"table\").substr(2)\n if (zoo != val) {\n zoo = val;\n set_zoo(selected_option.attr(\"search\"));\n }\n else {\n //updateData(selected_option.attr(\"search\"));\n };\n };\n // load first option from the list\n var dd_now = 0\n dd_change(d3.select(\"#upload_search\").select('option[value=\"0\"]'));\n}", "title": "" }, { "docid": "8e6e8ddba4558c6e8405a62628c1f498", "score": "0.5551164", "text": "function selectData(err, results, fields, req, res, recordsTotal, recordsFiltered) {\n\tif (err) throw err;\n\n\t// Convert object to array, format datetime\n\tarr = [];\n\tfor(i = 0; i < results.length; i++) {\n\t\tarr.push(Object.values(results[i]));\n\t\tarr[i][1] = arr[i][1].toLocaleString();\n\t}\n\n\tsendback = {\n\t\t\"draw\": req.query.draw,\n\t\t\"recordsTotal\": recordsTotal,\n\t\t\"recordsFiltered\": recordsFiltered,\n\t\t\"data\": JSON.parse(JSON.stringify(arr))\n\t}\n\n\tres.send(sendback);\n}", "title": "" }, { "docid": "1ef321f1c48f731e4d4752c75025ccbd", "score": "0.55501866", "text": "function resetDataDeselect() {\n\t\t\tconsole.log(\"resetDataDeselect()\");\n\n\t\t\tvm.apiDomain.alleleKey = \"\";\t\n\t\t\tvm.apiDomain.alleleSymbol = \"\";\t\n\t\t\tvm.apiDomain.accID = \"\";\n\t\t\tvm.apiDomain.mutationInvolves = [];\n\t\t\tvm.apiDomain.expressesComponents = [];\n\t\t\tvm.apiDomain.driverComponents = [];\n\t\t vm.attachOrganismValue = \"\";\n for(var i=0;i<5; i++) { addMutationInvolvesRow(); }\n for(var i=0;i<5; i++) { addExpressesComponentsRow(); }\n for(var i=0;i<5; i++) { addDriverComponentsRow(); }\n\t\t}", "title": "" }, { "docid": "ab291327ce3574ae52e40de42a0172b8", "score": "0.5544335", "text": "function getData(param, $leftTable, $rightTable, callback) {\n\n jQuery.post(\"/adcaslte/svc/DownLinkByNMSStats-selectCellTrafficStats\",param,function(result,stat){\n\n $(\"input[name=checkAll]\").attr(\"checked\",false); //전체선택된거 원위치\n\n if(result.error || result.rows.length===0){\n callback(result);\n return;\n }\n\n //각항목 배열\n var propertiesArray = {};\n //for 문으로 튜닝한다\n for(idx=0;idx<result.rows.length;idx++) {\n\n var row = result.rows[idx];\n\n //각 항목별 배열만들기\n propertiesArray = getPropertiesArray(row,propertiesArray);\n\n var $tr = $(\"<tr name='\" + row.ROWIDX + \"'>\"\n +\"<td style='height:13px;width:100px;text-align:center;font-size:11px; display:none;' group='title01'>\"+isUndifined(row.TITLE01,\"-\") + \"</td>\"\n +\"<td style='width:100px;text-align:center;font-size:11px; display:none;' group='title02'>\"+isUndifined(row.TITLE02,\"-\") + \"</td>\"\n +\"<td style='width:100px;text-align:center;font-size:11px; display:none;' group='title03'>\"+\"<div style='text-align:center;margin:0px;padding:0px;height:15px;width:95%;overflow-x:hidden;overflow-y:hidden;'>\"\n + isUndifined(row.TITLE03,\"-\") + \"</div>\" +\"</td>\"\n\n\n\n +\"<td style='width:70px;text-align:center;font-size:11px;'>\"+isUndifined(row.FREQ_KIND,\"-\")+\"</td>\"\n +\"<td style='width:30px;text-align:center;font-size:11px;'>\"\n + (function(_idx, _row){\n if ($rightTable.parent().attr(\"id\").match(/After/g)) {\n return \"&nbsp;\";\n } else {\n return \"<input onclick='checkedGraph(this)' type='checkbox' style='margin: 0px;' name='\"+_row.ROWIDX+\"'>\";\n }\n })(idx, row)\n +\"</td>\"\n +\"</tr>\")\n .data(\"row\",row)\n .appendTo($leftTable);\n\n $tr.children(\"td[group^=title]\").each(function(index,childTd){\n if($(\"#title01\").is(\":visible\") && $(childTd).is(\"[group=title01]\")) {\n $(childTd).show();\n }\n if($(\"#title02\").is(\":visible\") && $(childTd).is(\"[group=title02]\")) {\n $(childTd).show();\n }\n if($(\"#title03\").is(\":visible\") && $(childTd).is(\"[group=title03]\")) {\n $(childTd).show();\n }\n });\n\n $(\"<tr name='\" + row.ROWIDX + \"'>\"\n +\"<td style='text-align: right;font-size:11px;'>\"\n +(function(value,sign,critical) {\n if(Number(value) && critical != null && eval(value+sign+critical)) {\n return \"<span style='color:red'>\"+value+\"</span>\";\n } else {\n return value;\n }\n })(formatNumber(row.THROUGHPUT),'<',result.adminCriticalValues && result.adminCriticalValues.DL_RRU_VAL1)\n +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.CQI_AVERAGE )+\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.CQI0_RATE )+\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.RI_RATE )+\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"\n +(function(value,sign,critical) {\n if(Number(value) && critical != null && eval(value+sign+critical)) {\n return \"<span style='color:red'>\"+value+\"</span>\";\n } else {\n return value;\n }\n })(formatNumber(row.DL_PRB_RATE),'>',result.adminCriticalValues && result.adminCriticalValues.PRB_USG_VAL1)\n +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.MCS_AVERAGE )+\"</td>\" /*SS*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.MIMO_RATE )+\"</td>\" /*LG*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.DL_THROUGHPUT)+\"</td>\" /*LG*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.LICENSE_FAIL )+\"</td>\" /*LG*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.MIMO_RATE )+\"</td>\" /*NSN*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.MCS_AVERAGE )+\"</td>\" /*NSN*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.PUCCH_AVG )+\"</td>\" /*NSN*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.R2_PUCCH_AVG )+\"</td>\" /*NSN*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.PUSCH_AVG )+\"</td>\" /*NSN*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.R2_PUSCH_AVG )+\"</td>\" /*NSN*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.PDCP_DL_MB )+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.PRB_USG_RATE)+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.DRB_USG_RATE)+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.CON_TIME )+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.TRY_CCNT )+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.CON_RATE )+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.CDC_RATE )+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.DL_FA_USG_RATE )+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.VOICE_DL_MB ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.VOICE_DL_PRB ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.VOICE_TRY_CCNT ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.VOICE_TIME ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.IMAGE_DL_MB ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.IMAGE_DL_PRB ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.IMAGE_TRY_CCNT ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(row.IMAGE_TIME ) +\"</td>\"\n// +\"<td style='text-align: right;font-size:11px;'>\"+ isUndifined(row.CHNL_TYPE,\"-\") +\"</td>\"\n// +\"<td style='text-align: right;font-size:11px;'>\"+ formatNumber(row.CHNL_COUNT).replace(\".0\",\"\") +\"</td>\"\n\n +\"</tr>\")\n .appendTo($rightTable);\n\n }\n\n //각항목 배열 통계\n var statsArray = getStatsArray(propertiesArray);\n\n for(var i=0; i < 4; i++) {\n var title = \"\";\n if(i === 0) {\n title = '전체평균';\n } else if(i === 1) {\n title = '최대값';\n } else if(i === 2) {\n title = '최소값';\n } else if(i === 3) {\n title = '표준편차';\n }\n var $tr = $(\"<tr>\"\n +\"<td group='title01' style='width:100px;display:none;'></td>\"\n +\"<td group='title02' style='width:100px;display:none;'></td>\"\n +\"<td group='title03' style='width:100px;display:none;'></td>\"\n +\"<td style='text-align:center; width:70px;font-size:12px;'>\"+title+\"</td>\"\n +\"<td style='width:60px;'></td></tr>\")\n .appendTo($leftTable);\n $tr.children(\"td[group^=title]\").each(function(index,childTd){\n if($(\"#title01\").is(\":visible\") && $(childTd).is(\"[group=title01]\")) {\n $(childTd).show();\n }\n if($(\"#title02\").is(\":visible\") && $(childTd).is(\"[group=title02]\")) {\n $(childTd).show();\n }\n if($(\"#title03\").is(\":visible\") && $(childTd).is(\"[group=title03]\")) {\n $(childTd).show();\n }\n });\n\n $(\"<tr>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].THROUGHPUT )+\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].CQI_AVERAGE )+\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].CQI0_RATE )+\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].RI_RATE )+\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].DL_PRB_RATE )+\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].MCS_AVERAGE )+\"</td>\" /*SS*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].MIMO_RATE )+\"</td>\" /*LG*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].DL_THROUGHPUT)+\"</td>\" /*LG*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].LICENSE_FAIL )+\"</td>\" /*LG*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].MIMO_RATE )+\"</td>\" /*NSN*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].MCS_AVERAGE )+\"</td>\" /*NSN*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].PUCCH_AVG )+\"</td>\" /*NSN*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].R2_PUCCH_AVG )+\"</td>\" /*NSN*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].PUSCH_AVG )+\"</td>\" /*NSN*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].R2_PUSCH_AVG )+\"</td>\" /*NSN*/\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].PDCP_DL_MB )+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].PRB_USG_RATE)+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].DRB_USG_RATE)+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].CON_TIME )+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].TRY_CCNT )+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].CON_RATE )+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].CDC_RATE )+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].DL_FA_USG_RATE )+ \"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].VOICE_DL_MB ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].VOICE_DL_PRB ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].VOICE_TRY_CC ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].VOICE_TIME ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].IMAGE_DL_MB ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].IMAGE_DL_PRB ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].IMAGE_TRY_CC ) +\"</td>\"\n +\"<td style='text-align: right;font-size:11px;'>\"+formatNumber(statsArray[i].IMAGE_TIME ) +\"</td>\"\n// +\"<td style='text-align: right;font-size:11px;'>\"+ \"-\" +\"</td>\"\n// +\"<td style='text-align: right;font-size:11px;'>\"+ formatNumber(statsArray[i].CHNL_COUNT ) +\"</td>\"\n +\"</tr>\")\n .appendTo($rightTable);\n }\n\n callback(result);\n\n },\"json\");\n\n}", "title": "" }, { "docid": "44bfa3c731c2a839f8a1bad5e7e5de78", "score": "0.5537908", "text": "function tableInit(my_data) {\n // Find the table\n // Use D3 to select the table\n var table = d3.select(\"#ufo-table\");\n //Remove the las tbody to avoid unwanted data\n var my_tbody = table.select('tbody');\n my_tbody.remove();\n //Create e new tbody entity to append the data\n var tbody = table.append(\"tbody\");\n // Build the table\n my_data.forEach((sighting) => {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "f8a2a43f07d6c53e8b4e59a2a9e703d2", "score": "0.55320704", "text": "make(data, tableName) {\n\t\tlet results = data.results,\n\t\t\tfields = data.fields,\n\t\t\tpks = data.primaryKeys;\n\t\tlog('Fields: ', fields);\n\t\tlet table = $('<table />', {class: 'table table-striped'});\n\t\tlet heading = $('<tr />');\n\t\tfields.forEach(col => {\n\t\t\theading.append(`<th>${col.name}</th>`);\n\t\t});\n\t\theading = $('<thead />').append(heading);\n\t\ttable.append(heading);\n\t\tlet tbody = $('<tbody />');\n\t\tresults.forEach(r => {\n\t\t\tvar row = $('<tr />');\n\t\t\tfields.forEach(fname => {\n\t\t\t\tvar col = $('<td />');\n\t\t\t\tvar input = $('<input />');\n\t\t\t\tinput.val(r[fname.name]);\n\t\t\t\tinput.data({\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tcondition: this.generateCondition(pks, r),\n\t\t\t\t\tfield: fname.name\n\t\t\t\t});\n\t\t\t\tlog(input.data());\n\t\t\t\tthis.bindUpdateEvent(input);\n\t\t\t\tcol.append(input);\n\t\t\t\trow.append(col);\n\t\t\t});\n\t\t\ttbody.append(row);\n\t\t});\n\t\ttable.append(tbody);\n\t\treturn table;\n\t}", "title": "" }, { "docid": "23bb618d59e587284e2bdea82c2f9747", "score": "0.5525586", "text": "function createMany(){\n for(var i = 0; i < 50; i++){\n array_brand.push(\"MARQUE_\"+i);\n array_year.push(\"ANNEE\"+i);\n array_model.push(\"MODEL\"+i);\n array_fuel.push(\"CARBURANT\"+i);\n array_price.push(0000);\n }\n\n $('#create_car').hide();\n $('#show_cars').show();\n\n tabIncrement()\n $('.mydatatable').DataTable();\n}", "title": "" }, { "docid": "ca0fe9b289d493dab9577c08eea91b99", "score": "0.55239177", "text": "function changeDepSelect() {\n displayHouseBtn();\n displayDepDrp();\n removedtRows(); //Remove Exisiting DataTable Rows\n depEmpDt(); //Display House Wise Employees DataTable\n populateDepInfo();\n}", "title": "" }, { "docid": "3a863553d5819be146628da0439a6cbd", "score": "0.5523583", "text": "function renderTableData (data) {\n // JAX-RS serializes an empty list as null, and a 'collection of one' as an object (not an 'array of one')\n var list = data == null ? [] : (data.orders instanceof Array ? data.orders : [data.orders]);\n var table = $ ('#orderTbl').DataTable ();\n // var shippingTable = $('#shippingTbl').DataTable();\n var deliveredTable = $ ('#deliveredTbl').DataTable ();\n var orderDetailsTable = $ ('#orderDetailsTbl').DataTable ();\n\n table.clear ().draw ();\n deliveredTable.clear ().draw ();\n var extraButton = \"<span style='display:inline-flex !important;'><a href='' class='order-edit glyphicon glyphicon-pencil'></a> <a href='' class='order-delete glyphicon glyphicon-trash'></a> <a href='Javascript:void(0);' id='printOrder' class='glyphicon glyphicon-print'></a> </span>\";\n // var weight = order.weight;\n $.each (list, function (index, order) {\n var weight = order.weight;\n var amount = order.total;\n /* this will validate if value is not:\n null\n undefined\n NaN\n empty string (\"\")\n false\n 0\n */\n if (!weight)\n weight = 0;\n if (!amount)\n amount = 0;\n // divide data to 2 parts: ordered/delivered (0/1)\n if (order.status == 0)\n table.row.add ([order.id, order.date, order.s_name, order.s_phone, order.s_address, order.r_name, order.r_phone, order.r_address, weight, amount]).draw ();\n else if (order.status == 1)\n deliveredTable.row.add ([order.id, order.date, order.s_name, order.s_phone, order.s_address, order.r_name, order.r_phone, order.r_address, weight, amount]).draw ();\n //reserve first column for checkbox with order id as well\n console.log (\"fill data for order details table of shipping\");\n orderDetailsTable.row.add ([order.id, order.id, order.date, order.s_name, order.r_name, weight, amount]).draw ();\n });\n}", "title": "" }, { "docid": "5e8372e30aaeeaa288a44cbe46939998", "score": "0.5523421", "text": "function userClicked() {\n // selects elements\n let inputValue = d3.select(\"#datetime\").property(\"value\")\n let filtered = tableData\n // checks input and filters\n if (inputValue) {\n filtered = filtered.filter(newRow => newRow.datetime === inputValue)\n };\n // filtered table data\n ufoTable(filtered)\n}", "title": "" }, { "docid": "e7ec2a9431942b454213caf60942de9c", "score": "0.5522665", "text": "function populateDropDown() { \r\n \r\n // select the panel to put data\r\n var dropdown = d3.select('#selDataset');\r\n jsonData.names.forEach((name) => {\r\n dropdown.append('option').text(name).property('value', name);\r\n });\r\n \r\n // set 940 as place holder ID\r\n populatedemographics(jsonData.names[0]);\r\n visuals(jsonData.names[0]);\r\n }", "title": "" }, { "docid": "fdd3eacec87bf9b53e890e8c4977921e", "score": "0.5519619", "text": "function handleClick() {\n // Create variable to hold date data (.select() selects first element that matches the string '#datetime', and .property('value') grabs and stores that data in the the date variable)\n let date = d3.select(\"#datetime\").property(\"value\");\n // Set default filter and save it to original table data so user can refine search from complete table\n let filteredData = tableData;\n // Apply a filter on the date variable based on a date value\n if (date) {\n filteredData = filteredData.filter(row => row.datetime === date);\n }\n // Rebuild the table using filtered data. If no date was entered then filteredData will just be the original tableData\n buildTable(filteredData);\n}", "title": "" }, { "docid": "7569ef23f9ba5f2c73862c2f894e2cd8", "score": "0.5519443", "text": "function buildNewsTableSelectors() {\n // 1. set up the news source selector\n var newsselector = d3.select(\"#news_source\");\n newsselector.html(\"\");\n\n // add a default initial option to choose a news source\n newsselector.append(\"option\")\n .attr(\"hidden\", true)\n .attr(\"selected\", true)\n .attr(\"value\",\"\")\n .text(\" ---- Choose a News Source ---\")\n\n newsSrcPromise.then(function(newsSrcs) {\n console.log(\"buildNewsTableSelectors newsSrcs\", newsSrcs);\n newsSources = newsSrcs.sources;\n\n newssrc_ids.forEach(newsSourceId => {\n var sourceName = \"\";\n result = newsSources.find(source => source.id === newsSourceId);\n if (result) { sourceName = result.name }\n else { sourceName = newsSourceID };\n\n newsselector.append(\"option\")\n .attr(\"value\", newsSourceId)\n .text(sourceName);\n\n });\n\n // set no option selected\n // newsselector.selectedIndex = -1;\n }); \n\n // 2. set up the date selector with date options\n var dateselector = d3.select(\"#corona-date\")\n dateselector.html(\"\");\n \n // add a default initial option to choose a date\n dateselector.append(\"option\")\n .attr(\"hidden\", true)\n .attr(\"selected\", true)\n .attr(\"value\",\"\")\n .text(\" ---- Choose a Date ---\")\n\n dates.forEach(dateStr => {\n dateselector.append(\"option\")\n .attr(\"value\", dateStr)\n .text(dateStr);\n }); \n\n // set no option selected\n // dateselector.selectedIndex = -1;\n}", "title": "" }, { "docid": "98da9423f046284153ec22c387e2194e", "score": "0.55189335", "text": "function request(res) {\n\n \n\n var indexTrainNumber = 0;\n var stationData = res[\"Stations\"];\n var trainData = res[\"trains\"];\n if (trainData == \"1\") {\n alert(\"אין רכבות ליעד המבוקש\");\n }\n else {\n\n allData = res;\n\n var userTime = new Date(new Date().toDateString() + ' ' + $(\"#myTime\").val());\n var userHours = userTime.getHours();\n\n var trainLastIndex = -1;\n var counter = 0;\n var dynamicTable = \"<table id='dynamicTable' class='tsc_table_s9' style='width:100%'>\";\n dynamicTable += \"<thead><tr> <th>דווח</th> <th>פרטים</th> <th>הגעה מעודכן</th><th>יציאה מעודכן</th><th>יציאה מתוכנן</th></tr></thead>\";\n\n for (var j = 0; j < trainData.length; j++) {\n\n trainTime = parseInt(trainData[j].DepartureTime.slice(11, 13));\n\n\n\n if (trainTime >= userHours && (userHours + 2) >= trainTime || (trainLastIndex == trainData[j].IndexTrain && trainData[j].Direct == \"InDirect\")) {\n\n if (trainData[j].OrignStation == $(\"#searchTBDeparture\").val() || counter != 0) {\n\n counter = counter + 1;\n var originStation = trainData[j].OrignStation;\n var destinationStation = trainData[j].DestinationStation;\n stopStations = trainData[j].stops;\n var arrivalTime;\n var departureTime = showTimeFormat(trainData[j].DepartureTime);\n\n if (trainLastIndex != trainData[j].IndexTrain || trainData[j].Direct == \"Direct\") {\n\n if (trainData[j].Direct == \"Direct\") {\n functionName = \"showinfoTrainDirect(\";\n }\n else {\n functionName = \"showinfoTrainInDirect(\";\n }\n\n numOftrainToLine = parseInt(trainData[j].NumOfChanges);\n arrivalTime = showTimeFormat(trainData[j + numOftrainToLine].ArrivalTime);\n\n indexTrainNumber = indexTrainNumber + 1;\n if (indexTrainNumber % 2 == 0) {\n dynamicTable += \"<tbody><tr> <td><a data-role='button' class='button mobilebutton4 ui-btn ui-shadow ui-btn-corner-all ui-mini ui-btn-inline ui-btn-icon-left ui-btn-up-a' data-corners='true' data-inline='true' data-mini='true' data-shadow='true' style='font-family: Gisha; width:70%; font-size:12px; color: #003366; text-align: center' id='mmm\" + j + \"'\" + \"onclick='myfunc()'>עליתי לרכבת<a/></td> <td><a data-role='button' id='btn\" + j + \"'onclick='\" + functionName + j + \")'\" + \"><img class='mobileImage mobileimage1' src='files/views/assets/image/infoIcon.png'/></a></td> <td>\" + arrivalTime + \"</td><td>on time</td><td>\" + departureTime + \"</td></tr></tbody>\";\n }\n else {\n dynamicTable += \"<tbody><tr class='odd'> <td><a data-role='button'class='button mobilebutton4 ui-btn ui-shadow ui-btn-corner-all ui-mini ui-btn-inline ui-btn-icon-left ui-btn-up-a' data-corners='true' data-inline='true' data-mini='true' data-shadow='true' style='font-family: Gisha; width:70%; font-size:12px; color: #003366; text-align: center' id='mmm\" + j + \"'\" + \"onclick='myfunc()'>עליתי לרכבת<a/></td> <td><a data-role='button' id='btn\" + j + \"'onclick='\" + functionName + j + \")'\" + \"><img class='mobileImage mobileimage1' src='files/views/assets/image/infoIcon.png'/></a></td> <td>\" + arrivalTime + \"</td><td>on time</td><td>\" + departureTime + \"</td></tr></tbody>\";\n }\n\n\n }\n trainLastIndex = trainData[j].IndexTrain;\n }\n }\n }\n\n dynamicTable += \"<thead><tr><th></th><th></th><th></th><th></th><th></th></tr></thead></table>\";\n document.getElementById(\"showResult\").innerHTML = dynamicTable;\n }\n\n}", "title": "" }, { "docid": "467befe3a3e8807cca8b30599847b6ad", "score": "0.5517374", "text": "function optionChanged(passdata)\n{\n table(passdata);\n charts(passdata);\n}", "title": "" }, { "docid": "6f73f7bef2971936c69577978897b090", "score": "0.55165374", "text": "function buildHtmlTable(myList, selector) {\n\n $(selector).empty(); //just to be sure\n\n var columns = addAllColumnHeaders(myList, selector);\n\n var tBody$ = $('<tbody/>');\n\n for (var i = 0; i < myList.length; i++) {\n var row$ = $('<tr/>');\n for (var colIndex = 0; colIndex < columns.length; colIndex++) {\n var cellValue = myList[i][columns[colIndex]];\n if (cellValue == null) cellValue = \"\";\n row$.append($('<td/>').html(cellValue));\n }\n $(tBody$).append(row$);\n }\n $(selector).append(tBody$);\n\n\n //$(selector).DataTable({\n // \"paging\": false,\n // \"ordering\": false,\n // \"info\": false,\n // \"bFilter\": false\n //});\n\n\n //$(selector).dataTable({ bFilter: false, bInfo: false, bPaginate: false });\n\n //$(selector).dataTable({ sDom: '<\"H\"lfr>t<\"F\"ip>' });\n\n\n\n //$(selector).dataTable({ sDom: 't' });\n\n $(selector).dataTable({ sDom: '<\"H\">t<\"F\">', bDestroy: true, bPaginate: false });\n\n\n\n\n \n\n \n}", "title": "" }, { "docid": "f27482380257a5efcb836d89da4051a3", "score": "0.5516058", "text": "function runEnter() {\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Remove all previous table data\n d3.selectAll(\"td\").remove(); \n // Select the input element\n var inputElement = d3.select(\"#datetime\");\n // Get the value of the input element\n var inputValue = inputElement.property(\"value\")\n\n // Select the filtered data equal to the input element\n var filteredData = tableData.filter(data => data.datetime === inputValue);\n\n // Create a table and enter the values of the filtered data\n filteredData.forEach((ufoReport) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufoReport)\n .forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "02085b34479e9f3dbfa11363ae0bd16e", "score": "0.550805", "text": "function buildTable(){\n //var table = d3.select(\"#summary-table\");\n var tbody = d3.select(\"tbody\");\n var trow;\n \n for (var i = 0; i < data.length; i++){\n trow = tbody.append(\"tr\")\n trow.append(\"td\").text(data[i].datetime);\n trow.append(\"td\").text(data[i].city.charAt(0).toUpperCase() + data[i].city.slice(1));\n trow.append(\"td\").text(data[i].state.toUpperCase());\n trow.append(\"td\").text(data[i].country.toUpperCase());\n trow.append(\"td\").text(data[i].shape.charAt(0).toUpperCase() + data[i].shape.slice(1));\n trow.append(\"td\").text(data[i].durationMinutes);\n trow.append(\"td\").text(data[i].comments);\n };\n\n\n}", "title": "" }, { "docid": "82d4c4cd0419f10d926a3573b9e87d8e", "score": "0.5507425", "text": "function setDataTbl(){\n var currentIndex = 1;\n var tablegroup = \"datagrpRestriction\";\n setTable(currentIndex, tablegroup, this.grid.getPrimaryKeysForRow(this));\t\n}", "title": "" }, { "docid": "91fb74a3710ec8257c816bf074bf10ed", "score": "0.55031276", "text": "function buttonClick(){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Create & display new table with filtered/searched data\n var filtered_table = tableData.filter(ufo_sighting => \n (ufo_sighting.datetime===dateInputText.property(\"value\") || dateInputText.property(\"value\")=== \"\")\n && (ufo_sighting.city===cityInputText.property(\"value\") || cityInputText.property(\"value\")=== \"\")\n && (ufo_sighting.state===stateInputText.property(\"value\") || stateInputText.property(\"value\")=== \"\")\n && (ufo_sighting.country===countryInputText.property(\"value\") || countryInputText.property(\"value\")=== \"\")\n && (ufo_sighting.shape===shapeInputText.property(\"value\") || shapeInputText.property(\"value\")=== \"\"))\n displayData(filtered_table);\n}", "title": "" }, { "docid": "52d0d9ec5e20447bb5d1578ccdaf2210", "score": "0.5499347", "text": "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element using the id as reference\n var inputElement = d3.select(\"#datetime\");\n\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n // Check if the input field is blank, if blank then run default_table function\n if (inputValue.length == 0){\n\n // Remove existing records in tbody\n tbody.html(\"\");\n\n // run the default_table function\n return default_table();\n }\n \n // if input field is not blank then filter the output\n else {\n\n var filteredData = tableData.filter(results => results.datetime === inputValue);\n\n // Remove existing records in tbody\n tbody.html(\"\");\n\n // Loop through 'filteredData' and use d3 to add data to webpage\n filteredData.forEach((sightings) => {\n var record = tbody.append(\"tr\");\n Object.entries(sightings).forEach(([key, value]) => {\n var data_value = record.append(\"td\");\n data_value.text(value);\n });\n });\n \n };\n\n\n}", "title": "" }, { "docid": "256220e3e8020cfd424731fce9e2989a", "score": "0.5497267", "text": "function simDataSwitch() {\n document.getElementById(\"cbUpdateDataProvider\").disabled = false;\n document.getElementById(\"cbFilterRows\").disabled = false;\n document.getElementById(\"cbSortRows\").disabled = false;\n document.getElementById(\"btnFetch\").disabled = false;\n document.getElementById(\"btnFetch\").innerHTML = \"Start Fetching data\";\n idx = 0;\n grid.setDataProvider(generateData(500));\n}", "title": "" }, { "docid": "87530e575f77ac0c2b689623c7ddaeae", "score": "0.5495025", "text": "createData(col,d){\n var i,j = 0;\n // eslint-disable-next-line no-unused-vars\n var fieldName;\n //var final = [];\n var item;\n console.log(\"col array: \" + JSON.stringify(col));\n console.log(\"data array: \" + JSON.stringify(d));\n\n //first must check size is the same\n //col = 3 cols\n //data = 10 items\n //1 : {key: '1', \n // items:{\n // {isText: true, isPicklist: false, value: 'TEXT'}\n // {isText: false, isPicklist: true, value: 'Preselected', picklist: pickListOptions}\n // }\n // }\n //f1 = 1\n //f2 = 2\n //f3 = 3\n for(i=0;i<d.length;i++){ //10\n for(j=0; j <col.length;j++){ //3\n fieldName = col[j].fieldName;\n if(j === 0){\n this.final.push({'rowKey': i, items: []});\n }\n if(col[j].type === 'text'){\n item = {'colKey': j, 'type': col[j].type, 'value': d[i][fieldName], isText:true,isPicklist:false,isPhone:false,isEmail:false};\n }\n else if (col[j].type === 'picklist'){\n item = {'colKey': j, 'type': col[j].type, 'value': d[i][fieldName], isText:false,isPicklist:true,isPhone:false,isEmail:false, picklist:d[i][fieldName]};\n }\n else if (col[j].type === 'email'){\n item = {'colKey': j, 'type': col[j].type, 'value': d[i][fieldName], isText:false,isPicklist:false,isPhone:false,isEmail:true};\n }\n else if (col[j].type === 'phone'){\n item = {'colKey': j, 'type': col[j].type, 'value': d[i][fieldName], isText:false,isPicklist:false,isPhone:true,isEmail:false};\n }\n\n this.final[i].items.push(item);\n \n console.log(\"This Final: \" + JSON.stringify(this.final));\n }\n }\n }", "title": "" }, { "docid": "7e5d7bf76d21cefc8cb8e87bef034cf4", "score": "0.54915416", "text": "function initTableData() {\n //get all data to local variable\n getData();\n\n if (!localDb.length) return;\n\n const fragment = document.createDocumentFragment();\n\n localDb.forEach((item) => {\n const row = createTableRow(item);\n fragment.appendChild(row);\n });\n\n tBody.appendChild(fragment);\n }", "title": "" }, { "docid": "108d7570221c0291e4d25f0433ad3985", "score": "0.54907733", "text": "function generateTable(data, prefetchStatus) {\n \n let noData = 'noData'\n let tableHead = [];\n for(var k in data[0]) {\n //Create tablehead and shorten names (better to do in SQL query though)\n var l = null;\n if(k.includes('order_')) {\n l = k.replace(\"order_\", \"\");\n tableHead.push(<th>{l}</th>);\n }else if (k.includes('extra_information')) {\n l = k.replace(\"extra_information\", \"info\");\n tableHead.push(<th>{l}</th>);\n } else if (k.includes('_date')) {\n l = k.replace(\"_date\", \"\");\n tableHead.push(<th>{l}</th>);\n } else {\n tableHead.push(<th>{k}</th>);\n }\n }\n let tableBody = [];\n \n\n //prefetching the selection options.\n var statusArray = [];\n console.log(\"prefetchStatus: \",prefetchStatus);\n\n if(prefetchStatus.length > 0) {\n statusArray = generateSelections(prefetchStatus);\n setStatusArr(statusArray);\n } \n \n\n\n if(data.length < 1 || data.statusCode === 404) {\n // in case there's an issue with the db/node-server connection, \n // or just a lack of data.\n if(data.statusCode === 404) {\n noData = 'An error occured while fetching order data.';\n setUpdateInfo(noData);\n }\n else {\n noData = 'No data - customer has no order data available.';\n setUpdateInfo(noData);\n }\n noData = null;\n setOutput('');\n return <div className='orderOverviewTableNoDataDiv'><b>{noData}</b></div>\n } else {\n data.map((item,index) => {\n //console.log(`${index}. Order: ${item.order_price}`);\n \n //modifications:\n /*\n only description and extra_information ought to be modified, otherwise an order needs to be made!\n */\n let delButton = <td><button disabled={true} onClick={()=>modifyOrder(item.order_id)}>modify</button></td>\n let modButton = <td><button disabled={false} onClick={()=>deleteOrder(item.order_id)}>delete</button></td>\n \n //change dateformats. \n let ordered_date = datetimeToString(item.order_ordered_date);\n let ready_date = datetimeToString(item.order_ready_date);\n let started_date = datetimeToString(item.order_started_date);\n let accrej_date = datetimeToString(item.order_accrej_date);\n if(modifyableRows === item.order_id) {\n if(userInformationFromContext.userType === 'customer') {\n tableBody.push(\n <tr key={index}>\n <td>{item.order_id}</td>\n <td>{item.title}</td>\n <td><input type='text' className='OrderOverviewEditableUserInput' id={`input_description${item.order_id}`} defaultValue={item.description}></input></td>\n <td>{ordered_date}</td>\n <td>{started_date}</td>\n <td>{ready_date}</td>\n <td>{accrej_date}</td>\n <td>{item.workitemId}</td>\n <td>{item.status}</td>\n <td><input type='text' className='OrderOverviewEditableUserInput' id={`input_information${item.order_id}`} defaultValue={item.extra_information}></input></td>\n <td>{item.order_price}€</td>\n <td><button disabled={false} onClick={()=>modifyRequest(index,item.order_id)}>save</button></td>\n <td><button disabled={false} onClick={()=>modifyOrder(item)}>cancel</button></td>\n </tr>\n );\n } else {\n tableBody.push(\n <tr key={index}>\n <td>{item.order_id}</td>\n <td>{item.customerId}</td>\n <td>{item.lastname}</td>\n <td>{item.firstname}</td>\n <td><input type='text' className='OrderOverviewEditableUserInput' id={`input_title${item.order_id}`} defaultValue={item.title}></input></td>\n <td><input type='text' className='OrderOverviewEditableUserInput' id={`input_description${item.order_id}`} defaultValue={item.description}></input></td>\n <td>{ordered_date}</td>\n <td>{started_date}</td>\n <td>{ready_date}</td>\n <td>{accrej_date}</td>\n <td>{item.workitemId}</td>\n <td>{item.status}</td>\n <td><textarea cols=\"50\" rows=\"1\" type='text' className='OrderOverviewEditableUserInput' id={`input_extra_information${item.order_id}`} defaultValue={item.extra_information}></textarea></td>\n <td><input type='text' className='OrderOverviewEditableUserInput' id={`input_price${item.order_id}`} defaultValue={item.order_price}></input></td>\n <td><button disabled={false} onClick={()=>modifyRequest(index,item.order_id)}>save</button></td>\n <td><button disabled={false} onClick={()=>modifyOrder(item)}>cancel</button></td>\n </tr>\n );\n }\n } else {\n if(userInformationFromContext.userType === 'customer') {\n if(item.status === 'ORDERED') {\n tableBody.push(\n <tr key={index}><td>{item.order_id}</td><td>{item.title}</td><td>{item.description}</td><td>{ordered_date}</td><td>{started_date}</td>\n <td>{ready_date}</td><td>{accrej_date}</td><td>{item.workitemId}</td><td>{item.status}</td><td>{item.extra_information}</td><td>{item.order_price}€</td>\n <td><button disabled={false} onClick={()=>modifyOrder(item.order_id)}>modify</button></td>\n <td><button disabled={false} onClick={()=>deleteOrder(item)}>delete</button></td>\n </tr>\n );\n } else if(item.status === 'READY') {\n tableBody.push(\n <tr key={index}><td>{item.order_id}</td><td>{item.title}</td><td>{item.description}</td><td>{ordered_date}</td><td>{started_date}</td>\n <td>{ready_date}</td><td>{accrej_date}</td><td>{item.workitemId}</td><td>{item.status}</td><td>{item.extra_information}</td><td>{item.order_price}€</td>\n <td><button disabled={false} onClick={()=>acceptOrder(item.order_id)}>accept</button></td>\n <td><button disabled={false} onClick={()=>rejectOrder(item.order_id)}>reject</button></td>\n </tr>\n );\n } \n else \n {\n tableBody.push(\n <tr key={index}><td>{item.order_id}</td><td>{item.title}</td><td>{item.description}</td><td>{ordered_date}</td><td>{started_date}</td>\n <td>{ready_date}</td><td>{accrej_date}</td><td>{item.workitemId}</td><td>{item.status}</td><td>{item.extra_information}</td><td>{item.order_price}€</td>\n <td><button disabled={true} onClick={()=>modifyOrder(item.order_id)}>modify</button></td>\n <td><button disabled={true} onClick={()=>deleteOrder(item)}>delete</button></td>\n </tr>\n );\n }\n } else {\n let finishButton, startButton; \n \n \n if(item.status === 'ORDERED') {\n startButton = <td><button disabled={false} onClick={()=>startOrder(item)}>start</button></td>\n finishButton = <td><button disabled={true} onClick={()=>finishOrder(item)}>finish</button></td>\n } else if (item.status === 'STARTED') {\n startButton = <td><button disabled={true} onClick={()=>startOrder(item)}>start</button></td>\n finishButton = <td><button disabled={false} onClick={()=>finishOrder(item)}>finish</button></td>\n } else {\n startButton = <td><button disabled={true} onClick={()=>startOrder(item)}>start</button></td>\n finishButton = <td><button disabled={true} onClick={()=>finishOrder(item)}>finish</button></td>\n }\n tableBody.push(\n <tr key={index}>\n <td>{item.order_id}</td>\n <td>{item.customerId}</td>\n <td>{item.lastname}</td>\n <td>{item.firstname}</td>\n <td>{item.title}</td>\n <td>{item.description}</td>\n <td>{ordered_date}</td>\n <td>{started_date}</td>\n <td>{ready_date}</td>\n <td>{accrej_date}</td>\n <td>{item.workitemId}</td>\n <td>{item.status}</td>\n <td>{item.extra_information}</td>\n <td>{item.order_price}€</td>\n <select id={`changeStatusOption${item.order_id}`}>\n {statusArray}\n </select>\n <td><button disabled={false} onClick={()=>changeStatus(item)}>status</button></td>\n {startButton}\n {finishButton}\n <td><button disabled={false} onClick={()=>modifyOrder(item.order_id)}>modify</button></td>\n <td><button disabled={false} onClick={()=>deleteOrder(item)}>delete</button></td>\n </tr>\n );\n\n }\n }\n \n \n });\n if(data.length === 0) {\n return <div className='orderOverviewTableNoDataDiv'><b>{noData}</b></div>\n } else {\n return(\n <div className='orderOverviewTableDiv'>\n <h3> Your orders: </h3>\n \n <table className='orderOverViewTable'>\n <thead key='orderOverviewTableTHead'>\n <tr key='orderOverviewTableHead'>{tableHead}</tr>\n </thead>\n <tbody key='orderOverviewTableTBody'>\n {tableBody}\n </tbody>\n </table>\n </div>\n )\n }\n }\n }", "title": "" }, { "docid": "1e8c4193b367cdd81828306d929bed2e", "score": "0.54901874", "text": "function buildFilters() {\r\n\tconsole.log('buildFilters');\r\n\t\r\n\t// Remove existing filters\r\n\tvar cells = $('#sjo-api-row-filter td').empty();\r\n\t\r\n\t// Don't build filters on short data set\r\n\t// TODO: parameterise this\r\n\tif (data.length >= 10) {\r\n\t\t\r\n\t\t// Loop through filterable fields\r\n\t\tvar values;\r\n\t\t$.each(tableColumns, (colIndex, column) => {\r\n\t\t\tvar field = dataFields[column.name];\r\n\t\t\t\r\n\t\t\tif (column.has) {\r\n\t\t\t\t\r\n\t\t\t\t// Add checkbox to table header\r\n\t\t\t\t// TODO: add checkboxes to other sparse data (DOB, link fields, image, gender, elected)\r\n\t\t\t\t$(`<input type=\"checkbox\" class=\"sjo-api-filter-checkbox\" id=\"sjo-api-filter-__has_${column.name}\">`)\r\n\t\t\t\t\t.addClass(field.group ? 'sjo-api-filter-group-' + field.group : '')\r\n\t\t\t\t\t.prop('indeterminate', true).data('sjo-api-checked', 1).click(cycleCheckbox).appendTo(cells[colIndex]);\r\n\t\t\t\t\r\n\t\t\t} else if (field.filter) {\r\n\t\t\t\t\r\n\t\t\t\t// Build list of filter options\r\n\t\t\t\tvalues = [];\r\n\t\t\t\t$.each(data, (index, record) => {\r\n\t\t\t\t\tvar set = column.set >= 0 ? column.set : record[0] ? 0 : 1;\r\n\t\t\t\t\tif (!record[set]) return;\r\n\t\t\t\t\tif (values.indexOf(record[set][column.name]) < 0) {\r\n\t\t\t\t\t\tvalues.push(record[set][column.name]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Add wildcard options\r\n\t\t\t\t\t\tif (column.name == '_election_area' && currentExtract.urls[0] == allCandidatesUrl && record[set]._election_type != record[set]._election_area) {\r\n\t\t\t\t\t\t\tvar wildcardOption = record[set]._election_type + '.*';\r\n\t\t\t\t\t\t\tif (values.indexOf(wildcardOption) < 0) {\r\n\t\t\t\t\t\t\t\tvalues.push(wildcardOption);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t// Don't show filter for only one value\r\n\t\t\t\tconsole.log('buildFilters', column, field, values);\r\n\t\t\t\tif (values.length <= 1) return;\r\n\t\t\t\t\r\n\t\t\t\t// Add dropdown to table header\r\n\t\t\t\tvar dropdownId = 'sjo-api-filter-' + column.name + (column.set >= 0 ? '__' + column.set : '');\r\n\t\t\t\tvar dropdown = $(`<select multiple class=\"sjo-api-filter\" id=\"${dropdownId}\"></select>`)\r\n\t\t\t\t\t.data('sjo-api-set', column.set)\r\n\t\t\t\t\t.html(values.sort().map(value => `<option>${escapeHtml(value)}</option>`).join(''))\r\n\t\t\t\t\t.appendTo(cells[colIndex]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\t\r\n\t}\r\n\t\r\n\t// Apply the new filters\r\n\tapplyFilters(formatFilters);\r\n\t\r\n\tfunction formatFilters() {\r\n\t\t$('select.sjo-api-filter').chosen({\r\n\t\t\t'placeholder_text_multiple': ' ',\r\n\t\t\t'search_contains': true,\r\n\t\t\t'inherit_select_classes': true,\r\n\t\t\t//'width': field['filter-width'],\r\n\t\t\t'width': '100%',\r\n\t\t});\r\n\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "b752fd30bcc8ff3819d9f4221404fef9", "score": "0.54889727", "text": "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredDataSet.length; i++) {\n\n // Get the current object and its fields\n var data = filteredDataSet[i];\n var fields = Object.keys(data);\n\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\n // For every field in the table object, create a new cell at set its inner text to be the current value at the current field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = data[field];\n }\n }\n}", "title": "" }, { "docid": "d3bc01c32123ee1dc75f9ff6048214c8", "score": "0.5487955", "text": "function TableLogistics(sth, data,cliConsultar) {\n $(\".overflow\").scrollLeft(0);\n $(\".scroll_header\").scrollLeft(0);\n\n var tbody_hide = $(sth).next()[0].querySelector(\".hide\");\n var this_overflow = d3.select($(sth).next()[0]);\n var span = d3.select($(sth).find(\"span.s\")[0]);\n\n if (this_overflow.style(\"display\") == \"block\") {\n this_overflow.style(\"display\", \"none\");\n d3.select(tbody_hide).html(\"\");\n span.html(plus + \"&ensp;\");\n } else {\n //// <--- !\n var algo = sth;\n\n function nuevaTabla(algo, callback) {\n\n var parentTag = algo.parentNode.getAttribute(\"tag\");\n var Tag = algo.getAttribute(\"tag\");\n\n var tableData = data.filter(function(d) {\n return d[0] == parentTag;\n })[0].filter(function(d) {\n return typeof(d) == \"object\" && d[Tag];\n })\n\n if (tableData[0]) {\n tableData = tableData[0][Tag];\n tableData = formatoData(tableData);\n var parser = new DOMParser();\n var docTable = parser\n\t\t\t\t\t.parseFromString(tableData,\n\t\t\t\t\t\t\t\t\"text/html\");\n docTable = docTable.querySelector(\"table\");\n\n $(docTable).css(\"table-layout\", \"fixed\");\n\n\n d3.selectAll(\"div>label>span.s\")\n\t\t\t\t\t.html(plus + \"&ensp;\");\n span.html(minus + \"&ensp;\");\n d3.selectAll(\"div.overflow\").style(\"display\", \"none\");\n d3.selectAll(\"div.overflow>table>tbody\").html(\"\")\n\n docTable = discriminateRows(docTable);\n\n\n\t\t\tif(caso_especial) {\n\t\t\t// Estas líneas son importantes para que funcione 'nameGasNoil(_td_)'!\n\t\t\t $(docTable).find(\"tr\").each(function(i,d) {\n\t\t\t if(!$(d).find('td:first-child').attr(\"id\")) $(d).attr(\"id\",\"dist\")\n\t\t\t })\n\t\t\t// Estas líneas son importantes para que funcione 'nameGasNoil(_td_)'!\n\t\t\t}\n\n d3.select(tbody_hide.parentNode.parentNode)\n .style(\"display\", \"block\");\n\n\t\t\tvar contenidoEnFiltro = $('#filtroSerie').val();\n\n //--------------FILTRO PARA CASO ESPECIAL-----------------------\n if (caso_especial && contenidoEnFiltro) { //current_TXT ) {\n\n var _docTable = parser\n .parseFromString(docTable.outerHTML,\n\t\t\t\t\t\t\t\t\"text/html\")\n .body.querySelector(\"table\");\n\n/*\n var tds = Array.prototype\n .slice.call(_docTable\n\t\t\t\t.querySelectorAll(\"tr>td:first-child\"));\n\n\n var val,valName;\n\n var prevTD = tds.filter(function(d) {\n return d.textContent.replace(/\\s/g, \"\")\n .toUpperCase() == current_TXT[2]\n\t\t\t\t\t\t\t.replace(/\\s/g, \"\")\n\t\t .toUpperCase();\n })[0];\n\n\n var c = tds.indexOf(prevTD) + 0;\n var tdFromList;\n var referenceTd = current_TXT[3]\n\t\t\t\t\t\t.replace(/\\s/g, \"\")\n\t\t\t\t\t\t.toUpperCase();\n var condTD;\n\n for (c; c < tds.length; c++) {\n tdFromList = tds[c].textContent\n\t\t\t\t .replace(/\\s/g, \"\").toUpperCase();\n condTD = tdFromList == referenceTd;\n\n if (condTD) {\n break;\n }\n };\n*/\n//\t\t\t var textoEnFiltro_ = $('#filtroSerie').val().replace(/^\\s*/,'').split(\" > \")\n//\t\t\t var _td_ = selected_TD(textoEnFiltro_/*current_TXT*/,docTable);\n/*\n\t\t\t var headRow = docTable.querySelector(\"tr\").outerHTML;\n\n\t\t\t val = $(_td_).parent()[0].children;\n\t\t\t val = Array.prototype.slice.call(val);\n\t\t\t val = \"<tr>\" + val.map(function(d) { return d.outerHTML; }).join(\"\") + \"</tr>\";\n\t\t\t val = $(val);\n\n\t\t\t val = $(nameGasNoil(_td_));\n\n $(_docTable.querySelectorAll(\"tbody\")).html(\"\");\n\n $(_docTable.querySelectorAll(\"tbody\"))\n\t\t\t\t.append(val);\n*/\n d3.select(tbody_hide)\n .html(/*_*/docTable.innerHTML);//<--pega la tabla\n\n\n current_TXT = null; // <-- Checar relevancia.\n }\n//--------------FILTRO PARA CASO ESPECIAL-----------------------\n else {\n d3.select(tbody_hide)\n .html(docTable.innerHTML);//<--pega la tabla\n\n\t\t\t if(contenidoEnFiltro) {\n\t\t\t\tvar txtFiltro = contenidoEnFiltro.replace(/^\\s*/,'').split(' > ');\n\t\t\t\tvar filtroEl = selected_TD(txtFiltro)[0];\n\t\t\t\tvar specialType = filtroEl.parentNode.parentNode.querySelectorAll('td#dist_').length;\n\t\t\t\tif(specialType) {\n\t\t\t\t filterSpecialType(filtroEl.parentNode.parentNode,filtroEl);\n\t\t\t\t enableGraphs();\n\t\t\t\t} else {\n\t\t\t\t mostrar(filtroEl);\n\t\t\t\t}\n\t\t\t }\n\n }\n\n $(window).scrollTop(\n $(tbody_hide).offset().top - 250\n );\n\n icons();\n headerScroll();\n colcol();\n callback();\n\n $(\"td#n\").each(function() {\n let color = $(this.parentNode.children[0])\n .css(\"background-color\");\n });\n\n } else {\n\n var params = parametros();\n params[\"title\"] = params_especiales.title;\n params[\"subtitle\"] = params_especiales.subtitle;\n var algo_ = $(\"tbody.hide[tag='\" + params.title\n\t\t\t + \"']>div.labels[tag='\"\n\t\t\t + params.subtitle + \"']\")[0];\n\n $.ajax({\n url: HOSTNAME + \"/cubos_cuadros.py\",\n dataType: 'json',\n data: params,\n success: function(tabla_respuesta) {\n\n\t\t\t\tvar textoEnFiltro = $(\"#filtroSerie\").val();\n\t\t\t\tif(textoEnFiltro) { \n\t\t\t\t\ttabla_respuesta = filtroHandler(textoEnFiltro,formatoData(tabla_respuesta));\n\t\t\t\t} else {\n\t\t\t\t\ttabla_respuesta = formatoData(tabla_respuesta);\n\t\t\t\t}\n\n var sizeStr = JSON\n\t\t\t\t\t.stringify([tabla_respuesta])\n\t\t\t\t\t.length;\n\n if (sizeStr <= threshold) {\n// if(!textoEnFiltro) tabla_respuesta = formatoData(tabla_respuesta);\n TableLogistics(algo_, tabla_respuesta);\n } else {\n\t\t\t\t FILE_NAME = { 'title':params.title, 'subtitle':params.subtitle };\n\t\t\t\t mensajeExplicativo(params.title,params.subtitle,tabla_respuesta);\n }\n\n }\n });\n\n }\n\n\t\t $(\"div#divDefense\").remove();\n\t\t $(\"div#optionsDefense\").remove();\n };\n\n function mensajeEspera() {\n $(\"div#espere\").css(\"visibility\", \"visible\") // aquí\n window.setTimeout(function() {\n nuevaTabla(algo, function() {\n $(\"div#espere\").css(\"visibility\", \"hidden\");\n\n ///// FORZAR TAMAÑOS DE HEADER OCURRENTE CROSS-BROWSER ////////////////////////\n var cellHide = $(\"div.overflow>table>tbody.hide>tr:nth-child(2)>td:nth-child(4)\")\n var cellHead = $(\".scroll_aid_header>th:nth-child(n+2)\");\n\n var CellOffsetWidth = cellHide[0].offsetWidth;\n var jqueryWidth = \"75px\";\n\n\n cellHead.css(\"max-width\", jqueryWidth)\n cellHead.css(\"width\", jqueryWidth)\n cellHead.css(\"min-width\", jqueryWidth)\n\n\n d3.selectAll(\".scroll_aid_header>th:nth-child(n+2)\")\n .style(\"max-width\", jqueryWidth)\n .style(\"width\", jqueryWidth)\n .style(\"min-width\", jqueryWidth)\n\n var posHeader = document\n .querySelector(\".scroll_aid_header>th:nth-child(2)\")\n .getBoundingClientRect();\n\n var posHide = cellHide[0].getBoundingClientRect();\n\n $(\".scroll_aid_header>th:first-child\").css(\"padding\", \"0px\");\n $(\".scroll_aid_header>th:first-child\").css(\"min-width\", \"calc(360px + 55px)\");\n $(\"div.overflow tr>td\").css(\"border-bottom\", \"0px solid white\");\n $(\"div.overflow tr>td\").css(\"border-top\", \"1px solid lightGray\");\n\n if (posHeader.left != posHide.left) {\n\n d3.select(\".scroll_aid_header>th:first-child\")\n .style(\"min-width\", posHeader.left + \"px\");\n }\n\n\n///// FORZAR TAMAÑOS DE HEADER OCURRENTE CROSS-BROWSER ////////////////////////\n\n/*-----------------Quitar scroller horizontal si no se necesita--------------*/\n\n var tabla_overflow_X = $(\"div.overflow\")\n\t\t\t .filter(function() {\n return $(this).css(\"display\") == \"block\";\n });\n\n var row_length_ = tabla_overflow_X[0]\n .querySelector(\"tr:first-child\")\n .getBoundingClientRect().right;\n\n if (row_length_ < window.innerWidth) {\n tabla_overflow_X.css(\"overflow-x\", \"hidden\")\n } else {\n tabla_overflow_X.css(\"overflow-x\", \"scroll\")\n }\n/*-----------------Quitar scroller horizontal si no se necesita--------------*/\n PrincipalCheckBox();\n\n var checkIfDist_ = document\n\t\t\t\t.querySelectorAll(\"#dist_\").length;\n if (checkIfDist_ > 0) {\n d3.selectAll(\"tr#dist\").attr(\"id\", null);\n }\n\n //contratosPemexFIX(); // <-- Arregla \"coloreados no controlados\".\n enableGraphs();\n });\n }, 10);\n }\n mensajeEspera();\n };\n\n }", "title": "" }, { "docid": "2f6cf8aae2ef2e0f573868773e8b1515", "score": "0.54860854", "text": "function handleClick() {\n //grab the datetime value from the filter\n let date = d3.select(\"#datetime\").property('value');\n let filteredData = tableData;\n\n //Check to see fi a date was entered and filter the data using that date.\n if (date) {\n //apply 'filter' to the table data to only keep the rows\n //where the 'datetime' value matches the filter value\n filteredData = filteredData.filter(row => row.datetime === date);\n }\n\n //Rebuild the table using the filtered data\n //@NOTE: if no date was entered, then filteredData will\n //just be the original tableData\n buildTable(filteredData);\n}", "title": "" } ]
c62463d9df9847fcf755defe064fd9c1
Check if needle exists in haystack
[ { "docid": "c19ee6fa5d5d4f7c9810be6469dc4e03", "score": "0.6805929", "text": "function inArray(needle, haystack)\n{\n\tvar i;\n\tvar found = false;\n\tfor (i=0;i<haystack.length;i++){\n\t\tif (needle.search(haystack[i])>0){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" } ]
[ { "docid": "52d81dcb1f2a30d1ba8ea6cf201a1c6f", "score": "0.8053293", "text": "function contains(haystack, needle){ return haystack.indexOf(needle) >=0 }", "title": "" }, { "docid": "8b1efd9fdac78e4d8d190654e20b28ff", "score": "0.7589505", "text": "function contains(haystack, needle){\r\n\treturn (haystack.indexOf(needle) != -1);\r\n}", "title": "" }, { "docid": "55bf0b34ea00393a22dc6a35421d759c", "score": "0.74959886", "text": "function contains(haystack, needle) {\n return any(haystack, function (x) {\n return x === needle;\n });\n}", "title": "" }, { "docid": "af1b2f1a466293f332c7e8513d5337fa", "score": "0.74155563", "text": "function contains(haystack, needle) {\n var len = haystack.length,\n i = 0;\n for (; i < len; i++) {\n if (haystack[i] === needle) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "228681d2b82c69e0f113a06c09d5b192", "score": "0.7369291", "text": "function strcontains(needle, haystack) {\n return haystack.indexOf(needle) != -1;\n }", "title": "" }, { "docid": "e097fadc8242f326cb346f2c99616f16", "score": "0.73047554", "text": "function finder(haystack, needle){\n\tfor(var i =0;i<haystack.length;i++){\n\t\tif(haystack[i]===needle){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "ef7b1532db0cd37eda583cc580d45612", "score": "0.7271375", "text": "function containsHelper(haystack, needle) {\n let haystackType = nameType(haystack)\n let needleType = nameType(needle)\n if (haystackType != needleType) {\n return false\n } else if (haystackType == 'string') {\n return (haystack.indexOf(needle) != -1)\n } else if (haystackType == 'array') {\n for (let b of needle) {\n let found = false\n for (let a of haystack) {\n if (containsHelper(a, b)) {\n found = true\n break\n }\n }\n if (!found)\n return false\n }\n return true\n } else if (haystackType == 'object') {\n for (let k of Object.keys(needle)) {\n if (!haystack.hasOwnProperty(k))\n return false\n if (!containsHelper(haystack[k], needle[k]))\n return false\n }\n return true\n } else {\n return haystack === needle\n }\n}", "title": "" }, { "docid": "31c0f5c8e413df270342c601c5d9b8df", "score": "0.7164323", "text": "function includes (haystack, needle) {\n /* jshint maxdepth: 3*/\n var i;\n\n // Array#indexOf, but ie...\n if (isArray(haystack)) {\n for (i = haystack.length - 1; i >= 0; i = i - 1) {\n if (haystack[i] === needle) {\n return true;\n }\n }\n }\n\n // String#indexOf\n if (typeof haystack === 'string') {\n if (haystack.indexOf(needle) !== -1) {\n return true;\n }\n }\n\n // Object#hasOwnProperty\n if (isPlainObject(haystack)) {\n if (haystack.hasOwnProperty(needle)) {\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "3c14b0c4f093246338d945b780fad39d", "score": "0.7140613", "text": "function startsWith(haystack,needle){if(haystack.length<needle.length){return false;}for(var i=0;i<needle.length;i++){if(haystack[i]!==needle[i]){return false;}}return true;}", "title": "" }, { "docid": "e6734a862941693c7a9539e23219505e", "score": "0.7106162", "text": "function foundIn(needle, haystack) {\n // if haystack is a RegExp and not an array, just compare againt it\n if (isRegExp(haystack)) return haystack.test(needle)\n\n // if haystack is a String, just compare against it\n if (typeof haystack == \"string\") return needle == haystack\n\n // otherwise check each item in the list\n return haystack.some(function(item) {\n return isRegExp(item) ? item.test(needle) : needle === item\n })\n}", "title": "" }, { "docid": "8c5d65ec7d67930507b607e8c9766604", "score": "0.70308536", "text": "function contains(haystack, needle) {\n if (needle && needle.__type && (needle.__type === 'Pointer' || needle.__type === 'Object')) {\n for (var i in haystack) {\n var ptr = haystack[i];\n\n if (typeof ptr === 'string' && ptr === needle.objectId) {\n return true;\n }\n\n if (ptr.className === needle.className && ptr.objectId === needle.objectId) {\n return true;\n }\n }\n\n return false;\n }\n\n return (0, _indexOf.default)(haystack).call(haystack, needle) > -1;\n}", "title": "" }, { "docid": "912d1bac0891609d894c7dd11946404a", "score": "0.7011908", "text": "function startsWith(haystack, needle) {\n if (haystack.length < needle.length) {\n return false;\n }\n\n if (haystack === needle) {\n return true;\n }\n\n for (var i = 0; i < needle.length; i++) {\n if (haystack[i] !== needle[i]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "3c6e1ca7a3f86a20d0e8cf2a00343105", "score": "0.7001255", "text": "function startsWith(haystack, needle) {\n if (haystack.length < needle.length) {\n return false;\n }\n for (var i = 0; i < needle.length; i++) {\n if (haystack[i] !== needle[i]) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "8d22d43a3db119f0732d6c8d80d166b9", "score": "0.6997896", "text": "function startsWith(haystack, needle) {\r\n if (haystack.length < needle.length) {\r\n return false;\r\n }\r\n if (haystack === needle) {\r\n return true;\r\n }\r\n for (var i = 0; i < needle.length; i++) {\r\n if (haystack[i] !== needle[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "8d22d43a3db119f0732d6c8d80d166b9", "score": "0.6997896", "text": "function startsWith(haystack, needle) {\r\n if (haystack.length < needle.length) {\r\n return false;\r\n }\r\n if (haystack === needle) {\r\n return true;\r\n }\r\n for (var i = 0; i < needle.length; i++) {\r\n if (haystack[i] !== needle[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "5438d7f7454045c1ef290f24cbb457dc", "score": "0.68426466", "text": "function containsAll(needles, haystack){ \n for(var i = 0 , len = needles.length; i < len; i++){\n if($.inArray(needles[i], haystack) == -1) return false;\n }\n return true;\n}", "title": "" }, { "docid": "4265a7451a7dc0e13abad30f61436926", "score": "0.6809675", "text": "function containsAll(needles, haystack){\n for(let i = 0 , len = needles.length; i < len; i++){\n if($.inArray(needles[i], haystack) == -1) return false;\n }\n return true;\n}", "title": "" }, { "docid": "8fe66c0141623f5a6ddea5a284ffad58", "score": "0.678409", "text": "function fuzzysearch(needle, haystack) {\n var hlen = haystack.length;\n var nlen = needle.length;\n if (nlen > hlen) {\n return false;\n }\n if (nlen === hlen) {\n return needle === haystack;\n }\n outer: for (var i = 0, j = 0; i < nlen; i++) {\n var nch = needle.charCodeAt(i);\n while (j < hlen) {\n if (haystack.charCodeAt(j++) === nch) {\n continue outer;\n }\n }\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "132b8dd210dbfa03fd5a3b7c09a49775", "score": "0.6679748", "text": "function inArray(needle, haystack)\n{\n var length = haystack.length;\n for(var i = 0; i < length; i++) {\n if(haystack[i] == needle) return true;\n }\n return false;\n}", "title": "" }, { "docid": "e946aa09272cceacf2aab7318d3b3c55", "score": "0.66753846", "text": "function findNeedle(haystack) {\n var lookup = 'needle';\n for (var i = 0; i < haystack.length; i++) {\n if (lookup) {\n return 'found the needle at position ' + haystack.indexOf(lookup);\n }\n }\n}", "title": "" }, { "docid": "f5a7e874682b9307c8fc60238e016ad8", "score": "0.6656657", "text": "function inArray(needle, haystack) {\n var length = haystack.length;\n for(var i = 0; i < length; i++) {\n if(haystack[i] == needle) return true;\n }\n return false;\n}", "title": "" }, { "docid": "8672be8ddc5e8a6283593f1a8094c593", "score": "0.6625349", "text": "function WithinArray(needle, arrhaystack) {\n return (arrhaystack.indexOf(needle) > -1);\n}", "title": "" }, { "docid": "8a8306ee9de895fb68d10d5d849ed39c", "score": "0.6606798", "text": "function in_array(needle, haystack) {\n\tif(typeof needle == 'string' || typeof needle == 'number') {\n\tfor(var i in haystack) {\n\t\tif(haystack[i] == needle) {\n\t\t\treturn true;\n\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "2b01fce1c9c200fe11058ce74fb319a2", "score": "0.6597837", "text": "function strpos(haystack, needle, offset) {\n var i = (haystack + '').indexOf(needle, (offset || 0));\n return i === -1 ? false : i;\n }", "title": "" }, { "docid": "86d6d3c3f9f41f05ed3a0e5f1aaa7382", "score": "0.65759903", "text": "function _inArray(haystack, needle) {\n return Array.prototype.indexOf && (haystack.indexOf(needle) !== -1);\n }", "title": "" }, { "docid": "aa17036cad443c0feef7e41318b4a215", "score": "0.6573078", "text": "function aContainsB(a, b) {\n\treturn a.indexOf(b) >= 0; //indexOf() returns -1 if search item is not present.\n}", "title": "" }, { "docid": "cc245f00719815b50a17fdaaef28a751", "score": "0.65565044", "text": "function inArray(needle, haystack) {\n for (var i = haystack.length; i--;) {\n if (haystack[i] === needle) {\n return true\n }\n }\n return false\n}", "title": "" }, { "docid": "cc245f00719815b50a17fdaaef28a751", "score": "0.65565044", "text": "function inArray(needle, haystack) {\n for (var i = haystack.length; i--;) {\n if (haystack[i] === needle) {\n return true\n }\n }\n return false\n}", "title": "" }, { "docid": "b5b7684013b982f8e1360f0402aea028", "score": "0.6550614", "text": "function WithinArray(needle, arrhaystack) {\n\treturn (arrhaystack.indexOf(needle) > -1);\n}", "title": "" }, { "docid": "afe9d309d3b51d135fff0f0246244988", "score": "0.6538092", "text": "function stringContainsAt(haystack, needle, startIndex) {\n var needleLength = needle.length;\n if (needleLength + startIndex > haystack.length) {\n return false;\n }\n for (var i = 0; i < needleLength; i++) {\n if (needle.charCodeAt(i) !== haystack.charCodeAt(i + startIndex))\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "b0f217f328992abe6cd4aa5325cc918e", "score": "0.6522611", "text": "function ws_products_inArray(needle, haystack) {\n var length = haystack.length;\n for(var i = 0; i < length; i++) {\n if(typeof haystack[i] == 'object') {\n if(ws_products_arrayCompare(haystack[i], needle)) return true;\n } else {\n if(haystack[i] == needle) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "b8515c6a801cdface807876874202a43", "score": "0.65158236", "text": "function findNeedle(haystack) {\nreturn 'found the needle at position '+ haystack.indexOf('needle')\n}", "title": "" }, { "docid": "a1cfff52e0711df7b8b24e4bc99c436c", "score": "0.64990854", "text": "function inArray(arr, needle) {\n\tfor (var i = 0, l = arr.length; i < l; i++) if(arr[i] && arr[i] === needle) return true;\n\treturn false;\n}", "title": "" }, { "docid": "9d416e44e4b5e3e33eadcc897a76fb67", "score": "0.6494136", "text": "function inArray(needle, haystack, strict) {\n\tvar found = false, key, strict = !!strict;\n\n\tfor (key in haystack) {\n\t\tif ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {\n\t\t\tfound = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn found;\n}", "title": "" }, { "docid": "e4975cacb5a862849fa346d9464529f2", "score": "0.6457936", "text": "function strstr (haystack, needle) {\r\n var pos = 0;\r\n haystack += '';\r\n pos = haystack.indexOf(needle);\r\n\r\n return (pos == -1) ? false : haystack.slice(pos);\r\n}", "title": "" }, { "docid": "04fd5badc235d807139e7cce86a74bd0", "score": "0.64557713", "text": "function strpos(haystack, needle, offset) {\n var i = (haystack + '').indexOf(needle, (offset || 0));\n return i === -1 ? false : i;\n}", "title": "" }, { "docid": "7e13566b955449e36010c54ed4686413", "score": "0.6429135", "text": "function inArray(needle, haystack)\n{\n\tfor (h in haystack)\n\t{\n\t\tif (haystack[h] == needle)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "16b4fedc4ec7cb3620d8b18415984692", "score": "0.6369869", "text": "function inArray(needle,haystack){\n for(var i=0;i<haystack.length;i++){\n if(haystack[i]===needle){\n return exists = true;\n console.log(\"This already exists\") \n }\n\n exists = false;\n console.log(\"CAN'T SEEM TO FIND IT!\")\n }\n\n if (exists === false){\n friends.push(userInput);\n }\n \n }", "title": "" }, { "docid": "e027d10e58488115197c41fb74c42292", "score": "0.6319928", "text": "function endsWith(haystack, needle) {\n var diff = haystack.length - needle.length;\n\n if (diff > 0) {\n return haystack.indexOf(needle, diff) === diff;\n } else if (diff === 0) {\n return haystack === needle;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "a100bc50af3cb66804bb014f41bccd7f", "score": "0.63189316", "text": "function findNeedle(haystack) {\n let found = haystack.find((needle)=> needle === 'needle')\n return `found the needle at position ${haystack.indexOf(found)}` \n}", "title": "" }, { "docid": "9e9144425d2bbe9f1b3b05a9be24ca2f", "score": "0.63105685", "text": "function endsWith(haystack, needle) {\n var diff = haystack.length - needle.length;\n if (diff > 0) {\n return haystack.indexOf(needle, diff) === diff;\n }\n else if (diff === 0) {\n return haystack === needle;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "ccc4dfbc24f0df5f7880b03146d12538", "score": "0.6293201", "text": "function endsWith(haystack, needle) {\r\n var diff = haystack.length - needle.length;\r\n if (diff > 0) {\r\n return haystack.indexOf(needle, diff) === diff;\r\n }\r\n else if (diff === 0) {\r\n return haystack === needle;\r\n }\r\n else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "ccc4dfbc24f0df5f7880b03146d12538", "score": "0.6293201", "text": "function endsWith(haystack, needle) {\r\n var diff = haystack.length - needle.length;\r\n if (diff > 0) {\r\n return haystack.indexOf(needle, diff) === diff;\r\n }\r\n else if (diff === 0) {\r\n return haystack === needle;\r\n }\r\n else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "da7e77dc7b6afa14e18975d64b4338ea", "score": "0.62770545", "text": "function fieldMaskContains(haystack, needle) {\r\n\t return haystack.some(v => v.isEqual(needle));\r\n\t}", "title": "" }, { "docid": "a66a414619dcbdf8d28e02efacc24f23", "score": "0.62719214", "text": "function matchFound(elem, arr) { return arr.includes(elem); }", "title": "" }, { "docid": "79d656b25fd6b78b28ada7e230883fcc", "score": "0.62453914", "text": "function appearsExactlyOnce(haystack, needle) {\n let hit;\n return (hit = haystack.indexOf(needle)) >= 0 && (hit = haystack.indexOf(needle, hit + 1)) < 0;\n}", "title": "" }, { "docid": "7896ca5328d28af92a24a272e5ce59f6", "score": "0.62319225", "text": "function find(needle) {\n return userAgent.indexOf(needle) !== -1;\n}", "title": "" }, { "docid": "7896ca5328d28af92a24a272e5ce59f6", "score": "0.62319225", "text": "function find(needle) {\n return userAgent.indexOf(needle) !== -1;\n}", "title": "" }, { "docid": "0b076276e7bb01a02c248e5587524b35", "score": "0.6208384", "text": "function arrayContainsAnotherArray(needle, haystack) {\r\n for (var i = 0; i < needle.length; i++) {\r\n if (haystack.indexOf(needle[i]) === -1)\r\n return false;\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "bbb25c1834f6639ee37849152545d02a", "score": "0.6206185", "text": "function has(A,x) {\n return (indexOf(x,A) != -1)\n}", "title": "" }, { "docid": "f0a02d83202625b0478ede82a9a1ebcf", "score": "0.62052834", "text": "function contains(str,sub_str){\n return (str.indexOf(sub_str) > -1);\n}", "title": "" }, { "docid": "37f280af006db126bab01553f2e236f4", "score": "0.6193202", "text": "function arrayContainsAnotherArray(needle, haystack) {\n if (isNullOrUndefined(needle) || isNullOrUndefined(haystack)) {\n return false;\n }\n // Ensure every value of the needle exists in the haystack.\n for (var index = 0; index < needle.length; index++) {\n if (haystack.indexOf(needle[index]) === -1) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "e5f1ac05dd7048e522f08fcb226cb5f9", "score": "0.61830175", "text": "function findNeedle(haystack) {\n let theposition = haystack.indexOf('needle');\n return `found the needle at position ${theposition}`\n }", "title": "" }, { "docid": "24730e9764d3f46363bb14ec1a20d30d", "score": "0.6178007", "text": "function endsWith(haystack,needle){var diff=haystack.length-needle.length;if(diff>0){return haystack.indexOf(needle,diff)===diff;}else if(diff===0){return haystack===needle;}else{return false;}}", "title": "" }, { "docid": "b0e5b2b3e476f366edaf000b3da3315a", "score": "0.61750984", "text": "function contains(value, searchFor){\r\n return (value).indexOf(searchFor) > -1;\r\n }", "title": "" }, { "docid": "6ab509e0d79f3df073b8aef85d2b5a5f", "score": "0.6155182", "text": "static arrayContains(needle_value,haystack_array){\n for (var i = 0; i < haystack_array.length; i++){\n if (haystack_array[i] == needle_value){\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "cd90397e05639a2be4e74b3b16f182cd", "score": "0.6145878", "text": "function in_array (needle, haystack, argStrict) {\n var key = '',\n strict = !! argStrict;\n\n if (strict) {\n for (key in haystack) {\n if (haystack[key] === needle) {\n return true;\n }\n }\n } else {\n for (key in haystack) {\n if (haystack[key] == needle) {\n return true;\n }\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "01d3fe1f06ded751343ef853bf0c1c77", "score": "0.60937256", "text": "function endsWith(haystack, needle) {\n var diff = haystack.length - needle.length;\n if (diff > 0) {\n return haystack.lastIndexOf(needle) === diff;\n }\n else if (diff === 0) {\n return haystack === needle;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "104b1f88ae2d3416197de40757d104d9", "score": "0.6082331", "text": "function contains(needle) {\n // Per spec, the way to identify NaN is that it is not equal to itself\n var findNaN = needle !== needle;\n var indexOf;\n\n if (!findNaN && typeof Array.prototype.indexOf === 'function') {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function indexOf(needle) {\n var i = -1,\n index = -1;\n for (i = 0; i < this.length; i++) {\n var item = this[i];\n\n if (findNaN && item !== item || item === needle) {\n index = i;\n break;\n }\n }\n return index;\n };\n }\n return indexOf.call(this, needle) > -1;\n}", "title": "" }, { "docid": "38e1bfb50edd77f3c580ea6c32390c79", "score": "0.6035718", "text": "function contains(needle) {\n // Per spec, the way to identify NaN is that it is not equal to itself\n var findNaN = needle !== needle;\n var indexOf;\n if(!findNaN && typeof Array.prototype.indexOf === 'function') {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function(needle) {\n var i = -1, index = -1;\n for(i = 0; i < this.length; i++) {\n var item = this[i];\n\n if((findNaN && item !== item) || item === needle) {\n index = i;\n break;\n }\n }\n return index;\n };\n }\n return indexOf.call(this, needle) > -1;\n}", "title": "" }, { "docid": "f35734ddbd2dcc18f9943c57fb09a977", "score": "0.60324895", "text": "function endsWith(haystack, needle) {\n var diff = haystack.length - needle.length;\n\n if (diff > 0) {\n return haystack.lastIndexOf(needle) === diff;\n } else if (diff === 0) {\n return haystack === needle;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "751be7798ab9aa8efedf1cdbd7bb83c8", "score": "0.6006901", "text": "function getCaseSuggestion(needle, haystack) {\n var found = false;\n var lneedle = needle.toLowerCase();\n for (var i = 0; i < haystack.length; i++) {\n if (lneedle === haystack[i].toLowerCase()) {\n if (found) return false;\n found = haystack[i];\n }\n }\n return found;\n}", "title": "" }, { "docid": "9c5dfd7a8bed329ff2b2264e5fe72f98", "score": "0.60048956", "text": "static strContains(str, substring) {\n return str.indexOf(substring) > -1;\n }", "title": "" }, { "docid": "41ac9337070a6564d62f71eba81b2bd9", "score": "0.6002639", "text": "function findWord(needle, haystack) {\r return haystack.match(needle + \"\\\\b\");\r}", "title": "" }, { "docid": "3f406742bd5ae1b440b9b4f1276b660d", "score": "0.5998271", "text": "function endsWith(haystack, needle) {\n var diff = haystack.length - needle.length;\n if (diff > 0) {\n return haystack.lastIndexOf(needle) === diff;\n } else if (diff === 0) {\n return haystack === needle;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "e64ecc1285ea917e9644959ac20792aa", "score": "0.5979027", "text": "function contains( str, substr ) {\n\t return !!~('' + str).indexOf(substr);\n\t }", "title": "" }, { "docid": "932598339d8efb0db7bf2cc7c2300bbe", "score": "0.5977369", "text": "function findNeedle(haystack) {\r\n\treturn `found the needle at position ${haystack.indexOf('needle')}`;\r\n}", "title": "" }, { "docid": "bb381fec64198ca9e8796925379d5d84", "score": "0.5974507", "text": "function contains(target, pattern){\n \tvar value = 0;\n \tpattern.forEach(function(word){\n \t\tvalue = value + target.includes(word);\n \t});\n \treturn (value === 1)\n }", "title": "" }, { "docid": "05b9480804b6550a931172aad83d8351", "score": "0.59432703", "text": "function needleInHaystack() {\n\tvar raw_response = getResponseForChallenge(\"http://challenge.code2040.org/api/haystack\")\n\tvar response = JSON.parse(raw_response);\n\n\tvar needle = response.needle;\n\t$(\"#success\").append(\"<p>The needle is \" + needle + \"</p>\");\n\tvar haystack = response.haystack;\n\tvar location = -1;\n\tfor (var x = 0; x < haystack.length; x++) {\n\t\tif (needle === haystack[x]) {\n\t\t\tlocation = x;\n\t\t\tbreak;\n\t\t}\n\t}\n\t$(\"#success\").append(\"<p>The needle is located at \" + location + \" in the haystack</p>\");\n\tvalidateNeedleLocation(\"http://challenge.code2040.org/api/haystack/validate\", location);\n}", "title": "" }, { "docid": "5588254509d4a92fd51e5d536983f84f", "score": "0.5924701", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "5588254509d4a92fd51e5d536983f84f", "score": "0.5924701", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "5588254509d4a92fd51e5d536983f84f", "score": "0.5924701", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "89397c1aa0f3c60d7c6ee97c91303f7d", "score": "0.58824444", "text": "function includes(target, search) {\n if (search.length > target.length) {\n return false;\n }\n else {\n return target.indexOf(search) !== -1;\n }\n}", "title": "" }, { "docid": "89397c1aa0f3c60d7c6ee97c91303f7d", "score": "0.58824444", "text": "function includes(target, search) {\n if (search.length > target.length) {\n return false;\n }\n else {\n return target.indexOf(search) !== -1;\n }\n}", "title": "" }, { "docid": "89397c1aa0f3c60d7c6ee97c91303f7d", "score": "0.58824444", "text": "function includes(target, search) {\n if (search.length > target.length) {\n return false;\n }\n else {\n return target.indexOf(search) !== -1;\n }\n}", "title": "" }, { "docid": "d6fc858654eda0d3ed03f6956050ff44", "score": "0.5879827", "text": "function includes(a, b) {\n return a.indexOf(b) > -1;\n}", "title": "" }, { "docid": "d6fc858654eda0d3ed03f6956050ff44", "score": "0.5879827", "text": "function includes(a, b) {\n return a.indexOf(b) > -1;\n}", "title": "" }, { "docid": "d6fc858654eda0d3ed03f6956050ff44", "score": "0.5879827", "text": "function includes(a, b) {\n return a.indexOf(b) > -1;\n}", "title": "" }, { "docid": "d6fc858654eda0d3ed03f6956050ff44", "score": "0.5879827", "text": "function includes(a, b) {\n return a.indexOf(b) > -1;\n}", "title": "" }, { "docid": "6394b97930404a41c94a0ca12699986e", "score": "0.58685124", "text": "function check(a, x) {\n\treturn a.indexOf(x) !== -1 ;\n}", "title": "" }, { "docid": "0bdd78fd93dc64b0ddac9751dbfafe44", "score": "0.5863405", "text": "function contains(arr, str, identical) {\r\n\tvar ii = arr.length;\r\n\twhile (ii--) {\r\n\t\tif (!identical) { if (arr[ii].indexOf(str) >= 0) { return ii; } }\r\n\t\telse { if (arr[ii] === str) { return ii; } }\r\n\t}\r\n\treturn ii;\r\n}", "title": "" }, { "docid": "b739f8b0380c3f10b45de728066332e2", "score": "0.5860024", "text": "function contains (data, substring) {\n return string(data) && data.indexOf(substring) !== -1;\n }", "title": "" }, { "docid": "59a68461aa7e618d454e54f61ec3d14d", "score": "0.5852743", "text": "function containsString(srcString, subString)\r\n{\r\n\tif(srcString.indexOf(subString) != -1)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "title": "" }, { "docid": "45fb6f0dddb40ce560494a2131b547ff", "score": "0.58428496", "text": "static contains(indexOfAble, match) {\n if (!indexOfAble)\n return false;\n return indexOfAble.indexOf(match) !== -1;\n }", "title": "" }, { "docid": "08ecdc4ac08bef19ea0b203c67ab6b8a", "score": "0.58404636", "text": "function includes(text, substr) {\n // zwraca true lub false a nie index\n return text.includes(substr);\n}", "title": "" }, { "docid": "efe085b6b526a968293b1838172b3e2d", "score": "0.58332735", "text": "function containsExtended(a, str) {\n var i = a.length;\n while (i--) {\n if (a[i] === str || a[i].includes(str) || str.includes(a[i])) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" }, { "docid": "116f885091d8941cf32e38d42d2c254c", "score": "0.5833161", "text": "function contains( str, substr ) {\n return !!~('' + str).indexOf(substr);\n }", "title": "" } ]
10f1e2722d4913da6fbfb73532e546a5
Scene_Shop The scene class of the shop screen.
[ { "docid": "effbcbbc62a15f16062fcf27a24c9051", "score": "0.75149", "text": "function Scene_Shop() {\n this.initialize.apply(this, arguments);\n}", "title": "" } ]
[ { "docid": "5ee499f6b5ded643fee7a8c8ca31306e", "score": "0.6139264", "text": "constructor() {\n\n super('Menu');\n\n // make this an active scene\n this.active;\n this.currentScene;\n }", "title": "" }, { "docid": "ddfae2160949e324aff232eebbe58360", "score": "0.61162674", "text": "constructor () {\n super('MenuScene');\n }", "title": "" }, { "docid": "7c96366f8faea332dbeadec62bfe8792", "score": "0.6035316", "text": "constructor(){\n\n super(\"MenuScene\");\n\n }", "title": "" }, { "docid": "f597e0f7d2823c546a1ce6d3c048c465", "score": "0.6007322", "text": "constructor() {\n super('MenuScene');\n }", "title": "" }, { "docid": "2adf3cf519957b5e1affea5ee7eed768", "score": "0.58823216", "text": "constructor() {\r\n // \"menu\" is the identifier for this scene\"\r\n super (\"menu\");\r\n }", "title": "" }, { "docid": "14b6998e77016d1dd27eeb4fcf23d793", "score": "0.5839811", "text": "function initShop() {\n shop = new lib.Shop();\n shop.name = \"shop\";\n shop.y = 55;\n // sshop.x = widthInWidth //* 0.5;\n //cl(\"widthInWidth =\" + widthInWidth)\n shop.scaleX = shop.scaleY = topBGScale;\n shop.o = {\n buyMilk: false,\n }\n\n shop.snapToPixel = true;\n shop.cache(-150, -1, 151, 163, 4);\n\n topRight.addChild(shop);\n MilkPriceTxt();\n }", "title": "" }, { "docid": "0c3b67cd781bbc7919a0c40705d3aad9", "score": "0.5709323", "text": "function StoreScene(){\n\tvar o = {};\n\to.div = document.getElementById(\"storeScene\");\n\to.backBtn = document.getElementById(\"m4backBtn\");\n\to.backBtn.onclick = function(){\n\t\ttoggleMenu(o,titleScene);\n\t};\n\treturn o;\n}", "title": "" }, { "docid": "bb7cf866658b915a6d89e44e4ec9332e", "score": "0.56398606", "text": "constructor() {\n super('BootScene');// 'bootGame' will be the identifier for this 'scene1'\n }", "title": "" }, { "docid": "75124acbefb50f26dca6cceae63ea4b7", "score": "0.5609463", "text": "constructor() {\n super('Scene');\n }", "title": "" }, { "docid": "b10e3af6f25389d1b9d3e1886806ae82", "score": "0.5527682", "text": "function MainMenuScene() {\n\tthis.setup()\n}", "title": "" }, { "docid": "061336337b047743e012e7ef78dacb89", "score": "0.5483714", "text": "function Scene() {\n _super.call(this);\n /**\n * Node's ActionManager.\n * @member cc.node.Scene#_actionManager\n * @type {cc.action.ActionManager}\n * @private\n */\n this._actionManager = new ActionManager();\n /**\n * Callback reference for onEnter event.\n * @member cc.node.Scene#_onEnter\n * @type {cc.node.CallbackSceneTransition}\n * @private\n */\n this._onEnter = null;\n /**\n * Callback reference for onExit event.\n * @member cc.node.Scene#_onExit\n * @type {cc.node.CallbackSceneTransition}\n * @private\n */\n this._onExit = null;\n /**\n * Callback reference for enter transition end event.\n * @member cc.node.Scene#_onEnterTransitionDidFinish\n * @type {cc.node.CallbackSceneTransition}\n * @private\n */\n this._onEnterTransitionDidFinish = null;\n /**\n * Callback reference for exit transition start event.\n * @member cc.node.Scene#_onExitTransitionDidStart\n * @type {cc.node.CallbackSceneTransition}\n * @private\n */\n this._onExitTransitionDidStart = null;\n /**\n * Director reference this scene belongs to.\n * @member cc.node.Scene#_director\n * @type {cc.node.Director}\n * @private\n */\n this._director = null;\n\n this.setPositionAnchor(0, 0);\n }", "title": "" }, { "docid": "91f1555bf8e866fc966c321820f7c560", "score": "0.5477077", "text": "create() {\n consola.success('Game loaded');\n this.scene.start('MenuScene');\n }", "title": "" }, { "docid": "0b5bf00f0cbbe680d355132e7c112d02", "score": "0.54595613", "text": "get scene() {}", "title": "" }, { "docid": "eaaa8d010120a346ca37d4022d584274", "score": "0.545188", "text": "function SceneScene1() {\n\n}", "title": "" }, { "docid": "eaaa8d010120a346ca37d4022d584274", "score": "0.545188", "text": "function SceneScene1() {\n\n}", "title": "" }, { "docid": "52d53f9cc289a7156846d429fdb33c19", "score": "0.54480535", "text": "constructor() {\n super('WinScene');\n }", "title": "" }, { "docid": "16703e5eb7723ed784c763c5a4035cda", "score": "0.54158795", "text": "constructor() {\n super(\"optionsScene\");\n }", "title": "" }, { "docid": "44b823d99dd58c5f8abf11217bb74470", "score": "0.54126996", "text": "function WidgetShop( name, owner, location ) {\n // `this` will point to the blank canvas that is being created right now\n // Shop();\n // Execute the Shop function and make `this` inside Shop equal the first argument below\n Shop.call( this, name, owner );\n this.location = location;\n }", "title": "" }, { "docid": "fcd230bb670faba56a82efd63b7438c9", "score": "0.5380301", "text": "constructor() {\r\n // \"menu\" is the identifier for this scene\"\r\n super (\"controls\");\r\n }", "title": "" }, { "docid": "0de3630b060d0b92119897ed09766930", "score": "0.5334799", "text": "function GameScene()\n{\n\tthis.title = \"Playing\";\n\tthis.init = false;\n\n\tthis.backgroundImg = new Background(0, 0, \"GameScene/Background.png\");\n\t\n\tthis.playerOne = new Player(300,400,\"GameScene/ninja1.png\");\t\t\t\t\n\n\tthis.collManager = new CollisionManager();\n\t\t\t\t\t\t\n\tthis.Setup();\n}", "title": "" }, { "docid": "c5e3ec673ba1683c84536b4717d2aad5", "score": "0.5326947", "text": "function instantiate() {\n new ShopItem('img/bag.jpg', 'R2D2 suitcase');\n new ShopItem('img/banana.jpg', 'Banana slicer');\n new ShopItem('img/bathroom.jpg', 'Ipad holding toilet paper roll');\n new ShopItem('img/boots.jpg', 'Open toe boots');\n new ShopItem('img/breakfast.jpg', 'Breakfast machine');\n new ShopItem('img/bubblegum.jpg', 'Meatball bubblegum');\n new ShopItem('img/chair.jpg', 'Chair');\n new ShopItem('img/cthulhu.jpg', 'Cthulhu');\n new ShopItem('img/dog-duck.jpg', 'Duck beak on a dog');\n new ShopItem('img/dragon.jpg', 'Dragon meat');\n new ShopItem('img/pen.jpg', 'Blue silverware pen caps');\n new ShopItem('img/pet-sweep.jpg', 'Pet paw mops');\n new ShopItem('img/scissors.jpg', 'Pizza scissors');\n new ShopItem('img/shark.jpg', 'Shark sleeping bag');\n new ShopItem('img/sweep.png', 'Baby sweeping outfit');\n new ShopItem('img/tauntaun.jpg', 'Tauntaun sleeping bag');\n new ShopItem('img/unicorn.jpg', 'Unicorn meat');\n new ShopItem('img/usb.gif', 'USB lizard tail');\n new ShopItem('img/water-can.jpg', 'Watering can');\n new ShopItem('img/wine-glass.jpg', 'Wine glass');\n}", "title": "" }, { "docid": "0d5b901b3ba50d236fe35af62fb9ae67", "score": "0.53113294", "text": "_initScene(){\n let me = this,\n scene = new Scene({utils:me._utils});\n\n me.model.setData('scenes', scene);\n me._currentScene = scene;\n }", "title": "" }, { "docid": "12ccb8b5c45546b5aaef935d3eb22c89", "score": "0.5307563", "text": "function getScene() {\n return scene;\n }", "title": "" }, { "docid": "c0463efe5d7838a65b6f0f11241be946", "score": "0.53046435", "text": "function changeScene() {\n // Launch various scenes\n switch (scene) {\n case config.Scene.MENU:\n // show the MENU scene\n stage.removeAllChildren();\n menu = new scenes.Menu();\n currentScene = menu;\n console.log(\"Starting MENU Scene\");\n break;\n case config.Scene.SLOT_MACHINE:\n // show the PLAY scene\n stage.removeAllChildren();\n slotMachine = new scenes.SlotMachine();\n currentScene = slotMachine;\n console.log(\"Starting SLOT_MACHINE Scene\");\n break;\n case config.Scene.GAME_OVER:\n // show the game OVER scene\n stage.removeAllChildren();\n gameOver = new scenes.GameOver();\n currentScene = gameOver;\n console.log(\"Starting GAME_OVER Scene\");\n break;\n }\n //preload();\n console.log(currentScene.numChildren);\n}", "title": "" }, { "docid": "6fb1dae7aa50c1d9e8d09cfb5c6b7f62", "score": "0.53019315", "text": "function BasketScene() {\n this.kMinionSprite = \"assets/minion_sprite.png\";\n this.kPlatformTexture = \"assets/platform.png\";\n this.kWallTexture = \"assets/wall.png\";\n this.kTargetTexture = \"assets/target.png\";\n this.kForest = \"assets/Forest2.png\";\n this.kEarth = \"assets/Earth.png\";\n this.kMW = \"assets/MW2.jpg\";\n this.scoreMarks = \"assets/checksandx.png\"\n this.kArrow = \"assets/MenuSelectArrow.png\";\n this.helpTable = \"assets/BasketHelp.png\";\n this.kbats =\"assets/bats.png\";\n this.friend = \"assets/squirralR.png\";\n \n this.boat = \"assets/BasketGame/boat.png\";\n this.fish = \"assets/BasketGame/fish.png\";\n this.ocean = \"assets/BasketGame/ocean.png\";\n this.oceanBG = \"assets/BasketGame/oceanbackground.png\";\n this.seagull = \"assets/BasketGame/seagull.png\";\n this.boatcharacter = \"assets/BasketGame/boatcharacter.png\";\n this.chipmunk = \"assets/squirrel.png\";\n \n // The camera to view the scene\n this.mCamera = null;\n\n //this.mMsg = null;\n this.mShapeMsg = null;\n\n this.mAllObjs = null;\n this.mBounds = null;\n this.mCollisionInfos = [];\n this.mHero = null;\n \n this.mCurrentObj = 0;\n this.mTarget = null;\n \n \n // Setting up ray selection logic\n this.minselect=0;\n this.maxselect=4;\n \n //this.selection=0;\n \n this.genTimer=0;\n \n //width of world within camera view\n this.WCWidth=300;\n \n this.VPWidth=800;\n this.VPHeight=600;\n \n //height derived from width\n this.WCHeight=this.VPHeight/this.VPWidth*this.WCWidth;\n \n //center x coordinate of camera\n this.WCCenterX=0;\n //y coord\n this.WCCenterY=0;\n \n this.maxType=4;\n \n //this.WCCenterX - (this.WCWidth / 2) + 5\n // this.WCCenterY - (this.WCHeight / 2) + 5\n //this.nextMarkX=-140;\n //this.nextMarkY=109.5;\n \n this.markOffset = 10;\n this.nextMarkX = this.WCCenterX - (this.WCWidth / 2) + this.markOffset;\n this.nextMarkY = this.WCCenterY - (this.WCHeight / 2) + this.markOffset;\n this.scoreMarksArray = [];\n \n this.ground = null;\n \n // elements is an array that holds all the text elements for the data ttype\n // that the player can select from\n this.elements = [];\n this.selectedElement = null;\n this.selectIndex = 0;\n this.helpTableObject = null;\n this.helpTableVisible = false;\n this.GenerateOn=true;\n \n // the number of Xs the player has\n this.numIncorrect = 0;\n this.numCorrect = 0;\n // the number of Xs required to lose the game\n this.gameOverNumber = 10;\n \n //success\n this.succeedNumber = 100;\n // when gameOver is true, we display the player's score and prompt them\n // to play again or return to main menu\n this.gameOver = false;\n this.gameOverText = null;\n this.gameOverText2 = null;\n this.gameOverText3 = null;\n this.gameOverText4 = null;\n \n this.Accuracy = null;\n this.Shots = null;\n this.Hits = null;\n \n this.revealMsg = null;\n\n this.revealTime = 0;\n this.groundLevel = null;\n \n this.mFruit = null;\n this.mBat = null;\n this.mAnswer = null;\n \n \n // --------------------Starting Problem Set\n this.problemType=0;\n \n this.Operators=[];\n this.posY1 = 0;\n this.posX =0;\n this.offSet =0;\n this.position=0;\n \n this.maxPosition=2;\n \n this.basketText = null;\n \n this.THRESHOLD=3;\n this.MAX_TYPE=4;\n \n this.successCount = 0;\n this.friendObject = null;\n this.friendVisible = false;\n this.helpTimer = 0;\n \n this.numMistakes=0;\n \n this.musicOn=true;\n \n \n}", "title": "" }, { "docid": "cfa7960c8591799d8ea343956b3a9b99", "score": "0.52890307", "text": "function OptionScene(){\n\tvar o = {};\n\to.div = document.getElementById(\"optionScene\");\n\to.backBtn = document.getElementById(\"m3backBtn\");\n\to.backBtn.onclick = function(){\n\t\ttoggleMenu(o,titleScene);\n\t};\n\treturn o;\n}", "title": "" }, { "docid": "dbe39ae403872065d85c3a949a75d9cb", "score": "0.52523124", "text": "function isSceneMenu () {\n\treturn currentScene === SCENE_MENU;\n}", "title": "" }, { "docid": "42956b33a1e2c13f3ae7061b14b78566", "score": "0.5234596", "text": "get scene() {\n return this.m_scene;\n }", "title": "" }, { "docid": "42956b33a1e2c13f3ae7061b14b78566", "score": "0.5234596", "text": "get scene() {\n return this.m_scene;\n }", "title": "" }, { "docid": "75c5c9592e385b2a779fd37fe0cbe926", "score": "0.52339774", "text": "get _idPrefix() { return \"Node#Scene\" }", "title": "" }, { "docid": "1e65fdd6ff69c14d25d21b42997bca65", "score": "0.52232575", "text": "initScene() {\n console.log(\"init GaneUI Menu\");\n this.cp = new CodePanel();\n this.addComponent(this.cp, -1);\n\n //Instruction Menu Button \n this.InstructionMenuButton = Button.getButton('Instruction_Menu', 375, 30, 1, 3, 'IM');\n this.InstructionMenuButton.addClickEvent(new NewSceneEvent(new InstructionMenu()));\n var IMHint = new HintEvent('IMHint')\n IMHint.setHintContent('This is an instruction menu \\n It contain all insturtions that support the game to run');\n this.InstructionMenuButton.addLongPressEvent(IMHint);\n this.addComponent(this.InstructionMenuButton, -1);\n //run button\n this.RunButon = Button.getButton('Code_Run', 375, 60, 1, 3, 'Run');\n this.addComponent(this.RunButon, -1);\n this.m = new Memory(\"Memory\", [], 5, 5, 50, 200, false);\n this.m.add(0);\n this.addComponent(this.m, -1);\n this.r = new Register(\"Register\", [], 100, 270, 250, 50, true);\n this.r.init();\n this.addComponent(this.r, -1);\n this.addLayer();\n this.cpu = new CPU();\n this.addComponent(this.cpu, -1);\n this.cpu.setSpeed(2);\n this.interpreter=new Interpreter(this.cpu, this.cp, this.m, this.r);\n this.RunButon.addClickEvent(new RunCodeEvent( this.interpreter));\n }", "title": "" }, { "docid": "0cf60c2aa8d4f7a788eb93e3ebadb705", "score": "0.51819265", "text": "function changeScene() {\n // Launch various scenes\n switch (scene) {\n case config.Scene.MENU:\n // show the MENU scene\n stage.removeAllChildren();\n menu = new scenes.Menu();\n currentScene = menu;\n console.log(\"Starting MENU Scene\");\n break;\n case config.Scene.INSTRUCTIONS:\n // show the INSTRUCTIONS scene\n stage.removeAllChildren();\n instructions = new scenes.Instructions();\n currentScene = instructions;\n console.log(\"Starting INSTRUCTIONS Scene\");\n break;\n case config.Scene.PLAY:\n // show the PLAY scene\n stage.removeAllChildren();\n play = new scenes.Play();\n currentScene = play;\n console.log(\"Starting PLAY Scene\");\n break;\n case config.Scene.END:\n // show the END scene\n stage.removeAllChildren();\n end = new scenes.End();\n currentScene = end;\n console.log(\"Starting END Scene\");\n break;\n }\n console.log(currentScene.numChildren);\n}", "title": "" }, { "docid": "60f0b8fc7a76f4cbb73029bf6bbdf2b3", "score": "0.51646006", "text": "function Store () {\n this.searchEngines = {\n baidu: {\n name: '百度',\n pic: '../assets/baidu.png'\n },\n google: {\n name: '谷歌',\n pic: '../assets/google.png'\n },\n bing: {\n name: '必应',\n pic: '../assets/bing.png'\n },\n sogou: {\n name: '搜狗',\n pic: '../assets/sogou.png'\n }\n }\n this.shortcuts = [\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' },\n { url: '', pic: '' }\n ]\n // 3 states:\n // 0: view mode\n // 1: route mode\n // 2: settings mode\n this.state = 0\n // Store is also a Singleton\n if (typeof Store.instance === 'object') {\n return Store.instance\n }\n Store.instance = this\n return this\n}", "title": "" }, { "docid": "4f508c51f2709d8aced1c78ec7f4a8ff", "score": "0.51605105", "text": "get scene() {\n return this._scene;\n }", "title": "" }, { "docid": "7a08268de9b5145bcf3976e614c1a35e", "score": "0.516007", "text": "function Scene_FirstScene() {\n this.initialize.apply(this, arguments);\n }", "title": "" }, { "docid": "49bf5cb5140cbac38a66b9485191a491", "score": "0.5146299", "text": "static MoveGameObjectToScene() {}", "title": "" }, { "docid": "351c51bcdc0575dcaaa874ee6b603adf", "score": "0.51422596", "text": "constructor() {\n super('WorldScene');\n }", "title": "" }, { "docid": "ffc360de7f46fa26e1252f143edf56f4", "score": "0.51177454", "text": "function Scene(game)\r\n{\r\n this.game = game;\r\n this.changed = new Slot(this);\r\n}", "title": "" }, { "docid": "a1c14b53dd0d595b0b8f7fc043bd0561", "score": "0.50873506", "text": "function changeScene() {\n stage.removeAllChildren();\n // Launch various scenes\n switch (scene) {\n case config.Scene.LOADING:\n // show the loading scene \n loading = new scenes.Loading();\n currentScene = loading;\n console.log(\"Starting loading Scene\");\n break;\n case config.Scene.MENU:\n // show the MENU scene \n menu = new scenes.Menu();\n currentScene = menu;\n console.log(\"Starting MENU Scene\");\n break;\n case config.Scene.SLOT_MACHINE:\n // show the PLAY scene \n slotMachine = new scenes.SlotMachine();\n currentScene = slotMachine;\n console.log(\"Starting SLOT_MACHINE Scene\");\n break;\n case config.Scene.GAME_OVER:\n // show the game OVER scene\n gameOver = new scenes.GameOver();\n currentScene = gameOver;\n console.log(\"Starting GAME_OVER Scene\");\n break;\n }\n console.log(currentScene.numChildren);\n}", "title": "" }, { "docid": "286e3174c0a971ad9250952e8b6e0212", "score": "0.5079313", "text": "constructor() {\r\n // \"bootGame is the identifier for this scene\"\r\n super (\"load_game\");\r\n }", "title": "" }, { "docid": "0917f8e10ea0b3aca45be21aabcaefb5", "score": "0.50761676", "text": "function Scene() {\n _super.call(this);\n this.start();\n }", "title": "" }, { "docid": "36b8caa01531f8968bfd7b7617d3d5d2", "score": "0.50720847", "text": "renderScene(route, navigator) {\n switch(route.id){\n case \"CalculatorPage\":\n return<Calculator/>\n break;\n case \"Setting\":\n return <Setting/>\n break;\n default:\n }\n }", "title": "" }, { "docid": "be9dd712079dbd4bcaf86109fa0d3392", "score": "0.50646615", "text": "displayScene() {\n\n\t\tif (this.scene.interface.isKeyPressed(\"KeyM\") == true)\n\t\t\tthis.changeMaterials ();\n\n\t\tvar root = this.components [this.root];\n\t\t this.displayComponent(root, root.materials[root.currentMaterial], root.texture, root.texS, root.texT);\t\n\t\t\t\n\t\t}", "title": "" }, { "docid": "77c05f96653e1e62e8a70f0bcc04a3d2", "score": "0.5062794", "text": "function Scene_MenuBase() {\n this.initialize(...arguments);\n}", "title": "" }, { "docid": "3f87099f40e8453a98c30e27ae3d09f0", "score": "0.5062789", "text": "function Scene() {\n /**\n * The nodes belonging to the scene.\n *\n * @type {ModelComponents.Node[]}\n * @private\n */\n this.nodes = [];\n}", "title": "" }, { "docid": "2705c5f6c91e00582fe6b94524ea6839", "score": "0.50609523", "text": "function load() {\n\t\t\n\t\t\n\t\tinitCSS();\n\t\t\n\t\t// if webOS, tell it the stage is ready\n\t\tif (window.PalmSystem) {\n\t\t window.PalmSystem.stageReady();\n\t\t}\n\t\t\n\n\t\t\n\t\t// make a new screen\t\t\n\t\tself.ui.screen = new joScreen(\n\t\t\tnew joContainer([\n\t\t\t\tnew joFlexcol([\n\t\t\t\t\tself.ui.nav = new joNavbar(),\n\t\t\t\t\tself.ui.stack = new joStackScroller()\n\t\t\t\t])\n\t\t\t]).setStyle({position: \"absolute\", top: \"0\", left: \"0\", bottom: \"0\", right: \"0\"})\n\t\t);\n\t\tself.ui.nav.setStack(self.ui.stack);\n\t\t\n\t\t\n\t\t\n\t\t/**\n\t\t * make cards \n\t\t */\n\t\tself.ui.cards = {\n\t\t\t\n\t\t\thome:homeCard(),\n\t\t\tdef :defCard() \n\t\t\t\n\t\t};\n\t\t\n\t\t\n\t\t\n\t\tinitGestures();\n\t\t\n\t\t\n\t\t\n\t\t/**\n\t\t * push initial card to stack \n\t\t */\n\t\tself.ui.stack.push(self.ui.cards.home);\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "4f1ad2b972a1429dcb3c58c015b180db", "score": "0.50496674", "text": "constructor() {\n super('LevelScene');\n }", "title": "" }, { "docid": "77086d31cdf008d8eb784c7ff64b7e6a", "score": "0.50464594", "text": "constructor() { //call constructor method on the game object to create an instance of scene \n super({ key: \"Titles\" }); //on the game object create a property of scene and set key to Title, used in config parameters for game\n }", "title": "" }, { "docid": "e0b1dc652550f8968d48f4d1c9a15e10", "score": "0.5045983", "text": "renderScene(route, navigator) {\n if(route.title == 'SelectClass') {\n return <ClassSelectScreen navigator={navigator} {...route.extras}/>\n }\n if(route.title == 'SelectProject') {\n return <ProjectSelectScreen navigator={navigator} {...route.extras} />\n }\n if(route.title == 'Dashboard') {\n return <Root navigator={navigator} {...route.extras}/>\n }\n if(route.title == 'Summary') {\n return <Summary navigator={navigator} {...route.extras}/>\n }\n if(route.title == 'Details') {\n return <Details navigator={navigator} {...route.extras}/>\n }\n if(route.title == 'ManualTracking') {\n return <ManualTracking navigator={navigator} {...route.extras}/>\n }\n if(route.title == 'LogIn') {\n return <LogInScreen navigator={navigator} {...route.extras}/>\n }\n if(route.title == 'EnterInfo') {\n return <InfoScreen navigator={navigator} {...route.extras}/>\n }\n if(route.title == 'SignUpCredentials') {\n return <CredentialsScreen navigator={navigator} />\n }\n if(route.title == 'Settings') {\n return <Settings navigator={navigator} {...route.extras}/>\n }\n }", "title": "" }, { "docid": "018afae5171dcf83bb48c58f8e4f329c", "score": "0.503761", "text": "function changeScene() {\n // Launch various scenes\n switch (scene) {\n case config.Scene.MENU:\n // show the MENU scene\n stage.removeAllChildren();\n menu = new scenes.Menu();\n currentScene = menu;\n console.log(\"Starting MENU Scene\");\n break;\n case config.Scene.PLAY:\n // show the PLAY scene\n stage.removeAllChildren();\n play = new scenes.Play();\n currentScene = play;\n console.log(\"Starting PLAY Scene\");\n break;\n case config.Scene.Scene_A:\n // show the PLAY scene\n stage.removeAllChildren();\n scene_a = new scenes.Scene_A();\n currentScene = scene_a;\n console.log(\"Starting A Scene\");\n break;\n case config.Scene.Scene_A1:\n // show the PLAY scene\n stage.removeAllChildren();\n scene_a1 = new scenes.Scene_A1();\n currentScene = scene_a1;\n console.log(\"Starting A1 Scene\");\n break;\n case config.Scene.Scene_A2:\n // show the PLAY scene\n stage.removeAllChildren();\n scene_a2 = new scenes.Scene_A2();\n currentScene = scene_a2;\n console.log(\"Starting A2 Scene\");\n break;\n case config.Scene.Scene_A2a:\n // show the PLAY scene\n stage.removeAllChildren();\n scene_a2a = new scenes.Scene_A2a();\n currentScene = scene_a2a;\n console.log(\"Starting A2a Scene\");\n break;\n case config.Scene.Scene_A2b:\n // show the PLAY scene\n stage.removeAllChildren();\n scene_a2b = new scenes.Scene_A2b();\n currentScene = scene_a2b;\n console.log(\"Starting A2b Scene\");\n break;\n case config.Scene.Scene_A2a:\n // show the PLAY scene\n stage.removeAllChildren();\n scene_a2a = new scenes.Scene_A2a();\n currentScene = scene_a2a;\n console.log(\"Starting A2a Scene\");\n break;\n case config.Scene.Scene_B:\n // show the PLAY scene\n stage.removeAllChildren();\n scene_b = new scenes.Scene_B();\n currentScene = scene_b;\n console.log(\"Starting B Scene\");\n break;\n case config.Scene.Scene_B1:\n // show the PLAY scene\n stage.removeAllChildren();\n scene_b1 = new scenes.Scene_B1();\n currentScene = scene_b1;\n console.log(\"Starting B1 Scene\");\n break;\n case config.Scene.Scene_B1a:\n // show the PLAY scene\n stage.removeAllChildren();\n scene_b1a = new scenes.Scene_B1a();\n currentScene = scene_b1a;\n console.log(\"Starting B1a Scene\");\n break;\n case config.Scene.Scene_B1b:\n // show the PLAY scene\n stage.removeAllChildren();\n scene_b1b = new scenes.Scene_B1b();\n currentScene = scene_b1b;\n console.log(\"Starting B1b Scene\");\n break;\n case config.Scene.Scene_B2:\n // show the PLAY scene\n stage.removeAllChildren();\n scene_b2 = new scenes.Scene_B2();\n currentScene = scene_b2;\n console.log(\"Starting B2 Scene\");\n break;\n }\n console.log(currentScene.numChildren);\n}", "title": "" }, { "docid": "ab9d10a563a33afbcf4be0f6498105b7", "score": "0.5023795", "text": "function getSceneByAction(action) {\n var root = action.getRoot();\n var scene = root.type == \"Scene\" ? root : null;\n root.traverseAncestors(function (ancObj) {\n if (ancObj.type == \"Scene\") {\n scene = ancObj;\n }\n });\n return scene;\n }", "title": "" }, { "docid": "725af873586a2ba84c06e8c3cb214751", "score": "0.5017622", "text": "function addtoscene() {\n\t\t sceneSwitch(currentModelName);\n\t\t hideSubMenus();\n\t\t menu.style.visibility = 'hidden';\n\t\t scene_menu.style.visibility = 'visible';\n\t\t Header.innerHTML ='Scene';\n\t}", "title": "" }, { "docid": "115f901fa2060abbb28e547342e54726", "score": "0.5016357", "text": "function SOEBothExpertScene1(ballAnswer, spaceAnswer, rightTruckPosition, rightTruckBallNumber, sceneName, nextScene) {\n \n Scene.call(this);\n\n this.spaceAnswer = spaceAnswer;\n this.ballAnswer = ballAnswer;\n this.currentBallNumber = 0;\n this.sceneName = sceneName;\n this.nextScene = nextScene;\n\n this.nextButton = new NextButton(this.nextButtonAction.bind(this));\n this.balanceBeam = new ImageLabel(balanceBeamX, balanceBeamY, balanceBeamWidth, balanceBeamHeight, balanceImg);\n this.truckSlider = new SOESlider(TruckPositions[2], truckY, balanceBeamWidth/2 - 2*lengthOfSpaces, 1, 6, 1, this.sliderAction.bind(this), truckWidth, truckHeight);\n this.truckSlider.sliderImage(LeftTruckImages[0]);\n this.rightTruck = new ImageLabel(TruckPositions[rightTruckPosition], truckY, truckWidth, truckHeight, RightTruckImages[rightTruckBallNumber]);\n this.homeButton = new HomeButton(this.homeButtonAction.bind(this));\n \n this.plusButton = new TextButton(windowWidth/2+buttonWidth/4, multipleChoiceY1+buttonHeight/4, buttonWidth/2, buttonHeight/2, BLUE, \" + \", {size: 90, leading: 90}, this.plusButtonAction.bind(this));\n this.minusButton = new TextButton(windowWidth/2 - (buttonWidth/4 + buttonWidth/2), multipleChoiceY1+buttonHeight/4, buttonWidth/2, buttonHeight/2, BLUE, \" - \", {size: 90, leading: 90}, this.minusButtonAction.bind(this) );\n //modifies text placement on plus/minus buttons\n this.plusButton.nudge[0] = 10;\n this.plusButton.nudge[1] = -5;\n this.minusButton.nudge[0] = 10;\n this.minusButton.nudge[1] = -10;\n this.numberLabel = new Label(windowWidth/2, multipleChoiceY1 + buttonHeight/2, \" 0 \", attrs);\n \n this.titleLabel = new Label(windowWidth/2, borderBufferDist, \"Wobble\", attrs);\n this.addActor(this.titleLabel);\n \n this.border = new BackgroundBorder();\n this.border.z = -1;\n this.addActor(this.border);\n \n this.addActor(this.nextButton);\n this.addActor(this.homeButton);\n this.addActor(this.balanceBeam);\n this.addActor(this.truckSlider);\n this.addActor(this.rightTruck);\n this.addActor(this.plusButton);\n this.addActor(this.minusButton);\n this.addActor(this.numberLabel);\n\n \n \n console.log(\"created BothExpert1 scene\");\n}", "title": "" }, { "docid": "797e4f9d2ffa7b24197725dc252c6d9a", "score": "0.5013234", "text": "function startGame() {\n Crafty.scene('Game');\n}", "title": "" }, { "docid": "5e55ed24416b8f6aac5bdc0ff4d21a3e", "score": "0.5013072", "text": "displayScene() {\n\t\tthis.root.display(this.scene.defaultMaterial, this.scene.defaultTexture, 1.0, 1.0);\n\t}", "title": "" }, { "docid": "3f9b367abe22756488b80adff0ef9b2f", "score": "0.5008729", "text": "static initShopItems(){\n //Standard Shot\n GameManager.shopItems.StdShot = {\n bought: true,\n cost: 0,\n description: \"\\nThe Standard Bullet!\",\n img: item_STDShotIMG\n },\n\n //L-Shot\n GameManager.shopItems.LShot = {\n bought: false,\n cost: 500,\n description: \"\\nShoots 90 degrees each ways,\\naswell as up!\",\n img: item_LShotIMG\n },\n //X-Shot\n GameManager.shopItems.XShot = {\n bought: false,\n cost: 1000,\n description: \"\\nShoots 90 degrees each ways,\\naswell as up and down!\",\n img: item_XShotIMG\n },\n //Spread Shot\n GameManager.shopItems.SpreadShot = {\n bought: false,\n cost: 2000,\n description: \"\\nShoots all the ways\",\n img: item_SpreadShotIMG\n },\n\n //UPGRADES\n GameManager.shopItems.HEALTHUP = {\n bought: false,\n cost: 250,\n description: \"\\nIncrease Health by 100\",\n img: upgrade_HealthdUpIMG\n },\n GameManager.shopItems.SHIELDUP = {\n bought: false,\n cost: 400,\n description: \"\\nIncrease Shield by 100\",\n img: upgrade_ShieldUpIMG\n }\n }", "title": "" }, { "docid": "c9ca30a3e27ef311ef866a6d4349b8e8", "score": "0.50003964", "text": "function Scene_Deck() {\n\t this.initialize.apply(this, arguments);\n\t}", "title": "" }, { "docid": "6e791be0883d70f147ac8d85b3b17579", "score": "0.49896356", "text": "function Scene() {\n _super.call(this);\n /**\n * Node's ActionManager.\n * @member cc.node.Scene#_actionManager\n * @type {cc.action.ActionManager}\n * @private\n */\n this._actionManager = new ActionManager();\n /**\n * Callback reference for onEnter event.\n * @member cc.node.Scene#_onEnter\n * @type {cc.node.CallbackSceneTransition}\n * @private\n */\n this._onEnter = null;\n /**\n * Callback reference for onExit event.\n * @member cc.node.Scene#_onExit\n * @type {cc.node.CallbackSceneTransition}\n * @private\n */\n this._onExit = null;\n /**\n * Callback reference for enter transition end event.\n * @member cc.node.Scene#_onEnterTransitionDidFinish\n * @type {cc.node.CallbackSceneTransition}\n * @private\n */\n this._onEnterTransitionDidFinish = null;\n /**\n * Callback reference for exit transition start event.\n * @member cc.node.Scene#_onExitTransitionDidStart\n * @type {cc.node.CallbackSceneTransition}\n * @private\n */\n this._onExitTransitionDidStart = null;\n this._scheduler = null;\n this._sceneGraphPriorityTree = null;\n this._priorityTree = null;\n this._scheduler = this._actionManager.getScheduler();\n this._sceneGraphPriorityTree = new cc.input.SceneGraphInputTreeNode(this);\n this._priorityTree = [];\n this.setGlobalAlpha(true);\n this.setPositionAnchor(0, 0);\n }", "title": "" }, { "docid": "ab17f18f85e29fbe2caaa7a8dcff0d57", "score": "0.49880636", "text": "constructor(scene) {\r\n this.scene = scene;\r\n // array for pickups in this pickup manager\r\n this.container = [];\r\n }", "title": "" }, { "docid": "f10de31a24599f83b97d41b1d46f7ae0", "score": "0.49877495", "text": "function Scene_Steal() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "2f4827f0620f7f9e00e9dc574b81ea38", "score": "0.49818322", "text": "function InitScene() {\n\tthis.mPersist = false;\n}", "title": "" }, { "docid": "95813ea4692f4b434c2b5dd16af4f503", "score": "0.49744168", "text": "function Scene(index,title,theme,segue,init) {\n\t\n\tthis.sceneIndex = index;\n\tthis.sceneTitle = title;\n\n\tthis.segue = segue; \t// jquery sel (trigger)\n\tthis.height = 500;\t\t// height on page\n\tthis.isActive = false;\t// currently in view?\n\tthis.theme = theme;\t\t// background theme\n\tthis.initcallback = init;\n\t// Dynamic loading?\n\t// Multiple segues?\n\t// Separate segue for interactivity?\n\n\tthis.init = function() {\n\t\t// Init function\n\t\tthis.initcallback && this.initcallback();\n\t};\n\n\tthis.bgState = function() {\n\t\t// Changing background\n\t\tbg.changeTheme(this.theme);\n\t};\n\n\tthis.segueScene = function(enter,down) {\n\t\tvar up = !down;\n\t\tvar leave = !enter;\n\n\t\tenter && up && this.segue.segueEnterUp && this.segue.segueEnterUp();\n\t\tenter && down && this.segue.segueEnterDown && this.segue.segueEnterDown();\n\t\tleave && up && this.segue.segueLeaveUp && this.segue.segueLeaveUp();\n\t\tleave && down && this.segue.segueLeaveDown && this.segue.segueLeaveDown();\n\t\t\n\t\tthis.isActive = enter;\n\t}\n}", "title": "" }, { "docid": "5aa47150c044a729cbbd27093c190197", "score": "0.49655858", "text": "constructor()\n {\n super(\"Title Scene\");\n this.color = \"rgb(200,0,200)\";\n }", "title": "" }, { "docid": "60395a27729a191f6d7bc6c973ca7255", "score": "0.49654973", "text": "function addToScene() {\r\n // Add scene logic here\r\n }", "title": "" }, { "docid": "32e1a14a1205fcb84aa997c53d10e492", "score": "0.4961888", "text": "function ThirdScene() {\n // The camera to view the scene\n this.mCamera = null;\n\n this.mMsg = null;\n\n this.testDirt = null;\n this.stoneTexture = \"assets/MC_Stone.png\";\n this.dirtTexture = \"assets/MC_Dirt.png\";\n this.grassTexture = \"assets/MC_Grass.png\";\n this.lavaTexture = \"assets/MC_Lava.png\";\n this.diamondTexture = \"assets/MC_Diamond.png\";\n this.dirtTile = null;\n this.arr = null;\n this.nextPos = null;\n this.tileSize = null;\n\n this.mWorldMatrix = null;\n this.mTiers = null;\n this.mCameraCenter = null;\n\n}", "title": "" }, { "docid": "76ad31d0473076d710af415a6a2bdb4b", "score": "0.4955172", "text": "start() {\n\n console.log(\"init game scene\");\n\n //--set game scope--//\n Game.gsop = this;\n\n //--add our game holder to the scene, and our UI holder on top (all buttons etc will draw over the top)--//\n this.mapHolder.addChild(this.bgLayer, this.baseLayer, this.floorLayer, this.floorDecoLayer, this.floorDecoLayer_2, this.decoLayer, this.decoLayer_2, this.objectLayer, this.objectLayer_2, this.upperDecoLayer, this.blockedLayer, this.blockedLayer_2, this.characterLayer, this.aboveLayer, this.aboveLayer_2, this.uiLayer);\n this.addChild(this.mapHolder);\n\n //--load level from JSON--//\n this.loadLevel();\n\n //--init user input etc.--//\n this.initGame();\n\n }", "title": "" }, { "docid": "5d6954d6b4766f769442cb1102a9aef0", "score": "0.49494407", "text": "function play() {\n // Declare new Game Container\n game = new createjs.Container();\n // Instantiate Game Objects\n sea = new objects.Sea(stage, game);\n //smallFish = new objects.SmallFish(stage, game);\n fish = new objects.Fish(stage, game);\n // Show Cursor\n stage.cursor = \"none\";\n for (var count = 0; count < constants.SMALLFISH_NUM; count++) {\n smallFishs[count] = new objects.SmallFish(stage, game);\n }\n //add stone, fence and crystal in the scene\n addObj();\n // Display Scoreboard\n scoreboard = new objects.Scoreboard(stage, game);\n // Instantiate Collision Manager\n //+++ comment temporary\n //collision = new managers.Collision(fish, smallFishs, submarines, scoreboard);\n //add game container to stage\n stage.addChild(game);\n }", "title": "" }, { "docid": "146c77f8e4755aded551dfeb5d793af2", "score": "0.49450195", "text": "function vxlScene()\r\n{\r\n\tthis.views \t\t\t\t= [];\r\n\tthis.actors \t\t\t\t= [];\r\n\tthis.toys\t\t\t\t\t= new vxlSceneToys(this);\r\n\tthis.loadingMode \t\t\t= vxl.def.model.loadingMode.LIVE;\r\n\tthis.normalsFlipped \t\t= false;\r\n\tthis.lutID \t\t\t\t\t= null;\r\n\tthis.timerID\t\t\t\t= null;\r\n\tthis.dispatchRate \t\t\t= 500;\r\n\tthis.scalarMIN \t\t\t\t= Number.MAX_VALUE;\r\n\tthis.scalarMAX \t\t\t\t= Number.MIN_VALUE;\r\n\tthis.bb \t\t\t\t\t= [0, 0, 0, 0, 0, 0];\r\n\tthis.centre \t\t\t\t= [0, 0, 0];\r\n\tthis.frameAnimation\t\t\t= null;\r\n\tthis.UID = vxl.util.generateUID();\r\n\r\n\tif (vxl.c.scene == null) vxl.c.scene \t= this;\r\n\r\n\tvxl.go.scenes.push(this);\r\n\t\r\n\tvar ntf = vxl.go.notifier;\r\n var e = vxl.events;\r\n ntf.publish([e.SCENE_NEW, e.SCENE_UPDATED], this);\r\n ntf.subscribe([e.MODELS_LOADED, e.DEFAULT_LUT_LOADED], this);\r\n\tntf.fire(e.SCENE_NEW, this);\r\n}", "title": "" }, { "docid": "88d45c7c00af2845710ff02df638014f", "score": "0.49442607", "text": "startGame(){\n if(this.selection == 0)\n this.scene.start('Board 1'); //this might be 'Single Player'\n else if(this.selection == 1)\n this.scene.start('Board 2'); //this might be 'Multi Player'\n else if(this.selection == 2)\n this.scene.start('Board 3'); //etc...\n }", "title": "" }, { "docid": "eb24597f9e8881034f5711f8195e5b36", "score": "0.49425435", "text": "function Menu() {\n /* Create a title property for the menu */\n this.title = new GameTitle();\n\n /* TODO: Add other properties for the menus, such as player selection screen,\n * pause menu, etc.\n */\n\n this.timer = 0;\n }", "title": "" }, { "docid": "f4e31e2fa2cab24430628cd5a36a66af", "score": "0.4942541", "text": "_renderScene(sceneProps) {\n if ('1'==sceneProps.scene.route.key) {\n return (<LeftSideBar\n onPressRoute={this._onPressRoute}\n propsAll={this.props}\n />)\n }\n return (\n <Choose\n onPressRoute={this._onPressRoute}\n propsAll={this.props}\n />\n );\n }", "title": "" }, { "docid": "61ab74c9cee4be82ae34f9baad9449f0", "score": "0.49186358", "text": "renderPageScene(route,nav) {\n switch (route.screen) {\n case \"Menu\":\n return <Menu navigator = {nav} />\n case \"AboutJTC\":\n return <AboutJTC navigator = {nav} />\n case \"ContactUs\":\n return <ContactUs navigator = {nav} />\n case \"SAPMap\":\n return <SAPMap navigator = {nav} />\n case \"TenantDirectory\":\n return <TenantDirectory navigator = {nav} />\n }\n }", "title": "" }, { "docid": "79738bbbe0264f3b855014882d0f7040", "score": "0.49065349", "text": "display() {\n this.gameOrchestrator.scene.getCurrentTheme().displayScene();\n this.displayGameboard(this.gameOrchestrator.scene.getCurrentTheme());\n }", "title": "" }, { "docid": "79738bbbe0264f3b855014882d0f7040", "score": "0.49065349", "text": "display() {\n this.gameOrchestrator.scene.getCurrentTheme().displayScene();\n this.displayGameboard(this.gameOrchestrator.scene.getCurrentTheme());\n }", "title": "" }, { "docid": "1eef3a61ee96283d880c8571e0370530", "score": "0.4901122", "text": "static toMainMenu(game) {\n game.state.start('mainMenu');\n }", "title": "" }, { "docid": "6c3620c029bfe3a9622ad68017f4125b", "score": "0.48895177", "text": "getclassname() {\n return \"Slider\";\n }", "title": "" }, { "docid": "3b537dfb9d4a7ae42ea09a1c66b1eda4", "score": "0.4877358", "text": "function Main() {\n console.log(\"%c Scene Switched...\", \"color: green; font-size: 16px;\");\n // clean up\n if (currentSceneState != scenes.State.NO_SCENE) {\n currentScene.Clean();\n stage.removeAllChildren();\n }\n // switch to the new scene\n switch (config.Game.SCENE) {\n case scenes.State.START:\n console.log(\"switch to Start Scene\");\n currentScene = new scenes.Start();\n break;\n case scenes.State.INSTRUCTIONS:\n console.log(\"switch to Instruction Scene\");\n currentScene = new scenes.Instructions();\n break;\n case scenes.State.PLAY:\n console.log(\"switch to Play Scene\");\n currentScene = new scenes.Play();\n break;\n case scenes.State.END:\n console.log(\"switch to End Scene\");\n currentScene = new scenes.End();\n break;\n }\n currentSceneState = config.Game.SCENE;\n stage.addChild(currentScene);\n }", "title": "" }, { "docid": "1aefc61104a1816b1ed35916238bd96a", "score": "0.48621157", "text": "function start(){\n title.style.color = \"black\";\n console.log();\n inventory.style.display = \"none\";\n button1.style.display = \"block\";\n button2.style.display = \"block\";\n loadScene(0);\n}", "title": "" }, { "docid": "c6253475d10112402b66ce78a4af3c28", "score": "0.4860256", "text": "function Main() {\n console.log(\"%c Scene Switched...\", \"color: green; font-size: 16px;\");\n // clean up\n if (currentSceneState != scenes.State.NO_SCENE) {\n currentScene.Clean();\n stage.removeAllChildren();\n }\n // switch to the new scene\n switch (config.Game.SCENE) {\n case scenes.State.START:\n console.log(\"switch to Start Scene\");\n currentScene = new scenes.Start();\n break;\n case scenes.State.INFO:\n console.log(\"switch to Info Scene\");\n currentScene = new scenes.Info();\n break;\n case scenes.State.PLAY:\n console.log(\"switch to Play Scene\");\n currentScene = new scenes.Play();\n break;\n case scenes.State.END:\n console.log(\"switch to End Scene\");\n currentScene = new scenes.End();\n break;\n }\n currentSceneState = config.Game.SCENE;\n config.Game.CURRENT_SCENE = currentScene;\n stage.addChild(currentScene);\n }", "title": "" }, { "docid": "e404e8520aa3502681b73ca165181f1c", "score": "0.48534584", "text": "function Main() {\n console.log(\"%c Scene Switched...\", \"color: green; font-size: 16px;\");\n // clean up\n if (currentSceneState != scenes.State.NO_SCENE) {\n currentScene.removeAllChildren();\n stage.removeAllChildren();\n }\n // switch to the new scene\n switch (config.Game.SCENE) {\n case scenes.State.START:\n console.log(\"switch to Start Scene\");\n currentScene = new scenes.Start();\n break;\n case scenes.State.PLAY:\n console.log(\"switch to Play Scene\");\n currentScene = new scenes.Play();\n break;\n case scenes.State.END:\n console.log(\"switch to End Scene\");\n currentScene = new scenes.End();\n break;\n case scenes.State.TILED:\n console.log(\"switch to Tiled Scene\");\n currentScene = new scenes.TiledScene();\n break;\n }\n currentSceneState = config.Game.SCENE;\n stage.addChild(currentScene);\n }", "title": "" }, { "docid": "d102823a5b8eb441f47dfb72db329d75", "score": "0.48503157", "text": "create() {\n\n // hold music file in a variable\n music = this.sound.add('winter');\n\n // play music\n music.play();\n\n // create an interactive 'Play' button\n let button1 = this.add.sprite(170, 340, 'play');\n button1.setOrigin(0, 0);\n button1.setInteractive();\n // when clicked, stop the music and load the 'Game' scene\n button1.on('pointerdown', () => music.stop());\n button1.on('pointerdown', () => this.scene.start('Game'));\n\n // create an interactive 'Highscore' button\n let button2 = this.add.sprite(170, 480, 'high');\n button2.setOrigin(0, 0);\n button2.setInteractive();\n // when clicked, load the 'Highscore' scene\n button2.on('pointerdown', () => this.scene.start('High'));\n\n // create an interactive 'Options' button\n let button3 = this.add.sprite(170, 620, 'options');\n button3.setOrigin(0, 0);\n button3.setInteractive();\n // when clicked, load the 'Options' scene\n button3.on('pointerdown', () => this.scene.start('Options'));\n\n // create an interactive 'Help' button\n let button4 = this.add.sprite(170, 760, 'help');\n button4.setOrigin(0, 0);\n button4.setInteractive();\n // when clicked, load the 'Help' scene\n button4.on('pointerdown', () => this.scene.start('Help'));\n }", "title": "" }, { "docid": "d506ae3bbacfdd2e2db8515edccf8b35", "score": "0.48493147", "text": "function Cart (shop) {\n this.shop = shop;\n this.cartItems = [];\n}", "title": "" }, { "docid": "eb5e0cf83c982719f7e51a201527a3fe", "score": "0.48457962", "text": "static init() {\n const shop = new Shop();\n this.cart = shop.cart;\n }", "title": "" }, { "docid": "133d250e9ceb9c8f114e378f1ce0c854", "score": "0.48403627", "text": "function gsmMenu()\n\t{\n\t\tClearScreen(g_backgroundColor);\n\t\t\n\t\tAddSpriteToQueue(spriteIndices.spr_splash_logo, 0, {x:g_screensize.x / 2, y:g_screensize.y * 0.15}, 10, 1);\n\t\tAddSpriteToQueue(spriteIndices.spr_splash_cp, 0, {x:g_screensize.x / 2, y:g_screensize.y * 0.90}, 10, 1);\n\t\t\n\t\tvar str = \"start game\";\n\t\tvar len = str.length * 8;\n\t\tSpriteDrawText(str, {x:g_screensize.x / 2 - len / 2, y:g_screensize.y * 0.50}, 0, -1);\n\t\t\n\t\tstr = (g_diffStart + 1).toString();\n\t\tlen = str.length * 8;\n\t\tSpriteDrawText(str, {x:g_screensize.x * 0.8 - len / 2, y:g_screensize.y * 0.50}, 0, -1);\n\t\t\n\t\tstr = \"options\";\n\t\tlen = str.length * 8;\n\t\tSpriteDrawText(str, {x:g_screensize.x / 2 - len / 2, y:g_screensize.y * 0.60}, 0, -1);\n\t\t\n\t\tif (g_transition == 1 && !g_soundTest)\n\t\t{\n\t\t\tif (subMenuOption == 0) SpriteDrawText(\">\", {x:24, y:g_screensize.y * 0.50}, 0, -1);\n\t\t\telse SpriteDrawText(\">\", {x:24, y:g_screensize.y * 0.60}, 0, -1);\n\t\t}\n\t}", "title": "" }, { "docid": "f33a26a767a8f6c0e47ba8f5115e5865", "score": "0.48340315", "text": "function changeScene() {\n // Launch various scenes\n switch (scene) {\n case config.Scene.MENU:\n // show the MENU scene\n stage.removeAllChildren();\n menu = new scenes.Menu();\n currentScene = menu;\n console.log(\"Starting MENU Scene\");\n break;\n case config.Scene.LEVEL1:\n // show the LEVEL1 scene\n stage.removeAllChildren();\n level1 = new scenes.Level1();\n currentScene = level1;\n console.log(\"Starting LEVEL1 Scene\");\n break;\n case config.Scene.LEVEL2:\n // show the LEVEL2 scene\n stage.removeAllChildren();\n level2 = new scenes.Level2();\n currentScene = level2;\n console.log(\"Starting LEVEL2 Scene\");\n break;\n case config.Scene.LEVEL3:\n // show the LEVEL3 scene\n stage.removeAllChildren();\n level3 = new scenes.Level3();\n currentScene = level3;\n console.log(\"Starting LEVEL3 Scene\");\n break;\n case config.Scene.BONUS:\n // show the BONUS scene\n stage.removeAllChildren();\n bonus = new scenes.Bonus();\n currentScene = bonus;\n console.log(\"Starting BONUS Scene\");\n break;\n case config.Scene.END:\n // show the END scene\n stage.removeAllChildren();\n end = new scenes.End();\n currentScene = end;\n console.log(\"Starting END Scene\");\n break;\n case config.Scene.COMPLETE:\n // show the COMPLETE scene\n stage.removeAllChildren();\n complete = new scenes.Complete();\n currentScene = complete;\n console.log(\"Starting COMPLETE Scene\");\n break;\n case config.Scene.NEXTLEVEL:\n // show the NEXTLEVEL scene\n stage.removeAllChildren();\n nextlevel = new scenes.NextLevel();\n currentScene = nextlevel;\n console.log(\"Starting NEXTLEVEL Scene\");\n break;\n case config.Scene.INSTRUCTIONS:\n // show the INSTRUCTIONS scene\n stage.removeAllChildren();\n instructions = new scenes.Instructions();\n currentScene = instructions;\n console.log(\"Starting INSTRUCTIONS Scene\");\n break;\n case config.Scene.EXIT:\n // show the EXIT scene\n stage.removeAllChildren();\n exit = new scenes.Exit();\n currentScene = exit;\n console.log(\"Starting EXIT Scene\");\n break;\n }\n}", "title": "" }, { "docid": "f44bb5fe45c5818781c2ebf89c248437", "score": "0.4824691", "text": "function Main() {\n console.log(\"%c Scene Switched...\", \"color: green; font-size: 16px;\");\n // clean up\n if (currentSceneState != scenes.State.NO_SCENE) {\n currentScene.removeAllChildren();\n stage.removeAllChildren();\n }\n // switch to the new scene\n switch (config.Game.SCENE) {\n case scenes.State.START:\n console.log(\"switch to Start Scene\");\n currentScene = new scenes.Start();\n break;\n case scenes.State.PLAY:\n console.log(\"switch to Play Scene 1\");\n currentScene = new scenes.Play();\n break;\n case scenes.State.PLAY2:\n console.log(\"switch to Play Scene 2\");\n currentScene = new scenes.Play2();\n break;\n case scenes.State.PLAY3:\n console.log(\"switch to Play Scene 3\");\n currentScene = new scenes.Play3();\n break;\n case scenes.State.END:\n console.log(\"switch to End Scene\");\n currentScene = new scenes.End();\n break;\n }\n currentSceneState = config.Game.SCENE;\n stage.addChild(currentScene);\n }", "title": "" }, { "docid": "e30e79ea45c58f8ac5d1dc1061c65951", "score": "0.4820916", "text": "initMainMenu() {\n\t\t// clear the stage\n\t\tthis.stage.removeAllChildren();\n\t\t\n\t\t// set menu state\n\t\tthis.menuState = 'main';\n\t\t\n\t\tthis.mainMenuGfx = new createjs.Container();\n\t\t// add the background image\n\t\tvar background = new createjs.Shape();\n\t\tbackground.graphics.beginFill(\"#000000\").rect(0, 0, this.width, this.height);\n\t\tbackground.x = 0;\n\t\tbackground.y = 0;\n\t\tthis.mainMenuGfx.addChild(background);\n\t\t// add title text\n\t\tvar titleText = new createjs.Text(this.fullChartObject.TITLE, \"36px Arial\", \"#ffffff\");\n\t\ttitleText.x = this.width/2;\n\t\ttitleText.y = 150;\n\t\ttitleText.textAlign = \"center\";\n\t\tthis.mainMenuGfx.addChild(titleText);\n\t\t// add subtitle text\n\t\tvar subtitleText = new createjs.Text(this.fullChartObject.SUBTITLE, \"20px Arial\", \"#ffffff\");\n\t\tsubtitleText.x = this.width/2;\n\t\tsubtitleText.y = 200;\n\t\tsubtitleText.textAlign = \"center\";\n\t\tthis.mainMenuGfx.addChild(subtitleText);\n\t\t// add artist text\n\t\tvar artistText = new createjs.Text(this.fullChartObject.ARTIST, \"24px Arial\", \"#ffffff\");\n\t\tartistText.x = this.width/2;\n\t\tartistText.y = 300;\n\t\tartistText.textAlign = \"center\";\n\t\tthis.mainMenuGfx.addChild(artistText);\n\t\t// cd\n\t\tvar image = new createjs.Bitmap(\"data/cd.png\");\n\t\timage.x = this.width/2 + 130;\n\t\timage.y = 340;\n\t\tthis.mainMenuGfx.addChild(image);\n\t\t// add chart artist text\n\t\tif (this.chartConfig.chartArtist) {\n\t\t\tvar chartistText = 'Chart by ' + this.chartConfig.chartArtist;\n\t\t\tvar chartArtistText = new createjs.Text(chartistText, \"20px Arial\", \"#ffffff\");\n\t\t\tchartArtistText.x = this.width/2;\n\t\t\tchartArtistText.y = 400;\n\t\t\tchartArtistText.textAlign = \"center\";\n\t\t\tthis.mainMenuGfx.addChild(chartArtistText);\n\t\t}\n\t\t\n\t\t// settings menu button\n\t\tthis.mainMenuGfx.settingsButton = new createjs.Container();\n\t\tthis.mainMenuGfx.settingsButton.game = this;\n\t\tvar buttonX = 40;\n\t\tvar buttonY = 20;\n\t\tvar settingsButton = new createjs.Shape();\n\t\tsettingsButton.graphics.ss(1).s(\"#ffffff\").f(\"#000000\").rr(buttonX-35,buttonY-15,70,30,4,4,4,4);\n\t\tthis.mainMenuGfx.settingsButton.addChild(settingsButton);\n\t\t// settings menu button text\n\t\tvar settingsButtonText = new createjs.Text(\"Settings\", \"14px Arial\", \"#ffffff\");\n\t\tsettingsButtonText.x = buttonX;\n\t\tsettingsButtonText.y = buttonY;\n\t\tsettingsButtonText.textAlign = \"center\";\n\t\tsettingsButtonText.textBaseline = \"middle\";\n\t\tthis.mainMenuGfx.settingsButton.addChild(settingsButtonText);\n\t\t// add a click event listener\n\t\tthis.mainMenuGfx.settingsButton.addEventListener(\"click\", function(event) {\n\t\t\tvar game = event.currentTarget.game;\n\t\t\tgame.openSettings();\n\t\t});\n\t\tthis.mainMenuGfx.addChild(this.mainMenuGfx.settingsButton);\n\t\t\n\t\t// play menu button\n\t\tthis.mainMenuGfx.playButton = new createjs.Container();\n\t\tthis.mainMenuGfx.playButton.game = this;\n\t\tthis.mainMenuGfx.playButton.x = this.width-40;\n\t\tthis.mainMenuGfx.playButton.y = 20;\n\t\tvar playButton = new createjs.Shape();\n\t\tplayButton.graphics.ss(1).s(\"#ffffff\").f(\"#000000\").rr(-35,-15,70,30,4,4,4,4);\n\t\tthis.mainMenuGfx.playButton.addChild(playButton);\n\t\t// settings menu button text\n\t\tvar playButtonText = new createjs.Text(\"Play\", \"14px Arial\", \"#ffffff\");\n\t\tplayButtonText.textAlign = \"center\";\n\t\tplayButtonText.textBaseline = \"middle\";\n\t\tthis.mainMenuGfx.playButton.addChild(playButtonText);\n\t\t// add a click event listener\n\t\tthis.mainMenuGfx.playButton.addEventListener(\"click\", function(event) {\n\t\t\tvar game = event.currentTarget.game;\n\t\t\tgame.startGame();\n\t\t\tgame.level.reset();\n\t\t});\n\t\tthis.mainMenuGfx.addChild(this.mainMenuGfx.playButton);\n\t\t\n\t\t// download file button\n\t\t// add only if the download URL exists\n\t\tif (this.downloadURL !== -1) {\n\t\t\tthis.mainMenuGfx.downloadButton = new createjs.Container();\n\t\t\tthis.mainMenuGfx.downloadButton.game = this;\n\t\t\tthis.mainMenuGfx.downloadButton.x = 55;\n\t\t\tthis.mainMenuGfx.downloadButton.y = this.height-20;\n\t\t\tvar downloadButton = new createjs.Shape();\n\t\t\tdownloadButton.graphics.ss(1).s(\"#ffffff\").f(\"#000000\").rr(-50,-15,100,30,4,4,4,4);\n\t\t\tthis.mainMenuGfx.downloadButton.addChild(downloadButton);\n\t\t\t// settings menu button text\n\t\t\tvar downloadButtonText = new createjs.Text(\"Download File\", \"14px Arial\", \"#ffffff\");\n\t\t\tdownloadButtonText.textAlign = \"center\";\n\t\t\tdownloadButtonText.textBaseline = \"middle\";\n\t\t\tthis.mainMenuGfx.downloadButton.addChild(downloadButtonText);\n\t\t\t// add a click event listener\n\t\t\tthis.mainMenuGfx.downloadButton.addEventListener(\"click\", function(event) {\n\t\t\t\tvar game = event.currentTarget.game;\n\t\t\t\twindow.open(game.downloadURL, '_blank');\n\t\t\t});\n\t\t\tthis.mainMenuGfx.addChild(this.mainMenuGfx.downloadButton);\n\t\t}\n\t\t\n\t\t// add everything to the stage and update\n\t\tthis.stage.addChild(this.mainMenuGfx);\n\t\tthis.stage.update();\n\t}", "title": "" }, { "docid": "4c2236dd846cdedf551d46f6b11a2f3b", "score": "0.4816677", "text": "function AlleyGo() {\n\tscreen.setScene(4);\n\tscreen.setEndGame();\n}", "title": "" }, { "docid": "736e0e6ee53a9db8ac08788c455d49d1", "score": "0.48155242", "text": "renderScene(route, navigator) {\n switch (route.id) {\n case 'CalculatorPage':\n return (\n <Calculator navigator={navigator}/>\n );\n break;\n case 'SettingPage':\n return (<Setting navigator={navigator}/>\n );\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "4095f087c9d9c4aa56ea35626b18ca6b", "score": "0.4812257", "text": "function C999_Common_GameLoad_MainMenu() {\n\tSetScene(\"C000_Intro\", \"ChapterSelect\");\n}", "title": "" }, { "docid": "42990920b546be03ce537679980e446c", "score": "0.48070264", "text": "constructor(shopDB) {\n\t\tthis.shop = shopDB;\n\t\tthis.board = new GameBoard();\n\t}", "title": "" }, { "docid": "836f22aac175049664af1721e62593e1", "score": "0.4806681", "text": "get scenes() { return this._engine.scenes; }", "title": "" }, { "docid": "6bd5ce74b5d6f7ad4fd41828fe175ebd", "score": "0.4805356", "text": "function initMenu(scene) {\n vjs.ProjectionSelector = vjs.MenuButton.extend({\n init: function(player, options) {\n player.projections = options.projections || [];\n vjs.MenuButton.call(this, player, options);\n }\n });\n\n //Top Item - not selectable\n vjs.ProjectionTitleMenuItem = vjs.MenuItem.extend({\n init: function(player, options) {\n vjs.MenuItem.call(this, player, options);\n this.off('click'); //no click handler\n }\n });\n\n //Menu Item\n vjs.ProjectionMenuItem = vjs.MenuItem.extend({\n init: function(player, options){\n options.label = options.projection;\n options.selected = (options.projection === player.currentProjection);\n vjs.MenuItem.call(this, player, options);\n this.projection = options.projection;\n this.on('click', this.onClick);\n player.on('changeProjection', vjs.bind(this, function() {\n this.selected(this.projection === player.currentProjection);\n }));\n }\n });\n\n // Handle clicks on the menu items\n vjs.ProjectionMenuItem.prototype.onClick = function() {\n var player = this.player(),\n button_nodes = player.controlBar.projectionSelection.el().firstChild.children,\n button_node_count = button_nodes.length;\n\n // Save the newly selected projection in our player options property\n scene.changeProjection(this.projection);\n\n // Update the button text\n while ( button_node_count > 0 ) {\n button_node_count--;\n if ( 'vjs-current-projection' === button_nodes[button_node_count].className ) {\n button_nodes[button_node_count].innerHTML = this.projection;\n break;\n }\n }\n };\n\n // Create a menu item for each available projection\n vjs.ProjectionSelector.prototype.createItems = function() {\n var player = this.player(),\n items = [];\n\n // Add the menu title item\n items.push(new vjs.ProjectionTitleMenuItem(player, {\n el: vjs.Component.prototype.createEl('li', {\n className: 'vjs-menu-title vjs-projection-menu-title',\n innerHTML: 'Projections'\n })\n }));\n\n // Add an item for each available projection\n player.projections.forEach(function (projection) {\n items.push(new vjs.ProjectionMenuItem(player, {\n projection: projection\n }));\n });\n\n return items;\n };\n }", "title": "" }, { "docid": "9ec6565b750dccd49b75eb44444761d9", "score": "0.48035464", "text": "constructor() {\n super({ key: \"lobbyScene\" });\n }", "title": "" }, { "docid": "f5634bf7eb433eaa95658f8e6b0f0d49", "score": "0.47978142", "text": "function GameScene() {\n Scene.call(this, 'game-scene');\n this.cthun = new Cthun();\n this.hero = new Hero();\n this.arena = new SceneObject('arena', 'janez');\n this.gameFinished = false;\n\n // columns generation\n this.columns = [];\n var columnsNumber = 10;\n\n this.columns.push(new Column(10, 0 * 480 / columnsNumber));\n this.columns.push(new Column(14, (1/2) * 480 / columnsNumber));\n this.columns.push(new Column(20, (1.2) * 480 / columnsNumber));\n this.columns.push(new Column(28, (1.6) * 480 / columnsNumber));\n this.columns.push(new Column(38, (2.1) * 480 / columnsNumber));\n this.columns.push(new Column(48, (2.5) * 480 / columnsNumber));\n this.columns.push(new Column(50, (3) * 480 / columnsNumber));\n this.columns.push(new Column(50, (3.5) * 480 / columnsNumber));\n\n // array that tells which key is pressed\n this.wasd = [false, false, false, false];\n\n // Global variable of starting time.\n this.startTime = new Date();\n\n // Play the music\n backgroundMusic.play();\n}", "title": "" }, { "docid": "59dd1753a36d9a6d54ffc15f00a00939", "score": "0.4797445", "text": "constructor(){\r\n console.log(\"Scene:1\");\r\n SceneManager.instance = this;\r\n console.log(\"Scene:2\");\r\n }", "title": "" }, { "docid": "2a3f6f0913658df1e0e4d070924dc8c4", "score": "0.47940737", "text": "function startNewGame() {\n\tscene = new Scene(0); // erzeugt Scene Object\n\tscene.start();\n}", "title": "" }, { "docid": "1bd01903ada4e990095b8809afee53dc", "score": "0.47911692", "text": "function PBScenePauseMenu() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "6f857d5829960b9094a7a7029d85af3f", "score": "0.47894117", "text": "function Start() {\n console.log(\"%c Game Started!\", \"color: blue; font-size: 20px; font-weight: bold;\");\n stage = new createjs.Stage(canvas);\n createjs.Ticker.framerate = config.Game.FPS;\n createjs.Ticker.on('tick', Update);\n stage.enableMouseOver(20);\n currentSceneState = scenes.State.NO_SCENE;\n config.Game.SCENE = scenes.State.START;\n }", "title": "" }, { "docid": "b05348ad4e8d8265f50b86a9279e36f9", "score": "0.47891995", "text": "function getSceneByAction(action) {\n var root = action.getRoot();\n var scene = root.type == \"Scene\" ? root : null;\n root.traverseAncestors(function(ancObj) {\n if (ancObj.type == \"Scene\") {\n scene = ancObj;\n }\n });\n return scene;\n}", "title": "" } ]
33aac09e1774ea057bfd73f3a70650b3
Augment an target Object or Array by defining hidden properties. / istanbul ignore next
[ { "docid": "e19cac41ec8668f745d91dbf91e2f34f", "score": "0.0", "text": "function copyAugment (target, src, keys) {\n for (var i = 0, l = keys.length; i < l; i++) {\n var key = keys[i];\n def(target, key, src[key]);\n }\n}", "title": "" } ]
[ { "docid": "754bd7ba40ecf1903344d40ccd31d765", "score": "0.6272572", "text": "function borderLayoutvue_type_script_lang_js_objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n borderLayoutvue_type_script_lang_js_defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}", "title": "" }, { "docid": "b0b11c4696289551de38e34903f878f1", "score": "0.60110366", "text": "function extend(target) {\n var objs = Array.prototype.slice.call(arguments, 1);\n objs.forEach(function (obj) {\n var props = Object.getOwnPropertyNames(obj);\n props.forEach(function (key) {\n target[key] = obj[key];\n });\n });\n return target;\n }", "title": "" }, { "docid": "91d2cbe2b1a2af71eadf363a6c2e5329", "score": "0.5852426", "text": "extend(target, source) {\n return Object.getOwnPropertyNames(source)\n .reduce((t, v) => {\n t[v] = source[v];\n return t;\n }, target);\n }", "title": "" }, { "docid": "1a4b17827687e40e4ff23f33790fe4a5", "score": "0.57229626", "text": "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "title": "" }, { "docid": "1a4b17827687e40e4ff23f33790fe4a5", "score": "0.57229626", "text": "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "title": "" }, { "docid": "54a14812043e34a4e624e8d097f5c9fc", "score": "0.57042736", "text": "function setHiddenProp(target, prop, value) {\n if (!Object.hasOwnProperty.call(target, prop)) {\n Object.defineProperty(target, prop, {\n enumerable: false,\n configurable: true,\n writable: true,\n value: value\n });\n } else {\n target[prop] = value;\n }\n}", "title": "" }, { "docid": "54a14812043e34a4e624e8d097f5c9fc", "score": "0.57042736", "text": "function setHiddenProp(target, prop, value) {\n if (!Object.hasOwnProperty.call(target, prop)) {\n Object.defineProperty(target, prop, {\n enumerable: false,\n configurable: true,\n writable: true,\n value: value\n });\n } else {\n target[prop] = value;\n }\n}", "title": "" }, { "docid": "54a14812043e34a4e624e8d097f5c9fc", "score": "0.57042736", "text": "function setHiddenProp(target, prop, value) {\n if (!Object.hasOwnProperty.call(target, prop)) {\n Object.defineProperty(target, prop, {\n enumerable: false,\n configurable: true,\n writable: true,\n value: value\n });\n } else {\n target[prop] = value;\n }\n}", "title": "" }, { "docid": "5a5ea47eb2b6677eddd62b29d7af2067", "score": "0.56739956", "text": "function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { format_defineProperty(target, key, source[key]); }); } return target; }", "title": "" }, { "docid": "e6196c18c2cc1a3e4f81f08478349abc", "score": "0.5669813", "text": "function protoAugment (target, src, keys) {\r\n /* eslint-disable no-proto */\r\n target.__proto__ = src;\r\n /* eslint-enable no-proto */\r\n}", "title": "" }, { "docid": "5138b321c782496c23257bfdff9447e0", "score": "0.5669229", "text": "function extendWithNew(target, obj) {\r\n properties(obj).forEach( function(prop) {\r\n if (target[prop]===undefined) target[prop] = obj[prop];\r\n });\r\n}", "title": "" }, { "docid": "94952cabc1232de28cf1a29273775242", "score": "0.5666263", "text": "function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { entry_defineProperty(target, key, source[key]); }); } return target; }", "title": "" }, { "docid": "12e75e4d2c83867480bacc0685282d57", "score": "0.5655991", "text": "function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }", "title": "" }, { "docid": "12e75e4d2c83867480bacc0685282d57", "score": "0.5655991", "text": "function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "97b35102a637fbc90debd6a599016cfd", "score": "0.5586096", "text": "function protoAugment (target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "5db22bad3253fb0e66b79ec0991ff189", "score": "0.558045", "text": "function softCopyProperties(source, target) {\n _Object__WEBPACK_IMPORTED_MODULE_6__[\"each\"](source, function (key, value) {\n // only if value is set\n if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"hasValue\"](value) && !(_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"hasValue\"](target[key]))) {\n target[key] = value;\n }\n });\n return target;\n}", "title": "" }, { "docid": "9aa69b3e56e1fd4c89bf9de30cc3c297", "score": "0.55761546", "text": "function forward(obj, target, onlyAccessors) {\n onlyAccessors = onlyAccessors || false;\n for (var k in target) {\n (function(k) {\n if (typeof(target[k]) == 'function') {\n if (!onlyAccessors) {\n obj[k] = target[k].bind(target);\n }\n } else {\n Object.defineProperty(obj, k, {\n get: function() { return target[k]; },\n set: function(x) { target[k] = x; }\n });\n }\n })(k);\n }\n}", "title": "" }, { "docid": "85ca5c255f1eea0eee68a94b4857c3d4", "score": "0.557591", "text": "function deepMixIn(target, objects) {\n\t var i = 0,\n\t n = arguments.length,\n\t obj;\n\n\t while(++i < n){\n\t obj = arguments[i];\n\t if (obj) {\n\t forOwn(obj, copyProp, target);\n\t }\n\t }\n\n\t return target;\n\t }", "title": "" }, { "docid": "d905f135cf7cf49d14f91af11de5f23b", "score": "0.5567282", "text": "function protoAugment(target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "d457fb5f9715caaf3ee0f76ca163aa7f", "score": "0.5564962", "text": "static iextend(obj) {\n // eslint-disable-next-line prefer-rest-params\n each(slice.call(arguments, 1), function (source) {\n for (let prop in source) {\n if ({}.hasOwnProperty.call(source, prop)) {\n obj[prop] = source[prop];\n }\n }\n });\n return obj;\n }", "title": "" }, { "docid": "7c63bc025f4a6c8d7e298d6e67429dcd", "score": "0.55583555", "text": "function protoAugment(target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "7c63bc025f4a6c8d7e298d6e67429dcd", "score": "0.55583555", "text": "function protoAugment(target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "7c63bc025f4a6c8d7e298d6e67429dcd", "score": "0.55583555", "text": "function protoAugment(target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "7c63bc025f4a6c8d7e298d6e67429dcd", "score": "0.55583555", "text": "function protoAugment(target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "7c63bc025f4a6c8d7e298d6e67429dcd", "score": "0.55583555", "text": "function protoAugment(target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "7c63bc025f4a6c8d7e298d6e67429dcd", "score": "0.55583555", "text": "function protoAugment(target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "7c63bc025f4a6c8d7e298d6e67429dcd", "score": "0.55583555", "text": "function protoAugment(target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "7c63bc025f4a6c8d7e298d6e67429dcd", "score": "0.55583555", "text": "function protoAugment(target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "e3a610eb5569b73cf0ea30778161d8a4", "score": "0.5551403", "text": "function protoAugment(target, src, keys) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "10241ada28194c26d9ba700f796f1473", "score": "0.55226904", "text": "function extend(target, obj) {\n var i,\n toStr = Object.prototype.toString,\n aStr = \"[object Array]\";\n\n target = target || {};\n\n for (i in obj) {\n if (obj.hasOwnProperty(i)) {\n if (typeof obj[i] === \"object\") {\n target[i] = (toStr.call(obj[i]) === aStr) ? [] : {};\n extend(obj[i], target[i]);\n } else {\n target[i] = obj[i];\n }\n }\n }\n\n return target;\n }", "title": "" }, { "docid": "bf6bb8fadc59512d1623ffe7369e97ef", "score": "0.5504338", "text": "function protoAugment (target, src, keys) {\n\t /* eslint-disable no-proto */\n\t target.__proto__ = src;\n\t /* eslint-enable no-proto */\n\t}", "title": "" }, { "docid": "f8ab4e8af376baa0d1360b7aadda2221", "score": "0.55030113", "text": "function extend(target, source, noOverwrite, filter) {\r\n if (noOverwrite === void 0) { noOverwrite = false; }\r\n if (filter === void 0) { filter = function () { return true; }; }\r\n if (!objectDefinedNotNull(source)) {\r\n return target;\r\n }\r\n // ensure we don't overwrite things we don't want overwritten\r\n var check = noOverwrite ? function (o, i) { return !(i in o); } : function () { return true; };\r\n // final filter we will use\r\n var f = function (v) { return check(target, v) && filter(v); };\r\n return Object.getOwnPropertyNames(source)\r\n .filter(f)\r\n .reduce(function (t, v) {\r\n t[v] = source[v];\r\n return t;\r\n }, target);\r\n}", "title": "" }, { "docid": "2595794a21c9a068c69a9867417fb849", "score": "0.5490938", "text": "function safeMixin(target, source){\n\t\tvar name, t, i = 0, l = d._extraNames.length;\n\t\t// add props adding metadata for incoming functions skipping a constructor\n\t\tfor(name in source){\n\t\t\tt = source[name];\n\t\t\tif((t !== op[name] || !(name in op)) && name != cname){\n\t\t\t\tif(opts.call(t) == \"[object Function]\"){\n\t\t\t\t\t// non-trivial function method => attach its name\n\t\t\t\t\tt.nom = name;\n\t\t\t\t}\n\t\t\t\ttarget[name] = t;\n\t\t\t}\n\t\t}\n\t\t// process unenumerable methods on IE\n\t\tfor(; i < l; ++i){\n\t\t\tname = d._extraNames[i];\n\t\t\tt = source[name];\n\t\t\tif((t !== op[name] || !(name in op)) && name != cname){\n\t\t\t\tif(opts.call(t) == \"[object Function]\"){\n\t\t\t\t\t// non-trivial function method => attach its name\n\t\t\t\t\tt.nom = name;\n\t\t\t\t}\n\t\t\t\ttarget[name] = t;\n\t\t\t}\n\t\t}\n\t\treturn target;\n\t}", "title": "" }, { "docid": "ec3ef02e6948d568972562b1525a3de8", "score": "0.54796576", "text": "function protoAugment(target, src, keys) {\n\t /* eslint-disable no-proto */\n\t target.__proto__ = src;\n\t /* eslint-enable no-proto */\n\t}", "title": "" }, { "docid": "ec3ef02e6948d568972562b1525a3de8", "score": "0.54796576", "text": "function protoAugment(target, src, keys) {\n\t /* eslint-disable no-proto */\n\t target.__proto__ = src;\n\t /* eslint-enable no-proto */\n\t}", "title": "" }, { "docid": "ddb2c4ccd5a2dbfbd0703cb999d205a5", "score": "0.54747534", "text": "function extend (target, source) {\n for(prop in source) {\n target[prop] = source[prop];\n }\n return target;\n }", "title": "" }, { "docid": "a259cfffdda58ff197415dd4d76b16d5", "score": "0.54681164", "text": "function extend(target, obj) {\r\n properties(obj).forEach( function(prop) {\r\n target[prop] = obj[prop];\r\n });\r\n}", "title": "" }, { "docid": "a49d96af181d4886d708f37bee524090", "score": "0.5465863", "text": "function deepMixIn(target, objects) {\n var i = 0,\n n = arguments.length,\n obj;\n\n while(++i < n){\n obj = arguments[i];\n if (obj) {\n forOwn(obj, copyProp, target);\n }\n }\n\n return target;\n }", "title": "" }, { "docid": "a49d96af181d4886d708f37bee524090", "score": "0.5465863", "text": "function deepMixIn(target, objects) {\n var i = 0,\n n = arguments.length,\n obj;\n\n while(++i < n){\n obj = arguments[i];\n if (obj) {\n forOwn(obj, copyProp, target);\n }\n }\n\n return target;\n }", "title": "" }, { "docid": "31897cf85fcaf473f82afe43abec984d", "score": "0.54552627", "text": "function Extend(target, source){\r\n if((target) && (source) && (typeof source == 'object')) {\r\n for(var property in source) {\r\n if (source.hasOwnProperty(property)) {\r\n try { target[property] = source[property]; } catch (exception) { ; }\r\n }\r\n }\r\n }\r\n return target;\r\n}", "title": "" }, { "docid": "544ee50849e6063761094d23513cdc55", "score": "0.54547656", "text": "function mixin (target, ...sources){\n Object.assign(target, ...sources); //... here is the spread operator. ie to spread array element got from rest operator\n\n}", "title": "" }, { "docid": "0e277ac5dfc36fd918e939a2424aa0e4", "score": "0.54459095", "text": "function extend(target, source, args) {\n var exclude = {};\n \n if (args && args.exclude) {\n for (var i = 0; i < args.exclude.length; ++i) {\n exclude[args.exclude[i]] = true;\n }\n }\n\n for (var prop in source) {\n if (!args || !exclude.hasOwnProperty(prop)) {\n target[prop] = source[prop];\n }\n }\n\n return target;\n }", "title": "" }, { "docid": "adbad5b48f05cf043340af710d7059a4", "score": "0.54421145", "text": "function deepExtend(target, source) {\n if (!(source instanceof Object)) {\n return source;\n }\n switch (source.constructor) {\n case Date:\n return new Date(source.getTime());\n // Treat Dates like scalars; if the target date object had any child\n // properties - they will be lost!\n\n case Object:\n if (target === undefined) {\n target = {};\n }\n break;\n case Array:\n // Always copy the array source and overwrite the target.\n target = [];\n break;\n default:\n // Not a plain Object - treat it as a scalar.\n return source;\n }\n for (var prop in source) {\n if (!source.hasOwnProperty(prop)) {\n continue;\n }\n target[prop] = deepExtend(target[prop], source[prop]);\n }\n return target;\n}", "title": "" }, { "docid": "adbad5b48f05cf043340af710d7059a4", "score": "0.54421145", "text": "function deepExtend(target, source) {\n if (!(source instanceof Object)) {\n return source;\n }\n switch (source.constructor) {\n case Date:\n return new Date(source.getTime());\n // Treat Dates like scalars; if the target date object had any child\n // properties - they will be lost!\n\n case Object:\n if (target === undefined) {\n target = {};\n }\n break;\n case Array:\n // Always copy the array source and overwrite the target.\n target = [];\n break;\n default:\n // Not a plain Object - treat it as a scalar.\n return source;\n }\n for (var prop in source) {\n if (!source.hasOwnProperty(prop)) {\n continue;\n }\n target[prop] = deepExtend(target[prop], source[prop]);\n }\n return target;\n}", "title": "" }, { "docid": "54bfd776e111f58a49c78fe00101f991", "score": "0.5441188", "text": "function extend(target, obj) {\n properties(obj).forEach( function(prop) {\n target[prop] = obj[prop];\n });\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.54325736", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.54325736", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.54325736", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.54325736", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.54325736", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.54325736", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" } ]
1aab1d3c40f77edea43f9277203504ef
Applies selection to the indicated molecule, depending on whether it matched the criteria.
[ { "docid": "cb0517afb54bbe84cef49dcdbd7bf976", "score": "0.7520317", "text": "function ApplySelectionCriteria(molnum, srchcmp, isequal)\n{\n if (srchcmp == 'Replace') {\n\tSelectMolecule(molnum, isequal);\n } else if (srchcmp == 'Extend') {\n\tSelectMolecule(molnum, isequal || IsMoleculeSelected(molnum));\n } else if (srchcmp == 'Filter') {\n\tSelectMolecule(molnum, isequal && IsMoleculeSelected(molnum));\n } else if (srchcmp == 'Deselect') {\n\tSelectMolecule(molnum, !isequal && IsMoleculeSelected(molnum));\n }\n}", "title": "" } ]
[ { "docid": "658bd70a214f123c86dad4c792578c88", "score": "0.56381005", "text": "_calculate_selection() {\n\n this.selection_model.geometry.vertices.forEach(v => v.z = 0);\n\n let bounding_box_height = 100; // FIXME: should be safe\n let bbox = new THREE.Box3().setFromObject(this.selection_model);\n\n // calculate all intersecting actors\n let hits = this.actors.filter(x => {\n\n let b = new THREE.Box3().setFromObject(x.mesh);\n\n // change the actors bounding boxes to go pretty high in the Z-axis\n // so the selection model will definitely intersect it\n b.expandByVector(new THREE.Vector3(0, 0, bounding_box_height));\n\n return bbox.isIntersectionBox(b);\n });\n\n this.emit(\"selection\", hits);\n\n }", "title": "" }, { "docid": "2ef0e27f54c6271984384c62a282e0df", "score": "0.5276377", "text": "function match() {\n let selected = document.querySelectorAll('.selected');\n selected.forEach(function(card) {\n card.classList.add('match');\n disable();\n });\n}", "title": "" }, { "docid": "4eedf724dda1f5ca17cd978530f91b2a", "score": "0.5109954", "text": "function matchSelected() {\n // get currently selected option\n selected = select.options[select.selectedIndex];\n select.className = selected.className;\n }", "title": "" }, { "docid": "1423782c414c854166e3e8da0bc0be8a", "score": "0.5054906", "text": "function data_SearchEquality()\n{\n var srchfld = Node(\"data_numfld\").value;\n if (!srchfld) { // (IE6 hack)\n \tvar sel = Node(\"data_numfld\").getElementsByTagName(\"option\");\n\tfor (var n = 0; n < sel.length; n++) {\n\t if (sel[n].selected) srchfld = sel[n].text;\n\t}\n }\n\n var srchval = Node(\"data_numval\").value;\n var srchtol = Node(\"data_numtol\").value;\n var srchcmp = Node(\"data_applyrepl\").checked ? 'Replace' :\n\t Node(\"data_applyext\").checked ? 'Extend' :\n\t Node(\"data_applyfilt\").checked ? 'Filter' :\n\t\t\t\t\t\t 'Deselect';\n if (srchval.length == 0) {\n\talert(\"Enter something in the search value field first.\");\n\treturn;\n }\n \n srchval = parseFloat(srchval);\n srchtol = Math.abs(parseFloat(srchtol));\n if (isNaN(srchtol)) srchtol = 0;\n\n var actnum = 0;\n for (var n = 1; n <= num_activities; n++) {\n\tif (activity_name[n-1] == srchfld) {\n\t actnum = n;\n\t break;\n\t}\n }\n\n for (var n = 1; n <= num_molecules; n++) {\n\tvar molval = activity_value[n-1][actnum-1];\n\tif (molval == '#') continue; // null means do nothing\n\t\n\tvar tol = srchtol == 0 ? molval*1E-13 : srchtol;\n\tvar isequal = molval >= srchval-tol && molval <= srchval+tol;\n\tApplySelectionCriteria(n, srchcmp, isequal);\n }\n \n \t// Replace the content.\n \n ReplaceContent();\n}", "title": "" }, { "docid": "62954ad8e56770f1a3458e084c4856d7", "score": "0.50389636", "text": "function setSelection(){\r\n\t\t\tif (opts.idField){\r\n\t\t\t\tfor(var i=0; i<data.rows.length; i++){\r\n\t\t\t\t\tvar row = data.rows[i];\r\n\t\t\t\t\tif (contains(state.selectedRows, row)){\r\n\t\t\t\t\t\topts.finder.getTr(target, i).addClass('datagrid-row-selected');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (contains(state.checkedRows, row)){\r\n\t\t\t\t\t\topts.finder.getTr(target, i).find('div.datagrid-cell-check input[type=checkbox]')._propAttr('checked', true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfunction contains(a,r){\r\n\t\t\t\tfor(var i=0; i<a.length; i++){\r\n\t\t\t\t\tif (a[i][opts.idField] == r[opts.idField]){\r\n\t\t\t\t\t\ta[i] = r;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "1e401b06c83e2bee495cee2fcaba14a5", "score": "0.48504707", "text": "function data_SelectionView()\n{\n var molidx = new Array();\n for (var n = 1; n <= num_molecules; n++) {\n\tif (IsMoleculeSelected(n)) molidx.push(n);\n }\n if (molidx.length == 0) {\n\talert(\"Select some molecules first.\");\n\treturn;\n }\n PopupPersistentMolecules(molidx, null);\n}", "title": "" }, { "docid": "e4b2a12cf7914954086f38ab0e23ba3e", "score": "0.48228875", "text": "function matchingEngine() {\n updateScoreBoard();\n if (selectedElements[0][0].firstChild.className == selectedElements[1][0].firstChild.className) {\n $(selectedElements[1]).addClass('open show match');\n $(selectedElements[0]).addClass('match');\n $(selectedElements[1]).off('click');\n matchFound();\n selectedElements = [];\n } else {\n $(selectedElements[1]).addClass('open show nomatch');\n $(selectedElements[0]).addClass('nomatch');\n setTimeout(() => {\n $(selectedElements[1]).removeClass('open show nomatch');\n $(selectedElements[0]).removeClass('open show nomatch');\n $(selectedElements[0]).on('click', onClickEvent);\n selectedElements = [];\n }, 800);\n }\n}", "title": "" }, { "docid": "5b039242942eee4dfbef907c65b069bf", "score": "0.48183668", "text": "selectCircle(x, y) {\n \tvar foundCircle = false;\n var that = this;\n this.shapes.circles.forEach(function(circle) {\n if (that.inCircle(x, y, circle)) {\n \tfoundCircle = circle;\n }\n });\n return foundCircle;\n }", "title": "" }, { "docid": "f1562d68c2dea7cdb1e477971a93a19b", "score": "0.48112214", "text": "function selectItemOnMatch () {\n var searchText = $scope.searchText,\n matches = ctrl.matches,\n item = matches[ 0 ];\n if (matches.length === 1) getDisplayValue(item).then(function (displayValue) {\n var isMatching = searchText === displayValue;\n if ($scope.matchInsensitive && !isMatching) {\n isMatching = searchText.toLowerCase() === displayValue.toLowerCase();\n }\n\n if (isMatching) {\n select(0);\n }\n });\n }", "title": "" }, { "docid": "3f68940d6b7107bb374de6a61b5a12ab", "score": "0.48025382", "text": "function selectItemOnMatch () {\n var searchText = $scope.searchText,\n matches = ctrl.matches,\n item = matches[ 0 ];\n if (matches.length === 1) getDisplayValue(item).then(function (displayValue) {\n var isMatching = searchText == displayValue;\n if ($scope.matchInsensitive && !isMatching) {\n isMatching = searchText.toLowerCase() == displayValue.toLowerCase();\n }\n\n if (isMatching) select(0);\n });\n }", "title": "" }, { "docid": "3f68940d6b7107bb374de6a61b5a12ab", "score": "0.48025382", "text": "function selectItemOnMatch () {\n var searchText = $scope.searchText,\n matches = ctrl.matches,\n item = matches[ 0 ];\n if (matches.length === 1) getDisplayValue(item).then(function (displayValue) {\n var isMatching = searchText == displayValue;\n if ($scope.matchInsensitive && !isMatching) {\n isMatching = searchText.toLowerCase() == displayValue.toLowerCase();\n }\n\n if (isMatching) select(0);\n });\n }", "title": "" }, { "docid": "0875a3892c5875ddfa056bc7fe7eda1c", "score": "0.48008993", "text": "function contentMatchesInput(selection, content){\n for (var i = 0 ; i < selection.length; i++) {\n if($.inArray(selection[i], content) == -1) return false;\n }\n return true;\n }", "title": "" }, { "docid": "2e34642db2c8fafc4dee5e826d8ffd2f", "score": "0.47841436", "text": "function highlightSelected()\n\t{\n\t\t// selected pileups (mutations) on the diagram\n\t\tvar selected = getSelectedPileups();\n\n\t\t// highlight residues\n\t\thighlight3dResidues(selected);\n\t}", "title": "" }, { "docid": "da149fe4a640cccc916c7862a1a14a9e", "score": "0.47673845", "text": "function selectItemOnMatch () {\n var searchText = $scope.searchText,\n matches = ctrl.matches,\n item = matches[ 0 ];\n if (matches.length === 1) getDisplayValue(item).then(function (displayValue) {\n if (searchText == displayValue) select(0);\n });\n }", "title": "" }, { "docid": "91300ac842bb55113d5bf50850a81c8e", "score": "0.47559705", "text": "function add_selected_class() {\n if(clicked.piece != '' & clicked.piece != null){\n selection = clicked;\n console.log('updated selection to clicked spot');\n }\n\n // remove the \"selected\" class from the last selection\n if (last_selector != '') {\n last_selector.removeClass(\"selected\");\n }\n\n\n\n //if selection is defined add the \"selected\" class to the div that was clicked\n if (clicked.piece != '') {\n\n \n last_selector = selector;\n\n selector = $(\"[column=\" + selection.col + \"][row=\" + selection.row + \"]\");\n\n selector.addClass(\"selected\");\n\n // how to update the piece on the newly clicked square\n // selector.attr(\"piece\", \"b_queen\");\n\n // remove the \"selected\" class from the last selection\n if (last_selector != '') {\n last_selector.removeClass(\"selected\");\n remove_moves = true;\n }\n\n piece= true;\n \n\n }\n\n // update last selector to remove \"selected\" class\n\n}", "title": "" }, { "docid": "ffc43ab87392c3f9c61697777c3ec676", "score": "0.4745191", "text": "function checkSelection(address){\n var i = address.iAddress;\n var j = address.jAddress;\n if (selectionOne.found && selectionTwo.found){\n selectionOne.found = false;\n selectionTwo.found = false;\n }\n if (selectionOne.found){\n if (address.found){\n if ((selectionOne.xCoord === i && selectionOne.yCoord === j) || (selectionTwo.found && selectionTwo.xCoord === i && selectionTwo.yCoord === j)){\n selectionOne.found = false;\n selectionTwo.found = false;\n } else {\n var compatible = detectCompatibleSelection(address);\n if (compatible){\n selectionTwo.xCoord = i;\n selectionTwo.yCoord = j;\n selectionTwo.letter = address.letter;\n selectionTwo.found = true;\n } else {\n selectionOne.xCoord = i;\n selectionOne.yCoord = j;\n selectionOne.letter = address.letter;\n selectionOne.found = true;\n }\n // Test if the address found is compatible with selectionOne. In other words, is it on the same x OR y OR is it diagonal. Apply selectionTwo if so, if not, change selectionOne\n }\n }\n } else {\n if (address.found){\n selectionOne.xCoord = i;\n selectionOne.yCoord = j;\n selectionOne.letter = address.letter;\n selectionOne.found = true;\n }\n }\n}", "title": "" }, { "docid": "5d4e126fa48d2689392c38248de990f0", "score": "0.47269586", "text": "select(...cells) {\n let selection_changed = false;\n // The selection set is treated immutably, so we duplicate it here to\n // ensure that existing references to the selection are not modified.\n this.selection = new Set(this.selection);\n for (const cell of cells) {\n if (!this.selection.has(cell)) {\n this.selection.add(cell);\n cell.select();\n selection_changed = true;\n }\n }\n if (selection_changed) {\n this.panel.update(this);\n this.toolbar.update(this);\n }\n }", "title": "" }, { "docid": "b7b7a760f94995fca700265fcc97a954", "score": "0.47218198", "text": "_populateSubset() {\n const { model } = this;\n if (!model) {\n return false;\n }\n const items = this.node.querySelectorAll(`.${ITEM_CLASS}`);\n const subset = Private.commonSubset(Private.itemValues(items));\n const { query } = model;\n // If a common subset exists and it is not the current query, highlight it.\n if (subset && subset !== query && subset.indexOf(query) === 0) {\n model.query = subset;\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "c022c3212ed3f9683b658374bd322370", "score": "0.47122782", "text": "test() {\n if (this.selected.text) {\n var pattern = new RegExp('SAMPLE', 'g');\n var testArray = [];\n var index = -1;\n var foundMod;\n var modded = false;\n\n // replaces new array's 'SAMPLE' with the currently\n // selected text for testing.\n // mods.forEach(function(d) {\n // testArray.push(d.replace(pattern, this.selected.text));\n // });\n [for (i of this.mods.values()) testArray.push(i.replace(pattern, this.selected.text))]\n var length = testArray.length;\n\n // Searches for a matching markdown, if found sets\n // currentMod variable to the discovered md.\n while (++index < length) {\n var mIndex = testArray[index].indexOf(this.selected.text);\n var modStart = testArray[index].slice(0, mIndex);\n var doesStart = this.el.value.slice(0, this.selected.start).endsWith(modStart);\n if (doesStart) {\n foundMod = testArray[index];\n break;\n }\n }\n\n // this.mod = this.mod.replace(/SAMPLE/g, this.selected.text);\n this.mod = this.mod.replace(/SAMPLE/g, this.selected.text);\n // mod.set('mod', this.mod.replace(/SAMPLE/g, this.selected.text));\n\n if (foundMod && foundMod === this.mod) {\n // modded = true;\n // mod.set('modded', true);\n this.modded = true;\n this.currentMod = foundMod;\n } else {\n // modded = false;\n // mod.set('modded', false);\n this.modded = false;\n this.currentMod = undefined;\n }\n } else {\n // modded = false;\n // mod.set('modded', false);\n this.modded = false;\n this.currentMod = undefined;\n return false;\n }\n\n return this.modded;\n }", "title": "" }, { "docid": "517d5ed5c9e72f818a2dbc33f81356d5", "score": "0.46972954", "text": "function locateSingleChoice () {\n\td3.selectAll (\"g#vertices circle\").each(function (h,i){\n\t\tvar vtx = d3.select(this);\n\t\tvtx.classed(\"singlechoice\", false);\n\t\tvar isBorder = false;\n\t\tfor (let g of h.ds.vertexCirculator(h)) {\n\t\t\tif (g.isBorder) {\n\t\t\t\tisBorder = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!isBorder) return;\n\t\tvar vtype = vertexNodeType(h);\n\t\tvar matches = archMatch(vtype);\n\t\tif (matches.length == 1) {\n\t\t\td3.select(this).classed(\"singlechoice\", true);\n\t\t}\t\n\t});\n}", "title": "" }, { "docid": "36802053230b753b9a10b8b914a046de", "score": "0.46937785", "text": "function updateSelection(elem) {\n\n jQuery('.flex-item').attr(\"data-is-selected\", \"false\");\n\n jQuery(elem).attr(\"data-is-selected\", \"true\");\n var active = jQuery(elem).attr(\"id\");\n\n updateSortCSS();\n updateSortVisible(active);\n\n return;\n}", "title": "" }, { "docid": "4bd01bd4fbafca9fee34b7d8690a2f16", "score": "0.4674675", "text": "function Selector(mainElementId, selectionCallback) {\n debugIt(\"create Selector\");\n \n d3.select(mainElementId)\n .select(\"#searcher\")\n .on('keyup', showMatchingItems);\n \n return {\n loadData: loadData,\n loadFromDataRequest: loadFromDataRequest,\n collapse: collapse,\n expand: expand,\n clearSelection: clearSelection\n };\n \n function showMatchingItems() {\n var query = this.value.toLowerCase();\n $(mainElementId + \" #selector>li\").each(showOrHide);\n \n function showOrHide() {\n if($(this).text().toLowerCase().includes(query)) {\n $(this).show();\n }else{\n $(this).hide();\n }\n }\n }\n \n function loadData(dataArray) {\n d3.select(mainElementId)\n .select(\"#selector\")\n .selectAll(\"li\")\n .data(dataArray)\n .enter()\n .append(\"li\")\n .text(d=>d.label)\n .on(\"click.show\", showSelection)\n .on(\"click.callback\", selectionCallback)\n }\n \n function showSelection(d, i, nodes) {\n clearSelection();\n d3.select(this)\n .classed(\"current\", true);\n }\n \n function clearSelection() {\n d3.select(mainElementId)\n .select(\"#selector\")\n .selectAll(\"li\")\n .classed(\"current\", false);\n }\n \n /* Is this done properly? Should the mapper function be a parameter? */\n /* mapFunction and sortFunction are optional, with defaults */\n function loadFromDataRequest(actionName, mapFunction, sortFunction) {\n if (typeof mapFunction != \"function\") {\n mapFunction = function (d) {\n return {\n uri: d.uri.value,\n label: d.label.value\n }\n }\n }\n \n if (typeof sortFunction != \"function\") {\n sortFunction = function (a, b) {\n return a.label.toLowerCase().localeCompare(b.label.toLowerCase());\n }\n }\n \n $.get(ScholarsVis.Utilities.baseUrl + \"api/dataRequest/\" + actionName).then(mapAndLoad);\n \n function mapAndLoad(data) {\n loadData(data.results.bindings.map(mapFunction).sort(sortFunction).filter(distinct));\n \n function distinct(el, i, array) {\n return i == 0 || el.uri != array[i-1].uri;\n }\n }\n }\n \n function expand() {\n $(mainElementId + \" .collapse\").collapse(\"show\");\n }\n\n function collapse() {\n $(mainElementId + \" .collapse\").collapse(\"hide\");\n }\n }", "title": "" }, { "docid": "0e88ce81b8ebc1060ccafd4c230ad7d2", "score": "0.46569818", "text": "function matchSuspects( name ){\n rgName = name.substring(0,3);\n lcName = name.toLowerCase().substring(0,3);\n var rgQ = \"#matching .merge-list span:contains('{str}')\".supplant({\"str\": rgName});\n var lcQ = \"#matching .merge-list span:contains('{str}')\".supplant({\"str\": lcName});\n $(rgQ).addClass(\"selected\");\n }", "title": "" }, { "docid": "2e552dd2cbfe33835460a5eac6890a2e", "score": "0.46540293", "text": "function checkSelection(){\n\t// find intersections\n\n\t// create a Ray with origin at the mouse position\n\t// and direction into the scene (camera direction)\n\tvar vector = new THREE.Vector3( mouse.x, mouse.y, 1 );\n\tprojector.unprojectVector( vector, camera );\n\tvar ray = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );\n var activeEU = 0;\n\tvar activeUS = 0;\n\tvar activeCHA = 0;\n\t// create an array containing all objects in the scene with which the ray intersects\n\tvar intersects = ray.intersectObjects( targetList );\n\n\t//if an intersection is detected\n\tif ( intersects.length > 0 )\n\t{\n\t\tconsole.log(\"Hit @ \" + toString( intersects[0].point ) );\n\n\t\t//test items in selected faces array\n\t\tvar test=-1;\n\t\tselectedFaces.forEach( function(arrayItem)\n\t\t{\n\n\t\t\tif (arrayItem.object.name === \"USD\")\n\t\t\t{\n\t\t\t\tif(intersects[0].faceIndex==arrayItem.faceIndex && intersects[0].object.id==arrayItem.object.id){\n\t\t\t\t\ttest=selectedFaces.indexOf(arrayItem);\n\t\t\t\t\tconsole.log(\"False\");\n\t\t\t\t\tactiveCHA = 0;\n\t\t\t\t\t$scope.$emit(\"messageUSD\", 0);\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tif (activeCHA === 0 && activeUS === 0 && activeEU)\n\t\t\t\t\t{\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminwhole.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"De-Loaded Texture for CHA\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminUSA.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"De-Loaded Texture for CHA\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse if (arrayItem.object.name === \"EU\")\n\t\t\t{\n\t\t\t\tif(intersects[0].faceIndex==arrayItem.faceIndex && intersects[0].object.id==arrayItem.object.id){\n\t\t\t\t\ttest=selectedFaces.indexOf(arrayItem);\n\t\t\t\t\tconsole.log(\"False\");\n\t\t\t\t\t$scope.$emit(\"messageEU\", 0);\n\t\t\t\t\tactiveCHA = 0;\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tif (activeCHA === 0 && activeUS === 0 && activeEU)\n\t\t\t\t\t{\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminwhole.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"De-Loaded Texture for CHA\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminEU.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"De-Loaded Texture for CHA\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (arrayItem.object.name === \"CHA\")\n\t\t\t{\n\t\t\t\tif(intersects[0].faceIndex==arrayItem.faceIndex && intersects[0].object.id==arrayItem.object.id){\n\t\t\t\t\ttest=selectedFaces.indexOf(arrayItem);\n\t\t\t\t\tconsole.log(\"False\");\n\t\t\t\t\t$scope.$emit(\"messageCHA\", 0);\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tif (activeCHA === 0 && activeUS === 0 && activeEU)\n\t\t\t\t\t{\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminwhole.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"De-Loaded Texture for CHA\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminCHA.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"De-Loaded Texture for CHA\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\t\t\t}\n\n\n\n\n\t\t});\n\n\n\n\t\t//Change Touchpoint Color\n\t\t// if is a previously selected face, change the color back to green, otherswise change to blue\n\t\tif(test>=0){\n\t\t\tintersects[ 0 ].face.color=new THREE.Color( 0x17A0BF );\n\t\t\tselectedFaces.splice(test, 1);\n\n\t\t}\n\t\telse{\n\t\t\tintersects[ 0 ].face.color=new THREE.Color( 0x17A0BF );\n\t\t\tselectedFaces.push(intersects[0]);\n\t\t\tselectedFaces.forEach( function(arrayItem)\n\t\t\t{\n\t\t\t\tif (arrayItem.object.name === \"USD\")\n\t\t\t\t{\n\t\t\t\tconsole.log(\"True\");\n\t\t\t\tactiveUS = 1;\n\t\t\t\t$scope.$emit(\"messageUSD\", 1);\n if (activeUS === 1 && activeEU == 1)\n\t\t\t\t{\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminUSEU.png', {}, function(){\n\t\t\t\t\tconsole.log(\"Loaded Texture for USA <3 EU\")\n\t\t\t\t\t},\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t});\n\n\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\tanimate();\n\t\t\t\t}\n\t\t\t\telse if (activeUS == 1 && activeCHA === 1)\n\t\t\t\t{\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminUSA.png', {}, function(){\n\t\t\t\t\tconsole.log(\"Loaded Texture for USA <3 CHA\")\n\t\t\t\t\t},\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t});\n\n\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\tanimate();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminUSA.png', {}, function(){\n\t\t\t\t\tconsole.log(\"Loaded Texture for USA\")\n\t\t\t\t\t},\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t});\n\n\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\tanimate();\n\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\telse if (arrayItem.object.name === \"EU\")\n\t\t\t\t{\n\t\t\t\t\tconsole.log(\"True\");\n\t\t\t\t\tactiveEU = 1;\n\t\t\t\t\t$scope.$emit(\"messageUEU\", 1);\n\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\tif (activeUS === 1 && activeEU == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminUSAEU.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"Loaded Texture for USA <3 EU\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\t\t\t\t\telse if (activeEU == 1 && activeCHA === 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminCHAEU.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"Loaded Texture for CHA <3 EU\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminEU.png', {}, function(){\n\t\t\t\t\t\tconsole.log(\"Loaded Texture for EU\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\tanimate();\n\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\telse if (arrayItem.object.name === \"CHA\")\n\t\t\t\t{\n\n\t\t\t\t\t\tconsole.log(\"True\");\n\t\t\t\t\t\tactiveCHA = 1;\n\t\t\t\t\t\t$scope.$emit(\"messageCHA\", 1);\n\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\tif (activeUS === 1 && activeCHA == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminUSAEU.png', {}, function(){\n\t\t\t\t\t\t\tconsole.log(\"Loaded Texture for USA <3 EU\")\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\t\tanimate();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (activeEU == 1 && activeCHA === 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminCHAEU.png', {}, function(){\n\t\t\t\t\t\t\tconsole.log(\"Loaded Texture for CHA < EU\")\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\t\tanimate();\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 cgtxt = scene.getObjectByName(\"Earth\");\n\t\t\t\t\t\t\tcgtxt.material.map = THREE.ImageUtils.loadTexture( '../wgl3js/models/earthtextminCHA.png', {}, function(){\n\t\t\t\t\t\t\tconsole.log(\"Loaded Texture for CHA\")\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t\t\talert('Error Loading Texture')\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tcgtxt.material.needsUpdate = true;\n\t\t\t\t\t\t\tanimate();\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t}\n\n\t\tintersects[ 0 ].object.geometry.colorsNeedUpdate = true;\n\t}\n}", "title": "" }, { "docid": "99b868ba0bf7d5fc070815acb107d84c", "score": "0.46449426", "text": "selectViaInteraction() {\n if (!this.selectable) {\n return;\n }\n else if (!this.selected) {\n this._chipFoundation.setSelected(true);\n this._dispatchSelectionChange(true);\n }\n }", "title": "" }, { "docid": "793e88715a7de40d763d7d844aacc086", "score": "0.46351093", "text": "function matchedCards() {\n var matched = document.querySelectorAll(\".selected\");\n matched.forEach(square => {\n square.classList.add('matchedItem');\n square.classList.remove('.selected');\n});;\n}", "title": "" }, { "docid": "551fb37411f9a34cb35b8260e188ec22", "score": "0.4630692", "text": "_selectViaInteraction() {\n if (!this.disabled) {\n this._selected = this.multiple ? !this._selected : true;\n this._changeDetectorRef.markForCheck();\n this._emitSelectionChangeEvent(true);\n }\n }", "title": "" }, { "docid": "551fb37411f9a34cb35b8260e188ec22", "score": "0.4630692", "text": "_selectViaInteraction() {\n if (!this.disabled) {\n this._selected = this.multiple ? !this._selected : true;\n this._changeDetectorRef.markForCheck();\n this._emitSelectionChangeEvent(true);\n }\n }", "title": "" }, { "docid": "551fb37411f9a34cb35b8260e188ec22", "score": "0.4630692", "text": "_selectViaInteraction() {\n if (!this.disabled) {\n this._selected = this.multiple ? !this._selected : true;\n this._changeDetectorRef.markForCheck();\n this._emitSelectionChangeEvent(true);\n }\n }", "title": "" }, { "docid": "551fb37411f9a34cb35b8260e188ec22", "score": "0.4630692", "text": "_selectViaInteraction() {\n if (!this.disabled) {\n this._selected = this.multiple ? !this._selected : true;\n this._changeDetectorRef.markForCheck();\n this._emitSelectionChangeEvent(true);\n }\n }", "title": "" }, { "docid": "0a4836d2868930df1ed583628724e129", "score": "0.4624905", "text": "function selectMatches() {\n // mode\n let modes = $('#match-mode-select').dropdown('get value').split(',');\n for (let m in modes) {\n if (modes[m] !== \"\")\n modes[m] = parseInt(modes[m]);\n }\n\n // dates\n let start = $('#match-search-start-date').datepicker('getDate');\n let end = $('#match-search-end-date').datepicker('getDate');\n\n // players\n let players = $('#match-search-players').dropdown('get value').split(',');\n let playerMode = $('#match-search-players-mode').dropdown('get value');\n let playerWin = $('#match-search-players-win').dropdown('get value');\n\n // heroes\n let heroes = $('#match-search-heroes').dropdown('get value').split(',');\n let heroMode = $('#match-search-heroes-mode').dropdown('get value');\n\n // maps\n let maps = $('#match-map-select').dropdown('get value').split(',');\n\n // patches\n let patches = $('#match-patch-select').dropdown('get value').split(',');\n\n // team\n let team = $('#match-search-team').dropdown('get value');\n let teamWin = $('#match-search-team-win').dropdown('get value');\n\n // tags\n let tags = $('#match-search-tags').dropdown('get value').split(',');\n\n for (let p in patches) {\n if (patches[p] !== \"\")\n patches[p] = parseInt(patches[p]);\n }\n\n // construct the query\n let query = {};\n if (modes[0] !== \"\") {\n query.mode = { $in: modes };\n }\n\n if (maps[0] !== \"\") {\n query.map = { $in: maps };\n }\n\n if (patches[0] !== \"\") {\n query['version.m_build'] = { $in: patches };\n }\n\n if (tags[0] !== \"\") {\n query.tags = { $in: tags };\n }\n\n // dates\n query.$where = function() {\n let d = new Date(this.date);\n return (start <= d && d <= end);\n }\n\n // heroes\n if (heroes[0] !== \"\") {\n if (heroMode === 'and') {\n if (!('$and' in query))\n query.$and = [];\n \n for (let h in heroes) {\n query.$and.push({ 'heroes' : heroes[h] });\n }\n }\n else {\n query.heroes = { $elemMatch: { $in: heroes } };\n }\n }\n\n // players\n if (players[0] !== \"\") {\n if (playerMode === 'and') {\n if (!('$and' in query))\n query.$and = [];\n \n for (let p in players) {\n if (playerWin === 'win') {\n query.$and.push({ 'winningPlayers' : players[p]});\n }\n else {\n query.$and.push({ 'playerIDs' : players[p] });\n }\n\n if (playerWin === 'loss') {\n query.$and.push({ '$where' : function() {\n return this.winningPlayers.indexOf(players[p]) === -1\n }});\n }\n }\n }\n else if (playerMode === 'or' || playerMode === '') {\n if (playerWin === 'win') {\n query.winningPlayers = { $elemMatch: { $in: players }};\n }\n else if (playerWin === 'loss') {\n if (!('$or' in query))\n query.$or = [];\n \n for (let p in players) {\n let q = { $and: []};\n q.$and.push({ 'playerIDs' : players[p] });\n q.$and.push({ '$where' : function() {\n return this.winningPlayers.indexOf(players[p]) === -1;\n }});\n\n query.$or.push(q);\n }\n }\n else {\n query.playerIDs = { $elemMatch: { $in: players } };\n }\n }\n }\n\n // ok teams suck\n if (team !== \"\") {\n // get the team, then run the query as normal\n DB.getTeam(team, function(err, team) {\n let oldWhere = function() { return true; };\n let player = team.players;\n if ('$where' in query) {\n oldWhere = query.$where;\n }\n\n if (team.players.length <= 5) {\n // need to match length of players array\n query.$where = function() {\n if (player.length === 0)\n return false;\n \n let boundWhere = oldWhere.bind(this);\n let t0 = this.teams[0].ids;\n let count = 0;\n for (let i in t0) {\n if (player.indexOf(t0[i]) >= 0)\n count += 1;\n }\n \n if (count === player.length) {\n if (requireHeroOnTeam === true) {\n // basically here if we don't find the selected heroes on the team we should reject it\n for (let hero of heroes) {\n if (this.teams[0].heroes.indexOf(hero) === -1) {\n return false;\n }\n }\n }\n\n if (teamWin === 'win') {\n return this.winner === 0 && boundWhere();\n }\n else if (teamWin === 'loss') {\n return this.winner !== 0 && boundWhere();\n }\n\n return boundWhere();\n }\n \n count = 0;\n let t1 = this.teams[1].ids;\n for (let i in t1) {\n if (player.indexOf(t1[i]) >= 0)\n count += 1;\n }\n \n if (count === player.length) {\n if (requireHeroOnTeam === true) {\n // basically here if we don't find the selected heroes on the team we should reject it\n for (let hero of heroes) {\n if (this.teams[1].heroes.indexOf(hero) === -1) {\n return false;\n }\n }\n }\n\n if (teamWin === 'win') {\n return this.winner === 1 && boundWhere();\n }\n else if (teamWin === 'loss') {\n return this.winner !== 1 && boundWhere();\n }\n\n return boundWhere();\n }\n \n return false;\n }\n }\n else {\n // basically we need a match 5 of the players and then we're ok \n query.$where = function() {\n if (player.length === 0)\n return false;\n \n let boundWhere = oldWhere.bind(this);\n let t0 = this.teams[0].ids;\n let count = 0;\n for (let i in t0) {\n if (player.indexOf(t0[i]) >= 0)\n count += 1;\n }\n \n if (count === 5) {\n if (requireHeroOnTeam === true) {\n // basically here if we don't find the selected heroes on the team we should reject it\n for (let hero of heroes) {\n if (this.teams[0].heroes.indexOf(hero) === -1) {\n return false;\n }\n }\n }\n\n if (teamWin === 'win') {\n return this.winner === 0 && boundWhere();\n }\n else if (teamWin === 'loss') {\n return this.winner !== 0 && boundWhere();\n }\n \n return boundWhere();\n }\n \n count = 0;\n let t1 = this.teams[1].ids;\n for (let i in t1) {\n if (player.indexOf(t1[i]) >= 0)\n count += 1;\n }\n \n if (count === 5) {\n if (requireHeroOnTeam === true) {\n // basically here if we don't find the selected heroes on the team we should reject it\n for (let hero of heroes) {\n if (this.teams[1].heroes.indexOf(hero) === -1) {\n return false;\n }\n }\n }\n\n if (teamWin === 'win') {\n return this.winner === 1 && boundWhere();\n }\n else if (teamWin === 'loss') {\n return this.winner !== 1 && boundWhere();\n }\n\n return boundWhere();\n }\n \n return false;\n }\n }\n\n matchSearchQuery = query;\n currentPage = 0;\n showPage(currentPage)\n });\n }\n else {\n currentPage = 0;\n matchSearchQuery = query;\n showPage(currentPage);\n }\n}", "title": "" }, { "docid": "be6664331c1a40b86dc64c2f366b1837", "score": "0.4613606", "text": "function updateSelection() {\n var bbox = $('#bounding-box')\n .css({ \n left: Math.round(optimalApp.selectionPosition[0]),\n top: Math.round(optimalApp.selectionPosition[1])\n })\n .width(Math.round(Math.max(optimalApp.selectionWidth, 0)))\n .height(Math.round(Math.max(optimalApp.selectionHeight, 0)))\n .css('transform', 'rotate(' + optimalApp.selectionRotation + 'deg)')\n .css('-moz-transform', 'rotate(' + optimalApp.selectionRotation + 'deg)')\n .css('-webkit-transform', 'rotate(' + optimalApp.selectionRotation + 'deg)')\n .css('-o-transform', 'rotate(' + optimalApp.selectionRotation + 'deg)');\n}", "title": "" }, { "docid": "c150bcafba94fef97bfcb8f70ca66431", "score": "0.4599395", "text": "_inSelection(x, y) {\n const that = this,\n dimensionValues = that._coordinates;\n let validation = true,\n xDimension, yDimension, boundX, boundY;\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n xDimension = that.dimensions - 1;\n yDimension = that.dimensions - 2;\n }\n else {\n xDimension = 0;\n yDimension = 1;\n }\n\n if (!that._oneDimensionSpecialCase) {\n boundX = x + dimensionValues[xDimension];\n boundY = y + dimensionValues[yDimension];\n }\n else {\n boundX = y + dimensionValues[xDimension];\n }\n\n if (that.dimensions === 1) {\n if (boundX >= that._absoluteSelectionStart[xDimension] && boundX <= that._absoluteSelectionEnd[xDimension]) {\n return true;\n }\n else {\n return false;\n }\n }\n\n if (boundX >= that._absoluteSelectionStart[xDimension] &&\n boundX <= that._absoluteSelectionEnd[xDimension] &&\n boundY >= that._absoluteSelectionStart[yDimension] &&\n boundY <= that._absoluteSelectionEnd[yDimension]) {\n validation = true;\n }\n else {\n validation = false;\n }\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n for (let i = 0; i < yDimension; i++) {\n validation = validation && (dimensionValues[i] >= that._absoluteSelectionStart[i] && dimensionValues[i] <= that._absoluteSelectionEnd[i]);\n }\n }\n else {\n for (let j = 2; j < that.dimensions; j++) {\n validation = validation && (dimensionValues[j] >= that._absoluteSelectionStart[j] && dimensionValues[j] <= that._absoluteSelectionEnd[j]);\n }\n }\n\n return validation;\n }", "title": "" }, { "docid": "650680b0f1a43d9684d35aa49c811a78", "score": "0.45940006", "text": "function cardMatch() {\n if(cardSelections[0].firstElementChild.className === cardSelections[1].firstElementChild.className) {\n // If a match adds the match class to each card in array\n cardSelections.forEach(function(card){\n card.classList.add('match');\n });\n matchCount++;\n cardSelections = [];\n } else {\n // If no match sets timeout on card flipping via toggle.\n setTimeout(function() {\n displayCard(cardSelections[0]);\n displayCard(cardSelections[1]);\n cardSelections = [];\n }, 400 );\n }\n }", "title": "" }, { "docid": "71d78b3987b4776fbe282962fdb1a658", "score": "0.45906568", "text": "checkSelected() {\n let counter = 0;\n let midAnimation = this.checkMidAnimation();\n if(!midAnimation && !this.locked){\n counter = this.setSelected(this.view.thanosPieces, counter);\n counter = this.setSelected(this.view.gamoraPieces, counter);\n if (this.selectedPiece != null)\n //console.log(\"Selected:\" + counter);\n if (counter == 1)\n return \"OK\"; //One piece selected\n else if (counter == 0) {\n this.selectedPiece.swapText();\n this.selectedPiece = null;\n return \"NOTOK\"; // No pieces selected\n }\n }\n else{\n this.deselectAllPieces();\n }\n }", "title": "" }, { "docid": "1bc4dfafbe42a948711d1ccca683c2f8", "score": "0.45784044", "text": "function selectionChanged(args) {\n var diagram = $(\"#diagram\").ejDiagram(\"instance\");\n var ConnectorConstraints = ej.datavisualization.Diagram.ConnectorConstraints;\n var selectedConnectors = getSelectedConnectors(args.selectedItems);\n var connectors = selectedConnectors.length ? selectedConnectors : diagram.connectors();\n updateCheckBox(\"dragable\", connectors, ConnectorConstraints.Drag);\n updateCheckBox(\"dragablesource\", connectors, ConnectorConstraints.DragSourceEnd);\n updateCheckBox(\"dragabletarget\", connectors, ConnectorConstraints.DragTargetEnd);\n updateCheckBox(\"dragablesegment\", connectors, ConnectorConstraints.DragSegmentThumb);\n updateCheckBox(\"bridge\", connectors, ConnectorConstraints.Bridging);\n\n var checked;\n var radius = connectors[0].cornerRadius;\n for (i = 1; i < connectors.length; i++) {\n if (radius != connectors[i].cornerRadius) {\n $(\"#cornerRadius\").ejNumericTextbox({ enabled: false });\n checked = true;\n break;\n }\n }\n if (!checked) {\n $(\"#cornerRadius\").ejNumericTextbox({ enabled: true });\n $(\"#cornerRadius\").ejNumericTextbox({ value: radius });\n }\n}", "title": "" }, { "docid": "773c7a02b98e98630434ef33104e6b04", "score": "0.45753473", "text": "function selectProperMaterial()\n\t{\n\t\tvar rows = auxJobGrid.getSelectionModel().getSelections();\n\t\t\n\t\tif(rows.length > 0)\n\t\t{\n\t\t\tvar record = null;\n\t\t\tvar selectedSize = size.getRawValue();\n\t\t\tvar material = \"\";\n\t\t\t\n\t\t\tfor(var i = 0; i < dsMaterial.getCount(); i++)\n\t\t\t{\n\t\t\t\trecord = dsMaterial.getAt(i); \t\n\t\t\t\tmaterial = record.data.name;\n\t\t\t\t\n\t\t\t\tif(material.toString().indexOf(selectedSize) != -1 && selectedSize != \"\")\n\t\t\t\t{\n\t\t\t\t\trows[0].set('material', material);\n\t\t\t\t\trows[0].set('material_cost', record.data.cost);\n\t\t\t\t\trows[0].set('days', record.data.days);\n\t\t\t\t\t\n\t\t\t\t\tsetScheduledDate(rows[0]);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\trows[0].set('material', '');\n\t\t\trows[0].set('material_cost', 0);\n\t\t\trows[0].set('days', 0);\n\t\t\t\n\t\t\tsetScheduledDate(rows[0]);\n\t\t}\n\t}", "title": "" }, { "docid": "9ce869e3c635a85d9cbb31921cdedfaa", "score": "0.4568089", "text": "function updateSelectionState(piece) {\r\n // Coordinates of the piece and the rubberband in piece space:\r\n var rubbrX1P = rubberband.xP, rubbrY1P = rubberband.yP;\r\n var rubbrX2P = rubberband.xP + rubberband.widthP - 1;\r\n var rubbrY2P = rubberband.yP + rubberband.heightP - 1;\r\n var pieceX1P = piece.xP, pieceY1P = piece.yP;\r\n var pieceX2P = piece.xP + piece.widthP - 1;\r\n var pieceY2P = piece.yP + piece.heightP - 1;\r\n piece.selected =\r\n ((rubbrX1P <= pieceX1P && rubbrX2P >= pieceX1P) ||\r\n (rubbrX1P > pieceX1P && rubbrX1P <= pieceX2P)) &&\r\n ((rubbrY1P <= pieceY1P && rubbrY2P >= pieceY1P) ||\r\n (rubbrY1P > pieceY1P && rubbrY1P <= pieceY2P));\r\n }", "title": "" }, { "docid": "6d8c04a5721cc110061dd3e5542aa349", "score": "0.45544183", "text": "function SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\tt.selectionManagerDestroy = destroy;\n\t\n\t\n\t// imports\n\tvar calendar = t.calendar;\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t$(document).on('mousedown', documentMousedown);\n\t}\n\n\n\tfunction documentMousedown(ev) {\n\t\tvar ignore = opt('unselectCancel');\n\t\tif (ignore) {\n\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tunselect(ev);\n\t}\n\t\n\n\tfunction select(start, end) {\n\t\tunselect();\n\n\t\tstart = calendar.moment(start);\n\t\tif (end) {\n\t\t\tend = calendar.moment(end);\n\t\t}\n\t\telse {\n\t\t\tend = defaultSelectionEnd(start);\n\t\t}\n\n\t\trenderSelection(start, end);\n\t\treportSelection(start, end);\n\t}\n\t// TODO: better date normalization. see notes in automated test\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(start, end, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, start, end, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(\n\t\t\t\t\t\tdates[0],\n\t\t\t\t\t\tdates[1].clone().add('days', 1) // make exclusive\n\t\t\t\t\t);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(\n\t\t\t\t\t\tdates[0],\n\t\t\t\t\t\tdates[1].clone().add('days', 1), // make exclusive\n\t\t\t\t\t\tev\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n\tfunction destroy() {\n\t\t$(document).off('mousedown', documentMousedown);\n\t}\n\n\n}", "title": "" }, { "docid": "2d487fc2071d7935e338bfce97d08c52", "score": "0.4553204", "text": "function onSelect()\n\t{\n\t\tunit.div.toggleClass(\"selected\", unit.movePoints > 0);\n\t}", "title": "" }, { "docid": "0fc65b04b66ce259e8088824760a8129", "score": "0.45433596", "text": "_updateMdcSelectionClasses() {\n this._setMdcClass('mdc-chip-set--filter', this.selectable && this.multiple);\n this._setMdcClass('mdc-chip-set--choice', this.selectable && !this.multiple);\n }", "title": "" }, { "docid": "0fc65b04b66ce259e8088824760a8129", "score": "0.45433596", "text": "_updateMdcSelectionClasses() {\n this._setMdcClass('mdc-chip-set--filter', this.selectable && this.multiple);\n this._setMdcClass('mdc-chip-set--choice', this.selectable && !this.multiple);\n }", "title": "" }, { "docid": "6fd3886fb2feb97bdec7960efa193a2f", "score": "0.45389003", "text": "function NumSelected()\n{\n var nsel = 0;\n for (var n = 1; n <= num_molecules; n++) if (IsMoleculeSelected(n)) nsel++;\n return nsel;\n}", "title": "" }, { "docid": "36bbe233d30d0ae8ec40b9e6aae3518f", "score": "0.45268854", "text": "function selectItemOnMatch(){var searchText=$scope.searchText,matches=ctrl.matches,item=matches[0];if(matches.length===1)getDisplayValue(item).then(function(displayValue){var isMatching=searchText==displayValue;if($scope.matchInsensitive&&!isMatching){isMatching=searchText.toLowerCase()==displayValue.toLowerCase();}if(isMatching)select(0);});}", "title": "" }, { "docid": "ca884bfac2bd3fd57f580d80fdc3a237", "score": "0.45263755", "text": "changeManualSelection() {\n this.setState(state => {\n // Get manualSelection boolean option for selected group.\n let groupInfo = state.groups[state.selectedGroup];\n let newManualSelection = !groupInfo.manualSelection;\n\n // Erase any selection if filtering mode is now activated\n if (!newManualSelection) {\n groupInfo.selection = new Set();\n }\n\n // Change manualSelection to its oposite.\n groupInfo.manualSelection = newManualSelection;\n return state;\n });\n }", "title": "" }, { "docid": "a5e2f859c733c3aa65ea04bfd42701b6", "score": "0.45102715", "text": "function select(){\n\n\t\tcurrent = $filter.find('option:selected')[0].text.toLowerCase();\n\n\t\tmv.filter( current, '*' );\n\t}", "title": "" }, { "docid": "2f893b15c238ff189c320fc1b868827d", "score": "0.45086196", "text": "function filterSelectionChange(doc, sel, options) {\n\t\t var obj = {\n\t\t ranges: sel.ranges,\n\t\t update: function(ranges) {\n\t\t this.ranges = [];\n\t\t for (var i = 0; i < ranges.length; i++)\n\t\t { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n\t\t clipPos(doc, ranges[i].head)); }\n\t\t },\n\t\t origin: options && options.origin\n\t\t };\n\t\t signal(doc, \"beforeSelectionChange\", doc, obj);\n\t\t if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n\t\t if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n\t\t else { return sel }\n\t\t }", "title": "" }, { "docid": "e5aa5d4a17919396c0a494395369ae13", "score": "0.45045972", "text": "function selection(selected) {\n\t\t\tvar values = selected instanceof Array ? selected : [selected],\n\t\t\t\ti;\n\n\t\t\tfor (i = 0; i < element.options.length; ++i) {\n\t\t\t\telement.options[i].selected = values.indexOf(element.options[i].value) >= 0;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "6ced6d3a49456fa7df9dd120247ccc47", "score": "0.45010492", "text": "function setSelection() {\n var bbox = $('#bounding-box');\n \n optimalApp.selectionWidth = bbox.width();\n optimalApp.selectionHeight = bbox.height();\n \n optimalApp.selectionBaseWidth = bbox.width();\n optimalApp.selectionBaseHeight = bbox.height();\n \n optimalApp.selectionPosition[0] = bbox.position().left;\n optimalApp.selectionPosition[1] = bbox.position().top;\n \n optimalApp.selectionBasePosition[0] = bbox.position().left;\n optimalApp.selectionBasePosition[1] = bbox.position().top;\n \n optimalApp.selectionOffset[0] = event.offsetX;\n optimalApp.selectionOffset[1] = event.offsetY;\n \n optimalApp.selectionOrigin[0] = event.pageX;\n optimalApp.selectionOrigin[1] = event.pageY;\n \n optimalApp.selectionRotation = 0;\n // since the box is redrawn after being rotated, it should start vertically aligned\n \n optimalApp.resizingFrom = event.target.id;\n}", "title": "" }, { "docid": "2cba78e4f859d10a8f38964657ac225d", "score": "0.44891104", "text": "function filterSelectionChange(doc, sel, options) {\n\t\t var obj = {\n\t\t ranges: sel.ranges,\n\t\t update: function(ranges) {\n\t\t this.ranges = [];\n\t\t for (var i = 0; i < ranges.length; i++)\n\t\t this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n\t\t clipPos(doc, ranges[i].head));\n\t\t },\n\t\t origin: options && options.origin\n\t\t };\n\t\t signal(doc, \"beforeSelectionChange\", doc, obj);\n\t\t if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n\t\t if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n\t\t else return sel;\n\t\t }", "title": "" }, { "docid": "fc56ac21e6678f05c667c765099ebdcc", "score": "0.44864053", "text": "function selectCourseBySearch(){\n\n //Deselect the teachers previously selected\n deselectCourse();\n\n // take the searched value\n var selectedCourse = findCourseCircle();\n\n var arc = d3.arc().innerRadius(80).outerRadius(100);\n\n if (selectedCourse !== null) {\n \n d3.select(selectedCourse.childNodes[0])\n .attr('d', arc)\n\n d3.select(selectedCourse.childNodes[1])\n .attr('d', arc)\n\n \n d3.select(selectedCourse)\n .classed(\"coursesoverview_selected\", true);\n\n //Put the circle at the front\n\n d3.select(svg).each(function(){selectedCourse.parentNode.appendChild(selectedCourse)});\n\n\n //Add the text to the circle\n var radius = 100;\n var side = 1.5 * radius * Math.cos(Math.PI / 4);\n var dx = -side/2;\n\n var circle = d3.select(selectedCourse).append('circle')\n .attr('r', 80)\n .attr('fill', d => d.positiveValue - d.negativeValue === 0 ? '#5D41E6' : (d.positiveValue - d.negativeValue < 0 ? '#DC2F2F' : '#60B766'))\n .classed(\"coursesoverview_selectText\", \"true\");\n\n var g = d3.select(selectedCourse).append('g')\n .attr('transform', 'translate(' + [dx, dx+20] + ')')\n .classed(\"coursesoverview_selectText\", \"true\")\n\n g.append(\"foreignObject\")\n .attr(\"width\", side)\n .attr(\"height\", side)\n .append(\"xhtml:body\")\n .attr(\"id\", \"selectTextBody\")\n .style('text-align', 'center')\n .style('color', 'white')\n .style('background-color', d => d.positiveValue - d.negativeValue === 0 ? '#5D41E6' : (d.positiveValue - d.negativeValue < 0 ? '#DC2F2F' : '#60B766'))\n .html(function(d){\n propfunction(d.id);\n var text = \"<p style='margin: 0'>\" +\"<b>\"+d.code + \"</b>\";\n text+= \"<p style='margin: 0'>\" +d.name;\n text+=\"<p style='margin-top:20px'>\"+ d.value + \"h\";\n return text;\n });\n }\n }", "title": "" }, { "docid": "da195dfdead25b596e815e42dfc58880", "score": "0.44839478", "text": "static byIndicator() {\n const activeTextEditor = vscode_1.window.activeTextEditor;\n if (!activeTextEditor) {\n return Promise.resolve(false);\n }\n activeTextEditor.selection = new vscode_1.Selection(activeTextEditor.selection.active, activeTextEditor.selection.active);\n return vscode_1.commands.executeCommand('editor.action.addSelectionToNextFindMatch');\n }", "title": "" }, { "docid": "4e7382ce252b50d492266478a495bfa3", "score": "0.44782755", "text": "function selectInterface(c) {\r\n // Because NGL is incredibly clutsy, we have to do this..\r\n\r\n let radius = 5.0;\r\n let selection = '';\r\n let neighborsE;\r\n let neighborsB;\r\n\r\n // neighbors of B belonging to A\r\n nglsele = new NGL.Selection(\":B\");\r\n neighborsB = c.structure.getAtomSetWithinSelection(nglsele, radius);\r\n neighborsB = c.structure.getAtomSetWithinGroup(neighborsB);\r\n selection += \"((\" + neighborsB.toSeleString() + \") and :A)\"\r\n\r\n nglsele = new NGL.Selection(\":A\");\r\n neighborsA = c.structure.getAtomSetWithinSelection(nglsele, radius);\r\n neighborsA = c.structure.getAtomSetWithinGroup(neighborsA);\r\n selection += \"or ((\" + neighborsA.toSeleString() + \") and :B)\"\r\n\r\n return selection\r\n\r\n}", "title": "" }, { "docid": "ebb5da92b2d8827ad382254c653017a3", "score": "0.44598868", "text": "function isSelected(x, y) {\n\t\tif (selected.length === 1) {\n\t\t\t// Single Selections\n\n\t\t\tconst point = selected[0];\n\n\t\t\tif (sudoku[point.y][point.x] !== 0) {\n\t\t\t\t// If current cell is not 0 higligt all matching numbers\n\t\t\t\treturn sudoku[point.y][point.x] === sudoku[y][x]\n\t\t\t\t\t? 'selected'\n\t\t\t\t\t: '';\n\t\t\t} else {\n\t\t\t\t// Highlight all cells in row, col and square\n\t\t\t\treturn point.x === x ||\n\t\t\t\t\tpoint.y === y ||\n\t\t\t\t\t(Math.floor(point.x / 3) === Math.floor(x / 3) &&\n\t\t\t\t\t\tMath.floor(point.y / 3) === Math.floor(y / 3))\n\t\t\t\t\t? 'selected'\n\t\t\t\t\t: '';\n\t\t\t}\n\t\t} else {\n\t\t\t// Highlight multiple individually selcted cells\n\n\t\t\tfor (var p = 0; p < selected.length; p++) {\n\t\t\t\tif (selected[p].x === x && selected[p].y === y) {\n\t\t\t\t\treturn 'selected-main';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "title": "" }, { "docid": "7c6da8416bc612941a22dd0ff75d21c2", "score": "0.44568077", "text": "function SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\t\n\t\n\t// imports\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t$(document).mousedown(function(ev) {\n\t\t\tvar ignore = opt('unselectCancel');\n\t\t\tif (ignore) {\n\t\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunselect(ev);\n\t\t});\n\t}\n\t\n\n\tfunction select(startDate, endDate, allDay) {\n\t\tunselect();\n\t\tif (!endDate) {\n\t\t\tendDate = defaultSelectionEnd(startDate, allDay);\n\t\t}\n\t\trenderSelection(startDate, endDate, allDay);\n\t\treportSelection(startDate, endDate, allDay);\n\t}\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(startDate, endDate, allDay, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, startDate, endDate, allDay, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar _mousedownElement = this;\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(dates[0], dates[1], true);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], true, ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(dates[0], dates[1], true, ev);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n}", "title": "" }, { "docid": "7c6da8416bc612941a22dd0ff75d21c2", "score": "0.44568077", "text": "function SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\t\n\t\n\t// imports\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t$(document).mousedown(function(ev) {\n\t\t\tvar ignore = opt('unselectCancel');\n\t\t\tif (ignore) {\n\t\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunselect(ev);\n\t\t});\n\t}\n\t\n\n\tfunction select(startDate, endDate, allDay) {\n\t\tunselect();\n\t\tif (!endDate) {\n\t\t\tendDate = defaultSelectionEnd(startDate, allDay);\n\t\t}\n\t\trenderSelection(startDate, endDate, allDay);\n\t\treportSelection(startDate, endDate, allDay);\n\t}\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(startDate, endDate, allDay, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, startDate, endDate, allDay, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar _mousedownElement = this;\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(dates[0], dates[1], true);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], true, ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(dates[0], dates[1], true, ev);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n}", "title": "" }, { "docid": "7c6da8416bc612941a22dd0ff75d21c2", "score": "0.44568077", "text": "function SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\t\n\t\n\t// imports\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t$(document).mousedown(function(ev) {\n\t\t\tvar ignore = opt('unselectCancel');\n\t\t\tif (ignore) {\n\t\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunselect(ev);\n\t\t});\n\t}\n\t\n\n\tfunction select(startDate, endDate, allDay) {\n\t\tunselect();\n\t\tif (!endDate) {\n\t\t\tendDate = defaultSelectionEnd(startDate, allDay);\n\t\t}\n\t\trenderSelection(startDate, endDate, allDay);\n\t\treportSelection(startDate, endDate, allDay);\n\t}\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(startDate, endDate, allDay, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, startDate, endDate, allDay, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar _mousedownElement = this;\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(dates[0], dates[1], true);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], true, ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(dates[0], dates[1], true, ev);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n}", "title": "" }, { "docid": "2c254f5a376f418dd5f5a6097e7934d6", "score": "0.44512105", "text": "_applyPendingSelection() {\n if (this._model !== this._globalModel) {\n this._globalModel.updateSelection(this._model.selection, this);\n }\n }", "title": "" }, { "docid": "7891649ae7a4098de898a5e9ac19be4e", "score": "0.44499272", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "7891649ae7a4098de898a5e9ac19be4e", "score": "0.44499272", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "7891649ae7a4098de898a5e9ac19be4e", "score": "0.44499272", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "7891649ae7a4098de898a5e9ac19be4e", "score": "0.44499272", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "7891649ae7a4098de898a5e9ac19be4e", "score": "0.44499272", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "7891649ae7a4098de898a5e9ac19be4e", "score": "0.44499272", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "7891649ae7a4098de898a5e9ac19be4e", "score": "0.44499272", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "7891649ae7a4098de898a5e9ac19be4e", "score": "0.44499272", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "4abfa879ef63d8d01486d686aecd1920", "score": "0.44491303", "text": "function resolveCollisionsInSelection(selection) {\n\t var bounds = [];\n\t selection.each(function(){\n\t var bbox = $(this)[0].getBBox();\n\t bounds.push({\n\t left: bbox.x,\n\t right: bbox.x + bbox.width,\n\t top: bbox.y,\n\t bottom: bbox.y + bbox.height\n\t });\n\t });\n\t var collisions = {};\n\t var collider, collidee;\n\t for (collider = 0; collider < bounds.length; collider++) {\n\t var colliderBounds = bounds[collider];\n\t for (collidee = 0; collidee < bounds.length; collidee++) { if (collider !== collidee) {\n\t var collideeBounds = bounds[collidee];\n\t var collisionLR = colliderBounds.right - collideeBounds.left;\n\t var collisionRL = colliderBounds.left - collideeBounds.right;\n\t var collisionTB = colliderBounds.bottom - collideeBounds.top;\n\t var collisionBT = colliderBounds.top - collideeBounds.bottom;\n\n\t if (collisionLR > 0 && collisionRL < 0 && collisionTB > 0 && collisionBT < 0) {\n\t if (!collisions[collider]) {\n\t collisions[collider] = {};\n\t }\n\t if (!collisions[collider][collidee]) {\n\t collisions[collider][collidee] = {};\n\t }\n\t collisions[collider][collidee] = {\n\t x: (collisionLR > -collisionRL ? collisionRL : collisionLR),\n\t y: (collisionTB > -collisionBT ? collisionBT : collisionTB)\n\t };\n\t }\n\t }}\n\t }\n\n\t function adjustBy(collision, coordinate) {\n\t return function() {\n\t var t = $(this).attr(coordinate);\n\t var adjustment = collision[coordinate];\n\t $(this).attr(coordinate, t - adjustment / 1.9);\n\t };\n\t }\n\n\t for (collider in collisions) {if (collisions.hasOwnProperty(collider)) {\n\t var collidingWith = collisions[collider];\n\t for (collidee in collidingWith) {if (collidingWith.hasOwnProperty(collidee)) {\n\t var collision = collidingWith[collidee];\n\t var g = $(selection[collider]);\n\t if (Math.abs(collision.x) < Math.abs(collision.y)) {\n\t g.find('text').each(adjustBy(collision, 'x'));\n\t } else {\n\t g.find('text').each(adjustBy(collision, 'y'));\n\t }\n\t }}\n\t }}\n\n\t return [\n\t findExtremeBounds(bounds),\n\t !!(Object.keys(collisions).length)\n\t ];\n\t }", "title": "" }, { "docid": "f9a9581637884e2dee95a304a7b67605", "score": "0.4448127", "text": "function onSelectionChanged(event) {\n\t\t\t\t\t\n\t\t\t\t\t// Don't trigger foundset selection if table is grouping\n\t\t\t\t\tif (isTableGrouped()) {\n\t\t\t\t\t\t\n // Trigger event on selection change in grouo mode\n if ($scope.handlers.onSelectedRowsChanged) {\n $scope.handlers.onSelectedRowsChanged();\n }\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// set to true once the grid is ready and selection is set\n\t\t\t\t isSelectionReady = true;\n\t\t\t\t\n\t\t\t\t\tif(scrollToSelectionWhenSelectionReady) {\n\t\t\t\t\t\t$scope.api.scrollToSelection();\n\t\t\t\t\t}\n\n\t\t\t\t\t// rows are rendered, if there was an editCell request, now it is the time to apply it\n\t\t\t\t\tif(startEditFoundsetIndex > -1 && startEditColumnIndex > -1) {\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t$scope.api.editCellAt(startEditFoundsetIndex, startEditColumnIndex);\n\t\t\t\t\t\t}, 200);\n\t\t\t\t\t}\n\n\t\t\t\t // when the grid is not ready yet set the value to the column index for which has been requested focus\n\t\t\t\t if (requestFocusColumnIndex > -1) {\n\t\t\t\t \t$scope.api.requestFocus(requestFocusColumnIndex);\n\t\t\t\t }\n\n\t\t\t\t\tvar selectedNodes = gridOptions.api.getSelectedNodes();\n\t\t\t\t\tif (selectedNodes.length > 0) {\n\t\t\t\t\t\tvar foundsetIndexes = new Array();\n\n\t\t\t\t\t\tfor(var i = 0; i < selectedNodes.length; i++) {\n\t\t\t\t\t\t\tvar node = selectedNodes[i];\n\t\t\t\t\t\t\tif(node) foundsetIndexes.push(node.rowIndex);\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(foundsetIndexes.length > 0) {\n\t\t\t\t\t\t\tfoundsetIndexes.sort(function(a, b){return a - b});\n\t\t\t\t\t\t\t// if single select don't send the old selection along with the new one, to the server\n\t\t\t\t\t\t\tif(!foundset.foundset.multiSelect && foundsetIndexes.length > 1 &&\n\t\t\t\t\t\t\t\tfoundset.foundset.selectedRowIndexes.length > 0) {\n\t\t\t\t\t\t\t\t\tif(foundset.foundset.selectedRowIndexes[0] == foundsetIndexes[0]) {\n\t\t\t\t\t\t\t\t\t\tfoundsetIndexes = foundsetIndexes.slice(-1);\n\t\t\t\t\t\t\t\t\t} else if(foundset.foundset.selectedRowIndexes[0] == foundsetIndexes[foundsetIndexes.length - 1]) {\n\t\t\t\t\t\t\t\t\t\tfoundsetIndexes = foundsetIndexes.slice(0, 1);\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\tfoundset.foundset.requestSelectionUpdate(foundsetIndexes).then(\n\t\t\t\t\t\t\t\tfunction(serverRows){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t // Trigger event on selection change\n\t\t\t\t if ($scope.handlers.onSelectedRowsChanged) {\n\t\t\t\t $scope.handlers.onSelectedRowsChanged();\n\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//success\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction(serverRows){\n\t\t\t\t\t\t\t\t\t//canceled \n\t\t\t\t\t\t\t\t\tif (typeof serverRows === 'string'){\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t//reject\n\t\t\t\t\t\t\t\t\tselectedRowIndexesChanged();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\t$log.debug(\"table must always have a selected record\");\n\t\t\t\t\tselectedRowIndexesChanged();\n\n\t\t\t\t}", "title": "" }, { "docid": "6bef2c863840e590f7a959e26bb1d6ab", "score": "0.4447123", "text": "function filterSelectionChange(doc, sel, options) {\n\t var obj = {\n\t ranges: sel.ranges,\n\t update: function(ranges) {\n\t this.ranges = [];\n\t for (var i = 0; i < ranges.length; i++)\n\t this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n\t clipPos(doc, ranges[i].head));\n\t },\n\t origin: options && options.origin\n\t };\n\t signal(doc, \"beforeSelectionChange\", doc, obj);\n\t if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n\t if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n\t else return sel;\n\t }", "title": "" }, { "docid": "6bef2c863840e590f7a959e26bb1d6ab", "score": "0.4447123", "text": "function filterSelectionChange(doc, sel, options) {\n\t var obj = {\n\t ranges: sel.ranges,\n\t update: function(ranges) {\n\t this.ranges = [];\n\t for (var i = 0; i < ranges.length; i++)\n\t this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n\t clipPos(doc, ranges[i].head));\n\t },\n\t origin: options && options.origin\n\t };\n\t signal(doc, \"beforeSelectionChange\", doc, obj);\n\t if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n\t if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n\t else return sel;\n\t }", "title": "" }, { "docid": "6bef2c863840e590f7a959e26bb1d6ab", "score": "0.4447123", "text": "function filterSelectionChange(doc, sel, options) {\n\t var obj = {\n\t ranges: sel.ranges,\n\t update: function(ranges) {\n\t this.ranges = [];\n\t for (var i = 0; i < ranges.length; i++)\n\t this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n\t clipPos(doc, ranges[i].head));\n\t },\n\t origin: options && options.origin\n\t };\n\t signal(doc, \"beforeSelectionChange\", doc, obj);\n\t if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n\t if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n\t else return sel;\n\t }", "title": "" }, { "docid": "a60dbe28b8d31e7cb55365de054f5cc6", "score": "0.44466844", "text": "function optionCompareChangedOne(select) {\n //Giving select a variable name\n var sel = select\n\n // Importing data from portionsandweights\n d3.json(\"/portionsandweights\").then((importData) => {\n\n // Searching food names through json\n var portions = importData.data;\n\n //Empty Variable\n var filterSelect = []\n\n // Filter the search\n filterSelect = portions.filter(d => d.food_code == sel);\n\n // Food name of filtered data\n var nameOne = filterSelect[0].main_food_description;\n\n // selecting tag for displaying the name\n var selectFoodName = document.getElementById(\"nameOne\");\n\n // Clear html display name\n selectFoodName.innerHTML = \"\";\n\n // Create html tag showing food name\n selectFoodName.innerHTML = selectFoodName.innerHTML +\n '<h3>' + nameOne + '</h3>';\n\n // selecting tag for dropdown\n var select = document.getElementById(\"selCompareTwo\");\n\n //Clear dropdown\n select.innerHTML = \"\";\n\n // For loop for drop down. referencing id and seq_num of portion size\n for (var i = 0; i < filterSelect.length; i++) {\n select.innerHTML = select.innerHTML +\n '<option value=\"' + filterSelect[i].food_code + ',' + filterSelect[i].seq_num + '\">' + filterSelect[i].portion_description + '</option>';\n\n }\n\n // default selection\n var defaultPortionID = filterSelect[0].food_code\n var defaultPortionSeq_num = filterSelect[0].seq_num\n\n // Adding default selection into selection categfory\n optionCompareWeightChangedOne(defaultPortionID, defaultPortionSeq_num);\n // GAUGE ONE\n gaugeOne(defaultPortionID, defaultPortionSeq_num);\n\n });\n}", "title": "" }, { "docid": "984d188e0081609c1924edb4292adb71", "score": "0.4440247", "text": "function notMatched() {\n let selected = document.querySelectorAll('.selected');\n selected.forEach(function(card) {\n card.classList.add('unmatched');\n });\n disable();\n guessesReset();\n}", "title": "" }, { "docid": "cad9e96c78f4558e51f7a60f62601c22", "score": "0.4436911", "text": "function findSelectables() {\n\n var a = svg.getBoundingClientRect();\n\n for (var i = selectables.length; i--;) {\n\n var selectable = selectables[i],\n b = selectable.getBoundingClientRect();\n\n if (isColliding(a, b)) {\n selectable.classList.add(\"selected\");\n } else {\n selectable.classList.remove(\"selected\");\n }\n }\n}", "title": "" }, { "docid": "db52c6d3b51b4773e5ed828e03f2270b", "score": "0.44358328", "text": "function doSelections(event, selectedEles, cols) {\n // Select elements in a range, either across rows or columns\n function selectRange() {\n var frstSelect = selectedEles[0];\n var lstSelect = selectedEles[selectedEles.length - 1];\n if (cols) {\n var flipStart = flipFlipIdx(Math.min(flipIdx(selectionMinPivot), flipIdx(selectionMaxPivot),\n flipIdx(frstSelect), flipIdx(lstSelect)));\n var flipEnd = flipFlipIdx(Math.max(flipIdx(selectionMinPivot), flipIdx(selectionMaxPivot),\n flipIdx(frstSelect), flipIdx(lstSelect)));\n selectElemsDownRows(Math.min(flipStart, flipEnd), Math.max(flipStart, flipEnd));\n } else {\n var start = Math.min(selectionMinPivot, frstSelect);\n var end = Math.max(selectionMaxPivot, lstSelect);\n selectElemRange(start, end);\n }\n }\n // If not left mouse button then leave it for someone else\n if (event.which != LEFT_MOUSE_BUTTON) {\n return;\n }\n // Just a click - make selection current row/column clicked on\n if (!event.ctrlKey && !event.shiftKey) {\n clearAll();\n selectEles(selectedEles);\n selectionMinPivot = selectedEles[0];\n selectionMaxPivot = selectedEles[selectedEles.length - 1];\n return;\n }\n // Cntrl/Shift click - add to current selections cells between (inclusive) last single selection and cell\n // clicked on\n if (event.ctrlKey && event.shiftKey) {\n selectRange();\n return;\n }\n // Cntrl click - keep current selections and add toggle of selection on the single cell clicked on\n if (event.ctrlKey) {\n toggleEles(selectedEles);\n selectionMinPivot = selectedEles[0];\n selectionMaxPivot = selectedEles[selectedEles.length - 1];\n return;\n }\n // Shift click - make current selections cells between (inclusive) last single selection and cell clicked on\n if (event.shiftKey) {\n clearAll();\n selectRange();\n }\n }", "title": "" }, { "docid": "1fae9d54b9c3af9755560aeab5976287", "score": "0.44236267", "text": "function SelectionChange() {}", "title": "" }, { "docid": "1fae9d54b9c3af9755560aeab5976287", "score": "0.44236267", "text": "function SelectionChange() {}", "title": "" }, { "docid": "1fae9d54b9c3af9755560aeab5976287", "score": "0.44236267", "text": "function SelectionChange() {}", "title": "" }, { "docid": "1fae9d54b9c3af9755560aeab5976287", "score": "0.44236267", "text": "function SelectionChange() {}", "title": "" }, { "docid": "391def37897d1fef53b0375a175422a2", "score": "0.44226086", "text": "function SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\t\n\t\n\t// imports\n\tvar calendar = t.calendar;\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t// TODO: unbind on destroy\n\t\t$(document).mousedown(function(ev) {\n\t\t\tvar ignore = opt('unselectCancel');\n\t\t\tif (ignore) {\n\t\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunselect(ev);\n\t\t});\n\t}\n\t\n\n\tfunction select(start, end) {\n\t\tunselect();\n\n\t\tstart = calendar.moment(start);\n\t\tif (end) {\n\t\t\tend = calendar.moment(end);\n\t\t}\n\t\telse {\n\t\t\tend = defaultSelectionEnd(start);\n\t\t}\n\n\t\trenderSelection(start, end);\n\t\treportSelection(start, end);\n\t}\n\t// TODO: better date normalization. see notes in automated test\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(start, end, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, start, end, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(\n\t\t\t\t\t\tdates[0],\n\t\t\t\t\t\tdates[1].clone().add('days', 1) // make exclusive\n\t\t\t\t\t);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(\n\t\t\t\t\t\tdates[0],\n\t\t\t\t\t\tdates[1].clone().add('days', 1), // make exclusive\n\t\t\t\t\t\tev\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n}", "title": "" }, { "docid": "d4c8fd311c047abc84cf9448723cf22d", "score": "0.44215757", "text": "triggerSelected() {\n let cachedValues = this.cachedValues\n let self = this\n let values = new Array()\n this.iterateChecks((index, line, box, span) => {\n if (box.prop(\"checked\")) {\n // Update the \"selected\" property\n cachedValues[index][1] = true\n values.push(cachedValues[index])\n }\n })\n this.model.SetSelected(values)\n super.triggerSelected()\n }", "title": "" }, { "docid": "5034d760eddd02fbd3f30a8714bc7a9a", "score": "0.44208568", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "5034d760eddd02fbd3f30a8714bc7a9a", "score": "0.44208568", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "5034d760eddd02fbd3f30a8714bc7a9a", "score": "0.44208568", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "5034d760eddd02fbd3f30a8714bc7a9a", "score": "0.44208568", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "5034d760eddd02fbd3f30a8714bc7a9a", "score": "0.44208568", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "5034d760eddd02fbd3f30a8714bc7a9a", "score": "0.44208568", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "5034d760eddd02fbd3f30a8714bc7a9a", "score": "0.44208568", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "5034d760eddd02fbd3f30a8714bc7a9a", "score": "0.44208568", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "5034d760eddd02fbd3f30a8714bc7a9a", "score": "0.44208568", "text": "function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }", "title": "" }, { "docid": "ec55509f1fa51d168e5cbe631a6cba64", "score": "0.44189656", "text": "highlightSelection(isSelectionChanged) {\n if (this.owner.enableImageResizerMode) {\n this.owner.imageResizerModule.hideImageResizer();\n }\n if (this.isEmpty) {\n if (this.isHideSelection(this.start.paragraph)) {\n this.hideCaret();\n return;\n }\n this.updateCaretPosition();\n }\n else {\n if (this.isForward) {\n this.highlightSelectedContent(this.start, this.end);\n }\n else {\n this.highlightSelectedContent(this.end, this.start);\n }\n if (this.viewer.isComposingIME) {\n this.updateCaretPosition();\n }\n }\n this.viewer.updateTouchMarkPosition();\n if (isSelectionChanged) {\n this.viewer.scrollToPosition(this.start, this.end);\n }\n }", "title": "" }, { "docid": "0c987e9fe61f7bf5a2f6a4ca624be632", "score": "0.44136867", "text": "function setClimateSelected(){\n el.climate_selected = $('.climate-variables-map :selected:first').val();\n console.log(\"setClimateSelected - mapui is:\", el.climate_selected);\n $(\"select\").material_select();\n }", "title": "" }, { "docid": "fdc9427b5b53807d9238053b0ebb10da", "score": "0.44004396", "text": "select(item) {\n const that = this;\n\n if (typeof item === 'string') {\n item = that.getItem(item);\n if (!item) {\n return;\n }\n }\n if (typeof item === 'number') {\n item = that.getItem(item);\n if (!item) {\n return;\n }\n }\n\n if (item.grouped || item.readonly) {\n return;\n }\n\n if (that.selectionMode === 'none') {\n that.selectedIndexes = [];\n that.selectedValues = [];\n return;\n }\n\n if (!that._focusedItem !== item && that.selectionMode !== 'none') {\n if (that._focusedItem) {\n that._focusedItem._focused = false;\n }\n\n that._focusedItem = item;\n item._focused = true;\n }\n\n switch (that.selectionMode) {\n case 'one':\n if (that.selectedIndexes.length === 1 && that.selectedIndexes[0] === that._indexOf(item)) {\n return false;\n }\n\n that._previouslySelectedIndexes = that.selectedIndexes;\n\n if (that.selectedIndexes.length >= 1) {\n that.clearSelection();\n }\n\n that._select(item);\n delete that._previouslySelectedIndexes;\n return true;\n case 'zeroOrOne':\n if (that.selectedIndexes.length === 1 && that.selectedIndexes[0] === that._indexOf(item)) {\n that.unselect(item);\n return true;\n }\n\n that._previouslySelectedIndexes = that.selectedIndexes;\n\n if (that.selectedIndexes.length >= 1) {\n that.clearSelection();\n }\n\n that._select(item);\n delete that._previouslySelectedIndexes;\n return true;\n case 'radioButton':\n that._previouslySelectedIndexes = that.selectedIndexes;\n\n if (that.$.itemsInnerContainer.querySelectorAll('jqx-list-items-group').length > 0) {\n const group = item.parentNode;\n\n\n if (!item.selected) {\n for (let index in group.children) {\n const item = group.children[index];\n\n if (item.selected) {\n that.unselect(item);\n }\n }\n\n that._select(item);\n }\n\n delete that._previouslySelectedIndexes;\n return true;\n }\n else if (that.isVirtualized && that._groups.length > 0) {\n const group = item.group;\n\n if (!item.selected) {\n for (let index in group.items) {\n const item = group.items[index];\n\n if (item.selected) {\n that.unselect(item);\n }\n }\n\n that._select(item);\n }\n\n delete that._previouslySelectedIndexes;\n return true;\n }\n\n\n if (!item.selected) {\n if (that.selectedIndexes.length >= 1) {\n that.clearSelection();\n }\n\n that._select(item);\n }\n\n delete that._previouslySelectedIndexes;\n return true;\n case 'oneOrMany':\n if (!item.selected) {\n that._select(item);\n }\n else if (that.selectedIndexes.length > 1) {\n that.unselect(item);\n }\n return true;\n case 'zeroOrMany':\n case 'checkBox':\n if (!item.selected) {\n that._select(item);\n }\n else {\n that.unselect(item);\n }\n return true;\n case 'oneOrManyExtended': {\n const selectedValues = that.selectedValues;\n\n if (that._keysPressed['Control']) {\n if (that.selectedIndexes.length > 1) {\n if (item.selected) {\n that.unselect(item);\n that._focus(that._items[that.selectedIndexes[0]]);\n }\n else {\n that._select(item);\n }\n }\n else {\n that._select(item);\n }\n return true;\n }\n\n if (that._keysPressed['Shift']) {\n const selectedItem = that._items[that.selectedIndexes[0]];\n let index;\n\n that.clearSelection();\n\n const preventEvent = selectedValues.indexOf(selectedItem.value) >= 0 || selectedItem.selected;\n\n that._select(selectedItem, preventEvent);\n\n if (that._indexOf(selectedItem) > that._indexOf(item)) {\n index = that._indexOf(selectedItem) - 1;\n while (index >= that._indexOf(item)) {\n const item = that._items[index];\n const preventEvent = selectedValues.indexOf(item.value) >= 0 || item.selected;\n\n that._select(item, preventEvent);\n index--;\n }\n }\n else {\n index = that._indexOf(selectedItem) + 1;\n while (index <= that._indexOf(item)) {\n const item = that._items[index];\n const preventEvent = selectedValues.indexOf(item.value) >= 0 || item.selected;\n\n that._select(item, preventEvent);\n index++;\n }\n }\n\n const unselectedItems = [];\n\n for (let i = 0; i < selectedValues.length; i++) {\n unselectedItems.push(that.getItem(selectedValues[i]));\n }\n\n if (unselectedItems.length > 0 && !that._propertyChanging) {\n let selectedItems = [];\n\n for (let i = 0; i < that.selectedValues.length; i++) {\n const previousSelectedValue = that.selectedValues[i];\n\n if (selectedValues.indexOf(previousSelectedValue) < 0) {\n selectedItems.push(that.getItem(previousSelectedValue));\n }\n }\n\n that.$.fireEvent('change', {\n 'addedItems': selectedItems,\n 'removedItems': unselectedItems,\n 'selected': item.selected,\n 'disabled': item.disabled,\n 'index': that._indexOf(item),\n 'label': item.label,\n 'value': item.value\n });\n }\n\n return true;\n }\n\n for (let i = 0; i < selectedValues.length; i++) {\n const value = selectedValues[i];\n const selectedItem = that.getItem(value)\n\n if (item !== selectedItem) {\n that.unselect(selectedItem);\n }\n }\n\n that.clearSelection();\n that._select(item, selectedValues.indexOf(item.value) >= 0);\n return true;\n\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "531bb5b448ebfaeacd782bf3fd038558", "score": "0.43962693", "text": "function highlightMatch() {\n //if no matches, just clear the document\n if (!obj.hasMatch) { \n try {clearAll(chromeWindow, header); fireMouseEvent(\"click\", chromeWindow.content.wrappedJSObject.document.body); return;}\n catch(err) {return;} \n }\n //if XUL searching, don't do anything because red highlighting throws an error\n if (instanceOf(obj.document, XULDocument)) {return;}\n //then highlight all or just one, depending on whether they clicked on an expanded match object or not\n var win = obj.document.defaultView;\n if (!obj._toExpand) {\n clearAll(chromeWindow, obj);\n try {selectAll(win, obj);} catch (err) {debug(err)}\n header.style.color = 'red';\n header.title = 'black';\n }\n else {\n clearAll(chromeWindow, obj);\n var matchToSelect = oneMatch(obj);\n try {selectAll(obj.document.defaultView, matchToSelect);} catch (err) {debug(err)}\n header.childNodes[2].style.color = 'red';\n header.title = 'green';\n }\n }", "title": "" }, { "docid": "449830cf444e2ff20d670ca57b4519d9", "score": "0.43962097", "text": "function highlightMatchesInAllRelevantCells (cm) {\n\t\tvar newOverlay = null;\n\n\t\tvar re = params.show_token === true ? /[\\w$]/ : params.show_token;\n\t\tvar from = cm.getCursor('from');\n\t\tif (!cm.somethingSelected() && params.show_token) {\n\t\t\tvar line = cm.getLine(from.line), start = from.ch, end = start;\n\t\t\twhile (start && re.test(line.charAt(start - 1))) {\n\t\t\t\t--start;\n\t\t\t}\n\t\t\twhile (end < line.length && re.test(line.charAt(end))) {\n\t\t\t\t++end;\n\t\t\t}\n\t\t\tif (start < end) {\n\t\t\t\tnewOverlay = makeOverlay(line.slice(start, end), re, params.highlight_style);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tvar to = cm.getCursor(\"to\");\n\t\t\tif (from.line == to.line) {\n\t\t\t\tif (!params.words_only || isWord(cm, from, to)) {\n\t\t\t\t\tvar selection = cm.getRange(from, to);\n\t\t\t\t\tif (params.trim) {\n\t\t\t\t\t\tselection = selection.replace(/^\\s+|\\s+$/g, \"\");\n\t\t\t\t\t}\n\t\t\t\t\tif (selection.length >= params.min_chars) {\n\t\t\t\t\t\tvar hasBoundary = params.highlight_only_whole_words ? (re instanceof RegExp ? re : /[\\w$]/) : false;\n\t\t\t\t\t\tnewOverlay = makeOverlay(selection, hasBoundary, params.highlight_style);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar cells = params.highlight_across_all_cells ? get_relevant_cells() : [\n\t\t\t$(cm.getWrapperElement()).closest('.cell').data('cell')\n\t\t];\n\t\tvar oldOverlay = globalState.overlay; // cached for later function\n\t\tglobalState.overlay = newOverlay;\n\t\tcells.forEach(function (cell, idx, array) {\n\t\t\t// cm.operation to delay updating DOM until all work is done\n\t\t\tcell.code_mirror.operation(function () {\n\t\t\t\tcell.code_mirror.removeOverlay(oldOverlay);\n\t\t\t\tif (newOverlay) {\n\t\t\t\t\tcell.code_mirror.addOverlay(newOverlay);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "456c3b2f65c2eab75abf66d6a4aca1a6", "score": "0.43845394", "text": "function displaySelections(){\r\n //defaults\r\n Session.set('breaksOption','origOption');\r\n Session.set('highlightElement','line');\r\n Session.set('boldElement','boldLine');\r\n Session.set('syllablesVisible','true');\r\n Session.set('stressVisible', 'true');\r\n \r\n var selectionsCursor = Selections.find({poem_id:Session.get('currentPoem')});\r\n selectionsCursor.observe({\r\n //when something is added to the Selections Collection\r\n added: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n var styleID = selection.style_id;\r\n var style = Styles.find({_id:styleID}).fetch();\r\n //used to catch errors\r\n if (style.length > 0){\r\n var layerNodeID = style[0].layer_id;\r\n var layerID = Layers.findOne({poem_id: Session.get('currentPoem'), id: layerNodeID})._id;\r\n //if selection is from highlighting style/layer\r\n if ((style[0].background_color !== null)&&(typeof style[0].background_color !== \"undefined\")) {\r\n var rgba = style[0].background_color;\r\n var lastIndex = rgba.lastIndexOf(\",\");\r\n var substring = rgba.substr(0, lastIndex+1);\r\n //check opacity of layer that made the selection\r\n var curRGBA = substring+' ';\r\n var op = Layers.findOne(layerID).opacity;\r\n var newRGBA = curRGBA+op+\")\";\r\n console.log(newRGBA);\r\n $(\".\"+location).css(\r\n {\r\n \"background\": newRGBA\r\n });\r\n }\r\n //if selection is from bolding style/layer\r\n if ((style[0].font_color !== null)&&(typeof style[0].font_color !== \"undefined\")) {\r\n var substring = style[0].font_color;\r\n $(\".\"+location).css(\r\n {\r\n \"color\": substring\r\n }\r\n );\r\n }\r\n //if selection is from bolding style/layer\r\n if ((style[0].bold !== null)&&(typeof style[0].bold !== \"undefined\")) {\r\n var substring = style[0].bold;\r\n if (substring){\r\n $(\".\"+location).css(\r\n {\r\n \"font-weight\": \"bold\"\r\n }\r\n );\r\n $(\".\"+location).addClass(\"bold\"+style[0].font_color);\r\n }\r\n }\r\n //if selection is from stressing style/layer\r\n if((style[0].verticalAlign !== null)&&(typeof style[0].verticalAlign !== \"undefined\")){\r\n location = location.substr(1);\r\n if (Session.get('stressVisible')==\"true\"){\r\n $('.'+location).css('vertical-align','super');\r\n }\r\n $('.'+location).addClass('stressStyle');\r\n }\r\n }\r\n },\r\n //when something is removed from the Selections Collection\r\n removed: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n var styleID = selection.style_id;\r\n var curLayerNodeID = selection.layerNode_id;\r\n var style = Styles.find({_id:styleID}).fetch();\r\n console.log(style);\r\n //used to catch errors\r\n if (style.length > 0){\r\n //if removed is highlighting\r\n if ((style[0].background_color !== undefined)) {\r\n //must go through all selections that may have colored line/word/character to check and\r\n //see if after one background-color is turned off, there is another (from another layer)\r\n //still coloring that line/word/character\r\n var curRGBA = \"transparent\";\r\n var allSelections = Selections.find({poem_id: Session.get('currentPoem'), location: location}).fetch();\r\n console.log(allSelections);\r\n _.each(allSelections, function(sel){\r\n var piece = sel.style_id; \r\n var otherStyle = Styles.findOne({_id: piece});\r\n if ((otherStyle !== undefined)){\r\n if ((otherStyle.background_color !== undefined)){\r\n op = Layers.findOne({id:otherStyle.layer_id}).opacity;\r\n var rgba = otherStyle.background_color;\r\n var lastIndex = rgba.lastIndexOf(\",\");\r\n var substring = rgba.substr(0, lastIndex+1);\r\n //check opacity of layer that made the selection\r\n curRGBA = substring;\r\n var newRGBA = curRGBA+op+\")\";\r\n if (otherStyle.layer_id != curLayerNodeID){\r\n curRGBA = newRGBA;\r\n console.log(curRGBA);\r\n }\r\n }\r\n }\r\n });\r\n $(\".\"+location).css(\r\n {\r\n \"background-color\": curRGBA\r\n }\r\n );\r\n\r\n }\r\n //if removed selection is bolding\r\n if ((style[0].font_color !== null)&&(typeof style[0].font_color !== \"undefined\")) {\r\n $(\".\"+location).css(\r\n {\r\n \"color\": \"black\"\r\n }\r\n );\r\n $(\".\"+location).removeClass(\"bold\"+style[0].font_color);\r\n }\r\n //if removed selection is bolding\r\n if ((style[0].bold !== null)&&(typeof style[0].bold !== \"undefined\")) {\r\n //so that word can be bolded if line is bolded\r\n $(\".\"+location).css(\"font-weight\",\"\");\r\n $(\".\"+location).css(\"color\",\"\");\r\n }\r\n //if removed selection is stressing\r\n if((style[0].verticalAlign !== null)&&(typeof style[0].verticalAlign !== \"undefined\")){\r\n location = location.substr(1);\r\n $('.'+location).css('vertical-align','baseline');\r\n $('.'+location).removeClass('stressStyle');\r\n }\r\n }\r\n }\r\n });\r\n //handles additions/removals from SyllableMarkers Collection\r\n var syllablesCursor = SyllableMarkers.find({poem_id:Session.get('currentPoem')});\r\n syllablesCursor.observe({\r\n added: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n if (Session.get('syllablesVisible')==\"true\"){\r\n $(\".\"+location).css(\r\n {\r\n \"border-left\": \"2px solid black\"\r\n });\r\n }\r\n $(\".\"+location).addClass('syllableStyle');\r\n //updates natural syllables\r\n var lineSpan = $('#'+location).closest('.line');\r\n var countSpan = $(lineSpan).find('.lineCount');\r\n var wordCount=$(lineSpan).find('.word').length;\r\n var sylCount=0;\r\n $(lineSpan).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount++; \r\n }\r\n })\r\n $(countSpan).text(wordCount+sylCount);\r\n //updates other versions' syllable markers \r\n var lineSpanArray = $('.'+location).closest('.unnaturalLine');\r\n var countSpan1 = $(lineSpanArray[0]).find('.lineCount');\r\n var countSpan2 = $(lineSpanArray[1]).find('.lineCount');\r\n var wordArray1=$(lineSpanArray[0]).find('.word');\r\n var wordArray2=$(lineSpanArray[1]).find('.word');\r\n var wordCount1 = 0;\r\n var wordCount2 = 0;\r\n //don't count the awkward spaces created by new lines\r\n _.each(wordArray1, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount1++;\r\n }\r\n });\r\n _.each(wordArray2, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount2++;\r\n }\r\n });\r\n var sylCount1=0;\r\n var sylCount2=0; \r\n $(lineSpanArray[0]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount1++; \r\n }\r\n });\r\n $(lineSpanArray[1]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount2++; \r\n }\r\n });\r\n $(countSpan1).text(wordCount1+sylCount1);\r\n $(countSpan2).text(wordCount2+sylCount2);\r\n if ($('.syllablesGrid').data('gridded')===true){\r\n grid();\r\n grid();\r\n }\r\n },\r\n removed: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n $(\".\"+location).css(\r\n {\r\n \"border-left\": \"none\"\r\n });\r\n $(\".\"+location).removeClass('syllableStyle');\r\n var lineSpan = $('#'+location).closest('.line');\r\n var countSpan = $(lineSpan).find('.lineCount');\r\n var wordCount=$(lineSpan).find('.word').length;\r\n var sylCount=0;\r\n $(lineSpan).find('.letter').each(function(){\r\n console.log($(this).css(\"border-left\"));\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount++; \r\n }\r\n })\r\n $(countSpan).text(wordCount+sylCount);\r\n //updates other versions' syllable markers \r\n var lineSpanArray = $('.'+location).closest('.unnaturalLine');\r\n var countSpan1 = $(lineSpanArray[0]).find('.lineCount');\r\n var countSpan2 = $(lineSpanArray[1]).find('.lineCount');\r\n var wordArray1=$(lineSpanArray[0]).find('.word');\r\n var wordArray2=$(lineSpanArray[1]).find('.word');\r\n var wordCount1 = 0;\r\n var wordCount2 = 0;\r\n //don't count the awkward spaces created by new lines\r\n _.each(wordArray1, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount1++;\r\n }\r\n });\r\n _.each(wordArray2, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount2++;\r\n }\r\n });\r\n var sylCount1=0;\r\n var sylCount2=0; \r\n $(lineSpanArray[0]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount1++; \r\n }\r\n });\r\n $(lineSpanArray[1]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount2++; \r\n }\r\n });\r\n $(countSpan1).text(wordCount1+sylCount1);\r\n $(countSpan2).text(wordCount2+sylCount2);\r\n if ($('.syllablesGrid').data('gridded')===true){\r\n grid();\r\n grid();\r\n }\r\n },\r\n });\r\n //handles changes from Layers Collection\r\n var layersCursor = Layers.find({poem_id:Session.get('currentPoem')});\r\n layersCursor.observe({ \r\n added: function (selection, beforeIndex) {\r\n var sessionObj = Session.get(\"layersArray\");\r\n //if layer just created, user probably wants to use it, so default \"visible\"\r\n sessionObj[selection._id] = \"visible\";\r\n Session.set(\"layersArray\", sessionObj);\r\n },\r\n });\r\n\r\n}", "title": "" }, { "docid": "acb8335ba8b3ab70159d92453223207a", "score": "0.4369391", "text": "function filterMajors() {\n let menu = document.querySelector('select');\n let selected = menu.options[menu.selectedIndex].text;\n let cards = document.querySelectorAll('.card');\n for (let i = 0; i < cards.length; i++) {\n if (cards[i].classList.contains(\"d-none\")) {\n cards[i].classList.remove(\"d-none\");\n }\n }\n if (selected !== \"No filter\") {\n if (selected === \"Bachelor of Sciences\") {\n for (let i = 0; i < cards.length; i++) {\n if (!cards[i].classList.contains(\"bs\")) {\n cards[i].classList.add(\"d-none\");\n }\n }\n }\n else if (selected === \"Bachelor of Arts\") {\n for (let i = 0; i < cards.length; i++) {\n if (!cards[i].classList.contains(\"ba\")) {\n cards[i].classList.add(\"d-none\");\n }\n }\n }\n else if (selected === \"Capacity-contrained major\") {\n for (let i = 0; i < cards.length; i++) {\n if (!cards[i].classList.contains(\"cap\")) {\n cards[i].classList.add(\"d-none\");\n }\n }\n }\n else if (selected === \"Minimum major\") {\n for (let i = 0; i < cards.length; i++) {\n if (!cards[i].classList.contains(\"min\")) {\n cards[i].classList.add(\"d-none\");\n }\n }\n }\n else if (selected === \"Open major\") {\n for (let i = 0; i < cards.length; i++) {\n if (!cards[i].classList.contains(\"open\")) {\n cards[i].classList.add(\"d-none\");\n }\n }\n }\n }\n \n}", "title": "" }, { "docid": "347a772cf8a1aa45b444a79c0584aead", "score": "0.43658614", "text": "function DistSet()\n{\n var newDistCode = args[\"district\"];\n if (newDistCode === undefined)\n return true;\n\n var distSelect = document.distForm.District;\n var distOpts = distSelect.options;\n for(var i = 0; i < distOpts.length; i++)\n {\n if (distOpts[i].value == newDistCode)\n { // found matching entry\n distSelect.selectedIndex = i;\n changeDist(); \n return false;\n } // found matching entry\n } // search for distince to select\n return true;\n}", "title": "" }, { "docid": "3cf3cdcd92043634b590c2d944ca71b3", "score": "0.43657857", "text": "function isSelectableResult(result)\n{\n return (result == \"SUCCESS\" || result == \"PARTIAL\");\n}", "title": "" }, { "docid": "d49cc3375dc295c886b8418d062d04b5", "score": "0.43633026", "text": "static selectionsSameMeasure(selections) {\n let i = 0;\n if (selections.length < 2) {\n return true;\n }\n const sel1 = selections[0].selector;\n for (i = 1; i < selections.length; ++i) {\n if (!SmoSelector.sameMeasure(sel1, selections[i].selector)) {\n return false;\n }\n }\n return true;\n }", "title": "" } ]
b4ea9e219b1945964583b00a203512f3
! Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at THIS CODE IS PROVIDED ON AN AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NONINFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
[ { "docid": "537b33745a33fe2c84c2afbb09d773cf", "score": "0.0", "text": "function l(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,l=a.length;i<l;i++,o++)n[o]=a[i];return n}", "title": "" } ]
[ { "docid": "e9006a0083af3523b8963996e92482e3", "score": "0.5463907", "text": "isSupported() {\n return true;\n }", "title": "" }, { "docid": "e94ba4c29d9a5004778bee2349f60ac1", "score": "0.5167391", "text": "async function getAzureHeaders() {\n // get active account that was set up in AzureApp component\n const account = msalInstance.getActiveAccount();\n // Identify scope and and account to request token silently\n const silentRequest = { account, scopes: [process.env.REACT_APP_AZURE_API_TOKEN_SCOPE] };\n try {\n // No account mean that user wa not signed in, we can not acquire tokens, so we will return empty headers object.\n if (!account) throw InteractionRequiredAuthError.createNoTokensFoundError();\n // token is in local storage we will get it from there, if it is expired we will get a fresh one.\n const tokens = await msalInstance.acquireTokenSilent(silentRequest);\n // return headers object with access token to append to request.\n return {\n Authorization: 'Bearer ' + tokens.accessToken,\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n };\n } catch (error) {\n console.log('-----failed to get tokens-------------------------------------');\n console.dir({ error });\n\n // in case if silent token acquisition fails, fallback to an interactive method\n if (error instanceof InteractionRequiredAuthError) {\n // This method will initiate a full-frame redirect and the response will be handled when returning to the application.\n // When this component is rendered after returning from the redirect, acquireTokenSilent should now succeed\n // as the tokens will be pulled from the cache.\n msalInstance.acquireTokenRedirect(silentRequest);\n //we could use popup but we do not allow iframes;\n // const tokens = await msalInstance.acquireTokenPopup(silentRequest);\n\n // return {\n // Authorization: 'Bearer ' + tokens.accessToken,\n // Accept: 'application/json',\n // 'Content-Type': 'application/json',\n // };\n }\n // failed to get token from localstorage and by interactive request, use is not allowed to go further, backend will respond with 401\n return {};\n }\n}", "title": "" }, { "docid": "98af074a05cb248c2631db2dc68ad089", "score": "0.505966", "text": "function get_azure_storage_headers(accountname, accountkey, resource, method, headers, canonicalized_params) {\n const msdate = (new Date).toUTCString();\n const params = canonicalized_params ? `\\n${canonicalized_params}` : \"\";\n const inputvalue = method + \"\\n\" + /*VERB*/\n\t (headers[\"Content-Encoding\"] ? headers[\"Content-Encoding\"] : \"\") + \"\\n\" +\n\t (headers[\"Content-Language\"] ? headers[\"Content-Language\"] : \"\") + \"\\n\" +\n\t (headers[\"Content-Length\"] ? headers[\"Content-Length\"] : \"\") + \"\\n\" +\n\t (headers[\"Content-MD5\"] ? headers[\"Content-MD5\"] : \"\") + \"\\n\" +\n\t (headers[\"Content-Type\"] ? headers[\"Content-Type\"] : \"\") + \"\\n\" +\n\t \"\\n\" + /*Date*/\n\t \"\\n\" + /*If-Modified-Since*/\n\t \"\\n\" + /*If-Match*/\n\t \"\\n\" + /*If-None-Match*/\n\t \"\\n\" + /*If-Unmodified-Since*/\n\t \"\\n\" + /*Range*/\n\t (headers[\"x-ms-blob-type\"] ? `x-ms-blob-type:${headers[\"x-ms-blob-type\"]}\\n` : \"\") +\n\t `x-ms-date:${msdate}\\n` +\n\t (headers[\"x-ms-delete-snapshots\"] ? `x-ms-delete-snapshots:${headers[\"x-ms-delete-snapshots\"]}\\n` : \"\") +\n\t \"x-ms-version:2017-04-17\\n\" +\n\t `/${accountname}/${resource}${params}`;\n\n const key = new Buffer(accountkey, \"base64\");\n let hmac = crypto.createHmac(\"sha256\", key);\n hmac.update(inputvalue);\n const signature = hmac.digest(\"base64\");\n\n let result = headers;\n result[\"User-Agent\"] = \"nodejs\";\n result[\"x-ms-version\"] = \"2017-04-17\";\n result[\"x-ms-date\"] = msdate;\n result[\"Authorization\"] = `SharedKey ${accountname}:${signature}`;\n return result;\n}", "title": "" }, { "docid": "7df7dcccd707e46927c77fe3d8080596", "score": "0.49465415", "text": "function Metadata () {\n\n function _constr() {\n // nothing to initialize\n }\n\n _constr.apply(this, arguments);\n\n // Relying on HTTP user agent string parsing on the Conviva Platform.\n this.getBrowserName = function () {\n return null;\n };\n\n // Relying on HTTP user agent string parsing on the Conviva Platform.\n this.getBrowserVersion = function () {\n return null;\n };\n\n // Relying on HTTP user agent string parsing on the Conviva Platform.\n this.getDeviceBrand = function () {\n return null;\n };\n\n // Relying on HTTP user agent string parsing on the Conviva Platform.\n this.getDeviceManufacturer = function () {\n return null;\n };\n\n // Relying on HTTP user agent string parsing on the Conviva Platform.\n this.getDeviceModel = function () {\n return null;\n };\n\n // Relying on HTTP user agent string parsing on the Conviva Platform.\n this.getDeviceType = function () {\n return Conviva.Client.DeviceType.DESKTOP;\n };\n\n // There is no value we can access that qualifies as the device version.\n this.getDeviceVersion = function () {\n return null;\n };\n\n // HTML5 can qualify as an application framework of sorts.\n this.getFrameworkName = function () {\n return \"HTML5\";\n };\n\n // No convenient way to detect HTML5 version.\n this.getFrameworkVersion = function () {\n return null;\n };\n\n // Relying on HTTP user agent string parsing on the Conviva Platform.\n this.getOperatingSystemName = function () {\n return null;\n };\n\n // Relying on HTTP user agent string parsing on the Conviva Platform.\n this.getOperatingSystemVersion = function () {\n return null;\n };\n\n // Relying on HTTP user agent string parsing on the Conviva Platform.\n this.getDeviceCategory = function () {\n return Conviva.Client.DeviceCategory.WEB;\n };\n\n this.release = function() {\n // nothing to release\n };\n\n}", "title": "" }, { "docid": "d83f1888eb093fb2a0b70d70325b2a66", "score": "0.49008325", "text": "function getClientVersion () { return '0.16.1' }", "title": "" }, { "docid": "626e1120f21252fceee91fa876ff5bb6", "score": "0.48552468", "text": "_implicitHeader() {}", "title": "" }, { "docid": "37e53076e520d209a2ed7d5a52b755af", "score": "0.4847036", "text": "function isMSALThirdPartyEnabled() {\n /* Use MSAL for 3rd Party Requests */\n return _microsoft_sp_core_library__WEBPACK_IMPORTED_MODULE_0__[\"_SPFlight\"].isEnabled(1887);\n}", "title": "" }, { "docid": "1ad9ecc467b603c07817066e4051690e", "score": "0.48093516", "text": "function ht() {\n if (!ai.C().N) throw new E(T.UNIMPLEMENTED, \"Blobs are unavailable in Firestore in this environment.\");\n}", "title": "" }, { "docid": "55b8086c41ab5796c208b2449cc21466", "score": "0.47778636", "text": "_process_performance_cache_le(){\n let prf_c = this.performance_cache\n let numRefs = prf_c.readUInt16LE(23)\n let offset = 27\n let hasUnicodeRef = (this.vba_version >= 0x5B) && (![0x60, 0x62, 0x63].includes(this.vba_version)) || (this.vba_version == 0x4E)\n let hasUnicodeName = (this.vba_version >= 0x59) && (![0x60, 0x62, 0x63].includes(this.vba_version)) || (this.vba_version == 0x4E)\n let hasNonUnicodeName = (this.vba_version <= 0x59) && (this.vba_version != 0x4E) || (this.vba_version > 0x6B && this.vba_version < 0x5F)\n\n //PROJECTLCID lcid must be 0x00000409\n //https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-ovba/1136037b-5e9e-4e2d-81f8-615ace60be9d\n let references = []\n //Definicion de modulos\n for(let i_ref = 0; i_ref < numRefs; i_ref++){\n let refLength = prf_c.readUInt16LE(offset)\n if(refLength < 40){\n let refString = prf_c.slice(offset + 2, offset + 2 + refLength).toString('utf16le')\n if(refString === '*\\\\CNormal'){\n offset += refLength*2 + 16\n i_ref--;\n }else{\n offset += refLength + 2\n }\n \n continue;\n }\n if(hasUnicodeRef){\n //Similar as https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-ovba/3737ef6e-d819-4186-a5f2-6e258ddf66a5\n let refString = prf_c.slice(offset + 2, offset + 2 + refLength).toString('utf16le')\n offset += 2 + refLength\n if(prf_c.readUInt32LE(offset + 6) == 0x00){\n offset += 12\n }else{\n i_ref--;\n }\n references.push(refString)\n continue;\n }\n }\n let pos_mod = prf_c.indexOf(Uint8Array.from([0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]),offset)\n if(pos_mod < 0){\n throw new Error(\"Cannot parse pcode\")\n }\n offset = pos_mod + 23\n \n let numModules = prf_c.readUInt16LE(offset);\n offset += 2\n for(let i_mod = 0; i_mod < numModules; i_mod++){\n let size_name = prf_c.readUInt16LE(offset);\n let mod_name = prf_c.slice(offset + 2,offset + 2 + size_name).toString('utf16le');\n offset += 2 + size_name\n let ref_size = prf_c.readUInt16LE(offset);\n let ref_name = prf_c.slice(offset + 2,offset + 2 + ref_size).toString('utf16le');\n offset += 6 + ref_size\n size_name = prf_c.readUInt16LE(offset);\n let name2 = prf_c.slice(offset + 2,offset + 2 + size_name).toString('utf16le');\n offset += 23 + size_name\n this.modules.push({\n name: mod_name,\n name2,\n ref : ref_name\n })\n }\n //Skip the module descriptors\n //Module\n //Module size\n //module string\n //26 bytes basura\n //module size 2\n //module string\n\n }", "title": "" }, { "docid": "6f61fe8f86c8697e2c8273338f1b4387", "score": "0.47301152", "text": "function vc() {\n if (\"undefined\" == typeof atob) throw new T(E.UNIMPLEMENTED, \"Blobs are unavailable in Firestore in this environment.\");\n}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.4709182", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "c264c61305af2dd51cc545b2ed802032", "score": "0.46937445", "text": "_detectCopyrightVersion() {\n return '0.0.0'\n }", "title": "" }, { "docid": "82eb2edafdd173d795cc908fcfb0fcf1", "score": "0.4668519", "text": "constructor(credentials, subscriptionId, options) {\n var _a, _b;\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (subscriptionId === undefined) {\n throw new Error(\"'subscriptionId' cannot be null\");\n }\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials\n };\n const packageDetails = `azsdk-js-arm-compute/18.0.0`;\n const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n if (!options.credentialScopes) {\n options.credentialScopes = [\"https://management.azure.com/.default\"];\n }\n const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {\n userAgentPrefix\n }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : \"https://management.azure.com\" });\n super(optionsWithDefaults);\n if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===\n coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge\n }\n }));\n }\n }\n // Parameter assignments\n this.subscriptionId = subscriptionId;\n // Assigning values to Constant parameters\n this.$host = options.$host || \"https://management.azure.com\";\n this.operations = new OperationsImpl(this);\n this.usageOperations = new UsageOperationsImpl(this);\n this.virtualMachineSizes = new VirtualMachineSizesImpl(this);\n this.virtualMachineScaleSets = new VirtualMachineScaleSetsImpl(this);\n this.virtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsImpl(this);\n this.virtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesImpl(this);\n this.virtualMachineScaleSetVMExtensions = new VirtualMachineScaleSetVMExtensionsImpl(this);\n this.virtualMachineScaleSetVMs = new VirtualMachineScaleSetVMsImpl(this);\n this.virtualMachineExtensions = new VirtualMachineExtensionsImpl(this);\n this.virtualMachines = new VirtualMachinesImpl(this);\n this.virtualMachineImages = new VirtualMachineImagesImpl(this);\n this.virtualMachineImagesEdgeZone = new VirtualMachineImagesEdgeZoneImpl(this);\n this.virtualMachineExtensionImages = new VirtualMachineExtensionImagesImpl(this);\n this.availabilitySets = new AvailabilitySetsImpl(this);\n this.proximityPlacementGroups = new ProximityPlacementGroupsImpl(this);\n this.dedicatedHostGroups = new DedicatedHostGroupsImpl(this);\n this.dedicatedHosts = new DedicatedHostsImpl(this);\n this.sshPublicKeys = new SshPublicKeysImpl(this);\n this.images = new ImagesImpl(this);\n this.restorePointCollections = new RestorePointCollectionsImpl(this);\n this.restorePoints = new RestorePointsImpl(this);\n this.capacityReservationGroups = new CapacityReservationGroupsImpl(this);\n this.capacityReservations = new CapacityReservationsImpl(this);\n this.logAnalytics = new LogAnalyticsImpl(this);\n this.virtualMachineRunCommands = new VirtualMachineRunCommandsImpl(this);\n this.virtualMachineScaleSetVMRunCommands = new VirtualMachineScaleSetVMRunCommandsImpl(this);\n this.resourceSkus = new ResourceSkusImpl(this);\n this.disks = new DisksImpl(this);\n this.snapshots = new SnapshotsImpl(this);\n this.diskEncryptionSets = new DiskEncryptionSetsImpl(this);\n this.diskAccesses = new DiskAccessesImpl(this);\n this.diskRestorePointOperations = new DiskRestorePointOperationsImpl(this);\n this.galleries = new GalleriesImpl(this);\n this.galleryImages = new GalleryImagesImpl(this);\n this.galleryImageVersions = new GalleryImageVersionsImpl(this);\n this.galleryApplications = new GalleryApplicationsImpl(this);\n this.galleryApplicationVersions = new GalleryApplicationVersionsImpl(this);\n this.gallerySharingProfile = new GallerySharingProfileImpl(this);\n this.sharedGalleries = new SharedGalleriesImpl(this);\n this.sharedGalleryImages = new SharedGalleryImagesImpl(this);\n this.sharedGalleryImageVersions = new SharedGalleryImageVersionsImpl(this);\n this.communityGalleries = new CommunityGalleriesImpl(this);\n this.communityGalleryImages = new CommunityGalleryImagesImpl(this);\n this.communityGalleryImageVersions = new CommunityGalleryImageVersionsImpl(this);\n this.cloudServiceRoleInstances = new CloudServiceRoleInstancesImpl(this);\n this.cloudServiceRoles = new CloudServiceRolesImpl(this);\n this.cloudServices = new CloudServicesImpl(this);\n this.cloudServicesUpdateDomain = new CloudServicesUpdateDomainImpl(this);\n this.cloudServiceOperatingSystems = new CloudServiceOperatingSystemsImpl(this);\n }", "title": "" }, { "docid": "54e718f734e5c4d8f912784c226152df", "score": "0.46584123", "text": "storageType() { return 'AuthStorageIDB'; }", "title": "" }, { "docid": "ae637164fd625d23fe5971632a68e7b2", "score": "0.4640513", "text": "function IncClientException() {\r\n}", "title": "" }, { "docid": "f13a4c1b62fa02db282882b95734abb6", "score": "0.4639987", "text": "static get NFRETS() { return 14; }", "title": "" }, { "docid": "c90fb6f0c24897d806052b3ecb4e2848", "score": "0.46271276", "text": "function getAriaEventInfo(event) {\n var values = {\n CorrelationVector: event.vector.toString(),\n ValidationErrors: event.validationErrors,\n WebLog_FullName: event.eventName,\n WebLog_EventType: _ms_telemetry_manager_lib_EventBase__WEBPACK_IMPORTED_MODULE_0__[\"ClonedEventType\"][event.eventType]\n };\n var names = event.eventName.split(',');\n for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {\n var name_1 = names_1[_i];\n if (name_1) {\n values[\"WebLog_Type_\" + name_1] = 1;\n }\n }\n var data = event.data, context = event.context;\n if (context) {\n for (var key in context) {\n if (Object.prototype.hasOwnProperty.call(context, key)) {\n var value = context[key];\n if (value === undefined || value === null) {\n continue;\n }\n var loggingName = Object(_ms_utilities_strings_lib_index__WEBPACK_IMPORTED_MODULE_1__[\"capitalize\"])(key);\n values[loggingName] = value;\n }\n }\n }\n if (data) {\n for (var field in data) {\n if (Object.prototype.hasOwnProperty.call(data, field)) {\n var value = data[field];\n if (value === undefined || value === null) {\n continue;\n }\n var propertyMetadata = event.metadata[field];\n if (propertyMetadata) {\n var loggingName = propertyMetadata.isPrefixingDisabled\n ? Object(_ms_utilities_strings_lib_index__WEBPACK_IMPORTED_MODULE_1__[\"capitalize\"])(field)\n : Object(_ms_utilities_strings_lib_index__WEBPACK_IMPORTED_MODULE_1__[\"capitalize\"])(propertyMetadata.definedInName) + \"_\" + field;\n var type = propertyMetadata.type;\n if (type === 4 /* Object */) {\n for (var subField in value) {\n if (Object.prototype.hasOwnProperty.call(value, subField)) {\n var subValue = value[subField];\n if (subValue !== undefined && subValue !== null && subValue !== '') {\n var serializedValue = void 0;\n // Do not write values which would serialize as empty since they do not provide meaningful\n // information in instrumentation back-ends.\n if (typeof subValue === 'object') {\n // Value has already been checked for null.\n try {\n serializedValue = JSON.stringify(subValue);\n }\n catch (e) {\n serializedValue = subValue;\n }\n }\n else {\n serializedValue = subValue;\n }\n values[loggingName + \"_\" + subField.replace(/\\./g, '_')] = serializedValue;\n }\n }\n }\n }\n else {\n values[loggingName] = type === 6 /* Enum */ ? propertyMetadata.typeRef[value] : value;\n }\n }\n }\n }\n }\n return {\n name: event.isEventTypePrefixingDisabled ? names[names.length - 2] : \"ev_\" + names[names.length - 2],\n values: values\n };\n}", "title": "" }, { "docid": "0fa1e7ebcb0eaef9ea181df1ada59e8e", "score": "0.45934674", "text": "function Ic() {\n if (\"undefined\" == typeof atob) throw new D(N.UNIMPLEMENTED, \"Blobs are unavailable in Firestore in this environment.\");\n}", "title": "" }, { "docid": "0fa1e7ebcb0eaef9ea181df1ada59e8e", "score": "0.45934674", "text": "function Ic() {\n if (\"undefined\" == typeof atob) throw new D(N.UNIMPLEMENTED, \"Blobs are unavailable in Firestore in this environment.\");\n}", "title": "" }, { "docid": "fdd09e7b38c4c639e30d11534e8ebae3", "score": "0.45800358", "text": "function x(e,n,r,o){var i,a=arguments.length,s=a<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,r):o;if(\"object\"===(\"undefined\"==typeof Reflect?\"undefined\":t(Reflect))&&\"function\"==typeof Reflect.decorate)s=Reflect.decorate(e,n,r,o);else for(var u=e.length-1;u>=0;u--)(i=e[u])&&(s=(a<3?i(s):a>3?i(n,r,s):i(n,r))||s);return a>3&&s&&Object.defineProperty(n,r,s),s\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */}", "title": "" }, { "docid": "5472d154c4bb676002aa47d81f1c56dd", "score": "0.45785394", "text": "function TestFrameworkExample() {\n\n}", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.457273", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.457273", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.457273", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.457273", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.457273", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.457273", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.457273", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.457273", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.457273", "text": "constructor() {\n \n }", "title": "" }, { "docid": "7ef9f6f030afe7772e7778878f281c5a", "score": "0.45693427", "text": "@Test\n function testPL28296_PreV7AutocreateViaApi() {\n for ( i in 1..100000 ) {\n if ( i % 1000 == 0 ) {\n print( i )\n }\n //TODO - API CHANGE\n// new ClaimsOccurrence().ComIso_RRECd.Text = \"foo\"\n }\n }", "title": "" }, { "docid": "d502fd53997960ef11eda24aa6109482", "score": "0.45689392", "text": "async function annotationsList() {\n const subscriptionId = \"subid\";\n const resourceGroupName = \"my-resource-group\";\n const resourceName = \"my-component\";\n const start = \"2018-02-05T00%253A30%253A00.000Z\";\n const end = \"2018-02-06T00%253A33A00.000Z\";\n const credential = new DefaultAzureCredential();\n const client = new ApplicationInsightsManagementClient(credential, subscriptionId);\n const resArray = new Array();\n for await (let item of client.annotations.list(resourceGroupName, resourceName, start, end)) {\n resArray.push(item);\n }\n console.log(resArray);\n}", "title": "" }, { "docid": "88547f1691f8e964c484d90e87905d5f", "score": "0.45633093", "text": "function exportNodeCompatibleHeaders(e){const t=Object.assign({__proto__:null},e[MAP]),r=find(e[MAP],\"Host\");return void 0!==r&&(t[r]=t[r][0]),t}", "title": "" }, { "docid": "c6285546889f994d8b1fa6a80a3af371", "score": "0.45559224", "text": "function storageSharedKeyCredentialPolicy(options) {\n function signRequest(request) {\n request.headers.set(HeaderConstants.X_MS_DATE, new Date().toUTCString());\n if (request.body &&\n (typeof request.body === \"string\" || Buffer.isBuffer(request.body)) &&\n request.body.length > 0) {\n request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));\n }\n const stringToSign = [\n request.method.toUpperCase(),\n getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE),\n getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING),\n getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH),\n getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5),\n getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE),\n getHeaderValueToSign(request, HeaderConstants.DATE),\n getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE),\n getHeaderValueToSign(request, HeaderConstants.IF_MATCH),\n getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH),\n getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE),\n getHeaderValueToSign(request, HeaderConstants.RANGE),\n ].join(\"\\n\") +\n \"\\n\" +\n getCanonicalizedHeadersString(request) +\n getCanonicalizedResourceString(request);\n const signature = crypto.createHmac(\"sha256\", options.accountKey)\n .update(stringToSign, \"utf8\")\n .digest(\"base64\");\n request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`);\n // console.log(`[URL]:${request.url}`);\n // console.log(`[HEADERS]:${request.headers.toString()}`);\n // console.log(`[STRING TO SIGN]:${JSON.stringify(stringToSign)}`);\n // console.log(`[KEY]: ${request.headers.get(HeaderConstants.AUTHORIZATION)}`);\n }\n /**\n * Retrieve header value according to shared key sign rules.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key\n */\n function getHeaderValueToSign(request, headerName) {\n const value = request.headers.get(headerName);\n if (!value) {\n return \"\";\n }\n // When using version 2015-02-21 or later, if Content-Length is zero, then\n // set the Content-Length part of the StringToSign to an empty string.\n // https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key\n if (headerName === HeaderConstants.CONTENT_LENGTH && value === \"0\") {\n return \"\";\n }\n return value;\n }\n /**\n * To construct the CanonicalizedHeaders portion of the signature string, follow these steps:\n * 1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header.\n * 2. Convert each HTTP header name to lowercase.\n * 3. Sort the headers lexicographically by header name, in ascending order.\n * Each header may appear only once in the string.\n * 4. Replace any linear whitespace in the header value with a single space.\n * 5. Trim any whitespace around the colon in the header.\n * 6. Finally, append a new-line character to each canonicalized header in the resulting list.\n * Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string.\n *\n */\n function getCanonicalizedHeadersString(request) {\n let headersArray = [];\n for (const [name, value] of request.headers) {\n if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) {\n headersArray.push({ name, value });\n }\n }\n headersArray.sort((a, b) => {\n return a.name.toLowerCase().localeCompare(b.name.toLowerCase());\n });\n // Remove duplicate headers\n headersArray = headersArray.filter((value, index, array) => {\n if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) {\n return false;\n }\n return true;\n });\n let canonicalizedHeadersStringToSign = \"\";\n headersArray.forEach((header) => {\n canonicalizedHeadersStringToSign += `${header.name\n .toLowerCase()\n .trimRight()}:${header.value.trimLeft()}\\n`;\n });\n return canonicalizedHeadersStringToSign;\n }\n function getCanonicalizedResourceString(request) {\n const path = getURLPath(request.url) || \"/\";\n let canonicalizedResourceString = \"\";\n canonicalizedResourceString += `/${options.accountName}${path}`;\n const queries = getURLQueries(request.url);\n const lowercaseQueries = {};\n if (queries) {\n const queryKeys = [];\n for (const key in queries) {\n if (Object.prototype.hasOwnProperty.call(queries, key)) {\n const lowercaseKey = key.toLowerCase();\n lowercaseQueries[lowercaseKey] = queries[key];\n queryKeys.push(lowercaseKey);\n }\n }\n queryKeys.sort();\n for (const key of queryKeys) {\n canonicalizedResourceString += `\\n${key}:${decodeURIComponent(lowercaseQueries[key])}`;\n }\n }\n return canonicalizedResourceString;\n }\n return {\n name: storageSharedKeyCredentialPolicyName,\n async sendRequest(request, next) {\n signRequest(request);\n return next(request);\n },\n };\n}", "title": "" }, { "docid": "d13aad87b7e3faafab2ea18cb236398c", "score": "0.4554342", "text": "async setHTTPHeaders(blobHTTPHeaders, options = {}) {\n options.conditions = options.conditions || {};\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return tracingClient.withSpan(\"BlobClient-setHTTPHeaders\", options, async (updatedOptions) => {\n var _a;\n return assertResponse(await this.blobContext.setHttpHeaders({\n abortSignal: options.abortSignal,\n blobHttpHeaders: blobHTTPHeaders,\n leaseAccessConditions: options.conditions,\n modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),\n // cpkInfo: options.customerProvidedKey, // CPK is not included in Swagger, should change this back when this issue is fixed in Swagger.\n tracingOptions: updatedOptions.tracingOptions,\n }));\n });\n }", "title": "" }, { "docid": "aa1d1528903650fd64a1d81d0c51a62b", "score": "0.45452142", "text": "function demo_test() {\n document.getElementById(\"input\").value = \n`In file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager.hpp:5:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:7,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/work_item.hpp:5,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/spawn.hpp:6,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/runtime.hpp:15,\nfrom /tmp/insieme-src-39855543:11:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/acquire.hpp: In function ‘typename Requirement::region_type allscale::data_item_manager::detail::mark_owned(Requirement, std::size_t)’:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/acquire.hpp:61:66: warning: typedef ‘using location_info_type = struct allscale::data_item_manager::location_info<typename DataItemType::region_type>’ locally defined but not used [-Wunused-local-typedefs]\nusing location_info_type = location_info<region_type>;\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/acquire.hpp:63:106: warning: typedef ‘using fragment_type = typename allscale::data_item_manager::data_item_store<typename DataItemReference::data_item_type>::data_item_type::fragment_type’ locally defined but not used [-Wunused-local-typedefs]\nusing fragment_type = typename data_item_store<data_item_type>::data_item_type::fragment_type;\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/acquire.hpp: In function ‘hpx::lcos::future<allscale::lease<typename Item::data_item_type> > allscale::data_item_manager::detail::acquire(const Requirement&, const LocationInfo&)’:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/acquire.hpp:158:63: warning: typedef ‘using lease_type = struct allscale::lease<typename Item::data_item_type>’ locally defined but not used [-Wunused-local-typedefs]\nusing lease_type = allscale::lease<data_item_type>;\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/acquire.hpp:159:73: warning: typedef ‘using transfer_action_type = struct allscale::data_item_manager::detail::transfer_action<typename Requirement::data_item_type>’ locally defined but not used [-Wunused-local-typedefs]\nusing transfer_action_type = transfer_action<data_item_type>;\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/acquire.hpp:161:100: warning: typedef ‘using mutex_type = typename allscale::data_item_manager::data_item_store<typename DataItemReference::data_item_type>::data_item_type::mutex_type’ locally defined but not used [-Wunused-local-typedefs]\nusing mutex_type = typename data_item_store<data_item_type>::data_item_type::mutex_type;\n ^\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:9:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/work_item.hpp:5,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/spawn.hpp:6,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/runtime.hpp:15,\nfrom /tmp/insieme-src-39855543:11:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/acquire_rank.hpp: In function ‘std::size_t allscale::data_item_manager::detail::acquire_rank(const Requirement&, const LocationInfo&, std::size_t)’:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/acquire_rank.hpp:38:63: warning: typedef ‘using lease_type = struct allscale::lease<typename Item::data_item_type>’ locally defined but not used [-Wunused-local-typedefs]\nusing lease_type = allscale::lease<data_item_type>;\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/acquire_rank.hpp:39:73: warning: typedef ‘using transfer_action_type = struct allscale::data_item_manager::detail::transfer_action<typename Requirement::data_item_type>’ locally defined but not used [-Wunused-local-typedefs]\nusing transfer_action_type = transfer_action<data_item_type>;\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/acquire_rank.hpp:41:100: warning: typedef ‘using mutex_type = typename allscale::data_item_manager::data_item_store<typename DataItemReference::data_item_type>::data_item_type::mutex_type’ locally defined but not used [-Wunused-local-typedefs]\nusing mutex_type = typename data_item_store<data_item_type>::data_item_type::mutex_type;\n ^\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:10:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/work_item.hpp:5,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/spawn.hpp:6,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/runtime.hpp:15,\nfrom /tmp/insieme-src-39855543:11:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp: In function ‘allscale::data_item_manager::location_info<typename DataItemType::region_type> allscale::data_item_manager::detail::locate_root(Requirement)’:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:79:106: warning: typedef ‘using fragment_type = typename allscale::data_item_manager::data_item_store<typename DataItemReference::data_item_type>::data_item_type::fragment_type’ locally defined but not used [-Wunused-local-typedefs]\nusing fragment_type = typename data_item_store<data_item_type>::data_item_type::fragment_type;\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp: In function ‘hpx::lcos::future<allscale::data_item_manager::location_info<typename Requirement::region_type> > allscale::data_item_manager::detail::locate(Requirement, std::size_t)’:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:126:106: warning: typedef ‘using fragment_type = typename allscale::data_item_manager::data_item_store<typename Requirement::data_item_type>::data_item_type::fragment_type’ locally defined but not used [-Wunused-local-typedefs]\nusing fragment_type = typename data_item_store<data_item_type>::data_item_type::fragment_type;\n ^\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/throw_exception.hpp:16:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/detail/polymorphic_nonintrusive_factory.hpp:15,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_archive.hpp:14,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/serialize.hpp:12,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/utils/include/allscale/utils/serializer.h:11,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/api/include/allscale/api/core/data.h:6,\nfrom /tmp/insieme-src-39855543:8:\n/tmp/insieme-src-39855543: At global scope:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:868:43: warning: type attributes ignored after type is already defined [-Wattributes]\ntemplate struct HPX_ALWAYS_EXPORT transfer_action< action>; \\\n ^~~~~~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/expand.hpp:11:26: note: in definition of macro ‘HPX_PP_EXPAND’\n#define HPX_PP_EXPAND(x) x\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:29:32: note: in expansion of macro ‘HPX_REGISTER_ACTION_2’\n# define HPX_PP_CAT_I(a, b) a ## b\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:21:30: note: in expansion of macro ‘HPX_PP_CAT_I’\n# define HPX_PP_CAT(a, b) HPX_PP_CAT_I(a, b)\n ^~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:856:19: note: in expansion of macro ‘HPX_PP_CAT’\nHPX_PP_EXPAND(HPX_PP_CAT( \\\n ^~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:1084:5: note: in expansion of macro ‘HPX_REGISTER_ACTION_’\nHPX_REGISTER_ACTION_(__VA_ARGS__) \\\n^~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager.hpp:199:5: note: in expansion of macro ‘HPX_REGISTER_ACTION’\nHPX_REGISTER_ACTION( \\\n^~~~~~~~~~~~~~~~~~~\n/tmp/insieme-src-39855543:274:1: note: in expansion of macro ‘REGISTER_DATAITEMSERVER’\nREGISTER_DATAITEMSERVER(data_item_type_3)\n^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:870:13: warning: type attributes ignored after type is already defined [-Wattributes]\ntransfer_continuation_action< action>; \\\n^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/expand.hpp:11:26: note: in definition of macro ‘HPX_PP_EXPAND’\n#define HPX_PP_EXPAND(x) x\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:29:32: note: in expansion of macro ‘HPX_REGISTER_ACTION_2’\n# define HPX_PP_CAT_I(a, b) a ## b\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:21:30: note: in expansion of macro ‘HPX_PP_CAT_I’\n# define HPX_PP_CAT(a, b) HPX_PP_CAT_I(a, b)\n ^~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:856:19: note: in expansion of macro ‘HPX_PP_CAT’\nHPX_PP_EXPAND(HPX_PP_CAT( \\\n ^~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:1084:5: note: in expansion of macro ‘HPX_REGISTER_ACTION_’\nHPX_REGISTER_ACTION_(__VA_ARGS__) \\\n^~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager.hpp:199:5: note: in expansion of macro ‘HPX_REGISTER_ACTION’\nHPX_REGISTER_ACTION( \\\n^~~~~~~~~~~~~~~~~~~\n/tmp/insieme-src-39855543:274:1: note: in expansion of macro ‘REGISTER_DATAITEMSERVER’\nREGISTER_DATAITEMSERVER(data_item_type_3)\n^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:868:43: warning: type attributes ignored after type is already defined [-Wattributes]\ntemplate struct HPX_ALWAYS_EXPORT transfer_action< action>; \\\n ^~~~~~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/expand.hpp:11:26: note: in definition of macro ‘HPX_PP_EXPAND’\n#define HPX_PP_EXPAND(x) x\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:29:32: note: in expansion of macro ‘HPX_REGISTER_ACTION_2’\n# define HPX_PP_CAT_I(a, b) a ## b\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:21:30: note: in expansion of macro ‘HPX_PP_CAT_I’\n# define HPX_PP_CAT(a, b) HPX_PP_CAT_I(a, b)\n ^~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:856:19: note: in expansion of macro ‘HPX_PP_CAT’\nHPX_PP_EXPAND(HPX_PP_CAT( \\\n ^~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:1084:5: note: in expansion of macro ‘HPX_REGISTER_ACTION_’\nHPX_REGISTER_ACTION_(__VA_ARGS__) \\\n^~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager.hpp:199:5: note: in expansion of macro ‘HPX_REGISTER_ACTION’\nHPX_REGISTER_ACTION( \\\n^~~~~~~~~~~~~~~~~~~\n/tmp/insieme-src-39855543:287:1: note: in expansion of macro ‘REGISTER_DATAITEMSERVER’\nREGISTER_DATAITEMSERVER(data_item_type_4)\n^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:870:13: warning: type attributes ignored after type is already defined [-Wattributes]\ntransfer_continuation_action< action>; \\\n^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/expand.hpp:11:26: note: in definition of macro ‘HPX_PP_EXPAND’\n#define HPX_PP_EXPAND(x) x\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:29:32: note: in expansion of macro ‘HPX_REGISTER_ACTION_2’\n# define HPX_PP_CAT_I(a, b) a ## b\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:21:30: note: in expansion of macro ‘HPX_PP_CAT_I’\n# define HPX_PP_CAT(a, b) HPX_PP_CAT_I(a, b)\n ^~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:856:19: note: in expansion of macro ‘HPX_PP_CAT’\nHPX_PP_EXPAND(HPX_PP_CAT( \\\n ^~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:1084:5: note: in expansion of macro ‘HPX_REGISTER_ACTION_’\nHPX_REGISTER_ACTION_(__VA_ARGS__) \\\n^~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager.hpp:199:5: note: in expansion of macro ‘HPX_REGISTER_ACTION’\nHPX_REGISTER_ACTION( \\\n^~~~~~~~~~~~~~~~~~~\n/tmp/insieme-src-39855543:287:1: note: in expansion of macro ‘REGISTER_DATAITEMSERVER’\nREGISTER_DATAITEMSERVER(data_item_type_4)\n^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:868:43: warning: type attributes ignored after type is already defined [-Wattributes]\ntemplate struct HPX_ALWAYS_EXPORT transfer_action< action>; \\\n ^~~~~~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/expand.hpp:11:26: note: in definition of macro ‘HPX_PP_EXPAND’\n#define HPX_PP_EXPAND(x) x\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:29:32: note: in expansion of macro ‘HPX_REGISTER_ACTION_2’\n# define HPX_PP_CAT_I(a, b) a ## b\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:21:30: note: in expansion of macro ‘HPX_PP_CAT_I’\n# define HPX_PP_CAT(a, b) HPX_PP_CAT_I(a, b)\n ^~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:856:19: note: in expansion of macro ‘HPX_PP_CAT’\nHPX_PP_EXPAND(HPX_PP_CAT( \\\n ^~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:1084:5: note: in expansion of macro ‘HPX_REGISTER_ACTION_’\nHPX_REGISTER_ACTION_(__VA_ARGS__) \\\n^~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager.hpp:199:5: note: in expansion of macro ‘HPX_REGISTER_ACTION’\nHPX_REGISTER_ACTION( \\\n^~~~~~~~~~~~~~~~~~~\n/tmp/insieme-src-39855543:370:1: note: in expansion of macro ‘REGISTER_DATAITEMSERVER’\nREGISTER_DATAITEMSERVER(data_item_type_1)\n^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:870:13: warning: type attributes ignored after type is already defined [-Wattributes]\ntransfer_continuation_action< action>; \\\n^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/expand.hpp:11:26: note: in definition of macro ‘HPX_PP_EXPAND’\n#define HPX_PP_EXPAND(x) x\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:29:32: note: in expansion of macro ‘HPX_REGISTER_ACTION_2’\n# define HPX_PP_CAT_I(a, b) a ## b\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:21:30: note: in expansion of macro ‘HPX_PP_CAT_I’\n# define HPX_PP_CAT(a, b) HPX_PP_CAT_I(a, b)\n ^~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:856:19: note: in expansion of macro ‘HPX_PP_CAT’\nHPX_PP_EXPAND(HPX_PP_CAT( \\\n ^~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:1084:5: note: in expansion of macro ‘HPX_REGISTER_ACTION_’\nHPX_REGISTER_ACTION_(__VA_ARGS__) \\\n^~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager.hpp:199:5: note: in expansion of macro ‘HPX_REGISTER_ACTION’\nHPX_REGISTER_ACTION( \\\n^~~~~~~~~~~~~~~~~~~\n/tmp/insieme-src-39855543:370:1: note: in expansion of macro ‘REGISTER_DATAITEMSERVER’\nREGISTER_DATAITEMSERVER(data_item_type_1)\n^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:868:43: warning: type attributes ignored after type is already defined [-Wattributes]\ntemplate struct HPX_ALWAYS_EXPORT transfer_action< action>; \\\n ^~~~~~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/expand.hpp:11:26: note: in definition of macro ‘HPX_PP_EXPAND’\n#define HPX_PP_EXPAND(x) x\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:29:32: note: in expansion of macro ‘HPX_REGISTER_ACTION_2’\n# define HPX_PP_CAT_I(a, b) a ## b\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:21:30: note: in expansion of macro ‘HPX_PP_CAT_I’\n# define HPX_PP_CAT(a, b) HPX_PP_CAT_I(a, b)\n ^~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:856:19: note: in expansion of macro ‘HPX_PP_CAT’\nHPX_PP_EXPAND(HPX_PP_CAT( \\\n ^~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:1084:5: note: in expansion of macro ‘HPX_REGISTER_ACTION_’\nHPX_REGISTER_ACTION_(__VA_ARGS__) \\\n^~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager.hpp:199:5: note: in expansion of macro ‘HPX_REGISTER_ACTION’\nHPX_REGISTER_ACTION( \\\n^~~~~~~~~~~~~~~~~~~\n/tmp/insieme-src-39855543:677:1: note: in expansion of macro ‘REGISTER_DATAITEMSERVER’\nREGISTER_DATAITEMSERVER(data_item_type_2)\n^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:870:13: warning: type attributes ignored after type is already defined [-Wattributes]\ntransfer_continuation_action< action>; \\\n^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/expand.hpp:11:26: note: in definition of macro ‘HPX_PP_EXPAND’\n#define HPX_PP_EXPAND(x) x\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:29:32: note: in expansion of macro ‘HPX_REGISTER_ACTION_2’\n# define HPX_PP_CAT_I(a, b) a ## b\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:21:30: note: in expansion of macro ‘HPX_PP_CAT_I’\n# define HPX_PP_CAT(a, b) HPX_PP_CAT_I(a, b)\n ^~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:856:19: note: in expansion of macro ‘HPX_PP_CAT’\nHPX_PP_EXPAND(HPX_PP_CAT( \\\n ^~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:1084:5: note: in expansion of macro ‘HPX_REGISTER_ACTION_’\nHPX_REGISTER_ACTION_(__VA_ARGS__) \\\n^~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager.hpp:199:5: note: in expansion of macro ‘HPX_REGISTER_ACTION’\nHPX_REGISTER_ACTION( \\\n^~~~~~~~~~~~~~~~~~~\n/tmp/insieme-src-39855543:677:1: note: in expansion of macro ‘REGISTER_DATAITEMSERVER’\nREGISTER_DATAITEMSERVER(data_item_type_2)\n^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:868:43: warning: type attributes ignored after type is already defined [-Wattributes]\ntemplate struct HPX_ALWAYS_EXPORT transfer_action< action>; \\\n ^~~~~~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/expand.hpp:11:26: note: in definition of macro ‘HPX_PP_EXPAND’\n#define HPX_PP_EXPAND(x) x\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:29:32: note: in expansion of macro ‘HPX_REGISTER_ACTION_2’\n# define HPX_PP_CAT_I(a, b) a ## b\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:21:30: note: in expansion of macro ‘HPX_PP_CAT_I’\n# define HPX_PP_CAT(a, b) HPX_PP_CAT_I(a, b)\n ^~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:856:19: note: in expansion of macro ‘HPX_PP_CAT’\nHPX_PP_EXPAND(HPX_PP_CAT( \\\n ^~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:1084:5: note: in expansion of macro ‘HPX_REGISTER_ACTION_’\nHPX_REGISTER_ACTION_(__VA_ARGS__) \\\n^~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager.hpp:199:5: note: in expansion of macro ‘HPX_REGISTER_ACTION’\nHPX_REGISTER_ACTION( \\\n^~~~~~~~~~~~~~~~~~~\n/tmp/insieme-src-39855543:1671:1: note: in expansion of macro ‘REGISTER_DATAITEMSERVER’\nREGISTER_DATAITEMSERVER(data_item_type_5)\n^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:870:13: warning: type attributes ignored after type is already defined [-Wattributes]\ntransfer_continuation_action< action>; \\\n^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/expand.hpp:11:26: note: in definition of macro ‘HPX_PP_EXPAND’\n#define HPX_PP_EXPAND(x) x\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:29:32: note: in expansion of macro ‘HPX_REGISTER_ACTION_2’\n# define HPX_PP_CAT_I(a, b) a ## b\n ^\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/detail/pp/cat.hpp:21:30: note: in expansion of macro ‘HPX_PP_CAT_I’\n# define HPX_PP_CAT(a, b) HPX_PP_CAT_I(a, b)\n ^~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:856:19: note: in expansion of macro ‘HPX_PP_CAT’\nHPX_PP_EXPAND(HPX_PP_CAT( \\\n ^~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/actions/basic_action.hpp:1084:5: note: in expansion of macro ‘HPX_REGISTER_ACTION_’\nHPX_REGISTER_ACTION_(__VA_ARGS__) \\\n^~~~~~~~~~~~~~~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager.hpp:199:5: note: in expansion of macro ‘HPX_REGISTER_ACTION’\nHPX_REGISTER_ACTION( \\\n^~~~~~~~~~~~~~~~~~~\n/tmp/insieme-src-39855543:1671:1: note: in expansion of macro ‘REGISTER_DATAITEMSERVER’\nREGISTER_DATAITEMSERVER(data_item_type_5)\n^\n/tmp/insieme-src-39855543: In member function ‘IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_774_13_bool_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_774_13::operator allscale_type_1456() const’:\n/tmp/insieme-src-39855543:3373:1: warning: no return statement in function returning non-void [-Wreturn-type]\n}\n^\n/tmp/insieme-src-39855543: In member function ‘IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_594_34_void_double_space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_594_34::operator allscale_type_1327() const’:\n/tmp/insieme-src-39855543:3860:1: warning: no return statement in function returning non-void [-Wreturn-type]\n}\n^\n/tmp/insieme-src-39855543: In member function ‘IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_599_24_double_const_space_double_space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_599_24::operator allscale_type_1352() const’:\n/tmp/insieme-src-39855543:3869:1: warning: no return statement in function returning non-void [-Wreturn-type]\n}\n^\n/tmp/insieme-src-39855543: In member function ‘IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_662_34_void_double_space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_662_34::operator allscale_type_1327() const’:\n/tmp/insieme-src-39855543:3900:1: warning: no return statement in function returning non-void [-Wreturn-type]\n}\n^\n/tmp/insieme-src-39855543: In member function ‘IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_667_23_double_const_space_double_space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_667_23::operator allscale_type_1352() const’:\n/tmp/insieme-src-39855543:3913:1: warning: no return statement in function returning non-void [-Wreturn-type]\n}\n^\n/tmp/insieme-src-39855543: In function ‘IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_fragments_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt_ IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_range_spliter_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt___static__IMP_split_returns_fragments_lt_Vector_lt_long_comma__space_2UL_gt__space__gt_(uint64_t, const IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_range_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt_&)’:\n/tmp/insieme-src-39855543:4504:202: warning: variable ‘var_2’ set but not used [-Wunused-but-set-variable]\nconst IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_volume_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__bool var_2 = (IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_volume_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__bool&&)IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_volume_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__bool{};\n ^~~~~\n/tmp/insieme-src-39855543: In function ‘IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_fragments_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt_ allscale_fun_904(uint64_t, const IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_range_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt_&)’:\n/tmp/insieme-src-39855543:4658:202: warning: variable ‘var_2’ set but not used [-Wunused-but-set-variable]\nconst IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_volume_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__bool var_2 = (IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_volume_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__bool&&)IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_volume_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__bool{};\n ^~~~~\n/tmp/insieme-src-39855543: In member function ‘IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_810_18_double_const_space_double_space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_810_18::operator allscale_type_1352() const’:\n/tmp/insieme-src-39855543:4921:1: warning: no return statement in function returning non-void [-Wreturn-type]\n}\n^\n/tmp/insieme-src-39855543: In member function ‘IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_utils_slash_include_slash_allscale_slash_utils_slash_vector_dot_h_249_26_long_const_space_long_space__ampersand__const_space_long_space__ampersand_::operator allscale_type_541() const’:\n/tmp/insieme-src-39855543:5926:1: warning: no return statement in function returning non-void [-Wreturn-type]\n}\n^\n/tmp/insieme-src-39855543: In member function ‘IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_benchmark_dot_cpp_60_27_long_double_long_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_benchmark_dot_cpp_60_27::operator allscale_type_509() const’:\n/tmp/insieme-src-39855543:5948:1: warning: no return statement in function returning non-void [-Wreturn-type]\n}\n^\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:10:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/work_item.hpp:5,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/spawn.hpp:6,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/runtime.hpp:15,\nfrom /tmp/insieme-src-39855543:11:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp: In instantiation of ‘hpx::util::tuple<decltype (locate<state>(get<Is>(reqs), declval<std::size_t>()))...> allscale::data_item_manager::detail::locate(const Requirements&, hpx::util::detail::pack_c<long unsigned int, Is ...>) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirements = hpx::util::tuple<>; long unsigned int ...Is = {}]’:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:328:58: required from ‘decltype (locate<init>(reqs, declval<typename hpx::util::detail::make_index_pack<typename hpx::util::tuple_size<T>::type:: value>::type>())) allscale::data_item_manager::locate(const Requirements&) [with Requirements = hpx::util::tuple<>; decltype (locate<init>(reqs, declval<typename hpx::util::detail::make_index_pack<typename hpx::util::tuple_size<T>::type:: value>::type>())) = hpx::util::tuple<>; typename hpx::util::detail::make_index_pack<typename hpx::util::tuple_size<T>::type:: value>::type = hpx::util::detail::pack_c<long unsigned int>]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:454:42: required from ‘hpx::lcos::future<long unsigned int> allscale::detail::work_item_impl<WorkItemDescription, Closure>::process(allscale::executor_type&, std::size_t) [with WorkItemDescription = allscale::work_item_description<void, __wi_allscale_wi_5_name, allscale::do_serialization, __wi_allscale_wi_5_variant_0, __wi_allscale_wi_5_variant_1, __wi_allscale_wi_5_can_split>; Closure = hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10>; allscale::executor_type = hpx::threads::executors::pool_executor; std::size_t = long unsigned int]’\n/tmp/insieme-src-39855543:6472:1: required from here\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:304:25: warning: variable ‘src_id’ set but not used [-Wunused-but-set-variable]\nstd::size_t src_id = hpx::get_locality_id();\n ^~~~~~\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/work_item.hpp:5:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/spawn.hpp:6,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/runtime.hpp:15,\nfrom /tmp/insieme-src-39855543:11:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp: In instantiation of ‘typename std::enable_if<allscale::detail::work_item_impl<WorkItemDescription, Closure>::is_serializable, allscale::detail::work_item_impl<WorkItemDescription, Closure>*>::type allscale::detail::load_work_item_impl(hpx::serialization::input_archive&, allscale::detail::work_item_impl<WorkItemDescription, Closure>*) [with WorkItemDescription = allscale::work_item_description<void, __wi_allscale_wi_5_name, allscale::do_serialization, __wi_allscale_wi_5_variant_0, __wi_allscale_wi_5_variant_1, __wi_allscale_wi_5_can_split>; Closure = hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10>; typename std::enable_if<allscale::detail::work_item_impl<WorkItemDescription, Closure>::is_serializable, allscale::detail::work_item_impl<WorkItemDescription, Closure>*>::type = allscale::detail::work_item_impl<allscale::work_item_description<void, __wi_allscale_wi_5_name, allscale::do_serialization, __wi_allscale_wi_5_variant_0, __wi_allscale_wi_5_variant_1, __wi_allscale_wi_5_can_split>, hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10> >*]’:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:657:1: required from ‘static allscale::detail::work_item_impl<WorkItemDescription, Closure>* hpx::serialization::detail::constructor_selector<allscale::detail::work_item_impl<WorkItemDescription, Closure> >::create(hpx::serialization::input_archive&) [with WorkItemDescription = allscale::work_item_description<void, __wi_allscale_wi_5_name, allscale::do_serialization, __wi_allscale_wi_5_variant_0, __wi_allscale_wi_5_variant_1, __wi_allscale_wi_5_can_split>; Closure = hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10>]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/detail/polymorphic_nonintrusive_factory.hpp:205:57: required from ‘static void* hpx::serialization::detail::register_class<Derived>::create(hpx::serialization::input_archive&) [with Derived = allscale::detail::work_item_impl<allscale::work_item_description<void, __wi_allscale_wi_5_name, allscale::do_serialization, __wi_allscale_wi_5_variant_0, __wi_allscale_wi_5_variant_1, __wi_allscale_wi_5_can_split>, hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10> >]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/detail/polymorphic_nonintrusive_factory.hpp:213:17: required from ‘hpx::serialization::detail::register_class<Derived>::register_class() [with Derived = allscale::detail::work_item_impl<allscale::work_item_description<void, __wi_allscale_wi_5_name, allscale::do_serialization, __wi_allscale_wi_5_variant_0, __wi_allscale_wi_5_variant_1, __wi_allscale_wi_5_can_split>, hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10> >]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:673:1: required from ‘hpx::serialization::detail::register_class<allscale::detail::work_item_impl<allscale::work_item_description<void, __wi_allscale_wi_5_name, allscale::do_serialization, __wi_allscale_wi_5_variant_0, __wi_allscale_wi_5_variant_1, __wi_allscale_wi_5_can_split>, hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10> > > allscale::detail::work_item_impl<allscale::work_item_description<void, __wi_allscale_wi_5_name, allscale::do_serialization, __wi_allscale_wi_5_variant_0, __wi_allscale_wi_5_variant_1, __wi_allscale_wi_5_can_split>, hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10> >::hpx_register_class_instance’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:586:9: required from ‘hpx::serialization::detail::register_class<allscale::detail::work_item_impl<WorkItemDescription, Closure> >& allscale::detail::work_item_impl<WorkItemDescription, Closure>::hpx_get_register_class_instance(hpx::serialization::detail::register_class<allscale::detail::work_item_impl<WorkItemDescription, Closure> >*) const [with WorkItemDescription = allscale::work_item_description<void, __wi_allscale_wi_5_name, allscale::do_serialization, __wi_allscale_wi_5_variant_0, __wi_allscale_wi_5_variant_1, __wi_allscale_wi_5_can_split>; Closure = hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10>]’\n/tmp/insieme-src-39855543:6472:1: required from here\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:630:47: error: no matching function for call to ‘hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10>::tuple()’\ntypename work_item_type::closure_type closure;\n ^~~~~~~\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/invoke_fused.hpp:16:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/bind.hpp:20,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/lcos/detail/future_data.hpp:24,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/traits/serialization_access_data.hpp:10,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_container.hpp:15,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_archive.hpp:16,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/serialize.hpp:12,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/utils/include/allscale/utils/serializer.h:11,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/api/include/allscale/api/core/data.h:6,\nfrom /tmp/insieme-src-39855543:8:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:489:39: note: candidate: template<class UTuple, class Enable> constexpr hpx::util::tuple<Ts>::tuple(UTuple&&)\nHPX_CONSTEXPR HPX_HOST_DEVICE tuple(UTuple&& other)\n ^~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:489:39: note: template argument deduction/substitution failed:\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/work_item.hpp:5:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/spawn.hpp:6,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/runtime.hpp:15,\nfrom /tmp/insieme-src-39855543:11:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:630:47: note: candidate expects 1 argument, 0 provided\ntypename work_item_type::closure_type closure;\n ^~~~~~~\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/invoke_fused.hpp:16:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/bind.hpp:20,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/lcos/detail/future_data.hpp:24,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/traits/serialization_access_data.hpp:10,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_container.hpp:15,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_archive.hpp:16,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/serialize.hpp:12,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/utils/include/allscale/utils/serializer.h:11,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/api/include/allscale/api/core/data.h:6,\nfrom /tmp/insieme-src-39855543:8:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:461:9: note: candidate: hpx::util::tuple<Ts>::tuple(hpx::util::tuple<Ts>&&) [with Ts = {IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10}]\ntuple(tuple&&) = default;\n^~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:461:9: note: candidate expects 1 argument, 0 provided\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:456:9: note: candidate: hpx::util::tuple<Ts>::tuple(const hpx::util::tuple<Ts>&) [with Ts = {IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10}]\ntuple(tuple const&) = default;\n^~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:456:9: note: candidate expects 1 argument, 0 provided\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:448:48: note: candidate: template<class U, class ... Us, class Enable> constexpr hpx::util::tuple<Ts>::tuple(U&&, Us&& ...)\nexplicit HPX_CONSTEXPR HPX_HOST_DEVICE tuple(U&& v, Us&&... vs)\n ^~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:448:48: note: template argument deduction/substitution failed:\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/work_item.hpp:5:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/spawn.hpp:6,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/runtime.hpp:15,\nfrom /tmp/insieme-src-39855543:11:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:630:47: note: candidate expects at least 1 argument, 0 provided\ntypename work_item_type::closure_type closure;\n ^~~~~~~\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/invoke_fused.hpp:16:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/bind.hpp:20,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/lcos/detail/future_data.hpp:24,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/traits/serialization_access_data.hpp:10,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_container.hpp:15,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_archive.hpp:16,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/serialize.hpp:12,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/utils/include/allscale/utils/serializer.h:11,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/api/include/allscale/api/core/data.h:6,\nfrom /tmp/insieme-src-39855543:8:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:424:48: note: candidate: constexpr hpx::util::tuple<Ts>::tuple(const Ts& ...) [with Ts = {IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_one_on_one_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10_unsigned_space_long_const_space_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_Observer_lt__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_766_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_774_colon_13_rparen__comma__space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_776_colon_13_rparen__gt__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_530_10}]\nexplicit HPX_CONSTEXPR HPX_HOST_DEVICE tuple(Ts const&... vs)\n ^~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:424:48: note: candidate expects 2 arguments, 0 provided\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:417:39: note: candidate: template<class Dependent, class Enable> constexpr hpx::util::tuple<Ts>::tuple()\nHPX_CONSTEXPR HPX_HOST_DEVICE tuple()\n ^~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:417:39: note: template argument deduction/substitution failed:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:413:13: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’\ntypename Enable = typename std::enable_if<\n^~~~~~~~\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:10:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/work_item.hpp:5,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/spawn.hpp:6,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/runtime.hpp:15,\nfrom /tmp/insieme-src-39855543:11:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp: In instantiation of ‘allscale::data_item_manager::detail::locate(Requirement, std::size_t)::<lambda(hpx::lcos::future<allscale::data_item_manager::location_info<typename Requirement::region_type> >&&)> mutable [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirement = allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> >; typename Requirement::region_type = allscale::api::user::data::GridRegion<2>]’:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:199:86: required from ‘struct allscale::data_item_manager::detail::locate(Requirement, std::size_t) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirement = allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> >; typename Requirement::region_type = allscale::api::user::data::GridRegion<2>; std::size_t = long unsigned int]::<lambda(class hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > >&&)>’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:195:63: required from ‘hpx::lcos::future<allscale::data_item_manager::location_info<typename Requirement::region_type> > allscale::data_item_manager::detail::locate(Requirement, std::size_t) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirement = allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> >; typename Requirement::region_type = allscale::api::user::data::GridRegion<2>; std::size_t = long unsigned int]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:283:44: required from ‘std::vector<hpx::lcos::future<allscale::data_item_manager::location_info<typename Requirement::region_type> > > allscale::data_item_manager::detail::locate(const std::vector<Requirement, Allocator>&, std::size_t) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirement = allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> >; Allocator = std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> > >; typename Requirement::region_type = allscale::api::user::data::GridRegion<2>; std::size_t = long unsigned int]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:305:55: required from ‘hpx::util::tuple<decltype (locate<state>(get<Is>(reqs), declval<std::size_t>()))...> allscale::data_item_manager::detail::locate(const Requirements&, hpx::util::detail::pack_c<long unsigned int, Is ...>) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirements = hpx::util::tuple<std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> > > >, std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> > > >, std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> > > > >; long unsigned int ...Is = {0, 1, 2}]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:328:58: required from ‘decltype (locate<init>(reqs, declval<typename hpx::util::detail::make_index_pack<typename hpx::util::tuple_size<T>::type:: value>::type>())) allscale::data_item_manager::locate(const Requirements&) [with Requirements = hpx::util::tuple<std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> > > >, std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> > > >, std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> > > > >; decltype (locate<init>(reqs, declval<typename hpx::util::detail::make_index_pack<typename hpx::util::tuple_size<T>::type:: value>::type>())) = hpx::util::tuple<std::vector<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > >, std::allocator<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > > > >, std::vector<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > >, std::allocator<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > > > >, std::vector<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > >, std::allocator<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > > > > >; typename hpx::util::detail::make_index_pack<typename hpx::util::tuple_size<T>::type:: value>::type = hpx::util::detail::pack_c<long unsigned int, 0, 1, 2>]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:454:42: required from ‘hpx::lcos::future<long unsigned int> allscale::detail::work_item_impl<WorkItemDescription, Closure>::process(allscale::executor_type&, std::size_t) [with WorkItemDescription = allscale::work_item_description<void, __wi_allscale_wi_4_name, allscale::do_serialization, __wi_allscale_wi_4_variant_0, __wi_allscale_wi_4_variant_1, __wi_allscale_wi_4_can_split>; Closure = hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8>; allscale::executor_type = hpx::threads::executors::pool_executor; std::size_t = long unsigned int]’\n/tmp/insieme-src-39855543:6472:1: required from here\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:204:33: warning: unused variable ‘this_id’ [-Wunused-variable]\n std::size_t this_id = hpx::get_locality_id();\n ^~~~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp: In instantiation of ‘allscale::data_item_manager::detail::locate(Requirement, std::size_t)::<lambda(hpx::lcos::future<allscale::data_item_manager::location_info<typename Requirement::region_type> >&&)> mutable [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirement = allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> >; typename Requirement::region_type = allscale::api::user::data::GridRegion<2>]’:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:199:86: required from ‘struct allscale::data_item_manager::detail::locate(Requirement, std::size_t) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirement = allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> >; typename Requirement::region_type = allscale::api::user::data::GridRegion<2>; std::size_t = long unsigned int]::<lambda(class hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > >&&)>’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:195:63: required from ‘hpx::lcos::future<allscale::data_item_manager::location_info<typename Requirement::region_type> > allscale::data_item_manager::detail::locate(Requirement, std::size_t) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirement = allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> >; typename Requirement::region_type = allscale::api::user::data::GridRegion<2>; std::size_t = long unsigned int]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:283:44: required from ‘std::vector<hpx::lcos::future<allscale::data_item_manager::location_info<typename Requirement::region_type> > > allscale::data_item_manager::detail::locate(const std::vector<Requirement, Allocator>&, std::size_t) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirement = allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> >; Allocator = std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> > >; typename Requirement::region_type = allscale::api::user::data::GridRegion<2>; std::size_t = long unsigned int]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:305:55: required from ‘hpx::util::tuple<decltype (locate<state>(get<Is>(reqs), declval<std::size_t>()))...> allscale::data_item_manager::detail::locate(const Requirements&, hpx::util::detail::pack_c<long unsigned int, Is ...>) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirements = hpx::util::tuple<std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> > > >, std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> > > >, std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> > > > >; long unsigned int ...Is = {0, 1, 2}]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:328:58: required from ‘decltype (locate<init>(reqs, declval<typename hpx::util::detail::make_index_pack<typename hpx::util::tuple_size<T>::type:: value>::type>())) allscale::data_item_manager::locate(const Requirements&) [with Requirements = hpx::util::tuple<std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> > > >, std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> > > >, std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> > > > >; decltype (locate<init>(reqs, declval<typename hpx::util::detail::make_index_pack<typename hpx::util::tuple_size<T>::type:: value>::type>())) = hpx::util::tuple<std::vector<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > >, std::allocator<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > > > >, std::vector<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > >, std::allocator<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > > > >, std::vector<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > >, std::allocator<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > > > > >; typename hpx::util::detail::make_index_pack<typename hpx::util::tuple_size<T>::type:: value>::type = hpx::util::detail::pack_c<long unsigned int, 0, 1, 2>]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:454:42: required from ‘hpx::lcos::future<long unsigned int> allscale::detail::work_item_impl<WorkItemDescription, Closure>::process(allscale::executor_type&, std::size_t) [with WorkItemDescription = allscale::work_item_description<void, __wi_allscale_wi_4_name, allscale::do_serialization, __wi_allscale_wi_4_variant_0, __wi_allscale_wi_4_variant_1, __wi_allscale_wi_4_can_split>; Closure = hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8>; allscale::executor_type = hpx::threads::executors::pool_executor; std::size_t = long unsigned int]’\n/tmp/insieme-src-39855543:6472:1: required from here\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:204:33: warning: unused variable ‘this_id’ [-Wunused-variable]\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp: In instantiation of ‘allscale::data_item_manager::detail::locate(Requirement, std::size_t)::<lambda(hpx::lcos::future<allscale::data_item_manager::location_info<typename Requirement::region_type> >&&)> mutable [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirement = allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> >; typename Requirement::region_type = allscale::api::user::data::GridRegion<2>]’:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:199:86: required from ‘struct allscale::data_item_manager::detail::locate(Requirement, std::size_t) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirement = allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> >; typename Requirement::region_type = allscale::api::user::data::GridRegion<2>; std::size_t = long unsigned int]::<lambda(class hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > >&&)>’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:195:63: required from ‘hpx::lcos::future<allscale::data_item_manager::location_info<typename Requirement::region_type> > allscale::data_item_manager::detail::locate(Requirement, std::size_t) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirement = allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> >; typename Requirement::region_type = allscale::api::user::data::GridRegion<2>; std::size_t = long unsigned int]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:283:44: required from ‘std::vector<hpx::lcos::future<allscale::data_item_manager::location_info<typename Requirement::region_type> > > allscale::data_item_manager::detail::locate(const std::vector<Requirement, Allocator>&, std::size_t) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirement = allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> >; Allocator = std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> > >; typename Requirement::region_type = allscale::api::user::data::GridRegion<2>; std::size_t = long unsigned int]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:305:55: required from ‘hpx::util::tuple<decltype (locate<state>(get<Is>(reqs), declval<std::size_t>()))...> allscale::data_item_manager::detail::locate(const Requirements&, hpx::util::detail::pack_c<long unsigned int, Is ...>) [with allscale::data_item_manager::detail::locate_state state = (allscale::data_item_manager::detail::locate_state)0; Requirements = hpx::util::tuple<std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> > > >, std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> > > >, std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> > > > >; long unsigned int ...Is = {0, 1, 2}]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:328:58: required from ‘decltype (locate<init>(reqs, declval<typename hpx::util::detail::make_index_pack<typename hpx::util::tuple_size<T>::type:: value>::type>())) allscale::data_item_manager::locate(const Requirements&) [with Requirements = hpx::util::tuple<std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon_Matrix, 2> > > >, std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<allscale::api::user::data::AdaptiveGridCell<double, allscale::api::user::data::CellConfig<2, allscale::api::user::data::layers<allscale::api::user::data::layer<1, 1>, allscale::api::user::data::layer<8, 8>, allscale::api::user::data::layer<2, 2> > > >, 2> > > >, std::vector<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> >, std::allocator<allscale::data_item_requirement<allscale::api::user::data::Grid<IMP_amdados_colon__colon__lparen_anonymous_space_namespace_rparen__colon__colon_SubdomainContext_IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_86_1, 2> > > > >; decltype (locate<init>(reqs, declval<typename hpx::util::detail::make_index_pack<typename hpx::util::tuple_size<T>::type:: value>::type>())) = hpx::util::tuple<std::vector<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > >, std::allocator<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > > > >, std::vector<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > >, std::allocator<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > > > >, std::vector<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > >, std::allocator<hpx::lcos::future<allscale::data_item_manager::location_info<allscale::api::user::data::GridRegion<2> > > > > >; typename hpx::util::detail::make_index_pack<typename hpx::util::tuple_size<T>::type:: value>::type = hpx::util::detail::pack_c<long unsigned int, 0, 1, 2>]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:454:42: required from ‘hpx::lcos::future<long unsigned int> allscale::detail::work_item_impl<WorkItemDescription, Closure>::process(allscale::executor_type&, std::size_t) [with WorkItemDescription = allscale::work_item_description<void, __wi_allscale_wi_4_name, allscale::do_serialization, __wi_allscale_wi_4_variant_0, __wi_allscale_wi_4_variant_1, __wi_allscale_wi_4_can_split>; Closure = hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8>; allscale::executor_type = hpx::threads::executors::pool_executor; std::size_t = long unsigned int]’\n/tmp/insieme-src-39855543:6472:1: required from here\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/data_item_manager/locate.hpp:204:33: warning: unused variable ‘this_id’ [-Wunused-variable]\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/work_item.hpp:5:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/spawn.hpp:6,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/runtime.hpp:15,\nfrom /tmp/insieme-src-39855543:11:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp: In instantiation of ‘typename std::enable_if<allscale::detail::work_item_impl<WorkItemDescription, Closure>::is_serializable, allscale::detail::work_item_impl<WorkItemDescription, Closure>*>::type allscale::detail::load_work_item_impl(hpx::serialization::input_archive&, allscale::detail::work_item_impl<WorkItemDescription, Closure>*) [with WorkItemDescription = allscale::work_item_description<void, __wi_allscale_wi_4_name, allscale::do_serialization, __wi_allscale_wi_4_variant_0, __wi_allscale_wi_4_variant_1, __wi_allscale_wi_4_can_split>; Closure = hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8>; typename std::enable_if<allscale::detail::work_item_impl<WorkItemDescription, Closure>::is_serializable, allscale::detail::work_item_impl<WorkItemDescription, Closure>*>::type = allscale::detail::work_item_impl<allscale::work_item_description<void, __wi_allscale_wi_4_name, allscale::do_serialization, __wi_allscale_wi_4_variant_0, __wi_allscale_wi_4_variant_1, __wi_allscale_wi_4_can_split>, hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8> >*]’:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:657:1: required from ‘static allscale::detail::work_item_impl<WorkItemDescription, Closure>* hpx::serialization::detail::constructor_selector<allscale::detail::work_item_impl<WorkItemDescription, Closure> >::create(hpx::serialization::input_archive&) [with WorkItemDescription = allscale::work_item_description<void, __wi_allscale_wi_4_name, allscale::do_serialization, __wi_allscale_wi_4_variant_0, __wi_allscale_wi_4_variant_1, __wi_allscale_wi_4_can_split>; Closure = hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8>]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/detail/polymorphic_nonintrusive_factory.hpp:205:57: required from ‘static void* hpx::serialization::detail::register_class<Derived>::create(hpx::serialization::input_archive&) [with Derived = allscale::detail::work_item_impl<allscale::work_item_description<void, __wi_allscale_wi_4_name, allscale::do_serialization, __wi_allscale_wi_4_variant_0, __wi_allscale_wi_4_variant_1, __wi_allscale_wi_4_can_split>, hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8> >]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/detail/polymorphic_nonintrusive_factory.hpp:213:17: required from ‘hpx::serialization::detail::register_class<Derived>::register_class() [with Derived = allscale::detail::work_item_impl<allscale::work_item_description<void, __wi_allscale_wi_4_name, allscale::do_serialization, __wi_allscale_wi_4_variant_0, __wi_allscale_wi_4_variant_1, __wi_allscale_wi_4_can_split>, hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8> >]’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:673:1: required from ‘hpx::serialization::detail::register_class<allscale::detail::work_item_impl<allscale::work_item_description<void, __wi_allscale_wi_4_name, allscale::do_serialization, __wi_allscale_wi_4_variant_0, __wi_allscale_wi_4_variant_1, __wi_allscale_wi_4_can_split>, hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8> > > allscale::detail::work_item_impl<allscale::work_item_description<void, __wi_allscale_wi_4_name, allscale::do_serialization, __wi_allscale_wi_4_variant_0, __wi_allscale_wi_4_variant_1, __wi_allscale_wi_4_can_split>, hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8> >::hpx_register_class_instance’\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:586:9: required from ‘hpx::serialization::detail::register_class<allscale::detail::work_item_impl<WorkItemDescription, Closure> >& allscale::detail::work_item_impl<WorkItemDescription, Closure>::hpx_get_register_class_instance(hpx::serialization::detail::register_class<allscale::detail::work_item_impl<WorkItemDescription, Closure> >*) const [with WorkItemDescription = allscale::work_item_description<void, __wi_allscale_wi_4_name, allscale::do_serialization, __wi_allscale_wi_4_variant_0, __wi_allscale_wi_4_variant_1, __wi_allscale_wi_4_can_split>; Closure = hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8>]’\n/tmp/insieme-src-39855543:6472:1: required from here\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:630:47: error: no matching function for call to ‘hpx::util::tuple<IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8>::tuple()’\ntypename work_item_type::closure_type closure;\n ^~~~~~~\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/invoke_fused.hpp:16:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/bind.hpp:20,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/lcos/detail/future_data.hpp:24,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/traits/serialization_access_data.hpp:10,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_container.hpp:15,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_archive.hpp:16,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/serialize.hpp:12,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/utils/include/allscale/utils/serializer.h:11,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/api/include/allscale/api/core/data.h:6,\nfrom /tmp/insieme-src-39855543:8:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:489:39: note: candidate: template<class UTuple, class Enable> constexpr hpx::util::tuple<Ts>::tuple(UTuple&&)\nHPX_CONSTEXPR HPX_HOST_DEVICE tuple(UTuple&& other)\n ^~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:489:39: note: template argument deduction/substitution failed:\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/work_item.hpp:5:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/spawn.hpp:6,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/runtime.hpp:15,\nfrom /tmp/insieme-src-39855543:11:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:630:47: note: candidate expects 1 argument, 0 provided\ntypename work_item_type::closure_type closure;\n ^~~~~~~\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/invoke_fused.hpp:16:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/bind.hpp:20,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/lcos/detail/future_data.hpp:24,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/traits/serialization_access_data.hpp:10,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_container.hpp:15,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_archive.hpp:16,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/serialize.hpp:12,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/utils/include/allscale/utils/serializer.h:11,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/api/include/allscale/api/core/data.h:6,\nfrom /tmp/insieme-src-39855543:8:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:461:9: note: candidate: hpx::util::tuple<Ts>::tuple(hpx::util::tuple<Ts>&&) [with Ts = {IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8}]\ntuple(tuple&&) = default;\n^~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:461:9: note: candidate expects 1 argument, 0 provided\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:456:9: note: candidate: hpx::util::tuple<Ts>::tuple(const hpx::util::tuple<Ts>&) [with Ts = {IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8}]\ntuple(tuple const&) = default;\n^~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:456:9: note: candidate expects 1 argument, 0 provided\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:448:48: note: candidate: template<class U, class ... Us, class Enable> constexpr hpx::util::tuple<Ts>::tuple(U&&, Us&& ...)\nexplicit HPX_CONSTEXPR HPX_HOST_DEVICE tuple(U&& v, Us&&... vs)\n ^~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:448:48: note: template argument deduction/substitution failed:\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/work_item.hpp:5:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/spawn.hpp:6,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/runtime.hpp:15,\nfrom /tmp/insieme-src-39855543:11:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/allscale/detail/work_item_impl.hpp:630:47: note: candidate expects at least 1 argument, 0 provided\ntypename work_item_type::closure_type closure;\n ^~~~~~~\nIn file included from /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/invoke_fused.hpp:16:0,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/bind.hpp:20,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/lcos/detail/future_data.hpp:24,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/traits/serialization_access_data.hpp:10,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_container.hpp:15,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/input_archive.hpp:16,\nfrom /home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/runtime/serialization/serialize.hpp:12,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/utils/include/allscale/utils/serializer.h:11,\nfrom /home/petert/allscale/git/allscale-compiler/code/../api/code/api/include/allscale/api/core/data.h:6,\nfrom /tmp/insieme-src-39855543:8:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:424:48: note: candidate: constexpr hpx::util::tuple<Ts>::tuple(const Ts& ...) [with Ts = {IMP_allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_detail_colon__colon_RecArgsWithDependencies_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__allscale_colon__colon_api_colon__colon_user_colon__colon_algorithm_colon__colon_full_neighborhood_sync_dependency_lt_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__comma__space_1_gt_, IMP__Insieme__lambda__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8_unsigned_space_long_const_space__lparen_lambda_space_at_space__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_amdados_slash_code_slash_app_slash_src_slash_scenario_simulation_dot_cpp_colon_749_colon_9_rparen__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_Grid_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_AdaptiveGridCell_lt_double_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_CellConfig_lt_2_comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layers_lt_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_1_comma__space_1_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_8_comma__space_8_gt__comma__space_struct_space_allscale_colon__colon_api_colon__colon_user_colon__colon_data_colon__colon_layer_lt_2_comma__space_2_gt__space__gt__space__gt__space__gt__comma__space_2_gt__space__ampersand__void_const_space_allscale_colon__colon_utils_colon__colon_Vector_lt_long_comma__space_2_gt__space__ampersand__IMLOC__slash_home_slash_petert_slash_allscale_slash_git_slash_allscale_minus_compiler_slash_api_slash_code_slash_api_slash_include_slash_allscale_slash_api_slash_user_slash_algorithm_slash_stencil_dot_h_517_8}]\nexplicit HPX_CONSTEXPR HPX_HOST_DEVICE tuple(Ts const&... vs)\n ^~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:424:48: note: candidate expects 2 arguments, 0 provided\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:417:39: note: candidate: template<class Dependent, class Enable> constexpr hpx::util::tuple<Ts>::tuple()\nHPX_CONSTEXPR HPX_HOST_DEVICE tuple()\n ^~~~~\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:417:39: note: template argument deduction/substitution failed:\n/home/petert/allscale/git/allscale-compiler/code/../runtime/allscale_runtime/hpx/hpx/util/tuple.hpp:413:13: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’\ntypename Enable = typename std::enable_if<\n^~~~~~~~`;\n process_input();\n}", "title": "" }, { "docid": "3c196e9cdc02c00f759e181ee79a66f9", "score": "0.4545058", "text": "function t(e,t,r,a){var i,s=arguments.length,n=s<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(n=(s<3?i(n):s>3?i(t,r,n):i(t,r))||n);return s>3&&n&&Object.defineProperty(t,r,n),n\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */}", "title": "" }, { "docid": "d9e47d6b813e1a6a2a1d60ab4855bb16", "score": "0.45427302", "text": "async function annotationsCreate() {\n const subscriptionId = \"subid\";\n const resourceGroupName = \"my-resource-group\";\n const resourceName = \"my-component\";\n const annotationProperties = {\n annotationName: \"TestAnnotation\",\n category: \"Text\",\n eventTime: new Date(\"2018-01-31T13:41:38.657Z\"),\n id: \"444e2c08-274a-4bbb-a89e-d77bb720f44a\",\n properties: '{\"Comments\":\"Testing\",\"Label\":\"Success\"}',\n };\n const credential = new DefaultAzureCredential();\n const client = new ApplicationInsightsManagementClient(credential, subscriptionId);\n const result = await client.annotations.create(\n resourceGroupName,\n resourceName,\n annotationProperties\n );\n console.log(result);\n}", "title": "" }, { "docid": "1e68c75e2bdf057cb8c10345a5256f80", "score": "0.45360303", "text": "function ɵɵnamespaceHTML() {\n namespaceHTMLInternal();\n}", "title": "" }, { "docid": "4caa92dbd444856e80d27193a461d5e3", "score": "0.45313734", "text": "async function generateDetailedCostReportByBillingAccountLegacyAndBillingPeriod() {\n const scope = \"providers/Microsoft.Billing/billingAccounts/12345\";\n const parameters = {\n billingPeriod: \"202008\",\n metric: \"ActualCost\",\n };\n const credential = new DefaultAzureCredential();\n const client = new CostManagementClient(credential);\n const result = await client.generateDetailedCostReport.beginCreateOperationAndWait(\n scope,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "fa7e519d6da6bd8e48417c16796f9dc1", "score": "0.4523552", "text": "function tt() {\n if (\"undefined\" == typeof atob) throw new c(a.UNIMPLEMENTED, \"Blobs are unavailable in Firestore in this environment.\");\n}", "title": "" }, { "docid": "fa7e519d6da6bd8e48417c16796f9dc1", "score": "0.4523552", "text": "function tt() {\n if (\"undefined\" == typeof atob) throw new c(a.UNIMPLEMENTED, \"Blobs are unavailable in Firestore in this environment.\");\n}", "title": "" }, { "docid": "96dad832d9991d80bed710c4704adbc2", "score": "0.4516131", "text": "export() {}", "title": "" }, { "docid": "1caa7018e27440eddb372d08a78a198c", "score": "0.45159486", "text": "function TestSageAPI1() {\n\treturn Global.GetOS();\n}", "title": "" }, { "docid": "b1995fa76e3169bd82d17d8b73867908", "score": "0.4513591", "text": "function ɵɵnamespaceHTML() {\n namespaceHTMLInternal();\n}", "title": "" }, { "docid": "b1995fa76e3169bd82d17d8b73867908", "score": "0.4513591", "text": "function ɵɵnamespaceHTML() {\n namespaceHTMLInternal();\n}", "title": "" }, { "docid": "b1995fa76e3169bd82d17d8b73867908", "score": "0.4513591", "text": "function ɵɵnamespaceHTML() {\n namespaceHTMLInternal();\n}", "title": "" }, { "docid": "b1995fa76e3169bd82d17d8b73867908", "score": "0.4513591", "text": "function ɵɵnamespaceHTML() {\n namespaceHTMLInternal();\n}", "title": "" }, { "docid": "b81bc9f5adce7c9b7f4616c7a336442d", "score": "0.45112014", "text": "onInitialize(params) {\n let clientCapabilities = params.capabilities;\n // Does the client support the `workspace/configuration` request?\n // If not, we will fall back using global settings\n this.hasConfigurationCapability = !!(clientCapabilities.workspace && !!clientCapabilities.workspace.configuration);\n this.clientHasWorkspaceFolderCapability = !!(clientCapabilities.workspace && !!clientCapabilities.workspace.workspaceFolders);\n //return the capabilities of the server\n return {\n capabilities: {\n textDocumentSync: vscode_languageserver_1.TextDocumentSyncKind.Full,\n // Tell the client that the server supports code completion\n completionProvider: {\n resolveProvider: true,\n //anytime the user types a period, auto-show the completion results\n triggerCharacters: ['.'],\n allCommitCharacters: ['.', '@']\n },\n documentSymbolProvider: true,\n workspaceSymbolProvider: true,\n referencesProvider: true,\n signatureHelpProvider: {\n triggerCharacters: ['(', ',']\n },\n definitionProvider: true,\n hoverProvider: true,\n executeCommandProvider: {\n commands: [\n CustomCommands.TranspileFile\n ]\n }\n }\n };\n }", "title": "" }, { "docid": "5d9f51a09a7d2a82543c832e0e1f556b", "score": "0.4509994", "text": "async function j$3(r,s$1){const o=K(r),n=H(r);n||o||(r=Q(r));const f={url:r,requestOptions:{...f$3(s$1)}};let h=J(r);if(h){const e=await async function(e,t){if(null!=e.responseData)return e.responseData;e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers});e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query});if(e.before){let r,s;try{s=await e.before(t);}catch(e){r=R$1(\"request:interceptor\",e,t);}if((s instanceof Error||s instanceof s$g)&&(r=R$1(\"request:interceptor\",s,t)),r)throw e.error&&e.error(r),r;return s}}(h,f);if(null!=e)return {data:e,getHeader:M$2,requestOptions:f.requestOptions,url:f.url};h.after||h.error||(h=null);}if(r=f.url,\"image\"===(s$1=f.requestOptions).responseType){if(s(\"host-webworker\")||s(\"host-node\"))throw R$1(\"request:invalid-parameters\",new Error(\"responseType 'image' is not supported in Web Workers or Node environment\"),f)}else if(o)throw R$1(\"request:invalid-parameters\",new Error(\"Data URLs are not supported for responseType = \"+s$1.responseType),f);if(\"head\"===s$1.method){if(s$1.body)throw R$1(\"request:invalid-parameters\",new Error(\"body parameter cannot be set when method is 'head'\"),f);if(o||n)throw R$1(\"request:invalid-parameters\",new Error(\"data and blob URLs are not supported for method 'head'\"),f)}if(await async function(){s(\"host-webworker\")?U$1||(U$1=await import('./chunks/request-b738ca3b.js')):j$3._abortableFetch||(s(\"esri-abortable-fetch\")?j$3._abortableFetch=e$1.fetch.bind(e$1):j$3._abortableFetch=(await import('./chunks/fetch.umd-880c74b0.js').then(function (n) { return n.f; })).fetch);}(),U$1)return U$1.execute(r,s$1);const w=g$4();T$2(s$1,()=>w.abort());const y={controller:w,credential:null,credentialToken:null,fetchOptions:null,hasToken:!1,interceptor:h,params:f,redoRequest:!1,useIdentity:_$4.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},g=await async function(t){let r,s;await async function(t){const r=t.params.url,s=t.params.requestOptions,o=t.controller.signal,n=s.body;let a=null,i=null,l=null;P$2&&\"HTMLFormElement\"in e$1&&(n instanceof FormData?a=n:n instanceof HTMLFormElement&&(i=n,a=new FormData(i)));\"string\"==typeof n&&(l=n);t.fetchOptions={cache:s.cacheBust&&!j$3._abortableFetch.polyfill?\"no-cache\":\"default\",credentials:\"same-origin\",headers:s.headers||{},method:\"head\"===s.method?\"HEAD\":\"GET\",mode:\"cors\",redirect:\"follow\",signal:o},(a||l)&&(t.fetchOptions.body=a||l);\"anonymous\"===s.authMode&&(t.useIdentity=!1);if(t.hasToken=!!(/token=/i.test(r)||s.query&&s.query.token||a&&a.get&&a.get(\"token\")||i&&i.elements.token),t.useIdentity&&!t.hasToken&&!t.credentialToken&&!B$3(r)&&!y$8(o)){let e;\"immediate\"===s.authMode?(await H$2(),e=await i$g.getCredential(r,{signal:o}),t.credential=e):\"no-prompt\"===s.authMode?(await H$2(),e=await i$g.getCredential(r,{prompt:!1,signal:o}).catch(()=>{}),t.credential=e):i$g&&(e=i$g.findCredential(r)),e&&(t.credentialToken=e.token,t.useSSL=!!e.ssl);}}(t);try{do{[r,s]=await N$2(t);}while(!await $$2(t,r,s))}catch(e){const s=R$1(\"request:server\",e,t.params,r);throw s.details.ssl=t.useSSL,t.interceptor&&t.interceptor.error&&t.interceptor.error(s),s}const o=t.params.url;if(/\\/sharing\\/rest\\/(accounts|portals)\\/self/i.test(o)&&!t.hasToken&&!t.credentialToken&&s&&s.user&&s.user.username&&!T$1(o)){const e=F(o,!0);e&&_$4.trustedServers.push(e);}const n=t.credential;if(n&&i$g){const e=i$g.findServerInfo(n.server);let t=e&&e.owningSystemUrl;if(t){t=t.replace(/\\/?$/,\"/sharing\");const e=i$g.findCredential(t,n.userId);e&&-1===i$g._getIdenticalSvcIdx(t,e)&&e.resources.unshift(t);}}return {data:s,getHeader:r?e=>r.headers.get(e):M$2,requestOptions:t.params.requestOptions,ssl:t.useSSL,url:t.params.url}}(y);return h&&h.after&&h.after(g),g}", "title": "" }, { "docid": "fd869999499c00c2c97ecf482542e945", "score": "0.45037523", "text": "function e(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */}", "title": "" }, { "docid": "5e6ff56369c5d4d44876a9ca024d4681", "score": "0.44966725", "text": "function libraryVersion() {\n return \"1.3.3\";\n}", "title": "" }, { "docid": "f84b7611e854125bf485a410d9886d32", "score": "0.4483137", "text": "function is_namespace_blob_mock(bucket_type, remote_endpoint_type) {\n return remote_endpoint_type === 'AZURE' && bucket_type === 'namespace' && !process.env.NEWAZUREPROJKEY;\n}", "title": "" }, { "docid": "8e93e7c1a82f4ebe411a69a9888ac056", "score": "0.44705665", "text": "async function dciOperationsList() {\n const subscriptionId = \"00000000-0000-0000-0000-000000000000\";\n const credential = new DefaultAzureCredential();\n const client = new CustomerInsightsManagementClient(credential, subscriptionId);\n const resArray = new Array();\n for await (let item of client.operations.list()) {\n resArray.push(item);\n }\n console.log(resArray);\n}", "title": "" }, { "docid": "e20d36a8b26e163da19fe04ae884c878", "score": "0.4458615", "text": "constructor() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "e20d36a8b26e163da19fe04ae884c878", "score": "0.4458615", "text": "constructor() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "90f16461fc68e663c3c03e500104e71a", "score": "0.44560498", "text": "function WebRTCSignalingConstants() {}", "title": "" }, { "docid": "29db1be72e007f2996ef22756d53fad3", "score": "0.44540462", "text": "constructor(url, options) {\n var _a, _b;\n if (url === undefined) {\n throw new Error(\"'url' cannot be null\");\n }\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n const packageDetails = `azsdk-js-azure-storage-blob/12.13.0`;\n const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {\n userAgentPrefix\n }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : \"{url}\" });\n super(optionsWithDefaults);\n // Parameter assignments\n this.url = url;\n // Assigning values to Constant parameters\n this.version = options.version || \"2021-12-02\";\n this.service = new ServiceImpl(this);\n this.container = new ContainerImpl(this);\n this.blob = new BlobImpl(this);\n this.pageBlob = new PageBlobImpl(this);\n this.appendBlob = new AppendBlobImpl(this);\n this.blockBlob = new BlockBlobImpl(this);\n }", "title": "" }, { "docid": "063496b1e302035f7dffba216be8ce3e", "score": "0.44472176", "text": "function getAccessToken() {\n var authorityUrl = 'https://login.windows.net/aenv.onmicrosoft.com/oauth2/token';\n var clientId = '91553c83-ec0c-431a-93da-ef9c943d3f9f';\n var clientSecret = 'R/MBFEDNWoaLKUettQO+l6dmKQpW6AOKQTNqWu9Toy8=';\n var resource = 'https://www.ae.be/aegame';\n var grantType = 'client_credentials';\n\n // Build the post string\n var post_data = querystring.stringify({\n 'client_id': clientId,\n 'client_secret': clientSecret,\n 'resource': resource,\n 'grant_type': grantType\n });\n\n // An object of options to indicate where to post to\n var post_options = {\n host: 'login.windows.net',\n port: 443,\n path: '/aenv.onmicrosoft.com/oauth2/token',\n method: 'GET',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Content-Length': post_data.length\n }\n };\n\n // Set up the request\n var post_req = https.request(post_options, function (res) {\n res.setEncoding('utf8');\n res.on('data', function (chunk) {\n console.log('Response: ' + chunk);\n });\n });\n\n // post the data\n post_req.write(post_data);\n post_req.end();\n}", "title": "" }, { "docid": "0cb535d49712c5dd6f3f24eb60467d01", "score": "0.4434978", "text": "get blobBody() {\n return undefined;\n }", "title": "" }, { "docid": "203fa444b91c78d9421b27d1addb5ccc", "score": "0.4432815", "text": "function j() {\n if (\"undefined\" == typeof atob) throw new U(R.UNIMPLEMENTED, \"Blobs are unavailable in Firestore in this environment.\");\n}", "title": "" }, { "docid": "61a357ec827b47d3e626a76758df7894", "score": "0.44159824", "text": "getHeaders() {\n return {\n Authorization: `Bearer ${this.adwords.accessToken}`,\n developerToken: this.adwords.developerToken,\n clientCustomerId: this.adwords.clientCustomerId,\n skipReportHeader: 'true',\n skipReportSummary: 'true',\n };\n }", "title": "" }, { "docid": "e1b96e14d8470a97a35c4723cb96641a", "score": "0.440356", "text": "validateVersionHeaders () {\n\t\t// we don't expect any version headers\n\t}", "title": "" }, { "docid": "80a2f7466b6ed273e91b9298f42d5c2a", "score": "0.44028148", "text": "function SystemIO() {\n 'use strict';\n return;\n}", "title": "" } ]
c50d3c4bb02662c6b5a9f55656272640
TODO: this function can be made a lot more generic, to wrap plain object initializer with inheritance support
[ { "docid": "99d6d3b5d869a1b71427143e4c3701b9", "score": "0.0", "text": "function styleRuleWithOptions() {\n var options = Object.assign.apply(Object, [{}].concat(Array.prototype.slice.call(arguments))); //Simpler notation?\n var targetMethodName = options.targetMethodName || \"css\";\n\n function styleRuleDecorator(target, key, descriptor) {\n var initializer = descriptor.initializer,\n value = descriptor.value;\n\n\n descriptor.objInitializer = function () {\n var style = evaluateStyleRuleObject(this, initializer, value, options);\n\n if (options.inherit) {\n // Get the value we set in the prototype of the parent class\n var parentDesc = Object.getPrototypeOf(this.__proto__)[getStyleRuleKey(key)];\n var parentStyle = evaluateStyleRuleObject(this, parentDesc.objInitializer, parentDesc.value, options);\n style = deepCopy({}, parentStyle, style);\n return style;\n }\n\n return style;\n };\n\n // Change the prototype of this object to be able to access the old descriptor/value\n target[getStyleRuleKey(key)] = Object.assign({}, descriptor);\n\n descriptor.initializer = function () {\n var style = descriptor.objInitializer.call(this);\n return this[targetMethodName](style);\n };\n\n delete descriptor.value;\n\n return lazyInit(target, key, descriptor);\n }\n\n return styleRuleDecorator;\n}", "title": "" } ]
[ { "docid": "ec3f501563a471eab65316c4a72f0635", "score": "0.6482809", "text": "static initialize(obj) { \n obj['type'] = type;\n }", "title": "" }, { "docid": "300f75af360a9687c068c874f6df91e8", "score": "0.6427622", "text": "static initialize(obj, type) { \n }", "title": "" }, { "docid": "a3a1daf07c3f5e9aa1d0bbe63fd85064", "score": "0.6373133", "text": "static initialize(obj, type) { \n obj['type'] = type;\n }", "title": "" }, { "docid": "a3a1daf07c3f5e9aa1d0bbe63fd85064", "score": "0.6373133", "text": "static initialize(obj, type) { \n obj['type'] = type;\n }", "title": "" }, { "docid": "a3a1daf07c3f5e9aa1d0bbe63fd85064", "score": "0.6373133", "text": "static initialize(obj, type) { \n obj['type'] = type;\n }", "title": "" }, { "docid": "a3a1daf07c3f5e9aa1d0bbe63fd85064", "score": "0.6373133", "text": "static initialize(obj, type) { \n obj['type'] = type;\n }", "title": "" }, { "docid": "a3a1daf07c3f5e9aa1d0bbe63fd85064", "score": "0.6373133", "text": "static initialize(obj, type) { \n obj['type'] = type;\n }", "title": "" }, { "docid": "a3a1daf07c3f5e9aa1d0bbe63fd85064", "score": "0.6373133", "text": "static initialize(obj, type) { \n obj['type'] = type;\n }", "title": "" }, { "docid": "a3a1daf07c3f5e9aa1d0bbe63fd85064", "score": "0.6373133", "text": "static initialize(obj, type) { \n obj['type'] = type;\n }", "title": "" }, { "docid": "f9bd420b0c5c1a4d4db2afd9964bbbf2", "score": "0.6189826", "text": "function objectify(obj) {\n return Object.create(obj);\n }", "title": "" }, { "docid": "d0770cf4b7cabd5e16eafc63cc453184", "score": "0.6185268", "text": "static initialize(obj, name, value) { \n obj['name'] = name;\n obj['value'] = value;\n }", "title": "" }, { "docid": "1b17afcb173fe26c74dfa6d0c40b70a8", "score": "0.616731", "text": "constructor(obj) {\n Object.assign(this, obj);\n }", "title": "" }, { "docid": "db8511bd40e6624c90bcb4dd283d20d0", "score": "0.6135804", "text": "function base(spec) {\n var that = {}; // Create an empty object\n that.name = spec.name; // Add it a \"name\" property\n that.age = 9; // Add it a \"name\" property\n return that; // Return the object\n}", "title": "" }, { "docid": "c9ed6792ec6c724e1c71c0f32ca080e6", "score": "0.61327165", "text": "static initialize(obj, decimals, identifier, name, symbol, type) { \n obj['decimals'] = decimals;\n obj['identifier'] = identifier;\n obj['name'] = name;\n obj['symbol'] = symbol;\n obj['type'] = type;\n }", "title": "" }, { "docid": "ee95eaac47fcb2eb1e6420aa0fe11ffb", "score": "0.6114831", "text": "static initialize(obj) {\n }", "title": "" }, { "docid": "ee95eaac47fcb2eb1e6420aa0fe11ffb", "score": "0.6114831", "text": "static initialize(obj) {\n }", "title": "" }, { "docid": "ee95eaac47fcb2eb1e6420aa0fe11ffb", "score": "0.6114831", "text": "static initialize(obj) {\n }", "title": "" }, { "docid": "ee95eaac47fcb2eb1e6420aa0fe11ffb", "score": "0.6114831", "text": "static initialize(obj) {\n }", "title": "" }, { "docid": "9d6f911eee48c8aab3672fd0caf21f98", "score": "0.60971296", "text": "static initialize(obj, message, _object, tag, type) { \n obj['message'] = message;\n obj['object'] = _object;\n obj['tag'] = tag;\n obj['type'] = type;\n }", "title": "" }, { "docid": "e82b5a35844533de7d52db0469f068a1", "score": "0.6083796", "text": "function myNew(constructor, ...args){\n const obj= {\n\n }\n Object.setPrototypeOf(obj, constructor.prototype) \n return constructor.apply(obj, args) || obj\n}", "title": "" }, { "docid": "c9b907e2230696ba748c5453d1f3bc7b", "score": "0.60677636", "text": "function myNew(constructor){\n let obj={}\n //Object.setPrototypeOf(target, from)\n Object.setPrototypeOf(obj,constructor.prototype)\n //Associate arguments with array\n let argsArray=Array.prototype.slice.apply(arguments)\n constructor.apply(obj,argsArray.slice(1)) \n // 1 for arguments because 0 for constructor (myNew(constructor))\n \n return obj\n}", "title": "" }, { "docid": "38cc8f440a33cd0938a26e340edfe69d", "score": "0.606626", "text": "static initialize(obj, value) { \n obj['value'] = value;\n }", "title": "" }, { "docid": "e6df3ba0844394cef9a65fa0b0ae2a52", "score": "0.6039501", "text": "static initialize(obj, name) { \n obj['name'] = name;\n }", "title": "" }, { "docid": "204871b01c65fc40b326fd4aab3f45d8", "score": "0.6028615", "text": "static inherit(obj = {}) {\n return new InheritFlag(obj);\n }", "title": "" }, { "docid": "1f74542d059dff3e164361adc6a48737", "score": "0.60069174", "text": "static initialize(obj, environment, revision) { \n obj['environment'] = environment;\n obj['revision'] = revision;\n }", "title": "" }, { "docid": "0e8f5b738bf16eead26b4b195225e79a", "score": "0.59788984", "text": "constructor() {\n super({objectMode: true});\n }", "title": "" }, { "docid": "3f02317b5ebe9b1ddb4aa4b9ab721fe7", "score": "0.59765875", "text": "function baseExtend(args, deep) {\n\n var i, j, obj, src, key, keys, len;\n var target = args[0];\n var length = args.length;\n\n for (i = 1; i < length; ++i) {\n\n obj = args[i];\n if ((obj === null || typeof obj !== 'object') && typeof obj !== 'function'){\n continue;\n }\n\n keys = Object.keys(obj);\n len = keys.length;\n\n for (j = 0; j < len; j++) {\n key = keys[j];\n src = obj[key];\n if (deep && src !== null && typeof src === 'object') {\n if (target[key] === null || typeof target[key] !== 'object') {\n target[key] = Array.isArray(src) ? [] : {};\n }\n baseExtend([target[key], src], true);\n } else {\n target[key] = src;\n }\n }\n }\n return target;\n}", "title": "" }, { "docid": "444a5428edbe3e99257f7845f0b2541f", "score": "0.5953221", "text": "static initialize(obj, extensionHash, parentId) { \n obj['extensionHash'] = extensionHash;\n obj['parentId'] = parentId;\n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" }, { "docid": "6f716f181baa8d61e49bcdd60a141a90", "score": "0.5953188", "text": "static initialize(obj) { \n }", "title": "" } ]
703be81e3a932177aa7117c2e1903ea8
Open order products in popup
[ { "docid": "c53deaeea3a6b15bc4a4e27dbb8df5b8", "score": "0.7229725", "text": "function order_products_popup(order_record_id)\n{\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: '/waiter/ajax_get_order',\n\t\tdata: {'order_record_id' : order_record_id},\n\t\tasync: false,\n\t\tsuccess: function(data) {\n\t\t\tmyApp.popup($('.my-popup'));\n\t\t\t$('.my-popup').children().remove();\n\t\t\t$('.my-popup').append(data);\n\t\t\t$('.order-payment').on('click', function(){\n\t\t\t\torder_payment(order_record_id, $(this).find('.order-total-price').text());\n\t\t\t\t$(this).attr('disabled', true);\n\t\t\t});\n\t\t\torder_product_events_init();\n\t\t},\n\t\terror: function() {\n\t\t\talert('failure');\n\t\t}\n\t});\n}", "title": "" } ]
[ { "docid": "2a06820084d2a9b2edc9a2ce3a4860d2", "score": "0.75475276", "text": "function openProd(){\n $('.toproduct').click(function(){\n location.replace(app_root+'/productos/'+$(this).attr(\"id\"));\n });\n }", "title": "" }, { "docid": "1bdece4cce5942de985638155686f059", "score": "0.7329532", "text": "function openProduct() {\n chrome.tabs.query({ active: true, currentWindow: true }, tabs => {\n let productLink = '';\n chrome.storage.sync.get(['productLink'], response => {\n console.log('product link fetched from chrome!', response.productLink);\n productLink = response.productLink.toString();\n chrome.tabs.query({ active: true, currentWindow: true }, tabs => {\n chrome.tabs.sendMessage(tabs[0].id, { todo: 'openProductPage', params: { productLink } });\n });\n });\n });\n}", "title": "" }, { "docid": "d78a3e392012dbc6163f55d840f57c84", "score": "0.7243269", "text": "function onProductClick() {\n\n window.open(redirect_url, '_blank')\n\n }", "title": "" }, { "docid": "2c559819d03321b33a92aa292d9ff589", "score": "0.7026915", "text": "function openProducts(){\n \tdocument.getElementsByClassName(\"product\")[0].style.display = \"block\";\n\tdocument.getElementsByClassName(\"cart\")[0].style.display = \"none\";\n\tdocument.getElementsByClassName(\"selection\")[0].style.display = \"none\";\n\tshowProductsAndRestrictions()\n}", "title": "" }, { "docid": "239fb7c8fbe0d085f9e9fa39a937de71", "score": "0.689799", "text": "function changeOrder()\n{\n window.open( 'getDataElementOrder.action', '_blank', 'width=700,height=500,scrollbars=yes' );\n}", "title": "" }, { "docid": "c6e61e8e6f2fe2c3b26baa96f1a9e717", "score": "0.6628171", "text": "function ActiveOrderPopup() {\n $(document).on('s123.page.ready.activeOrderPopup', function(event) {\n $('.orderButtonPopup').off('click').on('click', function(event) {\n var $this = $(this);\n if (!atcValidator()) return;\n $this.attr('disabled', '');\n /**\n * Modules who has the ability to add multiple products to cart in single\n * click on the order button has array of unqiueID so we take it and modules\n * that don't have this ability we just add the the single unqiueID to array and\n * send it to cart.\n */\n var multiProducts = $this.data('multi-products') ? $this.data('multi-products') : JSON.stringify(Array($this.data('unique-page')));\n /**\n * Form Data Initialize - We use the browser Form Data Interface when we need\n * to upload files via Ajax. Note: We must add `cache: false, contentType: false,\n * processData: false` to `$.ajax` so it will works.\n * Documentations: https://developer.mozilla.org/en-US/docs/Web/API/FormData\n */\n var formData = new FormData();\n formData.append('w', $('#w').val());\n formData.append('websiteID', $('#websiteID').val());\n formData.append('moduleID', $this.data('module'));\n /* fix related product issue - when the user was at the product page and\n he try adding to cart a related product, the system was adding the product\n options to the related product even that they belong to the displayed product */\n if ($this.data('product-page')) {\n formData.append('productOptions', $('#productOptions').length !== 0 ? $('#productOptions').html() : '');\n formData.append('customText', $('#customText').length !== 0 ? $('#customText').html() : '');\n }\n formData.append('amount', $this.data('quantity-amount') ? $this.data('quantity-amount') : '1');\n formData.append('multiProducts', multiProducts);\n $('input[type=\"file\"]').each(function(index, upload) {\n if (upload.files.length > 0) {\n formData.append(upload.id, upload.files[0]);\n }\n });\n $.ajax({\n type: \"POST\",\n url: \"/versions/\" + $('#versionNUM').val() + \"/wizard/orders/front/addToCart.php\",\n data: formData,\n cache: false,\n contentType: false,\n processData: false,\n success: function(response) {\n response = tryParseJSON(response);\n showCart_GetContent('/versions/' + $('#versionNUM').val() + '/wizard/orders/front/showCart.php?w=' + $('#w').val() + '&websiteID=' + $('#websiteID').val() + '&tranW=' + websiteLanguageCountryFullCode + '&moduleID=' + $this.data('module'));\n CartCounter.updateCartIcon();\n $this.removeAttr('disabled');\n topWindow.eCommerce_cart_lastAdded = response.updatedCartIds ? response.updatedCartIds : false;\n }\n });\n });\n $('.orderOpenCart').off('click').on('click', function(event) {\n var $this = $(this);\n /**\n * Check if the website loaded in an Iframe (e.g. single page data pages), at\n * those cases we like to open the cart pop-up at the parent window and not\n * in the current pop-up/\n */\n showCart_GetContent('/versions/' + $('#versionNUM').val() + '/wizard/orders/front/showCart.php?w=' + $('#w').val() + '&websiteID=' + $('#websiteID').val() + '&moduleTypeNUM=37&tranW=' + websiteLanguageCountryFullCode + '&cartButton=1');\n });\n });\n\n /**\n * The function check if the product have fields that need to validation\n * before adding them to cart, if so the function alert the user and return\n * false, otherwise it return true.\n */\n function atcValidator() {\n var $ct = $(\"#product-custom-text\");\n var $po = $('.product-options');\n if ($ct.length !== 0 && $ct.data('mandatory')) {\n var $ct_fieldTitle = $('#ct_fieldTitle');\n if ($ct_fieldTitle.val().length === 0) {\n $ct_fieldTitle.popover({\n container: 'body',\n content: translations.productvalidatorPopover,\n trigger: 'manual',\n template: '<div class=\"popover product-validator-popover\" role=\"tooltip\"><div class=\"arrow\"></div><div class=\"popover-content\"></div></div>',\n placement: function(popover, input) {\n return isMobile.any() ? 'auto' : ($('html').attr('dir') === 'rtl' ? 'left' : 'right');\n }\n });\n $ct_fieldTitle.popover('show').one('input', function(e) {\n $(this).popover('hide');\n });\n $ct_fieldTitle.focus();\n return false;\n }\n }\n /**\n * Check if mandatory fields in product options\n * are not empty.\n */\n if ($po.length !== 0) {\n var $options = $po.find('.p-o-container[data-mandatory=\"1\"]');\n var addToCart = true;\n var $popoverContainer;\n var $firstErrorOption;\n var $errorsOptionsList = [];\n $.each($options, function(index, option) {\n var $option = $(option);\n switch ($option.data('type')) {\n /**\n * Multiple Items Options - When an option have multiple items the\n * system add a `selected` on the chosen item.\n */\n case 'color':\n case 'radio':\n case 'checkbox':\n case 'size':\n case 'list':\n if ($option.find('[id*=poi].selected').length === 0) {\n addToCart = false;\n }\n $popoverContainer = $(option);\n break;\n /**\n * One Item Option - When an option have only one item we use the\n * `form-control` to get its input and checking its value.\n */\n default:\n if ($option.find('.form-control').val().length === 0) {\n addToCart = false;\n $popoverContainer = $(option).parent();\n }\n }\n if (!addToCart) {\n $errorsOptionsList.push($option);\n var $popover = $option.find('.p-o-popover-box');\n if ($popover.length === 0) $popover = $option;\n /**\n * Bootstrap's Popovers Plugin Initial\n * Documentation : http://getbootstrap.com/javascript/#popovers\n */\n $popover.popover({\n container: 'body',\n content: translations.productvalidatorPopover,\n trigger: 'manual',\n template: '<div class=\"popover product-validator-popover\" role=\"tooltip\"><div class=\"arrow\"></div><div class=\"popover-content\"></div></div>',\n placement: function(popover, input) {\n return isMobile.any() ? 'auto' : ($('html').attr('dir') === 'rtl' ? 'right' : 'left');\n }\n });\n }\n });\n if ($errorsOptionsList.length !== 0) {\n var offset = $('#mainNav').outerHeight();\n if (!$.isNumeric(offset)) offset = 0;\n if (!elementInViewport($errorsOptionsList[0].get(0))) {\n $('html, body').scrollTop($errorsOptionsList[0].offset().top - offset);\n }\n $.each($errorsOptionsList, function(index, $option) {\n var $popover = $option.find('.p-o-popover-box');\n if ($popover.length === 0) $popover = $option;\n $popover.popover('show');\n });\n $po.off('po.update').on('po.update', function(event) {\n $('.product-validator-popover').popover('hide');\n });\n }\n return addToCart;\n }\n return true;\n }\n}", "title": "" }, { "docid": "7b3e69da3964cfdd375b3752cd8d10df", "score": "0.65951794", "text": "function openCheckoutLink() {\n var cart = getCart();\n shopCart.clearLineItems();\n for (var i = 0; i < Object.keys(cart).length; i++) {\n var id = Object.keys(cart)[i];\n console.log(skuMatch[id]);\n console.log(cart[id]);\n shopCart.createLineItemsFromVariants({\n variant: skuMatch[id],\n quantity: cart[id]\n });\n }\n\n window.open(shopCart.checkoutUrl, \"_blank\", \"height=\" + (screen.height * 3 / 4) + \",width=\" + (screen.width / 2) + \",top=\" + (screen.height / 8) + \",left=\" + (screen.width / 4));\n}", "title": "" }, { "docid": "8a2dd606e7e33e7cb7bede360459efc0", "score": "0.65044016", "text": "function openCreateProduct() {\n\tdocument.querySelector(\".modal-product-background\").classList.add(\"show-modal\");\n}", "title": "" }, { "docid": "3513ccc7958619476bac6e50fa79ed43", "score": "0.6483626", "text": "function open_popup(){\r\n\t\t$('.xoo-cp-opac').show();\r\n \t$('.xoo-cp-modal').addClass('xoo-cp-active');\r\n\t}", "title": "" }, { "docid": "da64d866827c24716c0c45502ddd6bdb", "score": "0.6396549", "text": "function showAddProductModal() {\n app.showModal('viewmodels/inventory/findProductModal', productList)\n .then(function (result) {\n\n if (result && result != 'cancel') {\n\n var productIncident = datacontext.createObject(model.entityNames.productIncident);\n\n productList.remove(result);\n\n productIncident.product(result);\n productIncident.quantity(1);\n\n productIncident.incident(incident());\n addToList(productIncident);\n }\n });\n }", "title": "" }, { "docid": "33d96eeaba7401848399dfade2ba5d87", "score": "0.6392257", "text": "function open_search_product () {\n var modalInstance = $uibModal.open({\n animation: true,\n templateUrl: 'partials/Modal_Product.html',\n controller: 'ProductSearchController',\n controllerAs: 'vm',\n size: 'lg',\n backdrop: false,\n resolve: {\n origin: function () {\n return {\n 'origin':'buy'\n };\n }\n }\n });\n }", "title": "" }, { "docid": "a79d27108bc2ddc449810def23f05131", "score": "0.6379746", "text": "function openGuestModal(productID) {\n setIsGuestModal(true);\n setProductClicked(productID);\n }", "title": "" }, { "docid": "553a534f642b093a2883fb13072be974", "score": "0.6376971", "text": "onWindowsOrderStepperFinish() {\n const priceOptions = find(this.windowsOption.prices, ({ capacities }) =>\n capacities.includes('renew'),\n );\n const expressParams = {\n productId: 'vps',\n serviceName: this.stateVps.name,\n planCode: this.windowsOption.planCode,\n duration: priceOptions.duration,\n pricingMode: priceOptions.pricingMode,\n quantity: 1,\n };\n this.expressOrderUrl = `${this.expressOrderUrl}?products=${JSURL.stringify([\n expressParams,\n ])}`;\n\n this.$window.open(this.expressOrderUrl, '_blank', 'noopener');\n\n this.CucCloudMessage.success({\n textHtml: this.$translate.instant('vps_order_windows_order_success', {\n url: this.expressOrderUrl,\n }),\n });\n\n return this.$onInit();\n }", "title": "" }, { "docid": "a7d1bfe7fd5cfb00f1c7e6f2c8ab00d7", "score": "0.636202", "text": "function displayPrice() {\n\n \n\n \n console.log(\"Displaying price\")\n\n let title = document.getElementById(\"productTitle\");\n \n// let rakuten_website= document.open(\"https://search.rakuten.co.jp/search/mall/\" +title.innerHTML.slice(0,30),'','noopener=false');\n window.open(\"https://search.rakuten.co.jp/search/mall/\" +title.innerHTML.slice(0,30),\"popup.html\",)\n \n\n // var xhr = new XMLHttpRequest(); \n // xhr.open('GET', rakuten_website, true);\n // xhr.responseType = \"document\"\n // xhr.send('');\n\n console.log(rakuten_website)\n\n}", "title": "" }, { "docid": "d1456c8d0c263b3a24d90805035a4230", "score": "0.6325821", "text": "shopingProduct(product) {\n this.fillProduct.id = product.id;\n this.newPurchases.product_id = product.id;\n $('#purchases').modal('show');\n }", "title": "" }, { "docid": "8628175d94b4fbcc2677c1dae0ec766a", "score": "0.6316558", "text": "function onProductClick() {\n $('.js-product--click').click(function(e) {\n const petId = $(this).closest('article').attr('data-id')\n $('body').addClass('modal--open')\n renderModalDialog(petId)\n\n // Below makes sure any click outside of modal closes modal\n e.stopPropagation()\n $(document).click(function() {\n closeModalDialog()\n })\n $('.js-dialog--listener').click(function(e) {\n e.stopPropagation()\n })\n })\n}", "title": "" }, { "docid": "7984a43ddf7faef93d7a2bf3149e6529", "score": "0.62856907", "text": "function DisplayOneProducto(productoid){\n window.location = \"producto.html\"+\"?prodId=\" + productoid;\n}", "title": "" }, { "docid": "92e679e2c566518031a97ccb70443e9f", "score": "0.62830466", "text": "function OpenCatalogue() {\n\t//Show the purchaseDone_button, hide the Work and Catalogue buttons\n\tdocument.getElementById(\"work_button\").style.display = \"none\";\n\tdocument.getElementById(\"purchase_button\").style.display = \"none\";\n\tdocument.getElementById(\"purchaseDone_button\").style.display = \"inline\";\n\t\n\t//Hides all items so they don't display on work screen\n\t//HideItems();\n\t\n\t//Give game hint in gametext box\n\tdocument.getElementById(\"gametext\").innerHTML=\"Tap one of the items to purchase it.\";\n\t\n\t//Show the catalogue area\n\tdocument.getElementById(\"catalogue_data\").style.display = \"block\";\n\tdocument.getElementById(\"catalogue_background\").style.display = \"block\";\n}", "title": "" }, { "docid": "cb19bcea371016bdbc198b7374d2e9e4", "score": "0.623801", "text": "function abrir (id) {\r\n\topen('./productDetails.php?ID=' + id, '', 'top=300, left=300, width=675, height=215, resizable=no, menubar=no, titlebar=no, toolbar=no');\r\n}", "title": "" }, { "docid": "67c4903303aee39f1b3700390fb2c233", "score": "0.6237819", "text": "function reloadable_checkout_popup_opener( url )\n{\n var windowName = \"reloadableCheckoutPopup\";\n var windowObj = window.open( \"\", windowName, \"width=370,height=320,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes\" );\n windowObj.location.href = url;\n if ( windowObj.focus )\n windowObj.focus();\n}", "title": "" }, { "docid": "31a4308af72cd36c37bffd2bce3b138e", "score": "0.621263", "text": "function showCrosssell(html){\r\n\tjQuery(\"<div/>\", {\r\n\t\t\"class\": \"modal\",\r\n\t}).appendTo(\"body\");\r\n\tjQuery(\"<div/>\", {\r\n\t\t\"class\": \"crosssell_product_modal\",\r\n\t}).appendTo(\".modal\");\r\n\tjQuery('body').addClass('modal-open')\r\n\tjQuery('.crosssell_product_modal').html(html);\r\n\tjQuery('.crosssell_product_modal').fadeIn();\r\n}", "title": "" }, { "docid": "8d1fa396d4fa95cc9c55256b82774414", "score": "0.61602414", "text": "function openMenu() {\n\n var root = this.req.responseXML.documentElement; // xmlhttp.responseXML.documentElement;\n var itemcount = root.getElementsByTagName(\"ItemCount\")[0].childNodes[0].nodeValue;\n var showpopups = false;\n var index;\n for ( var i = 0; i < itemcount; i++) {\n if(root.getElementsByTagName(\"showpopup\" + i)[0] != undefined ) {\n var showpopup = root.getElementsByTagName(\"showpopup\" + i)[0].childNodes[0].nodeValue;\n if (showpopup && showpopup == 'true') {\n showpopups = true;\n index = i;\n }\n }\n }\n var invhistid = root.getElementsByTagName(\"invhistid0\")[0].childNodes[0].nodeValue;\n var rowcount = root.getElementsByTagName(\"totalItems\")[0].childNodes[0].nodeValue;\n if (showpopups == false) {// no need show popup, ordered<instock OR there\n // is ONLY one option\n document.getElementById(preinvhist_hid).value = invhistid; // set\n // invhistid\n // to a\n // hidden\n // field\n\n if(itemIndex!=''){\n if (root.getElementsByTagName(\"changeqtyto0\")[0] != null && root.getElementsByTagName(\"changeqtyto0\")[0].childNodes[0] != null) {\n var changeqtyto = root.getElementsByTagName(\"changeqtyto0\")[0].childNodes[0].nodeValue;\n if (changeqtyto != null) {\n var qtyfieldForOne = document.getElementById(\"qty_\" + itemIndex);\n qtyfieldForOne.value = changeqtyto;\n }\n }\n }else{\n for ( var i = 0; i < itemcount; i++) {\n if (root.getElementsByTagName(\"changeqtyto\" + i)[0] != null\n && root.getElementsByTagName(\"changeqtyto\" + i)[0].childNodes[0] != null) {\n var changeqtyto = root.getElementsByTagName(\"changeqtyto\" + i)[0].childNodes[0].nodeValue;\n if (changeqtyto != null) {\n var qtyfieldForOne = document.getElementById(\"qty_\" + i);\n qtyfieldForOne.value = changeqtyto;\n }\n }\n }\n }\n\n // redirect itempage-->basket catepage-->no basket-->submit form\n if (actionmode == 'redirect') {\n eval(\"\" + actioncontent + \"\");\n } else if (actionmode == 'exec')\n eval(\"validateBeforeSubmit(\" + rowcount + \")\");\n } else {\n var popupel = document.getElementById(popupid);\n\n var fasterMsg = \"If you require faster delivery click OK then on the basket specify a required-by date and our staff will contact you with options.\";\n var firstChooseMsg = \"Please choose from the following delivery options:\";\n var chooseAgainMsg = \"The inventory level has changed. Please reselect a delivery option.\";\n var outOfStockMsg = \"Sorry there is not enough stock to fulfill your request.\";\n var dropshipMsg = \"Sorry this item can only be drop shipped but a minimum quantity of {0} must be purchased. Click CANCEL and increase the quantity.\";\n if (document.getElementById(\"fasterMsg\") != null\n && document.getElementById(\"fasterMsg\").value != null\n && document.getElementById(\"fasterMsg\").value != \"\") {\n fasterMsg = document.getElementById(\"fasterMsg\").value;\n }\n if (document.getElementById(\"firstChooseMsg\") != null\n && document.getElementById(\"firstChooseMsg\").value != null\n && document.getElementById(\"firstChooseMsg\").value != \"\") {\n firstChooseMsg = document.getElementById(\"firstChooseMsg\").value;\n }\n if (document.getElementById(\"chooseAgainMsg\") != null\n && document.getElementById(\"chooseAgainMsg\").value != null\n && document.getElementById(\"chooseAgainMsg\").value != \"\") {\n chooseAgainMsg = document.getElementById(\"chooseAgainMsg\").value;\n }\n if (document.getElementById(\"outOfStockMsg\") != null\n && document.getElementById(\"outOfStockMsg\").value != null\n && document.getElementById(\"outOfStockMsg\").value != \"\") {\n outOfStockMsg = document.getElementById(\"outOfStockMsg\").value;\n }\n if (document.getElementById(\"dropshipMsg\") != null\n && document.getElementById(\"dropshipMsg\").value != null\n && document.getElementById(\"dropshipMsg\").value != \"\") {\n dropshipMsg = document.getElementById(\"dropshipMsg\").value;\n }\n\n var inventorychanged = root.getElementsByTagName(\"inventorychanged0\")[0].childNodes[0].nodeValue;\n var dsmq = root.getElementsByTagName(\"dropshipminqty0\");\n var dropshipminqty = \"\";\n if (dsmq && dsmq.length > 0)\n dropshipminqty = dsmq[0].childNodes[0].nodeValue;\n\n var content = \"\";\n var options = genDeliveryOptions(root, index);\n if (options == '') {// there is no options\n content = genDivHeader(\"\");\n if (dropshipminqty != \"\") {\n content += genDivBody(dropshipMsg\n .replace(\"{0}\", dropshipminqty));\n } else {\n content += genDivBody(outOfStockMsg);\n }\n content += genDivFooter(\"\");\n content += genCancelButtonRow();\n } else {\n if (inventorychanged && inventorychanged == 'true') {\n content += genDivHeader(chooseAgainMsg);\n } else {\n content += genDivHeader(firstChooseMsg);\n }\n content += genDivBody(options);\n content += genDivFooter(fasterMsg);\n content += genOKCancelButtonRows(rowcount);\n }\n\n $(popupel).addClass(\"modal\");\n popupel.innerHTML = content;\n\n var center_x = (jQuery(window).width() - popupel.clientWidth) / 2\n + document.body.parentNode.scrollLeft;\n var center_y = (jQuery(window).height() - popupel.clientHeight) / 2\n + document.body.parentNode.scrollTop;\n\n // popupel.style.left = center_x + \"px\";\n // popupel.style.top = center_y + \"px\";\n popupel.style.visibility = \"visible\";\n }\n}", "title": "" }, { "docid": "d34e60e4dece662f2cb9e2002cfe59aa", "score": "0.61302066", "text": "function openBuyStore(storeID){\n\t// Get the stores cost\n\tvar storeCost = $(\"#ps_name_\"+storeID).data(\"value\");\n\n\t$( \"#buyPartStore\" ).data('storeID', storeID);\n\t$( \"#bps_cost\" ).text(storeCost);\n\t$( \"#buyPartStore\" ).dialog( \"open\" );\n}", "title": "" }, { "docid": "8929817e21fa3c8b9ad00e032ff4bf6c", "score": "0.6129948", "text": "function openPopupPromoCode() {\n window.location.hash = '#?promoCodePopup';\n $body.addClass('overflow');\n $overlayPromoCode.addClass('open');\n scrollTo($body, 0, 500, $overlayPromoCode);\n }", "title": "" }, { "docid": "360056890f92fb3e453d6d2388a53b84", "score": "0.6113353", "text": "showBuscarProducto(){\n\n //Desplegar la ventana flotante\n $(\"#body-modal\").html(Helpers.listFind('Productos','list_productos',`pantalla.listarProductos('list_productos')`));\n this.listarProductos('list_productos')\n \n\n\n }", "title": "" }, { "docid": "cff24f79a476df81529f7d1f72bab916", "score": "0.6110476", "text": "deleteOpenStoreProduct() {\r\n document.querySelectorAll('.tr-item').forEach((item, index, array)=> {\r\n item.childNodes[8].addEventListener('click', () => {\r\n this.setProductFiltres(item);\r\n this.product = item;\r\n document.getElementById('delete-store-detail-modal').style.display = 'block';\r\n })\r\n })\r\n }", "title": "" }, { "docid": "fc0507949c3482b239aee23f6d4e2575", "score": "0.60805154", "text": "function onAddProductSuccess1MS(id, childProductId, quantity, product) {\n\n window.location = \"http://www.oneminutesite.it/listini.html\";\n}", "title": "" }, { "docid": "8fde1a89e7de9c97b0d27a7542f393ed", "score": "0.6080308", "text": "function openProductImagewindow(productImage)\n{\n window.open(productImage,\"ProductImage\",\"menubar=1,resizable=1,width=350,height=250\"); \n}", "title": "" }, { "docid": "e793b61cec355e37f373330b393cd5eb", "score": "0.6067579", "text": "function enterProductInfomation(p) {\n $('#productName').text(p.Name);\n $('#productDescription').text(p.Description);\n $('#productImage').attr(\"src\", p.ImageUrl);\n $('#price').append(p.Price);\n $('#price').append(' ש\"ח');\n if (p.Discount != null && p.Discount != \"\") {\n $(\"#myPopup\").popup({ overlayTheme: \"a\" });\n $('#discount').text(p.Discount);\n setTimeout(OpenPopup, 2000);\n }\n GetProductPropertiesInfo(productCounter);\n }", "title": "" }, { "docid": "51f10c6f9c9903f6e6058ffd3dd1af92", "score": "0.6064291", "text": "function pv(){\n $('#productlist .caption a').on('click',productview);\n function productview(){\n //alert(\"gs\");\n var id=$(this).attr('value');\n //alert(id);\n $.ajax({\n url:'productmodalview.php',\n method:'POST',\n data:{itemid:id},\n success:function(data){\n //alert(\"done\");\n //alert(data);\n $('#compareitem').html(data);\n $('#modalhead').text('Item Info');\n $('#modaldialog').removeClass('modal-lg');\n $('#modaldialog').addClass('modal-md');\n $('#myModal').modal('show');\n printpro();\n }\n\t});\n }\n \n }", "title": "" }, { "docid": "92fc1ee11759996ee363fecee8e39f8c", "score": "0.60442597", "text": "function fnOpenSOAddProduct() {\n $.mobile.changePage(\"/HiDoctor_Activity/OTC/SOAddProduct\", {\n type: \"post\",\n reverse: false,\n changeHash: false\n });\n}", "title": "" }, { "docid": "f22b481d6ff3a9001286c1f5757bac6b", "score": "0.6037715", "text": "function viewDetails(product) {\n $(\"#quick-view\").modal('hide');\n\n $timeout(function() {\n var url = pdpProductService.getUrl(product._id);\n $location.path(url);\n }, 250);\n }", "title": "" }, { "docid": "46f9a173ee95f240235c1eb4ed2473bc", "score": "0.60345256", "text": "function cedProcessAddToCart(banaOrderDetails){\r\n\r\n // Get current counter from order detail array\r\n chrome.storage.local.get({\r\n banaCounterForProduct: 0\r\n }, function(data) {\r\n \r\n if(data.banaCounterForProduct == (banaOrderDetails.products.length - 1) ){ // Means this is last product to add into cart\r\n // Call function to open cart page\r\n // Open product page\r\n chrome.storage.local.set({\r\n banaIsLastProduct: 1\r\n }, function() {\r\n \r\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\r\n \r\n chrome.tabs.update(tabs.id, {\r\n url: banaOrderDetails.products[data.banaCounterForProduct].url\r\n }, function(tab){\r\n // nothing to do \r\n });\r\n });\r\n \r\n });\r\n }else{\r\n \r\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\r\n chrome.tabs.update(tabs.id, {\r\n url: banaOrderDetails.products[data.banaCounterForProduct].url\r\n }, function(tab){\r\n // nothing to do \r\n });\r\n });\r\n }\r\n });\r\n}", "title": "" }, { "docid": "70a7b86005b61719ccbab015c112c194", "score": "0.60343903", "text": "function openMiniBasketShopping() {\n\tvar shoppingTab = $('.shopping-tab');\n\n\tif (!$(shoppingTab).hasClass('is-active')) {\n\t\t$(shoppingTab).click();\n\t}\n}", "title": "" }, { "docid": "16a1ff58cf3ed2a773cb39baa2f400cb", "score": "0.60314953", "text": "function shopPage() {\n window.open('shop.html', '_self');\n}", "title": "" }, { "docid": "c20ab1b4c188ed2494fe0fe2d6ad306e", "score": "0.60223985", "text": "popup (window) {\n return this.menu.popup(window)\n }", "title": "" }, { "docid": "79dfa514599c143e52bc213465c4a4ca", "score": "0.6021812", "text": "function bindClickToProductItem () {\n $j('.product-item').click(function(){\n // console.log(this);\n window.location.href = $j($j(this)).find(\"a.product-detail-link\").attr('href');\n\n // $j(this).find(\"a.product-detail-link\").click();\n });\n}", "title": "" }, { "docid": "12769931dba1282d8ecc845bc2f2d8db", "score": "0.5998846", "text": "open () {\n return super.open('checkout');\n }", "title": "" }, { "docid": "c6df68a7457ab90bc9b96d834d0c9c16", "score": "0.5976253", "text": "function ListProduct(e) {\n Ti.API.info(\"click on which block\" + e);\n Ti.API.info(\"click on next block\" + JSON.stringify(e));\n var ListProduct = Alloy.createController('ListProduct', e.source.productcategoryid, JSON.stringify(access_token)).getView();\n ListProduct.open();\n}", "title": "" }, { "docid": "361efe45f61737b44b2640fc5b17f300", "score": "0.5961588", "text": "function showProducts(){\n\tconnection.query('SELECT * FROM products', function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log('=================================================');\n\t\tconsole.log('=================Items in Store==================');\n\t\tconsole.log('=================================================');\n\n\t\tfor(i=0;i<res.length;i++){\n\t\t\tconsole.log(' Item ID: ' + res[i].id + '\\n Product Name: ' + res[i].product_name + '\\n Price: ' + '$' + res[i].price + '\\n Quantity: ' + res[i].stock_quantity + '\\n')\n\t\t}\n console.log('=================================================');\n placeOrder()\n\t\t\n\t\t})\n}", "title": "" }, { "docid": "b229b465ec68c000fc46247eb158913d", "score": "0.59522015", "text": "function GetPurchasedCouponsOpenModal(){\n\t\t\tGetPurchasedCouponsModal.style.display = 'block';\n\t\t}", "title": "" }, { "docid": "dd5f0c779b5bf167f8b04e684aadf4fa", "score": "0.5952189", "text": "openLightbox(item, index) {\n this._lightbox.open(this.productList, index);\n }", "title": "" }, { "docid": "703b76f443d768b15430ebed69c02ded", "score": "0.5950526", "text": "function openCart() {\n\n\t\tblackBack.classList.add('display-block');\n\t\tcartGoods.classList.add('opacity-show');\n\t\tdocument.body.classList.add('overflow');\n\n\t}", "title": "" }, { "docid": "5fa4315855310f6f36ca4f3340dc7d62", "score": "0.5940559", "text": "function openPopup()\n{\n\twindow.open('terms_cond.php','','scrollbars=yes,menubar=no,height=400,width=500,resizable=yes,toolbar=no,status=no;topmargin=0');\n}", "title": "" }, { "docid": "5f2d042eb00737a17c972dc435d23ca5", "score": "0.59338886", "text": "function clickToGetDetail(id) {\n window.location = \"product.html?id=\" + id; // 跳轉到自己的頁面\n let productUrl = API + \"/products/details?id=\" + id;\n\n ajax(productUrl, productrender);\n\n}", "title": "" }, { "docid": "605595eae47a2fac41abd7751e669ae4", "score": "0.59275526", "text": "function handleOpenModal(id) {\n setProduto(id)\n setModal(true)\n }", "title": "" }, { "docid": "7b7ffc2fd3e1f8ddf9ff350dcb4ac42c", "score": "0.59132224", "text": "function accordionproductOpen() {\n \t $('.accordion-product').each(function(){\n \t\t\tif ($(this).find('.help-block').text() != '' || $(this).find('.help-error').text() != '') {\n \t\t\t\tif ($(this).hasClass('in')) {\n \t\t\t\t\treturn false;\n \t\t\t\t} else {\n \t\t\t\t\t$(this).prev().find('a').click();\n \t\t\t\t\treturn false;\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\treturn true;\n \t\t\t}\n \t });\n }", "title": "" }, { "docid": "15bb137f6124102888d4f40b220f9215", "score": "0.59065413", "text": "function PurchaseCouponsOpenModal(){\n\t\t\tPurchaseCouponsModal.style.display = 'block';\n\t\t}", "title": "" }, { "docid": "cd0ccb1a2d9b986094fba56c84a8c790", "score": "0.59051555", "text": "function showProducts(products){\n\n\t$(\"#searchOn\").text(searchOn);\n\tvar productDetails = $.parseJSON(products);\n\tvar content = \"\";\n\tvar attributes = \"\";\n\tvar role = new RegExp(\"admin\");\t\n\tif(role.test(document.location.href)){\n\t\t attributes = 'data-toggle=\"modal\" data-target=\"#editProductFormModal\"';\n\t}\n\tif(productDetails.length){\n\t\t$.each(productDetails, function( key, value ) {\n\t\t\tvar divClass = \"\";\n\t\t\tvar image = \"\";\n\t\t\tvar quantity = \"OUT OF STOCK\";\n\t\t\tif(value.IMAGE.length){\n\t\t\t\t image = \"images/product images/\"+value.IMAGE;\n\t\t\t}\n\t\t\telse{\n\t\t\t\timage = \"https://placehold.it/150x80?text=IMAGE\";\n\t\t\t}\n\t\t\tif(value.STATUS == \"1\"){\n\t\t\t\t divClass = \"panel panel-primary\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdivClass = \"panel panel-danger\";\n\t\t\t}\n\t\t\tif(value.QUANTITY > 0){\n\t\t\t\tquantity = \"AVAILABLE\";\n\t\t\t}\n\t\t\t content += '<div class=\"col-sm-3 productEditPart\" '+attributes+' data-productID = \"'+value.ID+'\" >\\\n\t\t\t\t\t\t\t <div class=\"'+divClass+'\">\\\n\t\t\t\t\t\t\t\t <div class=\"panel-heading\">' +value.NAME+ '</div>\\\n\t\t\t\t\t\t\t\t <div class=\"panel-body\">\\\n\t\t\t\t\t\t\t \t\t<img src=\"'+image+'\" class=\"img-responsive\" style=\"width:100%;height:25%;\" alt=\"Image\">\\\n\t\t\t \t\t\t\t\t\t\t </div>\\\n\t\t\t\t\t\t\t\t <div class=\"panel-footer\">\\\n\t\t\t\t\t\t\t \t\t'+quantity+'<br>\\\n\t\t\t\t\t\t\t\t\t \tprice : Rs.' +value.PRICE+ '<br>\\\n\t\t\t\t\t\t\t\t\t </div>\\\n\t\t\t\t\t\t\t\t</div>\\\n\t\t\t\t\t\t\t</div>'; \n\t\t\t});\n\t}\n\telse{\n\t\tcontent = \"<h3>No Products Found ...</h3>\"\n\t}\n\t$(\"#productDisplay\").html(content);\n}", "title": "" }, { "docid": "28faba53be3d56ced3d5ef4a83a04385", "score": "0.5903398", "text": "showLeadGenerationPopup() {\n mobileLeadGenPopup.open();\n }", "title": "" }, { "docid": "f0948d7d9d325314e057df3f469b5624", "score": "0.5890118", "text": "function upgradeProduct() {\n //remove current Item checked then check dummy checkbox\n _q('input[name=\"product\"]:checked').checked = false;\n dummyInput.checked = true;\n\n if (!!_qById('second_popup_buy_one_more')) {\n renderPriceFor2ndPop(true);\n }\n\n if (window.gapFlag) {\n if (!!_qById('second_popup_buy_one_more')) {\n window.showPopup('second_popup_buy_one_more');\n }\n else {\n window.gap.handleAppleGoogleClick();\n }\n }\n if (window.paypalFlag) {\n if (!!_qById('second_popup_buy_one_more')) {\n window.showPopup('second_popup_buy_one_more');\n }\n else {\n window.paypal.placeMainOrder();\n }\n }\n if (window.ccFlag) {\n activateCreditCardUpgrade(orderNumber, window.urlRedirect);\n }\n\n if (!!diggyPopup) {\n window.closePopup('diggyPopup');\n }\n }", "title": "" }, { "docid": "b5c17564519ffa48fa5041538fd3205b", "score": "0.5881385", "text": "function initPopupOrder() {\r\n $(\"#\" + global.Element.PopupOrder).modal({\r\n keyboard: false,\r\n show: false\r\n });\r\n $(\"#\" + global.Element.PopupOrder + \"button[save]\").click(function () {\r\n saveOrder();\r\n });\r\n $(\"#\" + global.Element.PopupOrder + \"button[cancel]\").click(function () {\r\n $(\"#\" + global.Element.PopupOrder).modal(\"hide\");\r\n });\r\n }", "title": "" }, { "docid": "e876d98617b4ec6ec0d12694933295cf", "score": "0.5861953", "text": "function productModal() {\n $('#productModal').modal();\n}", "title": "" }, { "docid": "b896cefffd33045f00ca9f1df1ca44f9", "score": "0.5836691", "text": "function openNodeProducts(nodeObject) {\n \n //GET '_id' ATTRIBUTE FROM OBJECT\n var id = nodeObject._id;\n \n //SEARCH DB FOR ENTRIES OF NODE TYPE PRODUCT\n var products = searchDB_forProducts(id);\n \n //UPDATES VIEW WITH RESULT\n products.then(function(result) {\n \n //DISPLAY CURRENT NODE TYPE: PRODUCT\n angular.forEach(result.docs, function(obj){\n $scope.viewNode = obj.NodeType;\n });\n \n //UPDATE VIEW\n $scope.$apply(function(){\n console.info('Display Products');\n nav = nodeObject;\n $scope.listStructure = result.docs;\n \n console.log('nav is: ' + nav.NodeType +': ' + nav.nodeName);\n });\n \n //COULD NOT RETRIEVE PRODUCT NODES FROM DB\n }).catch(function(err) {\n console.error(err.status);\n });\n }", "title": "" }, { "docid": "8d73629e691c4ede82ae6271b46d526e", "score": "0.58325297", "text": "function OpenStore(unitid) { \n\n if(!RoomRunning) return;\n \n //Update ore quantities\n $('CrystalAll').textContent = \"Sell All (\" + Workers[unitid].inv.ores.crystal + \")\";\n $('DiamondAll').textContent = \"Sell All (\" + Workers[unitid].inv.ores.diamond + \")\";\n\n UpdatePricing();\n\n //Disable / enable buttons\n if(Workers[unitid].inv.ores.crystal == 0) {$('CrystalAll').disabled = true; $('CrystalOne').disabled = true;}\n else {$('CrystalAll').disabled = false; $('CrystalOne').disabled = false;}\n \n if(Workers[unitid].inv.ores.diamond == 0) {$('DiamondAll').disabled = true; $('DiamondOne').disabled = true;}\n else {$('DiamondAll').disabled = false; $('DiamondOne').disabled = false;}\n\n //Add DOM callbacks\n $('CrystalOne').addEventListener(\"click\", () => { Sell(unitid, 'crystal', 1) });\n $('CrystalAll').addEventListener(\"click\", () => { Sell(unitid, 'crystal', Workers[unitid].inv.ores.crystal) });\n\n \n $('DiamondOne').addEventListener(\"click\", () => { Sell(unitid, 'diamond', 1) });\n $('DiamondAll').addEventListener(\"click\", () => { Sell(unitid, 'diamond', Workers[unitid].inv.ores.diamond) });\n\n $('SupportOne').addEventListener(\"click\", () => { Buy(unitid, 'supports') });\n $('LadderOne').addEventListener(\"click\", () => { Buy(unitid, 'ladder') });\n $('TorchOne').addEventListener(\"click\", () => { Buy(unitid, 'torch') });\n\n //Open The Popup\n OpenPopup('ShopContainer');\n\n}", "title": "" }, { "docid": "83a8d973ee1d8a6586114d55570c7c66", "score": "0.582561", "text": "function openShop() {\n // when the user opens the shop, change the display to block\n modalShop.style.display = \"block\";\n // pause the game\n pauseGame();\t\n}", "title": "" }, { "docid": "afaa8c4bbf10afb1147c897b4ed96a5f", "score": "0.5819525", "text": "function viewProducts() {\n\tconsole.log('VIEW Products');\n\tconnection.query('SELECT * FROM products', function(err, res) {\n\t\tif (err) throw err;\n console.log('\\n\\t## Inventory Items ##');\n\t\t\tvar products = [];\n\t\t\tres.forEach(item => {\n\t\t\t\tproducts.push(item);\n\t\t\t});\n\t\t\tconsole.table(products);\n\t\t\tshowMenu()\n\t});\n}", "title": "" }, { "docid": "fde502776cbfa4b5a051bcb0ef2378c7", "score": "0.5814048", "text": "async function navProducts() {\r\n console.log(\"Navigating to product\");\r\n agent.add('Navigating to the product');\r\n await postUserMessages(agent.query);\r\n await postBotMessages('Navigating to the product');\r\n cat = agent.parameters.Categories;\r\n //TODO get product id\r\n let body = JSON.stringify({ page: \"/\" + products + \"/\" + \"<product_id>\", dialogflowUpdated: true, back: false });\r\n let request = {\r\n method: 'PUT',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'x-access-token': token\r\n },\r\n body: body,\r\n redirect: 'follow'\r\n }\r\n await fetch('https://mysqlcs639.cs.wisc.edu/application', request);\r\n }", "title": "" }, { "docid": "6b6c8f78a2b1ce8cd92fb0bd6c773962", "score": "0.5809405", "text": "function printMyInvoice() {\n let Id = PaymentObject.Opr;\n w = window.open(window.location.origin.concat(\"/Payment/Invoice/\").concat(Id));\n w.print();\n //w.close();\n}", "title": "" }, { "docid": "14f0cb90ac22c9a5efaaa34da053a5e1", "score": "0.58041203", "text": "function openOrderForm() {\n result = {};\n $(\"#orderForm\").show();\n}", "title": "" }, { "docid": "e0a5aa1adf42177c5380e45b6a399a36", "score": "0.58001554", "text": "navigatetoViewOffer(e) {\n window.location = \"/viewProductOffers\";\n }", "title": "" }, { "docid": "60500d843dfcee71e172738060554f35", "score": "0.5800101", "text": "function clickMenu_csEntr011Batch(menuObject){\n\tDialog.open({ \n\t\tdiv : '#dialogContent',\n\t\turl : baseUrl+\"cs/entr/csEntr035?dialogName=dialogContent&eventCd=C11&source=menu&custNo=\" + pubCustNo,\n\t\ttitle : 'Change of Products by batch', \n\t\twidth : 1020, \n\t\theight : 560, \n\t\tmodal : true\n\t}); \n}", "title": "" }, { "docid": "f248e1dcf737b7192128dabd8030de3b", "score": "0.5784392", "text": "function A_LigaCatOfertasUSA(){\n\t//alert(\"ofertas usa\");\n\tvar objPopup = window.open(\"/Secciones/Popups/catalogo-ofertas.htm\", \"catofertas\", \"width=500,height=732,scrollbars=0, resize: none;\");\n\tobjPopup.focus();\n\tobjPopup = null;\n}", "title": "" }, { "docid": "55f997d63476805785d68f92b90664d6", "score": "0.5781131", "text": "function renderProductShow(id) {\n Products.show(id).then(product => {\n // console.log(`${product.id} - ${product.title}`)\n const showPage = document.querySelector('.page#product-show')\n const showPageHTML = `\n <h2>${product.title}</h2>\n <p>${product.description}</p>\n `\n showPage.innerHTML = showPageHTML;\n navigateTo('product-show')\n })\n}", "title": "" }, { "docid": "a7c12a466bc4fba95512d953597448d9", "score": "0.57808983", "text": "function continueShopping() {\n getProducts();\n }", "title": "" }, { "docid": "20ff98cb44177731f94112d2610b9618", "score": "0.5774491", "text": "function openTag(){\n\t\t//console.log(\"window.jsessionid=\"+window.jsessionid);\n\t\t//var url = 'extremedevTestPopup.html';\n\t\t//var url = '../../media/jsp/dialog/tagPopup.html;jsessionid='+window.jsessionid;\n\t\t\n\t\t//var url = '/modules/device/preload/grouppreload.jsp;jsessionid='+window.jsessionid+\"?\"+ \"groupids=8&type=group\";\n\t\t//var url = '/modules/device/preload/grouppreload.jsp;jsessionid='+window.jsessionid+\"?\"+ \"groupids=8&type=player\";\n\t\tvar url = '/modules/media/jsp/grouptree.jsp;jsessionid='+window.jsessionid+\"?\"+ \"groupids=8&type=player\";\n\t\t//var url = '/modules/role/jsp/roleWrapper.jsp;jsessionid='+window.jsessionid;\n\t\t\n\t\tjQuery.showModalDialog({\n\t\t\t url: url,\n\t\t\t dialogArguments: 'dialogArguments',\n\t\t\t height: 500,\n\t\t\t width: 900,\n\t\t\t scrollable: false,\n\t\t\t onClose: function(){ var returnedValue = this.returnValue; }\n\t\t\t //onClose: function(){ var returnedValue = this.returnValue; alert('This is the returned value from the popup:' + returnedValue); }\n\t\t});\n\t}", "title": "" }, { "docid": "d6b35090812625a40ca484b96a53632a", "score": "0.5751549", "text": "function OpenPopup(str_id) { bind.OpenPopup(str_id); }", "title": "" }, { "docid": "6a45ff03b780626fb49df7bde45857f9", "score": "0.5746001", "text": "function detalles(product, abono) {\n $('#idproducto').val(product.ID)\n $('#img').attr('src',product.imagen)\n $('#title').html(product.post_title)\n $('#title2').val(product.post_title)\n $('#content').html(product.post_content)\n $('#price').html('$ '+product.meta_value)\n $('#price2').val(product.meta_value)\n $('#abono').val(abono)\n $('#pagarcompra').click()\n // $('#myModal1').modal('show')\n}", "title": "" }, { "docid": "3ac81bd5ee7fda516a1ce131baf7c6bf", "score": "0.5745837", "text": "function showDetails(product) {\n document.getElementById('modal-name').innerHTML = product.title;\n\n document.getElementById('modal-details').innerHTML = `\n <img src=\"${product.image}\" class=\"img-fluid\">\n <div class=\"my-3 lh-lg p-1\">\n <p class=\"lh-sm mb-3 text-secondary\" style=\"text-align:justify\">${product.description}</p>\n <h5 class=\"text-capitalize\"><b>Category:</b> ${product.category}</h5>\n <h5><b>Rating:</b> ${product.rating.rate} out of 5.0</h5>\n <h5><b>Rated by:</b> ${product.rating.count} users</h5>\n <h2 class=\"display-6 my-3\">\n <span class=\"fw-bold\">Price:</span> $${product.price}\n </h2>\n <a role=\"button\" class=\"text-decoration-none text-dark text-center d-block fw-bold bg-warning py-1 mt-3 rounded-3\" onclick=\"addToCart(${product.id},${product.price})\">Add to Cart</a>\n </div>`;\n}", "title": "" }, { "docid": "1584455d38ccb4549aba2b2537ee4e62", "score": "0.57414085", "text": "function incomplete_order_details(incomplete_orders)\n{\n\tincomplete_orders.each(function(){\n\n\t\tvar order_record_id = $(this).data('order_record_id');\n\n\t\t$(this).children().first().on('click', function(){\n\t\t\torder_products_popup(order_record_id);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "05d91a4fdc9af94f8dc4f6bee65f313c", "score": "0.5740732", "text": "function displayInStock(products) {\n let page = document.getElementById(\"in-stock-main\");\n let content = \"\";\n for (let i = 0; i < products.length; i++) {\n content += `\n <div class = \"in-stock-item\" >\n <a href=product.html onclick=\"saveCurrentItem(this)\">\n <p class = \"in-stock-img\">\n <img src = \"${products[i].img}\">\n </p>\n <div class = \"in-stock-text\">\n <p><strong>${products[i].brand}</strong></p>\n <p class = 'in-stock-item-name'>${products[i].name}</p>\n <p>${products[i].price}</p>\n </div>\n </a>\n </div>\n `\n }\n page.innerHTML = content;\n}", "title": "" }, { "docid": "1a6d218be307736320445bd2c590a392", "score": "0.5738858", "text": "function openProductInfo(nodeObject) {\n \n //GET PRODUCT ID ATTRIBUTE FROM PRODUCT NODE\n var productId = nodeObject.productId;\n \n //SEARCH DB FOR ENTRIES WITH PRODUCT ID\n var productInfo = searchDB_byId(productId);\n \n //UPDATE VIEW WITH RESULT\n productInfo.then(function(result) {\n \n //DISPLAY CURRENT NODE: PRODUCT INFORMATION\n $scope.viewNode = 'PRODUCT INFO';\n \n //UPDATE VIEW\n $scope.$apply(function(){\n console.info('Display Product Info');\n nav = nodeObject;\n $scope.listStructure = result.docs;\n \n console.log('nav is: ' + nav.NodeType +': ' + nav.nodeName);\n console.info($scope.listStructure);\n });\n \n //COULD NOT RETRIEVE PRODUCT INFORMATION FROM DB\n }).catch(function(err) {\n console.error(err.status);\n });\n }", "title": "" }, { "docid": "e7d796446f2fd0a25ee3960eb07cbf62", "score": "0.57306254", "text": "function showCart(store) {\n console.log(\"Show Cart to User\");\n\n var modalContent = document.getElementById(\"modal-content\");\n renderCart(modalContent, store);\n\n document.getElementById(\"modal\").style.visibility = \"visible\";\n\n // Reset Inactivity\n resetInactivity();\n}", "title": "" }, { "docid": "1d23183c74d4f0e592be19f26af2ac53", "score": "0.572241", "text": "function openCart(){\n\t\tlet items = getCartData(), \n\t\t\t\titem_html = '',\n\t\t\t\tcount_id = 0,\n\t\t\t\tproduct_name,\n\t\t\t\tproduct_count,\n\t\t\t\tproduct_price,\n\t\t\t\tproduct_avalaible,\n\t\t\t\tresult;\t\t\t\n\t\t\t\t\n\t\t// data for output\n\t\tif(items !== null){\n\t\t\t\tfor(let item in items){\n\t\t\t\t\tcount_id++;\n\t\t\t\t\tproduct_name = items[item][0];\n\t\t\t\t\tproduct_price = +items[item][1];\n\t\t\t\t\tproduct_count = items[item][2];\n\t\t\t\t\tproduct_avalaible = items[item][3];\n\t\t\t\t\tresult = product_price*product_count;\n\t\t\t\t\tif(result<0){\n\t\t\t\t\t\tresult = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(product_count == null){\n\t\t\t\t\t\tproduct_count = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(product_avalaible !=0 && product_count !=0){\n\t\t\t\t\t\titem_html += `\n\t\t\t\t\t\t\t<li class=\"card-text card-item\" data-target=\"${product_avalaible}\">\n\t\t\t\t\t\t\t\t<div class=\"card-wrap\">\n\t\t\t\t\t\t\t\t\t<span class=\"card-text card-name\">${product_name}</span>\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t<span>$</span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"card-text card-price\">${result.toFixed(2)}</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<button type=\"button\" class=\"btn-count js_counter\" data-action=\"plus\" id=\"add-${count_id}\"> + </button>\n\t\t\t\t\t\t\t\t<button type=\"button\" class=\"btn-count js_counter\" data-action=\"minus\" id=\"min-${count_id}\"> - </button>\n\t\t\t\t\t\t\t\t<span class=\"card-text card-count\" id=\"count-${count_id}\"> ${product_count}</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<hr/>`;\n\t\t\t\t}\n\t\t\t\t\n\t\t\tCART.innerHTML = item_html;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t}else {\n\t\t\tCART.innerHTML = 'Cart is empty!';\n\t\t}\n\t\tcount(cartData);\n\t\tgetTotal(cartData);\n\t\t\n\t\treturn false;\n\t}", "title": "" }, { "docid": "23ed263c0fe0dc67fec6aff4e8b4622e", "score": "0.57221884", "text": "function viewProducts() {\n\n\t// SQL Query grabbing all products from the products table\n var query = \"SELECT * FROM products\";\n \n\t// Querying the Database\n\tconnection.query(query, function(err, res) {\n\n\t\tif (err) throw err;\n\n // Setting up the results in the console.table NPM\n\t\tconsoleTable(\"\\nAll Products For Sale\", res);\n\n // Bringing the Manager back to the start Inputs\n\t\tstart();\n\t});\n}", "title": "" }, { "docid": "c175724a901e132b5e0053c7d9219cbf", "score": "0.57199687", "text": "productsDisplayEvent_productsShow(products) {\n console.log(`AmazonProductsController: ${products}`);\n $('#amazonProductFinderDisplayContainer').hide();\n $('#amazonProductsDisplayContainer').show();\n this.apd.productsDisplayEvent_showProducts(products);\n }", "title": "" }, { "docid": "3bae27b0f73c2aacbd06589df5fd10f1", "score": "0.5718305", "text": "[openCategory](e) {\n let id = e.currentTarget.id;\n $(\"#categorylist li\").removeClass(\"active\");\n $(e.currentTarget).addClass(\"active\");\n let category = this[getCategoryById](id);\n let $products = $(\"#categoryitems .shoppinglist_item:not(.new)\");\n $products.remove();\n category.printShoppingItems($(\"#categoryitems .items_container\"));\n }", "title": "" }, { "docid": "3ef844893c20231c044ed854a145e2ca", "score": "0.571665", "text": "function addToCartDet() {\n var dispNode = document.getElementById(\"detailrighttop\");\n var atcName = localStorage.getItem(\"productName\");\n\n addToCart(dispNode,atcName);\n window.location = \"productbrowse.html\";\n}", "title": "" }, { "docid": "ccca5cc48b273ca6ec952918d346c78c", "score": "0.5716378", "text": "function product() {\n\n\t\t$.ajax({\n\t\t\turl\t:\t\"action.php\",\n\t\t\tmethod:\t\"POST\",\n\t\t\tdata\t:\t{getProduct:1},\n\t\t\tsuccess\t:\tfunction(data){\n\t\t\t\t$(\"#get_product\").html(data);\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "c1c4b26048a14d88c862d934248f908a", "score": "0.57160544", "text": "function advancedSearch() {\n //Way to get the dynamically generated path from symfony\n path = $(\".popupjs\").attr(\"data-path\");\n\n // Open a popup window to the search page\n window.open(path, \"_blank\", \"width=1000, height=600\");\n}", "title": "" }, { "docid": "f31e5158f9b0ac00af15b4211b353422", "score": "0.5710562", "text": "async backToProducts() {\n const backToProductsButton = await this.components.backToProductsButton()\n await backToProductsButton.click()\n }", "title": "" }, { "docid": "b84e631709709ca7ca198ff256067746", "score": "0.56996363", "text": "function open_picture_list_order_dialog(json_url, pg_id, pg_context) {\n function pgSuccessHandler(callback) {\n $.modal.close();\n callback();\n }\n function pgErrorHandler() {\n alert(\"Unable to reorder list, try again!\");\n }\n var inputProvider = undefined;\n var modalOpenedCallback = function(container) {\n container\n .data('pg-context', pg_context)\n .data('pg-list-selector', '#' + container.attr('id') + ' ul')\n .data('pg-item-selector', '#' + container.attr('id') + ' li')\n .data('pg-name', 'children');\n inputProvider = pg_get_input_provider(\n 'order-list', container, undefined\n );\n };\n var updateCallback = function(container) {\n pg_update(container, inputProvider, pgSuccessHandler, pgErrorHandler);\n };\n var cancelCallback = function(container) {\n $.modal.close();\n };\n open_picture_list_dialog(\n json_url, pg_id, pg_context,\n modalOpenedCallback,\n updateCallback, cancelCallback\n )\n}", "title": "" }, { "docid": "86f5d5e34a38711fe875f9c22ff8d446", "score": "0.56991106", "text": "function show_add_product()\n{\n\t//Unselect all products \n\t$(\".product_picker_check\").prop('checked', false);\n\t//Update the products in the product picker \n\t$.each(order_list, function (product_id, product_details)\n\t{\n\t\t$(\"#product_picker_check_\"+product_id).prop('checked', true);\n\t});\n\t$('.overlay').fadeIn(100); \n\t$('#product_picker').fadeIn(100); \t\n}", "title": "" }, { "docid": "d69fd130c957a1da3cc32f52e4157687", "score": "0.56982565", "text": "function handleCartOpen() {\n\treturn {\n\t\ttype: OPEN_CART,\n\t}\n}", "title": "" }, { "docid": "7262c8ae4df56ea9d6ad5b4d9662b967", "score": "0.5698087", "text": "clickBuySilverButtons() {\n cy.getCy(this.silverHeritageProduct).click({ scrollBehaviour: true });\n this.assertProductPage('/product/heritage-silver', 'silver', true);\n }", "title": "" }, { "docid": "2bef6e59df527b95d75bdd133180b4a0", "score": "0.569764", "text": "function displayProductDetails(id) {\n localStorage.setItem(\"idPr\", id);\n location.replace(\"display-product.html\");\n}", "title": "" }, { "docid": "bb025469adfd4766f59820f67e11f2e7", "score": "0.5694894", "text": "function thisopenEntityMiniPopupWin(pk) {\r\n if (pk == 0) {\r\n alert(getMessage(\"cs.entity.information.error.notRecorded\"));\r\n return;\r\n }\r\n\r\n var path = getCISPath() + \"/ciEntityMiniPopup.do?pk=\" + pk;\r\n\r\n if (isDivPopupEnabled()) {\r\n //openDivPopup(popupTitle, urlToOpen, isModel, isDragable, popupTop, popupLeft, popupWidth, popupHeight, contentWidth, contentHeight)\r\n openDivPopup(\"\", path, true, true, \"\", \"\", \"900\", \"890\", \"890\", \"880\", \"\", true);\r\n }\r\n else {\r\n var mainwin = window.open(path, 'EntityMiniPopup',\r\n 'width=900,height=700,innerHeight=700,innerWidth=875,scrollbars');\r\n mainwin.focus();\r\n }\r\n return;\r\n}", "title": "" }, { "docid": "932f76e442fc0e63c261d652862ab0c4", "score": "0.56919074", "text": "function purchaseItems() {\n\t// check for atleast one sessionStorage object\n\tif (sessionStorage.itemName) {\n\t\tlet openModal = document.getElementsByClassName('modal')[0]\n\t\topenModal.style.display = 'block'\n\t\tgrandTotal()\n\t} else {\n\t\talert('Please Add An Item To Your Cart.')\n\t\twindow.location.href = '../html/store.html'\n\t}\n}", "title": "" }, { "docid": "e82d2a1745a06eed9d1df6e7bf38828f", "score": "0.5689418", "text": "function addItemDetailView() {\n var detailViewQty;\n if (document.getElementById(\"product-vqty\")) {\n detailViewQty = document.getElementById(\"product-vqty\").value;\n } else {\n detailViewQty = \"1\";\n }\n\n addItemGeneric(session_no, stock_no, detailViewQty);\n\n if (window.location.hash !== \"#products\") {\n window.location.hash = \"cart\";\n }\n}", "title": "" }, { "docid": "e431f09f93a260d0f6058a71b95715c7", "score": "0.5686598", "text": "function openinfoget()\n{\n\tload_popup(\"infoget\");\n}", "title": "" }, { "docid": "bb74949ecf03f163a42c1ecffe01f33c", "score": "0.5685961", "text": "function products_info(workorder_number){\n console.log(\"clicked\")\n // validate the workorder via SQL\n\nif(true){\n var url='/wo-details?'+'wo_id='+workorder_number\n console.log(\"URL IS: \",url)\n \n window.location.href=url\n}else{\n alert('only \"879845\" and \"815348\" are implemented for demo')\n}\n\n\n\n}", "title": "" }, { "docid": "8b96b1831dc40cf1195ae7da8cd7f7f8", "score": "0.56734943", "text": "function showProducts() {\n connection.query('SELECT * FROM products', function(error, response) {\n if (error) console.log(error);\n\n console.log(response);\n purchasePrompt();\n });\n}", "title": "" }, { "docid": "71eabbd529430ce28de5396c56dbb84f", "score": "0.5670941", "text": "function openCreateStore() {\n\tdocument.querySelector(\".modal-store-background\").classList.add(\"show-modal\");\n}", "title": "" }, { "docid": "037f834724bf1a423ae2ce53ea5e96ef", "score": "0.56690717", "text": "function showProducts() {\n connection.query('SELECT * FROM products', function(error, response) {\n if (error) console.log(error);\n console.log(response);\n managerPrompt();\n });\n}", "title": "" }, { "docid": "ecb73674b9047d3cd5e8813a3e903a9b", "score": "0.566816", "text": "function showModalWindow() {\n var container = document.getElementById('modal-form-container');\n\n function closeWindow() {\n clearProductForm();\n container.style.display = 'none';\n document.onkeydown = null;\n }\n\n $('#buttonCancel').click(function () {\n closeWindow();\n return false;\n });\n\n $('#buttonBuy').click(function () {\n addOrderItem();\n closeWindow();\n return false;\n });\n\n container.style.display = 'block';\n}", "title": "" }, { "docid": "98f173dbd0b5b14e28165f670c66f061", "score": "0.5667714", "text": "clickBuyGoldButtonsFirst() {\n cy.getCy(this.goldHeritageProduct).first().click({ scrollBehaviour: true });\n this.assertProductPage('/product/heritage-gold', 'gold', true);\n }", "title": "" }, { "docid": "ee8c04ff2a88cce844d586457f1cdf3f", "score": "0.56670475", "text": "function viewProducts(){\n\tconnection.query('SELECT * FROM products', function(err,res){\n\t\tif (err) throw err;\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log('ID: ' + res[i].id + '| sku: ' + res[i].sku +' | name: ' + res[i].product_name + \" | Price: $\" + res[i].price + \" | Quantity: \" + res[i].stock_quantity);\n\t\t};\n\t\tconsole.log('\\n');\n\t\tmanagerView();\n\t});\n}", "title": "" }, { "docid": "c10c9a45229660e0f496b784dad64a0b", "score": "0.56668067", "text": "function showProductChoices() {\n\t$.iModal({\n\t\ttype: 'inline',\n\t\tinline: '#ChooseAnotherProduct',\n\t\twidth: 620,\n\t\theight: 200,\n\t\ttitle: getLang('ChooseAnotherProduct')\n\t});\n\n\tupdateSharingDataChoices(shareProductId);\n\n\tvar productCount = objectLength(sharingData);\n\tvar sharingDataWrapper = $(\"#SharingDataWrapper\");\n\tvar sharingDataChoices = $(\"#SharingDataChoices\");\n\tif (productCount < 6) {\n\t\tsharingDataWrapper.addClass('no-scroll');\n\t} else {\n\t\tsharingDataChoices.jCarouselLite({\n\t\t\tbtnNext: \".next\",\n\t\t\tbtnPrev: \".prev\",\n\t\t\tvisible: 4,\n\t\t\tscroll: 2,\n\t\t\tcircular: false,\n\t\t\tspeed: 200\n\t\t});\n\t}\n\n}", "title": "" }, { "docid": "aa387af32481322bb0eab1213a42fdb7", "score": "0.56651336", "text": "function btn_print_infor_onclick(p_hidden_obj, p_url){\r\n\t//Duong dan xu ly In\r\n\tp_url = p_url + '/hdn_object_id/' + p_hidden_obj.value;\r\n\tsRtn = showModalDialog(p_url,\"\",\"dialogWidth=1px;dialogHeight=1px;status=no;scroll=no;dialogCenter=yes\");\t\t\t\r\n if (sRtn!=\"\"){\r\n\t\twindow.open(sRtn);\r\n }\r\n\t\r\n}", "title": "" }, { "docid": "c7fa0e5a6d6612ed6fc09d8bb7f81e5f", "score": "0.5661221", "text": "function displayProduct(product) {\n console.log(\"P\", product);\n let ele = document.getElementById(\"product-page-container\");\n ele.innerHTML = `\n <div id = \"product-page-image\">\n <img src = \"${product.img}\">\n </div>\n <div id = \"product-page-description\">\n <div id = \"product-page-details\">\n <h1 class = \"product-description\">${product.brand}</h1>\n <h2 class = \"product-description\">${product.name}</h2>\n <h2 class = \"product-description\">${product.price}</h2>\n </div>\n <h3>Color: ${product.color}</h3>\n <h3>Drop: ${product.drop}</h3>\n <div class = \"size-dropdown\">\n <div class = \"size-selector\">\n <button onclick = \"openSizeSelector(this)\">Select Size</button>\n </div>\n </div>\n \n <button id = \"add-to-cart-button\" onclick = \"addItem(this, 'cartItems')\">Add To Bag</button>\n <button id = \"save-item-button\" onclick = \"addItem(this, 'savedItems')\">Save Item</button>\n \n </div>\n `\n}", "title": "" } ]
45e87f83aabefee05c369dc7a5df8b85
Function to return the current cartridge object
[ { "docid": "c31d0820086372cb73dd84f1dc98928f", "score": "0.7252349", "text": "getCartridgeObject() {\n const header = getCartridgeHeader(this);\n return idbKeyval.get(header);\n }", "title": "" } ]
[ { "docid": "827bb01af096f05bcb4d4345892c7f95", "score": "0.58820856", "text": "getCartridgeInfo() {\n if (!this.loadedCartridgeMemoryState.ROM) {\n return Promise.reject('No ROM has been loaded');\n }\n\n let getCartridgeInfoTask = async () => {\n const cartridgeInfo = {};\n\n cartridgeInfo.header = getCartridgeHeader(this);\n cartridgeInfo.ROM = getCartridgeRom(this);\n cartridgeInfo.RAM = getCartridgeRam(this);\n\n // Now parse our header for additional information\n cartridgeInfo.nintendoLogo = cartridgeInfo.ROM.slice(0x104, 0x134);\n\n cartridgeInfo.title = cartridgeInfo.ROM.slice(0x134, 0x144);\n cartridgeInfo.titleAsString = String.fromCharCode.apply(null, cartridgeInfo.title);\n\n cartridgeInfo.manufacturerCode = cartridgeInfo.ROM.slice(0x13f, 0x143);\n\n cartridgeInfo.CGBFlag = cartridgeInfo.ROM[0x143];\n\n cartridgeInfo.newLicenseeCode = cartridgeInfo.ROM.slice(0x144, 0x146);\n\n cartridgeInfo.SGBFlag = cartridgeInfo.ROM[0x146];\n\n cartridgeInfo.cartridgeType = cartridgeInfo.ROM[0x147];\n\n cartridgeInfo.ROMSize = cartridgeInfo.ROM[0x148];\n\n cartridgeInfo.RAMSize = cartridgeInfo.ROM[0x149];\n\n cartridgeInfo.destinationCode = cartridgeInfo.ROM[0x14a];\n\n cartridgeInfo.oldLicenseeCode = cartridgeInfo.ROM[0x14b];\n\n cartridgeInfo.maskROMVersionNumber = cartridgeInfo.ROM[0x14c];\n\n cartridgeInfo.headerChecksum = cartridgeInfo.ROM[0x14d];\n\n cartridgeInfo.globalChecksum = cartridgeInfo.ROM.slice(0x14e, 0x150);\n\n return cartridgeInfo;\n };\n\n return getCartridgeInfoTask();\n }", "title": "" }, { "docid": "3bb0e8d5a97987ea953465dc3060f080", "score": "0.5480972", "text": "loadCartridgeRam() {\n const loadCartridgeRamTask = async () => {\n // Get the entire header in byte memory\n // Each version of a rom can have similar title and checksums\n // Therefore comparing all of it should help with this :)\n // https://drive.google.com/file/d/0B7y-o-Uytiv9OThXWXFCM1FPbGs/view\n const header = getCartridgeHeader(this);\n\n if (!header) {\n throw new Error('Error parsing the cartridge header');\n }\n\n const cartridgeObject = await idbKeyval.get(header);\n\n if (!cartridgeObject || !cartridgeObject.cartridgeRam) {\n return;\n }\n\n // Set the cartridgeRam\n for (let i = 0; i < cartridgeObject.cartridgeRam.length; i++) {\n this.wasmByteMemory[this.WASMBOY_GAME_RAM_BANKS_LOCATION + i] = cartridgeObject.cartridgeRam[i];\n }\n this.loadedCartridgeMemoryState.RAM = true;\n };\n\n return loadCartridgeRamTask();\n }", "title": "" }, { "docid": "56d63bbade4b312516612efbddaaf2b3", "score": "0.5390597", "text": "function getCart(){\n return cart;\n }", "title": "" }, { "docid": "e7ad46cb8c10f8eabaccdefd56e6e925", "score": "0.5369286", "text": "function getMainCarrier() {\n var carrier = misc_1.getGlobalObject();\n carrier.__SENTRY__ = carrier.__SENTRY__ || {\n hub: undefined,\n };\n return carrier;\n}", "title": "" }, { "docid": "b352e8bc4acd16150583de596e57f694", "score": "0.5355764", "text": "function getCart() {\n return cart;\n}", "title": "" }, { "docid": "48bd6104e9133b576878aa0536c8ae87", "score": "0.52978665", "text": "bootstrap(iniObj) {\n /* VLab Inventory */\n this.Inventory = new VLabInventory({\n vLab: this\n });\n\n /* BasicsOfLungSounds Scene */\n this.SceneDispatcher.addScene({\n class: BasicsOfLungSoundsScene,\n natureURL: './scenes/base.scene/resources/vlab.scene.nature.json',\n /**\n * Set active: true for default VLabScene\n */\n active: true\n });\n\n console.log(this);\n }", "title": "" }, { "docid": "5897b4f796c1c3dd4360122d76de0386", "score": "0.52907467", "text": "function getCurrentCode() {\n\t\treturn cartObject.currentCode;\n\t}", "title": "" }, { "docid": "3ec6647405c9d60085cad8276e67ca8a", "score": "0.5270138", "text": "function getMainCarrier() {\n var carrier = Object(misc[\"f\" /* getGlobalObject */])();\n carrier.__SENTRY__ = carrier.__SENTRY__ || {\n extensions: {},\n hub: undefined,\n };\n return carrier;\n}", "title": "" }, { "docid": "a97c0b48766caa7b1a6e21bf2537769b", "score": "0.5185658", "text": "function getMainCarrier() {\n\t var carrier = getGlobalObject();\n\t carrier.__SENTRY__ = carrier.__SENTRY__ || {\n\t hub: undefined,\n\t };\n\t return carrier;\n\t}", "title": "" }, { "docid": "f0f71c3a9acd634fbdb6cdc54b1fd16d", "score": "0.51849157", "text": "function retrieveObject() {\n return new Object();\n }", "title": "" }, { "docid": "748b030e366c81f546cd2c2f56a2ed22", "score": "0.5182646", "text": "function getMainCarrier() {\n var carrier = (0, _utils.getGlobalObject)();\n carrier.__SENTRY__ = carrier.__SENTRY__ || {\n extensions: {},\n hub: undefined\n };\n return carrier;\n}", "title": "" }, { "docid": "25ba6f70a5bdbc023ff1596399feaa55", "score": "0.5061689", "text": "function SCACatalogRef(){\n var myCatalogRef = new Object();\n var JROM = getShippingChargeAdjustmentJROM();\n if (JROM != null) {\n if(JROM.catalogReferenceNumber != null && JROM.catalogReferenceNumber != \"\"){\n myCatalogRef.catalogReferenceNumber = JROM.catalogReferenceNumber;\n }\n myCatalogRef.name = JROM.catalogIdentifier;\n myCatalogRef.Owner = JROM.catalogOwner;\n return myCatalogRef;\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "51026d3ad25ed179b474ee861404a00c", "score": "0.506069", "text": "retrieveThis() {\n\t\tlet localObj = myStorage.localGetObj(this.ID);\n\t\treturn localObj;\n\t}", "title": "" }, { "docid": "51026d3ad25ed179b474ee861404a00c", "score": "0.506069", "text": "retrieveThis() {\n\t\tlet localObj = myStorage.localGetObj(this.ID);\n\t\treturn localObj;\n\t}", "title": "" }, { "docid": "51026d3ad25ed179b474ee861404a00c", "score": "0.506069", "text": "retrieveThis() {\n\t\tlet localObj = myStorage.localGetObj(this.ID);\n\t\treturn localObj;\n\t}", "title": "" }, { "docid": "51026d3ad25ed179b474ee861404a00c", "score": "0.506069", "text": "retrieveThis() {\n\t\tlet localObj = myStorage.localGetObj(this.ID);\n\t\treturn localObj;\n\t}", "title": "" }, { "docid": "51026d3ad25ed179b474ee861404a00c", "score": "0.506069", "text": "retrieveThis() {\n\t\tlet localObj = myStorage.localGetObj(this.ID);\n\t\treturn localObj;\n\t}", "title": "" }, { "docid": "51026d3ad25ed179b474ee861404a00c", "score": "0.506069", "text": "retrieveThis() {\n\t\tlet localObj = myStorage.localGetObj(this.ID);\n\t\treturn localObj;\n\t}", "title": "" }, { "docid": "e88b8418060ff7eb1750bf7c1ba91558", "score": "0.50433296", "text": "function getVM () {\n return bioVM || (bioVM = new BioVM());\n}", "title": "" }, { "docid": "0d20797a8c8c296282222d62c243eecf", "score": "0.5023444", "text": "addShoppingCart() {\n const shoppingCart = new ShoppingCart(this.username, null).addCarts();\n console.log(shoppingCart)\n return shoppingCart;\n }", "title": "" }, { "docid": "e7e77e0ebaaf40a7aa70264fd6358a31", "score": "0.5022037", "text": "async getContract() {\n\tconsole.log(\"getting contract\")\n\tconst contract = require('truffle-contract')\n\tthis.lendingContract = contract(Lending)\n\tthis.lendingContract.setProvider(this.state.web3.currentProvider)\n\tthis.lendingContractInst = await this.lendingContract.deployed()\n\tconsole.log(this.lendingContractInst)\n }", "title": "" }, { "docid": "e98523a9981c7d87c70a685abc8d14eb", "score": "0.5013029", "text": "getObject() {\n return {\n id : this.id,\n name: this.name,\n description: this.description,\n obligations: this.obligations,\n target: this.target,\n algorithm: this.algorithm,\n depth_level: this.depth_level,\n children: this.children,\n isActive: this.isActive,\n isIndeterminate: this.isIndeterminate,\n isTargetMet: this.isTargetMet,\n finalDecision: this.finalDecision\n }\n }", "title": "" }, { "docid": "08b43cd28119c29acbcb5f3b33cd5fa4", "score": "0.5004465", "text": "function Get(){\n if(!spinJack){\n initSpinJack();\n }\n return spinJack;\n }", "title": "" }, { "docid": "06d6e7b4e59922328f2f0391801b6295", "score": "0.49333405", "text": "get currentClue() {\n return this.#current.clue;\n }", "title": "" }, { "docid": "ec4bf848463f535f79376736f28a795f", "score": "0.49329984", "text": "function getMainCarrier() {\n worldwide/* GLOBAL_OBJ.__SENTRY__ */.n2.__SENTRY__ = worldwide/* GLOBAL_OBJ.__SENTRY__ */.n2.__SENTRY__ || {\n extensions: {},\n hub: undefined,\n };\n return worldwide/* GLOBAL_OBJ */.n2;\n}", "title": "" }, { "docid": "5c95632c4984527bad5656ee548f259c", "score": "0.49177328", "text": "parent() { return this.vglObject3d.inst(); }", "title": "" }, { "docid": "5c95632c4984527bad5656ee548f259c", "score": "0.49177328", "text": "parent() { return this.vglObject3d.inst(); }", "title": "" }, { "docid": "c9fd97ab80d7389ad2b58e6e36f7ce60", "score": "0.49030155", "text": "runCatalog() {\n (new Catalog()).run(this);\n }", "title": "" }, { "docid": "4873346f01cdfd77e6f0658049494aa4", "score": "0.48664933", "text": "get current() {\n return getCurrent(this);\n }", "title": "" }, { "docid": "17366b2cef8188c78ecaf475fe7d75d8", "score": "0.4857778", "text": "getThis() {\n return this.get(this.path);\n }", "title": "" }, { "docid": "921f310bbedbcecf77b14d0f8c3b9167", "score": "0.4854781", "text": "chain() {\n return this.commandManager.createChain();\n }", "title": "" }, { "docid": "921f310bbedbcecf77b14d0f8c3b9167", "score": "0.4854781", "text": "chain() {\n return this.commandManager.createChain();\n }", "title": "" }, { "docid": "b7b5e40829c2869a8af09a51213fd2b5", "score": "0.4852733", "text": "current() {\n if (!this._init) {\n this._fetch();\n }\n this._started = true;\n return this._current;\n }", "title": "" }, { "docid": "f56b5707b57ef0b3aff2cbf6889878d2", "score": "0.48508194", "text": "static current () {\n return _cube\n }", "title": "" }, { "docid": "2645b99ebaa51f891c261372099ee7bc", "score": "0.4848906", "text": "get gameObject() {}", "title": "" }, { "docid": "ad1b4a8db6f22e705e544ca771448df4", "score": "0.48487496", "text": "constructor(rom) {\n // Save raw ROM bytes.\n this.rom = rom;\n \n // Read header checksum.\n this.headerChecksum = this.rom[0x014D];\n\n // Read global checksum.\n this.globalChecksum = (this.rom[0x014E]<<8) + this.rom[0x014F]; \n\n // Read ROM title.\n this.title = \"\";\n for (let i = 0x134; i <= 0x142; i++){\n if (this.rom[i] === 0x00) continue; \n this.title += String.fromCharCode(this.rom[i]);\n } \n\n // Read Color GB flag.\n this.colorGameboyFlag = this.rom[0x0143] !== 0x00; // TODO: Should this worry about GBC only flag?\n\n // Read Super GB flag.\n this.superGameboyFlag = this.rom[0x0146] === 0x03;\n\n // Read cartridge type, determine memory bank controller and other cartridge properties.\n this.cartridgeType = this.rom[0x0147];\n this.mbc = null;\n this.hasRam = false;\n this.hasBattery = false; \n switch (this.cartridgeType) {\n case 0x00: break;\n case 0x01: this.mbc = new MBC1(this); break;\n case 0x02: this.mbc = new MBC1(this); this.hasRam = true; break;\n case 0x03: this.mbc = new MBC1(this); this.hasRam = true; this.hasBattery = true; break;\n case 0x05: this.mbc = new MBC2(this); break;\n case 0x06: this.mbc = new MBC2(this); this.hasBattery = true; break;\n case 0x08: this.hasRam = true; break;\n case 0x08: this.hasRam = true; this.hasBattery = true; break;\n case 0x0F: this.mbc = new MBC3(this); this.hasBattery = true; break;\n case 0x10: this.mbc = new MBC3(this); this.hasBattery = true; break;\n case 0x11: this.mbc = new MBC3(this); break;\n case 0x12: this.mbc = new MBC3(this); this.hasRam = true; break;\n case 0x13: this.mbc = new MBC3(this); this.hasRam = true; this.rtcExists = true; this.hasBattery = true; break;\n case 0x19: this.mbc = new MBC5(this); break;\n case 0x1A: this.mbc = new MBC5(this); this.hasRam = true; break;\n case 0x1B: this.mbc = new MBC5(this); this.hasRam = true; this.hasBattery = true; break;\n case 0x1C: this.mbc = new MBC5(this); this.hasRumble = true; break;\n case 0x1D: this.mbc = new MBC5(this); this.hasRumble = true; this.hasRam = true; break;\n case 0x1E: this.mbc = new MBC5(this); this.hasRumble = true; this.hasRam = true; this.hasBattery = true; break;\n default:\n throw `Cartridge: Unsupported cartridge type: ${this.cartridgeType.toHex(2)}`;\n }\n\n // Read ROM size.\n this.romSize = this.rom[0x0148];\n\n // Determine total ROM banks.\n switch (this.romSize) {\n case 0x00: this.totalRomBanks = 1; break;\n case 0x01: this.totalRomBanks = 4; break;\n case 0x02: this.totalRomBanks = 8; break;\n case 0x03: this.totalRomBanks = 16; break;\n case 0x04: this.totalRomBanks = 32; break;\n case 0x05: this.totalRomBanks = 64; break;\n case 0x06: this.totalRomBanks = 128; break;\n case 0x07: this.totalRomBanks = 256; break;\n case 0x08: this.totalRomBanks = 512; break;\n case 0x52: this.totalRomBanks = 72; break;\n case 0x53: this.totalRomBanks = 80; break;\n case 0x54: this.totalRomBanks = 96; break;\n }\n\n // Read RAM size.\n this.ramSize = this.rom[0x0149];\n\n // Initialize RAM space.\n let totalRam = 0;\n switch (this.ramSize) {\n case 0x00: totalRam = 0; this.totalRamBanks = 0; break;\n case 0x01: totalRam = 2048; this.totalRamBanks = 1; break;\n case 0x02: totalRam = 8192; this.totalRamBanks = 1; break;\n case 0x03: totalRam = 32768; this.totalRamBanks = 4; break;\n case 0x04: totalRam = 131072; this.totalRamBanks = 16; break;\n case 0x05: totalRam = 65536; this.totalRamBanks = 8; break;\n }\n\n if (totalRam > 0) {\n this.ram = [];\n for (let i = 0; i < totalRam; i++) {\n this.ram[i] = Math.floor(Math.random() * 256);\n }\n }\n\n // Load \"battery-backed\" RAM for storage.\n if (this.hasBattery) {\n this.ramIsDirty = false;\n let ram = localStorage.getItem(`RAM-${this.title}-${this.globalChecksum}`);\n if (ram) {\n console.log(`Cartridge RAM found in local storage.`);\n ram = ram.split(\",\");\n this.ram = ram.map(value => { return parseInt(value); });\n }\n } \n\n console.log(this);\n }", "title": "" }, { "docid": "104064fe5b5c37b2e975fb7586dac3af", "score": "0.48424375", "text": "export()\n {\n return {\n id: this.id,\n type: Launchpad.getType(),\n typeName: Launchpad.getName(),\n config: this.config\n };\n }", "title": "" }, { "docid": "a522d6085f4ebb8fad144043717b43d9", "score": "0.48167378", "text": "static boost(equipment) {\n return new Boost();\n }", "title": "" }, { "docid": "968f016a8d9a2d35c352ac0ad4e783bc", "score": "0.48054472", "text": "function $om() {return ObjectManager.instance;}", "title": "" }, { "docid": "969d377800bdd643564ce7e238834436", "score": "0.48002583", "text": "get controller () {\n if (this._cache.controller !== undefined) {\n return this._cache.controller;\n }\n this._cache.controller = null;\n if (this._mem.controller) {\n const link = Game.getObjectById(this._mem.controller);\n if (link) {\n this._cache.controller = link;\n }\n }\n return this._cache.controller;\n }", "title": "" }, { "docid": "f14e7500d3f7360e2bd4f1915bd024a5", "score": "0.47915408", "text": "getState() {\n return this.cartPole.getState();\n }", "title": "" }, { "docid": "61017c4d0e1e0ab35abe9e1d5819e013", "score": "0.47807607", "text": "getObject() {\n throw new Error(`getObject() должен быть реализован`)\n }", "title": "" }, { "docid": "3f307e364658790797648c3df64f053f", "score": "0.47745147", "text": "function creaCarrito() {\n let productos = [];\n if (localStorage.getItem('productos')) {\n productos = JSON.parse(localStorage.getItem('productos'));\n }\n return new Carrito('cliente', productos);\n}", "title": "" }, { "docid": "542abda0688d0f4615dfd9c0bfd73918", "score": "0.47614065", "text": "getCart() {\n\t\treturn this.get('store')\n\t\t.findAll('cart')\n\t\t.then(carts => {\n\t\t\tif (carts.get('length') === 0) {\n\t\t\t\treturn this.get('store').createRecord('cart');\n\t\t\t} else {\n\t\t\t\t//console.log('firstObject');\n\t\t\t\treturn carts.get('firstObject');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "324acdb6d1b9aac0c83f28c3b106aef9", "score": "0.47598612", "text": "getOwnContainer() {\n return \"\";\n }", "title": "" }, { "docid": "7d81bcb35e0394ac2bbe2bd5c12cbb8e", "score": "0.4759656", "text": "get library() {\n\t\treturn this.__library;\n\t}", "title": "" }, { "docid": "e91a830ca07b5f7de3e7a4164a74ba45", "score": "0.4750285", "text": "getCurrentScene() {\n return this.currentScene;\n }", "title": "" }, { "docid": "9edd9f13047bb11738f28f83c1e46007", "score": "0.47424316", "text": "get compilerObject() {\r\n return this._compilerObject;\r\n }", "title": "" }, { "docid": "9edd9f13047bb11738f28f83c1e46007", "score": "0.47424316", "text": "get compilerObject() {\r\n return this._compilerObject;\r\n }", "title": "" }, { "docid": "1504f1a3956a895db752a63af4f55cea", "score": "0.47365326", "text": "_getProduct() {\n return WorkspaceUtils.cloneRepo(this.productName, this.options.branch || 'main', null, '.', this.cwd, this.cloneSSH)\n .then(() => {\n this._removeUnnecessaryProductFiles();\n const phoveaProductJSON = `${this.cwd}/phovea_product.json`;\n if (!fs.existsSync(phoveaProductJSON)) {\n throw new Error('No phovea_product.json file found! Did you enter a valid phovea product repository?');\n }\n\n this.product = fs.readJSONSync(phoveaProductJSON);\n const defaultApp = findDefaultApp(this.product);\n this.defaultApp = defaultApp.name;\n\n this._createYoRcWorkspace(defaultApp);\n return RepoUtils.parsePhoveaProduct(this.product);\n });\n }", "title": "" }, { "docid": "d0d8bdb462e55c36257dbd3352ec4fe0", "score": "0.47337595", "text": "function getMainCarrier() {\n var carrier = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__[\"getGlobalObject\"])();\n carrier.__SENTRY__ = carrier.__SENTRY__ || {\n extensions: {},\n hub: undefined,\n };\n return carrier;\n}", "title": "" }, { "docid": "687a493952ea2868a542b33d711c4720", "score": "0.4733034", "text": "getCurrentObj() {\n return this.model;\n }", "title": "" }, { "docid": "687a493952ea2868a542b33d711c4720", "score": "0.4733034", "text": "getCurrentObj() {\n return this.model;\n }", "title": "" }, { "docid": "968fde4a46d31bfbf192806e5f1edddf", "score": "0.4730897", "text": "my_aircraft() {\n return window.aircraftController.aircraft_get(this.my_aircrafts_eid);\n }", "title": "" }, { "docid": "faf3937b5a91522d43335bee4c43f63c", "score": "0.4727018", "text": "getCart(callBack = () => {}) {\n if (!_.isEmpty(cartInstance)) {\n return callBack(cartInstance)\n }\n const ui = this.getUiInstance()\n const cartPromise = ui.createComponent('cart', {\n node: document.getElementById('cart'),\n options: {\n cart: {\n startOpen: false,\n styles: {\n button: {\n 'background-color': colors.teal,\n }\n },\n events: {\n openCheckout: () => { cleverTapCheckout() } // logs event into clever tap as user checkout from cart.\n }\n },\n toggle: {\n styles: {\n toggle: {\n 'background-color': colors.teal,\n ':hover': {\n 'background-color': colors.teal\n }\n }\n }\n }\n }\n })\n cartPromise.then((cartItem) => {\n callBack(cartItem)\n cartInstance = cartItem\n })\n }", "title": "" }, { "docid": "328afd983c068009afd5c65595f62b4f", "score": "0.47156018", "text": "getController() {\n if (!this.apollo) throw new Error(\"Apollo instance not present, did you initialize the Connection properly?\");\n if (this.controller && this.apollo.controllers.has(this.controller.id)) return this.controller;\n\n let controller = this.apollo.lowestLoadController;\n this.controller = controller;\n\n if (!controller) {\n return null;\n }\n\n // Hook events\n controller.on(\"ready\", (data) => {\n if (data.guildId === this.guildId) return this.ready();\n });\n\n controller.on(\"start\", (data) => {\n if (data.guildId === this.guildId) return this.started();\n });\n\n controller.on(\"end\", (data) => {\n if (data.guildId === this.guildId) return this.ended();\n });\n //\n\n return controller;\n }", "title": "" }, { "docid": "f60abace27c2318daa9fb3b48b0e5bc8", "score": "0.47057375", "text": "function getIt() {\r\n\treturn JenkinsActivitiPlugin.prototype.it;\r\n}", "title": "" }, { "docid": "ef4eeb7cd44a6d581e93121151ef6786", "score": "0.47052866", "text": "function returnObject() {\n //console.log(initial);\n return initial;\n }", "title": "" }, { "docid": "f2c8302f1034fb15823e0d324447a0bb", "score": "0.47036278", "text": "getCurrentComponent() {\n return this.currentComponent;\n }", "title": "" }, { "docid": "bf76ae8762df067db8895ed476dec9bd", "score": "0.46666253", "text": "function getCart(request, cart, ctx) {\n // Simply return the shopping cart as is.\n return cart;\n}", "title": "" }, { "docid": "4f24f1bd8abe6d46dc5a60af9b8deee8", "score": "0.46654412", "text": "function getSystem() {\n if (system == null) {\n system = new System();\n }\n return system;\n}", "title": "" }, { "docid": "d1df55c87728538defe62e3c90a9342f", "score": "0.46638128", "text": "function Aras(parent) {\n\tif (parent) {\n\t\tthis.parentArasObj = parent;\n\t\tfor (var prop in parent) {\n\t\t\tif (prop != 'privateProperties' && prop != 'parentArasObj' && prop != 'modalDialogHelper' && prop != 'shortcutsHelperFactory' && prop != 'CriteriaConverter' && !Aras.prototype[prop]) {\n\t\t\t\tthis[prop] = parent[prop];\n\t\t\t}\n\t\t}\n\t\tthis.IomInnovator = this.newIOMInnovator();\n\t\tthis.vault = controlWrapperFactory.createVaultWrapper(this, parent);\n\t\tthis.utils = controlWrapperFactory.createUtilsWrapper(this, parent);\n\t} else {\n\t\tvar innovatorWindow = window; // !!! wrong, but temporary work\n\t\tthis.Enums = Enums;\n\t\tthis.commonProperties = new ArasCommonProperties();\n\t\tthis.SetupURLs(window.location.href);\n\t\tthis.varsStorage = null;\n\t\tthis.vault = null;\n\t\tthis.itemsCache = new ClientCache(this);\n\t\tthis.windowsByName = new Array();\n\t\tthis.preferenceCategoryGuid = 'B0D45DA3B9CE4196A9FEB1D7AD3E4870';\n\t\tthis.mainWindowName = innovatorWindow.name;\n\t\tif (!this.mainWindowName) {\n\t\t\tvar d = new Date();\n\t\t\tinnovatorWindow.name = 'innovator_' + d.getHours() + 'h' + d.getMinutes() + 'm' + d.getSeconds() + 's';\n\t\t\tthis.mainWindowName = innovatorWindow.name;\n\t\t}\n\t\tthis.maxNestedLevel = 3; //constant to prevent recurrsion of nested forms (zero based)\n\t\tthis.newFieldIndex = 0; //variable used in formtool to generate new field name\n\t\tthis.sGridsSetups = new Object();\n\t\tthis.rels2gridXSL = new Object();\n\t\tthis.clipboard = new Clipboard(this);\n\t\tthis.VaultServerURLCache = new Object();\n\t\tthis.translationXMLNsURI = 'http://www.aras.com/I18N';\n\t\tthis.translationXMLNdPrefix = 'i18n';\n\n\t\tthis.IomFactory = null;\n\t\tthis.IomInnovator = null;\n\t\tthis.MetadataCache = null;\n\t\tthis.metadataCacheCategotries = new Object();\n\t\tthis.metadataCacheCategotries.variables = '824E7AB9B52446e58E05FC47A7507B21';\n\t}\n\n\tthis.modalDialogHelper = new ModalDialogHelper(this.getScriptsURL());\n\tthis.privateProperties = new ArasPrivateProperties(this);\n\tthis.controlsFactoryHelper = new ClientControlsFactoryHelper();\n\tthis.shortcutsHelperFactory = new ShortcutsHelperFactory();\n\tthis.customActionHelper = new CustomActionHelper(this);\n\n\tvar critConverter;\n\tvar self = this;\n\tObject.defineProperty(this, 'CriteriaConverter', {\n\t\tget: function() {\n\t\t\tif (!critConverter) {\n\t\t\t\tvar clientUrl = (new ClientUrlsUtility(self.commonProperties.BaseURL)).getBaseUrlWithoutSalt();\n\t\t\t\tcritConverter = new CriteriaConverter(clientUrl);\n\t\t\t}\n\t\t\treturn critConverter;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "52bd4c80bfafd28763f095c9cf783ac2", "score": "0.46454158", "text": "function setCart(c) {\n cart = c;\n return cart;\n}", "title": "" }, { "docid": "0f929d8aed3991363971af232530202f", "score": "0.46431473", "text": "getInfo() {\n return {\n \"id\": \"Test\",\n \"name\": \"Test\",\n \"blocks\": [{\n \"opcode\": \"secId1\",\n \"blockType\": \"command\",\n \"text\": \"Test Block\",\n \"arguments\": {}\n }],\n \"menus\": {}\n };\n }", "title": "" }, { "docid": "340c00ea73abcb28b2f0822ab3a60ece", "score": "0.46412846", "text": "getRoleManager() {\n return this.rm;\n }", "title": "" }, { "docid": "bde9979f77f596fadf3c783f940d1ad1", "score": "0.46356413", "text": "requireParent() {\n return \"SCServer\";\n }", "title": "" }, { "docid": "5cc8ce4eced7d31c3593d86a47b0aeb5", "score": "0.46345377", "text": "get product() {\n return this._launcher.product;\n }", "title": "" }, { "docid": "10f552356e1cf4b90fa11549669e2e0f", "score": "0.46264932", "text": "getUserCartDetails() {\n return this.crud.getData(`/carts/my`);\n }", "title": "" }, { "docid": "050f291629fae83fba42805d2383ab2f", "score": "0.46244997", "text": "function getCreateNewItem() {\n return { __blueprintCreateNewItemBrand: \"blueprint-create-new-item\" };\n}", "title": "" }, { "docid": "76c4cdd5a499a154d123bb96e8d1286c", "score": "0.46176466", "text": "toString() {\n return 'LibreObject';\n }", "title": "" }, { "docid": "a5f545c2d8088278fa56dea37bb4eb42", "score": "0.46174565", "text": "currentPlatform() {\n return this.platform;\n }", "title": "" }, { "docid": "ccc1cd65771142e45611a25fb4174dc9", "score": "0.46168256", "text": "function getMainCarrier() {\n var carrier = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__[/* getGlobalObject */ \"g\"])();\n carrier.__SENTRY__ = carrier.__SENTRY__ || {\n extensions: {},\n hub: undefined,\n };\n return carrier;\n}", "title": "" }, { "docid": "0e72d4c1c684459d0d399bf673646f7d", "score": "0.46104887", "text": "get system() {\n\t\treturn this.__system;\n\t}", "title": "" }, { "docid": "0e72d4c1c684459d0d399bf673646f7d", "score": "0.46104887", "text": "get system() {\n\t\treturn this.__system;\n\t}", "title": "" }, { "docid": "0e72d4c1c684459d0d399bf673646f7d", "score": "0.46104887", "text": "get system() {\n\t\treturn this.__system;\n\t}", "title": "" }, { "docid": "0e72d4c1c684459d0d399bf673646f7d", "score": "0.46104887", "text": "get system() {\n\t\treturn this.__system;\n\t}", "title": "" }, { "docid": "1cf0fe88acdbb927994b7a41ef3746e7", "score": "0.46094653", "text": "constructor() { \n \n CustomerInventory.initialize(this);\n }", "title": "" }, { "docid": "640676ccae1a369a73fdc50184d7ce07", "score": "0.4605257", "text": "getClient() {\n if (!this.client) {\n this.client = (new Client(this.key));\n }\n\n return this.client;\n }", "title": "" }, { "docid": "1d25bdbe83845e02f3932cd8b933d95c", "score": "0.4602245", "text": "function getSelf() {\n return self;\n }", "title": "" }, { "docid": "9321f3c38ba208b58e9ddcbff396f6e3", "score": "0.45916298", "text": "function getMainCarrier() {\n var carrier = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__[/* getGlobalObject */ \"e\"])();\n carrier.__SENTRY__ = carrier.__SENTRY__ || {\n hub: undefined\n };\n return carrier;\n}", "title": "" }, { "docid": "20d79ddfc46744937db32bd8025811ed", "score": "0.4585914", "text": "function buyCake(){\n\n return{\n type:BUy_Cake,\n info:\"this is the action which\"\n }\n}", "title": "" }, { "docid": "ce64492175fe787f59aa3487f4cebd9b", "score": "0.45823678", "text": "static getSelectedRoutine(){\n\t\tlet theRoutine= myStorage.localGetObj('selectedWorkout');\n\t\tlet myPersonal = null;\n\t\tif(theRoutine ) {\n\t\t\tmyPersonal = new Routine().retrieve(theRoutine.myID);\n\t\t}\n\t\t//load object from Storage local\n\t\treturn myPersonal;\n\t\n\t}", "title": "" }, { "docid": "4cd5db82818b7bce340ee698c87d61aa", "score": "0.45801494", "text": "toString() {\n return 'LibreController';\n }", "title": "" }, { "docid": "1557e28a4424181d8040cb85965dc368", "score": "0.45786637", "text": "object() {\n return new ObjectBuilder(this.resource);\n }", "title": "" }, { "docid": "f93340d57202bfe56a61eab6b2a92ce4", "score": "0.45781454", "text": "function OnNewVaultCore( vaultCore ) {\r\n}", "title": "" }, { "docid": "aa2485e44fdf759169c7246a860fcc24", "score": "0.4576884", "text": "function getComponentConstructor(ractive, name) {\r\n \tvar instance = findInstance('components', ractive, name);\r\n \tvar Component = undefined;\r\n\r\n \tif (instance) {\r\n \t\tComponent = instance.components[name];\r\n\r\n \t\t// best test we have for not Ractive.extend\r\n \t\tif (!Component._Parent) {\r\n \t\t\t// function option, execute and store for reset\r\n \t\t\tvar fn = Component.bind(instance);\r\n \t\t\tfn.isOwner = instance.components.hasOwnProperty(name);\r\n \t\t\tComponent = fn();\r\n\r\n \t\t\tif (!Component) {\r\n \t\t\t\twarnIfDebug(noRegistryFunctionReturn, name, 'component', 'component', { ractive: ractive });\r\n \t\t\t\treturn;\r\n \t\t\t}\r\n\r\n \t\t\tif (typeof Component === 'string') {\r\n \t\t\t\t// allow string lookup\r\n \t\t\t\tComponent = getComponentConstructor(ractive, Component);\r\n \t\t\t}\r\n\r\n \t\t\tComponent._fn = fn;\r\n \t\t\tinstance.components[name] = Component;\r\n \t\t}\r\n \t}\r\n\r\n \treturn Component;\r\n }", "title": "" }, { "docid": "54c9cead726315131c888d9eb3b26427", "score": "0.4574525", "text": "function callingCart(){\n\tapiCart.getCart()\n\t\t.then(res => {\n\t\t\tproductos = res.data;\n\t\t\tcarrito.agregarCarrito(productos);\n\t\t\tloadProducts(productos);\n\t\t\tloadTotalProducts(productos, 1)\n\t\t})\n}", "title": "" }, { "docid": "4948d7fa44d6e773ba1d552261f2f33a", "score": "0.45721334", "text": "createContext() {\n return new CarContext();\n }", "title": "" }, { "docid": "98b579f12764406051f201eb0eb6e439", "score": "0.4555115", "text": "get Brotli() {}", "title": "" }, { "docid": "694465b202dfe77ec0e7e4a43519e65e", "score": "0.45537066", "text": "function getMasterVariant() {\n var variant = new ProductVariantDisplay();\n angular.extend(variant, this);\n // clean up\n variant.key = this.productVariantKey;\n variant.productKey = this.key;\n variant.master = true;\n delete variant['productOptions'];\n delete variant['productVariants'];\n return variant;\n }", "title": "" }, { "docid": "694465b202dfe77ec0e7e4a43519e65e", "score": "0.45537066", "text": "function getMasterVariant() {\n var variant = new ProductVariantDisplay();\n angular.extend(variant, this);\n // clean up\n variant.key = this.productVariantKey;\n variant.productKey = this.key;\n variant.master = true;\n delete variant['productOptions'];\n delete variant['productVariants'];\n return variant;\n }", "title": "" }, { "docid": "95d810b78043d19fcaef7e90db0f1eb8", "score": "0.45536435", "text": "getContainer() {\n\n if ( !this.threeOBJ && this.parent ) {\n\n return this.parent.getContainer();\n\n } else if ( this.threeOBJ ) {\n\n return this\n\n } \n\n return DEFAULTS.container\n\n \n\n }", "title": "" }, { "docid": "7f69fe45fffbe85b01ced4a5049973c5", "score": "0.45510465", "text": "function _currentStore(){\r\n\t\t\treturn currentStore;\r\n\t\t}", "title": "" }, { "docid": "e386fb1ca0626ed386b0fbd9315cae8b", "score": "0.4549587", "text": "function _cartao(){\n \n function __carregar(){\n \n _load(function(){\n \n _eventosCartao();\n\n /*Apenas novo lancamento*/\n if(!id){\n /*Inicializa regras de preenchimento*/\n _regras();\n /*Previews da tela de novo lancamento*/\n _previews.init();\n }\n \n });\n }\n \n function __salvar(continuar){\n /*Se existe erro em alguma validacao interna, para*/\n if(!_setDefaultValues()) return;\n\n _setDefaultValuesCartao();\n Ajax('EDITAR_CARTAO',l.encode(),function(r){\n _done(r,continuar);\n }); \n \n }\n \n return {\n title : (id ? 'Editar' : 'Novo') + ' lançamento - Cartão de Crédito',\n showButtons : false,\n ajax : __carregar,\n buttons : _buttons(__salvar)\n }\n }", "title": "" }, { "docid": "8b2d6b49a09310b7ebf452b778517314", "score": "0.45440978", "text": "getConsumable() {\n\t\treturn this.call('get_consumable')\n\t\t\t.then(result => {\n\t\t\t\treturn result[0]\n\t\t\t})\n\t}", "title": "" }, { "docid": "a71bf487241e47c1d6043396f62ea7af", "score": "0.45405674", "text": "getOperationSystem() {\n\t \treturn this.operationSystem;\n\t }", "title": "" }, { "docid": "56d3c9dd50ea1387c3aac6847b7418f5", "score": "0.4539224", "text": "function NSGetModule( compMgr, fileSpec ) {\r\n\tlogMessage('entry point to: components/carrot_garden.js')\r\n return carrot_garden_objectModule;\r\n}", "title": "" }, { "docid": "526032df34cbcd93431294fa45289c6f", "score": "0.45379198", "text": "get controller() {\n return this.hash.module.controller || (this.getPrototype().hash && this.getPrototype().hash.module.controller);\n }", "title": "" }, { "docid": "ce9f3ca58bbe8ded7239c2ee639efe43", "score": "0.45365635", "text": "initAccessory() {\n return new Accessory(this.getName(), this.getUuid(), this.api.hap.Accessory.Categories.LIGHTBULB);\n }", "title": "" }, { "docid": "2198d03b00cf51945e5083de5facb027", "score": "0.45363206", "text": "function getInventoryApp() {\n const $inventory = page.get.$inventory();\n const match = ($inventory.attr('id') || '').match(/(\\d+)_(\\d+)$/);\n const [ , appid, contextid] = (match || []);\n \n return {\n appid,\n contextid\n };\n }", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "e06ce61b472ae35261697e46c013fda8", "score": "0.0", "text": "function n(e,n,t){var r,a,o={ss:n?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:n?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:n?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"};return\"m\"===t?n?\"хвіліна\":\"хвіліну\":\"h\"===t?n?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,a=o[t].split(\"_\"),r%10==1&&r%100!=11?a[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?a[1]:a[2])}", "title": "" } ]
[ { "docid": "10d1879eaeed63952d2503fd69f151f3", "score": "0.8290721", "text": "function g(e,t,r){return e+\" \"+function(e,t){return 2===t?function(e){var t={m:\"v\",b:\"v\",d:\"z\"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[r],e)}//! moment.js locale configuration", "title": "" }, { "docid": "a2cd0265366d469e1711c1dc40af6a12", "score": "0.76963586", "text": "function wa(e,t,n){var a={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+a[n]}//! moment.js locale configuration", "title": "" }, { "docid": "5d687930143ad23adb51a5822eb657c1", "score": "0.7654697", "text": "function init() {\n if (navigator && navigator.language) {\n moment.locale(navigator.language);\n }\n else {\n moment.locale('es');\n }\n }", "title": "" }, { "docid": "5d67dc8bcb8045ac2d2a13c12bedd632", "score": "0.76467", "text": "function localizeMoment(mom){mom._locale = localeData;}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.7548106", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.7548106", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "b5ee0f1824afd8786d73e0ab9ee28fb2", "score": "0.718394", "text": "function localizeMoment(mom) {\r\n\t\tmom._locale = localeData;\r\n\t}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71708643", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71708643", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "53b156f71f17bcf54c6a9177af5e1045", "score": "0.71614736", "text": "function doTheMagic () {\n moment.locale('pt-BR');\n setDisplay();\n}", "title": "" }, { "docid": "ffeac031b2f05305244a4c7894bb3dd0", "score": "0.7130321", "text": "get lang() {\n return moment.locale();\n }", "title": "" }, { "docid": "96429cc3f1ee77f92477a1c0f838fa77", "score": "0.69832134", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "ef65c75b88e6f3908a65e44dcb470148", "score": "0.68844", "text": "function sd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c];}//! moment.js locale configuration", "title": "" }, { "docid": "ad6199621e48dee2be6e8e4a57acdbfc", "score": "0.68776137", "text": "function init(){\n moment.locale(\"it\");\n printGraphic();\n}", "title": "" }, { "docid": "8636f8bcf2bb73c7efc7501fe0dcbec9", "score": "0.6857098", "text": "function relativeTimeWithPlural$4(number,withoutSuffix,key){return\"m\"===key?withoutSuffix?\"хвилина\":\"хвилину\":\"h\"===key?withoutSuffix?\"година\":\"годину\":number+\" \"+\n//! moment.js locale configuration\nfunction plural$6(word,num){var forms=word.split(\"_\");return num%10==1&&num%100!=11?forms[0]:num%10>=2&&num%10<=4&&(num%100<10||num%100>=20)?forms[1]:forms[2]}({ss:withoutSuffix?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:withoutSuffix?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:withoutSuffix?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[key],+number)}", "title": "" }, { "docid": "d67a3b8503ec4102a172573ded84b961", "score": "0.6732808", "text": "defaultLocale() {\n return 'en';\n }", "title": "" }, { "docid": "2c83a51fb5077040656e855f9655f4e9", "score": "0.6690814", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "461e6e675fb29fbbf2166539c9213026", "score": "0.66146594", "text": "formatMoment() {\n let lang = window.sessionStorage.getItem('language')\n let moment = require('moment'); /// para capturar o momento\n moment().format();\n moment.locale(lang);\n\n return moment().format('DD/MMMM/YYYY - HH:mm:ss')\n }", "title": "" }, { "docid": "d252e19be518329d10c10006b572f344", "score": "0.65586287", "text": "function setLocaleDateTime () {\n\t var days = [\n\t $.localise.tr(\"Sunday\"),\n\t $.localise.tr(\"Monday\"),\n\t $.localise.tr(\"Tuesday\"),\n\t $.localise.tr(\"Wednesday\"),\n\t $.localise.tr(\"Thursday\"),\n\t $.localise.tr(\"Friday\"),\n\t $.localise.tr(\"Saturday\")\n\t ],\n\t months = [\n\t $.localise.tr(\"January\"),\n\t $.localise.tr(\"February\"),\n\t $.localise.tr(\"March\"),\n\t $.localise.tr(\"April\"),\n\t $.localise.tr(\"May\"),\n\t $.localise.tr(\"June\"),\n\t $.localise.tr(\"July\"),\n\t $.localise.tr(\"August\"),\n\t $.localise.tr(\"September\"),\n\t $.localise.tr(\"October\"),\n\t $.localise.tr(\"November\"),\n\t $.localise.tr(\"December\")\n\t ],\n\t days_abbrev = [\n\t $.localise.tr(\"Sun\"),\n\t $.localise.tr(\"Mon\"),\n\t $.localise.tr(\"Tue\"),\n\t $.localise.tr(\"Wed\"),\n\t $.localise.tr(\"Thu\"),\n\t $.localise.tr(\"Fri\"),\n\t $.localise.tr(\"Sat\")\n\t ],\n\t months_abbrev = [\n\t $.localise.tr(\"Jan\"),\n\t $.localise.tr(\"Feb\"),\n\t $.localise.tr(\"Mar\"),\n\t $.localise.tr(\"Apr\"),\n\t $.localise.tr(\"May\"),\n\t $.localise.tr(\"Jun\"),\n\t $.localise.tr(\"Jul\"),\n\t $.localise.tr(\"Aug\"),\n\t $.localise.tr(\"Sep\"),\n\t $.localise.tr(\"Oct\"),\n\t $.localise.tr(\"Nov\"),\n\t $.localise.tr(\"Dec\")\n\t ];\n\t wialon.util.DateTime.setLocale(days, months, days_abbrev, months_abbrev);\n\t}", "title": "" }, { "docid": "7021ea3c212c9bd2f74b6c37d94d6338", "score": "0.6469657", "text": "function getMomentLocale(key) {\n return {\n id: key,\n locale: {\n week: {\n // Angular monday = 0 whereas Moment monday = 1\n dow: ($locale.DATETIME_FORMATS.FIRSTDAYOFWEEK + 1) % 7,\n doy: defaultConfig.doys[key]\n }\n }\n };\n }", "title": "" }, { "docid": "6ead600a845fbd33f37f6d5efb69f1d5", "score": "0.6365162", "text": "function setLocaleLanguage(locale) {\n let fetch = false\n if(locale == 'en') {\n dateFormatter.locale = 'en'\n fetch = true\n }\n else dateFormatter.locale = 'ko-Kore_KR'\n\n localeJSON.year = !fetch ? 'yy년' : 'y,'\n localeJSON.day = !fetch ? 'EEEE' : 'E'\n localeJSON.realtime = !fetch ? '현재' : 'Real-time'\n localeJSON.country = !fetch ? '전국' : 'Korea'\n localeJSON.accumulate = !fetch ? '0시 기준' : 'Total'\n localeJSON.yesterday = !fetch ? '어제' : 'Last'\n localeJSON.count = !fetch ? ' 명' : ''\n localeJSON.calendar = !fetch ? '일정' : 'Calendar'\n localeJSON.reminder = !fetch ? '미리알림' : 'Reminder'\n\n localeJSON.sun = !fetch ? '일' : 'S'\n localeJSON.mon = !fetch ? '월' : 'M'\n localeJSON.tue = !fetch ? '화' : 'T'\n localeJSON.wen = !fetch ? '수' : 'W'\n localeJSON.thu = !fetch ? '목' : 'T'\n localeJSON.fri = !fetch ? '금' : 'F'\n localeJSON.sat = !fetch ? '토' : 'S'\n\n localeJSON.regions = ['Seoul', 'Busan', 'Incheon', 'Daegu',\n 'Gwangju', 'Daejeon', 'Ulsan', 'Sejong',\n 'Gyeonggi', 'Gangwon', 'ChungBuk',\n 'ChungNam', 'GyeongBuk', 'GyeongNam',\n 'JeonBuk', 'JeonNam', 'Jeju']\n}", "title": "" }, { "docid": "f9bdceec711408a9ac249b49874f3f6d", "score": "0.6236138", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key)\n } else {\n data = defineLocale(key, values)\n }\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data\n }\n }\n return globalLocale._abbr\n }", "title": "" }, { "docid": "cf395bb0083ba1ea07b9d05bf01925ac", "score": "0.6183774", "text": "function ApexLocale() { }", "title": "" }, { "docid": "6e8eb0a6db712165ad6510dcb331f95c", "score": "0.6168197", "text": "beforeCreate(){\r\n if ( bbn.env && bbn.env.lang && (bbn.env.lang !== dayjs.locale()) ){\r\n dayjs.locale(bbn.env.lang);\r\n }\r\n }", "title": "" }, { "docid": "fcde36f904fbafdad011619f6d86d3ad", "score": "0.6156515", "text": "function overrideMonthNamesInCFPicker() {\n // short months for de locale have a dot at the end which makes java simpledateformat parser nuts\n if (confimoment.lang() == 'de') {\n confimoment.lang('de', {\n monthsShort: \"Jan_Feb_Mär_Apr_Mai_Jun_Jul_Aug_Sep_Okt_Nov_Dez\".split(\"_\")\n });\n }\n if (confimoment.lang() == 'es') {\n confimoment.lang('es', {\n monthsShort: function (a, b) {\n return \"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic\".split(\"_\")[a.month()];\n }\n });\n }\n if (confimoment.lang() == 'ja') {\n confimoment.lang('ja', {\n monthsShort: [\n \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"\n ]\n });\n }\n}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "52559860145ad28417b3ea5a7bcee95b", "score": "0.60859364", "text": "dateFormat(date) {\n return moment(date).locale('fr').format('Do MMMM YYYY')\n }", "title": "" }, { "docid": "e640ff1a70c59d2b6602b4c743d7ecf1", "score": "0.60783803", "text": "function datetimeConfig(moment)\n {\n // Make sure moment is in english and the first day of week is a monday\n moment.lang('en', {\n // customizations.\n week: {\n dow: 1\n },\n calendar: {\n lastDay: '[Yesterday], dddd MMM D',\n sameDay : '[Today], dddd MMM D',\n nextDay : '[Tomorrow], dddd MMM D',\n lastWeek : 'dddd, MMM D',\n nextWeek : 'dddd, MMM D',\n sameElse : 'dddd, MMM D'\n }\n });\n\n // Add America/Detroit timezone, note that this is the same as Toronto\n moment.tz.add(\n [\n 'America/Detroit|EST EDT|50 40|01010101010101010101010|1BQT0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0',\n \"Etc/UTC|UTC|0|0|\"\n ]);\n }", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]
07c6781ebee329b948570dab41d1ccb8
Also output the current height of each tree and how many branches it has to the DOM.
[ { "docid": "bfe5af9817218849c59348fbbe81c10e", "score": "0.0", "text": "function showMyTrees() {\n var buildstring = \"\";\n buildstring += `<div class=\"col-md-4\"><div class=\"card\">`\n buildstring += `<p class=\"timeP\">After ${timesGrown} seconds...</p>`\n buildstring += `<p class=\"pearTree\"><b>Pear Tree</b> is now <b>${PearTree.height}cm</b> tall and has <b>${PearTree.branches}</b> branches</p>`;\n buildstring += `<p class=\"oakTree\"><b>Oak Tree</b> is now <b>${OakTree.height}cm</b> tall and has <b>${OakTree.branches}</b> branches</p>`;\n buildstring += `</div></div>`\n output.append(buildstring);\n}", "title": "" } ]
[ { "docid": "7178a3333eb0e2e1348f62bc46908cdb", "score": "0.6946992", "text": "function getHeights(){\n //console.log(\"GETING HEIGHTS GETING HEIGHT GETING HEIGHT\");\n for (const [id, vertex] of Object.entries(tree_vertices)) {\n //console.log(\"id:\", id, \"height:\", vertex.height, \"possible root(?):\", !vertex.incomingConns);\n // if there are no incoming connections, it is possible that this vertex is root so lets calculate tree height\n if(!vertex.incomingConns){\n Vertex.treeHeight(vertex);\n //console.log(\"calculating height for\", vertex.vertex_id);\n }\n }\n\n //console.log(\"[getHeights] heights done!\")\n // Vertex.treeHeight(\"prvi vertex\");\n // napolni še za vse ostale vertexe, najdi boljši način kot da n krat kličeš treeHeight(shrajevanje v array)\n}", "title": "" }, { "docid": "4c710bf0f0d8e6d64660af19ac59745f", "score": "0.69337714", "text": "function getHeights(){\n // console.log(\"GETING HEIGHTS GETING HEIGHT GETING HEIGHT\");\n for (const [id, vertex] of Object.entries(tree_vertices)) {\n // console.log(\"id:\", id, \"height:\", vertex.height, \"possible root(?):\", !vertex.incomingConns);\n // if there are no incoming connections, it is possible that this vertex is root so lets calculate tree height\n if(!vertex.incomingConns){\n Vertex.treeHeight(vertex);\n // console.log(\"calculating height for\", vertex.vertex_id);\n }\n }\n\n // console.log(\"[getHeights] heights done!\")\n // Vertex.treeHeight(\"prvi vertex\");\n // napolni še za vse ostale vertexe, najdi boljši način kot da n krat kličeš treeHeight(shrajevanje v array)\n}", "title": "" }, { "docid": "98fe763e3402169d795e28c728f74a70", "score": "0.6679321", "text": "function height(tree) {\n //check if tree has any values\n if (!tree) {\n return 0;\n }\n \n let leftHeight = height(tree.left);\n let rightHeight = height(tree.right);\n \n return 1 + Math.max(leftHeight, rightHeight);\n }", "title": "" }, { "docid": "ac4bf5eedaf441be12aaed1222f18cce", "score": "0.6569339", "text": "computeHeight() {\n const { node } = this;\n return (\n node.states.length * this._state_height\n + 2 * this._state_offset\n + this._title_height\n )\n }", "title": "" }, { "docid": "bc19e8bc7902e5abc46b31b1f628594c", "score": "0.64745057", "text": "function findHeight(tree, lCount = 1, rCount = 1) {\n lCount = lCount;\n rCount = rCount;\n\n if (tree === null) {\n return 0;\n }\n\n function leftHeight(curNode) {\n if (curNode.left !== null) {\n lCount++;\n curNode = curNode.left;\n leftHeight(curNode);\n }\n return lCount;\n }\n\n function rightHeight(curNode) {\n if (curNode.right !== null) {\n rCount++;\n curNode = curNode.right;\n rightHeight(curNode);\n console.log(curNode, '38');\n }\n return rCount;\n }\n\n return Math.max(leftHeight(tree), rightHeight(tree));\n}", "title": "" }, { "docid": "15da525eee1178d7318aad40ffaa6017", "score": "0.6404027", "text": "function bstHeight(tree){\n let leftHeight = 0;\n let rightHeight = 0;\n\n // if no tree object, just return 0\n if(!tree){\n return 0;\n }\n\n if(tree.left){\n // leftHeight storing the amount of times function is called\n leftHeight = bstHeight(tree.left);\n // console.log(leftHeight);\n }\n\n if(tree.right){\n // rightHeight storing the amount of times function is called\n rightHeight = bstHeight(tree.right);\n // console.log(rightHeight);\n }\n // Math.max() returns the largest of the number inputs given. In this case, 2, then adds 1 for root node. \n return Math.max(leftHeight, rightHeight) + 1;\n\n}", "title": "" }, { "docid": "9dc8e3cc5cf76ae278c708c54592e82b", "score": "0.6230146", "text": "function findHeight(tree) {\n if (tree === null) return 0;\n\n const leftHeight = findHeight(tree.left) + 1;\n const rightHeight = findHeight(tree.right) + 1;\n return rightHeight > leftHeight ? rightHeight : leftHeight;\n}", "title": "" }, { "docid": "58bef131fb653c7d75f98254dfbb9734", "score": "0.6207941", "text": "function findHeight(root) {\n \n}", "title": "" }, { "docid": "2908998538bcc5994ece1ee2042a81ad", "score": "0.61992615", "text": "function getHeight(root) {\r\n \r\n}", "title": "" }, { "docid": "b85ad181aa7334bc4a955f0643e33b5c", "score": "0.6196339", "text": "[processBranches]() {\n\t\tconst self = this;\n\t\tlet branchWidth = 0;\n\t\tlet longestWidth = 0;\n\t\tlet branchWithLongestTitle;\n\n\t\tconst processLevel = (branches, depth) => {\n\t\t\tlet branchData;\n\t\t\tlet output = [];\n\n\t\t\tfor (let index = 0; index < branches.length; index++) {\n\t\t\t\tif (branches[index].isExpanded) {\n\t\t\t\t\tself[EXPANDED_BRANCHES].push(branches[index].id);\n\t\t\t\t\terase(branches[index], 'isExpanded');\n\t\t\t\t}\n\n\t\t\t\tbranchData = {\n\t\t\t\t\ticon: '',\n\t\t\t\t\t...branches[index],\n\t\t\t\t\tcss: set({}, PADDING_LEFT, depth ? ((depth * INDENT_PIXELS) + PIXELS) : EMPTY_STRING),\n\t\t\t\t\tisSelectable: self.isMultiSelect() || enforceBoolean(branches[index].isSelectable, false),\n\t\t\t\t\tisExpandable: branches[index].children !== undefined,\n\t\t\t\t\tisExpanded: self[EXPANDED_BRANCHES].includes(branches[index].id)\n\t\t\t\t};\n\n\t\t\t\tif (branchData.isExpandable) {\n\t\t\t\t\tself[SHOW_EXPANDERS] = true;\n\t\t\t\t}\n\t\t\t\tif (branchData.isSelectable) {\n\t\t\t\t\tself[SHOW_CHECKBOXES] = true;\n\t\t\t\t}\n\t\t\t\tif (branchData.isExpandable && branchData.isSelectable) {\n\t\t\t\t\tself[SHOW_CHECKBOXES_ON_GROUPS] = true;\n\t\t\t\t}\n\n\t\t\t\tbranchWidth = (branchData.title.length * AVERAGE_CHARACTER_WIDTH);\n\t\t\t\tbranchWidth += ((branchData.subTitle ? branchData.subTitle.length : 0) * AVERAGE_CHARACTER_WIDTH);\n\t\t\t\tbranchWidth += ((branchData.level || 0) * INDENT_PIXELS);\n\n\t\t\t\tif (branchWidth > longestWidth) {\n\t\t\t\t\tlongestWidth = branchWidth;\n\t\t\t\t\tbranchWithLongestTitle = branchData;\n\t\t\t\t}\n\n\t\t\t\toutput.push(branchData);\n\n\t\t\t\tif (branchData.isExpandable && branchData.isExpanded) {\n\t\t\t\t\toutput = output.concat(processLevel(branches[index].children, depth + 1));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn output;\n\t\t};\n\n\t\tself[SHOW_EXPANDERS] = false;\n\t\tself[SHOW_CHECKBOXES] = false;\n\t\tself[SHOW_CHECKBOXES_ON_GROUPS] = false;\n\n\t\tself[VIRTUAL_LIST].itemData(processLevel(self.branches(), 0));\n\n\t\tif (self.width().isAuto && branchWithLongestTitle) {\n\t\t\tself[preMeasureRowWidth](branchWithLongestTitle);\n\t\t}\n\t}", "title": "" }, { "docid": "efdd66014a84d5b71f60b7f433df34df", "score": "0.6156944", "text": "getHeight() {\n return helpers.getHeight(this.root);\n }", "title": "" }, { "docid": "0bcfb05ed63b9b4a98da3546ff8d3fb5", "score": "0.6155425", "text": "function bst_height1(tree) {\n return (\n Math.max(\n tree.left && bst_height1(tree.left),\n tree.right && bst_height1(tree.right)\n ) + 1\n );\n }", "title": "" }, { "docid": "59deb08eeb673eca74c5110ba7eacf81", "score": "0.61115265", "text": "function totalHeight() //used with browserVersion == 2\n{\n var h = this.navObj.clip.height\n var i = 0\n\n if (this.isOpen) //is a folder and _is_ open\n for (i=0 ; i < this.nChildren; i++)\n h = h + this.children[i].totalHeight()\n\n return h\n}", "title": "" }, { "docid": "2ca146202134bd65fc824dd07ef339c6", "score": "0.60649836", "text": "get height() {\n const lHeight = this.left !== null ? this.left.height : 0;\n const rHeight = this.right !== null ? this.right.height : 0;\n return Math.max(lHeight, rHeight) + 1; // +1 for height of current node.\n }", "title": "" }, { "docid": "01ccb8c5db92aff2c66f2243a7193cda", "score": "0.6057406", "text": "function totalHeight() //used with browserVersion == 2\n{\n\tvar h = this.navObj.clip.height\n\tvar i = 0\n\n\tif (this.isOpen) //is a folder and _is_ open\n\tfor (i=0 ; i < this.nChildren; i++)\n\t\th = h + this.children[i].totalHeight()\n\n\treturn h\n}", "title": "" }, { "docid": "b24d491c0a6885d90d8e2a59a0666fdd", "score": "0.6031704", "text": "function printTree (height) {\n\tconst topPiece = '*';\n\tconst strucPiece = '-';\n\tconst spacePiece = ' ';\n\n\tif (height === 0)\n\t\treturn 'no tree';\n\n\t// print tree topper\n\tconsole.log(spacePiece.repeat(height) + topPiece);\n\tfor(let i = 0; i < height; i++) {\n\t\tconsole.log(spacePiece.repeat(height - i) + strucPiece.repeat(i * 2 + 1));\n\t}\n}", "title": "" }, { "docid": "7aac6a51ab50f1fbd6f6b7fe8d543fae", "score": "0.60252756", "text": "height () {\n\tfor (var i=0 ; i < this.length ; i++ ) {\n\t\tvar node=this[i];\n\t\tvar nb = node.getBoundingClientRect();\n\t\treturn nb.bottom - nb.top;\n\t}\n\treturn 0;\n}", "title": "" }, { "docid": "a285fd203d9b94be9b051eb5565ebc9d", "score": "0.5999281", "text": "function findHeight(tree) {\n\t// empty\n\tif (tree.key == null) {\n\t\treturn 0;\n\t}\n\t// has children\n\tif (tree.left && tree.right) {\n\t\treturn 1 + Math.max(findHeight(tree.left), findHeight(tree.right));\n\t}\n\n\tif (tree.left) {\n\t\treturn 1 + findHeight(tree.left);\n\t}\n\tif (tree.right) {\n\t\treturn 1 + findHeight(tree.right);\n\t}\n\n\t// no children\n\telse {\n\t\treturn 1;\n\t}\n}", "title": "" }, { "docid": "15b3a4d4b7e8b5a244f79c571d2a316a", "score": "0.5984085", "text": "height() {\n return this._height(this.root)\n }", "title": "" }, { "docid": "21aed5bf16b505eb97e10e7389b5ec2e", "score": "0.5979096", "text": "height(){\n // Initialise variable for height\n max = 0;\n // Iterate over all nodes\n for(var i=0;i<this.nodes.length;++i){\n // If current node's height is greater than 'max', update max\n if(this.nodes[i].height > max){\n max = this.nodes[i].height\n }\n }\n // Return height\n return max;\n }", "title": "" }, { "docid": "fa7e786cc9f9d8ed9f1a6314e9ff5d9c", "score": "0.5977289", "text": "calculateListHeight(repoNumAll = this.props.repoNumAll) {\n const { listContainer } = this.refs;\n if (listContainer) {\n // console.log('list height', repoNumAll)\n let count = 0;\n for (const page of this.state.showPages) {\n count += this.elements[page % 3].length;\n }\n return listContainer.offsetHeight + (repoNumAll - count) * RepoAbstract.defaultHeight;\n }\n\n return repoNumAll * RepoAbstract.defaultHeight;\n }", "title": "" }, { "docid": "960d60db8fd168b85a909fc9e9de403a", "score": "0.5943804", "text": "calculate_height()\n\t{\n\t\tconst list_dom_node = ReactDOM.findDOMNode(this.list)\n\t\tconst border = parseInt(window.getComputedStyle(list_dom_node).borderTopWidth)\n\t\tconst height = list_dom_node.scrollHeight // + 2 * border // inner height + 2 * border\n\n\t\tconst vertical_padding = parseInt(window.getComputedStyle(list_dom_node.firstChild).paddingTop)\n\n\t\t// const images = list_dom_node.querySelectorAll('img')\n\n\t\t// if (images.length > 0)\n\t\t// {\n\t\t// \treturn this.preload_images(list_dom_node, images)\n\t\t// }\n\n\t\tconst state = { height, vertical_padding, border }\n\n\t\tif (!this.props.menu && this.props.scroll && this.props.options && this.overflown())\n\t\t{\n\t\t\tstate.list_height = this.scrollable_list_height(state)\n\t\t}\n\n\t\tthis.setState(state)\n\t}", "title": "" }, { "docid": "fa3171e02ddfb5f8efefced31d1aec75", "score": "0.5921568", "text": "treeDensity() {\n return Math.round(10 * this.numTrees / this.area) / 10;\n }", "title": "" }, { "docid": "643b1bac05efefa04559923c37dd286d", "score": "0.5915715", "text": "function bstHeight(bst) {\n const right = findMaxHeight(bst); // recursive search for right branch\n const left = findMinHeight(bst); // recursive search for left branch\n\n // if left is greater than right\n if (left > right) {\n // return left's height\n return console.log(`Left: ${left}`);\n } else {\n // else, return right's height\n return console.log(`Right: ${right}`);\n }\n}", "title": "" }, { "docid": "447c53e594a5daf3e2e9a644dbce1ff4", "score": "0.58939433", "text": "function findHeightofTree(tree) {\n if (tree == null) {\n return 0;\n }\n if (tree.left == null && tree.right == null) {\n return 1;\n } else {\n const leftHeight = findHeightofTree(tree.left);\n const rightHeight = findHeightofTree(tree.right);\n return 1 + (leftHeight > rightHeight ? leftHeight : rightHeight);\n }\n}", "title": "" }, { "docid": "e84fffcb0bb9ae4dbf3c67aa33dbe8f5", "score": "0.5885128", "text": "async treeHeightWidthRatio(match){\n let that = this;\n // two fields, treeHeight & treeBottomWidth\n let resultGraphData = [];\n let trees = await Factory.models.tree.find(match).select('treeHeight treeBottomWidth').exec();\n for(let index=0; index < trees.length; index++){\n let el = trees[index];\n\n if(el.treeHeight && el.treeHeight!='' && el.treeHeight!='Vælg' && el.treeBottomWidth && el.treeBottomWidth!='' && el.treeBottomWidth!='Vælg'){\n let avgTreeHeight = that.calculateAverage(el.treeHeight.split('-'));\n let avgTreeWidth = that.calculateSum(el.treeBottomWidth.split('-'));\n \n if(avgTreeHeight > 0){\n let resultValue = avgTreeWidth / avgTreeHeight * 100; //0-200\n if(resultValue < 30){\n //resultGraphData['<30'] ;\n if(resultGraphData['<30%'])\n resultGraphData['<30%'] += 1;\n else\n resultGraphData['<30%'] = 1;\n }\n else if(resultValue > 130){\n if(resultGraphData['130+'])\n resultGraphData['130+'] +=1;\n else\n resultGraphData['130+'] = 1;\n }\n else if(resultValue > 0){\n //resultGraphData['30-40'] =+1;\n let lowerVal = resultValue - resultValue%10;\n let upperVal = (resultValue - resultValue%10)+10;\n\n if(resultGraphData[lowerVal+'-'+upperVal+'%'])\n resultGraphData[lowerVal+'-'+upperVal+'%'] += 1;\n else\n resultGraphData[lowerVal+'-'+upperVal+'%'] = 1;\n }\n /* else{\n console.log(\"NOT A NUMBER: \");\n console.log(resultValue);\n console.log(el.treeHeight);\n console.log(el.treeBottomWidth);\n\n } */\n\n }\n }\n };\n\n /* format like other graphs result from aggregation for proper calculation */\n let formatedResult = [];\n\n for (var k in resultGraphData){\n formatedResult.push({_id: k, count: resultGraphData[k]});\n }\n // console.log(\"formated result:\");\n // console.log(formatedResult);\n return formatedResult;\n //let graphData = {'fieldName':'heightWidthRatio', 'graphName': 'Højde bredde forhold', 'defaultValues': ['<30%','30-40%','40-50%','50-60%','60-70%','70-80%','80-90%','90-100%','100-110%','110-120%','120-130%','130+']},\n }", "title": "" }, { "docid": "8231126f10ec671bfff88acd55dadcd8", "score": "0.5882672", "text": "function heightBST(tree) {\n if (!tree) return 0;\n let leftHeight = heightBST(tree.left);\n let rightHeight = heightBST(tree.right);\n \n return Math.max(leftHeight, rightHeight) + 1;\n }", "title": "" }, { "docid": "27ae22713765cfb2cc2c54df23156756", "score": "0.58819175", "text": "function treeHeight(t){\n let left = 0;\n let right = 0;\n\n if(!t) \n return 0;\n else {\n //computing the depth of each subtree\n left = treeHeight(t.left);\n right = treeHeight(t.right);\n //use the larger one\n if(left > right) {\n return left + 1;\n }\n else {\n return right + 1;\n }\n } \n}", "title": "" }, { "docid": "065ddce1bac1071495589d80706be762", "score": "0.58170474", "text": "calculate_height()\n\t{\n\t\tconst list_dom_node = ReactDOM.findDOMNode(this.refs.list)\n\t\tconst border = parseInt(window.getComputedStyle(list_dom_node).borderTopWidth)\n\t\tconst height = list_dom_node.scrollHeight // + 2 * border // inner height + 2 * border\n\n\t\tconst vertical_padding = parseInt(window.getComputedStyle(list_dom_node.firstChild).paddingTop)\n\n\t\t// const images = list_dom_node.querySelectorAll('img')\n\n\t\t// if (images.length > 0)\n\t\t// {\n\t\t// \treturn this.preload_images(list_dom_node, images)\n\t\t// }\n\n\t\tconst state = { height, vertical_padding, border }\n\n\t\tif (!this.props.menu && this.props.scroll && this.props.options && this.overflown())\n\t\t{\n\t\t\tstate.list_height = this.scrollable_list_height(state)\n\t\t}\n\n\t\tthis.setState(state)\n\t}", "title": "" }, { "docid": "cfc7e5c4041b25e5c8283e2d69581aca", "score": "0.5806209", "text": "function computeHeight(revs) {\n var height = {};\n var edges = [];\n traverseRevTree(revs, function (isLeaf, pos, id, prnt) {\n var rev = pos + \"-\" + id;\n if (isLeaf) {\n height[rev] = 0;\n }\n if (prnt !== undefined) {\n edges.push({from: prnt, to: rev});\n }\n return rev;\n });\n\n edges.reverse();\n edges.forEach(function (edge) {\n if (height[edge.from] === undefined) {\n height[edge.from] = 1 + height[edge.to];\n } else {\n height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);\n }\n });\n return height;\n}", "title": "" }, { "docid": "cfc7e5c4041b25e5c8283e2d69581aca", "score": "0.5806209", "text": "function computeHeight(revs) {\n var height = {};\n var edges = [];\n traverseRevTree(revs, function (isLeaf, pos, id, prnt) {\n var rev = pos + \"-\" + id;\n if (isLeaf) {\n height[rev] = 0;\n }\n if (prnt !== undefined) {\n edges.push({from: prnt, to: rev});\n }\n return rev;\n });\n\n edges.reverse();\n edges.forEach(function (edge) {\n if (height[edge.from] === undefined) {\n height[edge.from] = 1 + height[edge.to];\n } else {\n height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);\n }\n });\n return height;\n}", "title": "" }, { "docid": "710bf73d3ca6a056cecb249d3388028b", "score": "0.5805217", "text": "function computeHeight(revs) {\n var height = {};\n var edges = [];\n traverseRevTree(revs, function (isLeaf, pos, id, prnt) {\n var rev$$1 = pos + \"-\" + id;\n if (isLeaf) {\n height[rev$$1] = 0;\n }\n if (prnt !== undefined) {\n edges.push({from: prnt, to: rev$$1});\n }\n return rev$$1;\n });\n\n edges.reverse();\n edges.forEach(function (edge) {\n if (height[edge.from] === undefined) {\n height[edge.from] = 1 + height[edge.to];\n } else {\n height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);\n }\n });\n return height;\n}", "title": "" }, { "docid": "710bf73d3ca6a056cecb249d3388028b", "score": "0.5805217", "text": "function computeHeight(revs) {\n var height = {};\n var edges = [];\n traverseRevTree(revs, function (isLeaf, pos, id, prnt) {\n var rev$$1 = pos + \"-\" + id;\n if (isLeaf) {\n height[rev$$1] = 0;\n }\n if (prnt !== undefined) {\n edges.push({from: prnt, to: rev$$1});\n }\n return rev$$1;\n });\n\n edges.reverse();\n edges.forEach(function (edge) {\n if (height[edge.from] === undefined) {\n height[edge.from] = 1 + height[edge.to];\n } else {\n height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);\n }\n });\n return height;\n}", "title": "" }, { "docid": "710bf73d3ca6a056cecb249d3388028b", "score": "0.5805217", "text": "function computeHeight(revs) {\n var height = {};\n var edges = [];\n traverseRevTree(revs, function (isLeaf, pos, id, prnt) {\n var rev$$1 = pos + \"-\" + id;\n if (isLeaf) {\n height[rev$$1] = 0;\n }\n if (prnt !== undefined) {\n edges.push({from: prnt, to: rev$$1});\n }\n return rev$$1;\n });\n\n edges.reverse();\n edges.forEach(function (edge) {\n if (height[edge.from] === undefined) {\n height[edge.from] = 1 + height[edge.to];\n } else {\n height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);\n }\n });\n return height;\n}", "title": "" }, { "docid": "797517411fb044711b06253dd628bf03", "score": "0.57814693", "text": "calcHeightAndWidth() {\n var height = 0;\n var widthLeft = 0;\n var widthRight = 0;\n\n this.nodes.getChildren().forEach(n => {\n if (n.config.io === 'output') {\n if (n.text.width() > widthRight) {\n widthRight = n.width();\n }\n }\n else {\n if (n.text.width() > widthLeft) {\n widthLeft = n.width();\n }\n }\n\n if (n.y() + n.text.height() > height) {\n height = n.y() + n.height();\n }\n });\n\n if (widthLeft + widthRight < this.headerText.width()) {\n widthLeft = this.headerText.width() / 2;\n widthRight = this.headerText.width() / 2;\n }\n\n if (this.config.typ === \"Comment\") {\n height = this.commentHeight;\n widthLeft = this.commentWidth / 2;\n widthRight = this.commentWidth / 2;\n }\n\n if (height === 0) {\n height = 100;\n }\n\n if (widthLeft === 0) {\n widthLeft = 100;\n }\n\n if (widthRight === 0) {\n widthRight = 100;\n }\n\n\n\n return {\n height: height,\n widthLeft: widthLeft,\n widthRight: widthRight,\n }\n }", "title": "" }, { "docid": "31bc515e2d50edc9564610c238dc9747", "score": "0.5773302", "text": "CalcHeight() {}", "title": "" }, { "docid": "46d16a7636cc31566c61341cc9994be7", "score": "0.57715684", "text": "function computeHeight(revs) {\n var height = {};\n var edges = [];\n PouchMerge.traverseRevTree(revs, function(isLeaf, pos, id, prnt) {\n var rev = pos + \"-\" + id;\n if (isLeaf) {\n height[rev] = 0;\n }\n if (prnt !== undefined) {\n edges.push({from: prnt, to: rev});\n }\n return rev;\n });\n\n edges.reverse();\n edges.forEach(function(edge) {\n if (height[edge.from] === undefined) {\n height[edge.from] = 1 + height[edge.to];\n } else {\n height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);\n }\n });\n return height;\n}", "title": "" }, { "docid": "ba8456127f494bd754a1588dac3ec280", "score": "0.57646406", "text": "function computeHeight(revs) {\n var height = {};\n var edges = [];\n merge.traverseRevTree(revs, function (isLeaf, pos, id, prnt) {\n var rev = pos + \"-\" + id;\n if (isLeaf) {\n height[rev] = 0;\n }\n if (prnt !== undefined) {\n edges.push({from: prnt, to: rev});\n }\n return rev;\n });\n\n edges.reverse();\n edges.forEach(function (edge) {\n if (height[edge.from] === undefined) {\n height[edge.from] = 1 + height[edge.to];\n } else {\n height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);\n }\n });\n return height;\n}", "title": "" }, { "docid": "ba8456127f494bd754a1588dac3ec280", "score": "0.57646406", "text": "function computeHeight(revs) {\n var height = {};\n var edges = [];\n merge.traverseRevTree(revs, function (isLeaf, pos, id, prnt) {\n var rev = pos + \"-\" + id;\n if (isLeaf) {\n height[rev] = 0;\n }\n if (prnt !== undefined) {\n edges.push({from: prnt, to: rev});\n }\n return rev;\n });\n\n edges.reverse();\n edges.forEach(function (edge) {\n if (height[edge.from] === undefined) {\n height[edge.from] = 1 + height[edge.to];\n } else {\n height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);\n }\n });\n return height;\n}", "title": "" }, { "docid": "718da81960142c87e30ca21be22eb02a", "score": "0.5761921", "text": "get treeMaximumFullLODCount() {}", "title": "" }, { "docid": "eb9268bbb5f86f5cfce10500840de2ad", "score": "0.57598376", "text": "function dfsHeight_(node,arg){\r\n\tvar i;\r\n\tvar children = [];\r\n\tfor(var k=0;k<node.children.length;k++){\r\n\t\tchildren.push(node.children[k]);\r\n\t}\r\n\tfor(var j=0;j<node.unlinkedChildren.length;j++){\r\n\t\tchildren.push(node.unlinkedChildren[j]);\r\n\t}\r\n\t//console.log([node,node.height]);\r\n\tif(children.length==0){\r\n\t\treturn 1;\r\n\t}\r\n\r\n\tfor(i = 0;i<children.length;i++){\r\n\t\tif(arg.visited.indexOf(children[i]) < 0){\r\n\t\t\targ.visited.push(children[i]);\r\n\t\t\tdfsHeight_(children[i],arg);\r\n\t\t\tif(arg.max<children[i].depth){\r\n\t\t\t\targ.max=children[i].depth;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\treturn arg.max - node.depth + 1;\r\n}", "title": "" }, { "docid": "3f44213de72b7f64b4880c1421a0ca74", "score": "0.5755715", "text": "function computeHeight(revs) {\n var height = {};\n var edges = [];\n pouchdbMerge.traverseRevTree(revs, function (isLeaf, pos, id, prnt) {\n var rev$$1 = pos + \"-\" + id;\n if (isLeaf) {\n height[rev$$1] = 0;\n }\n if (prnt !== undefined) {\n edges.push({from: prnt, to: rev$$1});\n }\n return rev$$1;\n });\n\n edges.reverse();\n edges.forEach(function (edge) {\n if (height[edge.from] === undefined) {\n height[edge.from] = 1 + height[edge.to];\n } else {\n height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);\n }\n });\n return height;\n}", "title": "" }, { "docid": "da3385898cf0302ed7744fd8091eff48", "score": "0.5749614", "text": "constructor () { super('TreeHeight', ['ft', 'm']) }", "title": "" }, { "docid": "afd6ad282eef265453d198da450d9d9a", "score": "0.57441664", "text": "height() {\n return this.root !== null ? this.root.height : 0;\n }", "title": "" }, { "docid": "909dd10b6830925be7b3c326939fd40f", "score": "0.5730329", "text": "updateHeights() {\n const relativeSpace = 0.1;\n // Only get totalChartHeight once: afterwards we update chart.height to a string (e.g.\n // '50%', adding up won't work any more); add 0.05 for spacing between charts\n const totalHeight = this.getTotalChartHeight() + this.charts.length * relativeSpace;\n // Update heights (from relations to percentages); previous value is used as top position\n // of current chart\n const percentageBasedSpace = relativeSpace / totalHeight;\n this.charts.reduce((topPosition, chart) => {\n const height = chart.height / totalHeight;\n debug('Height %o of total %o, was %o', chart.height, totalHeight, chart.height);\n chart.height = Math.floor(height * 100) + '%';\n chart.top = Math.floor(topPosition * 100 + percentageBasedSpace) + '%';\n return topPosition + height + percentageBasedSpace;\n }, 0);\n\n }", "title": "" }, { "docid": "1b9d8381010b9235f884637ecb03baf7", "score": "0.57121754", "text": "function getHeight (node, height) {\n height = height+1\n if(!node.l && !node.r){\n if(debug)console.log(`${node.v} isa leaf w height ${height}`)\n // is leaf\n minHeight = height < minHeight ? height : minHeight\n maxHeight = height > maxHeight ? height : maxHeight\n } else {\n if(debug)console.log(`${node.v} not leaf`)\n // recurse\n if(node.l) getHeight(node.l, height)\n if(node.r) getHeight(node.r, height)\n }\n }", "title": "" }, { "docid": "998737bc1db11c5feda6b3e30dab0a2d", "score": "0.56935227", "text": "updateHeight() {\n if (this.left !== null && this.right !== null) {\n this.height = Math.max(this.left.height, this.right.height) + 1;\n }\n else if (this.right !== null) {\n this.height = this.right.height + 1;\n }\n else if (this.left !== null) {\n this.height = this.left.height + 1;\n }\n else {\n this.height = 0;\n }\n }", "title": "" }, { "docid": "d0477628644106cf16af3d764c6466e5", "score": "0.5689159", "text": "height(i) {\n let h = 0\n let j = i\n while (this.heap[this.left(j)]) {\n j = this.left(j)\n h++\n\n }\n return h\n }", "title": "" }, { "docid": "9cadb73335ec77ee3d70db6d0e9b58a5", "score": "0.56585324", "text": "function update(source) {\n // Compute the new height, function counts total children of root node and sets tree height accordingly.\n // This prevents the layout looking squashed when new nodes are made visible or looking sparse when nodes are removed\n // This makes the layout more consistent.\n var levelHeight = [1];\n var childCount = function(level, n) {\n if (n.children && n.children.length > 0) {\n if (levelHeight.length <= level + 1) levelHeight.push(0);\n\n levelHeight[level + 1] += n.children.length;\n n.children.forEach(function(d) {\n childCount(level + 1, d);\n });\n }\n };\n\t\tchildCount(0, root);\n\t\tvar maxLevel = levelHeight.length+2;\n\n // add pre-terminal nodes (these will be transparent)\n function add_preterminals(t) {\n if ('touched' in t) return;\n t.touched = true;\n if ('children' in t) {\n t.children.forEach(add_preterminals)\n } else {\n t.children = [{\"name\":t.name, \"s\":t.s,\"e\":t.e,\"sid\":t.sid,\"eid\":t.eid}]\n t.name = \"\";\n t.eid = -1;\n t.sid = -1;\n }\n }\n add_preterminals(root)\n\n // Compute the new tree layout.\n var nodes = tree.nodes(root);\n // determine node positions: leafs are spaces nicely, and then each\n // non-terminal is in the middle of its span.\n var nodeStartToX = {}\n var nodeEndToX = {}\n var dummy = baseSvg.append(\"text\");\n var start_pos = 0\n // determine the X positions for the leafs.\n nodes.filter(n=>!('children' in n)).forEach((n,i)=>{\n console.log(n.name,\"start pos\",start_pos)\n nodeStartToX[n.s] = start_pos;\n start_pos += dummy.text(n.name).node().getComputedTextLength()\n nodeEndToX[n.e] = start_pos;\n start_pos += 10; // spacing\n });\n dummy.remove()\n // Set heights between levels based on maxLevel.\n // determine the y position of non-terms, and based on that also of leafs.\n var lowest_nonterm = 0;\n nodes.filter(d=>'children' in d).forEach(function(d,i) {\n d.y = (d.depth * ((viewerHeight-300)/(maxLevel)));\n if (d.y > lowest_nonterm) lowest_nonterm = d.y;\n s = nodeStartToX[d.s];\n e = nodeEndToX[d.e];\n d.x = (s+e)/2;\n });\n tree_baseline = lowest_nonterm + 10;\n\n // set actual positions of leafs\n nodes.filter(d=>!('children' in d)).forEach(function(d,i) {\n //d.y = viewerHeight-50; \n d.y = tree_baseline;\n d.x = nodeStartToX[d.s] + (nodeEndToX[d.e] - nodeStartToX[d.s])/2\n });\n\n // determine the links based on the nodes.\n links = tree.links(nodes);\n // Update the nodes…\n node = svgGroup.selectAll(\"g.node\")\n .data(nodes, function(d) {\n return d.id || (d.id = ++i);\n });\n\n // Enter any new nodes at the parent's previous position.\n var nodeEnter = node.enter().append(\"g\")\n .attr(\"class\", \"node\")\n .attr(\"transform\", function(d) {\n return \"translate(\" + source.x0 + \",\" + source.y0 + \")\";\n })\n\n // draw the nodes\n\t\tnodeEnter.append(\"rect\")\n\t\t\t.attr('class', 'nodeRect')\n\t\t\t// Size of the rectangle/2\n\t\t\t.attr(\"x\", function(d){return -(d.name.length*5+10)/2})\n\t\t\t.attr(\"y\", -10)\n\t\t\t.attr(\"width\", 0)\n\t\t\t.attr(\"height\", 0)\n\t\t\t.style(\"fill\", function(d) {\n\t\t\t return d._children ? \"lightsteelblue\" : \"#fff\";\n\t\t});\n\n nodeEnter.append(\"text\")\n .attr(\"y\", 0)\n .attr(\"dy\", \".35em\")\n .attr('class', 'node')\n .attr(\"text-anchor\", \"middle\")\n .text(function(d) {\n return d.name;\n })\n .style(\"fill-opacity\", 1);\n\n // Update the text to reflect whether node has children or not.\n node.select('text')\n .attr(\"y\", 0)\n .attr(\"text-anchor\", \"middle\")\n .text(function(d) {\n return d.name;\n });\n\n node.select(\"rect.nodeRect\")\n .attr(\"width\", function(d) {\n\t\t\t\t// Adjust the size of the square according to the label\n return d.children || d._children ? d.name.length*5+10 : d.name.length*5+10;\n })\n .attr(\"height\", function(d) {\n if (d.name == \"\") return 0;\n return d.children || d._children ? 20 : 20;\n })\n .style(\"fill\", function(d) {\n return d._children ? \"lightsteelblue\" : \"#fffff\";\n });\n\n // Transition nodes to their new position.\n var nodeUpdate = node.transition()\n .duration(duration)\n .attr(\"transform\", function(d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n\n // Fade the text in\n nodeUpdate.select(\"text\")\n .style(\"fill-opacity\", 1);\n\n // Transition exiting nodes to the parent's new position.\n var nodeExit = node.exit().transition()\n .duration(duration)\n .attr(\"transform\", function(d) {\n return \"translate(\" + source.x + \",\" + source.y + \")\";\n })\n .remove();\n\n nodeExit.select(\"circle\")\n .attr(\"r\", 0);\n\n nodeExit.select(\"text\")\n .style(\"fill-opacity\", 1);\n\n // Update the links…\n var link = svgGroup.selectAll(\"path.link\")\n .data(links, function(d) {\n return d.target.id;\n });\n\n // Enter any new links at the parent's previous position.\n link.enter().insert(\"path\", \"g\")\n .attr(\"class\", \"link\")\n\t\t\t//TODO MARKERS LOOK TERRIBLE\n\t\t\t// .attr(\"marker-end\", \"url(#markerArrow)\")\n .attr(\"d\", function(d) {\n var o = {x: source.x, y: source.y};\n return diagonal({source: o,target: o});\n });\n\t\t\t// TODO doesn't work with the transition\n\t\t\t// .attr(\"d\", straightLine);\n\n // Transition links to their new position.\n link.transition()\n .duration(duration)\n .attr(\"d\", diagonal);\n\t\t\t// TODO doesn't work with the transition\n // .attr(\"d\", straightLine);\n\n // Transition exiting nodes to the parent's new position.\n link.exit().transition()\n .duration(duration)\n .attr(\"d\", function(d) {\n var o = {x: source.x, y: source.y};\n return diagonal({source: o,target: o});\n })\n\t\t\t// TODO doesn't work with the transition\n\t\t\t// .attr(\"d\", straightLine)\n .remove();\n\n // Stash the old positions for transition.\n nodes.forEach(function(d) {\n d.x0 = d.x;\n d.y0 = d.y;\n });\n return nodes;\n }", "title": "" }, { "docid": "ab0e2489fdb9ba8ee108065e012cbf94", "score": "0.56422806", "text": "height(current = this.root) {\n if (!current) {\n return 0;\n }\n\n return 1 + Math.max(this.height(current.right), this.height(current.left));\n }", "title": "" }, { "docid": "d41dbd10d9085f55234ed6e7a7b7076e", "score": "0.5624684", "text": "updateHeight() {\n if (this.left !== null && this.right !== null) {\n this.height = Math.max(this.left.height, this.right.height) + 1;\n } else if (this.right !== null) {\n this.height = this.right.height + 1;\n } else if (this.left !== null) {\n this.height = this.left.height + 1;\n } else {\n this.height = 0;\n }\n }", "title": "" }, { "docid": "3120c9bd75a865a4ba4401c56b667299", "score": "0.5621589", "text": "function computeNodeBreadths() {\n nodes.forEach(function(node){\n node.x = node.pos * nodeOffset;////pos is in the Json data jixiangyu \n node.dx = nodeWidth;\n });\n }", "title": "" }, { "docid": "7c599c9a2cd2126106b87e2fd5aed879", "score": "0.56006294", "text": "function resizeHeight() {\n if ($('#console-page').hasClass('collapsed')) {\n return; // Don't do anything in collapsed mode.\n }\n // Find the row height using the first console-cell-container of\n // each console-leaf-category.\n var rowHeight = 200; // Minimum height.\n // Find the max height of each of the leaf category rows.\n $('.console-leaf-category').each(function() {\n const thisContainer = $('.console-build-column-stacked .console-cell-container-inner').first();\n const thisHeight = thisContainer.height();\n if (thisHeight > rowHeight) rowHeight = thisHeight;\n });\n\n // Now set all cells to be the same height, as well as commit descriptions;\n $('.console-cell-container').height(rowHeight);\n $('.console-commit-item').each(function() {\n $(this).height(rowHeight - 1); // 1px for the border.\n const desc = $(this).find('.console-commit-description').first();\n const text = desc.find('p').first();\n const isClipped = desc.height() < text.height();\n // Add a class if the commit description is clipped,\n // so that we can render a fadeout.\n $(this).toggleClass('bottom-hidden', isClipped);\n });\n\n // Also set the width of the horizontal cell separator.\n var width = 0;\n $('#console>.console-column').each(function() {width += $(this).width();});\n $('.console-commit-item-overlay').width(width);\n }", "title": "" }, { "docid": "557bdcc4f502a55172832380134b2061", "score": "0.5586943", "text": "function getHeight() {\n return height;\n }", "title": "" }, { "docid": "badf74f72b4d471185ddb10f095038fd", "score": "0.55828375", "text": "get size() {\n return this.tree.size;\n }", "title": "" }, { "docid": "12c0229c7c1139b5142747bd4388002b", "score": "0.5565117", "text": "getTotalChildMarginHeights() {\n let height = 0;\n for (let i = 0; i < this._children.length; i++) {\n let child = this._children[i];\n if (i < this._children.length - 1) {\n height += Math.max(child._marginBottom, this._children[i + 1]._marginTop);\n }\n }\n return height;\n }", "title": "" }, { "docid": "8ae13b73e11e02a6f9aabd78e72ad13c", "score": "0.5560707", "text": "function BSTHeight(tree) {\n if (!tree) {\n return 0;\n } else {\n let left = BSTHeight(tree.left);\n let right = BSTHeight(tree.right);\n\n if (left > right) {\n return left + 1;\n } else return right + 1;\n }\n}", "title": "" }, { "docid": "e93b9df48ffc64c7b6867b0f555052a9", "score": "0.55572367", "text": "function bstHeight(bst) {\n if(!bst) {\n return null\n }\n let countL = bstHeight(bst.left)\n let countR = bstHeight(bst.right)\n //add one each recursion\n if(countL > countR){\n return countL + 1\n } else {\n return countR + 1\n }\n }", "title": "" }, { "docid": "6a9d1894e43a33bb025510be5cc551b3", "score": "0.5551036", "text": "function getHeight(startingHeight, n) {\n\tvar height = startingHeight\n\tconsole.log('starting height',startingHeight)\n\tfor (var i = 0; i<n; i++) {\n\t\tif (i%2 === 0) {\t// double\n\t\t\tconsole.log('double')\n\t\t\theight = 2*height\n\t\t} else { // add 1\n\t\t\tconsole.log('add 1')\n\t\t\theight += 1\n\t\t}\n\t\tconsole.log('it',i,'height',height)\n\t}\n\treturn height\n}", "title": "" }, { "docid": "48a789b787aeee1d6bb9a3e275f277be", "score": "0.55432135", "text": "treeDensity() {\r\n const density = this.numTrees / this.area;\r\n // Koristimo template string za prikaz u konzoli\r\n console.log(`${this.name} has a tree density of ${density} trees per square km.`);\r\n }", "title": "" }, { "docid": "4d8e536e27989b1070cd0adc3414de64", "score": "0.55376655", "text": "get nodeCount() {\n let count = 1;\n\n if (this.children.size) {\n this.children.forEach((val) => {\n count += val.nodeCount;\n });\n }\n\n return count;\n }", "title": "" }, { "docid": "f23500707b6c7e8f8a49d90d95db259e", "score": "0.5521597", "text": "function equalizeReportHeight(){\n\tvar currentTab = $('#' + currentReportTab);\n\tif ( $(\".leftTree\", currentTab).length > 0 ){\n\t\tvar rightHeight = parseInt($(\".rightReportWrapper\", currentTab).height(), 10);\n\t\t$(\".leftTreeWrapper\", currentTab).css({\n\t\t\t\"min-height\": (rightHeight - 24)\n\t\t});\n\t}\n}", "title": "" }, { "docid": "b600c4dd899416252140bbbd6b53ba11", "score": "0.551981", "text": "height(root) {\n if (!root) {\n return -1;\n }\n\n if (this.isLeaf(root)) {\n return 0;\n }\n\n // Post order, visiting leaves first\n return Math.max(this.height(root.leftChild) + this.height(root.rightChild));\n }", "title": "" }, { "docid": "079cbffcd1d9149effc70eef82eba30c", "score": "0.5499759", "text": "function utopianTree(growthCycles){\n let height = 1;\n let isSpring = true;\n while(growthCycles > 0){\n if (isSpring) height *= 2;\n else height += 1;\n isSpring = !isSpring;\n growthCycles--;\n }\n return height;\n}", "title": "" }, { "docid": "9cadc6d55b1fd3c26e48e5162e819a55", "score": "0.5476872", "text": "getHeight(node = this.root) { if(!node) {\n return -1;\n }\n let left = this.getHeight(node.left);\n let right = this.getHeight(node.right);\n \n return Math.max(left, right) + 1;\n }", "title": "" }, { "docid": "b453a541aaeab3065ae544de3c97f490", "score": "0.5467589", "text": "function depthInfo($dd) {\n $label = $dd.children(\".nav_group_title\").find(\".item_label p\");\n $dl = $dd.children(\"dl\");\n count = $dl.children(\"dd\").length;\n if($dl.children(\"dd.add_page\").length) { count--; };\n $label.find(\".active_mode\").first().before(\"<small class='pages_count'>(\" + count + \")</small>\");\n $dl.children(\"dd.folder\").each(function() { depthInfo($(this)); });\n }", "title": "" }, { "docid": "5f99fada4975779dcb9e5c4be131ca52", "score": "0.5467587", "text": "function printTree() {\n console.log('Tree: ');\n console.log();\n\n for(var [key, value] of visitedPages) {\n console.log(key);\n console.log(' Children: ');\n for (let index = 0; index < value.children.length; index++) {\n console.log(value.children[index]);\n }\n\n console.log('\\n');\n }\n}", "title": "" }, { "docid": "7949d54c32e34b6f5d5308923cb8d32d", "score": "0.5456307", "text": "function draw() {\n\n background('#6495ED'); //cornflower blue #6495ED\n\n //draw all the branches of the tree array\n for (var i = 0; i < tree.length; i++) {\n tree[i].show();\n\n //debugBranches(tree[i]); //displays attribues next to branges, not as usefull as console printing it but still;\n }\n\n //draw the leaves\n var leaveSize = 0;\n paramNoiseOffsets += offSetStep;\n for (var i = 0; i < leaves.length; i++) {\n //offsets for leaves color, ranges keep in\n paramNoiseOffsets += offSetStep;\n var r = Math.round(getRandomIntInclusive(51, 204));\n paramNoiseOffsets += offSetStep;\n var g = Math.round(getRandomIntInclusive(102, 255));\n paramNoiseOffsets += offSetStep;\n var b = Math.round(getRandomIntInclusive(0, 26));\n\n fill('rgb( ' + r + ', ' + g + ',' + b + ' )');\n noStroke(); //no outline\n leaveSize = Math.round(getRandomIntInclusive(4, 15));\n ellipse(leaves[i].x, leaves[i].y, leaveSize, leaveSize);\n }\n\n //debugGraphs(); //enable to draw graphis, helped a bit when debugging;\n noLoop(); // looping disabled, so it only draws it once\n}", "title": "" }, { "docid": "9915b310a3052f13d2142db024708f03", "score": "0.5453659", "text": "function divideTree(){\r\n\t\t\r\n\t}", "title": "" }, { "docid": "701c4f98d8baa9a68386ea7b0e66185f", "score": "0.5427785", "text": "get height() {}", "title": "" }, { "docid": "701c4f98d8baa9a68386ea7b0e66185f", "score": "0.5427785", "text": "get height() {}", "title": "" }, { "docid": "22c7ec85f7a89dc5dd03a81d6e230bd8", "score": "0.5424241", "text": "get treeBillboardDistance() {}", "title": "" }, { "docid": "afbae7754213bba1d94f60ce619dd4e9", "score": "0.54210067", "text": "function displayTree(tree) {\n\n return inspect(tree, false, 20, true);\n}", "title": "" }, { "docid": "1ad4bc0b8f624f32830a13433a3ce206", "score": "0.5420855", "text": "static handleHeight() {\n $('[data-auto-height]').each(function () {\n var parent = $(this);\n var items = $('[data-height]', parent);\n var height = 0;\n var mode = parent.attr('data-mode');\n var offset = parseInt(parent.attr('data-offset') ? parent.attr('data-offset') : 0);\n\n items.each(function () {\n if ($(this).attr('data-height') == \"height\") {\n $(this).css('height', '');\n } else {\n $(this).css('min-height', '');\n }\n\n var height_ = (mode == 'base-height' ? $(this).outerHeight() : $(this).outerHeight(true));\n if (height_ > height) {\n height = height_;\n }\n });\n\n height = height + offset;\n\n items.each(function () {\n if ($(this).attr('data-height') == \"height\") {\n $(this).css('height', height);\n } else {\n $(this).css('min-height', height);\n }\n });\n\n if (parent.attr('data-related')) {\n $(parent.attr('data-related')).css('height', parent.height());\n }\n });\n }", "title": "" }, { "docid": "891ce96aecd90299a9d05581d66a4173", "score": "0.54177815", "text": "function displayChildren() {\n containerComb.selectAll(\"g.node\").each(function (d, i) {\n if (d.depth + 1 == number && !d.children) {\n d.children = d._children;\n d._children = null;\n } else if (d.depth == number) {\n d._children = d.children;\n d.children = null;\n }\n });\n }", "title": "" }, { "docid": "613e77314bdddfe576a153fad087e40f", "score": "0.5416394", "text": "treeHeight(node) {\n\n // if trees is empty return 0\n if (!node) {\n return 0;\n } else {\n\n //check length of the tree on left side\n var leftHeight = this.treeHeight(node.left);\n\n //check length of the tree on right side\n var rightHeight = this.treeHeight(node.right);\n\n //get maximum length of the tree from left or right node's lenght\n var maxHeight = Math.max(leftHeight, rightHeight) + 1;\n\n return maxHeight;\n }\n }", "title": "" }, { "docid": "9b38a78e85720b46d4db0ca0aa307478", "score": "0.5416298", "text": "height(root) {\n if (!root) {\n return 0;\n }\n let leftHeight = root.height(root.left);\n let rightHeight = root.height(root.left);\n return Math.max(leftHeight, rightHeight) + 1;\n }", "title": "" }, { "docid": "0837c1743d5419a490b4ede9603f0b39", "score": "0.54081285", "text": "get treeCrossFadeLength() {}", "title": "" }, { "docid": "8eb9a8fe6eff3276a850296026cf1c00", "score": "0.54066557", "text": "function nodeDepths(root) {\n\t// Write your code here.\n}", "title": "" }, { "docid": "cfea3a315af6d902f6f8508b456aa7d0", "score": "0.5380173", "text": "size() {\n\t\treturn this._size(this.root);\n\t}", "title": "" }, { "docid": "f1ad7c10b5de54ea66d40a0f9921c764", "score": "0.53793347", "text": "function visitTree(node) {\n node.leafCount = 0;\n if (node.children.length === 0) {\n node.leafCount++;\n return;\n }\n for (var i = 0; i < node.children.length; i++) {\n visitTree(node.children[i]);\n node.leafCount += node.children[i].leafCount;\n }\n // Remove total if there is only one child outside of the total\n if (node.children.length == 2 && node.children[0].isTotal) {\n node.children.shift();\n node.leafCount--;\n }\n }", "title": "" }, { "docid": "eb5bfccc32aff956b59e238d5b496073", "score": "0.53718644", "text": "function drawTrees() {\n for (let i = 0; i < treeRoots.length; i++) {\n drawTree(i);\n }\n}", "title": "" }, { "docid": "2839b6f6605d541b92682f30c8c9ff0e", "score": "0.5371603", "text": "function unifyGrid() {\n var maxHeight = -1;\n\n $('.heightblock').each(function() {\n var inner = $(this).children('.innerheight');\n maxHeight = maxHeight > inner.height() ? maxHeight : inner.height();\n });\n $('.heightblock').each(function() {\n $(this).height(maxHeight);\n //console.log(maxHeight);\n });\n}", "title": "" }, { "docid": "362cebf85c153c12422e9057ae292000", "score": "0.5367009", "text": "size() {\n return this._size(this.root)\n }", "title": "" }, { "docid": "5397d37d6fd12a88e517e25832a09e40", "score": "0.5365335", "text": "getLinesTotalHeight() {\r\n let linesHeight = this._lineHeight * this._lineCount;\r\n let whitespacesHeight = this._whitespaces.getTotalHeight();\r\n return linesHeight + whitespacesHeight;\r\n }", "title": "" }, { "docid": "2bab500a8365bb100fdb9e6daf678db3", "score": "0.5362911", "text": "function drawTree(seed) {\r\n branchCount = 0;\r\n treeGrow += 0.02;\r\n randSeed(seed);\r\n maxTrunk = randSI(trunkMin, trunkMax);\r\n drawBranch(canvas.width / 2, canvas.height, -Math.PI / 2, canvas.height / 5, maxTrunk);\r\n}", "title": "" }, { "docid": "c515df134e30046a520863c7d7ec7a2e", "score": "0.53575605", "text": "function finalTraversal(node, depth, totalDepth) {\n depth++;\n if (!node.children) { // If no Children\n //alert(JSON.stringify(node));\n var p = $(document.createElement('p'));\n p.css(\"display\", \"inline-block\");\n p.css(\"font-size\", \"12px\");\n p.text(node.text.title);\n p.attr(\"id\", \"p1\");\n $(\"body\").append(p);\n var width = $('#p1').width();\n $('#p1').remove();\n\n //height = 50*(1+(totalDepth-depth));\n height = 30;\n width = Math.ceil(width); //Ceiling of width in pixels\n width += 10; //Min width\n if (width % 2 != 0) {\n width++;\n }\n var a = '<p><b>' + node.text.name + '</b></p><svg width=\"';\n var b = '\" height=\"' + height + '\"><polygon points=\"';\n var c = ',1 0,' + height + ' ';\n var d = ',' + height + ' \"style=\"fill:white;stroke:black;stroke-width:1;fill-rule:evenodd;\" />SVG Not supported.</svg><p>' + node.text.title + '</p>';\n var total = a + String(width) + b + String(width / 2) + c + String(width) + d; //Generate triangle and text below\n delete node.text;\n node.innerHTML = total;\n node.HTMLclass = 'nodeExample2';\n return node;\n } else {\n var numChild = node.children.length;\n for (var h = 0; h < numChild; h++) {\n node.children[h] = finalTraversal(node.children[h], depth, totalDepth);\n }\n return node;\n }\n }", "title": "" }, { "docid": "fbf44676f19a22a4a7b795c5eb5abd3a", "score": "0.5348449", "text": "function checkNumChangesPerBranch() {\r\n let numBranches = mesh.getNumBranches();\r\n for (let i = 0; i < numBranches; i++) {\r\n let numSubBranches = mesh.getNumBranches(i);\r\n for (let j = 0; j < numSubBranches; j++) {\r\n loadMeSH(i, j);\r\n app.render();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "cde107f08c2d4d2489a64dc7c809717b", "score": "0.5347228", "text": "function scaleBranchLengths(nodes, w) {\n var visitPreOrder = function(root, callback) {\n var i;\n callback(root);\n if (root.children) {\n for (i = 0; i < root.children.length; i += 1) {\n visitPreOrder(root.children[i], callback);\n }\n }\n };\n\n visitPreOrder(nodes[0], function(node) {\n node.rootDist = (node.parent ? node.parent.rootDist : 0) + (node.length);\n var myHeight = node.height;\n var parentHeight = node.parent ? node.parent.height : 0;\n var diff = myHeight - parentHeight;\n if (diff > 0) {\n console.log(panelID + \" \" + diff);\n }\n //removed 0 as the default node length. all branches should have length specified\n });\n \n //development time check for consistency between heights and lengths\n console.log(panelID + \" height span \" + (maxHeight - minHeight));\n\n var rootDists = nodes.map(function(n) { return n.rootDist; });\n \n console.log(panelID + \" length span \" + d3.max(rootDists));\n \n var outScale = d3.scale.linear()\n .domain([0, d3.max(rootDists)])\n .range([0, w]);\n\n return outScale;\n }", "title": "" }, { "docid": "716241ff352211995ca64724fa5f91a8", "score": "0.5341245", "text": "familySize() {\n if (this.children.length !== 0) {\n let childSize = this.children.length;\n //console.log(\"childSize\", childSize.length);\n return 1 + childSize;\n }\n return 1;\n }", "title": "" }, { "docid": "9f032731f2d6750e58424fa1ca5ac14c", "score": "0.5337173", "text": "function getHeight(node){\n if(node == null)\n return 0;\n else {\n return Math.max(getHeight(node.left),getHeight(node.right)) + 1;\n }\n }", "title": "" }, { "docid": "993b40a859ac758b670b1ba145d6d3ef", "score": "0.53369963", "text": "function outputCounts() {\n tree.updateCounts();\n process.stdout.write(\n (elapsed ? (`${elapsed} | `) : ``) + getCounts()\n );\n }", "title": "" }, { "docid": "29f509867ceec61cfe4c4ebc8c023c75", "score": "0.533385", "text": "function handleDepthValue(depth){\n\t//if(data.deap){\n\t\tvar depth_presize = ((depth % 1));\n\t\tif (!(depth_presize<0.5)) {\n\t\t\tdepth_presize-=1;\n\t\t}\n\t\tdocument.getElementById(\"depth_1\").innerHTML = ((Math.round(depth-3)).toString());\n\t\tdocument.getElementById(\"depth_2\").innerHTML = ((Math.round(depth-2)).toString());\n\t\tdocument.getElementById(\"depth_3\").innerHTML = ((Math.round(depth-1)).toString());\n\t\tdocument.getElementById(\"depth_4\").innerHTML = ((Math.round(depth)).toString());\n\t\tdocument.getElementById(\"depth_5\").innerHTML = ((Math.round(depth+1)).toString());\n\t\tdocument.getElementById(\"depth_6\").innerHTML = ((Math.round(depth+2)).toString());\n\t\tdocument.getElementById(\"depth_7\").innerHTML = ((Math.round(depth+3)).toString());\n\t\t$(\".depth_1\").css(\"font-size\", 6 - 8*(depth_presize));\n\t\t$(\".depth_2\").css(\"font-size\", 14 - 6*(depth_presize));\n\t\t$(\".depth_3\").css(\"font-size\", 20 - 12*(depth_presize));\n\t\t$(\".depth_4\").css(\"font-size\", 32 - 12*Math.abs(depth_presize));\n\t\t$(\".depth_5\").css(\"font-size\", 20 + 12*(depth_presize));\n\t\t$(\".depth_6\").css(\"font-size\", 14 + 6*(depth_presize));\n\t\t$(\".depth_7\").css(\"font-size\", 6 + 8*(depth_presize));\n\t//}\n}", "title": "" }, { "docid": "38528462ca1b01741530c03655be365f", "score": "0.53263146", "text": "get calculatedItemHeight() {\n const firstNode = this.findFirstNode();\n const { calculatedItemMarginTop, calculatedItemMarginBottom } = this;\n const height = firstNode ?\n parseInt(getComputedStyle(firstNode).height, 10) : 0;\n return calculatedItemMarginTop + height + calculatedItemMarginBottom;\n }", "title": "" }, { "docid": "33b5d46c15608f6d4b0ef690fc28ba1f", "score": "0.5320153", "text": "function nodeSizeFunc(d) {\n if (d.is_root) {\n return 15.0;\n } else if (d._children) {\n return 15.0 * (d.n_children / (d.n_children + 50));\n } else if (d.children) {\n return 15.0 * (d.n_children / (d.n_children + 100));\n } else {\n return 5.0;\n }\n }", "title": "" }, { "docid": "a3e955abdd670060ee1fd095fc902361", "score": "0.53165084", "text": "size(count=0, node=this.root){\n if(node){\n console.log(\"Current Node:\", node.value)\n count++;\n console.log(\"Current count:\", count)\n if(node.left){\n count++\n console.log(\"Node to the left:\", node.left.value)\n this.size(count, node.left);\n }\n if(node.right){\n count++\n console.log(\"Node to the right:\", node.right.value)\n this.size(count, node.right);\n }\n }\n // console.log(\"Count one\", count_one, \"Count two\", count_two, \"sum\", );\n return count\n }", "title": "" }, { "docid": "ba7bb168be72c49f08e6ba3b066d60c1", "score": "0.5314994", "text": "function getHeight() {\n // get the entire height of all html (including not the viewable)\n return document.documentElement.scrollHeight;\n}", "title": "" }, { "docid": "a6981913737d0b8b366b4c8cf67cb60f", "score": "0.5312165", "text": "function getHeight(baseUrl, cb) {\n\tnodeStatus(baseUrl, (err, res) => {\n\t\tif (err) {\n\t\t\treturn setImmediate(cb, err);\n\t\t}\n\t\treturn setImmediate(cb, null, res.height);\n\t});\n}", "title": "" }, { "docid": "a6130b97b953cdbfabf0ec935b57cede", "score": "0.53095686", "text": "countDescendants() {\n this.children.forEach(child => {\n if (child instanceof ToyVDom) {\n this.count += child.countDescendants()\n } \n this.count++\n })\n return this.count\n }", "title": "" }, { "docid": "9892957079c5d42159bf78414fd61e7e", "score": "0.53084284", "text": "get treeDistance() {}", "title": "" }, { "docid": "9e3bc37d0854e6be0062d19e09295ae0", "score": "0.5307157", "text": "function printBranches(branchLen, nodeSpaceLen, startLen, nodesInThisLevel, nodesQueue) {\n var cont = 0;\n \n for (var i = 0; i < parseInt(nodesInThisLevel / 2) ; i++) {\n out += ((i == 0) ? setw(startLen - 1) : setw(nodeSpaceLen - 2)) + \"\" + ((nodesQueue[cont++]) ? \"/\" : \" \");\n out += setw(2 * branchLen + 2) + \"\" + ((nodesQueue[cont++]) ? \"\\\\\" : \" \");\n }\n \n out += (parseInt(nodesInThisLevel / 2) == 0) ? \"\" : \"\";\n}", "title": "" } ]
6016c356ed8506e69378e58211473917
Array like: has length property, is numerically indexed and mutable. TODO: try to detect objects with length property but no indexed data elements
[ { "docid": "d47e4c1042ed6036429bb2129a47c593", "score": "0.0", "text": "function isArrayLike(obj) {\n if (!obj) return false;\n if (isArray(obj)) return true;\n if (isString(obj)) return false;\n if (obj.length === 0) return true;\n if (obj.length > 0) return true;\n return false;\n }", "title": "" } ]
[ { "docid": "d8de3f2014f3472033126f8f59ba4ddd", "score": "0.68133515", "text": "function isArray( obj ) { return ( obj && typeof obj === OBJECT && typeof obj.length === NUMBER && !( obj.propertyIsEnumerable( LENGTH ) ) ); }", "title": "" }, { "docid": "ff37ae356c637f45b8c5a84501509090", "score": "0.6684396", "text": "function CustomArray(){\n Object.defineProperty(this, \"length\",{\n value : 0,\n writable: true,\n enumerable:false\n })\n}", "title": "" }, { "docid": "c788c745ab57c266e16f26c31896f842", "score": "0.6682608", "text": "function test_ARRAYS_MODIFY_READONLY() {\n var x = [];\n try {\n Object.defineProperty(x, 'length', {value: 0, writable: false});\n x[0] = 1;\n } catch(e) {}\n return x.length !== 0 || x[0] !== void 0;\n }", "title": "" }, { "docid": "77efe0913d94070015154031eb2a8919", "score": "0.66707534", "text": "function CustomArray(){\n Object.defineProperty(this,\"length\",{\n value : 0,\n writable: true,\n enumerable:false\n })\n}", "title": "" }, { "docid": "be5413ca97119ca2a917451901c3d77a", "score": "0.6494889", "text": "get length() {\n return this._array.length;\n }", "title": "" }, { "docid": "4744cde2bac7383665f65eb051e3f092", "score": "0.6351398", "text": "function isArray(obj) {\n\treturn obj && !(obj.propertyIsEnumerable('length')) \n\t\t&& typeof obj === 'object' \n\t\t&& typeof obj.length === 'number';\n}", "title": "" }, { "docid": "add26c7bf26949b0ad346e783bfc0be9", "score": "0.6290832", "text": "function test_ARRAY_LENGTH_MUTABLE() {\n for (var i = 0; i < 2; i++) { // Only shows up the second time\n var x = [1,2];\n Object.freeze(x);\n try {\n // Call the unrepaired Array.prototype.push which is known to trigger\n // the internal mutability bug (whereas e.g. repair_PUSH_IGNORES_SEALED\n // would hide it). This is being used as a test mechanism and not\n // because the bug is in push.\n unrepairedArrayPush.call(x, 3);\n } catch (e) {\n // Don't care whether or not push throws; if it does not mutate and\n // does not throw, that's a bug but not this bug.\n }\n if (x.length === 3 && x[0] === 1 && x[1] === 2 && x[2] === 3) {\n // Behavior seen on Safari 5.1.9 (6534.59.8)\n return true;\n }\n if (x[0] !== 1 || x[1] !== 2 || x[2] !== undefined) {\n return 'Unexpected modification to elements of array';\n }\n if (x.length === 3) { return true; }\n if (x.length !== 2) {\n return 'Unexpected modification to length of array';\n }\n }\n return false;\n }", "title": "" }, { "docid": "f551b4edb32a15a28c4cb8354417eea1", "score": "0.62847763", "text": "function is_array_like(obj) {\r\n return Array.isArray(obj) ||\r\n typeof obj == 'object' && \"length\" in obj && typeof obj.length == 'number'\r\n }", "title": "" }, { "docid": "d7f69da401e6bb2d225c17c7aea50618", "score": "0.6236271", "text": "function likeArray(obj) {\n var length = !!obj && \"length\" in obj && obj.length;\n var type = $.type(obj);\n \n return (\n \"function\" !== type && \n !isWindow(obj) && \n (\"array\" === type || length === 0 ||\n (typeof length === \"number\" && length > 0 && length - 1 in obj))\n );\n}", "title": "" }, { "docid": "42362eaa0dcff1d4349f57dd95ded578", "score": "0.62059987", "text": "get size() {\n return this._arr.length;\n }", "title": "" }, { "docid": "42362eaa0dcff1d4349f57dd95ded578", "score": "0.62059987", "text": "get size() {\n return this._arr.length;\n }", "title": "" }, { "docid": "cca6650e2ec4f85ff36f1e50a47ec7f6", "score": "0.61880904", "text": "function MyArray() {\n this.length = 0\n}", "title": "" }, { "docid": "98c9d69e1784f53cba6d530555cfe369", "score": "0.61069214", "text": "function ArrayableObj() {\n var _map = [],\n _eLength = 0; // Effective length. Only count of defined element\n\n // Set a value in associative array\n this.set = function (key, value) {\n _eLength++;\n _map[key] = value;\n };\n\n // Get an value based on the key\n this.get = function (key) {\n return _map[key];\n };\n\n // Get the complete array\n this.getAll = function () {\n return _map;\n };\n\n // Merge with a given array and return a new one. However instance remains immutable.\n this.mergeWith = function (anotherArray) {\n var sArr,\n itemIndex,\n item,\n newArr = _map.slice(0);\n if (anotherArray instanceof Array) {\n sArr = anotherArray;\n } else if (anotherArray instanceof ArrayableObj) {\n sArr = anotherArray.getAll();\n } else {\n return;\n }\n for (itemIndex in sArr) {\n item = sArr[itemIndex];\n if (newArr[itemIndex]) {\n continue;\n }\n newArr[itemIndex] = item;\n }\n return newArr;\n };\n\n this.getEffectiveLength = function () {\n return _eLength;\n };\n }", "title": "" }, { "docid": "3fb05d2ae594cb0fb4e4534c0f3f44b4", "score": "0.60792804", "text": "function produce_object() {\n var real_length = 1;\n function set_length() { real_length = \"boom\"; }\n function get_length() { return real_length; }\n var o = { __proto__:Array.prototype , 0:\"x\" };\n Object.defineProperty(o, \"length\", { set:set_length, get:get_length })\n return o;\n}", "title": "" }, { "docid": "01d49270c190f77e59752ca771d1cebf", "score": "0.6017052", "text": "function Typedarray(length,elementlength,begin,end){\n\t\tvar obj=[]\n\t\tvar a\n\t\tif(typeof length==\"number\"){\n\t\t\tfor(a=0;a<length;a++){\n\t\t\t\tobj.push(0)\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif(end==null){\n\t\t\t\tbegin=0\n\t\t\t\tend=length.length\n\t\t\t}\n\t\t\tfor(a=begin;a<end;a++){\n\t\t\t\tobj.push(length[a])\n\t\t\t}\n\t\t}\n\t\tobj.subarray=subarray\n\t\tobj.set=set\n\t\tobj.byteLength=obj.length*elementlength\n\t\tobj.byteOffset=0\n\t\tfunction subarray(begin,end){\n\t\t\treturn Typedarray(obj,elementlength,begin,end)\n\t\t}\n\t\tfunction set(arr,w){\n\t\t\tw=w||0\n\t\t\tvar a\n\t\t\tvar target=obj\n\t\t\tvar len=arr.length\n\t\t\tfor(a=0;a<len;a++,w++){\n\t\t\t\ttarget[w]=arr[a]\n\t\t\t}\n\t\t}\n\t\treturn obj\n\t}", "title": "" }, { "docid": "5cde0a64f69d79c593ef97bdd7748feb", "score": "0.6012632", "text": "get length() {\n return this._itemArray.length;\n }", "title": "" }, { "docid": "5f404dda3dca45869c896f597ba049e5", "score": "0.6000889", "text": "size(){return this.#arr.length}", "title": "" }, { "docid": "4e0c483d39144d2ecd2fd3a3258ee025", "score": "0.59756637", "text": "function FakeArray() {\n this[0] = 10;\n this[1] = 20;\n this[2] = 30;\n this.length = 3;\n }", "title": "" }, { "docid": "ee39882b0d6fa2daf83dd498adaf806c", "score": "0.5969067", "text": "function length(array) {\n return array.length | 0;\n}", "title": "" }, { "docid": "ee39882b0d6fa2daf83dd498adaf806c", "score": "0.5969067", "text": "function length(array) {\n return array.length | 0;\n}", "title": "" }, { "docid": "ee39882b0d6fa2daf83dd498adaf806c", "score": "0.5969067", "text": "function length(array) {\n return array.length | 0;\n}", "title": "" }, { "docid": "461b523a02e54eadb7cb488004b5a17c", "score": "0.5963875", "text": "get count() {\n return this[rawArrayKey].length;\n }", "title": "" }, { "docid": "56432bcc97a61d7e0653df87f1606997", "score": "0.5937948", "text": "function test_ARRAYS_DELETE_NONCONFIGURABLE() {\n var x = [];\n Object.defineProperty(x, 0, { value: 3, configurable: false });\n try {\n x.length = 0;\n } catch (e) {}\n return x.length !== 1 || x[0] !== 3;\n }", "title": "" }, { "docid": "16ac0063808947363da016a49d979acb", "score": "0.59101796", "text": "size() {\n return this.arr.length;\n }", "title": "" }, { "docid": "d863b3632fa8411d17a3bc67b7b9f673", "score": "0.5884239", "text": "function isArrayLike(obj) {\n return obj &&\n typeof obj === \"object\" &&\n isFinite(obj.length) &&\n obj.length >= 0 &&\n obj.length === Math.floor(obj.length) &&\n obj.length < Math.pow(2, 23);\n }", "title": "" }, { "docid": "c3f1bc16a563bcc723165e599213711b", "score": "0.5841785", "text": "get length() { return this._length; }", "title": "" }, { "docid": "19cac0d37e4ca79d331f090fb5fc8106", "score": "0.5837398", "text": "size() {\n return this.arr.length\n }", "title": "" }, { "docid": "3bdcfb23faecd0172e65a840c3dc14b1", "score": "0.58205426", "text": "function testcase() {\n var arrObj = [1, 2, 3];\n try {\n Object.defineProperty(Array.prototype, \"0\", {\n value: \"test\",\n writable: false,\n configurable: true\n });\n\n var newArr = arrObj.slice(0, 1);\n return newArr.hasOwnProperty(\"0\") && newArr[0] === 1 && typeof newArr[1] === \"undefined\";\n } finally {\n delete Array.prototype[0];\n }\n }", "title": "" }, { "docid": "17ae26733607e4460382bdd7f6b79fc7", "score": "0.5816679", "text": "function makeArrayAccessors(obj) {\n if ('TYPED_ARRAY_POLYFILL_NO_ARRAY_ACCESSORS' in global)\n return;\n\n if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');\n\n function makeArrayAccessor(index) {\n Object.defineProperty(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "4e5c9f135d608dfc3c1248fc4e3394f2", "score": "0.5776647", "text": "function size() {\n return this.toArray().length;\n }", "title": "" }, { "docid": "2df44165d56054c11283c6df9b1a741a", "score": "0.57685465", "text": "function testDoubleSealedArray1(obj) {\n assertTrue(Object.isSealed(obj));\n assertFalse(Object.isFrozen(obj));\n assertTrue(Array.isArray(obj));\n\n // Verify that the length can't be written by builtins.\n assertThrows(function() { obj.pop(); }, TypeError);\n assertThrows(function() { obj.push(1); }, TypeError);\n assertThrows(function() { obj.shift(); }, TypeError);\n assertThrows(function() { obj.unshift(1); }, TypeError);\n assertThrows(function() { obj.splice(0); }, TypeError);\n assertDoesNotThrow(function() { obj.splice(0, 0); });\n\n // Verify search, filter, iterator\n assertEquals(obj.lastIndexOf(1), 1);\n assertEquals(obj.indexOf(undefined), -1);\n assertFalse(obj.includes(Symbol(\"test\")));\n assertTrue(obj.includes(1));\n assertTrue(obj.includes(-1.1));\n assertFalse(obj.includes());\n assertEquals(obj.find(x => x==0), undefined);\n assertEquals(obj.findIndex(x => x==2), 3);\n assertFalse(obj.some(x => typeof x == 'symbol'));\n assertFalse(obj.every(x => x == -1));\n var filteredArray = obj.filter(e => typeof e == \"symbol\");\n assertEquals(filteredArray.length, 0);\n assertEquals(obj.map(x => x), obj);\n var countPositiveNumber = 0;\n obj.forEach(function(item, index) {\n if (item === 1) {\n countPositiveNumber++;\n assertEquals(index, 1);\n }\n });\n assertEquals(countPositiveNumber, 1);\n assertEquals(obj.length, obj.concat([]).length);\n var iterator = obj.values();\n assertEquals(iterator.next().value, -1.1);\n assertEquals(iterator.next().value, 1);\n var iterator = obj.keys();\n assertEquals(iterator.next().value, 0);\n assertEquals(iterator.next().value, 1);\n var iterator = obj.entries();\n assertEquals(iterator.next().value, [0, -1.1]);\n assertEquals(iterator.next().value, [1, 1]);\n\n // Verify that the value can't be written\n var length = obj.length;\n for (var i = 0; i < length; i++) {\n obj[i] = 'new';\n assertEquals('new', obj[i]);\n }\n}", "title": "" }, { "docid": "82145a3bc334996780f87317ad7abfc6", "score": "0.57678473", "text": "function isIndexed(data) { return _.isArray(data) || _.isString(data); }", "title": "" }, { "docid": "21f3d08aabeadacc1f38c293c898a865", "score": "0.576344", "text": "function\nXATS2JS_jsarray_length\n (xs)\n{\n return (xs.length);\n}", "title": "" }, { "docid": "6221a5a4a78a5c23e0e5323a69cdae2b", "score": "0.5756198", "text": "function isArray(value) {\r\n\r\n\treturn value && \r\n\t\ttypeof value === 'object' &&\r\n\t\ttypeof value.length === 'number' && \r\n\t\t!(value.propertyIsEnumerable('length'));\r\n\r\n}", "title": "" }, { "docid": "5f2947629189106cc9fa92dc1b21f045", "score": "0.57458913", "text": "function testcase() {\n try {\n Object.defineProperty(Array.prototype, \"0\", {\n value: 100,\n writable: false,\n configurable: true\n });\n\n var oldArr = [101];\n\n var newArr = Array.prototype.concat.call(oldArr);\n\n var verifyValue = false;\n verifyValue = newArr[0] === 101;\n\n var verifyEnumerable = false;\n for (var p in newArr) {\n if (p === \"0\" && newArr.hasOwnProperty(\"0\")) {\n verifyEnumerable = true;\n }\n }\n\n var verifyWritable = false;\n newArr[0] = 12;\n verifyWritable = newArr[0] === 12;\n\n var verifyConfigurable = false;\n delete newArr[0];\n verifyConfigurable = newArr.hasOwnProperty(\"0\");\n\n return verifyValue && !verifyConfigurable && verifyEnumerable && verifyWritable;\n } finally {\n delete Array.prototype[0];\n }\n }", "title": "" }, { "docid": "129da7543b579c9d7c341b39b43a6302", "score": "0.5659045", "text": "function length(a) { return a.length; }", "title": "" }, { "docid": "94a357eb101ffdf1c6d42acc605ea7c8", "score": "0.5658178", "text": "function whitelistLengthIfItExists(dis) {\n if (('length' in dis) && !('length_v___' in dis)) {\n dis.DefineOwnProperty___('length', {\n value: dis.length,\n writable: true,\n configurable: true,\n enumerable: true\n });\n }\n }", "title": "" }, { "docid": "e7bd6a0858223957279ca8e070b98acd", "score": "0.5655546", "text": "function SubArray(length) {\n if (arguments.length < 1) {\n length = 0;\n }\n\n if (length > 0) {\n this._operations = [new Operation(RETAIN, length)];\n } else {\n this._operations = [];\n }\n }", "title": "" }, { "docid": "6b5e31967109bba437c2bcd2046c3b81", "score": "0.56418943", "text": "len() {\n return this._elements.length;\n }", "title": "" }, { "docid": "1d676033d74c66059bc4f4b3ef316d7d", "score": "0.56418145", "text": "static empty(length) {\n return new _ChangeSet(length ? [length, -1] : [], []);\n }", "title": "" }, { "docid": "6e9a88000616b0f27e165102aa24db6e", "score": "0.5640742", "text": "function makeArrayAccessors(obj) {\n if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');\n function makeArrayAccessor(index) {\n Object.defineProperty(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "6e9a88000616b0f27e165102aa24db6e", "score": "0.5640742", "text": "function makeArrayAccessors(obj) {\n if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');\n function makeArrayAccessor(index) {\n Object.defineProperty(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "6e9a88000616b0f27e165102aa24db6e", "score": "0.5640742", "text": "function makeArrayAccessors(obj) {\n if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');\n function makeArrayAccessor(index) {\n Object.defineProperty(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "6e9a88000616b0f27e165102aa24db6e", "score": "0.5640742", "text": "function makeArrayAccessors(obj) {\n if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');\n function makeArrayAccessor(index) {\n Object.defineProperty(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "6e9a88000616b0f27e165102aa24db6e", "score": "0.5640742", "text": "function makeArrayAccessors(obj) {\n if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');\n function makeArrayAccessor(index) {\n Object.defineProperty(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "6e9a88000616b0f27e165102aa24db6e", "score": "0.5640742", "text": "function makeArrayAccessors(obj) {\n if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');\n function makeArrayAccessor(index) {\n Object.defineProperty(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "197afdbd93c6c3e71af4bd163d448648", "score": "0.56338084", "text": "function testHoleySealedArray1(obj) {\n assertTrue(Object.isSealed(obj));\n assertFalse(Object.isFrozen(obj));\n assertTrue(Array.isArray(obj));\n\n // Verify that the length can't be written by builtins.\n assertThrows(function() { obj.pop(); }, TypeError);\n assertThrows(function() { obj.push(1); }, TypeError);\n assertThrows(function() { obj.shift(); }, TypeError);\n assertThrows(function() { obj.unshift(1); }, TypeError);\n assertThrows(function() { obj.splice(0); }, TypeError);\n assertDoesNotThrow(function() { obj.splice(0, 0); });\n\n // Verify search, filter, iterator\n obj = [undefined, null, 1, , -1, 'a', Symbol(\"test\")];\n assertTrue(%HasHoleyElements(obj));\n Object.seal(obj);\n assertTrue(Object.isSealed(obj));\n assertFalse(Object.isFrozen(obj));\n assertTrue(Array.isArray(obj));\n assertEquals(obj.lastIndexOf(1), 2);\n assertEquals(obj.indexOf('a'), 5);\n assertEquals(obj.indexOf(undefined), 0);\n assertFalse(obj.includes(Symbol(\"test\")));\n assertTrue(obj.includes(undefined));\n assertFalse(obj.includes(NaN));\n assertTrue(obj.includes());\n assertEquals(obj.find(x => x==0), undefined);\n assertEquals(obj.findIndex(x => x=='a'), 5);\n assertTrue(obj.some(x => typeof x == 'symbol'));\n assertFalse(obj.every(x => x == -1));\n var filteredArray = obj.filter(e => typeof e == \"symbol\");\n assertEquals(filteredArray.length, 1);\n assertEquals(obj.map(x => x), obj);\n var countPositiveNumber = 0;\n obj.forEach(function(item, index) {\n if (item === 1) {\n countPositiveNumber++;\n assertEquals(index, 2);\n }\n });\n assertEquals(countPositiveNumber, 1);\n assertEquals(obj.length, obj.concat([]).length);\n var iterator = obj.values();\n assertEquals(iterator.next().value, undefined);\n assertEquals(iterator.next().value, null);\n var iterator = obj.keys();\n assertEquals(iterator.next().value, 0);\n assertEquals(iterator.next().value, 1);\n var iterator = obj.entries();\n assertEquals(iterator.next().value, [0, undefined]);\n assertEquals(iterator.next().value, [1, null]);\n\n // Verify that the value can be written\n var length = obj.length;\n for (var i = 0; i < length; i++) {\n if (i==3) continue;\n obj[i] = 'new';\n assertEquals(obj[i], 'new');\n }\n}", "title": "" }, { "docid": "75950b623a305cf65e1cc484f164f0fc", "score": "0.5632467", "text": "function validateSchemaConstLengthArray(arr) {\n\t\t\tvar i\n\t\t\t , field;\n\t\t\t\n\t\t\t// Validate each index in the array.\n\t\t for (i = 0; i < arr.length; i++) {\n\t\t field = arr[i];\n\t\t \n\t\t // If the index is null, throw an exception.\n\t\t if (field === null) {\n\t\t throw \"The element at index \" + \n\t\t \t\ti + \n\t\t \t\t\" is null: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t \n\t\t // If the index is not an object, throw an exception.\n\t\t if (Object.prototype.toString.call(field) !== JS_TYPE_OBJECT) {\n\t\t throw \"The element at index \" + \n\t\t \t\ti + \n\t\t \t\t\"is not a JSON object: \" + \n\t\t \t\tJSON.stringify(obj, null, null);\n\t\t }\n\t\t \n\t\t validateSchemaType(field);\n\t\t }\n\t\t}", "title": "" }, { "docid": "761b186bfa9859e734e9af5ae14c696e", "score": "0.5632057", "text": "function n(){this.__data__=[],this.size=0}", "title": "" }, { "docid": "c1ef628b70e51e12295e28ccf99cd503", "score": "0.56310993", "text": "function findArrayLength(props) {\r\n const findLength = props.length;\r\n return findLength;\r\n}", "title": "" }, { "docid": "5d2b7f80b24d1ee4ff47a2b900af093b", "score": "0.5625367", "text": "function TestIteratorNextGetLength() {\n var lengthCalledTimes = 0;\n var array = {\n __proto__: Array.prototype,\n\n get length() {\n lengthCalledTimes += 1;\n return {\n valueOf() {\n return 0;\n }\n\n };\n }\n\n };\n var it = array[Symbol.iterator]();\n it.next();\n it.next();\n 1;\n lengthCalledTimes;\n}", "title": "" }, { "docid": "84e317b4a7e39fa056571116ef8f0798", "score": "0.55916715", "text": "length () {\n const keys = Object.values(this.data);\n var length = keys.length;\n return length;\n }", "title": "" }, { "docid": "38c79d43580427b6faa80d7e178b5500", "score": "0.55872655", "text": "get length() {\n\t\treturn this._size;\n\t}", "title": "" }, { "docid": "77d839d452eae4216b3eff23cf5d92e9", "score": "0.55844873", "text": "function testcase() {\n var arrObj = [];\n\n Object.defineProperty(arrObj, \"0\", { value: NaN });\n\n Object.defineProperty(arrObj, \"0\", { value: NaN });\n\n var hasProperty = arrObj.hasOwnProperty(\"0\");\n var verifyValue = (arrObj[0] !== arrObj[0]);\n\n var verifyWritable = false;\n arrObj[0] = 1001;\n verifyWritable = arrObj[0] !== 1001 && arrObj[0] !== arrObj[0];\n\n var verifyEnumerable = false;\n for (var p in arrObj) {\n if (p === \"0\") {\n verifyEnumerable = true;\n }\n }\n\n var verifyConfigurable = false;\n delete arrObj[0];\n verifyConfigurable = arrObj.hasOwnProperty(\"0\");\n\n return hasProperty && verifyValue && verifyWritable && !verifyEnumerable && verifyConfigurable;\n }", "title": "" }, { "docid": "44a8c3fed37fbb3304ac3d8a808cb9e5", "score": "0.55766815", "text": "size() {\n //Faz uso do atributo do array, length, que guarda o tamanho do mesmo\n return this.data.length;\n }", "title": "" }, { "docid": "a6323c08ecec4c5d1dff3eedbc3b25da", "score": "0.55718905", "text": "function testPackedSealedArray1(obj) {\n assertTrue(Object.isSealed(obj));\n assertFalse(Object.isFrozen(obj));\n assertTrue(Array.isArray(obj));\n\n // Verify that the length can't be written by builtins.\n assertThrows(function() { obj.pop(); }, TypeError);\n assertThrows(function() { obj.push(1); }, TypeError);\n assertThrows(function() { obj.shift(); }, TypeError);\n assertThrows(function() { obj.unshift(1); }, TypeError);\n assertThrows(function() { obj.splice(0); }, TypeError);\n assertDoesNotThrow(function() { obj.splice(0, 0); });\n\n // Verify search, filter, iterator\n obj = new Array(undefined, null, 1, -1, 'a', Symbol(\"test\"));\n assertTrue(%HasPackedElements(obj));\n Object.seal(obj);\n assertTrue(Object.isSealed(obj));\n assertFalse(Object.isFrozen(obj));\n assertTrue(Array.isArray(obj));\n assertEquals(obj.lastIndexOf(1), 2);\n assertEquals(obj.indexOf('a'), 4);\n assertEquals(obj.indexOf(undefined), 0);\n assertFalse(obj.includes(Symbol(\"test\")));\n assertTrue(obj.includes(undefined));\n assertFalse(obj.includes(NaN));\n assertTrue(obj.includes());\n assertEquals(obj.find(x => x==0), undefined);\n assertEquals(obj.findIndex(x => x=='a'), 4);\n assertTrue(obj.some(x => typeof x == 'symbol'));\n assertFalse(obj.every(x => x == -1));\n var filteredArray = obj.filter(e => typeof e == \"symbol\");\n assertEquals(filteredArray.length, 1);\n assertEquals(obj.map(x => x), obj);\n var countPositiveNumber = 0;\n obj.forEach(function(item, index) {\n if (item === 1) {\n countPositiveNumber++;\n assertEquals(index, 2);\n }\n });\n assertEquals(countPositiveNumber, 1);\n assertEquals(obj.length, obj.concat([]).length);\n var iterator = obj.values();\n assertEquals(iterator.next().value, undefined);\n assertEquals(iterator.next().value, null);\n var iterator = obj.keys();\n assertEquals(iterator.next().value, 0);\n assertEquals(iterator.next().value, 1);\n var iterator = obj.entries();\n assertEquals(iterator.next().value, [0, undefined]);\n assertEquals(iterator.next().value, [1, null]);\n\n // Verify that the value can be written\n var length = obj.length;\n for (var i = 0; i < length-1; i++) {\n obj[i] = 'new';\n assertEquals(obj[i], 'new');\n }\n}", "title": "" }, { "docid": "7936f07e2ea05ac46e0ced27c5213715", "score": "0.55677474", "text": "function makeArrayAccessors(obj) {\n if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');\n\n function makeArrayAccessor(index) {\n Object.defineProperty(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "7936f07e2ea05ac46e0ced27c5213715", "score": "0.55677474", "text": "function makeArrayAccessors(obj) {\n if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');\n\n function makeArrayAccessor(index) {\n Object.defineProperty(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "7936f07e2ea05ac46e0ced27c5213715", "score": "0.55677474", "text": "function makeArrayAccessors(obj) {\n if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');\n\n function makeArrayAccessor(index) {\n Object.defineProperty(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "7936f07e2ea05ac46e0ced27c5213715", "score": "0.55677474", "text": "function makeArrayAccessors(obj) {\n if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');\n\n function makeArrayAccessor(index) {\n Object.defineProperty(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "7936f07e2ea05ac46e0ced27c5213715", "score": "0.55677474", "text": "function makeArrayAccessors(obj) {\n if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');\n\n function makeArrayAccessor(index) {\n Object.defineProperty(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "b0533e40f490dee791df874ab435c39c", "score": "0.55642265", "text": "function test_GLOBAL_LEAKS_FROM_ARRAY_METHODS() {\n var readCanary = {};\n var writeCanary = {};\n\n var saved = [];\n function save(name) {\n var opt_desc = Object.getOwnPropertyDescriptor(global, name);\n saved.push([name, opt_desc]);\n return !!opt_desc;\n }\n // Save the state of all properties that our test might mutate. We save\n // 'length' and all numeric-indexed properties which\n // * have indexes less than global.length,\n // * are numbered consecutively from other saved properties, or\n // * are possibly mutated by our tests (the + 2).\n var lengthVal = global.length;\n var minSaveLength =\n ((typeof lengthVal === 'number' && isFinite(lengthVal))\n ? lengthVal : 0) + 2;\n save('length');\n var found = true;\n for (var i = 0; found || i < minSaveLength; i++) {\n found = save(i);\n }\n\n function subtest(name, args, failPredicate) {\n var method = Array.prototype[name];\n try {\n var result = method(args[0], args[1], args[2]);\n } catch (err) {\n if (err instanceof TypeError) { return false; }\n return 'Unexpected error from ' + name + ': ' + err;\n }\n if (failPredicate(result)) { return true; }\n return 'Unexpected result from ' + name + ': ' + result;\n }\n\n try {\n // Insert a dummy value to use.\n try {\n Array.prototype.push.call(global, readCanary);\n } catch (e) {\n // Fails on Firefox (which doesn't have this bug). Continue with the\n // test anyway just in case (but readCanary-using subtests will report\n // unexpected rather than true).\n }\n\n return (\n subtest('concat', [[]], function(result) {\n return result[0] === global; })\n || subtest('slice', [0], function(result) {\n return result[result.length-1] === readCanary; })\n || subtest('pop', [], function(result) {\n return result === readCanary; })\n || subtest('push', [writeCanary], function(result) {\n return global[global.length-1] === writeCanary; })\n || subtest('shift', [], function(result) { return true; })\n || subtest('slice', [], function(result) {\n return result.indexOf(readCanary) !== -1; })\n || subtest('splice', [0, 1, writeCanary], function(result) {\n return global[0] === writeCanary; })\n || subtest('unshift', [writeCanary], function(result) {\n return global[0] === writeCanary; })\n );\n } finally {\n saved.forEach(function(record) {\n if (record[1]) {\n Object.defineProperty(global, record[0], record[1]);\n } else {\n delete global[record[0]];\n }\n });\n }\n }", "title": "" }, { "docid": "a4a174d7f5c4231a11dc0839ffc82104", "score": "0.55633795", "text": "get length() { return this._keys().length; }", "title": "" }, { "docid": "374eb522e7c5d2dd137e56d1914fc9aa", "score": "0.55625945", "text": "function testcase() {\n var obj = [1, , 3, , 5];\n\n Object.defineProperty(obj, 5, {\n value: 7,\n enumerable: false,\n configurable: true\n });\n\n Object.defineProperty(obj, 10000, {\n value: \"ElementWithLargeIndex\",\n enumerable: true,\n configurable: true\n });\n\n var arr = Object.keys(obj);\n\n var index;\n var initValue = 0;\n for (index = 0; index < 3; index++) {\n if (arr[index] !== initValue.toString()) {\n return false;\n }\n initValue += 2;\n }\n\n if (arr.length !== 4 || arr[3] !== \"10000\") {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "c51075968d2401f1f1ab419c9be2c2b6", "score": "0.5553939", "text": "function r(){this.__data__=new o,this.size=0}", "title": "" }, { "docid": "8836f1750bda69caf1edb48fa07b94c0", "score": "0.5547866", "text": "function r(){this.__data__=o?o(null):{},this.size=0}", "title": "" }, { "docid": "c23c5f2c8474b6c867ae4d1223938fdc", "score": "0.55449283", "text": "function isArray(array) {\n \n return isObject(array) && isDefined(array.length);\n}", "title": "" }, { "docid": "e5c1c9b0f3adbe1a37857b4a0c74781e", "score": "0.5541842", "text": "function array(t){for(i=0;i<t;i++)this[i]=0;this.length=t}", "title": "" }, { "docid": "2a5fd84a9426d387840cd5b2be79b59d", "score": "0.5538428", "text": "function makeArrayAccessors(obj) {\n if (!defineProp) {\n return;\n }\n\n if (obj.length > MAX_ARRAY_LENGTH)\n throw new RangeError(\"Array too large for polyfill\");\n\n function makeArrayAccessor(index) {\n defineProp(obj, index, {\n get: function () {\n return obj._getter(index);\n },\n set: function (v) {\n obj._setter(index, v);\n },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n }", "title": "" }, { "docid": "b587171428d0a234e600c951d1ffe9d8", "score": "0.55360806", "text": "isLength() {\n return this.items.length;\n }", "title": "" }, { "docid": "68a3c8589321bac80ed6a7c881456f15", "score": "0.55319583", "text": "constructor(size){\n this.data = new Array(size);\n }", "title": "" }, { "docid": "c9036e3fbe1261e10bc4fe0eefdd46f4", "score": "0.55114347", "text": "function rebuildAttribute (attrib, data, itemSize) {\n if (attrib.itemSize !== itemSize) return true\n if (!attrib.array) return true\n var attribLength = attrib.array.length\n if (Array.isArray(data) && Array.isArray(data[0])) {\n // [ [ x, y, z ] ]\n return attribLength !== data.length * itemSize\n } else {\n // [ x, y, z ]\n return attribLength !== data.length\n }\n return false\n}", "title": "" }, { "docid": "c9036e3fbe1261e10bc4fe0eefdd46f4", "score": "0.55114347", "text": "function rebuildAttribute (attrib, data, itemSize) {\n if (attrib.itemSize !== itemSize) return true\n if (!attrib.array) return true\n var attribLength = attrib.array.length\n if (Array.isArray(data) && Array.isArray(data[0])) {\n // [ [ x, y, z ] ]\n return attribLength !== data.length * itemSize\n } else {\n // [ x, y, z ]\n return attribLength !== data.length\n }\n return false\n}", "title": "" }, { "docid": "c9036e3fbe1261e10bc4fe0eefdd46f4", "score": "0.55114347", "text": "function rebuildAttribute (attrib, data, itemSize) {\n if (attrib.itemSize !== itemSize) return true\n if (!attrib.array) return true\n var attribLength = attrib.array.length\n if (Array.isArray(data) && Array.isArray(data[0])) {\n // [ [ x, y, z ] ]\n return attribLength !== data.length * itemSize\n } else {\n // [ x, y, z ]\n return attribLength !== data.length\n }\n return false\n}", "title": "" }, { "docid": "4266b29bb9e4c3000bc8e6e1b85f38e4", "score": "0.55105036", "text": "function getLength(arr) {\n\n return arr.length\n}", "title": "" }, { "docid": "06a50cf43448acb3a1b830c0f77b612d", "score": "0.5506567", "text": "size() {\n /*Object contém um método chamado keys que retorna um array de chaves do objeto.*/\n return Object.keys(this.items).length;\n }", "title": "" }, { "docid": "2716dd541d54aedc6fc6284453b49abd", "score": "0.5498161", "text": "constructor(size) {\n this.data = new Array(size);\n }", "title": "" }, { "docid": "69669468189738a1af428289db9bade6", "score": "0.5496369", "text": "function rebuildAttribute(attrib, data, itemSize) {\n if (attrib.itemSize !== itemSize) return true;\n if (!attrib.array) return true;\n var attribLength = attrib.array.length;\n if (Array.isArray(data) && Array.isArray(data[0])) {\n // [ [ x, y, z ] ]\n return attribLength !== data.length * itemSize;\n } else {\n // [ x, y, z ]\n return attribLength !== data.length;\n }\n return false;\n }", "title": "" }, { "docid": "68d7195e2a8ecdabfc2e301819262fad", "score": "0.5487625", "text": "function validateSchemaConstLengthArray(obj) {\n var i\n , field\n , constLength = obj[KEYWORD_CONST_LENGTH]\n , constLengthType;\n \n // Ensure that the sub-schema exists.\n if (constLength === null) {\n throw \"The sub-schema for a constant length array is null: \" +\n JSON.stringify(obj);\n }\n // Ensure that the sub-schema is an array.\n constLengthType = Object.prototype.toString.call(constLength);\n if (constLengthType !== JS_TYPE_ARRAY) {\n throw \"The sub-schema for a constant length array, '\" +\n constLengthType +\n \"', is not of \" +\n \t\t\"type '\" +\n \t\tJS_TYPE_ARRAY +\n \t\t\"': \" +\n \t\tJSON.stringify(obj);\n }\n \n // Validate each index in the array.\n for (i = 0; i < constLength.length; i++) {\n // Get the field.\n field = constLength[i];\n \n // If the index is null, throw an exception.\n if (field === null) {\n throw \"The element at index \" + \n i + \n \" is null: \" + \n JSON.stringify(obj);\n }\n \n // If the index is not an object, throw an exception.\n if (Object.prototype.toString.call(field) !== JS_TYPE_OBJECT) {\n throw \"The element at index \" + \n i + \n \"is not a JSON object: \" + \n JSON.stringify(obj);\n }\n \n // Validate this field's type.\n validateSchemaInternal(field);\n }\n }", "title": "" }, { "docid": "2efcfd73cb47fa0c0117a446858c3889", "score": "0.5486822", "text": "function makeArrayAccessors(obj) {\n if (!defineProp) {\n return;\n }\n\n if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError(\"Array too large for polyfill\");\n\n function makeArrayAccessor(index) {\n defineProp(obj, index, {\n 'get': function get() {\n return obj._getter(index);\n },\n 'set': function set(v) {\n obj._setter(index, v);\n },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n} // Internal conversion functions:", "title": "" }, { "docid": "26350128565c2d805d936a4c756e6d51", "score": "0.548654", "text": "function _size(obj) {\n \tif (obj == null) return 0;\n \treturn isArrayLike(obj) ? obj.length : _keys(obj).length;\n }", "title": "" }, { "docid": "aad9608f84281c6072ad8de9d7d59ffd", "score": "0.5475839", "text": "get length() {\n return this._map.keys().length;\n }", "title": "" }, { "docid": "f82fbff023766466cefe226604b5a722", "score": "0.5473429", "text": "function testHoleyDoubleSealedArray1() {\n assertTrue(Object.isSealed(obj));\n assertFalse(Object.isFrozen(obj));\n assertTrue(Array.isArray(obj));\n\n // Verify that the length can't be written by builtins.\n assertThrows(function() { obj.pop(); }, TypeError);\n assertThrows(function() { obj.push(1); }, TypeError);\n assertThrows(function() { obj.shift(); }, TypeError);\n assertThrows(function() { obj.unshift(1); }, TypeError);\n assertThrows(function() { obj.splice(0); }, TypeError);\n assertDoesNotThrow(function() { obj.splice(0, 0); });\n\n // Verify search, filter, iterator\n obj = [-1.1, 0, 1, , -1, 1.1];\n assertTrue(%HasHoleyElements(obj));\n Object.seal(obj);\n assertTrue(Object.isSealed(obj));\n assertFalse(Object.isFrozen(obj));\n assertTrue(Array.isArray(obj));\n assertEquals(obj.lastIndexOf(1), 2);\n assertEquals(obj.indexOf(1.1), 5);\n assertEquals(obj.indexOf(undefined), -1);\n assertFalse(obj.includes(Symbol(\"test\")));\n assertTrue(obj.includes(undefined));\n assertFalse(obj.includes(NaN));\n assertTrue(obj.includes());\n assertEquals(obj.find(x => x==0), 0);\n assertEquals(obj.findIndex(x => x==1.1), 5);\n assertFalse(obj.some(x => typeof x == 'symbol'));\n assertFalse(obj.every(x => x == -1));\n var filteredArray = obj.filter(e => typeof e == \"symbol\");\n assertEquals(filteredArray.length, 0);\n assertEquals(obj.map(x => x), obj);\n var countPositiveNumber = 0;\n obj.forEach(function(item, index) {\n if (item === 1) {\n countPositiveNumber++;\n assertEquals(index, 2);\n }\n });\n assertEquals(countPositiveNumber, 1);\n assertEquals(obj.length, obj.concat([]).length);\n var iterator = obj.values();\n assertEquals(iterator.next().value, -1.1);\n assertEquals(iterator.next().value, 0);\n var iterator = obj.keys();\n assertEquals(iterator.next().value, 0);\n assertEquals(iterator.next().value, 1);\n var iterator = obj.entries();\n assertEquals(iterator.next().value, [0, -1.1]);\n assertEquals(iterator.next().value, [1, 0]);\n\n // Verify that the value can be written\n var length = obj.length;\n for (var i = 0; i < length; i++) {\n if (i==3) continue;\n obj[i] = 'new';\n assertEquals(obj[i], 'new');\n }\n}", "title": "" }, { "docid": "10b2c04c1c23806fb48ac154b8f429a2", "score": "0.5461909", "text": "$size (obj, expr) {\n let value = computeValue(obj, expr, null)\n return isArray(value) ? value.length : undefined\n }", "title": "" }, { "docid": "9cf5acbea187fbc816fa4709667f0198", "score": "0.5453785", "text": "function T() {\n Object.defineProperty(this, 'length', {\n set: function() {\n throw new Test262Error();\n }\n });\n}", "title": "" }, { "docid": "f8da18439ab0b64f8162eb3a83ee9572", "score": "0.5453584", "text": "get length() {\n return this[kAttributeTypes].size;\n }", "title": "" }, { "docid": "41567bc080e6f7045250ad5f7be40b4f", "score": "0.54525346", "text": "function lengthofArray(array)\n{\n\treturn array.length;\n}", "title": "" }, { "docid": "0244c71a0d94d39d52d5565bc645c63d", "score": "0.5446708", "text": "get length() {}", "title": "" }, { "docid": "d6076e50cc9c4b3938a4e3d1eff6d65c", "score": "0.5443728", "text": "function rebuildAttribute(attrib, data, itemSize) {\n if (attrib.itemSize !== itemSize) return true;\n if (!attrib.array) return true;\n var attribLength = attrib.array.length;\n\n if (Array.isArray(data) && Array.isArray(data[0])) {\n // [ [ x, y, z ] ]\n return attribLength !== data.length * itemSize;\n } else {\n // [ x, y, z ]\n return attribLength !== data.length;\n }\n\n return false;\n }", "title": "" }, { "docid": "c900894b604fd6f8c52cf747cf67ca7b", "score": "0.5441499", "text": "function makeArrayAccessors(obj) {\n\t if (!defineProp) { return; }\n\n\t if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError(\"Array too large for polyfill\");\n\n\t function makeArrayAccessor(index) {\n\t defineProp(obj, index, {\n\t 'get': function() { return obj._getter(index); },\n\t 'set': function(v) { obj._setter(index, v); },\n\t enumerable: true,\n\t configurable: false\n\t });\n\t }\n\n\t var i;\n\t for (i = 0; i < obj.length; i += 1) {\n\t makeArrayAccessor(i);\n\t }\n\t}", "title": "" }, { "docid": "85d1a28ea73e629db98e35d33f0c1cd5", "score": "0.54304296", "text": "function setupArrayMap(length) {\n var a = new Array(length);\n for (var i=0;i<length;i++) {\n a[i] = ''+i;\n }\n return Object.freeze(a);\n}", "title": "" }, { "docid": "502e64251bfeeafbb9ce59b47571fca1", "score": "0.5425448", "text": "get length() {\n return this._info.length;\n }", "title": "" }, { "docid": "9a98ccf8cb7df435f03692fe2b84f974", "score": "0.54182225", "text": "function TestArray(constructor) {\n function Check(a) {\n a[0] = \"\";\n assertEquals(0, a[0]);\n a[0] = {};\n assertEquals(0, a[0]);\n a[0] = { valueOf : function() { return 27; } };\n assertEquals(27, a[0]);\n }\n Check(new constructor(1));\n Check(new constructor(100));\n}", "title": "" }, { "docid": "8dfa7bd2e0019a147422768732969444", "score": "0.54144424", "text": "function makeArrayAccessors(obj) {\n if (!defineProp) { return; }\n\n if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError(\"Array too large for polyfill\");\n\n function makeArrayAccessor(index) {\n defineProp(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n}", "title": "" }, { "docid": "8dfa7bd2e0019a147422768732969444", "score": "0.54144424", "text": "function makeArrayAccessors(obj) {\n if (!defineProp) { return; }\n\n if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError(\"Array too large for polyfill\");\n\n function makeArrayAccessor(index) {\n defineProp(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n}", "title": "" }, { "docid": "8dfa7bd2e0019a147422768732969444", "score": "0.54144424", "text": "function makeArrayAccessors(obj) {\n if (!defineProp) { return; }\n\n if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError(\"Array too large for polyfill\");\n\n function makeArrayAccessor(index) {\n defineProp(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n}", "title": "" }, { "docid": "8dfa7bd2e0019a147422768732969444", "score": "0.54144424", "text": "function makeArrayAccessors(obj) {\n if (!defineProp) { return; }\n\n if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError(\"Array too large for polyfill\");\n\n function makeArrayAccessor(index) {\n defineProp(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n}", "title": "" }, { "docid": "8dfa7bd2e0019a147422768732969444", "score": "0.54144424", "text": "function makeArrayAccessors(obj) {\n if (!defineProp) { return; }\n\n if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError(\"Array too large for polyfill\");\n\n function makeArrayAccessor(index) {\n defineProp(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n}", "title": "" }, { "docid": "8dfa7bd2e0019a147422768732969444", "score": "0.54144424", "text": "function makeArrayAccessors(obj) {\n if (!defineProp) { return; }\n\n if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError(\"Array too large for polyfill\");\n\n function makeArrayAccessor(index) {\n defineProp(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n}", "title": "" }, { "docid": "8dfa7bd2e0019a147422768732969444", "score": "0.54144424", "text": "function makeArrayAccessors(obj) {\n if (!defineProp) { return; }\n\n if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError(\"Array too large for polyfill\");\n\n function makeArrayAccessor(index) {\n defineProp(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n}", "title": "" }, { "docid": "8dfa7bd2e0019a147422768732969444", "score": "0.54144424", "text": "function makeArrayAccessors(obj) {\n if (!defineProp) { return; }\n\n if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError(\"Array too large for polyfill\");\n\n function makeArrayAccessor(index) {\n defineProp(obj, index, {\n 'get': function() { return obj._getter(index); },\n 'set': function(v) { obj._setter(index, v); },\n enumerable: true,\n configurable: false\n });\n }\n\n var i;\n for (i = 0; i < obj.length; i += 1) {\n makeArrayAccessor(i);\n }\n}", "title": "" } ]
db76d472a4592b42dc96d9b4ca0f1515
$FlowFixMe: computed properties still not supported in flow
[ { "docid": "76acf30212e5429da62629ef1a2ac4c0", "score": "0.0", "text": "['fantasy-land/map'](f) {\n return this.map(f);\n }", "title": "" } ]
[ { "docid": "ed0d60e8824d5b8961484298447e28c7", "score": "0.5909738", "text": "@computedFrom('firstName', 'lastName')\n get fullName() : string{\n return `${this.firstName} ${this.lastName}`;\n }", "title": "" }, { "docid": "39ff85f5c68a14755dbc4bd8308d7c87", "score": "0.59059894", "text": "get foo() {\n return 5;\n }", "title": "" }, { "docid": "ee1f52aa306ce730f2d24e37ecbdd167", "score": "0.5869232", "text": "get c() {\r\n return this.a + this.b;\r\n }", "title": "" }, { "docid": "7f3907bfd09ca64aed389c8660f18239", "score": "0.5863993", "text": "upgradeProperties() {\n this.constructor.observedAttributes.forEach(prop => {\n // eslint-disable-next-line no-prototype-builtins\n if (this.hasOwnProperty(prop)) {\n let value = this[prop];\n if (value) {\n this[prop] = value;\n }\n }\n });\n }", "title": "" }, { "docid": "0adb2984ea2b3c455cc966504887c828", "score": "0.58200353", "text": "visitComputedPropertyExpressionAssignment(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "b1f5d87639a52bce7e57fbff4b204477", "score": "0.58074576", "text": "function e$44(r){return r?r.__accessor__?r.__accessor__:r.propertyInvalidated?r:null:null}", "title": "" }, { "docid": "e9ae024eafed83e65df6e3f8d24d8e9c", "score": "0.57349974", "text": "function loose(node, body, objId) {\n var _arr = node.properties;\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var prop = _arr[_i];\n body.push(t.expressionStatement(t.assignmentExpression(\"=\", t.memberExpression(objId, prop.key, prop.computed || t.isLiteral(prop.key)), prop.value)));\n }\n}", "title": "" }, { "docid": "f7f7afc9d01f977e5cd682bdf8c052c4", "score": "0.5719952", "text": "function add(a) {\n// uncomment to investigate\n// const obj = {\n// get prop() {\n// return 1;\n// },\n// getProp: function () {\n// return 1;\n// }\n// };\n return a+a;\n}", "title": "" }, { "docid": "05c3f53323774f8b231cf4ef4aadfdc7", "score": "0.57102364", "text": "_upgradeProperty(prop) {\n // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n // https://developers.google.com/web/fundamentals/web-components/examples/howto-checkbox\n /* eslint no-prototype-builtins: 0 */\n if (this.hasOwnProperty(prop)) {\n const value = this[prop];\n // get rid of the property that might shadow a setter/getter\n delete this[prop];\n // this time if a setter was defined it will be properly called\n this[prop] = value;\n // if a getter was defined, it will be called from now on\n }\n }", "title": "" }, { "docid": "a086b6344524e43bb4783a49d034ec47", "score": "0.5702483", "text": "function objprop(type){\n if (type == \"variable\") mark(\"js-property\");\n if (atomicTypes.hasOwnProperty(type)) cont(expect(\":\"), expression);\n }", "title": "" }, { "docid": "cde8e5298461b20d5642bc800df59971", "score": "0.56996226", "text": "check() {\n if (!this.cf) {\n this.cf = {};\n }\n if (!this.ct) {\n this.ct = {};\n }\n for (const prop of this.prop) {\n // From\n if (!this.f) {\n this.cf[prop] = this.obj[prop];\n }\n else {\n this.cf[prop] = this.f[prop];\n this.obj[prop] = this.f[prop];\n }\n // Relative\n if (this.relative) {\n this.ct[prop] = this.obj[prop] + this.t[prop];\n }\n else {\n this.ct[prop] = this.t[prop];\n }\n }\n }", "title": "" }, { "docid": "f22a506f3cc8bbaf46b9c46541743f0c", "score": "0.5692968", "text": "defineComputedProperty(name, watchProps, func) {\n Ember.defineProperty(\n this,\n name,\n Ember.computed(watchProps, function() {\n return func(this.get(watchProps));\n })\n );\n }", "title": "" }, { "docid": "0d860d09c9c2f5ec02ba87c7809102ef", "score": "0.56057596", "text": "initModelComputedProperties() {\n let model = this.get('model'),\n propName = this.get('name');\n\n if (model && propName) {\n defineProperty(this, 'validator', oneWay(`model.validations.attrs.${propName}`));\n // map the value to mode.property - this can be overridden by passing value\n // property into this component\n defineProperty(this, 'value', alias(`model.${propName}`));\n }\n }", "title": "" }, { "docid": "a92354ba56d3374d46ee1743253ae2cb", "score": "0.5591983", "text": "static get properties(){return{}}", "title": "" }, { "docid": "d41dc3f86ddc9f4b93d9a15103e8bc08", "score": "0.55316067", "text": "function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) die(31);\n this.derivation = options.get;\n this.name_ = options.name || ('development' !== \"production\" ? \"ComputedValue@\" + getNextId() : \"ComputedValue\");\n\n if (options.set) {\n this.setter_ = createAction('development' !== \"production\" ? this.name_ + \"-setter\" : \"ComputedValue-setter\", options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = !!options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }", "title": "" }, { "docid": "8117cbb6adbc1573da2f33f81a7a24df", "score": "0.5519554", "text": "function setter() {\n\t throw new Error('vuex getter properties are read-only.');\n\t }", "title": "" }, { "docid": "8117cbb6adbc1573da2f33f81a7a24df", "score": "0.5519554", "text": "function setter() {\n\t throw new Error('vuex getter properties are read-only.');\n\t }", "title": "" }, { "docid": "5030d1dbba2f16171d665f199f7a2593", "score": "0.551647", "text": "static getImmutablePropertyNames() { return props; }", "title": "" }, { "docid": "5030d1dbba2f16171d665f199f7a2593", "score": "0.551647", "text": "static getImmutablePropertyNames() { return props; }", "title": "" }, { "docid": "d85628c8d7e08653590f3e6707a58e6a", "score": "0.54799485", "text": "function PropertyExpression() {\n}", "title": "" }, { "docid": "2ccb6a0598a1dd48e2562d494c55ab40", "score": "0.54790604", "text": "static get properties() {\n return {\n };\n }", "title": "" }, { "docid": "623150287ecf2c1ddbad98d758e0c202", "score": "0.5463566", "text": "get p() { return { x: this.x, y: this.y }; }", "title": "" }, { "docid": "623150287ecf2c1ddbad98d758e0c202", "score": "0.5463566", "text": "get p() { return { x: this.x, y: this.y }; }", "title": "" }, { "docid": "6d034187a0ea9deb372715d0b3c5db3e", "score": "0.5455485", "text": "get x1() { return Object.getOwnPropertyDescriptor(this, 'p1') ? this.p1.x : 0; }", "title": "" }, { "docid": "ca85b00198bc63aa84b6b1cbc3bafb56", "score": "0.54487413", "text": "function optimizePropertyAccess(node) {\n var ok =\n node.type === \"MemberExpression\" &&\n node.computed &&\n node.property.type === \"Literal\" &&\n typeof node.property.value === \"string\" &&\n isSafe(node.property.value);\n if (ok) {\n var id = es.Identifier(null, node.property.value);\n return es.MemberExpression(null, false, node.object, id);\n }\n}", "title": "" }, { "docid": "a83f65fe0fa5fa867f593d808288c8c0", "score": "0.54341173", "text": "static get properties() {\n return { ...super.properties };\n }", "title": "" }, { "docid": "a83f65fe0fa5fa867f593d808288c8c0", "score": "0.54341173", "text": "static get properties() {\n return { ...super.properties };\n }", "title": "" }, { "docid": "61c88084dba49267957d017271cd2be0", "score": "0.54216313", "text": "function readThisProps(store, node) {\n var funcStore = store.properties.get(node.id.name);\n var statements = node.body.body;\n var i = 0;\n for (; i < statements.length; i++) {\n if (statements[i].expression &&\n statements[i].expression.type === \"AssignmentExpression\" &&\n statements[i].expression.left.type === \"MemberExpression\") {\n typeFromMember(store, statements[i].expression.left, node.id.name);\n }\n }\n}", "title": "" }, { "docid": "f5069cc1b591e9a0cc47e78f19ca5053", "score": "0.54111063", "text": "function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) die(31);\n this.derivation = options.get;\n this.name_ = options.name || (\"ComputedValue\");\n\n if (options.set) {\n this.setter_ = createAction(\"ComputedValue-setter\", options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = !!options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }", "title": "" }, { "docid": "b8bfe4aac1e33de5d210e08e6ce19e31", "score": "0.54087526", "text": "get x() { return Object.getOwnPropertyDescriptor(this, 'p') ? this.p.x : 0; }", "title": "" }, { "docid": "b8bfe4aac1e33de5d210e08e6ce19e31", "score": "0.54087526", "text": "get x() { return Object.getOwnPropertyDescriptor(this, 'p') ? this.p.x : 0; }", "title": "" }, { "docid": "9d021b9ec31b09ff6b388affdfd69cba", "score": "0.5407835", "text": "get p1() { return { x1: this.x1, y1: this.y1 }; }", "title": "" }, { "docid": "38230c0bf5e71a55afc985dfe36ad215", "score": "0.5388188", "text": "get bar() {\n return 2;\n }", "title": "" }, { "docid": "83000886497dbca97ef0bf7cd13deacb", "score": "0.5388091", "text": "function e$5(r){return r?r.__accessor__?r.__accessor__:r.propertyInvalidated?r:null:null}", "title": "" }, { "docid": "5db33c0b869202536f9642c9b0a79504", "score": "0.53878856", "text": "_propertiesChanged(currentProps, changedProps, oldProps) {\n // ----------------------------\n // let c = Object.getOwnPropertyNames(changedProps || {});\n // window.debug && console.group(this.localName + '#' + this.id + ': ' + c);\n // if (window.debug) { debugger; }\n // ----------------------------\n let hasPaths = this.__dataHasPaths;\n this.__dataHasPaths = false;\n // Compute properties\n runComputedEffects(this, changedProps, oldProps, hasPaths);\n // Clear notify properties prior to possible reentry (propagate, observe),\n // but after computing effects have a chance to add to them\n let notifyProps = this.__dataToNotify;\n this.__dataToNotify = null;\n // Propagate properties to clients\n this._propagatePropertyChanges(changedProps, oldProps, hasPaths);\n // Flush clients\n this._flushClients();\n // Reflect properties\n runEffects(this, this[TYPES.REFLECT], changedProps, oldProps, hasPaths);\n // Observe properties\n runEffects(this, this[TYPES.OBSERVE], changedProps, oldProps, hasPaths);\n // Notify properties to host\n if (notifyProps) {\n runNotifyEffects(this, notifyProps, changedProps, oldProps, hasPaths);\n }\n // Clear temporary cache at end of turn\n if (this.__dataCounter == 1) {\n this.__dataTemp = {};\n }\n // ----------------------------\n // window.debug && console.groupEnd(this.localName + '#' + this.id + ': ' + c);\n // ----------------------------\n }", "title": "" }, { "docid": "a7fa990ea8e0f887acbadaf88b264d4b", "score": "0.5384711", "text": "function setter() {\n throw new Error('vuex getter properties are read-only.');\n }", "title": "" }, { "docid": "a7fa990ea8e0f887acbadaf88b264d4b", "score": "0.5384711", "text": "function setter() {\n throw new Error('vuex getter properties are read-only.');\n }", "title": "" }, { "docid": "8ef9ee25eb82b21806ee25cd417f524b", "score": "0.53819823", "text": "update(_changedProperties){if(this._reflectingProperties!==void 0&&0<this._reflectingProperties.size){// Use forEach so this works even if for/of loops are compiled to for\n// loops expecting arrays\nthis._reflectingProperties.forEach((v,k)=>this._propertyToAttribute(k,this[k],v));this._reflectingProperties=void 0}this._markUpdated()}", "title": "" }, { "docid": "e27dc5ef390a3f8f728fc6eaa3c595c6", "score": "0.5381142", "text": "function computedObjectLiteral(func) {\n return {a: 1, b: 2, c: 3, ['test']: 4};\n}", "title": "" }, { "docid": "58d64d2f0e97556098b52fe2947b8c97", "score": "0.5372505", "text": "processProperty(context, prop) {\n return context\n }", "title": "" }, { "docid": "2678caecbc59dbe4be6a0f28a0e51de3", "score": "0.5369333", "text": "_set(propertyName, value, ...rest) {\n // Allow computed properties to be set regardless of proptypes. The get check will catch\n // any invalid values in computed properties. This allows Manikin to _set computed\n // properties during instantiation.\n //\n // Don't evaluate during object construction. This is because the default values get set first\n // followed by the initial values, and an invalid default value may get overridden by an\n // initial value, so throwing on the default value would be unwarrented.\n if (!(value instanceof ComputedProperty) && this.__constructed) {\n this._evaluatePropTypes(propertyName, value);\n }\n\n // Continue setting the property as usual\n return super._set(propertyName, value, ...rest);\n }", "title": "" }, { "docid": "5857449c6029c20875d642c430f2b336", "score": "0.5362927", "text": "get x() {}", "title": "" }, { "docid": "4b0e290fc5476c5f6859239340458f9a", "score": "0.5340928", "text": "function $rt_getPropField(base, propStr)\n{\n // If the base is a simple object\n if ($ir_is_object(base) || $ir_is_closure(base) || $ir_is_array(base))\n {\n var obj = base;\n\n // Note: BBV cannot propagate object shape from loop construct\n // shape is found for phi node inside loop but not propagated for\n // the object value flowing into the phi node\n\n // Try reading this as a normal property\n try\n {\n return $rt_getPropCache(obj, propStr);\n }\n\n // If the property is a getter-setter\n catch (propVal)\n {\n if ($ir_is_object(propVal))\n {\n return $rt_getProp(obj, propStr);\n }\n }\n\n // Get the prototype of the object\n var obj = $ir_obj_get_proto(obj);\n\n // If we have reached the end of the prototype chain\n if ($ir_is_null(obj))\n {\n return $undef;\n }\n\n // Until we reach the end of the prototype chain\n for (;;)\n {\n // Try reading this as a normal property\n try\n {\n return $rt_getPropCache(obj, propStr);\n }\n\n // If the property is a getter-setter\n catch (propVal)\n {\n if ($ir_is_object(propVal))\n {\n return $rt_getProp(obj, propStr);\n }\n }\n\n // Get the prototype of the object\n var obj = $ir_obj_get_proto(obj);\n\n // If we have reached the end of the prototype chain\n if ($ir_is_null(obj))\n {\n return $undef;\n }\n }\n }\n\n return $rt_getProp(base, propStr);\n}", "title": "" }, { "docid": "6bdb1c3f5d0720b2bfb76a5e43289c72", "score": "0.53271866", "text": "reify(props){// big perf optimization here: reify only *own* properties\n// since this object has __proto__ of the element's scope properties\nlet names=Object.getOwnPropertyNames(props);for(let i=0,n;i<names.length;i++){n=names[i];props[n]=this.valueForProperty(props[n],props)}}", "title": "" }, { "docid": "57416af426519fff288b4de5f66a24c1", "score": "0.5322568", "text": "static get properties() {\n return { };\n }", "title": "" }, { "docid": "c788c31af883877723472e5fe307cc72", "score": "0.53094286", "text": "function ComputedValue$$1(options) {\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isBeingObserved = false;\n this.isPendingUnobservation = false;\n this.observers = new Set();\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId$$1();\n this.value = new CaughtException$$1(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.isTracing = TraceMode$$1.NONE;\n this.firstGet = true;\n if (false)\n throw \"[mobx] missing option for computed: get\";\n this.derivation = options.get;\n this.name = options.name || \"ComputedValue@\" + getNextId$$1();\n if (options.set)\n this.setter = createAction$$1(this.name + \"-setter\", options.set);\n this.equals =\n options.equals ||\n (options.compareStructural || options.struct\n ? comparer$$1.structural\n : comparer$$1.default);\n this.scope = options.context;\n this.requiresReaction = !!options.requiresReaction;\n this.keepAlive = !!options.keepAlive;\n }", "title": "" }, { "docid": "c788c31af883877723472e5fe307cc72", "score": "0.53094286", "text": "function ComputedValue$$1(options) {\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isBeingObserved = false;\n this.isPendingUnobservation = false;\n this.observers = new Set();\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId$$1();\n this.value = new CaughtException$$1(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.isTracing = TraceMode$$1.NONE;\n this.firstGet = true;\n if (false)\n throw \"[mobx] missing option for computed: get\";\n this.derivation = options.get;\n this.name = options.name || \"ComputedValue@\" + getNextId$$1();\n if (options.set)\n this.setter = createAction$$1(this.name + \"-setter\", options.set);\n this.equals =\n options.equals ||\n (options.compareStructural || options.struct\n ? comparer$$1.structural\n : comparer$$1.default);\n this.scope = options.context;\n this.requiresReaction = !!options.requiresReaction;\n this.keepAlive = !!options.keepAlive;\n }", "title": "" }, { "docid": "1ef91c0d789f6444791a23d269a100d6", "score": "0.53032935", "text": "function ComputedValue$$1(options) {\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isBeingObserved = false;\n this.isPendingUnobservation = false;\n this.observers = new Set();\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId$$1();\n this.value = new CaughtException$$1(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.isTracing = TraceMode$$1.NONE;\n if ( true && !options.get)\n throw \"[mobx] missing option for computed: get\";\n this.derivation = options.get;\n this.name = options.name || \"ComputedValue@\" + getNextId$$1();\n if (options.set)\n this.setter = createAction$$1(this.name + \"-setter\", options.set);\n this.equals =\n options.equals ||\n (options.compareStructural || options.struct\n ? comparer$$1.structural\n : comparer$$1.default);\n this.scope = options.context;\n this.requiresReaction = !!options.requiresReaction;\n this.keepAlive = !!options.keepAlive;\n }", "title": "" }, { "docid": "9266e3d9372b45122a2e1e24c7b17226", "score": "0.53028697", "text": "function o6()\n{\n var e = Symbol('c');\n\n var o14 = o4.o14;\n try {\nfor (var o82 = 0; o3 < 3; o3++)\n {\n try {\no2 += o1.o2;\n}catch(e){} // hoisted field load\n try {\nObject.defineProperty(o1, \"sum\", { get: function() { try {\no4.o5(\"sum\" );\n}catch(e){} }, configurable: true });\n}catch(e){}\n try {\no2 += o1.o2;\n}catch(e){} // implicit call bailout\n }\n}catch(e){}\n}", "title": "" }, { "docid": "ffdba75f155e944de68e7eb5e0eab288", "score": "0.53028345", "text": "get normal() {\n return {}\n }", "title": "" }, { "docid": "3df590ac65786699f5dcb07f32ab5f93", "score": "0.52914095", "text": "function simulacrum() {\n try {\n if (!Object.prototype.__defineGetter__ && Object.defineProperty({}, 'x', {\n get: function () {\n return true\n }\n }).x) {\n Object.defineProperty(Object.prototype, '__defineGetter__', {\n enumerable: false,\n configurable: true,\n value: function (name, func) {\n Object.defineProperty(this, name, {\n get: func,\n enumerable: true,\n configurable: true\n });\n }\n });\n Object.defineProperty(Object.prototype, '__defineSetter__', {\n enumerable: false,\n configurable: true,\n value: function (name, func) {\n Object.defineProperty(this, name, {\n set: func,\n enumerable: true,\n configurable: true\n });\n }\n });\n }\n } catch (defPropException) {\n /*Do nothing if an exception occurs*/\n };\n}", "title": "" }, { "docid": "4e5c5aec21e291c85fe1409eefe283eb", "score": "0.52873665", "text": "static get properties() {\n return {\n totalCost: {type: Number},\n listOfMaterials: {type: Array},\n currentlySelectedMaterial: {type: Object},\n };\n }", "title": "" }, { "docid": "ba4c91d14a9e8890d858541b0d493ccb", "score": "0.5282811", "text": "_assign(props = {}) {\n props = checkProps('Accessor', props, PROP_CHECKS);\n\n if (props.type !== undefined) {\n this.type = props.type;\n\n // Auto-deduce integer type?\n if (props.type === GL.INT || props.type === GL.UNSIGNED_INT) {\n this.integer = true;\n }\n }\n if (props.size !== undefined) {\n this.size = props.size;\n }\n if (props.offset !== undefined) {\n this.offset = props.offset;\n }\n if (props.stride !== undefined) {\n this.stride = props.stride;\n }\n if (props.normalized !== undefined) {\n this.normalized = props.normalized;\n }\n if (props.integer !== undefined) {\n this.integer = props.integer;\n }\n\n // INSTANCE DIVISOR\n if (props.divisor !== undefined) {\n this.divisor = props.divisor;\n }\n\n // Buffer is optional\n if (props.buffer !== undefined) {\n this.buffer = props.buffer;\n }\n\n // The binding index (for binding e.g. Transform feedbacks and Uniform buffers)\n // TODO - should this be part of accessor?\n if (props.index !== undefined) {\n if (typeof props.index === 'boolean') {\n this.index = props.index ? 1 : 0;\n } else {\n this.index = props.index;\n }\n }\n\n // DEPRECATED\n if (props.instanced !== undefined) {\n this.divisor = props.instanced ? 1 : 0;\n }\n if (props.isInstanced !== undefined) {\n this.divisor = props.isInstanced ? 1 : 0;\n }\n\n return this;\n }", "title": "" }, { "docid": "8e857f77fa08cd60d20c88b3b89de3c1", "score": "0.5282767", "text": "function ComputedValue(options) {\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n\n this.newObserving = null; // during tracking it's an array with new observed observers\n\n this.isBeingObserved = false;\n this.isPendingUnobservation = false;\n this.observers = new Set();\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.value = new CaughtException(null);\n this.isComputing = false; // to check for cycles\n\n this.isRunningSetter = false;\n this.isTracing = TraceMode.NONE;\n invariant(options.get, \"missing option for computed: get\");\n this.derivation = options.get;\n this.name = options.name || \"ComputedValue@\" + getNextId();\n if (options.set) this.setter = createAction(this.name + \"-setter\", options.set);\n this.equals = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer.default);\n this.scope = options.context;\n this.requiresReaction = !!options.requiresReaction;\n this.keepAlive = !!options.keepAlive;\n }", "title": "" }, { "docid": "8b554cc0b228677f3ddc4af4bf630b7c", "score": "0.52813923", "text": "constructor(options) {\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isBeingObserved = false;\n this.isPendingUnobservation = false;\n this.observers = new Set();\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId$$1();\n this.value = new CaughtException$$1(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.isTracing = TraceMode$$1.NONE;\n this.firstGet = true;\n if (\"development\" !== \"production\" && !options.get)\n throw \"[mobx] missing option for computed: get\";\n this.derivation = options.get;\n this.name = options.name || \"ComputedValue@\" + getNextId$$1();\n if (options.set)\n this.setter = createAction$$1(this.name + \"-setter\", options.set);\n this.equals =\n options.equals ||\n (options.compareStructural || options.struct\n ? comparer$$1.structural\n : comparer$$1.default);\n this.scope = options.context;\n this.requiresReaction = !!options.requiresReaction;\n this.keepAlive = !!options.keepAlive;\n }", "title": "" }, { "docid": "8fe0699ba99b340eced982c62ffd4efc", "score": "0.52752864", "text": "function internalProperty(options){return property({attribute:!1,hasChanged:null===options||void 0===options?void 0:options.hasChanged})}", "title": "" }, { "docid": "69eb1b116957171c56fccaf204a4dfb4", "score": "0.5273912", "text": "evaluate() {\n this.value = this.get()\n this.dirty = false\n }", "title": "" }, { "docid": "cae2f4a66cbf3df68c7c6419443a9992", "score": "0.52715343", "text": "static get properties() {\n return {\n action: { type: String },\n value: { type: String },\n result: { type: String }\n };\n }", "title": "" }, { "docid": "66dc0646903d201506b265dc8b78e003", "score": "0.5266799", "text": "static get properties() {\n return {\n number: {\n type: Number,\n notify: true\n },\n image: {\n type: String,\n notify: true\n },\n title: {\n type: String,\n notify: true\n },\n date: {\n type: Object,\n notify: true\n },\n alt: {\n type: String,\n notify: true\n },\n transcript: {\n type: String,\n notify: true\n },\n label: {\n type: String,\n notify: true,\n computed: '_computeLabel(title, date)'\n },\n initialLoadHandled: {\n type: Boolean,\n value: false\n }\n };\n }", "title": "" }, { "docid": "deb74fc8f108da2a65832fb957981304", "score": "0.52666694", "text": "function _convertPropertyBinding(localResolver,implicitReceiver,expressionWithoutBuiltins,bindingId,form,interpolationFunction){if(!localResolver){localResolver=new DefaultLocalResolver}var currValExpr=createCurrValueExpr(bindingId);var visitor=new _AstToIrVisitor(localResolver,implicitReceiver,bindingId,interpolationFunction);var outputExpr=expressionWithoutBuiltins.visit(visitor,_Mode.Expression);var stmts=getStatementsFromVisitor(visitor,bindingId);if(visitor.usesImplicitReceiver){localResolver.notifyImplicitReceiverUse()}if(visitor.temporaryCount===0&&form==BindingForm.TrySimple){return new ConvertPropertyBindingResult([],outputExpr)}stmts.push(currValExpr.set(outputExpr).toDeclStmt(DYNAMIC_TYPE,[StmtModifier.Final]));return new ConvertPropertyBindingResult(stmts,currValExpr)}", "title": "" }, { "docid": "e0965f84ced5a7f95014b2d5a0f94473", "score": "0.52645403", "text": "function r$3(r){r&&r.writtenProperties&&r.writtenProperties.forEach((r=>{const t=r.target;r.newOrigin&&r.oldOrigin!==r.newOrigin&&i$c(t)&&t.updateOrigin(r.propName,r.newOrigin);}));}", "title": "" }, { "docid": "7fb693ef8c8232d343c1685fd13bbe72", "score": "0.52589875", "text": "function _PropertyExpressionEmitter() {\n}", "title": "" }, { "docid": "8714d4c76c8e6b395ad3dcb0f57cea59", "score": "0.52557063", "text": "function test1() {\n var {\n get\n } = {\n get: 1\n };\n let {\n set\n } = {\n set: 2\n };\n console.log(1, get);\n console.log(2, set);\n const {\n get: x\n } = {\n get: 3\n };\n var {\n set: y\n } = {\n set: 4\n };\n console.log(3, x);\n console.log(4, y);\n}", "title": "" }, { "docid": "d32360b563e4de26103a16dde5c296fc", "score": "0.5252839", "text": "function e$1y(r){return r?r.__accessor__?r.__accessor__:r.propertyInvalidated?r:null:null}", "title": "" }, { "docid": "ccca7a4498ba76b8244760d79e9ef3c3", "score": "0.52512676", "text": "function tryParseMethodDefinition(token,key,computed,node){var value,options,methodNode,params,previousAllowYield=state.allowYield;if(token.type===Token.Identifier){ // check for `get` and `set`;\nif(token.value==='get'&&lookaheadPropertyName()){computed=match('[');key=parseObjectPropertyKey();methodNode=new Node();expect('(');expect(')');state.allowYield=false;value=parsePropertyFunction(methodNode,{params:[],defaults:[],stricted:null,firstRestricted:null,message:null},false);state.allowYield=previousAllowYield;return node.finishProperty('get',key,computed,value,false,false);}else if(token.value==='set'&&lookaheadPropertyName()){computed=match('[');key=parseObjectPropertyKey();methodNode=new Node();expect('(');options={params:[],defaultCount:0,defaults:[],firstRestricted:null,paramSet:{}};if(match(')')){tolerateUnexpectedToken(lookahead);}else {state.allowYield=false;parseParam(options);state.allowYield=previousAllowYield;if(options.defaultCount===0){options.defaults=[];}}expect(')');state.allowYield=false;value=parsePropertyFunction(methodNode,options,false);state.allowYield=previousAllowYield;return node.finishProperty('set',key,computed,value,false,false);}}else if(token.type===Token.Punctuator&&token.value==='*'&&lookaheadPropertyName()){computed=match('[');key=parseObjectPropertyKey();methodNode=new Node();state.allowYield=true;params=parseParams();state.allowYield=previousAllowYield;state.allowYield=false;value=parsePropertyFunction(methodNode,params,true);state.allowYield=previousAllowYield;return node.finishProperty('init',key,computed,value,true,false);}if(key&&match('(')){value=parsePropertyMethodFunction();return node.finishProperty('init',key,computed,value,true,false);} // Not a MethodDefinition.\nreturn null;}", "title": "" }, { "docid": "38f6708bc9fccdef4d81788acce72f06", "score": "0.5250827", "text": "AssignmentExpression(assignmentPath) {\n const left = assignmentPath.get('left.object');\n if (left.isIdentifier() && left.node.name === name) {\n let initialConversion = convert(assignmentPath.get('right'), {\n ...context,\n mode: 'value'\n });\n defaultProps = initialConversion.members;\n }\n }", "title": "" }, { "docid": "45ef316f5bba9965218a2d894094b68b", "score": "0.523718", "text": "get rule() {\n return this.prop.rule;\n }", "title": "" }, { "docid": "052e98bcf19e5b4feaa4706b7f4e527d", "score": "0.5229864", "text": "function ComputedValue(options) {\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isBeingObserved = false;\n this.isPendingUnobservation = false;\n this.observers = new Set();\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.value = new CaughtException(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.isTracing = TraceMode.NONE;\n if ( true && !options.get)\n throw \"[mobx] missing option for computed: get\";\n this.derivation = options.get;\n this.name = options.name || \"ComputedValue@\" + getNextId();\n if (options.set)\n this.setter = createAction(this.name + \"-setter\", options.set);\n this.equals =\n options.equals ||\n (options.compareStructural || options.struct\n ? comparer.structural\n : comparer.default);\n this.scope = options.context;\n this.requiresReaction = !!options.requiresReaction;\n this.keepAlive = !!options.keepAlive;\n }", "title": "" }, { "docid": "052e98bcf19e5b4feaa4706b7f4e527d", "score": "0.5229864", "text": "function ComputedValue(options) {\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isBeingObserved = false;\n this.isPendingUnobservation = false;\n this.observers = new Set();\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.value = new CaughtException(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.isTracing = TraceMode.NONE;\n if ( true && !options.get)\n throw \"[mobx] missing option for computed: get\";\n this.derivation = options.get;\n this.name = options.name || \"ComputedValue@\" + getNextId();\n if (options.set)\n this.setter = createAction(this.name + \"-setter\", options.set);\n this.equals =\n options.equals ||\n (options.compareStructural || options.struct\n ? comparer.structural\n : comparer.default);\n this.scope = options.context;\n this.requiresReaction = !!options.requiresReaction;\n this.keepAlive = !!options.keepAlive;\n }", "title": "" }, { "docid": "b14b93e304e1b5094e3a851719d71a39", "score": "0.5229326", "text": "function y$2X(n={}){return (o,s)=>{if(o===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${o.name}.${s}. Accessor does not support static properties.`);const i=Object.getOwnPropertyDescriptor(o,s),a=s$4c(o,s);i&&(i.get||i.set?(a.get=i.get||a.get,a.set=i.set||a.set):\"value\"in i&&(\"value\"in n&&s$4g.getLogger(\"esri.core.accessorSupport.decorators.property\").warn(`@property() will redefine the value of \"${s}\" on \"${o.constructor.name}\" already defined in the metadata`,n),a.value=n.value=i.value)),null!=n.readOnly&&(a.readOnly=n.readOnly);const p=n.aliasOf;if(p){const t=\"string\"==typeof p?p:p.source,e=\"string\"==typeof p?null:!0===p.overridable;let r;a.dependsOn=[t],a.get=function(){let e=o$45(this,t);if(\"function\"==typeof e){r||(r=t.split(\".\").slice(0,-1).join(\".\"));const n=o$45(this,r);n&&(e=e.bind(n));}return e},a.readOnly||(a.set=e?function(t){this._override(s,t);}:function(e){t$4d(this,t,e);});}const u=n.type,c=n.types;a.cast||(u?a.cast=h$3u(u):c&&(Array.isArray(c)?a.cast=m$3X(S$1V(c[0])):a.cast=S$1V(c))),i$5e(a,n),n.range&&(a.cast=j$25(a.cast,n.range));}}", "title": "" }, { "docid": "a25bca07c9a925a2a6a0b8a9436d1959", "score": "0.52215976", "text": "static get properties() {\n return {\n __updated: {\n type: Boolean,\n },\n };\n }", "title": "" }, { "docid": "2c1abb05b38df3a6d7fde00653b865df", "score": "0.5218166", "text": "function ComputedValue(options) {\n var _this = this;\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isBeingObserved = false;\n this.isPendingUnobservation = false;\n this.observers = [];\n this.observersIndexes = {};\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.value = new CaughtException(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.isTracing = TraceMode.NONE;\n if (process.env.NODE_ENV !== \"production\" && !options.get)\n return fail$1(\"missing option for computed: get\");\n this.derivation = options.get;\n this.name = options.name || \"ComputedValue@\" + getNextId();\n if (options.set)\n this.setter = createAction(this.name + \"-setter\", options.set);\n this.equals =\n options.equals ||\n (options.compareStructural || options.struct\n ? comparer.structural\n : comparer.default);\n this.scope = options.context;\n this.requiresReaction = !!options.requiresReaction;\n if (options.keepAlive === true) {\n // dangerous: never exposed, so this cmputed value should not depend on observables\n // that live globally, or it will never get disposed! (nor anything attached to it)\n autorun(function () { return _this.get(); });\n }\n }", "title": "" }, { "docid": "f25325e30c102d68769ba2fbb0922fbc", "score": "0.5217056", "text": "get state() {\n // Here, state is a non-enumerable property.\n return this.getState();\n }", "title": "" }, { "docid": "f73839e3f9d7278ab64a9a37c4ad8a44", "score": "0.52122283", "text": "function someObject() {\n return {\n firstProp: \"firstProp\",\n secondProp: 100\n }\n}", "title": "" }, { "docid": "aa74493cdce7f6dd48568bc5bcf16188", "score": "0.5204333", "text": "@computed('model.error')\n get error() {\n const error = this.model.error;\n return error ? error[this.name] : null;\n }", "title": "" }, { "docid": "83742fb33130e34fcb84659aa5f42db1", "score": "0.51999253", "text": "function ComputedValue(options) {\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isBeingObserved = false;\n this.isPendingUnobservation = false;\n this.observers = [];\n this.observersIndexes = {};\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.value = new CaughtException(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.isTracing = TraceMode.NONE;\n invariant(options.get, \"missing option for computed: get\");\n this.derivation = options.get;\n this.name = options.name || \"ComputedValue@\" + getNextId();\n if (options.set)\n this.setter = createAction(this.name + \"-setter\", options.set);\n this.equals =\n options.equals ||\n (options.compareStructural || options.struct\n ? comparer.structural\n : comparer.default);\n this.scope = options.context;\n this.requiresReaction = !!options.requiresReaction;\n this.keepAlive = !!options.keepAlive;\n }", "title": "" }, { "docid": "65f5ff17b719328e370c28f7fe0f90f3", "score": "0.5198196", "text": "static get properties() {\n return {\n total: Object,\n togglePopup: Function\n }\n }", "title": "" }, { "docid": "fc5d9b96de706ccb4282da7ea1310d4e", "score": "0.51964545", "text": "get x(): B { return b }", "title": "" }, { "docid": "b9e681166d9a2f7d25723a41d7eb7290", "score": "0.518885", "text": "visitPropertyExpressionAssignment(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "5afdfa208be8b1e9ee682cf000afc018", "score": "0.51845026", "text": "validateProperties() {\n\n \t\tlet retVal = super.validateProperties();\n \t\tretVal = retVal ? this.validateTarget() : retVal;\n\n \t\treturn retVal;\n \t}", "title": "" }, { "docid": "ec1f172ed838420bee7f09df18e52174", "score": "0.5184098", "text": "get x(): C { return c }", "title": "" }, { "docid": "b4c47acf1f1fcbe326fdcef829767b9d", "score": "0.5181359", "text": "get value() {\n // @ts-ignore\n return super.value;\n }", "title": "" }, { "docid": "0625c4d9202c112e85a881785441ffbb", "score": "0.517917", "text": "#defineProperties() {\n /**********************\n * define properties\n */\n let that = this;\n stateKeys.forEach(s => {\n //e.g. this.isFulfilled\n Object.defineProperty(that, s, {\n enumerable: true,\n get() {\n return that.#states[s];\n },\n set(v) {\n // only the internal can set this variable\n console.log(`not possible to set state ${s}`, v);\n //that.#PPromise[s] = v\n }\n });\n });\n\n Object.defineProperties(this, {\n 'isUnbreakable': {\n enumerable : true,\n get() {\n return this.#isUnbreakable;\n },\n set(v) {\n if (this.#isUnbreakable || typeof v === 'undefined')\n return;\n\n this.#isUnbreakable = !!v;\n }\n },\n 'state' : {\n enumerable: true,\n get() {\n return (this.isPending && 'pending') ||\n (this.isRejected && 'rejected') ||\n (this.isFulfilled && 'fulfilled') ||\n undefined\n }\n },\n 'expectedValue': {\n enumerable: true,\n get() {\n return Object.assign({}, this.#values);\n }\n },\n 'result' : {\n enumerable: true,\n get() {\n return (this.isRejected && this.#values.reject) ||\n (this.isFulfilled && this.#values.resolve) ||\n undefined\n }\n },\n 'settled' : {\n enumerable: true,\n get() {\n if (this.isPending) {\n return null;\n } else {\n Object.assign(this.#PPromise, this);\n return this.#PPromise;\n }\n }\n },\n 'condition' : {\n enumerable: true,\n get() {\n return this.#condition;\n },\n set(v) {\n\n }\n },\n 'isConditional': {\n enumerable: true,\n get() {\n return this.#isConditional\n },\n set(v) {\n\n }\n },\n //can freely switch to solid but not the inverse\n 'type' : {\n enumerable: true,\n get() {\n let _map = {\n solid : 'promise:solid',\n standard: 'deferred:standard',\n fluid : 'deferred:fluid'\n };\n return _map[this.#Type.description];\n\n },\n set(newType) {\n if (this.#Type === solid)\n return; //cannot undo solid\n\n newType = PPromise.getType(newType);\n if (newType === null) return;\n\n if (newType === solid)\n this.#setSolid();\n\n if (newType === standard && this.#Type === fluid)\n this.#setStandard();\n\n\n if (typeof this.#Type === 'undefined')\n this.#setFluid();\n }\n }\n });\n }", "title": "" }, { "docid": "38301d188539a03b86d74f19cca7d30d", "score": "0.51779133", "text": "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((v,p)=>this[p]=v);this._instanceProperties=void 0}", "title": "" }, { "docid": "6207fa2e7a28a32541436b22ddc48195", "score": "0.5174886", "text": "get x2() { return Object.getOwnPropertyDescriptor(this, 'p2') ? this.p2.x : 0; }", "title": "" }, { "docid": "257617f782ddde7e68a3f8cbe986511a", "score": "0.51696014", "text": "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n\n this._instanceProperties = undefined;\n }", "title": "" }, { "docid": "ff5f565853a710ce639022f54cb1b5f0", "score": "0.5167628", "text": "function visitObjectLiteralExpression(node) {\n // We are here because a ComputedPropertyName was used somewhere in the expression.\n var properties = node.properties;\n var numProperties = properties.length;\n // Find the first computed property.\n // Everything until that point can be emitted as part of the initial object literal.\n var numInitialProperties = numProperties;\n var numInitialPropertiesWithoutYield = numProperties;\n for (var i = 0; i < numProperties; i++) {\n var property = properties[i];\n if (property.transformFlags & 16777216 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ && i < numInitialPropertiesWithoutYield) {\n numInitialPropertiesWithoutYield = i;\n }\n if (property.name.kind === 145 /* ComputedPropertyName */) {\n numInitialProperties = i;\n break;\n }\n }\n if (numInitialProperties !== numProperties) {\n if (numInitialPropertiesWithoutYield < numInitialProperties) {\n numInitialProperties = numInitialPropertiesWithoutYield;\n }\n // For computed properties, we need to create a unique handle to the object\n // literal so we can modify it without risking internal assignments tainting the object.\n var temp = ts.createTempVariable(hoistVariableDeclaration);\n // Write out the first non-computed properties, then emit the rest through indexing on the temp variable.\n var expressions = [];\n var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), node.multiLine), 65536 /* Indented */));\n if (node.multiLine) {\n ts.startOnNewLine(assignment);\n }\n expressions.push(assignment);\n addObjectLiteralMembers(expressions, node, temp, numInitialProperties);\n // We need to clone the temporary identifier so that we can write it on a\n // new line\n expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp);\n return ts.inlineExpressions(expressions);\n }\n return ts.visitEachChild(node, visitor, context);\n }", "title": "" }, { "docid": "5120be4b47aeebbd43454751d986b257", "score": "0.5165895", "text": "async getUserProperty() {\n throw log.subimpl;\n }", "title": "" }, { "docid": "ff64a7ff14a64963986294420884b640", "score": "0.51623744", "text": "visitPropertyGetter(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "79d49bb30b9dea6b56635f9674463d45", "score": "0.5158349", "text": "get something() {return this._something;}", "title": "" }, { "docid": "6a2cf2b7c99b32f98a768c904ae22acd", "score": "0.51571727", "text": "function ComputedValue(options) {\n var _this = this;\n this.dependenciesState = exports.IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isBeingObserved = false;\n this.isPendingUnobservation = false;\n this.observers = [];\n this.observersIndexes = {};\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = exports.IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.value = new CaughtException(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.isTracing = TraceMode.NONE;\n if (process.env.NODE_ENV !== \"production\" && !options.get)\n return fail$1(\"missing option for computed: get\");\n this.derivation = options.get;\n this.name = options.name || \"ComputedValue@\" + getNextId();\n if (options.set)\n this.setter = createAction(this.name + \"-setter\", options.set);\n this.equals =\n options.equals ||\n (options.compareStructural || options.struct\n ? comparer.structural\n : comparer.default);\n this.scope = options.context;\n this.requiresReaction = !!options.requiresReaction;\n if (options.keepAlive === true) {\n // dangerous: never exposed, so this cmputed value should not depend on observables\n // that live globally, or it will never get disposed! (nor anything attached to it)\n autorun(function () { return _this.get(); });\n }\n }", "title": "" }, { "docid": "2ea06934c99aabce7a815aaa073fcac1", "score": "0.5152306", "text": "visitFunctionProperty(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "e64a29e92cccb88469da34e04cee4120", "score": "0.5152222", "text": "function ComputedProxyFactory (target) {\n return new Proxy(target, {\n get (target, prop, receiver) {\n return (typeof target[prop] === 'object')\n ? ComputedProxyFactory(target[prop])\n : computed(() => target[prop])\n }\n })\n }", "title": "" }, { "docid": "9fff2a09583ddb3d7f576f1e3a141889", "score": "0.515204", "text": "static get properties() {\n return {\n index: {\n type: Number,\n value: \"not defined\"\n }\n };\n }", "title": "" }, { "docid": "2f72bbed40579d091b9ae063b4cede47", "score": "0.51480913", "text": "function ComputedValue(derivation, scope, equals, name, setter) {\n this.derivation = derivation;\n this.scope = scope;\n this.equals = equals;\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isPendingUnobservation = false;\n this.observers = [];\n this.observersIndexes = {};\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.value = new CaughtException(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.isTracing = TraceMode.NONE;\n this.name = name || \"ComputedValue@\" + getNextId();\n if (setter)\n this.setter = createAction(name + \"-setter\", setter);\n }", "title": "" }, { "docid": "13bf600bb39df157f1aeb6dbb75bdbc1", "score": "0.5145171", "text": "property(name) {\n return name in this.object ? Maybe.Just(this.for(this.object[name]))\n : /* otherwise */ Maybe.Nothing();\n }", "title": "" }, { "docid": "24fcedf51ebda236218e9abbf89a53de", "score": "0.5142108", "text": "function ComputedValue(derivation, scope, equals, name, setter) {\n this.derivation = derivation;\n this.scope = scope;\n this.equals = equals;\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isPendingUnobservation = false;\n this.observers = [];\n this.observersIndexes = {};\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.value = new CaughtException(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.name = name || \"ComputedValue@\" + getNextId();\n if (setter)\n this.setter = createAction(name + \"-setter\", setter);\n }", "title": "" }, { "docid": "24fcedf51ebda236218e9abbf89a53de", "score": "0.5142108", "text": "function ComputedValue(derivation, scope, equals, name, setter) {\n this.derivation = derivation;\n this.scope = scope;\n this.equals = equals;\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isPendingUnobservation = false;\n this.observers = [];\n this.observersIndexes = {};\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.value = new CaughtException(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.name = name || \"ComputedValue@\" + getNextId();\n if (setter)\n this.setter = createAction(name + \"-setter\", setter);\n }", "title": "" }, { "docid": "e92466465ba8ba97af2e6805924e9b85", "score": "0.51409906", "text": "get p2() { return { x2: this.x2, y2: this.y2 }; }", "title": "" }, { "docid": "0e12d0e7cb98a4d7e30353b4ab5d870c", "score": "0.5139906", "text": "function addProperty () {\n this.val = 6\n}", "title": "" }, { "docid": "2681fcb2c2e57323fa2814b89c1c3954", "score": "0.5137841", "text": "function visitObjectLiteralExpression(node) {\n // We are here because a ComputedPropertyName was used somewhere in the expression.\n var properties = node.properties;\n var numProperties = properties.length;\n // Find the first computed property.\n // Everything until that point can be emitted as part of the initial object literal.\n var numInitialProperties = numProperties;\n var numInitialPropertiesWithoutYield = numProperties;\n for (var i = 0; i < numProperties; i++) {\n var property = properties[i];\n if ((property.transformFlags & 16777216 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */)\n && i < numInitialPropertiesWithoutYield) {\n numInitialPropertiesWithoutYield = i;\n }\n if (property.name.kind === 145 /* ComputedPropertyName */) {\n numInitialProperties = i;\n break;\n }\n }\n if (numInitialProperties !== numProperties) {\n if (numInitialPropertiesWithoutYield < numInitialProperties) {\n numInitialProperties = numInitialPropertiesWithoutYield;\n }\n // For computed properties, we need to create a unique handle to the object\n // literal so we can modify it without risking internal assignments tainting the object.\n var temp = ts.createTempVariable(hoistVariableDeclaration);\n // Write out the first non-computed properties, then emit the rest through indexing on the temp variable.\n var expressions = [];\n var assignment = ts.createAssignment(temp, ts.setEmitFlags(ts.createObjectLiteral(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), node.multiLine), 65536 /* Indented */));\n if (node.multiLine) {\n ts.startOnNewLine(assignment);\n }\n expressions.push(assignment);\n addObjectLiteralMembers(expressions, node, temp, numInitialProperties);\n // We need to clone the temporary identifier so that we can write it on a\n // new line\n expressions.push(node.multiLine ? ts.startOnNewLine(ts.getMutableClone(temp)) : temp);\n return ts.inlineExpressions(expressions);\n }\n return ts.visitEachChild(node, visitor, context);\n }", "title": "" } ]
80393e6f8260ce37165fdbcf6b901cc2
Gets the current users organization.
[ { "docid": "b264aebd10963f14b717fa992f996a97", "score": "0.6438702", "text": "async getOrganization({ commit, state }) {\n let response = await orgAPI.getOrganization();\n if (response.status === 200 && response.data) {\n commit('set_organization', {\n organization: response.data\n })\n return state.organization;\n }\n }", "title": "" } ]
[ { "docid": "533a743e9227246d67e37f7df0e36211", "score": "0.7033543", "text": "get organization() {\n let orgFromConfig = shell.exec( 'git config --get beanstalk.organization' ).stdout.trim();\n\n if ( orgFromConfig ) {\n return orgFromConfig;\n }\n\n let { isValid, organization, repository } = GitUtils.parseCurrentRepositoryOrigin();\n return organization;\n }", "title": "" }, { "docid": "7a3caa7cbf342f0725a11db0377bfce1", "score": "0.7016458", "text": "get organization() {\n\t\treturn this.__organization;\n\t}", "title": "" }, { "docid": "7a3caa7cbf342f0725a11db0377bfce1", "score": "0.7016458", "text": "get organization() {\n\t\treturn this.__organization;\n\t}", "title": "" }, { "docid": "27d3cf225fe78a694a72c68f7505db71", "score": "0.649183", "text": "get managingOrganization() {\n\t\treturn this.__managingOrganization;\n\t}", "title": "" }, { "docid": "7db0b821352c8e76e81648b4d1cf9fc9", "score": "0.6391129", "text": "async function getOrg(req, reply) {\n const { id } = req.params\n const { user_id } = req.session\n\n if (!id) {\n throw Boom.badRequest('organization id is required')\n }\n\n let [data, isMember, isManager, isOwner] = await Promise.all([\n organization.get(id),\n organization.isMember(id, user_id),\n organization.isManager(id, user_id),\n organization.isOwner(id, user_id),\n ])\n\n // User needs to be member or staff to access a private org\n if (data?.privacy === 'private' && !isMember && !isManager && !isOwner) {\n throw Boom.unauthorized()\n } else {\n reply.send({ ...data, isMember, isManager, isOwner })\n }\n}", "title": "" }, { "docid": "cfd67d4f25a226fe700b482f28c1f07e", "score": "0.6186923", "text": "async function getOrganizationId (req) {\n if(!req.session.organizationId){\n let dsApiClient = new docusignAdmin.ApiClient();\n dsApiClient.setBasePath(`${dsConfig.adminAPIUrl}`);\n dsApiClient.addDefaultHeader('Authorization', 'Bearer ' + req.user.accessToken);\n\n const accountsApi = new docusignAdmin.AccountsApi(dsApiClient);\n const organizations = await accountsApi.getOrganizations();\n\n // It's possible to belong to more than one organization, but we assume you are in a single organization.\n const orgId = organizations.organizations[0].id;\n req.session.organizationId = orgId;\n }\n}", "title": "" }, { "docid": "59f35abff80226738393fac0f75cb0cf", "score": "0.58521736", "text": "getUser() {\n\t\treturn this.auth.currentUser;\n\t}", "title": "" }, { "docid": "eb83a3adaaad3653c6977279a5e3bd30", "score": "0.5733028", "text": "function currentUser() {\n return userInfo();\n }", "title": "" }, { "docid": "ba244cf5ca0c9050cdd26921cb142702", "score": "0.5687666", "text": "async getAllOrganizations({ commit, getters }) {\n let response = await orgAPI.getAllOrganizations();\n if (response.status === 200) {\n commit('set_all_organizations', {\n organizations: response.data\n })\n }\n\n return getters.allOrganizations;\n }", "title": "" }, { "docid": "5c6eb136e8b0a8bc6bc92e927236fbaa", "score": "0.56729406", "text": "async getOrgSettings(_options) {\n let _config = _options || this.configuration;\n // Path Params\n const path = '/api/v1/org';\n // Make Request Context\n const requestContext = _config.baseServer.makeRequestContext(path, http_1.HttpMethodEnum.GET);\n requestContext.setHeaderParam('Accept', 'application/json, */*;q=0.8');\n let authMethod;\n // Apply auth methods\n authMethod = _config.authMethods['apiToken'];\n if (authMethod?.applySecurityAuthentication) {\n await authMethod?.applySecurityAuthentication(requestContext);\n }\n // Apply auth methods\n authMethod = _config.authMethods['oauth2'];\n if (authMethod?.applySecurityAuthentication) {\n await authMethod?.applySecurityAuthentication(requestContext);\n }\n const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;\n if (defaultAuth?.applySecurityAuthentication) {\n await defaultAuth?.applySecurityAuthentication(requestContext);\n }\n return requestContext;\n }", "title": "" }, { "docid": "d4f36cdaf01b7e9aef56b0355333a62a", "score": "0.564958", "text": "getOrgs() {\n return new Promise((resolve, reject) => {\n if (!this.username) {\n reject(Error(\"Invalid Username\"));\n }\n\n fetch(`https://api.github.com/users/${this.username}/orgs`)\n .then((data) => {\n resolve(data.json());\n })\n .catch((err) => {\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "721cc083a1a773859a4cff3a913c332b", "score": "0.5625576", "text": "function getOE() {\n h.get(\"./organisations\").then(function(resp) {\n updateOrganisationMenu(\"nav-drawer\", JSON.parse(resp), true);\n updateOrganisationMenu(\"nav-drawer-frame\", JSON.parse(resp), false);\n });\n}", "title": "" }, { "docid": "57541cfa1f5ed1e5c5033ab40d8e0daf", "score": "0.5623436", "text": "async getOrganizationById({ commit, getters }, { id }) {\n if (!id) {\n throw Error('Organization id cannot be null')\n }\n\n // Only fetch the organization if our collection doesn't contain it.\n if (!getters.getOrganizationCollection || !getters.getOrganizationCollection.find(x => { return x.id === id })) {\n let response = await orgAPI.getOrganizationById({ id });\n\n if (response.status === 200) {\n commit('add_organization_to_collection', {\n organization: response.data\n })\n }\n }\n\n return getters.getOrganizationCollection.find(x => { return x.id === id });\n }", "title": "" }, { "docid": "366b21826a31342034553fbc7408bb78", "score": "0.55895364", "text": "function getCurrentUser() {\n\tvar context = nlapiGetContext();\n\treturn context.getUser();\n}", "title": "" }, { "docid": "915e59f7fe03a3fc9c1980336ae8cd74", "score": "0.5517383", "text": "function getOrganization(community, organization) {\n for(i in resources[community].organizations) {\n if (resources[community].organizations[i].name==organization) {\n return resources[community].organizations[i];\n }\n }\n //console.log(\"Cannot find event\")\n //console.log(community + \"|\"+ organizations)\n }", "title": "" }, { "docid": "e90d23c0852c5c9ea66f49aa167e81a4", "score": "0.5507307", "text": "users_and_projects() {\r\n\t\treturn API.get(\"pm\", \"/list-users-and-projects\");\r\n\t}", "title": "" }, { "docid": "64ea6e99164be94dfa91943163e3aeb6", "score": "0.54747283", "text": "getUser() {\n\t\treturn this.getSession().getUser();\n\t}", "title": "" }, { "docid": "e79391dde6a01b8cb6a98759ad7a7579", "score": "0.54739326", "text": "retrieve(req, res) {\n return Organizations\n .findById(req.params.orgId, {\n include: [{\n model: Projects,\n as: 'projects',\n },\n {\n model: Users,\n as: 'users',\n }],\n })\n .then((org) => {\n if (!org) {\n return res.status(404).send({\n message: 'Organization Not Found',\n });\n }\n return res.status(200).send(org);\n })\n .catch((error) => res.status(400).send(error));\n }", "title": "" }, { "docid": "36e49b1438bec02369769d64e13a95c4", "score": "0.5462101", "text": "function getOrgId(token,cb){\n\n request.get({\n \"headers\": { \"content-type\": \"application/json\",\"Authorization\": `Bearer ${token}` },\n \"url\": config.get('anypoint.host2') + config.get('anypoint.path2')\n\n},\n(error, res, body) => {\n if (error) {\n console.error(error)\n return\n }\n //console.log(`statusCode: ${res.statusCode}`)\n //console.log(\"LIST OF ENVs\")\n console.log(\"----------------------------------------------\")\n //console.log(body)\n const resBody = JSON.parse(body)\n var orgId = resBody.user.organization.id\n cb(orgId)\n \n })\n\n}", "title": "" }, { "docid": "79c4d2ae7fc984182b3a5159f5c44876", "score": "0.54208773", "text": "function getCurrentUser() {\n console.log(loggedIn);\n return currentUser;\n }", "title": "" }, { "docid": "63df1f8fe991b529714e1214530dbe6c", "score": "0.5419044", "text": "getCurrentUserJid() {\r\n return this.comms.username;\r\n }", "title": "" }, { "docid": "1c1feb645a16f3c191fcbd099d9a385e", "score": "0.54053843", "text": "getOrgRef(orgUID=null){\n //make sure the user's uid is initialize first\n if((this.uid != \"\") && (orgUID != null)){\n return firebase.database().ref(`${this.profileDataPath}/${this.orgDataPath}/${orgUID}`)\n }\n }", "title": "" }, { "docid": "68ea8a2d9caa093b42f2f89efad15c81", "score": "0.5400664", "text": "function getOrg(){\n \n generateToken((body)=>{\n request.get({\n \"headers\": { \"content-type\": \"application/json\",\"Authorization\": `Bearer ${body.access_token}` },\n \"url\": \"https://anypoint.mulesoft.com\" + config.get('anypoint.path2')\n },\n (error, res, body) => {\n if (error) {\n console.error(error)\n return\n }\n console.log(`statusCode: ${res.statusCode}`)\n console.log(\"LIST OF ORGs\")\n console.log(\"----------------------------------------------\")\n //console.log(JSON.parse(body))\n var getOrgRes = JSON.parse(body)\n var getOrgRes1 = getOrgRes.user.contributorOfOrganizations \n \n const getOrgRes2 = getOrgRes1.map(item => {\n const container = {};\n container.id = item.id;\n container.name = item.name;\n container.parentOrg = item.isMaster\n return container;\n })\n console.log(getOrgRes2);\n console.log(\"----------------------------------------------\")\n //console.log(getOrgRes.user.contributorOfOrganizations)\n }\n \n )\n })\n}", "title": "" }, { "docid": "0e87f7a62c023333cef9947baaaa2762", "score": "0.5391248", "text": "getCurrentUserResource() {\r\n return this.comms.getCurrentUserResource();\r\n }", "title": "" }, { "docid": "a9684849ea7f7e914df7d0eae5c9c577", "score": "0.5361607", "text": "function populateBillingOrganizations(){\n var params = {\n role: \"administrator\",\n level: {\n value: \"2\"\n }\n };\n\n getBillingOrganizationsService.getOrganizationsForLoggedInUser(params).then(function(data){\n $scope.billingOrganizationList = _.map(data.role, function(val){\n return val.scopingOrganization;\n });\n\n //redirect to Case Inbox if no organization is present\n if($scope.billingOrganizationList.length < 1){\n redirectToCaseInbox();\n }\n\n //If only 1 organization is present,then select that organization\n if($scope.billingOrganizationList.length === 1){\n $scope.selectedBillingOrganization = $scope.billingOrganizationList[0];\n }\n }, function(){\n redirectToCaseInbox();\n });\n }", "title": "" }, { "docid": "ed5335c7cbe727f3f5f862857b4abff6", "score": "0.5352866", "text": "function getUser() {\n return user;\n }", "title": "" }, { "docid": "ed5335c7cbe727f3f5f862857b4abff6", "score": "0.5352866", "text": "function getUser() {\n return user;\n }", "title": "" }, { "docid": "dc1b03ced4eb5869c427e6f27843a8ea", "score": "0.5341196", "text": "function getOrganization(name, access_token, callback) {\n var url = process.env.HOST_URL + process.env.LP_PATH\n + 'orgstructure/?orgUnitType=' + encodeURIComponent(process.env.ORGANIZATION_TYPE_ID)\n + '&orgUnitName=' + encodeURIComponent(name);\n\n // Multiple results are possible since orgUnitNames are not unique and are matched as a substring.\n getPaginated(url, access_token, function(err, organizations) {\n if (err) return callback(err);\n // Narrow the results down to one exact match.\n getExactMatch(organizations, {Name: name}, callback);\n });\n}", "title": "" }, { "docid": "58a9e59cad244983cd4c1b628ead4eda", "score": "0.5309983", "text": "async getOrganisationsCount() {\n return this.orgRegistryContract.getOrgCount();\n }", "title": "" }, { "docid": "1b2c26bd8139e8abacecabec7210b4a7", "score": "0.5297201", "text": "function getOrg(url, token) {\n fetch(url, { headers: {\"Authorization\": \"Bearer \" + token\n }\n}\n)\n .then(function (response) {\n console.log(response);\n // display the status\n\n responseText.textContent = response.status;\n // check the response status for success\n if (response.status === 200) {\n responseText.style.color = 'green';\n } else {\n responseText.style.color = 'red';\n }\n return response.json();\n })\n .then(function (data) {\n console.log(data);\n\n orgName = data.organization.name;\n\n console.log(orgName);\n\n });\n}", "title": "" }, { "docid": "edac1123476be4fda9189e1ed2b8b7bf", "score": "0.52920884", "text": "async getOrgProfile(id) {\n let data = await dbContext.OrgProfile.findOne({ _id: id }).populate(\"profileId\")\n if (!data) {\n throw new BadRequest(\"Invalid ID or you do not own this list\")\n }\n return data\n }", "title": "" }, { "docid": "e19bd7b3b961a1dde5f98665600e3dd9", "score": "0.5282509", "text": "getUser() {\n return this.builder.config.user;\n }", "title": "" }, { "docid": "14921d888b5ae7eb1644febccb5f9e15", "score": "0.5256593", "text": "function getUserContainer()\n{\n\treturn Homey.ManagerSettings.get('userContainer');\n}", "title": "" }, { "docid": "644a0f1d9c95474ecf83ac26aa02e76b", "score": "0.5250502", "text": "function getUser() {\n\t\t\treturn _this.user;\n\t\t}", "title": "" }, { "docid": "487a6938e998cf2e8863b833aa06ab45", "score": "0.52451074", "text": "currentUser() {\n return this.get(`${this.domain}/user`);\n }", "title": "" }, { "docid": "c28933a1e67a6885be399c70aa4d1bd0", "score": "0.5214214", "text": "function owner() {\n return Session.getCurrentUser() && Session.getCurrentUser()._id;\n }", "title": "" }, { "docid": "1d1728f34352fff375b5e8bc3c8d053d", "score": "0.51527613", "text": "function foundationFhirOrganization() {\n return {\n organizationResource: {\n resourceType: \"Organization\",\n text: {\n status: \"generated\",\n div: \"\"\n }\n },\n getOrganizationName: function () {\n return this.organizationResource.name;\n },\n getOrganizationId: function () {\n return this.organizationResource.id;\n },\n resourceType: \"Organization\"\n };\n}", "title": "" }, { "docid": "5bc2172a917cdfdbb70089ec6c1009f3", "score": "0.51524913", "text": "function get_user_repo () {\n return new Promise((resolve, reject) => {\n exec('git config --get remote.origin.url', (err, stdout, stderr) => {\n if (err) {\n reject(err)\n return\n }\n const url = stdout.trim()\n const parts = url.split('/')\n // GitHub URLs can have many forms, taking the last two path parameters\n // is the only robust way to discover the user/repo.\n let user = parts[parts.length - 2].replace('.git', '')\n const repo = parts[parts.length - 1].replace('.git', '')\n if (user.includes(':')) {\n // SSH-style [email protected]:foo\n user = user.split(':')[1]\n }\n resolve({user, repo})\n })\n })\n}", "title": "" }, { "docid": "0e467b5d4b32ee43279c0a1f337b8722", "score": "0.5143827", "text": "function getCorporation() {\n if($sessionStorage.selectedCorporation)\n return JSON.parse(Base64.decode($sessionStorage.selectedCorporation));\n else\n return null;\n }", "title": "" }, { "docid": "30e694a0772b0f3eebde33a644801f10", "score": "0.51357234", "text": "getSelf() {\n\t\treturn this._get(\"/api/user\");\n\t}", "title": "" }, { "docid": "d4d209dbc12257eb063ac351c6cf1e9c", "score": "0.5123524", "text": "function getUser() {\r\n var users = JSON.parse(localStorage.getItem(\"users\"));\r\n if (users) {\r\n var returnUser;\r\n users.forEach(function (user) {\r\n if (user.loggedIn) {\r\n returnUser = user;\r\n }\r\n });\r\n }\r\n return returnUser;\r\n}", "title": "" }, { "docid": "e7cc6ea5a45cfbee7ca8a9c6657983de", "score": "0.51054525", "text": "getCurrentAccount(context) {\n\t\tconst { user } = context.meta;\n\t\tif (!user) {\n\t\t\treturn {};\n\t\t}\n\t\treturn {\n\t\t\tuserName: context.meta.userName,\n\t\t\tuserId: context.meta.userId,\n\t\t\tinfo: user._doc || {}\n\t\t};\n\t}", "title": "" }, { "docid": "d852273ad3d476e75b407c7a2585f215", "score": "0.51009893", "text": "getCurrentUser() {\n return new Promise((resolve, reject) => {\n this.requestHandler.request('GET', 'me').then(result => {\n resolve(result)\n })\n })\n }", "title": "" }, { "docid": "1835386763bb7a2ea3d71aeb897adecc", "score": "0.50646394", "text": "getUser() {\n if (getUser()) return getUser();\n else return false;\n }", "title": "" }, { "docid": "a77be505a0b3cc835df273148ab6fbe9", "score": "0.5060601", "text": "organizations() {\n return _.map(organizationList, function makeOrganizationObject(organization) {\n return { label: organization };\n });\n }", "title": "" }, { "docid": "dedb060ead44086962feca066e21f2b6", "score": "0.505402", "text": "getScopes(){\n let self = this\n return new Promise((resolve, reject) => {\n self.mgr.getUser().then(function (user) {\n if (user == null) {\n self.signIn()\n return resolve(null)\n } else{\n return resolve(user.scopes)\n }\n }).catch(function (err) {\n console.log(err)\n return reject(err)\n });\n })\n }", "title": "" }, { "docid": "19debdf387cbef6aa9b54e7cca631524", "score": "0.5046379", "text": "function getUserInfo() {\n var returnValue;\n\n try {\n var result = Ab.workflow.Workflow.call('AbCommonResources-getUser', {});\n\n if (Ab.workflow.Workflow.sessionTimeoutDetected) {\n returnValue = {'name': \"timeout\", 'role': \"timeout\"};\n }\n else if (result.data) {\n var adminPath = AdminService._path;\n var webAppContextPath = '';\n if (adminPath) {\n webAppContextPath = adminPath.substr(0, adminPath.indexOf('/', 2) + 1);\n }\n\n returnValue = {\n 'name': result.data.user_name,\n 'role': result.data.role_name,\n 'groups': result.data.groups,\n 'projectName': result.data.projectName,\n 'serverVersion': result.data.serverVersion,\n 'locale': result.data.locale,\n 'languageExtension': result.data.languageExtension,\n 'colorScheme': result.data.colorScheme,\n 'webAppContextPath': webAppContextPath\n };\n }\n }\n catch (e) {\n Workflow.handleError(e);\n }\n\n return returnValue;\n}", "title": "" }, { "docid": "e7902563044aaf5026590d3b8caec1ef", "score": "0.5045536", "text": "getAggregatedOrganizationOverview(orgName, callback) {\n this.getAggregatedOverview((error, results) => {\n if (error) {\n return callback(error);\n }\n const lco = orgName.toLowerCase();\n const removeOtherTeams = team => {\n return team.organization.login.toLowerCase() !== lco;\n };\n _.remove(results.teams.member, removeOtherTeams);\n _.remove(results.teams.maintainer, removeOtherTeams);\n // At this time it does not simplify or reduce repo lists or the general orgs list\n return callback(null, results);\n });\n }", "title": "" }, { "docid": "c5e8b8a5ab4803e2c6c5ce0630fa3df6", "score": "0.50437826", "text": "async getWellknownOrgMetadata(_options) {\n let _config = _options || this.configuration;\n // Path Params\n const path = '/.well-known/okta-organization';\n // Make Request Context\n const requestContext = _config.baseServer.makeRequestContext(path, http_1.HttpMethodEnum.GET);\n requestContext.setHeaderParam('Accept', 'application/json, */*;q=0.8');\n const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;\n if (defaultAuth?.applySecurityAuthentication) {\n await defaultAuth?.applySecurityAuthentication(requestContext);\n }\n return requestContext;\n }", "title": "" }, { "docid": "b3c4bc24295e5ff0daa536c257b6c29e", "score": "0.5040803", "text": "getUser() {\n return this.user;\n }", "title": "" }, { "docid": "966e549430e636a1ce05ab1d2f29e25e", "score": "0.5034078", "text": "static get currentUser() {\n return currentUser;\n }", "title": "" }, { "docid": "431729e4e061b36a54824e1ac81c314d", "score": "0.50331384", "text": "function getCompany() {\n if ( props.docMode && props.docMode==='true') {\n return \"\";\n } else {\n return location.state.company;\n }\n }", "title": "" }, { "docid": "0cf185c9148f05f5bd3ab9c333132c37", "score": "0.50238", "text": "getCurrentUser() {\r\n return auth.currentUser;\r\n }", "title": "" }, { "docid": "5d4b34a359b7d1f22fd88db7bfa3fa93", "score": "0.50228155", "text": "getAuthUser( req, res ) {\n\t\tUsers.findOne( { email: req.user._json.email }, ( err, user ) => {\n\t\t\tif ( user ) {\n\t\t\t\tUsers.findById( user._id )\n\t\t\t\t\t// ANY POPULATION CAN BE DONE HERE, FOR EXAMPLE\n\t\t\t\t\t// .populate( 'payments' )\n\n\t\t\t\t\t.exec( ( error, currentUser ) => {\n\t\t\t\t\t\tif ( error ) {\n\t\t\t\t\t\t\treturn res.status( 500 ).json( error );\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn res.status( 200 ).json( currentUser );\n\t\t\t\t\t} );\n\t\t\t} else if ( err ) {\n\t\t\t\treturn res.status( 500 ).json( err );\n\t\t\t}\n\t\t} );\n\t}", "title": "" }, { "docid": "172c3abaf05bd200289b7899b3de2e57", "score": "0.50194496", "text": "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "title": "" }, { "docid": "abcb176445b7309dd4450f71564206f5", "score": "0.49986407", "text": "async adminGetUsers({ commit }, { organizationId }) {\n let response = await orgUserAPI.adminGetOrganizationUsers({ organizationId });\n if (response.status === 200) {\n commit('set_users', {\n users: response.data\n })\n }\n }", "title": "" }, { "docid": "152154f3cd7d7a6dd17768f80b2eeade", "score": "0.49919346", "text": "function getCurrentUserFromPodio () {\n queryPodioAPI({\n verb: 'GET',\n endpoint: '/user',\n callback: function(profile) {\n window.currentUser = profile.mails[0].mail\n }\n })\n}", "title": "" }, { "docid": "6f9da30cf567745bfe0ba4e31b617c96", "score": "0.4990071", "text": "function get_user() {\n return stateMap.user;\n }", "title": "" }, { "docid": "77e29b7940e1d8f796dc2cc1dc432991", "score": "0.49818438", "text": "getUserOwnRepo() {\n const self = this\n let url = this._getUrl('/projects/owned')\n return _request(url).then((results) => {\n return results.data.map((repo) => self._formatRepo(repo))\n })\n }", "title": "" }, { "docid": "29975e3a12aabc2d6143c8ccce1e9a67", "score": "0.49788263", "text": "function getGlobalUser(){\n\t\tif(sessionStorage){\n\t\t\tvar currentUserString = sessionStorage.getItem(\"currentUser\");\n\t\t \tif(!currentUserString){\n\t\t \t\tconsole.log(\"Unable to retrieve user!\");\n\t\t\t\tlogout();\n\t\t \t}\n\t\t \telse{\n\t\t \t\treturn $.parseJSON(currentUserString);\n\t\t \t}\n\t\t}\n\t\telse{\n\t\t\tconsole.log(\"session storage not available!\");\n\t\t\tlogout();\n\t\t}\n\t}", "title": "" }, { "docid": "5ea3caa74b1be67f1a2a997cd492dc7e", "score": "0.4938142", "text": "function getCurrentUser() {\n return makeXhrRequest(\n HTTP_GET,\n `${svcHost}/user/`\n )\n}", "title": "" }, { "docid": "9c0830b660eb22cf9f28aa03d2638173", "score": "0.49339154", "text": "function getUserInDirectory (email) {\n return gapi.client.directory.users.get({\n userKey: email,\n viewType: 'domain_public'\n })\n}", "title": "" }, { "docid": "748d19b53d143be174c6a232aef9eb00", "score": "0.4932748", "text": "get_owner(con_pkg) {\n\t\tconst { socket, current_player } = con_pkg\n\t\tif (!current_player) return\n\n\t\tlet room = this.find('id', current_player.room_id)\n\t\tif (!room) return\n\n\t\tsocket.emit('room_owner', room.creator)\n\t}", "title": "" }, { "docid": "ecea4f1a7f6df9c23212e3ef4c69fb58", "score": "0.49327183", "text": "async function InternetAPIGetRequestforMicrosoft365() {\n\tconst service = await cdsapi.connect.to(\"MicrosoftGraph\");\n\treturn await service.run({\n\t\turl: \"/v1.0/users?$select=displayName,givenName,postalCode\",\n\t\tmethod: 'GET'\n\t})\n}", "title": "" }, { "docid": "4d4c94901ea4bdf8f40828f4a045447d", "score": "0.49286884", "text": "async getUserBuilding() {\n\t\tif (this._isRootInstance) {\n\t\t\tlet closestBuilding;\n\t\t\ttry {\n\t\t\t\tawait this._getGeoLocation();\n\t\t\t\tlet buildingsForGeoLocation = await this._getBuildingsForGeoLocation();\n\t\t\t\tclosestBuilding = this._getClosestBuilding(buildingsForGeoLocation);\n\t\t\t} catch (error) {\n\t\t\t\tclosestBuilding = null;\n\t\t\t\tthis._clearGeoLocationPromise();\n\t\t\t}\n\t\t\tlet userBuilding;\n\t\t\tif (closestBuilding != null) {\n\t\t\t\tuserBuilding = closestBuilding;\n\t\t\t} else {\n\t\t\t\ttry { \n\t\t\t\t\tuserBuilding = await this._getUserPrimaryBuilding();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tuserBuilding = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn userBuilding && userBuilding._id ? userBuilding : null;\n\t\t} else {\n\t\t\treturn this._rootInstance.getUserBuilding();\n\t\t}\n\t}", "title": "" }, { "docid": "eeaafd5f133fa2d0b80e3cf07a99403d", "score": "0.49217966", "text": "function userOrganizationList(uId, OrgId) {\n return new Promise((resolve, reject) => {\n let selectUser = \"select user.*, organization_details.name from user inner join organization_details on user.organization_id = organization_details.id and organization_details.id = \" + OrgId; //+ \" and user.id != \" + uId;\n connection.query(selectUser, (err, result) => {\n if (err)\n reject(err);\n resolve(result);\n });\n });\n\n}", "title": "" }, { "docid": "8fb70ab8fba60cacd40f69d57fe6012c", "score": "0.4915286", "text": "function getSpaceUsers(space) {\n return users.filter(user => user.space === space)[0];\n}", "title": "" }, { "docid": "6f38a630a1bcdf5a8c250abae5f0eca1", "score": "0.49073282", "text": "function getOrganisationsNonVolatileGraph() {\n h.get('./overview').then(function(mas) {\n getOrganisationsAsDot(JSON.parse(mas));\n });\n}", "title": "" }, { "docid": "525be045cb918c62bcecfd80b47d61d7", "score": "0.49069855", "text": "findByName(name) {\n return this.db.oneOrNone('SELECT * FROM organization WHERE name = $1', name);\n }", "title": "" }, { "docid": "67aeaf7547bdb9ee2bc0ec258b7751a0", "score": "0.4898983", "text": "currentUser() {\n return this.auth.currentUser;\n }", "title": "" }, { "docid": "8377603647e81542e02623d7913c3299", "score": "0.48964468", "text": "getOwner () {\n if (this.owner !== undefined) return this.owner\n if (this.cachedOwner !== undefined) return this.cachedOwner\n }", "title": "" }, { "docid": "dc7551c2f4e338ad59d4064026634a8c", "score": "0.4890717", "text": "get CurrentUser() {\n return _state.currentUser\n }", "title": "" }, { "docid": "53d1f7f1259e94744c8a8f5d5cd82554", "score": "0.48881546", "text": "getPrimaryCalendarId() {\n return GoogleCalendar.getCalendarList().then((response) => {\n console.log('response', response);\n response = JSON.parse(response);\n const calendars = response.items;\n const selectedCalender = calendars.find(calendar => calendar.accessRole === 'owner');\n if (!selectedCalender) return null;\n\n const selectedCalendarId = selectedCalender.id;\n return selectedCalendarId;\n }).catch((error) => {\n console.log('error', error);\n });\n }", "title": "" }, { "docid": "0b5324be1b56d38846582980509811a2", "score": "0.48850703", "text": "function Orgs() {\n return knex('orgs');\n}", "title": "" }, { "docid": "a29992145204d5ac670f3eb072939351", "score": "0.48816618", "text": "getScope() {\n var _this7 = this;\n\n return _asyncToGenerator(function* () {\n return _this7.rbac.getScope(_this7.name);\n })();\n }", "title": "" }, { "docid": "d730238b1176f34f402a9f5a90ebeb5d", "score": "0.4875366", "text": "function currentUser() {\n var user = localStorageService.get('user');\n if (!user) {\n return null;\n }\n user.roles = localStorageService.get('roles');\n user.token = localStorageService.get('token');\n user.department_id = localStorageService.get('department_id');\n user.position_id = localStorageService.get('position_id');\n user.landline = localStorageService.get('landline');\n user.profile = localStorageService.get('profile');\n user.school_id = localStorageService.get('school_id');\n user.position_name = localStorageService.get('positionName');\n user.department = localStorageService.get('department');\n user.isOutbound = localStorageService.get('isOutbound');\n user.employeeId = localStorageService.get('employeeId');\n user.outboundphone = localStorageService.get('outboundphone');\n user.userId = localStorageService.get('userId');\n try {\n user.account = localStorageService.get('user').account;\n } catch (e) {\n console.log('错了')\n }\n try {\n user.projectSettingId = localStorageService.get('department').projectSettingId;\n user.schoolNature = localStorageService.get('department').schoolNature;\n } catch (e) {\n console.log('错了')\n }\n return user;\n }", "title": "" }, { "docid": "4a01d41d5f0e3c9b549a5b6f9af1e302", "score": "0.4869446", "text": "get me() {\n return this.guild.members.get(this.client.user.id);\n }", "title": "" }, { "docid": "1652a586d6f62399889aa3e8a5a24a8a", "score": "0.48692662", "text": "getOwner() {\n return this.owner;\n }", "title": "" }, { "docid": "38d677ce644899677ceadd330bd0b442", "score": "0.48690146", "text": "async getOrgPreferences(_options) {\n let _config = _options || this.configuration;\n // Path Params\n const path = '/api/v1/org/preferences';\n // Make Request Context\n const requestContext = _config.baseServer.makeRequestContext(path, http_1.HttpMethodEnum.GET);\n requestContext.setHeaderParam('Accept', 'application/json, */*;q=0.8');\n let authMethod;\n // Apply auth methods\n authMethod = _config.authMethods['apiToken'];\n if (authMethod?.applySecurityAuthentication) {\n await authMethod?.applySecurityAuthentication(requestContext);\n }\n // Apply auth methods\n authMethod = _config.authMethods['oauth2'];\n if (authMethod?.applySecurityAuthentication) {\n await authMethod?.applySecurityAuthentication(requestContext);\n }\n const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;\n if (defaultAuth?.applySecurityAuthentication) {\n await defaultAuth?.applySecurityAuthentication(requestContext);\n }\n return requestContext;\n }", "title": "" }, { "docid": "e78d89595a624b57a1eb6794e64dec1b", "score": "0.48609406", "text": "async function getUserOrgProfile(req, reply) {\n const { osmId, id: orgId } = req.params\n const { user_id: requesterId } = req.session\n\n if (!osmId) {\n throw Boom.badRequest('osmId is required parameter')\n }\n\n const values = await profile.getProfile('user', osmId)\n const tags = prop('tags', values)\n if (!values || !tags) {\n throw Boom.notFound()\n }\n\n let visibleKeys = []\n let orgKeys = []\n let requesterIsMemberOfOrg = false\n let requesterIsManagerOfOrg = false\n let requesterIsOwnerOfOrg = false\n\n // Get org keys & visibility\n orgKeys = await profile.getProfileKeysForOwner('org', orgId, 'user')\n\n if (requesterId === osmId) {\n const allIds = orgKeys.map(prop('id'))\n const allValues = pick(allIds, tags)\n const keysToSend = orgKeys.map((key) => {\n return assoc('value', allValues[key.id], key)\n })\n return reply.send(keysToSend)\n } else {\n requesterIsMemberOfOrg = await org.isMember(orgId, requesterId)\n requesterIsManagerOfOrg = await org.isManager(orgId, requesterId)\n requesterIsOwnerOfOrg = await org.isOwner(orgId, requesterId)\n\n // Get visible keys\n orgKeys.forEach((key) => {\n const { visibility } = key\n switch (visibility) {\n case 'public': {\n visibleKeys.push(key)\n break\n }\n case 'org_staff': {\n if (requesterIsOwnerOfOrg || requesterIsManagerOfOrg) {\n visibleKeys.push(key)\n }\n break\n }\n case 'org': {\n if (\n requesterIsMemberOfOrg ||\n requesterIsOwnerOfOrg ||\n requesterIsManagerOfOrg\n ) {\n visibleKeys.push(key)\n }\n break\n }\n }\n })\n }\n\n // Get values for keys\n const visibleKeyIds = visibleKeys.map(prop('id'))\n const visibleValues = pick(visibleKeyIds, tags)\n\n const keysToSend = visibleKeys.map((key) => {\n return assoc('value', visibleValues[key.id], key)\n })\n\n return reply.send(keysToSend)\n}", "title": "" }, { "docid": "ea274ab6c4ff995df6d60b0c551f7497", "score": "0.48526284", "text": "function getUser(){\n return firebase.auth().currentUser;\n}", "title": "" }, { "docid": "4d3623793dd66a249801f8f52e0504b7", "score": "0.4851118", "text": "async owner (item) {\n return await getUser(item.ownerId)\n }", "title": "" }, { "docid": "666194c96d064bf3a80ffcb3b2a75467", "score": "0.48410776", "text": "findById(id) {\n return this.db.oneOrNone('SELECT * FROM organization WHERE id = $1', +id);\n }", "title": "" }, { "docid": "4a043ac1af45fda67d7a220083a0ad18", "score": "0.4837776", "text": "load_orgs() {\n this.props.api.get_organizations().then((organizations) => {\n this.setState({organizations: organizations});\n })\n }", "title": "" }, { "docid": "8b39a029cf2cdad6eb9c822371e542f1", "score": "0.48315525", "text": "get CurrentUser() {\n return _CurrentUser;\n }", "title": "" }, { "docid": "a1a22a59ac2e966d1fdb185b8078e4ba", "score": "0.48304686", "text": "function GetCurrentUser(){\n const [user, setUser]=useState(null);\n useEffect(()=>{\n auth.onAuthStateChanged(user=>{\n if(user){\n fs.collection('users').doc(user.uid).get().then(snapshot=>{\n setUser(snapshot.data().FullName);\n })\n }\n else{\n setUser(null);\n }\n })\n },[])\n return user;\n }", "title": "" }, { "docid": "580ba4cfa9618b7d80e61f7c37af9fe8", "score": "0.48298022", "text": "function getUsuario() {\r\n\r\n\tvar user = getValue(\"WKUser\");\t\r\n\t\r\n\tvar c1 = DatasetFactory.createConstraint(\"colleaguePK.colleagueId\", user,user, ConstraintType.MUST);\r\n\t\r\n\tvar datasetUser = DatasetFactory.getDataset(\"colleague\", null, [ c1 ], null);\r\n\tvar colleague = new Array();\r\n\tif (datasetUser.rowsCount > 0) {\r\n\t\t\r\n\t\tcolleague = [datasetUser.getValue(0, \"colleaguePK.colleagueId\"),\r\n\t\t datasetUser.getValue(0, \"colleagueName\"),\r\n\t\t datasetUser.getValue(0, \"adminUser\"),\r\n\t\t datasetUser.getValue(0, \"mail\"),\r\n\t\t datasetUser.getValue(0, \"currentProject\"),\r\n\t\t datasetUser.getValue(0, \"especializationArea\")\r\n\t\t ]\r\n\t}\r\n\t\r\n\treturn colleague;\r\n}", "title": "" }, { "docid": "f5734cedb852d9f55acbaed545b17ff3", "score": "0.48296362", "text": "function getUser () {\r\n return axios.get(`${REACT_APP_API_URL}/user/me`, {}, getConfig())\r\n}", "title": "" }, { "docid": "4b230e9011ec8825c2b5630d8e472e0d", "score": "0.48235786", "text": "function findAll() {\n return db(\"organizations\");\n}", "title": "" }, { "docid": "a9b626d787cb96451e2a879d46a6c759", "score": "0.48234576", "text": "async getOrgUsersIfNotStored({ getters, dispatch }, { userId }) {\n if (!getters.getUserById({ id: userId })) {\n dispatch('getUsers');\n }\n }", "title": "" }, { "docid": "69b62be74219c539e9d071c98294993a", "score": "0.48190135", "text": "getCurrentUser() {\n return JSON.parse(localStorage.getItem(\"user\"));\n }", "title": "" }, { "docid": "7b336d9dc47e7bfd8ef863e63309613a", "score": "0.4803263", "text": "function getUser(userId) {\n return SyncUser.syncUserAsObject(userId);\n }", "title": "" }, { "docid": "e0b98fd5d959c526554ab7d9b4fa1b65", "score": "0.48032025", "text": "async getUserIdentity (options) {\n\t\tconst authorizer = new GithubAuthorizer({ options });\n\t\treturn await authorizer.getGithubIdentity(\n\t\t\toptions.accessToken,\n\t\t\toptions.providerInfo\n\t\t);\n\t}", "title": "" }, { "docid": "c619eaf948d84cd6d9598c8642ca06de", "score": "0.4803182", "text": "static getCurrent(){\n let user = new User();\n user.getCurrent();\n return user;\n }", "title": "" }, { "docid": "ad827046bb4d0195bc6024ff88af6203", "score": "0.47978646", "text": "static getCurrentUser() {\n return this.checkAuthIsVaild() ? cookies.get(USER_STORE_KEY) : null;\n }", "title": "" }, { "docid": "10222d7693c6d3b3eacdf6ba1cc6ea82", "score": "0.47940806", "text": "getCurrentUser() {\n return JSON.parse(localStorage.getItem('user'));\n }", "title": "" }, { "docid": "715f27d9d0571e68b1e7dd79269379fc", "score": "0.47921184", "text": "async getOrgContactUser(contactType, _options) {\n let _config = _options || this.configuration;\n // verify required parameter 'contactType' is not null or undefined\n if (contactType === null || contactType === undefined) {\n throw new baseapi_1.RequiredError('OrgSettingApi', 'getOrgContactUser', 'contactType');\n }\n // Path Params\n const path = '/api/v1/org/contacts/{contactType}';\n const vars = {\n ['contactType']: String(contactType),\n };\n // Make Request Context\n const requestContext = _config.baseServer.makeRequestContext(path, http_1.HttpMethodEnum.GET, vars);\n requestContext.setHeaderParam('Accept', 'application/json, */*;q=0.8');\n let authMethod;\n // Apply auth methods\n authMethod = _config.authMethods['apiToken'];\n if (authMethod?.applySecurityAuthentication) {\n await authMethod?.applySecurityAuthentication(requestContext);\n }\n // Apply auth methods\n authMethod = _config.authMethods['oauth2'];\n if (authMethod?.applySecurityAuthentication) {\n await authMethod?.applySecurityAuthentication(requestContext);\n }\n const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;\n if (defaultAuth?.applySecurityAuthentication) {\n await defaultAuth?.applySecurityAuthentication(requestContext);\n }\n return requestContext;\n }", "title": "" }, { "docid": "1ede3c3a45f4ad436a8554ab377cab71", "score": "0.47861314", "text": "function getOrganization(term, rows) {\n return axios.get(`/api/get-organization/${term}/${rows}`). // triggers a server side route\n then(function(response) {\n const orgs = JSON.parse(response.data.body);\n return orgs\n })\n}", "title": "" }, { "docid": "e08038ae1efb0421b7820d4f721014b2", "score": "0.478514", "text": "function infoCall(userName) {\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://api.github.com/users/\" + userName + \"/orgs\",\n \"method\": \"GET\",\n \"processData\": false,\n \"data\": \"{}\"\n };\n $.ajax(settings).done(function(response) {\n for (var org = 0; org < response.length; org++) {\n new OrgDetails(response[org]);\n }\n });\n}", "title": "" }, { "docid": "6ddbbdb6cb1158c46d22b71249784778", "score": "0.47746238", "text": "function getUser(accessToken) {\n const headers = new Headers();\n headers.append(\"Authorization\", `Bearer ${accessToken}`);\n\n return fetch('https://www.googleapis.com/oauth2/v2/userinfo', { headers })\n .then(resp => resp.json(), err => console.log(err))\n}", "title": "" } ]
bdec87863fbd7593299a0df2a79cc956
OMDB Title of the movie. Year the movie came out. IMDB Rating of the movie. Rotten Tomatoes Rating of the movie. Country where the movie was produced. Language of the movie. Plot of the movie. Actors in the movie.
[ { "docid": "a64b1de2137a440032e1a742e79929c1", "score": "0.0", "text": "function movie() {\n\n if (!name) {\n name = \"Mr Nobody\";\n }\n\n axios.get(\"https://www.omdbapi.com/?t=\" + name + \"&apikey=trilogy\").then(\n function (response) {\n // console.log(response.data);\n var movieInfo = response.data;\n var display = `\\nTitle: ${movieInfo.Title}\\nYear: ${movieInfo.Year}\\nIMDB Rating: ${movieInfo.imdbRating}\\nRotten Tomatoes Rating: ${movieInfo.Ratings[1].Value}\\nCountry: ${movieInfo.Country}\\nLanguage: ${movieInfo.Language}\\nPlot: ${movieInfo.Plot}\\nActors: ${movieInfo.Actors}\\n`;\n\n console.log(\"---------------------------------------------------------------------------------------\");\n console.log(display);\n console.log(\"---------------------------------------------------------------------------------------\")\n\n fs.appendFile(\"log.txt\", display, function (err) {\n if (err) {\n console.log(err);\n } else {\n console.log(\"Movie Added!\");\n }\n\n });\n }\n );\n}", "title": "" } ]
[ { "docid": "071856819bbb957eeec199d4b9e85cfd", "score": "0.7201622", "text": "function movieThis(){\n\trequest(\"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&tomatoes=true&r=json\", function(error, response, body) {\n\t\tif (!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).tomatoRating);\n\t\t\tconsole.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "866051dde4173542e26a0300e6b5a72b", "score": "0.7167641", "text": "function movieInfo(){\n var title = process.argv[3];\n if(title ===undefined){\n title=\"Malcolm X\";\n console.log(`Default Title Query:`);\n console.log(`***********************************************`);\n };\n var queryURL = \"https://www.omdbapi.com/?t=\" + title + \"&y=&plot=short&apikey=trilogy\";\n\n\n request(queryURL, function (error, response, body) {\n\n if (error) {\n return console.log('Error occurred: ' + error);\n }\n \n //console.log('error:', error); // Print the error if one occurred\n //console.log('statusCode:', response && response.statusCode); // Print the \n //console.log('body:', body); // Print the HTML for the Google homepage.\n \n var output = JSON.parse(body);\n var title =output.Title;\n var year = output.Year;\n var imbdRating=output.Ratings[0].Value;\n var rottenRating=output.Ratings[1].Value;\n var country= output.Country;\n var lang= output.Language;\n var plot= output.Plot;\n var actors = output.Actors;\n\n var movieData= (`Movie: ${title}\\nMovie Year: ${year}\\nIMDB Rating: ${imbdRating}\\nRotten Tomatoes Rating: ${rottenRating}\\nCountry where produced: ${country}\\nLanguages: ${lang}\\nPlot: ${plot}\\nActors: ${actors}\\n${separator}` );\n \n console.log(movieData);\n appendToFile(movieData);\n\n });\n}", "title": "" }, { "docid": "2657e0c42266d94640b1cd4616950376", "score": "0.71310765", "text": "function movieInfo(results) {\n console.log(\"-------------------------------------------------------------------\");\n console.log(`\\nTitle: ${results.Title}\\nYear: ${results.Year}`);\n console.log(`\\nLanguage: ${results.Language}\\n\\nActors: ${results.Actors}.`);\n console.log(`\\nRating: ${results.Ratings[1].Source}Score: ${results.Ratings[1].Value}IMDB Score${results.imdbRating}`);\n console.log(`\\nPlot: ${results.Plot}`);\n console.log(\"-------------------------------------------------------------------\");\n }", "title": "" }, { "docid": "bf92dc3cff0e3022bc26ea4b44b4aded", "score": "0.7058914", "text": "function omdbData(movie) {\n\trequest(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&r=json&tomatoes=true&apikey=trilogy\", function (error, response, body) {\n\t\t\tif (!error && response.statusCode == 200) {\n\t\t\t\tvar movieObject = JSON.parse(body);\n\t\t\t\t//console.log(movieObject); // Show the text in the terminal\n\t\t\t\tvar movieResults =\n\t\t\t\t\"Title: \" + movieObject.Title+\"\\r\\n\"+\n\t\t\t\t\"Year: \" + movieObject.Year+\"\\r\\n\"+\n\t\t\t\t\"Imdb Rating: \" + movieObject.imdbRating+\"\\r\\n\"+\n\t\t\t\t\"Country: \" + movieObject.Country+\"\\r\\n\"+\n\t\t\t\t\"Language: \" + movieObject.Language+\"\\r\\n\"+\n\t\t\t\t\"Plot: \" + movieObject.Plot+\"\\r\\n\"+\n\t\t\t\t\"Actors: \" + movieObject.Actors+\"\\r\\n\"+\n\t\t\t\t\"Rotten Tomatoes Rating: \" + movieObject.tomatoRating+\"\\r\\n\";\n\t\t\t\tconsole.log(movieResults);\n\t\t\t\tlog(movieResults);\n\t\t\t} else {\n\t\t\t\tconsole.log(\"Error :\"+ error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}); \n}", "title": "" }, { "docid": "f2dc7508b7dd8bd4976f2f07fe242e20", "score": "0.70518506", "text": "function movieThis(){\n\t\tvar movie = process.argv[3];\n\n\t\tif (process.argv[3] == \"\") {\n\t\t\tmovie = \"Mr. Nobody\";\n\t\t}\n\t\t\n\t\tvar params = movie;\n\t\trequest(\"http://www.omdbapi.com/?t=\" + params + \"&y=&plot=short&r=json&tomatoes=true\", function (error, response, body) {\n\t\t\n\t\tvar movieObject = JSON.parse(body);\n console.log(\"the title is \", movieObject.Title);\n console.log(\"the year is \", movieObject.Year);\n console.log(\"the IMDB Rating is \", movieObject.imdbRating);\n console.log(\"the country is \", movieObject.Country);\n console.log(\"the language is \", movieObject.Language);\n console.log(\"the plot is \", movieObject.Plot);\n console.log(\"the actors are \", movieObject.Actors);\n\t\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "1409512a8f5b1fda1ec4b5ac6d4c3af6", "score": "0.70422107", "text": "function movieThis() {\n let movie = ''\n if (input) movie = input\n else movie = 'Mr. Nobody'\n let movieQuery = `http://www.omdbapi.com/?t=${movie}&y=&plot=short&apikey=trilogy`\n\n axios.get(movieQuery).then( response => {\n let rd = response.data\n console.log(`\\nTitle: ${rd.Title}`)\n console.log(`Year: ${rd.Year}`)\n console.log(`IMDB Rating: ${rd.Ratings[0].Value}`)\n console.log(`Rotten Tomatoes Rating: ${rd.Ratings[1].Value}`)\n console.log(`Production Country: ${rd.Country}`)\n console.log(`Language: ${rd.Language}`)\n console.log(`Plot: ${rd.Plot}`)\n console.log(`Actors: ${rd.Actors} \\n`)\n })\n}", "title": "" }, { "docid": "a7ebe9683301d18849d22ad82dd9a425", "score": "0.70006144", "text": "function movie(input) {\n\t\n\t\n\n\t//utilizing request to access API and display output\n\trequest(\"http://www.omdbapi.com/?t=\" + input + \"&y=&plot=short&apikey=trilogy\", function (error, response, body) {\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t\t\tconsole.log(\"Movie Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t\t\tconsole.log(\"Country of Production: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\n\t\t}\n\t\t \n\t});\n}", "title": "" }, { "docid": "950a083a1ec6b2113c4e496505ad3cc7", "score": "0.6979356", "text": "function buildMovie(movie) {\n var title = movie.Title;\n var releaseYear = movie.Year;\n var imdbRating = movie.imdbRating;\n var rottenTomatoes;\n try {\n if (typeof movie.Ratings[2].Value !== 'undefined') {\n rottenTomatoes = movie.Ratings[2].Value;\n }\n } catch (e) {\n rottenTomatoes = \"No Rotten Tomatoes rating available\"\n }\n \n var countryProduced = movie.Country;\n var language = movie.Language;\n var plot = movie.Plot;\n var actors = movie.Actors;\n var movie = new Movie(title, releaseYear, imdbRating, rottenTomatoes, countryProduced, language, plot, actors);\n movie.displayMovie();\n}", "title": "" }, { "docid": "c866c069937fffcebe51b26ba707fbe8", "score": "0.69686395", "text": "function movieInfo(searchTitle) {\n if (searchTitle == undefined) {\n searchTitle = 'Mr. Nobody';\n }\n\n var queryProps = {\n t: searchTitle,\n plot: 'full',\n r: 'json',\n tomatoes: true\n };\n\n var queryUrl = 'http://www.omdbapi.com/?' + querystring.stringify(queryProps);\n\n request(queryUrl, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n output = (\"\\n\\nTitle:\" + JSON.parse(body)['Title'] + \"\\n\\nYear: \" + JSON.parse(body)['Released'] + \"\\n\\nIMDB Rating: \" + JSON.parse(body)['imdbRating'] + \"\\n\\nCountry: \" + JSON.parse(body)['Country'] + \"\\n\\nLanguage: \" + JSON.parse(body)['Language'] + \"\\n\\nSynopsis: \" + JSON.parse(body)['Plot'] + \"\\n\\nActors: \" + JSON.parse(body)['Actors'] + \"\\n\\nRotten Tomatoes Rating: \" + JSON.parse(body)['tomatoRating']);\n console.log(output);\n } else {\n console.log(\"You have encountered an error.\");\n }\n });\n\n}", "title": "" }, { "docid": "02cee05823b019b3e9c4a9458f30741e", "score": "0.6952726", "text": "function movieInfo(movieName) {\n request(\"https://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\", function (error, response, body) {\n if (!error) {\n var item = JSON.parse(body);\n var movieDisplay = \n \"Title of the movie: \" + item.Title\n + \"\\n Year of Release: \" + item.Year\n + \"\\n IMDB Rating: \" + item.Ratings[0].Value\n + \"\\n Rotten Tomatoes Rating: \" + item.Ratings[1].Value\n + \"\\n Country of Production: \" + item.Country\n + \"\\n Language: \" + item.Language\n + \"\\n Plot: \" + item.Plot\n + \"\\n Actors: \" + item.Actors\n + \"\\n --------------------------------------------------------\"\n console.log(movieDisplay);\n } else {\n return console.log('Error occurred: ' + error);\n }\n });\n}", "title": "" }, { "docid": "c00c15a8d1de2ef9dbedd1a36e09355c", "score": "0.6945941", "text": "function movie(){\n if (!secondInstruction) {secondInstruction = \"Shrek 2\"; };\n var queryUrl = \"http://www.omdbapi.com/?t=\" + secondInstruction + \"&y=&plot=short&apikey=trilogy\";\n request(queryUrl, function(error, response, body) {\n var data = JSON.parse(body);\n if (!error && response.statusCode === 200) {\n console.log(\"Title: \" + data.Title);\n console.log(\"Year: \" + data.Year);\n console.log(\"IMDB Rating: \" + data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + data.Ratings[1].Value);\n console.log(\"Country: \" + data.Country);\n console.log(\"Language: \" + data.Language);\n console.log(\"Plot: \" + data.Plot);\n console.log(\"Actors: \" + data.Actors);\n console.log(\"-------------\");\n };});\n}", "title": "" }, { "docid": "8d614c9c4a7108542627205a6692f8c9", "score": "0.690122", "text": "function printMovieDetails(data) {\n\n console.log(\"\\nTitle\\t\\t: \"+data.Title)\n writeFile(\"Title\\t\\t: \"+data.Title+\"\\n\")\n console.log(\"Released Year\\t: \"+data.Year)\n writeFile(\"Released Year\\t: \"+data.Year+\"\\n\")\n console.log(\"Ratings:\")\n writeFile(\"Ratings:\\n\")\n for (var m = 0; m < data.Ratings.length; m++) {\n \tif (data.Ratings[m].Source == \"Internet Movie Database\" || data.Ratings[m].Source == \"Rotten Tomatoes\") {\n \t\tconsole.log(\"\\t\"+data.Ratings[m].Source+\" : \"+data.Ratings[m].Value)\n \t\twriteFile(\"\\t\"+data.Ratings[m].Source+\" : \"+data.Ratings[m].Value+\"\\n\")\n \t}\n }\n console.log(\"Country\\t\\t: \"+data.Country)\n writeFile(\"Country\\t\\t: \"+data.Country+\"\\n\")\n console.log(\"Language\\t: \"+data.Language)\n writeFile(\"Language\\t: \"+data.Language+\"\\n\")\n console.log(\"Actors\\t\\t: \"+data.Actors)\n writeFile(\"Actors\\t\\t: \"+data.Actors+\"\\n\")\n console.log(\"Plot\\t\\t: \"+data.Plot+\"\\n\")\n writeFile(\"Plot\\t\\t: \"+data.Plot+\"\\n\\n\")\n\n timestamp = getDates();\n\twriteFile(\"LOG TIME ENDS: \"+timestamp+\"\\n\\n\")\n}", "title": "" }, { "docid": "7a790367e414826d08e9967b683ee7dc", "score": "0.6897256", "text": "function movieThis(){\n \n var movie = process.argv[3];\n \n\t\tif(!movie){\n\t\t\tmovie = \"mr nobody\";\n\t\t}\n\t\tparams = movie\n\t\trequest(\"http://www.omdbapi.com/?t=\" + params + \"&y=&plot=short&r=json&tomatoes=true&apikey=trilogy\", function (error, response, body) {\n\t\t\tif (!error && response.statusCode == 200) {\n\t\t\t\tvar data = JSON.parse(body);\n \n \n\t\t\t\tvar movieResults ='------------------------\\n' + \n 'Movie Information:\\n' + \n '------------------------\\n\\n' +\n 'Movie Title: ' + data.Title + '\\n' + \n 'Year Released: ' + data.Released + '\\n' +\n 'IMBD Rating: ' + data.imdbRating + '\\n' +\n 'Country Produced: ' + data.Country + '\\n' +\n 'Language: ' + data.Language + '\\n' +\n 'Plot: ' + data.Plot + '\\n' +\n 'Actors: ' + data.Actors + '\\n' + \n 'Rotten Tomatoes Rating: ' + data.tomatoRating + '\\n' +\n 'Rotten Tomatoes URL: ' + data.tomatoURL + '\\n';\n\n\t\t\t\tconsole.log(movieResults);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tconsole.log(\"Error :\"+ error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "2df014893a1f457573a63e0faae831dc", "score": "0.68642056", "text": "function movie(inputs) {\n\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + inputs + \"&y=&plot=short&apikey=ced56c7c\";\n\n\trequest(queryUrl, function(error, response, body) {\n\t\tif (!inputs){\n \tinputs = 'Mr Nobody';\n \t}\n\t\tif (!error && response.statusCode === 200) {\n\n\t\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t\t console.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t\t console.log(\"Country: \" + JSON.parse(body).Country);\n\t\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t console.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "25481f9fb803fd843051beaf9e261a46", "score": "0.68587476", "text": "function movieThis() {\n var movie = process.argv[3];\n request(`http://www.omdbapi.com/?apikey=40e9cece&t=${movie}`, function(error, response, body) {\n if (error) {\n console.log(\"error:\", error); // Print the error if one occurred\n } else {\n // console.log(JSON.parse(body));\n console.log(`Title: ${JSON.parse(body).Title}`); //movie title\n console.log(`Year: ${JSON.parse(body).Year}`); //movie year\n console.log(`IMDB Rating: ${JSON.parse(body).Ratings[0].Value}`); //IMDB Rating\n console.log(\n `Rotten Tomatoes Rating: ${JSON.parse(body).Ratings[1].Value}`\n ); //Rotten tomatoes rating\n console.log(`Country: ${JSON.parse(body).Country}`); //Country\n console.log(`Language(s): ${JSON.parse(body).Language}`); //Language\n console.log(`Plot: ${JSON.parse(body).Plot}`); //Plot\n console.log(`Actors: ${JSON.parse(body).Actors}`); //Actors\n log(movie);\n }\n });\n }", "title": "" }, { "docid": "ceccd2a019b2516dd5ee67083e47383c", "score": "0.6851886", "text": "function movieThis(movie_name) {\n request(\"http://www.omdbapi.com/?t=\" + movie_name + \"&y=&plot=short&apikey=trilogy\", function(error, response, body) {\n if (error) {\n return console.log('Error occurred: ' + error);\n }\n if (!error && response.statusCode === 200) {\n var output = \"\\nTitle: \" + JSON.parse(body).Title\n + \"\\nYear: \" + JSON.parse(body).Year\n + \"\\nIMDB Rating: \" + JSON.parse(body).imdbRating\n + \"\\nRotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value\n + \"\\nCountry: \" + JSON.parse(body).Country\n + \"\\nLanguage: \" + JSON.parse(body).Language\n + \"\\nPlot: \" + JSON.parse(body).Plot\n + \"\\nActors: \" + JSON.parse(body).Actors\n + \"\\n-----------------\";\n console.log(output);\n outputLog(output);\n }\n });\n}", "title": "" }, { "docid": "0d5a80568625f6897fa5ea0ffc4ca84a", "score": "0.684631", "text": "function omdbFunc(title){\n\n\tif(title === undefined){\n\t\ttitle = 'mr nobody';\n\t};\n\n\t//concatenate title with search url and API key\n\tvar url = \"http://www.omdbapi.com/?t=\" + title + \"&y=&plot=short&apikey=40e9cece\";\n\n\t//call to API and return response\n\trequest(url, function(error, response, data) {\n\t\tif (error) {\n\t\t return console.log('Error occurred: ' + error);\n\t\t}\n\t else if (!error && response.statusCode === 200) {\n\t\t console.log(\"Movie Title: \" + JSON.parse(data).Title);\n\t\t console.log(\"Year Released: \" + JSON.parse(data).Year);\n\t\t console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n\t\t console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(data).Ratings[1].Value);\n\t\t console.log(\"Production Country(s): \" + JSON.parse(data).Country);\n\t\t console.log(\"Language(s): \" + JSON.parse(data).Language);\n\t\t console.log(\"Plot Summary: \" + JSON.parse(data).Plot);\n\t\t console.log(\"Actors: \" + JSON.parse(data).Actors);\n\t }\n\t});\n}", "title": "" }, { "docid": "ade424c90d1367937937cb46e1fd7b42", "score": "0.68142194", "text": "function movieThis(search) {\n var queryUrl = \"http://www.omdbapi.com/?t=\" + search + \"&y=&plot=short&apikey=trilogy\";\n request(queryUrl, function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n context = \"Title: \" + JSON.parse(body).Title;\n context += \"\\nYear: \" + JSON.parse(body).Year;\n context += \"\\nRated: \" + JSON.parse(body).Rated;\n context += \"\\nIMDB Rating: \" + JSON.parse(body).imdbRating;\n context += \"\\nRotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value;\n context += \"\\nCountry: \" + JSON.parse(body).Country;\n context += \"\\nLanguage: \" + JSON.parse(body).Language;\n context += \"\\nPlot: \" + JSON.parse(body).Plot;\n context += \"\\nActors: \" + JSON.parse(body).Actors;\n console.log(context);\n write2File(context);\n }\n });\n}", "title": "" }, { "docid": "c76de1bc123743f11ae99987898b7649", "score": "0.6809817", "text": "function getMovieInfo () {\n var movie = process.argv[3];\n var omdbURL = \"http://www.omdbapi.com/?apikey=\" + process.env.OMDB_KEY + \"&t=\" + movie + \"&plot=short&tomatoes=true\";\n console.log (omdbURL);\n request(omdbURL, function(error, response, body) {\n \n if (!error && response.statusCode === 200) {\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Country Where Movie Produced: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n } \n });\n}", "title": "" }, { "docid": "b278708fcf529f6a6b2cd93e542515b9", "score": "0.6804599", "text": "function movieThis() {\n var movieTitle = process.argv[3];\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=trilogy\";\n axios.get(queryUrl)\n .then(function (response) {\n // if (!movieTitle) {\n // movieTitle = \"Mr. Nobody\"\n // }\n\n var queryResults =\n \"Title:\" + response.data.Title + \"\\n\" +\n \"Year:\" + response.data.Year + \"\\n\" +\n \"IMBD Rating:\" + response.data.Ratings[0].Value + \"\\n\" +\n \"Rotten Tomatoes\" + response.data.Ratings[1].Value + \"\\n\" +\n \"Country of Production:\" + response.data.Country + \"\\n\" +\n \"Language of Movie:\" + response.data.Language + \"\\n\" +\n \"Plot:\" + response.data.Plot + \"\\n\" +\n \"Key Actors:\" + response.data.Actors + \"\\n\" \n \n console.log(chalk.bold.inverse.bgMagenta(queryResults));\n\n\n\n\n });\n\n}", "title": "" }, { "docid": "723cfe4c03046f504e4c91f6d27d0058", "score": "0.67890036", "text": "function movieThis(movie) {\n\n var query_url = 'http://www.omdbapi.com/?t=' + movie +'&y=&plot=long&tomatoes=true&r=json';\n\n request(query_url, function(error, res, body) {\n\n \n var movie_data = {\n \"Title\" : JSON.parse(body).Title,\n \"Released\" : JSON.parse(body).Released,\n \"Country\" : JSON.parse(body).Country,\n \"Language(s)\" : JSON.parse(body).Language,\n \"Actors\" : JSON.parse(body).Actors,\n \"IMDB Rating\" : JSON.parse(body).imdbRating,\n \"Rotten Tomatoes Rating\": JSON.parse(body).tomatoRating,\n \"Rotten Tomatoes URL\" : JSON.parse(body).tomatoURL,\n \"Plot\" : JSON.parse(body).Plot\n \n console.log(\"----------------------------\");\n console.log(movie_data.Title);\n console.log(\"----------------------------\");\n }\n else\n console.error(error);\n }", "title": "" }, { "docid": "95b7978e32116e979f49717a7f7bce95", "score": "0.6775218", "text": "function omdbThisMovie (movieNameStrings) {\n const omdbKey = keys.omdb.key\n let movieName = getAllTheStrings(movieNameStrings).replace(/^\"(.*)\"$/, '$1')\n\n // If the user doesn't type a movie in, the program will output data for the movie 'The Boondock Saints'\n if (!movieName) {\n movieName = 'The Boondock Saints'\n }\n\n // This will search OMDB API\n axios.get('http://www.omdbapi.com/?t=' + movieName + '&y=&plot=short&apikey=' + omdbKey)\n .then(response => {\n let ratings = response.data.Ratings\n let imdbRating = ratings.find(Source => Source.Source === 'Internet Movie Database')\n let rottenTomatoesRating = ratings.find(Source => Source.Source === 'Rotten Tomatoes')\n\n // This will output the following information to your terminal\n console.log('------------------------------------')\n console.log('Movie Name:', movieName)\n console.log('IMDB Rating:', imdbRating.Value)\n console.log('Rotten Tomatoes Rating:', rottenTomatoesRating.Value)\n console.log('The Country:', response.data.Country)\n console.log('The Language:', response.data.Language)\n console.log('The Plot:', response.data.Plot)\n console.log('The Actors:', response.data.Actors)\n console.log('------------------------------------')\n })\n}", "title": "" }, { "docid": "dc5564e64add323f4d173c529a0df656", "score": "0.6769357", "text": "function movie() {\n\n //If No movie is specified, default to \"Mr. Nobody\"\n if (liriSecondPrompt === \"\")\n liriSecondPrompt = \"Mr. Nobody\";\n\n //axios API Call to retrieve movie Information\n axios.get(\"http://www.omdbapi.com/?t=\" + liriSecondPrompt + \"=&plot=short&apikey=trilogy\").then(\n function (response) {\n\n console.log(\"Title:\" + response.data.Title + \"\\n\");\n console.log(\"Year:\" + response.data.Year + \"\\n\");\n console.log(\"IMBD Rating:\" + response.data.Ratings[0].Value + \"\\n\");\n if (response.data.Ratings[1])\n console.log(\"Rotten Tomatoes Rating:\" + response.data.Ratings[1].Value + \"\\n\");\n else\n console.log(\"Rotten Tomatoes Rating:\" + \"No Rotten Tomatoes Rating\\n\");\n console.log(\"Country of production:\" + response.data.Country + \"\\n\");\n console.log(\"Language:\" + response.data.Language + \"\\n\");\n console.log(\"Plot:\" + response.data.Plot + \"\\n\");\n console.log(\"Actors:\" + response.data.Actors + \"\\n\");\n });\n}", "title": "" }, { "docid": "319080f29e14f95c1310c46f04861eb7", "score": "0.676636", "text": "function movieThis(value) {\n\tif (value === undefined) {\n\t\tvalue = 'Mr. Nobody';\n\t}\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + value + \"&y=&plot=short&apikey=40e9cece\";\n\n\tconsole.log(queryUrl);\n\n\trequest(queryUrl, function (error, response, body) {\n\t\tvar movieData = JSON.parse(body);\n\t\t// If the request is successful\n\t\tif (!error && response.statusCode === 200) {\n\t\t\t//Display information based on the movie that was submitted\n\t\t\tconsole.log(\"Release Year: \" + movieData.Year, \"\\nMovie Title: \" + movieData.Title, \"\\nIMDB Rating: \" +\n\t\t\t\tmovieData.imdbRating, \"\\nRotten Tomatoes Rating: \" + movieData.tomatoRating, \"\\nCountry of Production: \" + movieData.Country,\n\t\t\t\t\"\\nLanguage of the Movie: \" + movieData.Language, \"\\nPlot: \" + movieData.Plot, \"\\nActors: \" + movieData.Actors);\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "836eae68aa8beb421802e12e82921e41", "score": "0.6765313", "text": "function getMovieInfo(movieTitle) {\n\n var url = 'http://www.omdbapi.com/?apikey=40e9cece&t=' + movieTitle ;\n //var url = encodeURI(ref);\n //console.log(url);\n request(url, function (error, response, body) {\n\n if (error || response.statusCode != 200) {\n console.log(\"Sorry, cannot get information for the movie\");\n writeToFile(\"Sorry, cannot get information for the movie\\n\");\n return;\n }\n\n var bodyObj = JSON.parse(body);\n \n var title = bodyObj.Title;\n var release_year = bodyObj.Year;\n var imdb_rating = bodyObj.imdbRating;\n var rotten = '';\n \n for (var i =0;i<bodyObj.Ratings.length;i++) {\n if (bodyObj.Ratings[i].Source = 'Rotten Tomatoes') {\n \n rotten = bodyObj.Ratings[i].Value;\n }\n }\n var country = bodyObj.Country;\n var language = bodyObj.Language;\n var plot = bodyObj.Plot;\n var actors = bodyObj.Actors;\n \n console.log(\"Movie title: \" + title + \"\\nIMDB Rating: \"+imdb_rating+\"\\nRotten Tomatoes Rating: \"+rotten +\n \n \"\\nActors: \" + actors + \"\\nCountry: \" + country + \"\\nLanguage: \" + language + \n \"\\nPlot: \" + plot + \"\\nYear Released: \" + release_year);\n console.log('----------------------------------------------------');\n\n writeToFile(\"Movie title: \" + title + \"\\nIMDB Rating: \"+imdb_rating+\"\\nRotten Tomatoes Rating: \"+rotten +\n \n \"\\nActors: \" + actors + \"\\nCountry: \" + country + \"\\nLanguage: \" + language + \n \"\\nPlot: \" + plot + \"\\nYear Released: \" + release_year + \"\\n\");\n writeToFile(\"----------------------------------------------------\\n\");\n \n\n });\n\n}", "title": "" }, { "docid": "9b5a039299891eeedca096fac028b505", "score": "0.6749607", "text": "function writeMovie(body) {\n\tvar outputString = \"\";\n outputString += \n`===============================================================================\nTitle: ${body.Title}\nYear: ${body.Year}\nIMDB Rating: ${body.imdbRating}\nCountry where produced: ${body.Country}\nLanguage: ${body.Language}\nPlot: ${body.Plot}\nRotten Tomatoes rating: ${body.tomatoRating}\nRotten Tomatoes url: ${body.tomatoURL}\n===============================================================================`;\n\n\treturn outputString;\t\n}", "title": "" }, { "docid": "c6a3f03446483c2c65ea07a752eb26eb", "score": "0.67288053", "text": "function movieFn(movieName){\n\tif (movieName.length === 0){\n\t\tmovieName = \"Mr. Nobody\";\n\t}\n\tvar omdbURL = \"http://www.omdbapi.com?tomatoes=true&t=\" + movieName;\n\tRequest(omdbURL, function (error, response, data) {\n\t\tif (!error && response.statusCode == 200) {\n\t\t\tdata = JSON.parse(data);\n\t\t\tconsole.log(\"Title: \" + data.Title);\n\t\t\tconsole.log(\"Year of release: \" + data.Year);\n\t\t\tconsole.log(\"IMDB rating: \" + data.imdbRating);\n\t\t\tconsole.log(\"Country: \" + data.Country);\n\t\t\tconsole.log(\"Language: \" + data.Language);\n\t\t\tconsole.log(\"Plot: \" + data.Plot);\n\t\t\tconsole.log(\"Actors: \" + data.Actors);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + data.tomatoRating);\n\t\t\tconsole.log(\"Rotten Tomatoes URL: \" + data.tomatoURL);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a5f2de92c2ac5d1b14420ec4e14e1946", "score": "0.670956", "text": "function Movie(title, director, genre, releaseYear, rating) {\n this.title = title;\n this.director = director;\n this.genre = genre;\n this.releaseYear = releaseYear;\n this.rating = rating;\n}", "title": "" }, { "docid": "e594b9f432ac4df801d3bfdc66c4f119", "score": "0.67063385", "text": "function movie(selection) {\n\n // Empty user song selection, then searches default\n if (!selection) {\n selection = \"Mr. Nobody\"\n };\n\n // Splits movie name into an array\n var movieArray = selection.split(\" \");\n var movieSearch = \"\";\n \n // Adds \"+\" to the string for the IMDB API\n for (let i = 0; i < movieArray.length; i++) {\n if (i < (movieArray.length - 1)) {\n movieSearch += movieArray[i] + \"+\";\n } else {\n movieSearch += movieArray[i];\n }\n }\n\n // Configures url\n var queryUrl = \"https://www.omdbapi.com/?t=\" + movieSearch + \"&y=&plot=short&apikey=trilogy\";\n \n /// IMDB API call\n axios.get(queryUrl).then(\n function (response) {\n\n // Display movie details\n console.log(\"\\n **** Movie Information **** \\n\");\n console.log(\"Title : \",response.data.Title); \n console.log(\"Year : \",response.data.Year); \n console.log(\"IMDB Rating : \",response.data.Ratings[0].Value); \n console.log(\"R Tomatoes Rating : \",response.data.Ratings[1].Value); \n console.log(\"Country : \",response.data.Country); \n console.log(\"Language : \",response.data.Language); \n console.log(\"Actors : \",response.data.Actors); \n console.log(\"Plot : \",response.data.Plot, \"\\n\"); \n console.log(\"\\n **** End **** \\n\");\n\n \n writeLog(logText = (\n \"\\n **** Movie Information **** \\n\"+\n \"Title : \"+ response.data.Title+ \" \\n\"+\n \"Year : \"+ response.data.Yea+ \" \\n\"+\n \"IMDB Rating : \"+ response.data.Ratings[0].Value+ \" \\n\"+\n \"R Tomatoes Rating : \"+ response.data.Ratings[1].Value + \" \\n\"+\n \"Country : \"+ response.data.Country+ \" \\n\"+\n \"Language : \"+ response.data.Language+ \" \\n\"+\n \"Actors : \"+ response.data.Actors+ \" \\n\"+\n \"Plot : \"+ response.data.Plot+ \" \\n\"\n ));\n\n })\n .catch(function (error) {\n // Fail OMDB API response\n console.log(\"An error has ocurred : \", err);\n return;\n });\n return;\n}", "title": "" }, { "docid": "e5e5554f84fba084307e28f4f5291105", "score": "0.667451", "text": "function Movie (title, overview, average_votes, image, popularity, released_on) {\n this.title = title;\n this.overview = overview;\n this.average_votes = average_votes;\n this.image_url = 'https://image.tmdb.org/t/p/w500' + image;\n this.popularity = popularity;\n this.released_on = released_on;\n}", "title": "" }, { "docid": "bce34400eb1a43ad77bf0a966ff8abea", "score": "0.6657154", "text": "function movieThis(movieTitle) {\n var omdbapikey = process.env.OMDB_API_KEY;\n var omdbapi = 'http://www.omdbapi.com/?apikey=' + omdbapikey;\n\n var requestUrl = omdbapi + '&type=movie&plot=short&t=' + movieTitle;\n\n request(requestUrl, function (error, response, body) {\n var movie = JSON.parse(body);\n\n // If there is an error show message\n if ( error ) {\n return console.log( 'Sorry Please Try Searching Again there was an Error.' );\n }\n\n // If there is a Movie show movie data\n if ( movie.Response === 'True' ) {\n\n console.log( '' );\n console.log( '******************************************************************************************************************' );\n console.log( '****************************************** MOVIE THIS ************************************************' );\n console.log( '' );\n\n // If no movie is passed show this movie\n if ( movie.Title === 'Mr. Nobody' ) {\n console.log( \"If you haven't watched Mr. Nobody, then you should: http://www.imdb.com/title/tt0485947/ It's on Netflix!\" );\n console.log( '' );\n }\n\n console.log( 'MOVIE INFORMATION' );\n console.log( 'Movie Title: ' + movie.Title );\n console.log( 'Year Released: ' + movie.Year );\n console.log( 'Country: ' + movie.Country );\n console.log( 'Language: ' + movie.Language );\n console.log( '' );\n console.log( 'RATINGS' );\n console.log( movie.Ratings[0].Source + ': ' + movie.Ratings[0].Value );\n console.log( movie.Ratings[1].Source + ': ' + movie.Ratings[1].Value );\n console.log( '' );\n console.log( 'PLOT/ACTORS' );\n console.log( 'Plot: ' + movie.Plot );\n console.log( 'Actors: ' + movie.Actors );\n console.log( '' );\n console.log( '******************************************************************************************************************' );\n\n // Log all data to log.txt\n let toFile =\n 'Movie Title: ' + movie.Title +\n ' Year Released: ' + movie.Year +\n ' Country: ' + movie.Country +\n ' Language: ' + movie.Language +\n ' Ratings: ' + movie.Ratings[0].Source + ': ' + movie.Ratings[0].Value + movie.Ratings[1].Source + ': ' + movie.Ratings[1].Value +\n ' Plot: ' + movie.Plot +\n ' Actors: ' + movie.Actors +\n '\\n' + '******************************************************************************************************************' + '\\n';\n log( toFile );\n\n } else {\n console.log( 'Movie Not Found!' );\n }\n\n });\n}", "title": "" }, { "docid": "e13a770c5b97e08b4564a11e85e5a189", "score": "0.6651172", "text": "function Movie(name, year, genre,cast,description){\n this.name = name;\n this.year = year;\n this.genre = genre;\n this.cast = cast;\n this.description = description;\n}", "title": "" }, { "docid": "7b2c5f047bb7599efd0b785e1d33b827", "score": "0.6649874", "text": "function movie(){\n\n //reformats user input with +'s so it can be insterted into the URL\n let title = searchWord.replace(\" \",\"+\");\n \n request(`http://www.omdbapi.com/?t=${title}&apikey=trilogy`, function(error, response, body) {\n\n // If there were no errors and the response code was 200 (i.e. the request was successful)...\n if (!error && response.statusCode === 200) {\n //makes response ledgible\n var body = JSON.parse(body);\n //logs title, year, ratings, country of production, language, plot, and actors\n console.log(`Title: ${body.Title}`);\n console.log(`Year: ${body.Year}`);\n console.log(`IMDB Rating: ${body.Ratings[0].Value}`);\n console.log(`Rotten Tomatoes Rating: ${body.Ratings[1].Value}`);\n console.log(`Produced In: ${body.Country}`);\n console.log(`Language: ${body.Language}`);\n console.log(`Plot: ${body.Plot}`);\n console.log(`Actors: ${body.Actors}`);\n }\n });\n}", "title": "" }, { "docid": "35f90022dcd188d797e46976739ea355", "score": "0.6648245", "text": "function movieThis() {\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n\n //if request comes back successful\n if (!error && response.statusCode === 200) {\n // console.log('success');\n //pull data and console log\n var myMovieData = JSON.parse(body);\n var omdbResults =\n \"Title: \" + myMovieData.Title + \"\\n\" +\n \"Year: \" + myMovieData.Year + \"\\n\" +\n \"IMDB Rating: \" + myMovieData.Ratings[0].Value + \"\\n\" +\n \"Origin Country: \" + myMovieData.Country + \"\\n\" +\n \"Language: \" + myMovieData.Language + \"\\n\" +\n \"Plot: \" + myMovieData.Plot + \"\\n\" +\n \"Actors: \" + myMovieData.Actors + \"\\n\" +\n //console log\n console.log(\"\\n-----------------\\n\");\n console.log(omdbResults);\n console.log(\"\\n-----------------\\n\");\n } else {\n console.log(\"error: \" + err);\n return;\n };\n });\n}", "title": "" }, { "docid": "6863364c4d5c96edb39da23ec0292d02", "score": "0.663315", "text": "function Movie(name,year,genre,cast,description){\n this.name = name\n this.year = year\n this.genre = genre\n this.cast = cast\n this.description = description\n}", "title": "" }, { "docid": "e684de6a5f5fe8cde74e16c41299f085", "score": "0.6632526", "text": "function getMovies() {\n return [{\n title: 'Good Bye Lenin!',\n year: '2003',\n rated: 'R',\n released: '14 May 2004',\n runtime: '2h 01min', \n genre: 'Comedy, Drama, Romance',\n director: 'Wolfgang Becker',\n writer: 'Bernd Lichtenberg, Achim von Borries',\n actors: 'Daniel Brühl, Katrin Sass, Chulpan Khamatova',\n plot: \"East Germany, the year 1989: A young man protests against the regime. His mother watches the police arresting him and suffers a heart attack and falls into a coma. Some months later, the GDR does not exist anymore and the mother awakes. Since she has to avoid every excitement, the son tries to set up the GDR again for her in their flat. But the world has changed a lot.\",\n language: 'German, English, Russian',\n country: 'Germany',\n movieId: '01'\n },\n {\n title: 'Salt of the Earth',\n year: '2014',\n rated: 'PG-13',\n released: '27 March 2015',\n runtime: '1h 50min', \n genre: 'Documentary, Biography, History',\n director: 'Juliano Ribeiro Salgado, Wim Wenders',\n writer: 'Wim Wenders, Juliano Ribeiro Salgado',\n actors: 'Sebastião Salgado, Wim Wenders, Lélia Wanick Salgado',\n plot: \"For the last 40 years, the photographer Sebastião Salgado has been travelling through the continents, in the footsteps of an ever-changing humanity. He has witnessed some of the major events of our recent history; international conflicts, starvation and exodus. He is now embarking on the discovery of pristine territories, of wild fauna and flora, and of grandiose landscapes as part of a huge photographic project which is a tribute to the planet's beauty.\",\n language: 'French, English, Portuguese',\n country: 'France, , Brazil, Italy',\n movieId: '02'\n },\n {\n title: 'Maria Full of Grance',\n year: '2004',\n rated: 'R',\n released: '06 August 2004',\n runtime: '1h 41min', \n genre: 'Crime, Drama',\n director: 'Joshua Marston',\n writer: 'Joshua Marston',\n actors: 'Catalina Sandino Moreno, Guilied Lopez, Orlando Tobón',\n plot: \"In a small village in Colombia, the pregnant seventeen-year-old Maria supports her family with her salary working in floriculture. She is fired, and with a total lack of prospects of finding a new job, she decides to accept the offer to work as a drug mule, flying to the USA with sixty-two pellets of cocaine in her stomach. Once in New York, things do not happen as planned.\",\n language: 'Spanish, English',\n country: 'Colombia, USA, Ecuador',\n movieId: '03'\n },\n {\n title: 'The 100 Year-Old Man Who Climbed Out the Window and Disappeared',\n year: '2013',\n rated: 'R',\n released: '08 May 2015',\n runtime: '1h 54min', \n genre: 'Adventure, Comedy',\n director: 'Felix Herngren',\n writer: 'Felix Herngren, Hans Ingemansson',\n actors: 'Robert Gustafsson, Iwar Wiklander, David Wiberg',\n plot: \"Based on the internationally best-selling novel by Jonas Jonasson, the unlikely story of a 100-year-old man who decides it's not too late to start over. For most people it would be the adventure of a lifetime, but Allan Karlsson's unexpected journey is not his first. For a century he's made the world uncertain, and now he is on the loose again.\",\n language: 'Swedish, German, English',\n country: 'Sweden, Russa, UK, Germany',\n movieId: '04'\n },\n {\n title: 'Strawberry and Chocolate',\n year: '1993',\n rated: 'R',\n released: '20 January 1995',\n runtime: '1h 48min', \n genre: 'Comedy, Drama, Romance',\n director: 'Tomás Gutiérrez Alea, Juan Carlos Tabío',\n writer: 'Tomás Gutiérrez Alea, Senel Paz',\n actors: 'Jorge Perugorría, Vladimir Cruz, Mirta Ibarra',\n plot: \"Diego, a cultivated, homosexual and skeptical young man, falls in love with a young heterosexual communist full of prejudices and doctrinal ideas. First come rejection and suspicion, but also fascination. It is a coming-of-age story, told through the development of a great friendship, which overcomes incomprehension and intolerance.\",\n language: 'Spanish, English',\n country: 'Colombia, USA, Ecuador',\n movieId: '05'\n },\n {\n title: \"Sarah's Key\",\n year: '2010',\n rated: 'PG-13',\n released: '22 July 2011',\n runtime: '1h 51min', \n genre: 'Drama, War',\n director: 'Gilles Paquet-Brenner',\n writer: 'Tatiana De Rosnay, Serge Joncour',\n actors: 'Kristin Scott Thomas, Mélusine Mayance, Niels Arestrup',\n plot: \"One of the darkest moments in French history occurred in 1942 Paris when French officials rounded up over 10,000 Jews and placed them in local camps. Eventually over 8,000 were sent off to German concentration camps. As 10-year old Sarah and her family are being arrested, she hides her younger brother in a closet. After realizing she will not be allowed to go home, Sarah does whatever she can to get back to her brother. In 2009, a journalist named Julia is on assignment to write a story on the deported Jews in 1942. When she moves into her father-in-law's childhood apartment, she realizes it once belonged to the Strazynski family, and their daughter Sarah.\",\n language: 'French, English, Italian, German, Yiddish',\n country: 'France',\n movieId: '06'\n },\n {\n title: 'Noi the Albino',\n year: '2003',\n rated: 'PG-13',\n released: '28 February 2003',\n runtime: '1h 33', \n genre: 'Drama',\n director: 'Dagur Kári',\n writer: 'Dagur Kári',\n actors: 'Tómas Lemarquis, Þröstur Leó Gunnarsson, Elín Hansdóttir',\n plot: \"Is he the village idiot or a genius in disguise? 17 year old Noi drifts through life on a remote fjord in the north of Iceland. In winter, the fjord is cut off from the outside world, surrounded by ominous mountains and buried under a shroud of snow. Noi dreams of escaping from this white-walled prison with Iris, a city girl who works in a local gas staion. But his clumsy attempts at escape spiral out of control and end in complete failure. Only a natural disaster will shatter Noi's universe and offer him a window into a better world.\",\n language: 'Icelandic, French',\n country: 'Iceland, Germany, UK, Denmark',\n movieId: '07'\n },\n {\n title: 'The Lives of Others',\n year: '2006',\n rated: 'R',\n released: '30 March 2007',\n runtime: '2h 17', \n genre: 'Drama, Thriller',\n director: 'Florian Henckel von Donnersmarck',\n writer: 'Florian Henckel von Donnersmarck',\n actors: 'Ulrich Mühe, Martina Gedeck, Sebastian Koch',\n plot: \"Gerd Wiesler is an officer with the Stasi, the East German secret police. The film begins in 1984 when Wiesler attends a play written by Georg Dreyman, who is considered by many to be the ultimate example of the loyal citizen. Wiesler has a gut feeling that Dreyman can't be as ideal as he seems, and believes surveillance is called for. The Minister of Culture agrees but only later does Wiesler learn that the Minister sees Dreyman as a rival and lusts after his partner Christa-Maria. The more time he spends listening in on them, the more he comes to care about them. The once rigid Stasi officer begins to intervene in their lives, in a positive way, protecting them whenever possible. Eventually, Wiesler's activities catch up to him and while there is no proof of wrongdoing, he finds himself in menial jobs - until the unbelievable happens.\",\n language: 'German',\n country: 'Germany',\n movieId: '08'\n }]\n}", "title": "" }, { "docid": "72da61c35d890f3594aad261465f628d", "score": "0.66226727", "text": "function movieThis(movie) {\n //pulling in the omdb token\n const token = keys.omdb.id;\n //if there are any spaces in the modifier, it changes them to something the web can use.\n let movieParam = movie.replace(\" \", \"%20\");\n //the OMDB base url\n const baseURL = \"http://www.omdbapi.com/?t=\"\n //set up the query url\n let queryURL = baseURL + movieParam + \"&apikey=\" + token;\n axios.get(queryURL)\n .then(function (response) {\n //grabs the data and assigns it to movieData\n let movieData = response.data;\n\n //checks to make sure movieData has results. If so, does this:\n if (movieData.Title) {\n\n //grab the movie title\n let movieTitle = movieData.Title;\n movieTitle = \"\\nMovie Tite: \" + movieTitle;\n\n //grab the release year\n let movieReleaseYear = movieData.Year;\n movieReleaseYear = \"\\nReleased: \" + movieReleaseYear;\n\n //grab the IMDB rating\n let movieIMDB = movieData.Ratings[0].Value;\n movieIMDB = \"\\nIMDB Rating: \" + movieIMDB;\n\n //grab the rotten tomatoes rating\n let movieRotten = movieData.Ratings[1].Value;\n movieRotten = \"\\nRotten Tomatoes Rating: \" + movieRotten;\n\n\n //grab the location where the movie was produced\n let movieLocation = movieData.Country;\n movieLocation = \"\\nCountry of Production: \" + movieLocation;\n\n //grab the language of the move\n let movieLang = movieData.Language;\n movieLang = \"\\nLanguage: \" + movieLang;\n\n // grab the plot of the movie\n let moviePlot = movieData.Plot;\n moviePlot = \"\\nPlot: \" + moviePlot;\n\n //grab the actors in the movie\n let movieCast = movieData.Actors;\n movieCast = \"\\nActors: \" + movieCast;\n\n //grab the poster link\n let moviePoster = movieData.Poster;\n\n //log all of this and display all of the this to the terminal\n console.log(separator + movieTitle + movieReleaseYear + movieIMDB + movieRotten + movieLocation + movieLang + moviePlot + movieCast + separator);\n\n\n //logs it all in the log.txt file\n fs.appendFile(\"log.txt\", separator + movieTitle + movieReleaseYear + movieIMDB + movieRotten + movieLocation + movieLang + moviePlot + movieCast + separator, function (err) {\n if (err) {\n return console.log(err);\n }\n });\n\n\n //asks the user if they'd like to view the poster in their browser\n const prompt = new Confirm({\n name: 'poster',\n message: 'Would you like to open your browser to view the movie poster?'\n })\n prompt.ask(function (answer) {\n if (answer) {\n //if answer is true, then open the movie poster link\n opn(moviePoster);\n } else return;\n })\n } else { \n console.log(\"\\nNo movie by that title found.\");\n\n //logs it all in the log.txt file\n fs.appendFile(\"log.txt\", \"\\nNo movie by that title found.\", function (err) {\n if (err) {\n return console.log(err);\n }\n });\n\n };\n }\n\n )\n .catch(function (err) {\n console.log(err);\n })\n}", "title": "" }, { "docid": "a8c5509b588e3529e3f47790853d21a1", "score": "0.6596927", "text": "function movieThis(OMDB_id, movieTitle) {\n //creating my url request\n var urlRequest = {\n method: 'GET',\n url: 'http://www.omdbapi.com/',\n qs: { apikey: OMDB_id, t: movieTitle, type: 'movie' },\n };\n\n //making request to OMDB to return user movie search\n request(urlRequest, function (error, response, body) {\n const movie = JSON.parse(body)\n if (error) throw new Error(error);\n console.log(`Here is your information for ${movie.Title}`)\n console.log(`\\nRelease Year: ${movie.Year} \\nIMDB Rating: ${movie.imdbRating} \\nRotten Tomatoe Rating: ${movie.Ratings[2].Value} \\nCountry Produced: ${movie.Country} \\nPlot: \\n ${movie.Plot} \\nActors: \\n ${movie.Actors}`)\n\n });\n}", "title": "" }, { "docid": "f93cc8a7a7f9c01b482493d6e4c3cfed", "score": "0.6596535", "text": "function Movie(name, year, genre, cast, description) {\n this.name = name\n this.year = year\n this.genre = genre\n this.cast = cast\n this.description = description\n}", "title": "" }, { "docid": "8115d3229827583d7caf23c7ac14ff56", "score": "0.6595878", "text": "function omdb(){\n // if the user doesn't write anything, plug in Mr. Nobody\n if (query === undefined){\n query = \"mr+nobody\";\n }\n\n var movieUrl = \"http://www.omdbapi.com/?t=\" + query + \"&y=&plot=short&apikey=trilogy\";\n\n axios.get(movieUrl).then(function(response){\n // write title, year, imdb rating, rotten tomatoes score, country produced, language, plot, actors\n console.log(\"\\nTitle: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n console.log(\"Rotten Tomatoes Score: \" + response.data.Ratings[1].Value);\n console.log(\"Country Produced: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors + \"\\n\");\n })\n}", "title": "" }, { "docid": "93b2f07cd6bded84bf2da89df90ece93", "score": "0.65935796", "text": "function getMovieInfo(movie) {\n console.log(\"-----------------------------\")\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=a3f93189\").then(\n\n function (response) {\n\n var currentData = `\\n\n Title: ${response.data.Title}\n Released: ${response.data.Year}\n IMDB Rating: ${response.data.imdbRating}\n Rotten Tomatos Rating: ${response.data.Ratings[1].Value}\n Country: ${response.data.Country}\n Language: ${response.data.Language}\n Plot: ${response.data.Plot}\n Actors: ${response.data.Actors}\n `\n console.log(currentData)\n\n })\n}", "title": "" }, { "docid": "bfc64a0d692a83930684f0a91234bde0", "score": "0.659321", "text": "function movieData(searchTerm) {\n var movie = searchTerm ? searchTerm : \"Lord%20of%20the%20Rings\"\n var query = 'https://www.omdbapi.com/?apikey=trilogy&t=' + movie;\n\n request.get(query, function (err, response, body) {\n if (err) {\n return console.log(err);\n } else {\n body = JSON.parse(body)\n // sends data to console\n console.log('==============================================================')\n console.log(\" Title: \" + body.Title);\n console.log(\" Release Year: \" + body.Year);\n console.log(\" IMDB Rating: \" + body.Ratings[0].Value);\n console.log(\" Rotten Tomatoes Rating: \" + body.Ratings[1].Value);\n console.log(\" Country: \" + body.Country);\n console.log(\" Language: \" + body.Language);\n console.log(\" Plot: \" + body.Plot);\n console.log(\" Actors: \" + body.Actors);\n console.log('==============================================================')\n console.log('')\n logResults('\\nCommand: ' + cmd + '\\n')\n }\n })\n }", "title": "" }, { "docid": "d474707555dcae95c66ff8f59c9f0e59", "score": "0.6589376", "text": "function Movie(data) {\r\n this.title = data.title;\r\n this.movieDescription = data.overview;\r\n this.img_url = `https://image.tmdb.org/t/p/w300_and_h450_bestv2${data.poster_path}`;\r\n // data.ratings !== undefined ? this.ratings_code = data.ratings[0].code : this.ratings_code = 'Unrated';\r\n // this.runtime = data.runTime;\r\n}", "title": "" }, { "docid": "e52d64d839ebaad409b90a07d8e953f7", "score": "0.6584304", "text": "function movieInfo(parameter) {\n if (!parameter) {\n parameter = \"mr nobody\";\n }\n var movieQuery = \"http://www.omdbapi.com/?t=\" + parameter + \"&y=&plot=short&apikey=trilogy\";\n axios.get(movieQuery).then(\n function (response) {\n var data =\n \"\\n--------------------\" +\n \"\\nMovie Name: \" + response.data.Title +\n \"\\nRelease Year: \" + response.data.Year +\n \"\\nIMDB Rating: \" + response.data.imdbRating +\n \"\\nRotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\nProduction Country: \" + response.data.Country +\n \"\\nLanguage: \" + response.data.Language +\n \"\\nPlot: \" + response.data.Plot +\n \"\\nActors: \" + response.data.Actors +\n \"\\n--------------------\";\n console.log(data);\n logData(data);\n }).catch(function (err) {\n console.log(\"Error: \" + err)\n })\n}", "title": "" }, { "docid": "80b64d535f80fc039cf0def1c0b22a97", "score": "0.65625155", "text": "function movie() {\n\n\tvar movieName = userInput;\n\n\tif (movieName === undefined) {\n\t\tmovieName = \"Mr. Nobody\";\n\t}\n\n\t// console.log(movieName);\n\n\t// if the movie has more than a one word in the title, need to concatenate a plus sign\n\t// inbetween the words\n\n\tfor (var i = 4; i < process.argv.length; i++) {\n\t\tif (process.argv[i]) {\n\t\tmovieName = movieName + \"+\" + process.argv[i];\n\t\t//console.log(movieName);\n\t\t}\n\t}\n\n\t// build the queryurl with the properly formatted movie name\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=40e9cece\";\n\n\t// console.log(queryUrl);\n\n\t// then perform the request to the omdb api\n\n\trequest(queryUrl, function(error, response, body) {\n\n\t\t// if no error and status Code is ok\n\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// Parse the body (the data from the site)\n\t\t\t// Use the JSON.parse to make it into JSON\n \t\t\tvar answer = JSON.parse(body);\n\t\t\t// console.log(answer);\n\n\t\t\t// then get the data required\n\n\t\t\t// Title of the movie.\n\t\t\t// Year the movie came out.\n\t\t\t// IMDB Rating of the movie.\n\t\t\t// Rotten Tomatoes Rating of the movie.\n\t\t\t// Country where the movie was produced.\n\t\t\t// Language of the movie.\n\t\t\t// Plot of the movie.\n\t\t\t// Actors in the movie.\n\n\t\t\tconsole.log(\"The movie's title is: \" + answer.Title);\n\t\t\tconsole.log(\"The movie was released in: \" + answer.Year);\n\t\t\tconsole.log(\"The movie's IMDB rating is: \" + answer.imdbRating);\n\t\t\tif (answer.Ratings[1] != undefined) {\n\t\t\t\tconsole.log(\"The movie's Rotten Tomatoes rating is: \" + \n\t\t\t\tanswer.Ratings[1].Value);\n\t\t\t}\n\t\t\tconsole.log(\"The movie was produced in: \" + answer.Country);\n\t\t\tconsole.log(\"The movie is in the language of : \" + answer.Language);\n\t\t\tconsole.log(\"The plot of the movie is: \" + answer.Plot);\n\t\t\tconsole.log(\"The actors in the movie are: \" + answer.Actors);\n \t\t}\n\n\t});\n\n}", "title": "" }, { "docid": "d3cfdd16c960b10c270a27d28d5135f5", "score": "0.6547392", "text": "function movie(){\nqueryURL = `http://www.omdbapi.com/?t=${search}&y=&plot=short&tomatoes=true&apikey=trilogy`\nrequest(queryURL, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(\"\\n-------------\\n\");\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"\\nReleased in: \" + JSON.parse(body).Year);\n console.log(\"\\nIMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"\\nRotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"\\nCountry: \" + JSON.parse(body).Country);\n console.log(\"\\nLanguage: \" + JSON.parse(body).Language);\n console.log(\"\\nPlot: \" + JSON.parse(body).Plot);\n console.log(\"\\nStarring \" + JSON.parse(body).Actors);\n console.log(\"\\n-------------\");\n \n } else if(error){\n console.log(\"\\n-------------\\n\");\n console.log(\"Title: Mr. Nobody\");\n console.log(\"\\nReleased in: 2009\");\n console.log(\"\\nIMDB Rating: 7.9\");\n console.log(\"\\nRotten Tomatoes Rating: 66%\");\n console.log(\"\\nCountry: Belgium, Germany, Canada, France, USA, UK\");\n console.log(\"\\nLanguage: English, Mohawk\");\n console.log(\"\\nPlot: A boy stands on a station platform as a train is about to leave. Should he go with his mother or stay with his father? Infinite possibilities arise from this decision. As long as he doesn't choose, anything is possible.\");\n console.log(\"\\nStarring Jared Leto, Sarah Polley, Diane Kruger, Linh Dan Pham\");\n console.log(\"\\n-------------\");\n }\n})}", "title": "" }, { "docid": "f6feb43552cb62533bd030f79a101be3", "score": "0.6540245", "text": "function movieThis(term){\n console.log(\"MOVIE THIS: \", term);\n axios.get(\"http://www.omdbapi.com/?t=\"+term+\"&apikey=\"+keys.omdb.key).then(function(response){\n // console.log(response.data);\n var data=response.data;\n console.log(\"\\nTitle: \"+data.Title+\"\\nYear: \"+data.Year+\"\\nIMDB Rating: \"+data.imdbRating+\"\\nRotten Tomatos Rating: \"\n +data.Ratings[1].Value+\"\\nCountry Produced In: \"+data.Country+\"\\nLanguage: \"+data.Language+\"\\nPLOT: \"+data.Plot+\"\\nActors: \"+data.Actors);\n\n }).catch(function(error) {\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 object that comes back with details pertaining to the error that occurred.\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 }", "title": "" }, { "docid": "ea7510b64895764eecb5be265430c020", "score": "0.65367955", "text": "function imdbLog(response) {\n var movie = response.data;\n var imdbRating = movie.Ratings.forEach(function (rating) {\n if (rating.Source === \"Internet Movie Database\") {\n return rating.Value;\n } else {\n return \"Not Rated By IMDB\";\n }\n });\n var rottenTomatoesRating = movie.Ratings.forEach(function (rating) {\n if (rating.Source === \"Rotten Tomatoes\") {\n return rating.Value;\n } else {\n return \"Not Rated By Rotten Tomatoes\";\n }\n });\n console.log(\"\\n\\n*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\\n\");\n console.log(`Movie Title: ${movie.Title}\\nRelease Year: ${movie.Year}\\nIMDB Rating: ${imdbRating}\\nRotten Tomatoes Rating: ${rottenTomatoesRating}\\nProduction Country: ${movie.Country}\\nLanguage: ${movie.Language}\\nPlot Summary: ${movie.Plot}\\nList of Actors: ${movie.Actors}`);\n console.log(\"\\n*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\\n\\n\");\n}", "title": "" }, { "docid": "5d14eb5e2cbfe1b11a7236209856c184", "score": "0.65308374", "text": "function movieThis() {\n if (!userSearch) {\n userSearch = \"Mr Nobody\";\n }\n let URL = \"http://www.omdbapi.com/?t=\" + userSearch + \"&apikey=163f2aff\";\n // console.log(URL);\n axios.get(URL).then(function(response) {\n let movieData = response.data;\n // console.log(movieData);\n console.log(\"-----------------------------------\");\n console.log(\"Title: \" + movieData.Title);\n console.log(\"Year: \" + movieData.Year);\n console.log(\"IMDB Rating: \" + movieData.Ratings[0].Value);\n console.log(\"Rotten Tomatoes Rating: \" + movieData.Ratings[1].Value);\n console.log(\"Country: \" + movieData.Country);\n console.log(\"Language: \" + movieData.Language);\n console.log(\"Plot: \" + movieData.Plot);\n console.log(\"Actors: \" + movieData.Actors);\n console.log(\"-----------------------------------\");\n\n });\n}", "title": "" }, { "docid": "aeede70fc8e79fdd2648980f72413ac2", "score": "0.65288806", "text": "function Movie(name, year, genre, cast, description) {\n this.name = name;\n this.year = year;\n this.genre = genre;\n this.cast = cast;\n this.description = description;\n}", "title": "" }, { "docid": "ce1841b25f47b86ce64faed05a28e18c", "score": "0.6518819", "text": "function printMovie2 (movie) {\n let output = `${movie.title} lasts for ${movie.duration} minutes. Stars: ${movie.stars.join(\", \")}.`;\n return output;\n}", "title": "" }, { "docid": "8c29fe229131723406f73710cff56876", "score": "0.6518387", "text": "function movieThis(thing){\n if (thing == null){\n thing = 'Mr. Nobody';\n }\n request(\"http://www.omdbapi.com/?t=\"+thing+\"&y=&plot=short&apikey=40e9cece\",\n function(error, response, body){\n if (!error && response.statusCode === 200){\n console.log('---------------------');\n console.log('Movie Title:' + JSON.parse(body).Title);\n console.log('Release Year: ' + JSON.parse(body).Year);\n console.log('IMDb Rating: ' + JSON.parse(body).imdbRating);\n console.log('Country: ' + JSON.parse(body).Country);\n console.log('Plot: ' + JSON.parse(body).Plot);\n console.log('Lead Actors: ' + JSON.parse(body).Actors);\n console.log('Language: ' + JSON.parse(body).Language);\n console.log('Rotten Tomatoes Rating: ' + JSON.parse(body).rottenTomatoesRating);\n console.log('-----------------------');\n } else {\n console.log(\"Error: \" + error);\n return;\n }\n });\n\n}", "title": "" }, { "docid": "e8d123b5b50c869e7bc85f04b6a5c903", "score": "0.6503826", "text": "function movieIt (movieQuery) {\n if(movieQuery === undefined || null) {\n movieQuery = \"Mr. Nobody\";\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieQuery + \"&y=&plot=short&apikey=trilogy\";\n// console.log(queryUrl);\n request(queryUrl, function (error, response, body){\n if(!error && response.statusCode ===200){\n//json pull\n var movieData = JSON.parse(body);\n console.log(\"---------\");\n//movie title, year, rating, rotten tomatoes rating, country, language, plot and actors in 1 console log\n console.log(\"Movie Title: \" + movieData.Title +\n \"\\nYear: \" + movieData.released + \n \"\\nIMDB Rating: \" + movieData.imdbRating +\n \"\\n Rotten Tomatoes Rating: \" + movieData.Ratings[1].Value +\n \"\\nCountry: \" + movieData.Country +\n \"\\nLanguage: \" + movieData.Language + \n \"\\nPlot: \" + movieData.Plot +\n \"\\nActors: \" + movieData.Actors +\n \"\\n----------\"); \n };\n });\n}", "title": "" }, { "docid": "dc0c8c4f72b84ca09880bc5144ecb058", "score": "0.64929265", "text": "function movieThis() {\n\tfiglet(userInput, function(err, data) {\n\t\tif (err) {\n\t\t\tconsole.log(\"Something went wrong...\");\n\t\t\tconsole.dir(err);\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(chalk.green(data));\n\t});\n\tvar movieURL = `http://www.omdbapi.com/?apikey=${keys.OMDB.API_KEY}&t=${userInput}&limit=3&type=movie`;\n\taxios.get(movieURL).then(function(response) {\n\t\tconsole.log(\n\t\t\tchalk.green(\"Movie Title: \"),\n\t\t\tchalk.yellow(response.data.Title)\n\t\t);\n\t\tconsole.log(chalk.green(\"Released: \"), chalk.yellow(response.data.Year));\n\t\tconsole.log(\n\t\t\tchalk.green(\"IMDB rating: \"),\n\t\t\tchalk.yellow(response.data.imdbRating)\n\t\t);\n\t\tconsole.log(\n\t\t\tchalk.green(\"Rotten Tomatoes rating: \"),\n\t\t\tchalk.yellow(response.data.Ratings[1].Value)\n\t\t);\n\t\tconsole.log(\n\t\t\tchalk.green(\"Country of release: \"),\n\t\t\tchalk.yellow(response.data.Country)\n\t\t);\n\t\tconsole.log(\n\t\t\tchalk.green(\"Language: \"),\n\t\t\tchalk.yellow(response.data.Language)\n\t\t);\n\t\tconsole.log(chalk.green(\"Plot: \"), chalk.yellow(response.data.Plot));\n\t\tconsole.log(chalk.green(\"Actors: \"), chalk.yellow(response.data.Actors));\n\t});\n}", "title": "" }, { "docid": "d3527a158a02588a2c61bc63c55c638e", "score": "0.64922935", "text": "function movieThis() {\n //If no movie is input than Mr. Nobody will be the default movie\n if (!input2) {\n input2 = \"Mr.+Nobody\"\n }\n //console.log(input2)\n axios.get(\"http://www.omdbapi.com/?t=\" + input2 + \"&y=&plot=short&apikey=trilogy\").then(\n function (response) {\n console.log(\"The movie's Title is: \" + response.data.Title);\n console.log(\"The movie's premiere year is: \" + response.data.Year);\n console.log(\"The movie's IMBD rating is: \" + response.data.Ratings[0].Value);\n console.log(\"The movie's Rotten Tomatoes score is: \" + response.data.Ratings[1].Value);\n console.log(\"The movie's Country of origin is: \" + response.data.Country);\n console.log(\"The movie's inherent Language is: \" + response.data.Language);\n console.log(\"The movie's Plot: \" + response.data.Plot);\n console.log(\"The Actors in the Movie: \" + response.data.Actors);\n }\n\n );\n\n }", "title": "" }, { "docid": "a8746ef92ca5ddff7a0b0bee801616fe", "score": "0.64817476", "text": "function movieDetails() {\n\nvar movie = \"Mr. Nobody\";\n\nif(process.argv.length>3 && process.argv[3]) {\n\tmovie = process.argv[3];\n\tif(debug) console.log(\"movie\", movie);\n}\n\nvar queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\";\n\nif(debug) console.log(queryUrl);\n\nrequest(queryUrl, (error, response, body)=>{\n\n\tif(!error && response.statusCode === 200 )\n\t{\n\t\tvar bodyObj = JSON.parse(body)\n\t\t//console.log(body);\n\t\t// if (debug) console.log(bodyObj);\n\t\tconsole.log(\"Title:\", bodyObj.Title);\n\t\tconsole.log(\"Released:\", bodyObj.Released);\n\t\tconsole.log(moment(new Date(bodyObj.Released)).format(\"YYYY\"));\n\t\tconsole.log(\"IMDB rating:\", bodyObj.imdbRating);\n\t\tconsole.log(\"Country:\", bodyObj.Country);\n\t\tconsole.log(\"Language:\", bodyObj.Language);\n\t\tconsole.log(\"Plot:\", bodyObj.Plot);\n\t\tconsole.log(\"Actors:\", bodyObj.Actors);\n\t\t\n\t\t\n\t}\n});\n// This will output the following information to your terminal/bash window:\n\n// * Title of the movie.\n// * Year the movie came out.\n// * IMDB Rating of the movie.\n// * Country where the movie was produced.\n// * Language of the movie.\n// * Plot of the movie.\n// * Actors in the movie.\n// * Rotten Tomatoes URL.\n// If the user doesn't type a movie in, the program will output data for the movie 'Mr. Nobody.'\n\n// If you haven't watched \"Mr. Nobody,\" then you should: http://www.imdb.com/title/tt0485947/\n// It's on Netflix!\n\n}", "title": "" }, { "docid": "f25accaa38b9ef25d7c71ae5cfe6b9de", "score": "0.6480379", "text": "function movies(){\n\n axios\n\n .get(\"http://www.omdbapi.com/?t=\" + randomText + \"&y=&plot=short&apikey=2eafb601\")\n .then(function (response) {\n\n // Then log the body from the OMDB\n console.log(\"Title: \" + (response.data.Title));\n console.log(\"Release Date: \" + (response.data.Released));\n console.log(\"IMDB Rating: \" + (response.data.imdbRating));\n console.log(\"Rotten Tomatoes: \" + (response.data.Ratings[1].Value));\n console.log(\"Country: \" + (response.data.Country));\n console.log(\"Language: \" + (response.data.Language));\n console.log(\"Plot: \" + (response.data.Plot));\n console.log(\"Actors: \" + (response.data.Actors));\n })\n}", "title": "" }, { "docid": "1c871788439302a46685ce2a2af95237", "score": "0.6474867", "text": "function movies(){\n var movie = process.argv[3];\n //if there is no movie in input\n if(!movie){\n movie = \"the matrix\";\n }\n var paramaters = movie\n request(\"http://www.omdbapi.com/?t=\" + paramaters + \"&y=&plot=short&r=json&tomatoes=true\", function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var movieObject = JSON.parse(body);\n //test out in console log if not working\n //these are all selecting directly from their object key names!\n var movieResults =\n \"Title: \" + movieObject.Title+\"\\r\\n\"+\n \"Year: \" + movieObject.Year+\"\\r\\n\"+\n \"Imdb Rating: \" + movieObject.imdbRating+\"\\r\\n\"+\n \"Country: \" + movieObject.Country+\"\\r\\n\"+\n \"Language: \" + movieObject.Language+\"\\r\\n\"+\n \"Plot: \" + movieObject.Plot+\"\\r\\n\"+\n \"Actors: \" + movieObject.Actors+\"\\r\\n\"+\n \"Rotten Tomatoes Rating: \" + movieObject.tomatoRating+\"\\r\\n\"+\n \"Rotten Tomatoes URL: \" + movieObject.tomatoURL + \"\\r\\n\" +\n console.log(movieResults);\n log(movieResults);\n } else {\n console.log(\"Error :\"+ error);\n return;\n }\n });\n}", "title": "" }, { "docid": "a26423abe28e089a7577a7f57443132e", "score": "0.6464387", "text": "function mrNobody() {\n var movie = \"mr.-nobody\";\n var omdbURL = \"http://www.omdbapi.com/?apikey=\" + process.env.OMDB_KEY + \"&t=\" + movie + \"&plot=short&tomatoes=true\";\n console.log (omdbURL);\n request(omdbURL, function(error, response, body) {\n \n if (!error && response.statusCode === 200) {\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Country Where Movie Produced: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n } \n });\n}", "title": "" }, { "docid": "f298aa293603917f5a792da92c556d14", "score": "0.6462946", "text": "function movieThis() {\n if (userLine == undefined) {\n userLine = \"Mr. Nobody\"\n log(chalk.grey(\"\\nHere's an overrated movie, enjoy\"));\n }\n request(\"http://www.omdbapi.com/?t=\" + userLine + \"&y=&plot=short&apikey=trilogy\", function(error, response, data) {\n saveSearch();\n if (!error && response.statusCode === 200 && userLine != undefined) {\n let jBody = JSON.parse(data);\n let showMovie = [\n spacing + \" OMDB RESULT \" + spacing,\n \"Title: \" + jBody.Title,\n \"Year Released: \" + jBody.Year,\n \"IMDB Rating: \" + jBody.imdbRating,\n \"Rotten Tomatoes Rating: \" + jBody.Ratings[1].Value,\n \"Country: \" + jBody.Country,\n \"Language: \" + jBody.Language,\n \"Plot Summary: \" + jBody.Plot,\n \"Actors: \" + jBody.Actors + \"\\n\"\n ].join(\"\\n\\n\");\n log(showMovie);\n logResults(showMovie);\n } else {\n return log(error);\n }\n});\n}", "title": "" }, { "docid": "747a02abd0084892bfda4c5d9fdb788d", "score": "0.6457141", "text": "function imdb(input) {\r\n if (input.length === 0) {\r\n input = \"Mr. Nobody\";\r\n }\r\n // We run the API search\r\n axios\r\n .get(\"http://www.omdbapi.com/?t=\" + input + \"&apikey=trilogy\")\r\n .then(function(response) {\r\n // We collect the data from the API here\r\n const {\r\n Title: title,\r\n Year: year,\r\n imdbRating: imdbRating,\r\n Country: country,\r\n Language: language,\r\n Plot: plot,\r\n Actors: actors\r\n } = response.data;\r\n\r\n // var rottenTomatoes = response.data.Ratings[1].Value;\r\n\r\n // We display the data on the terminal\r\n console.log(\"===============================\");\r\n console.log(\"Movie Title: \" + title);\r\n console.log(\"Year: \" + year);\r\n console.log(\"IMDB Rating: \" + imdbRating);\r\n // console.log(\"Rotten Tomatoes: \" + rottenTomatoes);\r\n console.log(\"Country: \" + country);\r\n console.log(\"Language: \" + language);\r\n console.log(\"Plot: \" + plot);\r\n console.log(\"Actors: \" + actors);\r\n console.log(\"===============================\\n\");\r\n })\r\n // an error function to catch and display any errors\r\n .catch(function(error) {\r\n console.log(error);\r\n });\r\n}", "title": "" }, { "docid": "494a0e6d723c696b8991c15251897722", "score": "0.64565706", "text": "function movie(text) {\n\n //initializes movieName with a default setting\n var movieName = \"Mr.+Nobody\"\n //if there is items in the array and text is not an object it will join them together with a +\n if(text.length !== 0 && typeof(text) === \"object\"){\n movieName = text.join(\"+\");\n //if the text is a string then set the movieName to the text\n } else if (typeof(text) === \"string\") {\n movieName = text;\n }\n \n //using axios to fetch the json file so that it will parse through it, also the api key is hidden using dotenv\n axios({\n method: \"GET\",\n url: \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=\" + process.env.OMDB_ID\n }).then(movie => {\n var response = movie.data;\n //stores the information into the object\n var movieObject = {\n Title: response.Title,\n Year: response.Year,\n \"IMDB Rating\": response.imdbRating,\n \"Rotten Tomatoes\": response.Ratings[1].Value,\n Country: response.Country,\n Language: response.Language,\n Plot: response.Plot,\n Actors: response.Actors\n }\n //converts the object into a readible string in the printInfo function\n console.log(printInfo(movieObject));\n flag = false;\n })\n}", "title": "" }, { "docid": "07fc26423d699fe8f0b03b2f7817960d", "score": "0.64459413", "text": "function omdb(movie) {\n\tif (movie == null) {\n\t\tmovie = 'Mr. Nobody';\n\t}\n\t//run a request to omdb api with the movie specified\n\tvar queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\";\n\tconsole.log(queryURL); // to help debug the actual URL\n\trequest(queryURL, function(error, response, body) {\n\t\tif (!error && response.statusCode === 200) {\n\t\t\tvar json = JSON.parse(body);\n\t\t\tconsole.log(\"\\n--------------------\\n\");\n\t\t\tconsole.log(\"Title: \" + json.Title + \"\\n\");\n\t\t\tconsole.log(\"Year: \" + json.Year + \"\\n\");\n\t\t\tconsole.log(\"IMDB Rating: \" + json.imdbRating + \"\\n\");\n\t\t\tconsole.log(\"Rotten Tomato Score: \" + json.tomatoUserMeter + \"\\n\");\n\t\t\tconsole.log(\"Country: \" + json.Country + \"\\n\");\n\t\t\tconsole.log(\"Language: \" + json.Language + \"\\n\");\n\t\t\tconsole.log(\"Plot: \" + json.Plot + \"\\n\");\t\n\t\t\tconsole.log(\"Actors: \" + json.Actors + \"\\n\");\n\t\t\tconsole.log(\"\\n--------------------\\n\");\n\t} else {\n\t\tif(error) throw error; \n\t}\n});\n}", "title": "" }, { "docid": "4a59f2e81319e79a8f9f13306d316afe", "score": "0.6419107", "text": "function movieRequest(movie) {\n request(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\", function (error, response, body) {\n if (!error && response.statusCode === 200) {\n // console.log(JSON.parse(body));\n body = JSON.parse(body);\n logger.info(body.Title + \" was released in \" + body.Year +\".\");\n logger.info(\"It received a rating of \" + body.Ratings[0].Value + \" from IMDB and a rating of \" + body.Ratings[1].Value + \" from Rotten Tomatoes.\");\n logger.info(\"It was made in \" + body.Country + \" in \" + body.Language + \".\");\n logger.info(\"Plot: \" + body.Plot);\n logger.info(\"Cast: \" + body.Actors);\n }\n });\n}", "title": "" }, { "docid": "1f4700e4502838776380a250fac10e80", "score": "0.64119476", "text": "function movieDisplay(requestMovie) {\n log.info(\"Title: \" + requestMovie.Title);\n log.info(\"Year: \" + requestMovie.Year);\n log.info(\"IMDB Rating: \" + requestMovie.imdbRating);\n\n // Checks to see if Rotten Tomato ratings exist in ratings array\n var rotten = requestMovie.Ratings.length;\n var rottenExists = false;\n for (i = 0; i < rotten; i++) {\n if (requestMovie.Ratings[i].Source === \"Rotten Tomatoes\") {\n log.info(\"Rotten Tomatoes Rating: \" + requestMovie.Ratings[i].Value);\n rottenExists = true;\n }\n }\n if (rottenExists === false) {\n log.info(\"No Rotten Tomatoes Rating available.\");\n }\n log.info(\"Produced in: \" + requestMovie.Country);\n log.info(\"Plot: \" + requestMovie.Plot);\n log.info(\"Actors: \" + requestMovie.Actors);\n}", "title": "" }, { "docid": "22ad9bb5c577652721c9c04541b180d2", "score": "0.64019984", "text": "function getMovieInfo() {\n var url = `http://www.omdbapi.com/?t=${searchValue}&apikey=${keys.omdb.key}`;\n\n axios\n .get(url)\n .then(function(response) {\n console.log('movie title', response.data.Title);\n console.log('movie year', response.data.Year);\n console.log('movie Imdb rating', response.data.imdbRating);\n console.log('movie Country', response.data.Country);\n console.log('movie Language', response.data.Language);\n console.log('movie Plot', response.data.Plot);\n console.log('movie Actors', response.data.Actors);\n\n $.each(response.data.Ratings, function(index, value) {\n if (value.Source == 'Rotten Tomatoes') {\n console.log('Rotten Tomatoes Rating', value.Value);\n }\n });\n })\n .catch(function(error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "665d8e3304d5f1bb550ece7527d9f221", "score": "0.639467", "text": "function movie() {\n axios.get(\"http://www.omdbapi.com/?apikey=trilogy&t=\" + film)\n .then(function (response) {\n // handle success\n var rtnScore = \"\";\n var imdbScore = \"\";\n if (response.data.Response != \"False\") {\n if (response.data.Ratings != undefined) {\n response.data.Ratings.forEach(function (i) {\n if (i.Source == \"Rotten Tomatoes\") {\n rtnScore = i.Value;\n }\n if (i.Source == \"Internet Movie Database\") {\n imdbScore = i.Value;\n }\n })\n } else {\n imdbScore = response.data.Year;\n rtnScore = \"N/A\";\n }\n\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Year released: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + imdbScore);\n console.log(\"Rotten Tomatoes Rating: \" + rtnScore);\n console.log(\"Country produced: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n console.log(\"\\n-------------------------------\\n\");\n } else {\n console.log(\"There was an error finding that movie! Please try again!\");\n console.log(\"\\n-------------------------------\\n\");\n }\n })\n .catch(function (error) {\n // handle error\n console.log(\"There was an error finding that movie! Please try again!\");\n console.log(\"\\n-------------------------------\\n\");\n })\n}", "title": "" }, { "docid": "a667892aff278bf5c70a29ebe00a4c16", "score": "0.639354", "text": "function movieThis() {\n\n\t\tvar movieName = \"\";\n\t\tvar movieNameArr = [];\n\t\tconsole.log(process.argv[3])\n\n\n\t\t// Loop through Args\n\t\tif (process.argv[3] == undefined){\n\t\t\t\tmovieName = \"Mr. Nobody\";\n\t\t\t}\n\t\t\t\n\t\telse {\n\n\t\t\tfor (var i = 3; i < process.argv.length; i++) {\n\t\t\t\tmovieNameArr.push(process.argv[i]);\n\t\t\t\tmovieName = movieNameArr.join(\"+\");\n\n\t\t\t}// close loop\n\t\t}// close if statement\n\n\n\n\t\t\n\t\t// OMDB API REQUEST\n\t\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=40e9cece\";\n\t\t\tconsole.log(queryUrl);\n\n\t\trequest(queryUrl, function(error, response, body) {\n\t\t\tif (!error && response.statusCode === 200) {\n\t\t\t\t// console.log(JSON.parse(body));\n\n\t\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\t\tconsole.log(\"Year: \" + JSON.parse(body).Year);\n\t\t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t\t\t// console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Rating[0].Value);\n\t\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\t\tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t\t\tconsole.log(\"---------------------\")\n\t\t\t\tconsole.log(\"+++++++++++++++++++++\")\n\t\t\t}\n\t\t});// close queryUrl request\n\t} // close movie function", "title": "" }, { "docid": "9f76a556cd75ea46477f03634ee4acf8", "score": "0.638453", "text": "function omdB(movie) {\n\n\n\n if (!movie) {\n movie = \"Taxi Driver\"\n request('https://api.themoviedb.org/3/search/movie?api_key=cba1b4cbb2e31573ed2bee4f2bac51c8&language=en-US&query=' + movie + '&page=1', function(error, response, body) {\n if (!error && response.statusCode == 200) {\n var info = JSON.parse(body)\n\n log(\"\\n---------------------\\n\");\n log(\"Title: \" + info.results[0].title);\n // log(\"Starring: \" + info.Actors + \"/n\");\n log(\"Release Date: \" + info.results[0].release_date);\n // log(\"IMDB Rating: \" + info.imdbRating);\n log(\"Language: \" + info.results[0].original_language + \"/n\");\n log(\"Plot: \" + info.results[0].overview + \"/n\");\n // log(\"RT Score: \" + info.tomatoUserMeter);\n // log(\"RT URL: \" + info.tomatoURL + \"/n\");\n log(\"\\n---------------------\\n\");\n } else {\n console.log(\"Error occured\" + error);\n }\n\n\n });\n\n }\n}", "title": "" }, { "docid": "5be28ddd6d28d8cc52f4aead2547241d", "score": "0.63812894", "text": "function movieThis(movieName) {\n axios({\n method:'get',\n url:\"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=trilogy\" \n })\n .then (function (response){\n console.log(\"===============================\");\n console.log(\"Movie Title: \", response.data.Title);\n console.log(\"\\nRelease Year: \", response.data.Year);\n console.log(\"\\n IMDB Rating: \", response.data.imdbRating);\n console.log(\"===============================\");\n });\n}", "title": "" }, { "docid": "7abef674ffd7d732691e20082a558749", "score": "0.63790727", "text": "function getMovie(movieName){\n request('http://www.omdbapi.com/?r=json&t=' + movieName + '&apikey=228c4f7d', function (error, response, body) {\n var obj = JSON.parse(body);\n console.log('Title: ' + obj[\"Title\"]);\n console.log('Year: ' + obj[\"Year\"]);\n console.log('Rated: ' + obj[\"Rated\"]);\n console.log('Language: ' + obj[\"Language\"]);\n console.log('Release date: ' + obj[\"Released\"]);\n console.log('Genre: ' + obj[\"Genre\"]);\n console.log('Actors: '+ obj[\"Actors\"]);\n console.log('Plot: '+ obj[\"Plot\"]);\n console.log('IMDB Rating: ' + obj[\"imdbRating\"]);\n });\n}", "title": "" }, { "docid": "c3c1c0a06bab3dc8f4931618333cca2a", "score": "0.63766104", "text": "function getMovie(searchTerm){\n\n\tvar params = {\n \ttitle: searchTerm,\n \ttype: 'movie',\n\t}\n\n\tvar options = {\n\t\ttomatoes: true\n\t}\n\n\t//call ombd to get info\n\tomdb.get(params, options, function(err, movies) {\n if(err) {\n return console.error(err);\n }\n \n if(movies.length < 1) {\n return console.log('No movies were found!');\n } else {\n\n \tvar imdbID = movies.imdb.id;\n \t//since omdb didn't have languages, call the imdb\n \timdb.getById(imdbID, function(err, data) {\n \t\t// console.log(data.languages);\n\n \t//console.log all results\n \tconsole.log(\"Movie Title: \"+movies.title);\n \tconsole.log(\"Year Released: \"+movies.year);\n \tconsole.log(\"IMDB Rating: \"+movies.imdb.rating);\n \tconsole.log(\"Countries: \"+movies.countries);\n \tconsole.log(\"Languages: \"+data.languages);\n \tconsole.log(\"Plot: \"+movies.plot);\n \tconsole.log(\"Actors: \"+movies.actors);\n \tconsole.log(\"Rotten Tomatoes Rating: \"+movies.tomato.rating);\n \tconsole.log(\"Rotten Tomato URL: \"+movies.tomato.url);\n\n \tvar logMovie= \"Movie Title: \"+movies.title+\"\\r\\n\"+\"Year Released: \"+movies.year+\"\\r\\n\"+\"IMDB Rating: \"+movies.imdb.rating+\"\\r\\n\"+\"Countries: \"+movies.countries+\"\\r\\n\"+\"Languages: \"+data.languages+\"\\r\\n\"+\"Plot: \"+movies.plot+\"\\r\\n\"+\"Actors: \"+movies.actors+\"\\r\\n\"+\"Rotten Tomatoes Rating: \"+movies.tomato.rating+\"\\r\\n\"+\"Rotten Tomato URL: \"+movies.tomato.url+\"\\r\\n\";\n \tlogMovie = logMovie.toString();\n fs.appendFile(\"log.txt\", logMovie+\"\\r\\n\", function(err, data) {});\n\n\n\n \t\t// console.log(result);\n \t\t});\n };\n });\t\n}", "title": "" }, { "docid": "b3c094ee8a50170b9a07a4e1f8fe8105", "score": "0.63684416", "text": "function movie(movieName) {\n\n if (!movieName) {\n movieName = 'Mr. Nobody';\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=def076ee\";\n\n request(queryUrl, function(error, response, body) {\n\n if (!error && response.statusCode === 200) {\n \n var result = JSON.parse(body);\n console.log('-------------------------------------------------------')\n console.log(\"Title: \" + result.Title);\n console.log(\"Year: \" + result.Released);\n console.log(\"IMDB Rating: \" + result.imdbRating );\n // console.log(\"Rotten Tomatoes: \" + result.Ratings[1].Value);\n // since all movies do not have Rotten Tomattoes Ratings, build a for loop to crosscheck if there is one\n for(var i = 0; i < result.Ratings.length; i++) {\n\t \tif(result.Ratings[i].Source === \"Rotten Tomatoes\") {\n\t \t\tconsole.log(\"Rotten Tomatoes: \" + result.Ratings[i].Value);\n } else if(result.Ratings[i].Website !== undefined) {\n\t \t\t\tconsole.log(\"Rotten Tomatoes: \" + result.Ratings[i].Website)\n } \n };\n console.log(\"Country: \" + result.Country);\n console.log(\"Language: \" + result.Language);\n console.log(\"Plot: \" + result.Plot);\n console.log(\"Actors: \" + result.Actors);\n console.log('-------------------------------------------------------')\n \n\n }\n });\n console.log('-------------------------------------------------------')\n console.log(\"You searched for: \" + movieName);\n\n}", "title": "" }, { "docid": "699b63d660aeeb60fd1ddae06f857932", "score": "0.63484114", "text": "function Movie(title, duration, stars) {\n this.title = title;\n this.duration = duration;\n this.stars = stars;\n}", "title": "" }, { "docid": "dda8028583f6b7edeba381af6bcb74d7", "score": "0.6326201", "text": "function movies(movieTitle){\n\n // run a request to the OMDB API with the movie specified\n if (movieTitle === ''){\n movieTitle = \"Mr. Nobody\"\n }\n\n request(\"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=trilogy\", function(error, response, body) {\n\n\n\n // If the request is successful (i.e. if the response status code is 200) [no errors]\n if (!error && response.statusCode === 200) {\n\n // * Title of the movie.\n console.log(\"Movie title: \" + JSON.parse(body).Title);\n\n // * Year the movie came out.\n console.log(\"The movie was released in: \" + JSON.parse(body).Year);\n\n // * IMDB Rating of the movie.\n console.log(\"Movie Rating: \" + JSON.parse(body).imdbRating);\n\n // * Rotten Tomatoes Rating of the movie.\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings);\n\n // * Country where the movie was produced.\n console.log(\"Country produced in: \" + JSON.parse(body).Country);\n\n // * Language of the movie.\n console.log(\"This movie is in: \" + JSON.parse(body).Language);\n\n // * Plot of the movie.\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n\n // * Actors in the movie.\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n}\n\n\n });\n\n\n}", "title": "" }, { "docid": "0d6372233d6a31bd85b53619a905161e", "score": "0.632053", "text": "function movieThis () {\n var request = require(\"request\");\n//Get user input for movie name. Default is \"Mr. Nobody\"\n var title = title || \"Mr. Nobody\"\n \n //Retrieve data from OMDB\n var queryUrl = \"http://www.omdbapi.com/?t=\" + title + \"&y=&plot=short&apikey=trilogy\";\n console.log(queryUrl);\n request(queryUrl, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(\"Title: \" + JSON.parse(body).Title + \"\\n\" +\n \"Release Year: \" + JSON.parse(body).Year + \"\\n\" +\n \"IMDB Rating: \" + JSON.parse(body).imdbRating + \"\\n\" +\n \"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[2].Value + \"\\n\" +\n \"Produced in: \" + JSON.parse(body).Country + \"\\n\" +\n \"Language: \" + JSON.parse(body).Language + \"\\n\" +\n \"Plot: \" + JSON.parse(body).Plot + \"\\n\" +\n \"Actors: \" + JSON.parse(body).Actors )\n }\n \n\n \n });\n}", "title": "" }, { "docid": "2165afc1e5c75fec76e9c97ca70e8869", "score": "0.632001", "text": "function movieThis (movieTitle) {\n \n if (!movieTitle) {\n movieTitle = \"Dr. Strangelove\";\n }\n \n console.log(\"Searching OMDB for: \" + movieTitle + \"\\n\");\n \n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=trilogy\";\n axios.get(queryUrl).then(\n function(response) {\n // console.log(JSON.stringify(response.data, null, 3));\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Rated: \" + response.data.Rated);\n console.log(\"Released: \" + response.data.Released);\n \n console.log(\"Reviews: \" + response.data.Ratings.map(mapRatings));\n console.log(\"Produced in: \" + response.data.Country);\n console.log(\"Language(s): \" + response.data.Language);\n console.log(\"Starring: \" + response.data.Actors);\n console.log(\"Plot: \" + response.data.Plot);\n })\n .catch(function(error) {\n \n if (error.response) {\n // Responded with a status code that falls out of the range of 2xx\n console.log(\"*** Data: \" + error.response.data + \" ***\");\n console.log(\"*** Status: \" + error.response.status + \" ***\");\n console.log(\"*** Headers: \" + error.response.headers + \" ***\");\n \n } else if (error.request) {\n // No response was received, log object with error details\n console.log(error.request);\n \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 \n }", "title": "" }, { "docid": "0b5763f9eb04aaaabb9003b1b8596a1c", "score": "0.63165784", "text": "function movieThis(movie) {\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&plot=short&apikey=trilogy\")\n .then(function (response) {\n if (response.data.Response === \"True\") {\n console.log(\"---------------------------------------------------------------------------\\n\")\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Released Year: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.Ratings[0].Value);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Languages: \" + response.data.Language);\n console.log(\"Actors: \" + response.data.Actors);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"\\n---------------------------------------------------------------------------\") \n\n } else {\n console.log(\"---------------------------------------------------------------------------\\n\")\n console.log(\"Sorry, no movie title found for '\" + movie +\"'\");\n console.log(\"\\n---------------------------------------------------------------------------\")\n };\n }).catch(function (error) {\n console.log(\"---------------------------------------------------------------------------\\n\")\n console.log(\"Sorry, an error has occured. Please try again later.\");\n console.log(\"\\n---------------------------------------------------------------------------\")\n });\n}", "title": "" }, { "docid": "997163421e209afe7e94f08772003b2b", "score": "0.6276453", "text": "function fillMovieObject(movie) {\n var newMovie = new Movie();\n\n movie.imdbVotes = movie.imdbVotes.replace(/\\,/g, \"\");\n\n newMovie.title = movie.Title;\n newMovie.year = parseInt(movie.Year, 10);\n newMovie.genre = movie.Genre.split(\",\");\n newMovie.rating = parseFloat(movie.imdbRating);\n newMovie.votes = parseInt(movie.imdbVotes, 10);\n newMovie.plot = movie.Plot;\n newMovie.release_date = movie.Released;\n newMovie.language = movie.Language;\n newMovie.imdb_id = movie.imdbID;\n newMovie.director = movie.Director.split(\",\");\n newMovie.actors = movie.Actors.split(\",\");\n newMovie.writers = movie.Writer.split(\",\");\n newMovie.img_url = movie.Poster;\n\n return newMovie;\n\n}", "title": "" }, { "docid": "92c0b4003a04d2d176f8608d815496dd", "score": "0.62709326", "text": "function myMovie() {\n\n\tvar searchMovie;\n\tif(secondCommand === undefined) {\n\t\tsearchMovie = \"Mr. Nobody\";\n\t} else {\n\t\tsearchMovie = secondCommand;\n\t};\n\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + searchMovie + \"&y=&plot=short&apikey=40e9cece\"; \n\trequest(queryUrl, function(error, response, body) {\n\t\tif(!error && response.statusCode === 200){\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body)[\"Title\"]);\n\t\t\tconsole.log(\"Year: \" + JSON.parse(body)[\"Year\"]);\n\t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body)[\"imdbRating\"]);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body)[\"Country\"]);\n\t console.log(\"Language: \" + JSON.parse(body)[\"Language\"]);\n\t console.log(\"Plot: \" + JSON.parse(body)[\"Plot\"]);\n\t console.log(\"Actors: \" + JSON.parse(body)[\"Actors\"]);\n\t console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body)[\"tomatoRating\"]);\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "a3cd5e2359f9eee391a2014bc38b2173", "score": "0.6260243", "text": "function omdbData(movie){\n var omdbURL = 'http://www.omdbapi.com/?t=' + movie + '&plot=short&tomatoes=true';\n \n request(omdbURL, function (error, response, body){\n if(!error && response.statusCode == 200){\n var body = JSON.parse(body);\n \n console.log(\"Title: \" + body.Title);\n console.log(\"Release Year: \" + body.Year);\n console.log(\"IMdB Rating: \" + body.imdbRating);\n console.log(\"Country: \" + body.Country);\n console.log(\"Language: \" + body.Language);\n console.log(\"Plot: \" + body.Plot);\n console.log(\"Actors: \" + body.Actors);\n console.log(\"Rotten Tomatoes Rating: \" + body.tomatoRating);\n console.log(\"Rotten Tomatoes URL: \" + body.tomatoURL);\n } else\n {\n console.log('error');\n }\n if(movie === \"Mr. Nobody\"){\n console.log(\"-----\");\n console.log(\"If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\");\n console.log(\"It's on Netflix!\");\n }\n });\n\n}", "title": "" }, { "docid": "044e915e8329d99a55d5a59c5cb46a8e", "score": "0.6259927", "text": "function getMovie(movieName) {\n axios.get(`http://www.omdbapi.com/?apikey=trilogy&t=${movieName}+`).then\n (function (response) {\n var stuff = response.data\n console.log(\"\");\n console.log(`Title: ${stuff.Title}`);\n console.log(`Released: ${stuff.Year}`);\n console.log(`IMDB rating: ${stuff.Ratings[0].Value}`);\n console.log(`Rotten tomatoes rating: ${stuff.Ratings[1].Value}`);\n console.log(`Produced in: ${stuff.Country}`);\n console.log(`Language: ${stuff.Language}`)\n console.log(`Plot: ${stuff.Plot}`);\n console.log(`Starring: ${stuff.Actors}`);\n if (movieName === \"Mr.+Nobody\") {\n console.log(`If you haven't watched Mr. Nobody then you should: http://www.imdb.com/title/tt0485947/`);\n console.log(\"It's on Netflix!\");\n }\n console.log(`---------------------------`)\n })\n .catch(function (err) {\n console.log(err)\n });\n}", "title": "" }, { "docid": "87c2a310d23f47735b9fed4aafd7c7a9", "score": "0.6258165", "text": "function movie() {\n\n var title = searchTerm;\n \n var titleSplit = title.split(' ').join('+');\n\n // search omdbi api using axios\n axios\n .get('http://www.omdbapi.com/?apikey=' + keys.omdb.id + '&t=' + titleSplit)\n .then(function ({data}) {\n\n var movie = data;\n\n if (movie.Title) {\n\n // print movie data to console\n console.log(\n '\\n' + heading(movie.Title.toUpperCase()) + \n divider(' (' + movie.Year + ')'));\n console.log(movie.Plot);\n\n console.log(divider(divLine));\n\n logObject.push('\\r\\r' + movie.Title.toUpperCase() + ' MOVIE SEARCH AT ' + now);\n\n console.log(divider('STARRING: ') + movie.Actors);\n console.log(divider('PRODUCED IN: ') + movie.Country);\n console.log(divider('LANGUAGE(S): ') + movie.Language);\n\n // only print ratings data that exists\n if (movie.Ratings[1] && movie.Ratings[0]) {\n console.log(divider('RATINGS: ') + 'Rotten Tomatoes: ' + \n movie.Ratings[1].Value + \n divider(' | ') + \n 'IMDb: ' + movie.Ratings[0].Value);\n } else if (movie.Ratings[1]) {\n console.log(\n divider('RATING: ') + 'Rotten Tomatoes: ' + \n movie.Ratings[1].Value);\n } else if (movie.Ratings[0]) {\n console.log(\n divider('RATING: ') + 'IMDb: ' + movie.Ratings[0].Value);\n };\n\n logObject.push(\n '\\rplot: ' + movie.Plot,\n '\\rcast: ' + movie.Actors,\n '\\ryear: ' + movie.Year,\n ' country: ' + movie.Country,\n ' language(s): ' + movie.Language\n );\n\n logData(logObject);\n\n } \n\n // if no data is returned from omdb api\n else {\n\n console.log(invalid('\\nI cannot find any movies (or television shows!) with the title \"' + title + '\" right now.'));\n\n };\n\n reRun();\n\n })\n \n // catch errors\n .catch(function (error) {\n console.log(inverse(error));\n reRun();\n });\n\n}", "title": "" }, { "docid": "a2e4ba6c73ccb221ab431d70b4d32a78", "score": "0.6255245", "text": "function omdbFunction(movieTitle){\n\trequest(\"http://www.omdbapi.com/?apikey=40e9cece&t=\" + movieTitle, function(error, response, body){\n\t\tif(error){\n\t\t\tconsole.log(err);\n\t\t}\n\t\t//Parse the body of the return to make it accessible for later information\n\t\tvar movieInfo = JSON.parse(body);\n\t\t//Commented out string to see the full data for the movie info and access data later\n\t\t// console.log(movieInfo);\n\n\t\t//variable string to be accessed when both logging and writing the move information\n\t\tvar allMovieData = \"======================\" + newLine +\n\t\t\t\"===== MOVIE DATA =====\" + newLine + \n\t\t\t\"======================\" + newLine + \n\t\t\t\"Title: \" + movieInfo.Title + newLine +\n\t\t\t\"Year: \" + movieInfo.Year + newLine +\n\t\t\t\"IMDB Rating: \" + movieInfo.Ratings[0].Value + newLine +\n\t\t\t\"Rotten Tomatoes Rating: \" + movieInfo.Ratings[1].Value + newLine +\n\t\t\t\"Country: \" + movieInfo.Country + newLine +\n\t\t\t\"Langauge: \" + movieInfo.Language + newLine +\n\t\t\t\"Plot: \" + movieInfo.Plot + newLine +\n\t\t\t\"Actors: \" + movieInfo.Actors + newLine;\n\n\t\t//log all the movie information to the console\n\t\tconsole.log(allMovieData);\n\n\t\t//Write the movie information to the log.txt file\n\t\tfs.appendFile(\"log.txt\", allMovieData, \"utf8\", (err) => {\n\t\t\tif (err) throw err;\n\t\t\tconsole.log(\"Movie data added to log.txt file\");\n\t\t});\n\t})\n}", "title": "" }, { "docid": "93a63b47c854408f5fc1eea275bc6c81", "score": "0.6241274", "text": "function movieSearch(title) {\n axios\n .get(`http://www.omdbapi.com/?t=${title}&apikey=${process.env.OMDB_API}`)\n .then(res => {\n const result = res.data;\n const data = `\n ==============MOVIE==============\n\n Title: ${result.Title}\n Year: ${result.Year}\n Rating: ${result.Rated}\n Genre: ${result.Genre}\n Cast: ${result.Actors}\n Awards: ${result.Awards}\n `;\n logger(data);\n console.log(data);\n })\n .catch(err => console.log(`Error: ${err.message}`));\n}", "title": "" }, { "docid": "f1aaa51859036f1ab15f774031ace1eb", "score": "0.624005", "text": "function omdb() {\n var movieEndPoint = \"http://www.omdbapi.com/?t=\";\n var movieParams = \"&y=&plot=short&apikey=40e9cece\";\n var movieTitle = \"\";\n for (var i = 0; i < userArr.length; i++) {\n if (i === userArr.length - 1) {\n movieTitle += (userArr[i])\n } else {\n movieTitle += (userArr[i] + \"+\")\n }\n }\n if (userArr.length == 0) {\n movieTitle = \"Mr.+Nobody\";\n }\n var movieApiCall = movieEndPoint + movieTitle + movieParams;\n request(movieApiCall, function(error, response, body) {\n // If the request was successful...\n if (!error && response.statusCode === 200) {\n // Then log the body from the site!\n console.log(\"The Title of the movie is \" + JSON.parse(body).Title);\n console.log(\"The Year of the movie was released \" + JSON.parse(body).Year);\n console.log(\"The IMBD Rating of the movie is \" + JSON.parse(body).imdbRating);\n console.log(\"The Rotten Tomatos score of the movie is \" + JSON.parse(body).Metascore);\n console.log(\"This movie was produced in \" + JSON.parse(body).Country);\n console.log(\"The Language of this movie is \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n}", "title": "" }, { "docid": "1f5ae27ed3f3207aa8c09d7d92f9d17a", "score": "0.6226659", "text": "function dramaMoviesRate(movies) {\n \n }", "title": "" }, { "docid": "5b499ff7c9d5bcbba84ed386d0995b8e", "score": "0.6226525", "text": "function Movie(movieData) {\n\n this.title = movieData.title;\n this.overview = movieData.overview;\n this.average_votes = movieData.vote_average;\n this.total_votes = movieData.vote_count;\n this.image_url = 'https://image.tmdb.org/t/p/w500' + movieData.poster_path;\n this.popularity = movieData.popularity;\n this.released_on = movieData.relase_date;\n}", "title": "" }, { "docid": "1ddbc02d906dfb8b964756862c68be49", "score": "0.62166446", "text": "function movieThis(movieName) {\n if (!movieName) movieName = \"Mr. Nobody\";\n\n axios.get(\"https://omdbapi.com/?t=\" + movieName + \"&apikey=trilogy\")\n .then(function (response) {\n\n var data = response.data;\n var movieData = [\n \"Title: \" + data.Title,\n \"Year: \" + data.Year,\n \"IMDB Rating: \" + data.imdbRating,\n \"Rotten Tomatoes Rating: \" + data.Ratings[1].Value,\n \"Country: \" + data.Country,\n \"Language: \" + data.Language,\n \"Plot: \" + data.Plot,\n \"Actors: \" + data.Actors\n ].join(\"\\n\");\n\n fs.appendFile(\"log.txt\", \"---------- MOVIE ----------\" + \"\\n\" + movieData + \"\\n\\n\", function (err) {\n if (err) throw err;\n console.log(movieData);\n });\n });\n}", "title": "" }, { "docid": "36a8e1f7ad73810c6a367d4357567ee6", "score": "0.6214737", "text": "function movieThis(userEnteredData) {\n if (!userEnteredData) {\n userEnteredData = \"jaws\";\n }\n axios.get(\"https://www.omdbapi.com/?t=\" + userEnteredData + \"&y=&plot=short&apikey=trilogy\")\n .then(function (response) {\n console.log(\"-----------------\")\n console.log(\"Movie Title: \" + response.data.Title);\n console.log(\"Year Released: \" + response.data.Year);\n console.log(\"Imdb Rating: \" + response.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Metascore);\n console.log(\"Country movie produced: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n console.log(\"-----------------\");\n })\n .catch(function (error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "957ce1cfef88966f06df8ab50bee95e1", "score": "0.6206188", "text": "function Movie (title, year, genre) {\n this.title = title\n this.year = year\n this.genre = genre\n // Could add methods here, but this would be redundant\n}", "title": "" }, { "docid": "a9ba22acc462588b688fee0eeba76b2f", "score": "0.61923033", "text": "function movies(input) {\n if (!input) {\n input = \"Mr. Nobody\";\n }\n\n var queryUrl =\n \"http://www.omdbapi.com/?t=\" + input + \"&y=&plot=short&apikey=9613e41\";\n\n axios.get(queryUrl).then(function (response) {\n //console.log(response);\n console.log(\"Title of the movie: \" + response.data.Title);\n console.log(\"Year the movie came out: \" + response.data.Year);\n console.log(\"IMDB Rating of the movie: \" + response.data.imdbRating);\n console.log(\n \"Rotten Tomatoes Rating of the movie: \" + response.data.Ratings[0].Value\n );\n console.log(\n \"Country where the movie was produced: \" + response.data.Country\n );\n console.log(\"Language of the movie: \" + response.data.Language);\n console.log(\"Plot of the movie: \" + response.data.Plot);\n console.log(\"Actors in the movie: \" + response.data.Actors);\n \n\n var showData = [\n \"Title of the movie: \" + response.data.Title,\n \"Year the movie came out: \" + response.data.Year,\n \"IMDB Rating of the movie: \" + response.data.imdbRating,\n \"Rotten Tomatoes Rating of the movie: \" + response.data.Ratings[1].Value,\n \"Country where the movie was produced: \" + response.data.Country,\n \"Language of the movie: \" + response.data.Language,\n \"Plot of the movie: \" + response.data.Plot,\n \"Actors in the movie: \" + response.data.Actors\n ].join(\"\\n\\n\");\n\n fs.appendFile(\"log.txt\", showData + divider, function (err) {\n if (err) throw err;\n });\n });\n}", "title": "" }, { "docid": "cf4f64197c7378fafcd03cd51cf9de24", "score": "0.6190409", "text": "function getMovie()\t{\n\n\t//Rename a global variable to help me keep track of it in this particular function\n\tvar movieTitle = mediaTitle;\n\n\t//Set up default movie title to send into OMDB if no movie titel is entered (...one of my faves)\n\tif (movieTitle === \"\")\t{\n\t\tmovieTitle = \"kung fu hustle\";\n\t}\n\n\t//Call to OMDB database for movie info\n\trequest(\"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&\" + omdbApiKey, function(error, response, body) {\n\t\t//Only return a response if there is no error, the response goes fully through and listing in the database is considered complete\n\t\tif (!error && response.statusCode === 200 && JSON.parse(body).Response === \"True\")\t{\n\t\t\t//Log info to console\n\t\t\tconsole.log(\"This movie's title is \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"It was released in \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"The movie's IMDB rating is \" + JSON.parse(body).imdbRating);\n\t\t\t//If there is no Rotton Tomatoes rating, skip it\n\t\t\tif (JSON.parse(body).Ratings[1])\t{\n\t\t\t\tconsole.log(\"The Rotten Tomatoes rating is \" + JSON.parse(body).Ratings[1].Value);\n\t\t\t}\n\t\t\tconsole.log(\"It was produced in \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"The original release language was \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"The plot of this movie goes something like this: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"This film stars \" + JSON.parse(body).Actors);\n\t\t\t//Write the movie info in the log file\n\t\t\tfs.appendFile(\"log.txt\", \"\\n***\\n\" + JSON.parse(body).Title + \"\\n\" + JSON.parse(body).Year + \"\\n\" + JSON.parse(body).imdbRating + \"\\n\" + (response.Response === \"True\" ? JSON.parse(body).Ratings[1].Value : \"\") + JSON.parse(body).Country + \"\\n\" + JSON.parse(body).Language + \"\\n\" + JSON.parse(body).Plot + \"\\n\" + JSON.parse(body).Actors, function(error)\t{\n \t\t\tif (error)\t{\n \t\t\tconsole.log(error)\n \t\t\t\t}\t\n \t\t});\t\n \t//If the movie can not be found, say so in the console\n \t} else {\n \t\tconsole.log(\"Movie not found.\");\n \t}\n\t});\n}", "title": "" }, { "docid": "0e4062b45f6f320ef30af1c762aeacaa", "score": "0.6181522", "text": "function movieThis() {\n console.log(`\\n - - - - -\\n\\nSEARCHING FOR...\"${userQuery}\"`);\n if (!userQuery) {\n userQuery = \"mr nobody\";\n };\n request(\"http://www.omdbapi.com/?t=\" + userQuery + \"&apikey=ae9172\", function (error, response, body) {\n let movieName = JSON.parse(body);\n\n // BECAUSE THE ROTTEN TOMATOES RATING WAS NESTED IT WAS NECESSARY TO CAPTURE ITS VALUES IN AN ARRAY TO CREATE A PATH\n let ratingsArr = movieName.Ratings;\n if (ratingsArr.length > 2) {}\n\n if (!error && response.statusCode === 200) {\n console.log(`\\nTARRRRRRA!...\\n\\nTitle: ${movieName.Title}\\nCast: ${movieName.Actors}\\nReleased: ${movieName.Year}\\nIMDb Rating: ${movieName.imdbRating}\\nRotten Tomatoes Rating: ${movieName.Ratings[1].Value}\\nCountry: ${movieName.Country}\\nLanguage: ${movieName.Language}\\nPlot: ${movieName.Plot}\\n\\n- - - - -`)\n } else {\n return console.log(\"Not found!. Error:\" + error)\n };\n })\n}", "title": "" }, { "docid": "3ad50f5e1ff6e12a06547b03a8a400be", "score": "0.6176086", "text": "function showMovie(a) {\n\t//Will insert movie name into the URL with correct end point\n\tvar myQuery = \"http://www.omdbapi.com/?t=\" + a + \"&y=&plot=short&apikey=40e9cece\";\n\trequest(myQuery, function(error, response, body) {\n\t\t//if a is undefined, it will default to showing Mr. Nobody details\n\t\tif (a === \"\" || a === undefined) {\n\t\t\tshowMovie(\"Mr Nobody\");\n\t\t//if it is not an error and success code, it will desplayed the entered movie's details\n\t\t} else if (!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"\\n****************************************\\n\");\n\t\t\t//Console Log all movie details below\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"Year Released: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"IMDB Rating: \" +JSON.parse(body).Ratings[0].Value);\n\t\t\tconsole.log('Rotten Tomatoes Rating: ' + JSON.parse(body).Ratings[1].Value);\n\t\t\tconsole.log(\"Country of Production: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"\\n****************************************\\n\");\n\t\t}\n\t})\n}", "title": "" }, { "docid": "796dca65064aab7ae9e9ac7235cdc004", "score": "0.61733395", "text": "function queryMovie(searchTerm) {\n\n\tvar movieName = searchTerm.replace(\" \", \"_\");\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=40e9cece\";\n\n\trequest(queryUrl, function(error, response, body){\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t\t\tif (JSON.parse(body).Response === \"False\") {\n\n\t\t\t\tconsole.log(JSON.parse(body).Error);\n\n\t\t\t} else {\n\n\t\t\t\tvar title = \"Title: \" + JSON.parse(body).Title;\t\n\t\t\t\tvar year = \"Year: \" + JSON.parse(body).Year;\n\t\t\t\tvar imdbRating = \"IMDB Rating: \" + JSON.parse(body).imdbRating;\n\t\t\t\tvar rottenTomato = \"none\";\n\n\t\t\t\t//take care of edge case where rotten tomato rating is not avilable\n\t\t\t\tif (JSON.parse(body).Ratings[1] != undefined) {\n\n\t\t\t\t\trottenTomato = \"Rotten Tomato Rating: \" + JSON.parse(body).Ratings[1].Value\n\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tvar country = \"Country: \" + JSON.parse(body).Country;\n\t\t\t\tvar lang = \"Language: \" + JSON.parse(body).Language;\n\t\t\t\tvar plot = \"Plot: \" + JSON.parse(body).Plot;\n\t\t\t\tvar actors = \"Actors: \" + JSON.parse(body).Actors;\n\t\t\t\tvar dataArray = [title, year, imdbRating, rottenTomato, country, lang, plot, actors];\n\n\t\t\t\tlogToFile(dataArray);\n\n\t\t\t\tconsole.log(title);\t\t\t\t\n\t\t\t\tconsole.log(year);\n\t\t\t\tconsole.log(imdbRating);\n\t\t\t\tconsole.log(rottenTomato);\n\t\t\t\tconsole.log(country);\n\t\t\t\tconsole.log(lang);\n\t\t\t\tconsole.log(plot);\n\t\t\t\tconsole.log(actors);\n\t\t\t\n\t\t\t}\n\n\t\t}\n\n\t})\n\n}", "title": "" }, { "docid": "5db025bf7f2105546486860cdc21d88b", "score": "0.6171499", "text": "function getTheMovieInfo(movie) {\n\n var url = \"http://www.omdbapi.com/?t=\" + movie;\n request(url, function(error, response, body) {\n\n if (!error && response.statusCode === 200) {\n recordIt(\"\\n----------------------------\");\n recordIt(\"\\nThe movie's title is \" + JSON.parse(body).Title);\n recordIt(\"\\nThe movie came out in \" + JSON.parse(body).Year);\n recordIt(\"\\nThe movie's IMDB rating is \" + JSON.parse(body).imdbRating);\n recordIt(\"\\nThe movie's was made in \" + JSON.parse(body).Country);\n recordIt(\"\\nThe movie was filmed in \" + JSON.parse(body).Language);\n recordIt(\"\\nThe plot is: \" + JSON.parse(body).Plot);\n recordIt(\"\\nThe stars of the movie are \" + JSON.parse(body).Actors);\n recordIt(\"\\nFind out more on the website: \" + JSON.parse(body).Website);\n }\n});\n}", "title": "" }, { "docid": "eb8d1b56377d0d6a81badf562ea677d9", "score": "0.61525536", "text": "function movieThis() {\n var movie = process.argv[3];\n if (!movie) {\n movie = \"mr nobody\";\n }\n params = movie\n request(\"http://www.omdbapi.com/?t=\" + params + \"&y=&plot=short&r=json&tomatoes=true\", function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var movieObject = JSON.parse(body);\n //console.log(movieObject); // Show the text in the terminal\n var movieResults =\n \"------------------------------ begin ------------------------------\" + \"\\r\\n\"\n \"Title: \" + movieObject.Title + \"\\r\\n\" +\n \"Year: \" + movieObject.Year + \"\\r\\n\" +\n \"Imdb Rating: \" + movieObject.imdbRating + \"\\r\\n\" +\n \"Country: \" + movieObject.Country + \"\\r\\n\" +\n \"Language: \" + movieObject.Language + \"\\r\\n\" +\n \"Plot: \" + movieObject.Plot + \"\\r\\n\" +\n \"Actors: \" + movieObject.Actors + \"\\r\\n\" +\n \"Rotten Tomatoes Rating: \" + movieObject.tomatoRating + \"\\r\\n\" +\n \"Rotten Tomatoes URL: \" + movieObject.tomatoURL + \"\\r\\n\" +\n \"------------------------------ fin ------------------------------\" + \"\\r\\n\";\n console.log(movieResults);\n log(movieResults); // calling log function\n } else {\n console.log(\"Error :\" + error);\n return;\n }\n });\n}", "title": "" }, { "docid": "0dba9a634321195a42b13ddf25e70476", "score": "0.6148686", "text": "function getMovie() {\n \n for (var i = 3; i < input.length; i++) {\n if (i > 2 && i < input.length) {\n\t movieName = movieName + \" \" + input[i];\n\t }\n\t}\n\t if (!movieName) {\n\t \tmovieName = \"Mr Nobody\";\n }\n \n\trequest(\"http://www.omdbapi.com/?t=\" + movieName + \"&apikey=trilogy\", function(error, response, body) {\n \n if (!error && response.statusCode === 200) {\n\t\t\tvar movieInfo = JSON.parse(body);\n\t\t\tvar movieResponse = \n\t\t\t\t\"|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\" + \"\\r\\n\" +\n\t\t\t\t\"Title: \" + movieInfo.Title + \"\\r\\n\" +\n\t\t\t\t\"Year movie was released: \" + movieInfo.Year + \"\\r\\n\" +\n\t\t\t\t\"IMDB movie rating (out of 10): \" + movieInfo.imdbRating + \"\\r\\n\" +\n\t\t\t\t\"Filmed in: \" + movieInfo.Country + \"\\r\\n\" +\n\t\t\t\t\"Language: \" + movieInfo.Language + \"\\r\\n\" + \n\t\t\t\t\"Movie plot: \" + movieInfo.Plot + \"\\r\\n\" +\n\t\t\t\t\"Actors: \" + movieInfo.Actors + \"\\r\\n\" +\n\t\t\t\t\"|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\"\n\t\t\tconsole.log(movieResponse);\n\t\t\t\n\t\t}\n\t});\n }", "title": "" }, { "docid": "44c324786f1671520eb06fc5c58bf05f", "score": "0.6142694", "text": "function omdb(title) {\n //building url to query database\n omdbURL = \"https://www.omdbapi.com/?t=\" + title + \"&y=&plot=short&apikey=trilogy\";\n\n //run AJAX call to the omdb API\n $.ajax({\n url: omdbURL,\n method: \"GET\"\n })\n // We store all of the retrieved data inside of an object called \"response\"\n .then(function (response) {\n\n // Log the queryURL\n console.log(omdbURL);\n\n // Log the resulting object\n console.log(response);\n //title\n\n $(\"#title\").text(response.Title);\n\n //running time\n $(\"#time\").html(\"<b>Running time:</b> \" + response.Runtime);\n //Plot\n $(\"#plot\").text(\"Plot\");\n $(\"#plot\").html(\"<p>\" + response.Plot + \"</p>\");\n //director and cast\n $(\"#directorANDcast\").html(\"<p><b>Director:</b> \" + response.Director + \"<br><b>Starring:</b> \" + response.Actors + \"</p>\");\n //poster\n $(\"#poster\").attr(\"src\", response.Poster);\n //ratings\n var ratingsDiv = $(\"#ratings\");\n var tomatoDiv = $(\"<td>\");\n var tomatoIcon = $(\"<img>\");\n tomatoIcon.attr(\"src\", \"css/tomato.png\");\n tomatoIcon.attr(\"style\", \"width:100px; height:100px\");\n var imdbDiv = $(\"<td>\");\n var imdbIcon = $(\"<img>\");\n imdbIcon.attr(\"src\", \"css/imdb.png\");\n imdbIcon.attr(\"style\", \"width:100px; height:100px\");\n var metaDiv = $(\"<td>\");\n var metaCIcon = $(\"<img>\");\n metaCIcon.attr(\"src\", \"css/meta.png\");\n metaCIcon.attr(\"style\", \"width:100px\");\n\n ratingsDiv.html(\"<td>\" + response.Ratings[1].Value + \"</td><td>\" + response.Ratings[0].Value + \"</td><td>\" + response.Ratings[2].Value + \"</td>\");\n tomatoDiv.append(tomatoIcon);\n imdbDiv.append(imdbIcon);\n metaDiv.append(metaCIcon);\n $(\"#icons\").prepend(tomatoDiv, imdbDiv, metaDiv);\n });\n }", "title": "" }, { "docid": "c09eb507e00cc3d830a3bc1f7c2aab86", "score": "0.61401373", "text": "function movieThis() {\n if (userChoice === undefined) {\n userChoice = \"Mr. Nobody\";\n }\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + userChoice + \"&y=&plot=short&apikey=trilogy\";\n \n request(queryUrl, function (error, response, body) {\n if (error) {\n console.log(error);\n }\n if (!error && response.statusCode === 200) {\n var musicChoice = JSON.parse(body);\n // console.log(JSON.parse(body));\n\n console.log(\"Movie Title: \" + musicChoice.Title);\n console.log(\"Year Movie Released: \" + musicChoice.Year);\n console.log(\"IMDB Rating: \" + musicChoice.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + musicChoice.Ratings[1].Value);\n console.log(\"Country Produced In: \" + musicChoice.Country);\n console.log(\"Language: \" + musicChoice.Language);\n console.log(\"Plot: \" + musicChoice.Plot);\n console.log(\"Actors: \" + musicChoice.Actors);\n }\n });\n}", "title": "" } ]
da99110f9fb21288ffaa12746795905e
Update the number of spots available for a day.
[ { "docid": "d4aed80e306689e3b25f2cfb91cc01c8", "score": "0.6546205", "text": "function setSpots(appointmentID, increment) {\n let newSpots;\n let dayObject;\n let daysArray = [...state.days];\n for (const [index, day] of state.days.entries()) {\n if (day.appointments.includes(appointmentID)) {\n newSpots = day.spots + increment;\n dayObject = { ...day, spots: newSpots };\n daysArray[index] = dayObject;\n dispatch({ type: SET_SPOTS, days: daysArray });\n }\n }\n\n return daysArray;\n }", "title": "" } ]
[ { "docid": "8e742f2d8f617fb53a64227c9caf1b87", "score": "0.66297567", "text": "function updateSpots(dayName, days, appointments) {\n return days.map((day) => {\n if (day.name === dayName) {\n let spot = 0;\n day.appointments.forEach((appointment) => {\n if (appointments[appointment].interview === null) {\n spot++;\n }\n });\n day.spots = spot;\n }\n return day;\n });\n }", "title": "" }, { "docid": "9bd2966237b700421634af405ad7bf4e", "score": "0.6456774", "text": "function updateDaysSpots(days, appointmentID, incrementer) {\n return days.map((day) => {\n if (!day.appointments.includes(appointmentID)) {\n return day;\n } \n return {\n ...day,\n spots: day.spots + incrementer\n }\n })\n }", "title": "" }, { "docid": "2933332c8a9156fe4e8afe8dd92885f3", "score": "0.64565367", "text": "function updateSpots(dayName, days, appointments) {\n const output = [...days];\n const day = output.find(x => x.name === dayName);\n const none = getNullSpots(day, appointments);\n day.spots = none;\n\n return output;\n }", "title": "" }, { "docid": "b267491d57e37fc2957a5742d0420a61", "score": "0.6086297", "text": "function updateSpots(){\n\t\tvar dirReader = approot.createReader();\n\t\tvar fail =failCB('Read de.s1-e01.spots Directory for parsing');\n\t\tdirReader.readEntries(parseSpots,fail);\n\t\tdatabox.trigger('spotsupdated');\n\t}", "title": "" }, { "docid": "25cd7554f1ff6283be15e0b8f3913295", "score": "0.58972055", "text": "async updatePlayerPunchcard(numNewPlayers) {\n // get date, utc hour, and utc day\n const now = new Date();\n const time = now.getTime();\n const hour = now.getUTCHours();\n const day = now.getUTCDay();\n const month = now.getUTCMonth();\n const year = now.getUTCFullYear();\n\n // find the punchcard\n const card = await this.stores.status.findOne({\n type: 'punchcard',\n kind: 'playerCount',\n month, year,\n });\n\n // create a new punchcard if one does not exist for this month\n if (!card) {\n const punchcard = createPunchcard();\n punchcard[day][hour] = numNewPlayers;\n // insert it\n await this.stores.status.insert({\n type: 'punchcard',\n kind: 'playerCount',\n created: time,\n updated: time,\n month, year,\n punchcard,\n });\n\n // if the card exists, check if it was already updated this hour\n } else {\n // add the players to this slot\n card.punchcard[day][hour] += numNewPlayers;\n // update the punchcard\n await this.stores.status.update({ _id: card._id }, {\n $set: {\n punchcard: card.punchcard,\n updated: time,\n },\n });\n }\n }", "title": "" }, { "docid": "2b1b12579f98e3e357f3f709b038c272", "score": "0.56388795", "text": "setOccupancy(slotsDate, count) {\n // because of `setDefaultOccupancies()`, which initializes all possible\n // occupancies to 0, a previous entry must exist in order for it to be a\n // valid occupancy\n var previousEntryExists = false;\n for (var i = 0; i < this.occupancies.length; i++) {\n if (AthensDateTime.hasSameDate(this.occupancies[i].date, slotsDate)) {\n this.occupancies[i].count = count;\n return;\n }\n }\n throw new RangeError(\"Date does not exist in time range\");\n }", "title": "" }, { "docid": "256f4ecad05348b4baf0e2d7ec569320", "score": "0.56357145", "text": "function updateCounts() {}", "title": "" }, { "docid": "46236b5a846766ce5f0c939e66eff29b", "score": "0.56139183", "text": "function updateOcc() {\n\n let currentDate = new Date()\n\n //Check that a new hour has begun\n if (prevHour != currentDate.getHours()) {\n\n prevHour = currentDate.getHours();\n\n //Check to see if a new day has begun and reset the data values\n if (prevHour === 0) {\n values = getInitalValues();\n } else {\n values.push([[prevHour,0,0], generateOcc(prevHour)]);\n }\n //Update chart\n google.charts.setOnLoadCallback(drawOcc);\n } \n }", "title": "" }, { "docid": "de451327ca0de55c6841a06dec404dca", "score": "0.55879337", "text": "checkKnightCount() {\n\n if (this.game.deadEntities.length === this.totalSpawned) {\n this.knightSpawned = 0;\n this.knightCount++;\n }\n }", "title": "" }, { "docid": "39240a7a3881ebb4d5c2c8a9e608f0c3", "score": "0.5579838", "text": "dailyCheck(hour) {\n if (hour > 0) {\n for (let index = 0; index < this.world.listOfRestaurant.length; index++) {\n if (this.world.listOfRestaurant[index].isAvailable(hour)) {\n this.world.listOfRestaurant[index].openHours++;\n }\n }\n } else {\n this.world.final();\n for (let index = 0; index < this.world.listOfRestaurant.length; index++) {\n this.world.listOfRestaurant[index].openHours = 0;\n this.world.listOfRestaurant[index].score = 0;\n }\n }\n }", "title": "" }, { "docid": "6634463172237191435e6624f2e31563", "score": "0.5537124", "text": "updatePoints() {\n this.prolog.countPoints(this.gameboard.toString())\n }", "title": "" }, { "docid": "2a40fb3b4b9da17967bccd1af498c719", "score": "0.5526264", "text": "updateMoveCount(){\n\t\tthis.moveCount+=1;\n\t\tlet counter = document.getElementById('counter');\n\t\tcounter.innerHTML = `<strong>Moves Made: </strong> ${this.moveCount}`;\n\t\tif(this.moveCount > 18 &&this.moveCount < 20){\n\t\t\tlet stars = document.getElementById('starContainer');\n\t\t\tstars.innerHTML = `<p class=\"fa fa-star\"></p><p class=\"fa fa-star\"></p>`\n\t\t\tthis.starCount -=1;\n\t\t}\n\t\tif(this.moveCount > 27 &&this.moveCount < 29){\n\t\t\tlet stars = document.getElementById('starContainer');\n\t\t\tstars.innerHTML = `<p class=\"fa fa-star\"></p>`\n\t\t\tthis.starCount -=1;\n\t\t}\n\t}", "title": "" }, { "docid": "092740c2309fbee81d65d35b9dce0c03", "score": "0.54990286", "text": "function updateEggCycles(){\n\n // Do not update egg cycles on day zero\n if (thisZoneData.day === 0){ return false; }\n\n // First, loop through any eggs and decrement their cycles by one\n if (thisZoneData.currentPokemon.length){\n for (var key = 0; key < thisZoneData.currentPokemon.length; key++){\n var pokemonInfo = thisZoneData.currentPokemon[key];\n if (pokemonInfo.eggCycles > 0){ pokemonInfo.eggCycles--; }\n if (pokemonInfo.eggCycles === 0\n && pokemonInfo.growthCycles === 0){\n if (typeof ga !== 'undefined'){\n ga('send', {\n hitType: 'event',\n eventCategory: 'pokemon',\n eventAction: 'hatched',\n eventLabel: pokemonInfo.token + ' hatched from egg'\n });\n }\n }\n }\n }\n\n }", "title": "" }, { "docid": "04e0f98cdbefb4db20a4af6298a56619", "score": "0.54963154", "text": "function updateCount(points) {\n if (points) {\n currentCount = points.length;\n }\n else{\n currentCount = 0;\n }\n $(\"#count\").replaceWith(\"<span id=\\\"count\\\">\" + currentCount + \" out of \" + totalCount + \"</span>\");\n}", "title": "" }, { "docid": "c855cecab25b47918d75cfbdc1fde49c", "score": "0.5462999", "text": "function updateCount() {\n setCount(++Count);\n }", "title": "" }, { "docid": "7beae604ade1da45f1101655df3d59c9", "score": "0.54322934", "text": "function updatePoints() {\n points += 1;\n}", "title": "" }, { "docid": "b916b2511bd012245f1270d5ef0083a1", "score": "0.5418827", "text": "function updateNumberOfStars() {\n if (moves <= THREE_STARS) {\n numberOfStars = 3;\n } else if (moves <= TWO_STARS) {\n numberOfStars = 2;\n } else if (moves <= ONE_STAR) {\n numberOfStars = 1;\n } else {\n numberOfStars = 0;\n }\n\n drawStars(numberOfStars);\n}", "title": "" }, { "docid": "c6b055b21e172b3c49a92269c47959f6", "score": "0.53978395", "text": "function pillCounter() {\n\n var dailyDose = setInterval(function () {\n //loop over existing meds and decrement count every 24 hrs\n meds.forEach(el => {\n el.count -= 1\n })\n //update LS with new count\n localStorage.setItem(\"meds\", JSON.stringify(meds))\n }, 24 * 60 * 60 * 1000);\n}", "title": "" }, { "docid": "2b10fc1887936b1eb07cca182606283c", "score": "0.5392112", "text": "updatePopularities() {\n for (let i = 0; i < this.preferences.length; i++) {\n this.preferences[i].incrementPopularity(this.popularityPoints[i]);\n }\n }", "title": "" }, { "docid": "806eef2ed05330d2c3828b8ce7718ef6", "score": "0.5375332", "text": "function countMoves() {\n nbMoves++;\n $('.moves').text(nbMoves);\n updateStars();\n}", "title": "" }, { "docid": "2a2cac09e4e596de30daf23bde5da9d5", "score": "0.53633356", "text": "updateServings(type){\n\n const newServings = type ==='dec'?this.servings-1:this.servings+1;\n\n this.ingredients.forEach(element=>{\n element.count *= (newServings/this.servings);\n })\n\n\n this.servings=newServings;\n }", "title": "" }, { "docid": "2bc0d1edfda3518c773af49fa6848cbd", "score": "0.53467274", "text": "updateServings(type){\n // Servings\n const newServings = type === 'dec'? this.servings - 1: this.servings + 1;\n \n // Ingredients based on servings\n this.ingredients.forEach(ingredient =>{\n ingredient.count *= (newServings/this.servings);\n });\n\n this.servings = newServings;\n }", "title": "" }, { "docid": "780413d96aabe3a9b42c996b4718ee8e", "score": "0.5300466", "text": "updateStarCount(){\n\t\t$(`#starCount${this.playerId}`).html(`${this.starCount}`);\n\t}", "title": "" }, { "docid": "bb18932702a17132d6a1989d49e423c2", "score": "0.52997786", "text": "function updateCounter() {\n\t const moves = document.querySelector('.moves');\n\t moves.innerText = moveCounter;\n\t checkStars();\n}", "title": "" }, { "docid": "7a2b778767dd01a0ed597d41f9ef59e3", "score": "0.5268796", "text": "function processDay() {\n // Check if game is live\n if (state.env.updateDay()) {\n state.gross = 0;\n\n state.stock.stock.forEach((el, i) => {\n // find demand\n const demand = state.stock.getDemand(el.item, state.env.getWeather());\n // make sales\n const sale = state.stock.processItem(el.item, demand, \"sell\", state.balance);\n\n el.numSold = sale[1];\n state.gross += sale[0];\n state.balance += sale[0];\n });\n\n state.env.generateWeather();\n\n // Print the report\n dailySummary();\n\n //update the UI\n updateUI();\n }\n}", "title": "" }, { "docid": "5cdb31102f48d113695176dfeb49ecfa", "score": "0.5267807", "text": "function updateMarkers(){\n clearMarkers();\n\n var count = 1;\n\n for(var key in places){\n if(places[key].day.replace(/\\s/g, '') == trip_days[day].replace(/\\s/g, '')){\n data = {color: visits_color, icon: getIcon(places[key][\"poi_type\"])};\n createMarker(places[key], data, \"visits\", 'green', count);\n count++;\n }\n }\n\n for(var key in hotels){\n if(hotels[key].day.replace(/\\s/g, '') == trip_days[day].replace(/\\s/g, '')){\n data = {color: visits_color, icon: getIcon(hotels[key][\"poi_type\"])};\n createMarker(hotels[key], data, \"visits\", 'yellow', 'H');\n }\n }\n\n for(var key in suggested_places){\n data = {color: suggested_visits_color, icon: getIcon(suggested_places[key][\"poi_type\"])};\n createMarker(suggested_places[key], data, \"suggestions\", 'blue', 'I');\n }\n\n /* Markers clustering */\n markerCluster = new MarkerClusterer(map, markers,\n {imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});\n \n /* update itinerary */\n loadItinerary();\n}", "title": "" }, { "docid": "39f651cae45abcc1e94dcb03f7627215", "score": "0.5253255", "text": "function dockDoorsUpdate() {\n var dockDoorsValue = document.getElementById(\"dockDoors\").value;\n var activeBtn = document.getElementsByClassName(\"active\")[0];\n var targetedItemInObject = activeBtn.id;\n var baseNumber =\n buildingPlans[targetedItemInObject][\"rangeSliders\"][\"dockDoors\"][\"base\"];\n\n if (dockDoorsValue > baseNumber) {\n dockDoorsPrice = (dockDoorsValue - baseNumber) * 15000;\n } else if (dockDoorsValue < baseNumber) {\n dockDoorsPrice = (baseNumber - dockDoorsValue) * -15000;\n } else if (dockDoorsValue == baseNumber) {\n dockDoorsPrice = 0;\n }\n\n // update the counter on the screen\n document.getElementById(\"dockDoorsCount\").textContent = \" \" + dockDoorsValue;\n\n updatePrice();\n}", "title": "" }, { "docid": "c40c63d86500ef8a2d2dc7e1d7058e16", "score": "0.5245704", "text": "function updateSelectedCount() {\r\n const selectedSeats = document.querySelectorAll(\".row .seat.selected\");\r\n const seatInedxes = [...selectedSeats].map(seat => [...seats].indexOf(seat));\r\n localStorage.setItem(\"seatIndexes\", JSON.stringify(seatInedxes));\r\n const selectedNumber = selectedSeats.length;\r\n\r\n seatsNumber.innerText = selectedNumber;\r\n price.innerText = selectedNumber * ticketPrice;\r\n}", "title": "" }, { "docid": "5b50a82c2b38d3c56146c067cecd9d90", "score": "0.52163726", "text": "function updatePoints(){\n points++;\n $('.points').text(points);\n }", "title": "" }, { "docid": "f83604ad6b3bd5dcc23737c617856f17", "score": "0.52139926", "text": "function updateParkingLotSpaces(){\n $scope.parkingLotSpaces = getParkingLotSpaces();\n $scope.availableParkingSpacesNo = getAvailableParkingSpotsNr();\n }", "title": "" }, { "docid": "beb9f9c673a166f63d59d877f5b2f9ac", "score": "0.5211754", "text": "function update_num_events(){\r\n\t\t$('.evoDV').each(function(){\r\n\t\t\tvar numevents = $(this).find('.eventon_daily_in').find('p.on_focus').data('events');\r\n\r\n\t\t\tif(numevents!=='' && numevents!==false){\r\n\t\t\t\t$(this).find('.evodv_current_day .evodv_events span').html(numevents).parent().show();\r\n\t\t\t}\r\n\r\n\t\t\t// update day and date name\r\n\t\t\tvar onfocus = $(this).find('p.evo_day.on_focus');\r\n\t\t\tchangin_dates(onfocus.data('date'), $(this).attr('id'), onfocus);\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "66c8285be639780455bdaa394ae3eba8", "score": "0.5210262", "text": "function countUpdate()\n{\n\t// cap nhat du lieu moi len phan tin moi\n\tdocument.getElementById(\"count_new_mark\").innerHTML = arrMarkSync.length;\n\tdocument.getElementById(\"count_new_attendance\").innerHTML = arrAttendaneSync.length;\n}", "title": "" }, { "docid": "6380a44597f34151fa00a3567a9c7617", "score": "0.5205814", "text": "update() {\n this.node.getElementsByClassName('days')[0].remove()\n this.generateDays()\n this.node.appendChild(this.days)\n this.controllers.update(this.date)\n }", "title": "" }, { "docid": "de10ffe86dc61d6130ea97a7141f6dfb", "score": "0.5205388", "text": "function updateNumberOfGuests() {\n \tcontainer.find(\"#numberOfGuests\").html(model.getNumberOfGuests());\n }", "title": "" }, { "docid": "5870c26889ad984c32820f055bb842fa", "score": "0.5184785", "text": "function updateCount(){\n\n}", "title": "" }, { "docid": "febc14ce44de27ee971fc8d9b09747bf", "score": "0.51843596", "text": "function updateStatistics(){\n var cleanNames = [];\n var prevCnts = [];\n for (var i = 0; i < map.drivers.length; i++) {\n cleanNames.push(map.drivers[i].name.replace(/\\s/g,\"\"));\n }\n setInterval(function() {\n $('#total-trips').text(id);\n for (var i = 0; i < map.drivers.length; i++) {\n $(`#${cleanNames[i]}-events`).text(map.drivers[i].turnCount);\n }\n }, 3000);\n}", "title": "" }, { "docid": "b1b2d91dce3728d1c4fb1742bccadca1", "score": "0.5181621", "text": "update() {\r\n const min = 0;\r\n const max = 120;\r\n const days = Math.floor(Math.random() * (max - min) + min);\r\n const expireDate = Date.now() + (days * 24 * 60 * 60 * 1000);\r\n let value = expireDate / 1000;\r\n this.metric.labels(this.labels).set(value);\r\n }", "title": "" }, { "docid": "54e68fd2dcc8e1bd8a25284f222df9d3", "score": "0.51814246", "text": "updateTimes() {\n setInterval(() => {\n this._state.activeRallyList.forEach(rallyKey => {\n this._updateRallyTimes(rallyKey);\n });\n }, this.config.updateInterval * 1000);\n }", "title": "" }, { "docid": "2ff90bb2d9d802bb1b588346d4954167", "score": "0.5175989", "text": "function updateDaily(){\n var dateColumnData = cohSheet.getRange(1,1,cohSheet.getMaxRows()).getValues();\n var outputRow=__searchDate__(dateColumnData, today);\n var outputColumn = outputColumnStart;\n for (var i=0; i<infoArray.length; i++){\n for (var j=0; j<columns.length; j++){\n __autoUpdate__(i, columns[j], outputColumn, outputRow, cohSheet);\n outputColumn++;\n }\n }\n}", "title": "" }, { "docid": "0c9ee884de84180f939769c7183088ad", "score": "0.51616687", "text": "updateNeighborCounts () {\n // for each cell in the grid\n\t\tfor (var column = 0; column < this.numberOfColumns; column++) {\n for (var row = 0; row < this.numberOfRows; row++) {\n\n\t\t\t\t// reset it's neighbor count to 0\n this.cells[column][row].liveNeighborCount = 0;\n\n\t\t\t\t// get the cell's neighbors\n\t\t\t\tthis.getNeighbors(this.cells[column][row]);\n\n\t\t\t\t// increase liveNeighborCount by 1 for each neighbor that is alive\n\t\t\t\tfor (var i = 0; i < this.getNeighbors(this.cells[column][row]).length; i++){\n\t\t\t\t\tif (this.getNeighbors(this.cells[column][row])[i].isAlive == true){\n\t\t\t\t\t\tthis.cells[column][row].liveNeighborCount += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n }\n }\n\t}", "title": "" }, { "docid": "3a7c22bf1458afc3c998d7a359755f55", "score": "0.51566917", "text": "function updateNumberOfPlayers(){\n\n // this is the real number of players\n numberOfPlayers = inPlayerId - 1;\n}", "title": "" }, { "docid": "d541ad72a6ff75c2954225e6955c1ba1", "score": "0.5156321", "text": "function updateDay() {\n day++;\n $('#day').text('Day ' + day);\n}", "title": "" }, { "docid": "56c8e630631cd31f8ad506afce0a3974", "score": "0.5151135", "text": "function updateTime() {\n time += 10;\n}", "title": "" }, { "docid": "59cc2ca0f089deeaabb663ff8e6a5d23", "score": "0.5144568", "text": "function updateSeatCountAndTotal() {\n const selectedSeats = document.querySelectorAll(\".row .seat.selected\");\n const selectedSeatsIndices = [...selectedSeats].map((seat) =>\n [...seats].indexOf(seat)\n );\n localStorage.setItem(\"selectedSeats\", JSON.stringify(selectedSeatsIndices));\n const selectedSeatsCount = selectedSeats.length;\n count.innerText = selectedSeatsCount;\n total.innerText = selectedSeatsCount * ticketPrice;\n}", "title": "" }, { "docid": "1c230e5f56a3f33d62ab948003d39d5d", "score": "0.51441306", "text": "function updateSelectedCount() {\n const selectedSeats = document.querySelectorAll(\".row .seat.selected\");\n const selectedSeatsCount = selectedSeats.length;\n\n /**\n * ? copy selected seats into array\n * ? map through array\n * ? return a new array indexes\n * */\n\n const seatsIndex = [...selectedSeats].map((seat) => [...seats].indexOf(seat));\n\n setSeatsData(seatsIndex);\n\n count.innerText = selectedSeatsCount;\n total.innerText = selectedSeatsCount * ticketPrice;\n}", "title": "" }, { "docid": "526b534f922e225c9d3f6f2f8128ac23", "score": "0.5132328", "text": "function updateSelectedCount() {\r\n const selectedSeats = document.querySelectorAll('.row .seat.selected');\r\n \r\n \r\n // Copiando los seats seleccionados en un array \"[...selectedSeats]\"\r\n // map a traves del array obteniendo los índices de los seats y devolver un nuevo array de índices seleccionados\r\n \r\n const seatsIndex = [...selectedSeats].map(function(seat){\r\n return[...seats].indexOf(seat)\r\n\r\n });\r\n\r\n localStorage.setItem('selectedSeats', JSON.stringify(seatsIndex));\r\n\r\n const selectedSeatsCount = selectedSeats.length;\r\n\r\n count.innerText = selectedSeatsCount;\r\n total.innerText = selectedSeatsCount * ticketPrice;\r\n}", "title": "" }, { "docid": "3cf41a1fc17df0c0d0ceff31f6524caf", "score": "0.5129198", "text": "function updateSelectedSeatsCount() {\n const selectedSeats = document.querySelectorAll(\n \".seatingsAndScreen .seat.selected\"\n ).length;\n count.innerText = selectedSeats;\n total.innerText = selectedSeats * totalPrice;\n}", "title": "" }, { "docid": "9fddc12f5ea2adac62d1d27031cc660f", "score": "0.51190066", "text": "function updateSelectedCount() {\n const selectedSeats = document.querySelectorAll('.row .seat.selected');\n\n const seatIndex = [...selectedSeats].map(seat => [...seats].indexOf(seat));\n\n localStorage.setItem('selectedSeats', JSON.stringify(seatIndex))\n const selectedSeatCount = selectedSeats.length;\n count.innerText = selectedSeatCount;\n total.innerText = selectedSeatCount * tricketPrice;\n}", "title": "" }, { "docid": "43d1fb93b65e2a4ea37b00839fb9ebb1", "score": "0.5112027", "text": "function updateSelectedCount()\n{\n const selectedSeats = document.querySelectorAll('.row .seat.selected');\n \n //Getting the index of each selected seat using spread syntax\n const seatsIndex = [...selectedSeats].map( seat => [...seats].indexOf(seat));\n \n localStorage.setItem('selectedSeats' , JSON.stringify(seatsIndex) );\n\n const selectedSeatCount = selectedSeats.length;\n count.innerText = selectedSeatCount;\n\n total.innerText = ticketPrice * selectedSeatCount;\n}", "title": "" }, { "docid": "69dddc0a8a2395687624a1a8c8ac5096", "score": "0.5105119", "text": "function countUpdate(){\n count++;\n if(count === 21){\n $(\"#count\").html(\"00\");\n alert(\"Good Job, you have completed the game. Please press reset to start over.\");\n document.click();\n }\n if(count < 10){\n $(\"#count\").html(\"0\" + count)\n }\n else{\n $(\"#count\").html(count);\n }\n }", "title": "" }, { "docid": "a9179d8aefa49a41d3aa5af20541a912", "score": "0.510403", "text": "function countMoves() {\r\n moves += 1;\r\n $moves.html(moves);\r\n changeStars();\r\n}", "title": "" }, { "docid": "1eaa983ba9118c0479604fcda9751c11", "score": "0.50917906", "text": "function updateDevouredBurgers() {\n\n }", "title": "" }, { "docid": "7caf2766e690bff5828696e568a191e4", "score": "0.50867134", "text": "function updateSelectedCount() {\n const selectedSeats = document.querySelectorAll(\".row .seat.selected\");\n\n // const seatsIndex = [...selectedSeats].map(function(seat) {\n // return [...seats].indexOf(seat);\n // });\n\n // finds length of selected seats\n const selectedSeatsCount = selectedSeats.length;\n\n // changes the count\n count.innerHTML = selectedSeatsCount;\n\n // changes the price\n total.innerHTML = selectedSeatsCount*ticketPrice;\n}", "title": "" }, { "docid": "16016679b5921d495e3e989f7e473b6e", "score": "0.50845003", "text": "function updateWinnings() {\n scope.render()\n }", "title": "" }, { "docid": "ffd8ddd68b15f9bf7af8a84c0d4e51a9", "score": "0.5082312", "text": "function updateView() {\n Session.set('qmeals', []);\n document.getElementById('create-new-diet').setAttribute('disabled', 'disabled');\n\n //get diet period\n var period = 'day';\n if (document.getElementById('weekly_diet').checked) {\n period = 'week';\n }\n\n var resources = {\n protein: parseInt(document.getElementById('proteins-input').value),\n fat: parseInt(document.getElementById('fats-input').value),\n carbohydrates: parseInt(document.getElementById('carbohydrates-input').value),\n calories: parseInt(document.getElementById('calories-input').value)\n };\n var day_count = initDaysCollection(period);\n\n // save meal count state to session\n daily_limits = document.getElementsByName('meals_limit');\n for (var i = 0; i < daily_limits.length; i++) {\n if (daily_limits[i].checked) {\n calcPortions(parseInt(daily_limits[i].value), resources);\n return;\n }\n }\n}", "title": "" }, { "docid": "0cfd6aec97e263ad8d96d10c030bca5d", "score": "0.50531304", "text": "function updateSelectedCount() {\n const selectedSeats = document.querySelectorAll(\".row .seat.selected \");\n // Copy selected seats into an array - map through the array - return new array of indexes\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax\n const seatsIndex = [...selectedSeats].map(seat => [...seats].indexOf(seat));\n\n // Store to local storage\n localStorage.setItem(\"selectedSeats\", JSON.stringify(seatsIndex));\n\n console.log(seatsIndex);\n\n // Get the length of the nodelist *****************************************************\n const selectedSeatsCount = selectedSeats.length;\n\n // console.log(selectedSeatsCount);\n count.innerText = selectedSeatsCount;\n total.innerText = selectedSeatsCount * ticketPrice;\n}", "title": "" }, { "docid": "d64c0e62c88d7b35cdbf80a610fb6563", "score": "0.5047585", "text": "function updateSelectedCount() {\n var selectedSeats = document.querySelectorAll('.row .seat.selected');\n var selectedSeatsCount = selectedSeats.length;\n var seatsIndex = __spreadArrays(selectedSeats).map(function (seat) {\n return __spreadArrays(seats).indexOf(seat);\n });\n localStorage.setItem('selectedSeats', JSON.stringify(seatsIndex));\n count.innerText = selectedSeatsCount;\n total.innerText = selectedSeatsCount * ticketPrice;\n}", "title": "" }, { "docid": "5cd4839edfa166a7c56193282ba17777", "score": "0.5046871", "text": "function updateDailyUsage(){\n if (dailyUsageData.consumption.devices){\n for (let usageDevice of dailyUsageData.consumption.devices){\n updateDeviceDailyUsage({id: usageDevice.id, dailyUsage: (usageDevice.pct/100) * dailyUsageData.consumption.total});\n }\n }\n if (dailyUsageData.production.devices){\n for (let usageDevice of dailyUsageData.production.devices){\n updateDeviceDailyUsage({id: usageDevice.id, dailyUsage: (usageDevice.pct/100) * dailyUsageData.production.total});\n }\n }\n}", "title": "" }, { "docid": "c31375ee30b8d486d83373719e45bfd4", "score": "0.50455934", "text": "function updateSelectedCount() {\n const selectedSeats = document.querySelectorAll(\".row .seat.selected\");\n\n const seatsIndex = [...selectedSeats].map(seat => [...seats].indexOf(seat));\n\n localStorage.setItem(\"selectedSeats\", JSON.stringify(seatsIndex));\n\n const selectedSeatsCount = selectedSeats.length;\n\n count.innerText = selectedSeatsCount;\n total.innerText = selectedSeatsCount * ticketPrice;\n}", "title": "" }, { "docid": "886ec2ea8f8fc7e638326deb3dcbc2c6", "score": "0.50441295", "text": "function incrementMoveCounter() {\n moveCount++;\n updateMoves();\n updateStars();\n}", "title": "" }, { "docid": "ded2bc8d07295aae6d2867313772acba", "score": "0.50373745", "text": "updateTotalHits (timestamp) {\n const currentTimestamp = this._getTimestamp()\n\n if (timestamp < currentTimestamp) {\n console.log(`Skipping since log timestamp ${timestamp} is older than current timestamp ${currentTimestamp}`)\n return\n }\n\n const slot = timestamp % this.TOTAL_HITS_INTERVAL\n\n // Initiate slot if it does not exist yet\n if (slot in this.totalHitsTracker === false) {\n this.totalHitsTracker[slot] = {timestamp, total: 1}\n this.revisitAlertState()\n\n return\n }\n\n // If current slot is older than interval, reset it\n // Else increase counter\n if (currentTimestamp - this.totalHitsTracker[slot].timestamp > this.TOTAL_HITS_INTERVAL) {\n this.totalHitsTracker[slot] = {timestamp, total: 1}\n } else {\n // this.totalHitsTracker[slot].timestamp = timestamp\n this.totalHitsTracker[slot].total += 1\n }\n\n this.revisitAlertState()\n }", "title": "" }, { "docid": "5f907e537c7a9164758c629af40e3e5d", "score": "0.50266784", "text": "function updateStarCount(postElement, nbStart) {\n\tpostElement.getElementsByClassName('star-count')[0].innerText = nbStart;\n}", "title": "" }, { "docid": "12e5110982bb38d7758ca94d2ddcc2d2", "score": "0.5025785", "text": "function updateSelectedCount() {\n\n // select all selected seats:\n const selectedSeats = document.querySelectorAll('.row .seat.selected');\n\n // need to know index of each selected seat in all seats, to store it and be able to retrieve\n // this will return array of selected ((INDEXES)) from global (seats)\n // (seats) themselves are indexes at first_level, then we get their indexes in its order! [1,2,3,4,5] -> in fact these are indexes, but we get index of 1 e.g in this array of indexes!\n const seatsIndex = [...selectedSeats].map(seat => [...seats].indexOf(seat));\n\n // store in LocalStorage: => with non-primitives dataType we use (JSON.stringfy)\n localStorage.setItem('selectedSeats', JSON.stringify(seatsIndex));\n\n const selectedSeatsCount = selectedSeats.length;\n count.innerText = selectedSeatsCount;\n total.innerText = selectedSeatsCount * ticketPrice;\n}", "title": "" }, { "docid": "7dee81e8d894a5255906cb547e337587", "score": "0.50240076", "text": "function updateCount() {\n const selectedSeats = document.querySelectorAll('.row .seat.selected');\n const selectedSeatsCount = selectedSeats.length;\n count.innerText = selectedSeatsCount;\n total.innerText = selectedSeatsCount * ticketPrice;\n\n}", "title": "" }, { "docid": "1751708132c5e180e63538c545e5e1ef", "score": "0.50235933", "text": "function updateSpecialCount(){\r\n const specialSeats = document.querySelectorAll('.row .seat.special');\r\n\r\n const seatsIndex = [...specialSeats].map(function(seat){\r\n return [...seats].indexOf(seat)\r\n });\r\n\r\n localStorage.setItem('specialSeats', JSON.stringify(seatsIndex));\r\n\r\n\r\n const selectedSpecialSeatCount = specialSeats.length;\r\n\r\n count.innerText = selectedSpecialSeatCount;\r\n total.innerText = selectedSpecialSeatCount * ticketSpecialPrice;\r\n}", "title": "" }, { "docid": "1883a633bf0ccd87ebc01a49bb32c3ef", "score": "0.5023287", "text": "function updateDeadPeople() {\r\n amount_of_dead_graph = 0;\r\n\r\n for (let i = 0; i < amount_of_people; i++) {\r\n if (list_of_people[i].dead) {\r\n amount_of_dead_graph += 1;\r\n }\r\n }\r\n // console.log(amount_of_dead_graph)\r\n return amount_of_dead_graph\r\n}", "title": "" }, { "docid": "7d10d87b07527bfec52e9c905d9f931d", "score": "0.5020132", "text": "function updateHealthyPeople() {\r\n amount_of_healthy_graph = 0;\r\n\r\n for (let i = 0; i < amount_of_people; i++) {\r\n if (list_of_people[i].healthy) {\r\n amount_of_healthy_graph += 1;\r\n }\r\n }\r\n // console.log(amount_of_healthy_graph)\r\n return amount_of_healthy_graph\r\n}", "title": "" }, { "docid": "17836f0261e94215c194cd871f3848ce", "score": "0.5013092", "text": "updateServings(type) { //c we need a param type so that we can pass increase or decrease\n // servings\n const newServings = type ==='dec' ? this.servings -1 : this.servings +1;\n\n // ingredents\n this.ingredients.forEach(ing =>{\n ing.count *= (newServings/ this.servings);\n\n });\n this.servings = newServings;\n\n }", "title": "" }, { "docid": "9014f44ba9ad6f4eadc5749c3a4f9988", "score": "0.50008476", "text": "function update() {\n checkIfAvailable();\n updateProgressBar();\n displayLeftStands();\n}", "title": "" }, { "docid": "71fc9d091a1b60689382abdfbfcf58da", "score": "0.5000162", "text": "function updateStarCount(postElement, nbStart) {\n postElement.getElementsByClassName('star-count')[0].innerText = nbStart;\n}", "title": "" }, { "docid": "fe76671b9def956ec765b25c64c3ad55", "score": "0.4996785", "text": "function harvest(){\n nutrients += nutrientsPerClick;\n updateLabels();\n}", "title": "" }, { "docid": "0b49fcfd7b9ad8d4098106149d32539b", "score": "0.49967822", "text": "function updatestarCounter() {\n\tstarCounter = STAR_NUMBER - Math.floor((moveCounter - FULL_STAR_ERROR_TOLERANCE - 1) / PATTERN_NUMBER)\n\tstarCounter = Math.max(0, starCounter)\n}", "title": "" }, { "docid": "2b7f9e7e4ee4e523b4b9af2582404aa6", "score": "0.49944234", "text": "function newTotalLaps() {\n lapsCompleted = lapsCompleted + 1\n \n}", "title": "" }, { "docid": "6c9cae0862dee1e668ec33940139452a", "score": "0.49935743", "text": "function scheduleGamesUpdate(date) {\n scheduleUpdate(matchesTimeout, date, function() {\n onMatchesUpdate();\n });\n}", "title": "" }, { "docid": "9c149f33a283fa330174bdb3fde209b3", "score": "0.4990244", "text": "function updateElements(url) {\n els.forEach((el) => {\n let elUrl = initValue(el.dataset, 'clapyUrl', currentUrl, 'string');\n if (url === elUrl) {\n el.querySelector('.clapy__counter').innerHTML = counts[url].count;\n }\n });\n }", "title": "" }, { "docid": "029ac29c2abc0c25991b90e0a5982873", "score": "0.4986342", "text": "countUpdated (data) {\n console.log('sift-ocado: view: countUpdated: ', data);\n this.renderTotalSection(data);\n }", "title": "" }, { "docid": "e40dae882d20d536112e5dea4e3d45a6", "score": "0.4983825", "text": "function refreshCounter() {\n $(\".seatsAmount\").text($(\".seatSelected\").length); \n }", "title": "" }, { "docid": "119e907f8d207aeee78623422710eba8", "score": "0.4977553", "text": "function countConsumption() {\n\n const now = new MyDate();\n\n // console.log(state);\n const lastStateUpdate = new MyDate(domoJS.state.lastUpdate);\n const minSinceLastRun = Math.round( (now - lastStateUpdate) / 1000 / 60 );\n const HCorHP = lastStateUpdate.getHCHP();\n\n // we add the number of minutes each heater has been on (in state)\n for (let room_name in domoJS.state.rooms) {\n let room = domoJS.state.rooms[room_name];\n if (room.state === \"On\") {\n room[HCorHP] += minSinceLastRun;\n // console.log( room.name + \" is \" + room.state);\n }\n }\n\n // update last update in the state and save it to disk\n domoJS.state.lastUpdate = now.toISOString();\n\n // we save state in 5 seconds: we want to be sure that everything has been done\n setTimeout( writeState, 5000);\n\n}", "title": "" }, { "docid": "b9afca3cc0b95bd717b055660c7c90c7", "score": "0.49716806", "text": "function updateSelectedCount(){\n const selectedSeats = document.querySelectorAll('.row .seat.selected');\n const selectedSeatCount = selectedSeats.length\n count.innerText=(selectedSeatCount);\n total.innerText=(selectedSeatCount*tickPrice);\n}", "title": "" }, { "docid": "e4ed07546d17381233d53acb495e289f", "score": "0.49667603", "text": "function moveManager(){\n var moves=document.getElementsByClassName(\"moves\")[0];\n moves.innerHTML=String(movesCounter);\n if(movesCounter<12){\n starCount=3;\n }\n else if(movesCounter<18){\n starCount=2;\n }\n else {\n starCount=1;\n }\n updateStars();\n}", "title": "" }, { "docid": "89dccced477385a66c26046bd7c29e8d", "score": "0.49620545", "text": "updateSize(foodSize) {\n this.size += foodSize;\n }", "title": "" }, { "docid": "c1149d45afc5b60f40bfe519d20f3cfb", "score": "0.49607605", "text": "function updateWatch() {\n updateTime();\n updateDate(0);\n }", "title": "" }, { "docid": "076c4cb79933ec5c7d24675451a064b8", "score": "0.4958334", "text": "function updateLots() {\n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var myObj = JSON.parse(this.responseText);\n for (var i = 0; i < myObj.value.length; i++) {\n //if lot is not displayed due to google api limitation reached\n //skip the lot\n if (document.getElementById(\"res-lots\" + (i)) === null) {\n continue;\n } else {\n document.getElementById(\"res-lots\" + (i)).innerHTML = myObj.value[i].Lots;\n }\n\n }\n }\n };\n xmlhttp.open(\"GET\", \"availabilityUpdate.php\", true);\n xmlhttp.send();\n}", "title": "" }, { "docid": "1dd06726cebc7ed7d0c901d504959760", "score": "0.4957271", "text": "function updateCount(chugId2Beta, curChugHolder) {\n var groupHolder = $(curChugHolder).closest(\".groupholder\");\n var chugHolders = $(groupHolder).children(\".chugholder\");\n $(chugHolders).each(function(index) {\n\t var chugId = $(this).attr('name');\n\t var newCount = $(this).find(\"ul\").children().length;\n\t var min = parseInt(chugId2Beta[chugId][\"min_size\"]);\n\t var max = parseInt(chugId2Beta[chugId][\"max_size\"]);\n\t var colorClass = getColorForCount(newCount, min, max);\n\t var curCountHolder = $(this).find(\"span[name=curCountHolder]\");\n\t $.each(chugCountColorClasses, function(index, classToRemove) {\n\t\t // Remove old color class.\n\t\t $(curCountHolder).removeClass(classToRemove);\n\t\t});\n\t // Add new color class and count.\n\t $(curCountHolder).attr('value', newCount);\n\t $(curCountHolder).text(\"cur = \" + newCount);\n\t $(curCountHolder).addClass(colorClass);\n\t});\n}", "title": "" }, { "docid": "6a69b38bf818161e21d28a8c787feedf", "score": "0.4955324", "text": "function updateSelectedCount() {\n //\n const selectedSeats = document.querySelectorAll(\".row .seat.selected\");\n\n //copy selected seats into an array\n //map through array\n //return new array of indexes\n const seatsIndex = [...selectedSeats].map((seat) =>\n [...seatsEl].indexOf(seat)\n );\n\n //saving array of seats selected by the user into local storage\n localStorage.setItem(\"selectedSeats\", JSON.stringify(seatsIndex));\n\n //creating a variabel to hold the length aka number of seats selected\n const selectedSeatsCount = selectedSeats.length;\n\n //setting the innerHTML for the two spans with number of seats and total price\n countEl.innerText = selectedSeatsCount;\n totalEl.innerText = selectedSeatsCount * ticketPrice;\n}", "title": "" }, { "docid": "aa307b44254472907f06005e21ed0f07", "score": "0.49495453", "text": "function updateNinja()\n {\n this.dfh = glat.getDistancefrompoint(home_lat,home_lng); \n self.emit('data',this.dfh); \n }", "title": "" }, { "docid": "3d495a067da325aca2b979c242956019", "score": "0.4945665", "text": "updatePoints(){\n for(var i = 0; i < this.shots.length; i++){\n var shot = this.shots[i]\n //first take care of Strikes\n if(shot.isStrike()){\n shot.points = shot.pins;\n //add next shot\n shot.points += this.shots[i + 1] ? this.shots[i + 1].pins : 0;\n //add second next shot\n shot.points += this.shots[i + 2] ? this.shots[i + 2].pins : 0;\n } else if (i < this.shots.length - 1 && Shot.sameFrame(shot, this.shots[i + 1]) && Shot.isSpare(shot, this.shots[i + 1])) {\n //Bonus points on spares are stored in the first shot of the frame\n shot.points = shot.pins;\n shot.points += this.shots[i + 2] ? this.shots[i + 2].pins : 0;\n } else {\n shot.points = shot.pins;\n }\n }\n }", "title": "" }, { "docid": "f70dbc447484f3453f4aa0f912968d29", "score": "0.4944012", "text": "function pointUpdate() {\n // for (let i=0; i<targetDays.length; i++) { \n \n let rateOption = Number(document.getElementById(\"todays-rate\").innerHTML);\n\n let totalPoints = document.querySelector(\"#point-counter\").innerHTML;\n let totalPointsText = document.querySelector(\"#point-counter\");\n\n let counter = Number(totalPoints);\n\n totalPointsText.innerHTML = counter + rateOption;\n\n}", "title": "" }, { "docid": "0fdf590618db8ca3ee369713fc80bf9a", "score": "0.49366856", "text": "function updateAvailables()\n {\n var aAdjusted = getAvailableAdjustment();\n var aInlays = aAdjusted[0];\n var aOptions = aAdjusted[1];\n var aAccessories = aAdjusted[2];\n aAdjusted = null;\n\n // Update the options!\n if(aOptions)\n {\n _instance.dispatchEvent(new be.marlon.DataEvent(be.marlon.Service.RENDER_OPTIONS, [aOptions, _configuration.Options]));\n }\n\n // Update the inlays\n if(aInlays)\n {\n _instance.dispatchEvent(new be.marlon.DataEvent(be.marlon.Service.RENDER_INLAYS, [aInlays, _configuration.InlayID]));\n }\n\n // Update the accessories\n if(aAccessories)\n {\n _instance.dispatchEvent(new be.marlon.DataEvent(be.marlon.Service.RENDER_ACCESSORIES, [aAccessories, _configuration.Accessories]));\n }\n // Clean up!\n aAccessories = aOptions = aInlays = null;\n }", "title": "" }, { "docid": "5091680b86078a8f284ae7af84c6553c", "score": "0.49350646", "text": "function updateSelectedCount(){\n const selectedSeats = document.querySelectorAll('.row .seat.selected');\n // copy selected seats into array\n // Map through array\n // return a new array indexes.\n const seatsIndex = [...selectedSeats].map(seat => [...seats].indexOf(seat));\n // To SetItem to localstorage as in string by JSON.stringify.\n localStorage.setItem('selectedSeats', JSON.stringify(seatsIndex));\n\n const selectedSeatsCount = selectedSeats.length;\n\n count.innerText = selectedSeatsCount;\n total.innerText = selectedSeatsCount * ticketPrice;\n\n}", "title": "" }, { "docid": "740460327f42902bf434041c8d9b9360", "score": "0.49348053", "text": "function updateSelectedCount(){\n //all the elements with class row.seat.selected will be grabbed and kept in a NodeList which is similar as an array\n const selectedSeats = document.querySelectorAll('.row .seat.selected');\n const seatIndex=[...selectedSeats].map((seat)=>{\n return [...seats].indexOf(seat);\n });\n\n localStorage.setItem('selectedSeats',JSON.stringify(seatIndex));\n\n //selected seats will be a NodeList. Can perform all the functions like we perform on an array\n const selectedSeatsCount = selectedSeats.length;\n count.innerText = selectedSeatsCount;\n total.innerText = selectedSeatsCount*ticketPrice;\n}", "title": "" }, { "docid": "97cf78e6a2f09e8e09c1adff4561a344", "score": "0.49285564", "text": "function updatePokeBoxBannerStats(){\n\n // Update the banner counters with the total days and current species\n var pokedexCurrent = Object.keys(PokemonSpeciesSeen).length;\n var pokedexTotal = PokemonSpeciesIndexTokens.length - hiddenPokemonTokens.length;\n var pokedexPercent = pokedexTotal > 0 ? (Math.ceil((pokedexCurrent / pokedexTotal) * 1000) / 10) : 0;\n $('.timer .count .total', $panelBanner).html(numberWithCommas(PokeboxDaysPassed));\n $('.pokedex .count .current', $panelBanner).html(pokedexCurrent);\n $('.pokedex .count .total', $panelBanner).html(pokedexTotal);\n $('.pokedex .count .percent', $panelBanner).html(pokedexPercent+'%');\n // //console.log('pokedexCurrent = ', pokedexCurrent);\n // //console.log('PokemonSpeciesIndexTokens.length = ', PokemonSpeciesIndexTokens.length);\n // //console.log('hiddenPokemonTokens.length = ', hiddenPokemonTokens.length);\n // //console.log('pokedexTotal = ', pokedexTotal);\n // //console.log('pokedexPercent = ', pokedexPercent);\n\n }", "title": "" }, { "docid": "d78a054551bcd4e64b2040accf8cac40", "score": "0.49283683", "text": "function updateLocation() {\n if (scheduled_location_refresh) {\n clearTimeout(scheduled_location_refresh);\n scheduled_location_refresh = null;\n }\n\n //Collapse region details\n $('#region-name').collapse('hide').addClass('hidden');\n\n //Show loading spinner\n $('#region-loading').removeClass('hidden');\n\n var parameters = {latitude: PlayerLocation.instance().latitude, longitude: PlayerLocation.instance().longitude};\n $.get('/location', parameters).done(processStory);\n\n scheduled_location_refresh = setTimeout(updateLocation, 30000);\n}", "title": "" }, { "docid": "163fc06cc7c8b5f7d03ea0eca7dfa228", "score": "0.49264255", "text": "update() {\n for (let index = 0; index < this.planets.length; index++) {\n this.planets[index].update();\n }\n }", "title": "" }, { "docid": "4b91b8d61ef6acf2b6ffa7e68742d773", "score": "0.4924742", "text": "function updateDots() {\r\n\r\n\t\t\t//Loop through the dots one by one and update them accordingly\r\n\t\t\tfor (var i = 0; i < nDots; i++) {\r\n\t\t\t\tvar dot = dotArray[i]; //Load the current dot into the variable for easy handling\r\n\t\t\t\t\r\n\t\t \t//Generate a random value\r\n\t\t \tvar randomValue = Math.random();\r\n\r\n\t\t\t\t//Update based on the dot's update type\r\n\t\t\t\tif (dot.updateType == \"random direction\") {\r\n\t\t\t\t\tdot = randomDirectionUpdate(dot);\r\n\t\t\t\t} else if (dot.updateType == \"coherent direction\") {\r\n\t\t\t\t\tdot = coherentDirectionUpdate(dot);\r\n\t\t\t }//End of if dotUpdate == ...\r\n\r\n\t\t\t\t//Increment the life count\r\n\t\t\t\tdot.lifeCount++;\r\n\r\n\t\t\t\t//Check if out of bounds or if life ended\r\n\t\t\t\tif (lifeEnded(dot) || outOfBounds(dot)) {\r\n\t\t\t\t\tdot = resetLocation(dot);\r\n\t\t\t\t\tif(stimulusIsOn && dotInCircle(dot) && Math.random() <= coherence){\r\n\t\t\t\t\t\tdot.updateType = 'coherent direction';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tdot = setvx2vy2(dot);\r\n\t\t\t\t\t\tdot.updateType = 'random direction';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t} //End of for loop\r\n\t\t} //End of updateDots function", "title": "" }, { "docid": "aadeefbbcb64cad73a54838db1fb3151", "score": "0.4921686", "text": "function updateSelectedCountAndTotal() {\n const selectedSeats = document.querySelectorAll('.movie__seat.selected');\n selectedSeatsCount = selectedSeats.length;\n const seatsIndex = [...selectedSeats].map(seat => [...seats].indexOf(seat));\n localStorage.setItem('selectedSeats', JSON.stringify(seatsIndex));\n\n count.textContent = selectedSeatsCount;\n total.textContent = selectedSeatsCount * ticketPrice;\n}", "title": "" }, { "docid": "68587c9d37b87d49bbb7d4e11195e9d3", "score": "0.49200055", "text": "function updateRosterMini() {\r\n jQuery('#jappix_mini a.jm_button span.jm_counter').text(jQuery('#jappix_mini a.jm_online').size());\r\n}", "title": "" }, { "docid": "602cc04643a31d91e97f9043890d4bfc", "score": "0.49174756", "text": "function moveCounter() {\n moveCount += 1;\n $('.moves').text(moveCount);\n starRating();\n}", "title": "" }, { "docid": "538f0d9f7ec26db6dfe467e4cbbf7092", "score": "0.49124518", "text": "function increaseViewCount(context) {\n let id = { id: context.image.id }\n let url = '/images/views';\n $http.put(url, id).then(function(response) {\n context.image.view_count += 1\n }); \n } // end increaseViewCount()", "title": "" }, { "docid": "9ea87466fe82c2432097f285bb24730d", "score": "0.4909401", "text": "function updateCountNum() {\n const count = d.getElementById('skCount');\n\n if (count) {\n setInterval(() => {\n kudosBtns = d.querySelectorAll(els);\n count.innerHTML = kudosBtns.length;\n toggleKudosBox();\n }, KUDOS_INTERVAL);\n }\n}", "title": "" } ]
399398f301ac99879ea690ccd672b0e2
Convert an array of littleendian words to a string
[ { "docid": "5e16e8976e0604335f66d292f5e7718f", "score": "0.0", "text": "function binl2rstr(input) {\n var i = void 0;\n var output = '';\n var length32 = input.length * 32;\n for (i = 0; i < length32; i += 8) {\n output += String.fromCharCode(input[i >> 5] >>> i % 32 & 255)\n }\n return output\n }", "title": "" } ]
[ { "docid": "71ebd48d53762f6f1cb2f9d0ccee05d0", "score": "0.7247671", "text": "function bin2String(array) {\n var result = \"\";\n for (var i = 0; i < array.byteLength; i++) {\n result += String.fromCharCode(parseInt(array[i]));\n }\n return result;\n}", "title": "" }, { "docid": "630bbd8c0f6fc320bae9573623c35e21", "score": "0.71542066", "text": "function Utf8ArrayToStr(array) {\n\tvar out, i, len, c;\n\tvar char2, char3;\n\n\tout = \"\";\n\tlen = array.length;\n\ti = 0;\n\twhile(i < len) {\n\t\tc = array[i++];\n\t\tswitch(c >> 4) {\n\t\t\tcase 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n\t\t\t// 0xxxxxxx\n\t\t\tout += String.fromCharCode(c);\n\t\t\tbreak;\n\t\t\tcase 12: case 13:\n\t\t\t// 110x xxxx 10xx xxxx\n\t\t\tchar2 = array[i++];\n\t\t\tout += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n\t\t\tbreak;\n\t\t\tcase 14:\n\t\t\t// 1110 xxxx 10xx xxxx 10xx xxxx\n\t\t\tchar2 = array[i++];\n\t\t\tchar3 = array[i++];\n\t\t\tout += String.fromCharCode(((c & 0x0F) << 12) |\n\t\t\t\t\t\t\t((char2 & 0x3F) << 6) |\n\t\t\t\t\t\t\t((char3 & 0x3F) << 0));\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn out;\n}", "title": "" }, { "docid": "6db5ad49c82a622f598b717abf80ebf9", "score": "0.71285146", "text": "function Utf8ArrayToStr(array) {\n var out, i, len, c;\n var char2, char3;\n\n out = \"\";\n len = array.length;\n i = 0;\n while(i < len) {\n c = array[i++];\n switch(c >> 4)\n {\n case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12: case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode(((c & 0x0F) << 12) |\n ((char2 & 0x3F) << 6) |\n ((char3 & 0x3F) << 0));\n break;\n }\n }\n\n return out;\n}", "title": "" }, { "docid": "683a489b57a9acc84f6013ce4337e7b0", "score": "0.7099854", "text": "function bin2String(array) {\n var result = \"\";\n for (var i = 0; i < array.length; i++) {\n result += String.fromCharCode(parseInt(array[i], 2));\n }\n return result;\n}", "title": "" }, { "docid": "23ced1027a7400735cb78e2768aa6489", "score": "0.699029", "text": "function _utf8ArrayToStr(array) {\n let out, i, len, c;\n let char2, char3;\n\n out = \"\";\n len = array.length;\n i = 0;\n while(i < len) {\n c = array[i++];\n switch(c >> 4) {\n case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12: case 13: // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n break;\n case 14: // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode(\n ((c & 0x0F) << 12) |\n ((char2 & 0x3F) << 6) |\n ((char3 & 0x3F) << 0)\n );\n break;\n }\n }\n\n return out;\n}", "title": "" }, { "docid": "2e0829fd2c0ad570d95b49256192fff7", "score": "0.6906583", "text": "function bytes2words(array) {\n var words = [];\n for (var i = 0; i < array.byteLength; i++) {\n words[i >>> 2] |= array[i] << (24 - (i % 4) * 8);\n }\n return words;\n }", "title": "" }, { "docid": "4d4476ed407592bc31128479c88ca49d", "score": "0.68910974", "text": "function binaryStringFromUint8Array(array) {\r\n var binaryString = '';\r\n for (var i = 0; i < array.length; ++i) {\r\n binaryString += String.fromCharCode(array[i]);\r\n }\r\n return binaryString;\r\n}", "title": "" }, { "docid": "98f122350555714b1ad982d58ea8a51f", "score": "0.6836317", "text": "function words_to_string(words) {\n\tvar bytes = \"\";\n\tfor (var i = 0; i < words.length; ++i) {\n\t\tvar w = words[i];\n\t\tbytes += String.fromCharCode(w >> 24 & 0xFF, w >> 16 & 0xFF, w >> 8 & 0xFF, w & 0xFF);\n\t}\n\treturn bytes;\n}", "title": "" }, { "docid": "05a8aea99de70c182711d44956a7ade4", "score": "0.6816187", "text": "function binaryStringFromUint8Array(array) {\r\n\t let binaryString = '';\r\n\t for (let i = 0; i < array.length; ++i) {\r\n\t binaryString += String.fromCharCode(array[i]);\r\n\t }\r\n\t return binaryString;\r\n\t}", "title": "" }, { "docid": "735c1e3f1b5b8523b3e6178fbfaad9c4", "score": "0.6685298", "text": "function bytes_array_to_str(bytes_array) {\n result = '';\n for (var i = 0; i < bytes_array.length; i++) {\n result = result + (String.fromCharCode(bytes_array[i]));\n }\n return result;\n }", "title": "" }, { "docid": "06a67772d1f8c862ac077559472ea09e", "score": "0.6494985", "text": "function arr2Str(arr) {\n\tvar str = \"\";\n\tfor (var i=0;i<arr.length;i++)\n\t{\n\t\tif (arr[i] < 16)\n\t\t\tstr += \"0\";\n\t\tstr += arr[i].toString(16);\n\t}\n\treturn str;\n}", "title": "" }, { "docid": "ab7be195e5fb2cfb2774a6e70727d714", "score": "0.64731276", "text": "function arrayToStr(buf)\n{\n res = '';\n for (var ind=0; ind<buf.length; ind++) \n {\n if (buf[ind] == 0) \n {\n return res;\n } else {\n res += String.fromCharCode(buf[ind]);\n }\n }\n return res;\n}", "title": "" }, { "docid": "44e9ab9a2207411746e55fee53d6db16", "score": "0.64191425", "text": "function binl2byt(binarray) {\r\n var hex_tab = \"0123456789abcdef\";\r\n var bytarray = new Array(binarray.length * 4);\r\n var str = \"\";\r\n for (var i = 0; i < binarray.length * 4; i++) {\r\n bytarray[i] = (binarray[i >> 2] >> ((i % 4) * 8 + 4) & 0xF) << 4 |\r\n binarray[i >> 2] >> ((i % 4) * 8) & 0xF;\r\n }\r\n return bytarray;\r\n}", "title": "" }, { "docid": "52b2335ebc3aa20296fab7d56ab0d746", "score": "0.6363505", "text": "static binl2hex(binarray) {\r\n let hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n let str = \"\";\r\n for (let i = 0; i < binarray.length * 4; i++) {\r\n str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +\r\n hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF);\r\n }\r\n return str;\r\n }", "title": "" }, { "docid": "6831e6eb8a6808103e19abee6660058c", "score": "0.63436145", "text": "function binl2hex(binarray) {\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var str = \"\";\r\n for (var i = 0; i < binarray.length * 4; i++) {\r\n str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +\r\n hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "34a35018f5f33a493ca13f05ac7c311d", "score": "0.6336511", "text": "function binl2hex(binarray)\n\t{\n\t var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n\t var str = \"\";\n\t for(var i = 0; i < binarray.length * 4; i++)\n\t {\n\t str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n\t\t hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n\t }\n\t return str;\n\t}", "title": "" }, { "docid": "e066d4e8a60a265cb43d10c24e64db33", "score": "0.6330374", "text": "function binl2hex(binarray)\r\n{\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var str = \"\";\r\n for(var i = 0; i < binarray.length * 4; i++)\r\n {\r\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\r\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "e066d4e8a60a265cb43d10c24e64db33", "score": "0.6330374", "text": "function binl2hex(binarray)\r\n{\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var str = \"\";\r\n for(var i = 0; i < binarray.length * 4; i++)\r\n {\r\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\r\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "a7ad57fa28311cf560dff9861e1af8d2", "score": "0.63118833", "text": "function binl2hex(binarray)\n\t{\n\t var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n\t var str = \"\";\n\t for(var i = 0; i < binarray.length * 4; i++)\n\t {\n\t\tstr += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n\t\t\t hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n\t }\n\t return str;\n\t}", "title": "" }, { "docid": "86fdf6b9dee6dc6fccbd7c4d5276306f", "score": "0.6297955", "text": "function wordsToBytes(words, endian) {\n if (endian === void 0) { endian = Endian.Big; }\n var numWords = words.length;\n var bytes = new Array(numWords * 4);\n var s0 = 0 + 24 * endian;\n var s1 = 8 + 8 * endian;\n var s2 = 16 - 8 * endian;\n var s3 = 24 - 24 * endian;\n for (var i = 0; i < numWords; i++) {\n var word = words[i];\n var j = 4 * i;\n bytes[j] = (word >> s0) & 0x0FF;\n bytes[j + 1] = (word >> s1) & 0x0FF;\n bytes[j + 2] = (word >> s2) & 0x0FF;\n bytes[j + 3] = (word >> s3) & 0x0FF;\n }\n return bytes;\n }", "title": "" }, { "docid": "c17074a3dde988b48b62481943970385", "score": "0.6290393", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "4bc5fc06fbb28e15c45dc1d6f93ac3d6", "score": "0.6288221", "text": "function binl2hex(binarray) {\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var str = \"\";\r\n for (var i = 0; i < binarray.length * 4; i++) {\r\n str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +\r\n hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 )) & 0xF);\r\n }\r\n return str;\r\n }", "title": "" }, { "docid": "a4453fd779fe3e0fc8cfaa9e4464f875", "score": "0.6272916", "text": "function binl2hex(binarray)\n{\n\tvar hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n\n\tvar str = \"\";\n\n\tfor(var i = 0; i < binarray.length * 4; i++)\n\t{\n\t\tstr += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n\n\t\thex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n\n\t}\n\n\treturn str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.6271212", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.6271212", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.6271212", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.6271212", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.6271212", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.6271212", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.6271212", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.6271212", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "efb3b5826b04e180d16deb52af781fac", "score": "0.6268476", "text": "function binl2hex(binarray)\n {\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n }", "title": "" }, { "docid": "fb5d26cb422a7b1748b40677a98e3a91", "score": "0.62594", "text": "function array_to_hex_string(ary) {\r\n var res = \"\";\r\n for (var i = 0; i < ary.length; i++)\r\n res += SHA256_hexchars[ary[i] >> 4] + SHA256_hexchars[ary[i] & 0x0f];\r\n return res;\r\n}", "title": "" }, { "docid": "a5c2882cb5db3a865f8c93e68b8f47c6", "score": "0.6256766", "text": "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint16Array(buf));\n}", "title": "" }, { "docid": "a5c2882cb5db3a865f8c93e68b8f47c6", "score": "0.6256766", "text": "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint16Array(buf));\n}", "title": "" }, { "docid": "2f9873d5e2694d236c1117a4da1a50c5", "score": "0.62541354", "text": "function binl2hex(binarray) {\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for (var i = 0; i < binarray.length * 4; i++) {\n str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +\n hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF);\n }\n return str;\n }", "title": "" }, { "docid": "141cab4c4e3ee7bdb76769a3f131cb33", "score": "0.6246402", "text": "function ab2str(buf) {\n\treturn String.fromCharCode.apply(null, new Uint16Array(buf));\n}", "title": "" }, { "docid": "4addc00bbe7ef8dc4ea9e5998e27ace5", "score": "0.6239728", "text": "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint16Array(buf));\n}", "title": "" }, { "docid": "4addc00bbe7ef8dc4ea9e5998e27ace5", "score": "0.6239728", "text": "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint16Array(buf));\n}", "title": "" }, { "docid": "830410dc1b81ee53a27ad8441a620dbd", "score": "0.6160343", "text": "function utf8_bytes_array_to_string(bytes) {\n var out = [], pos = 0, c = 0;\n while (pos < bytes.length) {\n var c1 = bytes[pos++];\n if (c1 < 128) {\n out[c++] = String.fromCharCode(c1);\n } else if (c1 > 191 && c1 < 224) {\n var c2 = bytes[pos++];\n out[c++] = String.fromCharCode((c1 & 31) << 6 | c2 & 63);\n } else if (c1 > 239 && c1 < 365) {\n // Surrogate Pair\n var c2 = bytes[pos++];\n var c3 = bytes[pos++];\n var c4 = bytes[pos++];\n var u = ((c1 & 7) << 18 | (c2 & 63) << 12 | (c3 & 63) << 6 | c4 & 63) -\n 0x10000;\n out[c++] = String.fromCharCode(0xD800 + (u >> 10));\n out[c++] = String.fromCharCode(0xDC00 + (u & 1023));\n } else {\n var c2 = bytes[pos++];\n var c3 = bytes[pos++];\n out[c++] =\n String.fromCharCode((c1 & 15) << 12 | (c2 & 63) << 6 | c3 & 63);\n }\n }\n return out.join('');\n }", "title": "" }, { "docid": "74ead1d7992b312365915087cd577510", "score": "0.61552376", "text": "function binl2hex(binarray) {\n var hex_tab = \"0123456789abcdef\";\n var str = \"\";\n for (var i = 0; i < binarray.length * 4; i++) {\n str += hex_tab.charAt(binarray[i >> 2] >> i % 4 * 8 + 4 & 0xF) + hex_tab.charAt(binarray[i >> 2] >> i % 4 * 8 & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "f840a3a91979861ab75cb468aace92c1", "score": "0.61532915", "text": "function u8ToStr (myUint8Arr) {\n return String.fromCharCode.apply(null, myUint8Arr)\n}", "title": "" }, { "docid": "e853e3d1f268f54a6106c45b6bd963c2", "score": "0.6131398", "text": "function binl2hex(binarray) {\n var hex_tab = \"0123456789abcdef\"\n var str = \"\"\n for (var i = 0; i < binarray.length * 4; i++) {\n str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +\n hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF)\n }\n return str\n}", "title": "" }, { "docid": "921df3fc44ad52e15f4d1f92eb7bdee2", "score": "0.6066829", "text": "function ArrayToHex(data) {\r\n\tvar res='';\t\r\n\tvar str=new Uint8Array(data);\r\n\tfor (i = 0; i < str.length; i++) {\r\n\t\tvar code = str[i].toString(16);\r\n\t\tif (code.length < 2)\tcode = '0' + code;\r\n\t\tres = res + code;\r\n\t}\r\n\treturn res; \r\n}", "title": "" }, { "docid": "921df3fc44ad52e15f4d1f92eb7bdee2", "score": "0.6066829", "text": "function ArrayToHex(data) {\r\n\tvar res='';\t\r\n\tvar str=new Uint8Array(data);\r\n\tfor (i = 0; i < str.length; i++) {\r\n\t\tvar code = str[i].toString(16);\r\n\t\tif (code.length < 2)\tcode = '0' + code;\r\n\t\tres = res + code;\r\n\t}\r\n\treturn res; \r\n}", "title": "" }, { "docid": "2c4ba5524127384f65483fb76173f6c9", "score": "0.60238904", "text": "function uint8ArrayToString(uintArray) {\n return decoder.decode(uintArray);\n }", "title": "" }, { "docid": "783094c81e4a8f1a76d4c082839d9c91", "score": "0.59780693", "text": "function UTF8ArrayToString(u8Array, idx) {\n var u0, u1, u2, u3, u4, u5;\n\n var str = '';\n while (1) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629\n u0 = u8Array[idx++];\n if (!u0) return str;\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\n u1 = u8Array[idx++] & 63;\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\n u2 = u8Array[idx++] & 63;\n if ((u0 & 0xF0) == 0xE0) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n u3 = u8Array[idx++] & 63;\n if ((u0 & 0xF8) == 0xF0) {\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\n } else {\n u4 = u8Array[idx++] & 63;\n if ((u0 & 0xFC) == 0xF8) {\n u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\n } else {\n u5 = u8Array[idx++] & 63;\n u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\n }\n }\n }\n if (u0 < 0x10000) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n }\n }\n}", "title": "" }, { "docid": "783094c81e4a8f1a76d4c082839d9c91", "score": "0.59780693", "text": "function UTF8ArrayToString(u8Array, idx) {\n var u0, u1, u2, u3, u4, u5;\n\n var str = '';\n while (1) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629\n u0 = u8Array[idx++];\n if (!u0) return str;\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\n u1 = u8Array[idx++] & 63;\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\n u2 = u8Array[idx++] & 63;\n if ((u0 & 0xF0) == 0xE0) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n u3 = u8Array[idx++] & 63;\n if ((u0 & 0xF8) == 0xF0) {\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\n } else {\n u4 = u8Array[idx++] & 63;\n if ((u0 & 0xFC) == 0xF8) {\n u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\n } else {\n u5 = u8Array[idx++] & 63;\n u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\n }\n }\n }\n if (u0 < 0x10000) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n }\n }\n}", "title": "" }, { "docid": "783094c81e4a8f1a76d4c082839d9c91", "score": "0.59780693", "text": "function UTF8ArrayToString(u8Array, idx) {\n var u0, u1, u2, u3, u4, u5;\n\n var str = '';\n while (1) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629\n u0 = u8Array[idx++];\n if (!u0) return str;\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\n u1 = u8Array[idx++] & 63;\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\n u2 = u8Array[idx++] & 63;\n if ((u0 & 0xF0) == 0xE0) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n u3 = u8Array[idx++] & 63;\n if ((u0 & 0xF8) == 0xF0) {\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\n } else {\n u4 = u8Array[idx++] & 63;\n if ((u0 & 0xFC) == 0xF8) {\n u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\n } else {\n u5 = u8Array[idx++] & 63;\n u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\n }\n }\n }\n if (u0 < 0x10000) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n }\n }\n}", "title": "" }, { "docid": "783094c81e4a8f1a76d4c082839d9c91", "score": "0.59780693", "text": "function UTF8ArrayToString(u8Array, idx) {\n var u0, u1, u2, u3, u4, u5;\n\n var str = '';\n while (1) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629\n u0 = u8Array[idx++];\n if (!u0) return str;\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\n u1 = u8Array[idx++] & 63;\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\n u2 = u8Array[idx++] & 63;\n if ((u0 & 0xF0) == 0xE0) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n u3 = u8Array[idx++] & 63;\n if ((u0 & 0xF8) == 0xF0) {\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\n } else {\n u4 = u8Array[idx++] & 63;\n if ((u0 & 0xFC) == 0xF8) {\n u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\n } else {\n u5 = u8Array[idx++] & 63;\n u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\n }\n }\n }\n if (u0 < 0x10000) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n }\n }\n}", "title": "" }, { "docid": "783094c81e4a8f1a76d4c082839d9c91", "score": "0.59780693", "text": "function UTF8ArrayToString(u8Array, idx) {\n var u0, u1, u2, u3, u4, u5;\n\n var str = '';\n while (1) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629\n u0 = u8Array[idx++];\n if (!u0) return str;\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\n u1 = u8Array[idx++] & 63;\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\n u2 = u8Array[idx++] & 63;\n if ((u0 & 0xF0) == 0xE0) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n u3 = u8Array[idx++] & 63;\n if ((u0 & 0xF8) == 0xF0) {\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\n } else {\n u4 = u8Array[idx++] & 63;\n if ((u0 & 0xFC) == 0xF8) {\n u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\n } else {\n u5 = u8Array[idx++] & 63;\n u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\n }\n }\n }\n if (u0 < 0x10000) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n }\n }\n}", "title": "" }, { "docid": "783094c81e4a8f1a76d4c082839d9c91", "score": "0.59780693", "text": "function UTF8ArrayToString(u8Array, idx) {\n var u0, u1, u2, u3, u4, u5;\n\n var str = '';\n while (1) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629\n u0 = u8Array[idx++];\n if (!u0) return str;\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\n u1 = u8Array[idx++] & 63;\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\n u2 = u8Array[idx++] & 63;\n if ((u0 & 0xF0) == 0xE0) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n u3 = u8Array[idx++] & 63;\n if ((u0 & 0xF8) == 0xF0) {\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\n } else {\n u4 = u8Array[idx++] & 63;\n if ((u0 & 0xFC) == 0xF8) {\n u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\n } else {\n u5 = u8Array[idx++] & 63;\n u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\n }\n }\n }\n if (u0 < 0x10000) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n }\n }\n}", "title": "" }, { "docid": "783094c81e4a8f1a76d4c082839d9c91", "score": "0.59780693", "text": "function UTF8ArrayToString(u8Array, idx) {\n var u0, u1, u2, u3, u4, u5;\n\n var str = '';\n while (1) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629\n u0 = u8Array[idx++];\n if (!u0) return str;\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\n u1 = u8Array[idx++] & 63;\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\n u2 = u8Array[idx++] & 63;\n if ((u0 & 0xF0) == 0xE0) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n u3 = u8Array[idx++] & 63;\n if ((u0 & 0xF8) == 0xF0) {\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\n } else {\n u4 = u8Array[idx++] & 63;\n if ((u0 & 0xFC) == 0xF8) {\n u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\n } else {\n u5 = u8Array[idx++] & 63;\n u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\n }\n }\n }\n if (u0 < 0x10000) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n }\n }\n}", "title": "" }, { "docid": "783094c81e4a8f1a76d4c082839d9c91", "score": "0.59780693", "text": "function UTF8ArrayToString(u8Array, idx) {\n var u0, u1, u2, u3, u4, u5;\n\n var str = '';\n while (1) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629\n u0 = u8Array[idx++];\n if (!u0) return str;\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\n u1 = u8Array[idx++] & 63;\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\n u2 = u8Array[idx++] & 63;\n if ((u0 & 0xF0) == 0xE0) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n u3 = u8Array[idx++] & 63;\n if ((u0 & 0xF8) == 0xF0) {\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\n } else {\n u4 = u8Array[idx++] & 63;\n if ((u0 & 0xFC) == 0xF8) {\n u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\n } else {\n u5 = u8Array[idx++] & 63;\n u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\n }\n }\n }\n if (u0 < 0x10000) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n }\n }\n}", "title": "" }, { "docid": "783094c81e4a8f1a76d4c082839d9c91", "score": "0.59780693", "text": "function UTF8ArrayToString(u8Array, idx) {\n var u0, u1, u2, u3, u4, u5;\n\n var str = '';\n while (1) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629\n u0 = u8Array[idx++];\n if (!u0) return str;\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\n u1 = u8Array[idx++] & 63;\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\n u2 = u8Array[idx++] & 63;\n if ((u0 & 0xF0) == 0xE0) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n u3 = u8Array[idx++] & 63;\n if ((u0 & 0xF8) == 0xF0) {\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\n } else {\n u4 = u8Array[idx++] & 63;\n if ((u0 & 0xFC) == 0xF8) {\n u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\n } else {\n u5 = u8Array[idx++] & 63;\n u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\n }\n }\n }\n if (u0 < 0x10000) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n }\n }\n}", "title": "" }, { "docid": "783094c81e4a8f1a76d4c082839d9c91", "score": "0.59780693", "text": "function UTF8ArrayToString(u8Array, idx) {\n var u0, u1, u2, u3, u4, u5;\n\n var str = '';\n while (1) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629\n u0 = u8Array[idx++];\n if (!u0) return str;\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\n u1 = u8Array[idx++] & 63;\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\n u2 = u8Array[idx++] & 63;\n if ((u0 & 0xF0) == 0xE0) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n u3 = u8Array[idx++] & 63;\n if ((u0 & 0xF8) == 0xF0) {\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\n } else {\n u4 = u8Array[idx++] & 63;\n if ((u0 & 0xFC) == 0xF8) {\n u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\n } else {\n u5 = u8Array[idx++] & 63;\n u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\n }\n }\n }\n if (u0 < 0x10000) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n }\n }\n}", "title": "" }, { "docid": "fa99657f325c6a78a7a10b4ec78f1331", "score": "0.5977781", "text": "dump(arr){\n\t\tlet dumpString = arr.reduce((acc, val) => {\n\t\t\treturn acc + val\n\t\t}, ``) // Concat all bitstrings into one\n\t\treturn dumpString\n\t}", "title": "" }, { "docid": "9a27db3c60a34f683faf2048bcb3d460", "score": "0.59625435", "text": "function h$toHsStringMU8(arr) {\n\n var accept = false, b, n = 0, cp = 0, r = h$ghczmprimZCGHCziTypesziZMZN;\n while(i >= 0) {\n b = arr[i];\n if(!(b & 128)) {\n cp = b;\n accept = true;\n } else if((b & 192) === 128) {\n cp += (b & 32) * Math.pow(64, n)\n } else {\n cp += (b&((1<<(6-n))-1)) * Math.pow(64, n);\n accept = true;\n }\n if(accept) {\n r = (h$c2(h$ghczmprimZCGHCziTypesziZC_con_e, (cp), (r)));\n cp = 0\n n = 0;\n } else {\n n++;\n }\n accept = false;\n i--;\n }\n return r;\n}", "title": "" }, { "docid": "9a27db3c60a34f683faf2048bcb3d460", "score": "0.59625435", "text": "function h$toHsStringMU8(arr) {\n\n var accept = false, b, n = 0, cp = 0, r = h$ghczmprimZCGHCziTypesziZMZN;\n while(i >= 0) {\n b = arr[i];\n if(!(b & 128)) {\n cp = b;\n accept = true;\n } else if((b & 192) === 128) {\n cp += (b & 32) * Math.pow(64, n)\n } else {\n cp += (b&((1<<(6-n))-1)) * Math.pow(64, n);\n accept = true;\n }\n if(accept) {\n r = (h$c2(h$ghczmprimZCGHCziTypesziZC_con_e, (cp), (r)));\n cp = 0\n n = 0;\n } else {\n n++;\n }\n accept = false;\n i--;\n }\n return r;\n}", "title": "" }, { "docid": "9a27db3c60a34f683faf2048bcb3d460", "score": "0.59625435", "text": "function h$toHsStringMU8(arr) {\n\n var accept = false, b, n = 0, cp = 0, r = h$ghczmprimZCGHCziTypesziZMZN;\n while(i >= 0) {\n b = arr[i];\n if(!(b & 128)) {\n cp = b;\n accept = true;\n } else if((b & 192) === 128) {\n cp += (b & 32) * Math.pow(64, n)\n } else {\n cp += (b&((1<<(6-n))-1)) * Math.pow(64, n);\n accept = true;\n }\n if(accept) {\n r = (h$c2(h$ghczmprimZCGHCziTypesziZC_con_e, (cp), (r)));\n cp = 0\n n = 0;\n } else {\n n++;\n }\n accept = false;\n i--;\n }\n return r;\n}", "title": "" }, { "docid": "4b463b9e84cad16e06362050dcc1a83d", "score": "0.5954655", "text": "function numericBeltToString (p_arrayLeft, p_arrayUp, p_arrayRight, p_arrayDown) {\n\tconst streamBelt = new StreamEncodingSparseAny();\n\tif (p_arrayLeft != null) {\n\t\tfor (var i = p_arrayLeft.length-1; i >= 0 ; i--) {\n\t\t\tstreamBelt.encode(p_arrayLeft[i]);\n\t\t}\n\t}\n\tif (p_arrayUp != null) {\n\t\tfor (var i = 0 ; i < p_arrayUp.length ; i++) {\n\t\t\tstreamBelt.encode(p_arrayUp[i]);\n\t\t}\n\t}\n\tif (p_arrayRight != null) {\n\t\tfor (var i = 0 ; i < p_arrayRight.length ; i++) {\n\t\t\tstreamBelt.encode(p_arrayRight[i]);\n\t\t}\n\t}\n\tif (p_arrayDown != null) {\n\t\tfor (var i = p_arrayDown.length-1; i >= 0 ; i--) {\n\t\t\tstreamBelt.encode(p_arrayDown[i]);\n\t\t}\n\t}\n\treturn streamBelt.getString();\n}", "title": "" }, { "docid": "16120c2e7e12ee00b7f1c8b5b9c7c5a6", "score": "0.5952361", "text": "function ab2str(buf) {\n var result = '';\n try {\n result = String.fromCharCode.apply(null, new Uint16Array(buf));\n } catch (e) {}\n return result;\n}", "title": "" }, { "docid": "fd61338b5cb384064aba94699862e7f8", "score": "0.5951238", "text": "function ab2str(buf) {\n\t return String.fromCharCode.apply(null, new Uint8Array(buf));\n\t }", "title": "" }, { "docid": "a85446d952ace1cf53c9bfe23a2abf94", "score": "0.5951064", "text": "function UTF8ArrayToString(u8Array, idx) {\r\n var u0, u1, u2, u3, u4, u5;\r\n\r\n var str = '';\r\n while (1) {\r\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629\r\n u0 = u8Array[idx++];\r\n if (!u0) return str;\r\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\r\n u1 = u8Array[idx++] & 63;\r\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\r\n u2 = u8Array[idx++] & 63;\r\n if ((u0 & 0xF0) == 0xE0) {\r\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\r\n } else {\r\n u3 = u8Array[idx++] & 63;\r\n if ((u0 & 0xF8) == 0xF0) {\r\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\r\n } else {\r\n u4 = u8Array[idx++] & 63;\r\n if ((u0 & 0xFC) == 0xF8) {\r\n u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\r\n } else {\r\n u5 = u8Array[idx++] & 63;\r\n u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\r\n }\r\n }\r\n }\r\n if (u0 < 0x10000) {\r\n str += String.fromCharCode(u0);\r\n } else {\r\n var ch = u0 - 0x10000;\r\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\r\n }\r\n }\r\n}", "title": "" }, { "docid": "a85446d952ace1cf53c9bfe23a2abf94", "score": "0.5951064", "text": "function UTF8ArrayToString(u8Array, idx) {\r\n var u0, u1, u2, u3, u4, u5;\r\n\r\n var str = '';\r\n while (1) {\r\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629\r\n u0 = u8Array[idx++];\r\n if (!u0) return str;\r\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\r\n u1 = u8Array[idx++] & 63;\r\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\r\n u2 = u8Array[idx++] & 63;\r\n if ((u0 & 0xF0) == 0xE0) {\r\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\r\n } else {\r\n u3 = u8Array[idx++] & 63;\r\n if ((u0 & 0xF8) == 0xF0) {\r\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\r\n } else {\r\n u4 = u8Array[idx++] & 63;\r\n if ((u0 & 0xFC) == 0xF8) {\r\n u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\r\n } else {\r\n u5 = u8Array[idx++] & 63;\r\n u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\r\n }\r\n }\r\n }\r\n if (u0 < 0x10000) {\r\n str += String.fromCharCode(u0);\r\n } else {\r\n var ch = u0 - 0x10000;\r\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\r\n }\r\n }\r\n}", "title": "" }, { "docid": "ca42d9ac6479a35bf7aad7384b660639", "score": "0.59506655", "text": "function byteArrayToString(byteArr){\n var outStr = \"\";\n for(byte of byteArr){\n outStr += String.fromCharCode(byte);\n }\n return outStr;\n}", "title": "" }, { "docid": "6931c3696ba1d5d01035852be85d8c20", "score": "0.59379596", "text": "function bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n var length8 = input.length * 8;\n var output = new Uint32Array(getOutputLength(length8));\n\n for (var i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}", "title": "" }, { "docid": "6931c3696ba1d5d01035852be85d8c20", "score": "0.59379596", "text": "function bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n var length8 = input.length * 8;\n var output = new Uint32Array(getOutputLength(length8));\n\n for (var i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}", "title": "" }, { "docid": "6931c3696ba1d5d01035852be85d8c20", "score": "0.59379596", "text": "function bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n var length8 = input.length * 8;\n var output = new Uint32Array(getOutputLength(length8));\n\n for (var i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}", "title": "" }, { "docid": "6931c3696ba1d5d01035852be85d8c20", "score": "0.59379596", "text": "function bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n var length8 = input.length * 8;\n var output = new Uint32Array(getOutputLength(length8));\n\n for (var i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}", "title": "" }, { "docid": "6931c3696ba1d5d01035852be85d8c20", "score": "0.59379596", "text": "function bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n var length8 = input.length * 8;\n var output = new Uint32Array(getOutputLength(length8));\n\n for (var i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}", "title": "" }, { "docid": "6931c3696ba1d5d01035852be85d8c20", "score": "0.59379596", "text": "function bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n var length8 = input.length * 8;\n var output = new Uint32Array(getOutputLength(length8));\n\n for (var i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}", "title": "" }, { "docid": "6931c3696ba1d5d01035852be85d8c20", "score": "0.59379596", "text": "function bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n var length8 = input.length * 8;\n var output = new Uint32Array(getOutputLength(length8));\n\n for (var i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}", "title": "" }, { "docid": "f00b5efa1071d691c9572eaf2a29194b", "score": "0.59252036", "text": "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint8Array(buf));\n}", "title": "" }, { "docid": "de2b5307c70776641876a20fc9e46f13", "score": "0.59216344", "text": "function h$toHsStringMU8(arr) {\n var accept = false, b, n = 0, cp = 0, r = h$ghczmprimZCGHCziTypesziZMZN;\n while(i >= 0) {\n b = arr[i];\n if(!(b & 128)) {\n cp = b;\n accept = true;\n } else if((b & 192) === 128) {\n cp += (b & 32) * Math.pow(64, n)\n } else {\n cp += (b&((1<<(6-n))-1)) * Math.pow(64, n);\n accept = true;\n }\n if(accept) {\n r = (h$c2(h$ghczmprimZCGHCziTypesziZC_con_e, (cp), (r)));\n cp = 0\n n = 0;\n } else {\n n++;\n }\n accept = false;\n i--;\n }\n return r;\n}", "title": "" }, { "docid": "de2b5307c70776641876a20fc9e46f13", "score": "0.59216344", "text": "function h$toHsStringMU8(arr) {\n var accept = false, b, n = 0, cp = 0, r = h$ghczmprimZCGHCziTypesziZMZN;\n while(i >= 0) {\n b = arr[i];\n if(!(b & 128)) {\n cp = b;\n accept = true;\n } else if((b & 192) === 128) {\n cp += (b & 32) * Math.pow(64, n)\n } else {\n cp += (b&((1<<(6-n))-1)) * Math.pow(64, n);\n accept = true;\n }\n if(accept) {\n r = (h$c2(h$ghczmprimZCGHCziTypesziZC_con_e, (cp), (r)));\n cp = 0\n n = 0;\n } else {\n n++;\n }\n accept = false;\n i--;\n }\n return r;\n}", "title": "" }, { "docid": "de2b5307c70776641876a20fc9e46f13", "score": "0.59216344", "text": "function h$toHsStringMU8(arr) {\n var accept = false, b, n = 0, cp = 0, r = h$ghczmprimZCGHCziTypesziZMZN;\n while(i >= 0) {\n b = arr[i];\n if(!(b & 128)) {\n cp = b;\n accept = true;\n } else if((b & 192) === 128) {\n cp += (b & 32) * Math.pow(64, n)\n } else {\n cp += (b&((1<<(6-n))-1)) * Math.pow(64, n);\n accept = true;\n }\n if(accept) {\n r = (h$c2(h$ghczmprimZCGHCziTypesziZC_con_e, (cp), (r)));\n cp = 0\n n = 0;\n } else {\n n++;\n }\n accept = false;\n i--;\n }\n return r;\n}", "title": "" }, { "docid": "de2b5307c70776641876a20fc9e46f13", "score": "0.59216344", "text": "function h$toHsStringMU8(arr) {\n var accept = false, b, n = 0, cp = 0, r = h$ghczmprimZCGHCziTypesziZMZN;\n while(i >= 0) {\n b = arr[i];\n if(!(b & 128)) {\n cp = b;\n accept = true;\n } else if((b & 192) === 128) {\n cp += (b & 32) * Math.pow(64, n)\n } else {\n cp += (b&((1<<(6-n))-1)) * Math.pow(64, n);\n accept = true;\n }\n if(accept) {\n r = (h$c2(h$ghczmprimZCGHCziTypesziZC_con_e, (cp), (r)));\n cp = 0\n n = 0;\n } else {\n n++;\n }\n accept = false;\n i--;\n }\n return r;\n}", "title": "" }, { "docid": "de2b5307c70776641876a20fc9e46f13", "score": "0.59216344", "text": "function h$toHsStringMU8(arr) {\n var accept = false, b, n = 0, cp = 0, r = h$ghczmprimZCGHCziTypesziZMZN;\n while(i >= 0) {\n b = arr[i];\n if(!(b & 128)) {\n cp = b;\n accept = true;\n } else if((b & 192) === 128) {\n cp += (b & 32) * Math.pow(64, n)\n } else {\n cp += (b&((1<<(6-n))-1)) * Math.pow(64, n);\n accept = true;\n }\n if(accept) {\n r = (h$c2(h$ghczmprimZCGHCziTypesziZC_con_e, (cp), (r)));\n cp = 0\n n = 0;\n } else {\n n++;\n }\n accept = false;\n i--;\n }\n return r;\n}", "title": "" }, { "docid": "a1b503a0a0903b0a69bfbadc17fd7d97", "score": "0.59111357", "text": "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint8Array(buf));\n}", "title": "" }, { "docid": "a1b503a0a0903b0a69bfbadc17fd7d97", "score": "0.59111357", "text": "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint8Array(buf));\n}", "title": "" }, { "docid": "52791f62d6fe9ffc7ea5a783748df006", "score": "0.5896937", "text": "function UTF8ArrToStr(aBytes) {\n var sView = \"\";\n\n for (var nPart, nLen = aBytes.length, nIdx = 0; nIdx < nLen; nIdx++) {\n nPart = aBytes[nIdx];\n sView += String.fromCharCode(\n nPart > 251 && nPart < 254 && nIdx + 5 < nLen ? /* six bytes */\n /* (nPart - 252 << 32) is not possible in ECMAScript! So...: */\n (nPart - 252) * 1073741824 + (aBytes[++nIdx] - 128 << 24) + (aBytes[++nIdx] - 128 << 18) +\n (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128 : nPart >\n 247 && nPart < 252 && nIdx + 4 < nLen ? /* five bytes */\n (nPart - 248 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (\n aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128 : nPart > 239 && nPart < 248 &&\n nIdx + 3 < nLen ? /* four bytes */\n (nPart - 240 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++\n nIdx] - 128 : nPart > 223 && nPart < 240 && nIdx + 2 < nLen ? /* three bytes */\n (nPart - 224 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128 : nPart > 191 &&\n nPart < 224 && nIdx + 1 < nLen ? /* two bytes */\n (nPart - 192 << 6) + aBytes[++nIdx] - 128 : /* nPart < 127 ? */ /* one byte */\n nPart\n );\n }\n\n return sView;\n\n}", "title": "" }, { "docid": "a04f907d59bcf1043f82b00e4e1b35d5", "score": "0.5886423", "text": "function arrayBufferToString(input) {\n return String.fromCharCode(...new Uint8Array(input));\n}", "title": "" }, { "docid": "187d6cc70e637a4c8569e450dc1e1a9c", "score": "0.58830523", "text": "function arrToStr( arr ) {\n var i = 0,\n arrL = arr.length,\n str = '';\n\n for ( ; i < arrL; str += DIGITS.charAt( arr[i++] ) ) {\n }\n\n return str;\n }", "title": "" }, { "docid": "914ccaaf59a4d08ea31d305c591cad0d", "score": "0.587032", "text": "function binl2rstr (input) {\n\t var i\n\t var output = ''\n\t var length32 = input.length * 32\n\t for (i = 0; i < length32; i += 8) {\n\t output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF)\n\t }\n\t return output\n\t }", "title": "" }, { "docid": "914ccaaf59a4d08ea31d305c591cad0d", "score": "0.587032", "text": "function binl2rstr (input) {\n\t var i\n\t var output = ''\n\t var length32 = input.length * 32\n\t for (i = 0; i < length32; i += 8) {\n\t output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF)\n\t }\n\t return output\n\t }", "title": "" }, { "docid": "5c7d8d92ad8e0f25bfe5cd1ff010b6fd", "score": "0.5868138", "text": "function binaryToString(binary) {\n \n}", "title": "" }, { "docid": "9b8acddd3275bd67c256cfbc76438a34", "score": "0.5865283", "text": "function h$toHsStringMU8(arr) {\n var accept = false, b, n = 0, cp = 0, r = h$ghczmprimZCGHCziTypesziZMZN, i = arr.length - 1;\n while(i >= 0) {\n b = arr[i];\n if(!(b & 128)) {\n cp = b;\n accept = true;\n } else if((b & 192) === 128) {\n cp += (b & 32) * Math.pow(64, n)\n } else {\n cp += (b&((1<<(6-n))-1)) * Math.pow(64, n);\n accept = true;\n }\n if(accept) {\n r = h$c2(h$ghczmprimZCGHCziTypesziZC_con_e, cp, r);\n cp = 0\n n = 0;\n } else {\n n++;\n }\n accept = false;\n i--;\n }\n return r;\n}", "title": "" }, { "docid": "cbfa3bf97307709c0bd57f9ad708669b", "score": "0.5860152", "text": "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint8Array(buf));\n }", "title": "" }, { "docid": "cbfa3bf97307709c0bd57f9ad708669b", "score": "0.5860152", "text": "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint8Array(buf));\n }", "title": "" }, { "docid": "f4fbe5f933819b90b065589d670d9fc7", "score": "0.5850415", "text": "function UTF8ArrToStr (aBytes) {\n\n var sView = \"\";\n\n for (var nPart, nLen = aBytes.length, nIdx = 0; nIdx < nLen; nIdx++) {\n nPart = aBytes[nIdx];\n sView += String.fromCharCode(\n nPart > 251 && nPart < 254 && nIdx + 5 < nLen ? /* six bytes */\n /* (nPart - 252 << 30) may be not so safe in ECMAScript! So...: */\n (nPart - 252) * 1073741824 + (aBytes[++nIdx] - 128 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 247 && nPart < 252 && nIdx + 4 < nLen ? /* five bytes */\n (nPart - 248 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 239 && nPart < 248 && nIdx + 3 < nLen ? /* four bytes */\n (nPart - 240 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 223 && nPart < 240 && nIdx + 2 < nLen ? /* three bytes */\n (nPart - 224 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 191 && nPart < 224 && nIdx + 1 < nLen ? /* two bytes */\n (nPart - 192 << 6) + aBytes[++nIdx] - 128\n : /* nPart < 127 ? */ /* one byte */\n nPart\n );\n }\n\n return sView;\n\n}", "title": "" }, { "docid": "42a784644537887b9f5f0aeef503d406", "score": "0.58140147", "text": "function bytesToWords(input) {\n var i;\n var output = [];\n output[(input.length >> 2) - 1] = undefined;\n\n for (i = 0; i < output.length; i += 1) {\n output[i] = 0;\n }\n\n var length8 = input.length * 8;\n\n for (i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}", "title": "" }, { "docid": "8c8a9e5b2a0fd27bcd65b3538c9079ab", "score": "0.58115834", "text": "function bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n const length8 = input.length * 8;\n const output = new Uint32Array(getOutputLength(length8));\n\n for (let i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}", "title": "" }, { "docid": "6a249c43fa1a92303958abfa78075f04", "score": "0.5806748", "text": "function binl2rstr (input) {\n var i\n var output = ''\n var length32 = input.length * 32\n for (i = 0; i < length32; i += 8) {\n output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF)\n }\n return output\n }", "title": "" }, { "docid": "6a249c43fa1a92303958abfa78075f04", "score": "0.5806748", "text": "function binl2rstr (input) {\n var i\n var output = ''\n var length32 = input.length * 32\n for (i = 0; i < length32; i += 8) {\n output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF)\n }\n return output\n }", "title": "" }, { "docid": "a673721bf8c674faf7536ff880f35330", "score": "0.5803053", "text": "function buf2binstring(buf,len){// use fallback for big arrays to avoid stack overflow\nif(len<65537){if(buf.subarray&&STR_APPLY_UIA_OK||!buf.subarray&&STR_APPLY_OK){return String.fromCharCode.apply(null,utils.shrinkBuf(buf,len));}}var result='';for(var i=0;i<len;i++){result+=String.fromCharCode(buf[i]);}return result;}// Convert byte array to binary string", "title": "" }, { "docid": "25458c33b294fffe36d07836e178a2fc", "score": "0.57936853", "text": "function convertArrayToString(myArray){\n\n}", "title": "" }, { "docid": "8c600a6128adda7c208d53bdb022bcfe", "score": "0.5792487", "text": "function encode(array) {\n\t\tvar result = [];\n\t\tfor (var i = array.length - 1; i >= 0; --i) {\n\t\t\tresult[i] = encodeValue(array[i]);\n\t\t}\n\t\treturn result.join(\"\");\n\t}", "title": "" }, { "docid": "6bc5ff544c44cd5a9bec5fea5f2ebb2c", "score": "0.5758563", "text": "function binary(array, idx) {\n var value = array[idx]; // If not a number we print 8 `?` to retain alignment but let user know that it was called on\n // wrong type.\n\n if (typeof value !== 'number') return '????????'; // We prefix 0s so that we have constant length number\n\n var text = '00000000' + value.toString(2);\n return text.substring(text.length - 8);\n }", "title": "" }, { "docid": "6bc5ff544c44cd5a9bec5fea5f2ebb2c", "score": "0.5758563", "text": "function binary(array, idx) {\n var value = array[idx]; // If not a number we print 8 `?` to retain alignment but let user know that it was called on\n // wrong type.\n\n if (typeof value !== 'number') return '????????'; // We prefix 0s so that we have constant length number\n\n var text = '00000000' + value.toString(2);\n return text.substring(text.length - 8);\n }", "title": "" }, { "docid": "27ef1e498cd02765a433d2f004795ec9", "score": "0.57585245", "text": "function binl2rstr (input) {\n var i\n var output = ''\n var length32 = input.length * 32\n for (i = 0; i < length32; i += 8) {\n output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff)\n }\n return output\n }", "title": "" } ]
4e01e72b50d9b14fcc31e07ff414d2e7
Update battery power levels
[ { "docid": "588c34ac78260e684853880a445fb618", "score": "0.0", "text": "function reactorLevels(){\n var percentFilled = (.05+(playerStats[\"ship-acorncoin\"])/12)*100;\n document.getElementById(\"red-reactor\").style.backgroundImage = \"linear-gradient(to top, rgba(0,0,0,0) \"+percentFilled+\"%, white 0%)\";\n\n percentFilled = (.05+(playerStats[\"ship-mushroomcoin\"])/12)*100;\n document.getElementById(\"silver-reactor\").style.backgroundImage = \"linear-gradient(to top, rgba(0,0,0,0) \"+percentFilled+\"%, white 0%)\";\n\n percentFilled = (.05+(playerStats[\"ship-bearclawcoin\"])/12)*100;\n document.getElementById(\"gold-reactor\").style.backgroundImage = \"linear-gradient(to top, rgba(0,0,0,0) \"+percentFilled+\"%, white 0%)\";\n}", "title": "" } ]
[ { "docid": "c4621b297197d716b3f47637811b3c2f", "score": "0.7836518", "text": "function onBatteryLevelChange() {\n if (!enabled || !battery) {\n return;\n }\n\n t.set(\"bat\", battery.level);\n }", "title": "" }, { "docid": "6848165e1664f66bd604d4e48fae3b83", "score": "0.75021267", "text": "updatePowerStatus() {}", "title": "" }, { "docid": "c3c8b5a49318d256c8884bc155c46b5b", "score": "0.68309355", "text": "function getBatteryState() {\n batteryLevel = Math.floor(battery.level * 100);\n batteryLevel = batteryLevel + '%';\n }", "title": "" }, { "docid": "0e1420cbe2fcffecbf500f7a8c61cb3f", "score": "0.67603713", "text": "function batteryCallback(params)\n {\n var plagged = params.isPlugged ? 'plugged in' : 'not plugged';\n batteryStatus = '<b>'+params.level+'%</b>';\n batteryPlagged = plagged;\n }", "title": "" }, { "docid": "cb315e709a6d31b58c1a2c97aee84f04", "score": "0.6568144", "text": "function updateBatteryStatus(dischargeRate, isCharging) {\n if(isCharging) {\n if(battery >= 100.0) {\n battery = 100;\n console.log('battery fully charged!');\n } else {\n status = 'active';\n battery+=1.0;\n }\n } else {\n if(status == 'dead' || isKilled) {\n return;\n }\n\n if(battery <= 0.0) {\n battery = 0;\n status = 'dead';\n console.log('battery fully discharged! shutting down device!');\n } else if(battery <= 50.0) {\n if(status == 'sleep') {\n status = 'awake';\n } else {\n status = 'sleep';\n }\n battery-=dischargeRate/2;\n } else {\n status = 'active';\n battery-=dischargeRate;\n }\n }\n}", "title": "" }, { "docid": "9ad111c3a4373647e0e0cafd9310feca", "score": "0.6526183", "text": "displayBattery() {\n let level = Math.round(this.batteryLevel);\n if (this.isCharging) {\n this.$battery.addClass(\"charging\");\n } else {\n this.$battery.removeClass(\"charging\");\n }\n this.$batteryText.text(level + \"%\");\n this.$battery.attr(\"data-level\", Math.round(level / 10) * 10);\n }", "title": "" }, { "docid": "3136c39427134483e7bb49f5f7e9b838", "score": "0.6501995", "text": "function updateChargingLevel() {\n for (let i = 0; i < chargingBars.length; i++) {\n chargingBars[i].style.height = chargingLevel + \"%\";\n if (chargingLevel <= 20) {\n chargingBars[i].style.backgroundColor = \"red\";\n } else if (chargingLevel <= 50) {\n chargingBars[i].style.backgroundColor = \"orange\";\n } else {\n chargingBars[i].style.backgroundColor = \"#0f0\";\n }\n }\n }", "title": "" }, { "docid": "f1b3aa4891d94c1edc5523d13b338635", "score": "0.64324546", "text": "function batteryUpdateHandler() { items[0].emit(\"redraw\"); }", "title": "" }, { "docid": "8bf30523d8851306a567cb2a477ff60d", "score": "0.64261436", "text": "updateLevel() {\n this.level = this.computeLevel()\n this.maxEnergy = this.computeMaxEnergy()\n\n // check to see if any stats are unlocked\n if (this.getStat(STATS.LEG) < 1 && this.level >= LEG_UNLOCK_LEVEL) this.setStat(STATS.LEG, 1)\n if (this.getStat(STATS.ARM) < 1 && this.level >= ARM_UNLOCK_LEVEL) this.setStat(STATS.ARM, 1)\n if (this.getStat(STATS.HAIR) < 1 && this.level >= HAIR_UNLOCK_LEVEL) this.setStat(STATS.HAIR, 1)\n if (this.getStat(STATS.DOG) < 1 && this.level >= DOG_UNLOCK_LEVEL) this.setStat(STATS.DOG, 1)\n }", "title": "" }, { "docid": "c3e44a6330d4aa07c1b9baf8f786d501", "score": "0.6394898", "text": "function getBatteryLevel(){\n var bytes=new Uint8Array(64);\n /*var UUID_FIRMW_VERS = new Uint8Array([0x2a, 0x19]);\n bytes[0]=0x12;\n bytes[1]=(UUID_FIRMW_VERS.length & 0xFF);\n bytes[2]=0x2a;\n bytes[3]=0x19;*/\t\n\tif(oldVersion == true)\n\t{\n\t\tconsole.log(\"old version\");\n\t\tbytes[0] = 0x17;\t\t\t\t\t\t\t\t//read handle\n\t\tbytes[1] = 4;\n\t\tbytes[2] = 0x00;\n\t\tbytes[3] = 0x24;\n\t}\n\telse\n\t{\n\t\tconsole.log(\"new version\");\n\t\tbytes[0] = 0x17;\t\t\t\t\t\t\t\t//read handle\n\t\tbytes[1] = 4;\n\t\tbytes[2] = 0x00;\n\t\tbytes[3] = 0x26;\n\t}\n\t\n\tsendByteData(true,bytes,null,connectionId_FIDO_FIDO,'UUID_BAT_LVL'); \n\t\t\n }", "title": "" }, { "docid": "919194d200bba32ee50628584f6e07ca", "score": "0.6372993", "text": "_enableBatterySwitch () {\n let byte = this.getRegister(REG_BATT);\n byte = byte & 0x0F;\n this.setRegister(REG_BATT, byte);\n }", "title": "" }, { "docid": "da011e60501dc14ab33766fa9b072d73", "score": "0.6304704", "text": "function waterPlant() {\n if (chargingLevel <= 90) {\n chargingLevel += 10;\n updateChargingLevel();\n }\n }", "title": "" }, { "docid": "4e7b0b5aa1aa7ebc82afa95a5517f180", "score": "0.6269321", "text": "function onBatteryStatus(status) {\n _home.updateBatteryStatus(status);\n //alert(\"Level: \" + status.level + \" isPlugged: \" + status.isPlugged);\n }", "title": "" }, { "docid": "df87716a11507c30e3159a19cc346be5", "score": "0.61879784", "text": "function onBatteryStatus(status) {\n\n $('.battery-status-level').css('width', status.level + '%');\n\n if (status.isPlugged) {\n $('.battery-status-level').addClass('plugged')\n } else {\n $('.battery-status-level').removeClass('plugged')\n }\n\n console.log(\"Level: \" + status.level + \" isPlugged: \" + status.isPlugged);\n }", "title": "" }, { "docid": "447302580420ffaf215b503a9e4a267e", "score": "0.6171337", "text": "function update() {\n healthBar.value = health;\n choosePick();\n lowhealth();\n}", "title": "" }, { "docid": "766cc09da1d4acb6e94fff95fe8ecbaf", "score": "0.61425126", "text": "function reduceBattery()\n{\n\tcurrentBatteryRemaining = currentBatteryRemaining - 1;\n}", "title": "" }, { "docid": "d53bf5e9c78ceb365d5744d69d35085c", "score": "0.6135309", "text": "changePower() {\n this.power = true;\n }", "title": "" }, { "docid": "e365d16c7ceb538ad88f142ba95e01a5", "score": "0.6115969", "text": "function lowBattery(params)\n {\n Ext.Msg.alert('Warning', 'Your battery reached low level <br/>'+\n 'current battery status:'+params.level+'% <br/>'+\n 'and '+(params.isPlugged ? 'plugged to source' : 'even not plugged'));\n }", "title": "" }, { "docid": "919b2849018160452490dd117e0386f9", "score": "0.6096144", "text": "function syncUpgradeLevels() {\r\n for (var i = 0; i < constants.upgrades.length; i++) {\r\n constants.upgrades[i].current = player.upgradeLevels[i];\r\n }\r\n}", "title": "" }, { "docid": "5275575cd10aa644c7602094bcf88b5d", "score": "0.6049771", "text": "function chkBattery() {\n if (curvalues['status'] == \"ONLINE REPLACEBATT\") {\n mclient.publish(\"alert/\" + devicename, \"UPS Battery needs to be replaced!\");\n }\n setTimeout(chkBattery, 86400000); // 24 hours; recheck tomorrow\n}", "title": "" }, { "docid": "0917d89ebbd7e84f15b45bc7e99c4d59", "score": "0.5985025", "text": "function updateLevel() {\n currentLevel = Math.min(Math.floor(killedZombies / 10), 35);\n currentPlayIntervalTimeout = Math.max(startPlatIntervalTimeout - currentLevel * 50, 250);\n }", "title": "" }, { "docid": "f7b8b2e903fa77edaf27d9f3b6003eb3", "score": "0.59638256", "text": "updateEnergy() {\n switch( this.state ) {\n case 'sleeping':\n this.energy += 10\n break;\n case 'wakingUp':\n this.energy += 3;\n break;\n case 'watchingTv':\n this.energy -= 1;\n break;\n case 'tired':\n this.energy -= 6;\n break;\n default:\n this.energy -= 2;\n break;\n }\n }", "title": "" }, { "docid": "697c029f2bfb9057af6918a5f1ce80b6", "score": "0.5957243", "text": "updateLevel(value) {\n this.level=value;\n }", "title": "" }, { "docid": "69f6e8c62cae3d44e3f302aec21cebb7", "score": "0.5888891", "text": "function updateBoostsScreen() {\r\n $('#pointsOutput').text(points);\r\n $('#quackLevelOutput').text(quackLevel);\r\n $('#speedLevelOutput').text(speedLevel);\r\n $('#invisibilityLevelOutput').text(invisibilityLevel);\r\n $('#quackCostOutput').text(quackCost);\r\n $('#speedCostOutput').text(speedCost);\r\n $('#invisibilityCostOutput').text(invisibilityCost);\r\n if (points < invisibilityCost || invisibilityLevel >= maxSkillLevel)\r\n {\r\n $('#upgradeInvisibilityButton').attr(\"disabled\",\"disabled\");\r\n }\r\n else\r\n {\r\n $('#upgradeInvisibilityButton').removeAttr(\"disabled\");\r\n }\r\n \r\n if (points < speedCost || speedLevel >= maxSkillLevel)\r\n {\r\n $('#upgradeSpeedButton').attr(\"disabled\",\"disabled\");\r\n }\r\n else\r\n {\r\n $('#upgradeSpeedButton').removeAttr(\"disabled\");\r\n }\r\n \r\n if (points < quackCost || quackLevel >= maxSkillLevel)\r\n {\r\n $('#upgradeQuackButton').attr(\"disabled\",\"disabled\");\r\n }\r\n else\r\n {\r\n $('#upgradeQuackButton').removeAttr(\"disabled\");\r\n }\r\n }", "title": "" }, { "docid": "b2b167092f42c52807718132c3046542", "score": "0.5888297", "text": "control_increasePow(){\n\t\tthis.fireAdj = true;\n\t\tvar power = 18;\n\t\tthis.firePow = (this.firePow * 1.97 + power * 0.03) / 2;\n\t}", "title": "" }, { "docid": "e767424ab1a73abdafdad539a7fcc839", "score": "0.58856916", "text": "_disableBatterySwitch () {\n let byte = this.getRegister(REG_BATT);\n byte = byte | 0x10;\n this.setRegister(REG_BATT, byte);\n }", "title": "" }, { "docid": "5d52deb5328ab01c359422309b9f1c59", "score": "0.588304", "text": "function YLed_set_power(newval)\n { var rest_val;\n rest_val = String(newval);\n return this._setAttr('power',rest_val);\n }", "title": "" }, { "docid": "c13f23d30e6a79cc59e65d91d1fce4b8", "score": "0.5838018", "text": "powerChange() {\n this.setState({\n power: !this.state.power,\n bank: this.state.bank,\n volume: this.state.volume\n });\n this.setDisplay(\"\");\n }", "title": "" }, { "docid": "306c30cb615f04a509153f3de1f7d3e4", "score": "0.58078754", "text": "function ChangeStatus(OpenDicht,level,idx,currentlevel){\n\t//When switched off return to previous level, no matter if plus or min pressed\n\tif (level == txt_off) {\n\t\tif (currentlevel == 1) {\n\t\t\tcurrentlevel++;\n\t\t}\n\t\t//console.log(\"In uit\",currentlevel);\n\t\t$.ajax({\n\t\turl: $.domoticzurl+\"/json.htm?type=command&param=switchlight&idx=\" + idx + \"&switchcmd=Set Level&level=\" + currentlevel,\n\t\tasync: false,\n\t\tdataType: 'json',\n\t\tsuccess: function(){\n\t\tconsole.log('SUCCES');\n\t\t},\n\t\terror: function(){\n\t\tconsole.log('ERROR');\n\t\t}\n\t\t});\n\t}\n\telse {\n\t\tlevel = level * 1;\n\t\t//console.log(OpenDicht,level);\n\t\tif (OpenDicht == \"plus\")\n\t\t\t{\n\t\t\tvar d = ((level + 10)/100 * 16) + 0.5;\n\t\t\t//console.log(\"in plus\",d,level);\n\t\t\tif(d > 16) {\n\t\t\t\td = 16;\n\t\t\t}\n\t\t\t$.ajax({\n\t\t\turl: $.domoticzurl+\"/json.htm?type=command&param=switchlight&idx=\" + idx + \"&switchcmd=Set Level&level=\" + d,\n\t\t\tasync: false,\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(){\n\t\t\tconsole.log('SUCCES');\n\t\t\t},\n\t\t\terror: function(){\n\t\t\tconsole.log('ERROR');\n\t\t\t}\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tvar d = ((level-0.1 )/100*16) ;\n\t\t\t//console.log(\"in min\",d,level);\n\t\t\tif( d < 0 ){\n\t\t\t\td = 0;\n\t\t\t}\n\t\t\t$.ajax({\n\t\t\turl: $.domoticzurl+\"/json.htm?type=command&param=switchlight&idx=\" + idx + \"&switchcmd=Set Level&level=\" + d,\n\t\t\tasync: false,\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(){\n\t\t\tconsole.log('SUCCES');\n\t\t\t},\n\t\t\terror: function(){\n\t\t\tconsole.log('ERROR');\n\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tRefreshData();\n\t}", "title": "" }, { "docid": "f4bc21fb412ae65513140bea78aa7173", "score": "0.5800545", "text": "function criticalBattery(params)\n {\n Ext.Msg.alert('Warning', 'Your battery reached critical level <br/>'+\n 'current battery status:'+params.level+'% <br/>'+\n 'and '+(params.isPlugged ? 'plugged to source' : 'even not plugged'));\n }", "title": "" }, { "docid": "1fb7e499b2beee720b3da4ada11bb918", "score": "0.5757634", "text": "function toggle_power() {\n\theatpump_div = $(this).closest(\".heatpump\")\n\theatpump_id = heatpump_div.attr(\"id\")\n\tcurrent_power = heatpump_div.attr(\"data-power\")\n\tconsole.log (\"current power: \" + current_power)\n\tnew_power = (current_power == \"ON\") ? \"OFF\" : \"ON\"\n\tconsole.log (\"new power: \" + new_power)\n\n\tput_data_for_heatpump({\"power\": new_power}, heatpump_id)\n}", "title": "" }, { "docid": "55ce548093779469a2eb7a392a008eee", "score": "0.57492733", "text": "function applyLevel(){\n\tMonsterHealth = (Math.pow(2 * UserLevel, 2)) * 5;\n\tconsole.log(\"User Level: \" + UserLevel + \"|\" + \"Monster Health: \" + MonsterHealth);\n}", "title": "" }, { "docid": "9a4a93a7100b970d3c8ab756fd01452b", "score": "0.5696653", "text": "function YLed_get_power()\n { var json_val = this._getAttr('power');\n return (json_val == null ? Y_POWER_INVALID : parseInt(json_val));\n }", "title": "" }, { "docid": "35d22ed0ed0557d8181c067cd05990c2", "score": "0.5693141", "text": "update() {\n this.updateHealthBar();\n this.pauseMusic();\n this.checkWinCondition();\n \n }", "title": "" }, { "docid": "42c6071f48f557e77c38602a86161c7b", "score": "0.5680655", "text": "setBrightness(level, callback) {\n this.log(`LIGHT: ${this.device.name} setBrightness(${level})`);\n this.scheduleCharacteristicUpdate(callback, doneCallback => {\n if (level != this.device.getCurrentLightDimState()) {\n if (level == 0) {\n this.log(\"LIGHT: \" + this.device.name + \" Brightness set to 0, sending off command\");\n this.pendingPowerState = false;\n this.device.sendLightCommand(false, () => {\n this.pendingPowerState = undefined;\n doneCallback();\n });\n }\n else {\n this.log(\"LIGHT: \" + this.device.name + \" Changing Brightness to \" + level);\n this.device.sendLightDimCommand(level, () => {\n this.log(\"LIGHT: \" + this.device.name + \" Done changing brightness to \" + level);\n doneCallback();\n });\n }\n }\n else {\n doneCallback();\n }\n });\n }", "title": "" }, { "docid": "4a754a2b6410a110c1b240bf545e5b39", "score": "0.5657188", "text": "function saveBatteryLevel(rsender, payload) {\n\n var battLevel = {\n battLevels: {\n timestamp: new Date().getTime(),\n value: payload\n }\n }\n\n SensorNode.findOneAndUpdate({\n \"id\": rsender\n }, {\n $set: {\n \"currentBattValue\": payload\n }\n })\n .exec()\n .then(() => {\n\n SensorNode.findOne({\n \"id\": rsender\n })\n .select('id battLevels')\n .exec()\n .then((battLevels) => {\n\n var values = battLevels.battLevels.sort(function(a, b){return a.timestamp - b.timestamp});\n var valuesLength = values.length;\n\n var lastValueArray = valuesLength - 1;\n lastValue = moment(values[lastValueArray].timestamp).format();\n\n var nowMinusTen = moment(new Date().getTime()).subtract(10, 'minutes').format();\n\n if (valuesLength == 0 || lastValue < nowMinusTen) {\n\n SensorNode.findOneAndUpdate({\n\n \"id\": rsender,\n\n }, {\n\n \"$push\": {\n\n \"battLevels\": {\n\n \"$each\": [battLevel],\n \"$sort\": {timestamp: 1},\n \"$slice\": -50\n\n }\n\n }\n\n })\n .exec()\n .then(() => {\n\n }, (e) => {\n\n var today = new Date();\n var time = moment(today).format('h:mm:ss a');\n var date = moment(today).format('MMMM Do YYYY');\n\n fs.appendFileSync('app.log', date + \" \" + time + \" \");\n\n fs.appendFileSync('app.log', \"Unable to update battery values\" + \"\\n\" + e + \"\\n\");\n\n });\n\n }\n\n }, (e) => {\n\n var today = new Date();\n var time = moment(today).format('h:mm:ss a');\n var date = moment(today).format('MMMM Do YYYY');\n\n fs.appendFileSync('app.log', date + \" \" + time + \" \");\n\n fs.appendFileSync('app.log', \"Unable to update battery values\" + \"\\n\" + e + \"\\n\");\n\n });\n\n }, (e) => {\n\n var today = new Date();\n var time = moment(today).format('h:mm:ss a');\n var date = moment(today).format('MMMM Do YYYY');\n\n fs.appendFileSync('app.log', date + \" \" + time + \" \");\n\n fs.appendFileSync('app.log', \"Unable to update battery values\" + \"\\n\" + e + \"\\n\");\n\n });\n\n}", "title": "" }, { "docid": "5e2f4a0d128e03a1e541782acae2e354", "score": "0.56471246", "text": "upgrade () {\n if ( this.level == 1 && this.ship.credit > 100 ) {\n this.ship.credit -= 100;\n this.level = 2;\n this.ScanCP = 5;\n }\n else {\n addMessage( \"Can't upgrade sensor, check your sensor's lv or your credit\" );\n }\n }", "title": "" }, { "docid": "e6773160f3d3be1cd465932d206146cd", "score": "0.56467694", "text": "setPower(power) {\n\t\tvar p = parseInt(Math.max(0, power), 10);\n\t\tif (p != this.power) {\n\t\t\tthis.power = p;\n\t\t\tthis.writePower = true;\n\t\t}\n\t}", "title": "" }, { "docid": "cf2087017a8e804e2f5648de85724904", "score": "0.5635378", "text": "set_power(newval) {\n this.liveFunc.set_power(newval);\n return this._yapi.SUCCESS;\n }", "title": "" }, { "docid": "0deea0ab8f463d1ae131b93bd8eed0ee", "score": "0.56316024", "text": "function batteryCheck(val){\n\tbatteryBIP(val,panel);\n\tif (val == 2) errorBIP(1,panel);\n\tif (val == 1) warnBIP(1,panel);\n}", "title": "" }, { "docid": "3ff4971a54f098816688b1fbf9152a65", "score": "0.56282467", "text": "set powerRange(value){\n if(value > 100 ) throw new Error(\"value must be less than 100\")\n this._powerRange = value;\n }", "title": "" }, { "docid": "a18d1360a4b01599b68369517b79f1a0", "score": "0.5621853", "text": "function updatePowerMsg(sourceDeviceId, targetDeviceId, power){\n devices[targetDeviceId].links[sourceDeviceId].state.power = power;\n refreshLink(sourceDeviceId, targetDeviceId);\n}", "title": "" }, { "docid": "8aec109ba610bb9a2f57d6b5eba7c968", "score": "0.56179565", "text": "function calculatePowerCost() {\n var curLv = parseInt($(\"#curLvP\").val());\n var rawCost = $(\"#curCostP\").val();\n var rawVal = $(\"#curPow\").val();\n var toLv = parseInt($(\"#toLvP\").val());\n var totalCost = 0;\n var finalPower = 0;\n\n var costReg = rawCost.match(/[a-zA-Z]+|[0-9]+(?:\\.[0-9]+|)/g);\n var valReg = rawVal.match(/[a-zA-Z]+|[0-9]+(?:\\.[0-9]+|)/g);\n \n var curCost = parseFloat(costReg[0]);\n var curVal = parseFloat(valReg[0]);\n\n // constrain poison to max power level\n if (CURRENT_BALL_INDEX == 3) {\n if (toLv > 119) {\n toLv = 119;\n $(\"#toLvP\").val(119);\n }\n }\n // Calculate running cost of upgrading power and the new power value\n var lvDiff = toLv - curLv;\n if (lvDiff > 0) {\n\n // Get ball base power\n var basePower = allBalls[CURRENT_BALL_INDEX].stats[RADIO_INDEX][1];\n var baseIncrease;\n\n // Check if selected ball is Poison or Cash\n if (CURRENT_BALL_INDEX == 3 || CURRENT_BALL_INDEX == 7) {\n baseIncrease = 0.4333;\n increaseMulti = 1 / 1.02;\n } else {\n baseIncrease = basePower * 1.02;\n increaseMulti = 1.02;\n }\n\n // Adjust base power value for levels\n for (var i = 0; i < curLv; i++) {\n basePower += (baseIncrease);\n baseIncrease *= increaseMulti;\n }\n \n // Calculate total power multiplier\n var powMulti = curVal / basePower;\n\n // Calculate effect of leveling\n for (var j = 0; j < lvDiff; j++) {\n // Calculate new base power\n basePower += (baseIncrease);\n baseIncrease *= increaseMulti;\n\n // Calculate new total cost\n totalCost += curCost;\n curCost *= 1.9;\n }\n\n finalPower = (powMulti * basePower).toFixed(2);\n } else {\n finalPower = curVal;\n }\n\n // apply purchased prestige boosts\n if (PERF_PRES_1) { \n finalPower *= 5; \n console.log(\"pres 1\");\n }\n if (PERF_PRES_2) { \n finalPower *= 5; \n console.log(\"pres 2\");\n }\n\n finalPower = convertNumberLetter(finalPower, valReg[1]);\n totalCost = convertNumberLetter(totalCost, costReg[1]);\n\n $(\"#newPow\").text(finalPower);\n $(\"#powCost\").text(totalCost); \n }", "title": "" }, { "docid": "0d8ed2885b72800c45998bab28400532", "score": "0.5609735", "text": "updateEnergy(percent) {\n window.$(this.energyBar).progress({\n percent\n })\n }", "title": "" }, { "docid": "6a5a3696a57cc00011e74d91897c765f", "score": "0.5588242", "text": "setPowerMultiplier(min, max, interval){\n let my = this.__private__;\n if(my.attack.state)\n {\n if(my.attack.power >= max) // Check if maximum multiplier is reached\n my.attack.counterIncrease = false; // Reverse value\n else if(my.attack.power <= min) // Check if minimum multiplier is reached\n my.attack.counterIncrease = true; // Reverse value\n\n if(my.attack.counterIncrease) // Increment or decriment accordingly\n my.attack.power += interval;\n else\n my.attack.power -= interval;\n // Set cursor power multiplier visual\n $(\".cursor-target-power\").css(\"clip-path\",`inset(${50-(50*my.attack.power/max)}px 0px 0px 0px)`); \n }\n else\n $(\".cursor-target-power\").css(\"clip-path\",`inset(50px 0px 0px 0px)`); // Reset cursor power multiplier visual\n }", "title": "" }, { "docid": "6d35aafa19d159cd8d61e52208edf777", "score": "0.5582763", "text": "function stop_power_up_att () {\n rate_of_fire = 40\n }", "title": "" }, { "docid": "0487e0e9bed948cfeb49899da62d9d63", "score": "0.5544449", "text": "control_decreasePow(){\n\t\tthis.fireAdj = true;\n\t\tvar power = 18;\n\t\tvar f = (this.firePow * 1.97 + power * 0.03) / 2;\n\t\tthis.firePow -= Math.max(f - this.firePow, 0.1);\n\t\tif(this.firePow <= 0)\n\t\t\tthis.firePow = 0.00001;\n\t}", "title": "" }, { "docid": "5b7cdd504126f51248a4f05e5015dfc4", "score": "0.5540386", "text": "function powerTrackUpdate() {\r\n powerTrackMax = parseInt(html.find('#engines')[0].value);\r\n if (html.find('[data-talent-name=\"Secondary Reactors\"]').length > 0) {\r\n powerTrackMax += 5;\r\n }\r\n // This checks that the max-power hidden field is equal to the calculated Max Power value, if not it makes it so.\r\n if (html.find('#max-power')[0].value != powerTrackMax) {\r\n html.find('#max-power')[0].value = powerTrackMax;\r\n }\r\n html.find('#bar-power-renderer').empty();\r\n for (i = 1; i <= powerTrackMax; i++) {\r\n const div = document.createElement('DIV');\r\n div.className = 'box';\r\n div.id = 'power-' + i;\r\n div.innerHTML = i;\r\n div.style = 'width: calc(100% / ' + html.find('#max-power')[0].value + ');';\r\n html.find('#bar-power-renderer')[0].appendChild(div);\r\n }\r\n }", "title": "" }, { "docid": "4838f94fb983b3a75b826a77517906de", "score": "0.55361736", "text": "function update_energy(){\n\thero.energy--;\n\tdocument.getElementById(\"energy\").value = get_energy();\n}", "title": "" }, { "docid": "70cd065eab1526e893aecd45a310b912", "score": "0.55350363", "text": "function battery(battery) {\n var bat = '';\n\n if(battery.load == -1)\n return '<small>[AC]</small>';\n\n if(batpic[battery.status] != undefined)\n bat = batpic[battery.status] + ' ';\n\n var pc = battery.load;\n if(battery.load < 0 || battery.load > 100)\n pc = 100;\n\n return bat + percent(pc);\n}", "title": "" }, { "docid": "21d44e5607826da2e4f5150c0a6853df", "score": "0.5522639", "text": "alterMaxWounds(valueIn) {\n this.maxWounds += valueIn;\n if(this.aliveBool) {\n this.restoreWounds(valueIn); //Also changes current vigor+wounds by the same amount... if they are alive.\n }\n $(`#statLevelerTitle${this.name}`).text(`${this.name}, Level ${this.currentLevel} ${this.className} - ${this.unusedSkillPoints} Skill Points to Spend`);\n $(`#woundUpgradeBlock${this.name}`).children().eq(1).text(`${this.maxWounds} -> ${this.maxWounds+12}`);\n this.attachedPlayerGroup.updateMapHealthBlocks();\n this.currentBattlefield.updateHealthValues();\n }", "title": "" }, { "docid": "8fadaf52292aaad0594ce66b369e2f06", "score": "0.552043", "text": "function setBrightness(percent){\n if(tools.isPi()){\n // value of 0 - 255. Don't lower below 10\n // map percent to byte value.\n const backlightValue = tools.map(percent,0,100,10,255).toFixed(0);\n exec(`echo ${backlightValue} > /sys/class/backlight/rpi_backlight/brightness`, (err, stdout, stderr) => {\n // ignore\n });\n }\n}", "title": "" }, { "docid": "600781c6185bb4fb15f63b3c263e34a5", "score": "0.5500432", "text": "function batteryLife(battery) {\n batteryNumberElement.textContent = batteryPercent(battery)+\"%\"\n batteryProgressElement.style.width = batteryPercent(battery)+\"%\"\n}", "title": "" }, { "docid": "9be58e7565abe8ff648828d1595fa672", "score": "0.5493082", "text": "addPower() {\n eval(this.item.power);\n }", "title": "" }, { "docid": "d59cc503fa8fe23c47d71608f0772251", "score": "0.5473958", "text": "[USE_POWER_UP]() {\n this.powerUps.forEach((p, i, a) => {\n const updated = p;\n const next = a[i + 1];\n\n if (next !== undefined && next.type !== null) {\n updated.node.classList.replace(`power-up${updated.type}`, `power-up${next.type}`);\n updated.type = next.type;\n } else {\n updated.node.classList.remove(`power-up${updated.type}`);\n updated.type = null;\n }\n });\n }", "title": "" }, { "docid": "fd0093fa597a229cffebf69daaa9225b", "score": "0.5450662", "text": "function updatePlayerLevel() {\n playerLvl = (Math.floor(playerXP / playerXPperLevel)) + 1;\n if (playerLvl >= 20 && schonGewonnen == false) {\n alert(\"Du hasch gwonna' !\");\n schonGewonnen = true;\n }\n document.getElementById(\"xpCounter\").innerHTML = \"Player-Level: \" + playerLvl + \" (XP: \" + playerXP + \" / \" + playerXPperLevel * (playerLvl) + \")\"; // Baue den String für die Spieler-Info zusammen //////////////////////////zeigt jetzt nicht mehr an, wieviel XP benötigt werden für einen Level aufstieg, sondern, bei wieviel XP der Level erreicht wird\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n document.getElementById(\"items\").innerHTML = \"\" + getItemsAsString();\n console.log(\"Spieler \" + playerName + \" hat nun Level \" + playerLvl); // Spieler-Level in der Konsole.\n }", "title": "" }, { "docid": "67fdb3b6c00cff30a2d500046f56b401", "score": "0.5439709", "text": "function updateFuelGaugeDisplay()\r\n{\r\n\t$('.fuelGauge').each(function() {\r\n\t\tvar level = $(this).data('level');\r\n\r\n\t\t// Remove all existing levels\r\n\t\t$(this).removeClass(function(index, css) {\r\n\t\t\treturn (css.match (/\\blevel[0-9]+/g) || []).join(' ');\r\n\t\t});\r\n\t\t\r\n\t\tif(level > 0)\r\n\t\t{\r\n\t\t\t$(this).addClass('level' + Math.round(level / VIRTUAL_MECHANIC.FUEL_GAUGE_LEVELS))\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "9309f030eb4329c26bd0600d08a5ec16", "score": "0.5429854", "text": "updateVolume() {\n if (!this.supported.ui) {\n return;\n }\n\n // Update range\n if (is.element(this.elements.inputs.volume)) {\n controls.setRange.call(this, this.elements.inputs.volume, this.muted ? 0 : this.volume);\n }\n\n // Update mute state\n if (is.element(this.elements.buttons.mute)) {\n this.elements.buttons.mute.pressed = this.muted || this.volume === 0;\n }\n }", "title": "" }, { "docid": "1db9449fa59c32d67fec1c0ebb290f43", "score": "0.5421792", "text": "static adjustPower (power, wind) {\n return (power * Ballistics.powerMultiplier) + (wind * Ballistics.windMultiplier)\n }", "title": "" }, { "docid": "f10326b971bf6f0a12c6401035cbbfdf", "score": "0.5419963", "text": "function toggle_power_if_ready() {\n\tif (config.emulate.bmbt !== true) return;\n\n\t// Only setTimeout if we don't already have one waiting\n\tif (BMBT.timeout.power_on !== null) return;\n\n\tBMBT.timeout.power_on = setTimeout(() => {\n\t\t// Debug logging\n\t\t// log.module('dsp.ready: ' + status.dsp.ready);\n\t\t// log.module('rad.source_name: ' + status.rad.source_name);\n\n\t\tBMBT.timeout.power_on = null;\n\n\t\tif (status.rad.source_name !== 'off' || status.vehicle.ignition_level === 0) return;\n\n\t\tkodi.notify(module_name, 'power [' + module_name + ']');\n\t\tIKE.text_override(module_name + ' power [' + module_name + ']');\n\n\t\tlog.module('Sending power!');\n\n\t\tbutton('power');\n\t\t// DSP.request('memory'); // Get the DSP memory\n\n\t\tstatus_loop(true);\n\n\t\t// Increase volume after power on\n\t\tif (config.bmbt.vol_at_poweron === true) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tfor (let i = 0; i < 2; i++) RAD.volume_control(5);\n\t\t\t}, 500);\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tfor (let i = 0; i < 2; i++) RAD.volume_control(5);\n\t\t\t}, 750);\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tfor (let i = 0; i < 2; i++) RAD.volume_control(5);\n\t\t\t}, 1000);\n\t\t}\n\t}, 1000);\n}", "title": "" }, { "docid": "80fd46adcc6182573b392f4a6cc0b010", "score": "0.5417522", "text": "update() {\r\n\t\t// Update state of every light\r\n\t\tlet i = 0;\r\n\t\tfor (const key in this.lightValues) {\r\n\t\t\tif (this.lightValues.hasOwnProperty(key)) {\r\n\t\t\t\tif (this.lightValues[key]) {\r\n\t\t\t\t\tthis.lights[i].setVisible(true);\r\n\t\t\t\t\tthis.lights[i].enable();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.lights[i].setVisible(false);\r\n\t\t\t\t\tthis.lights[i].disable();\r\n\t\t\t\t}\r\n\t\t\t\tthis.lights[i].update();\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "be5dfdac453ea1eaa05d6b4e52984e91", "score": "0.54163927", "text": "batteryFill(event) {\n if (frienDroid.round === 1) {\n frienDroid.battery += 50;\n if (frienDroid.battery > 100) {\n frienDroid.battery = 100;\n } \n $('#battery').text(`Battery: ${frienDroid.battery}%`);\n frienDroid.buttonDisable();\n } else if (frienDroid.round === 2) {\n frienDroid.battery += 40;\n if (frienDroid.battery > 100) {\n frienDroid.battery = 100;\n } \n $('#battery').text(`Battery: ${frienDroid.battery}%`);\n frienDroid.buttonDisable();\n } else {\n frienDroid.battery += 35;\n if (frienDroid.battery > 100) {\n frienDroid.battery = 100;\n } \n $('#battery').text(`Battery: ${frienDroid.battery}%`);\n frienDroid.buttonDisable();\n }\n }", "title": "" }, { "docid": "64cbc639b592da8cc221f3338572b6e4", "score": "0.54122865", "text": "function getBatteryState() {\n navigator.getBattery().then(function(battery) {\n var batteryLevel = Math.floor(battery.level * 100);\n var batteryFill = document.getElementById(\"battery-fill\");\n var batteryText = document.getElementById(\"battery-text\");\n\n batteryFill.style.width = batteryLevel + \"%\";\n batteryText.innerText = batteryLevel + \"%\";\n\n if (batteryLevel <= 17) {\n batteryText.classList.add('bc-danger');\n } else {\n batteryText.classList.remove('bc-danger');\n }\n\n if (battery.charging) {\n // @TODO show lightning icon\n } else {\n // @TODO hidelightning icon\n }\n });\n }", "title": "" }, { "docid": "f87b89b20b42563b2a9c95f6cb8cf56f", "score": "0.54050064", "text": "function updatePowerUps() {\n // draw new one every 50*drawInterval ms\n if (timer%50 == 0 && timer%27 > 4 && timer%27 < 23) {\n var index = Math.floor(Math.random()*(allPowers.length*2));\n if (index>=allPowers.length){\n index = 0;\n }\n var x = chooseLane();\n powerUps.push(new Obs(allPowers[index], 0, x, -obstacleHeight, powerUpWidth, powerUpWidth));\n \n // track data\n if (trackDataFlag){\n gameData.powersData.numPowersSpawned++;\n if (powerUps[powerUps.length-1].name == \"gas\") {\n gameData.powersData.numGasPowersSpawned++;\n }\n else if (powerUps[powerUps.length-1].name == \"invincible\") {\n gameData.powersData.numBoostPowersSpawned++;\n }\n else if (powerUps[powerUps.length-1].name == \"crossout\") {\n gameData.powersData.numCrossoutPowersSpawned++;\n }\n else if (powerUps[powerUps.length-1].name == \"timeplus\") {\n gameData.powersData.numTimePowersSpawned++;\n }\n }\n\n }\n // update existing ones\n for(var i = 0; i < powerUps.length; i++) {\n powerUps[i].update(carX, carY); // update location\n // detect collision\n if (powerUps[i].eaten) {\n if (eatenPowerFlag === false){eatenPowerFlag = true};\n if (trackDataFlag){\n gameData.powersData.numPowersEaten++;\n }\n // when eating gas powerup, play sound and show question\n if (powerUps[i].name == \"gas\") {\n if (trackDataFlag){\n gameData.powersData.numGasPowersEaten++;\n }\n if (soundOn){\n questionSfx.play();\n }\n questionFlag = true;\n }\n // when eating boost powerup\n else if (powerUps[i].name == \"invincible\" && invincibleFlag == false) {\n if (trackDataFlag){\n gameData.powersData.numBoostPowersEaten++;\n }\n if (soundOn){ // play sound\n boostSfx.play();\n }\n invincibleFlag = true; // set flag\n objectSpeed = 40; // change speed of objects on road\n storedPowers[2].increment(); // add to active power\n obsCarTransparency = 0.2;\n setTimeout(function() { // set duration\n objectSpeed = 20;\n flameTransparency = 0.7;\n obsCarTransparency = 0.4;\n }, invincibleDuration-1000);\n setTimeout(function() { // set duration\n objectSpeed = 15;\n flameTransparency = 0.4;\n obsCarTransparency = 0.7;\n }, invincibleDuration-500);\n setTimeout(function() { // set duration\n objectSpeed = 10;\n storedPowers[2].decrement();\n invincibleFlag = false;\n flameTransparency = 1;\n obsCarTransparency = 1;\n }, invincibleDuration);\n }\n // other powerups\n else {\n if (soundOn){ //play sound\n powerupSfx.play();\n }\n if (powerUps[i].name == \"crossout\") {\n if (trackDataFlag){\n gameData.powersData.numCrossoutPowersEaten++;\n }\n storedPowers[0].increment();\n }\n if (powerUps[i].name == \"timeplus\") {\n if (trackDataFlag){\n gameData.powersData.numTimePowersEaten++;\n }\n storedPowers[1].increment();\n }\n }\n powerUps.splice(i, 1);\n }\n // remove powerups off screen\n else if(powerUps[i].y >= height) {\n powerUps.splice(i,1);\n\n // track how many powers user misses before eating one\n if (trackDataFlag){\n if (eatenPowerFlag === false){\n gameData.powersData.numPowersMissedInitially++;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "5b266f0890f1dba04c322b19ad3436f5", "score": "0.5380156", "text": "function increaseHealth() {\n if (player.health < playerHealth) {//making sure they can only use this power when they have less than full health\n player.health += 1;//adding 1 to the player's health\n powerTimer = 0;//reseting power regeration bar time\n document.getElementById(\"powerBar\").style.backgroundColor = \"red\";//changing power bar color back to red\n\n\n }\n}", "title": "" }, { "docid": "35a0e1425e8d157adeb05ba3208847ea", "score": "0.53788704", "text": "function livePower() {\n\tvar url = tsPowerURL + \"feeds/last.json?callback=?\";\n\tvar params = {\n\t\toffset: getTimezoneOffset(new Date()),\n\t\tkey: tsPowerKey,\n\t};\n\t$.getJSON(url, params, function(data) {\n\t\tif (data.field1) {\n\t\t\t$(\"#total-power\").html(data.field1);\n\t\t\tvar peak = parseInt(data.field2, 10);\n\t\t\tvar offpeak = parseInt(data.field3, 10);\n\t\t\tupdatePowerPopover(peak, offpeak);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "ddaa4232cba5a15f2c37af1aa4ac5207", "score": "0.5376761", "text": "function updateEnergy() {\n\t// Update the page headings, etc\n\tupdateEnergyInfo();\n\n\tvar stamp = dateStamp(energyPrefs.start, energyPrefs.end);\n\tvar fieldID = energyPrefs.field.id;\n\n\t// Use cached energy data, if it exists\n\tif (typeof(energyHist[fieldID][stamp]) !== 'undefined') {\n\t\tvar energy = energyHist[fieldID][stamp];\n\t\t$(\"#energy\").html(energy);\n\t\treturn;\n\t}\n\n\t// Use cached power data if it exists\n\tif (typeof(powerHist[fieldID][stamp]) !== 'undefined') {\n\t\tvar energy = calcEnergy(powerHist[fieldID][stamp]);\n\t\tenergy = Math.round(energy * 100) / 100;\n\t\tenergyHist[fieldID][stamp] = energy;\n\t\t$(\"#energy\").html(energy);\n\t\treturn;\n\t}\n\n\t// Otherwise, download power data and calculate\n\tvar download = getData(energyPrefs.start, energyPrefs.end, energyPrefs.field);\n\t$.when(download.handler).done(function() {\n\t\t// Cache raw power data for future use\n\t\tpowerHist[fieldID][stamp] = download.data;\n\n\t\tvar energy = calcEnergy(download.data);\n\t\tenergy = Math.round(energy * 100) / 100;\n\t\tenergyHist[fieldID][stamp] = energy;\n\t\t$(\"#energy\").html(energy);\n\t});\n}", "title": "" }, { "docid": "0724c9d24a5461e9fa7837e3cb789d85", "score": "0.5371865", "text": "function updatePowerEffects() {\r\n\tif (buildings[3].count > 0) {\r\n\t\tvar percentage = Math.log(minigames[3].vars.power / minigames[3].vars.max_power * 2 + 1);\r\n\t\t$(\"#buildingpower_plant\").children().first().css(\"filter\", \"drop-shadow(0px 0px \" + percentage * 2 + \"px #53f9ff)\");\r\n\t}\r\n}", "title": "" }, { "docid": "b0a814c0b07951dd8dc7b1aba9631c0d", "score": "0.53717804", "text": "togglePower() {\n\t\tthis.power(!this.data.on);\n\t}", "title": "" }, { "docid": "312b617339af17fe30c314c2481900c2", "score": "0.53688926", "text": "function callReduceBattery()\n{\n\tif (reduceBatteryNow == true)\n\t{\n\t\tInvokeRepeating(\"reduceBattery\", 1, 1);\n\t\tcallItOnce = true;\n\t}\n}", "title": "" }, { "docid": "8329f365c3708a586fe82f02865543ac", "score": "0.5360067", "text": "function _updateVolume() {\n // Get the current volume\n var volume = plyr.media.muted ? 0 : plyr.media.volume * config.volumeMax;\n\n // Update the <input type=\"range\"> if present\n if (plyr.supported.full) {\n if (plyr.volume.input) {\n plyr.volume.input.value = volume;\n }\n if (plyr.volume.display) {\n plyr.volume.display.value = volume;\n }\n }\n\n // Update the volume in storage\n _updateStorage({ volume: volume });\n\n // Toggle class if muted\n _toggleClass(plyr.container, config.classes.muted, volume === 0);\n\n // Update checkbox for mute state\n if (plyr.supported.full && plyr.buttons.mute) {\n _toggleState(plyr.buttons.mute, volume === 0);\n }\n }", "title": "" }, { "docid": "bde4bf70bd7061ff95186bcb0df55368", "score": "0.53483826", "text": "function batteryPercent(battery) {\n return battery / 3.7 * 100\n}", "title": "" }, { "docid": "0fa5fc1586fca1350cfe49b5a7408286", "score": "0.5325346", "text": "function updateEnergyBar(){\n\t\t// Update Progress Bar\n\t\tprogress.graphics.clear();\n\t\tif(energy/MAX_ENERGY < 0.15) {\n \t\tprogress.graphics.beginFill(\"#F9997c\").drawRect(stage.canvas.width/2 - 150,stage.canvas.height-20,400*energy/MAX_ENERGY,20);\n\t\t} else {\n\t\t\tif(energy/MAX_ENERGY <= 0.33) {\n\t\t\t\tprogress.graphics.beginFill(\"#ffec6c\").drawRect(stage.canvas.width/2 - 150,stage.canvas.height-20,400*energy/MAX_ENERGY,20);\n\t\t} else {\n\t\t\tprogress.graphics.beginFill(\"#3c855c\").drawRect(stage.canvas.width/2 - 150,stage.canvas.height-20,400*energy/MAX_ENERGY,20);\n\t\t}\n\t}\n\n\t}", "title": "" }, { "docid": "6c3f082e33bcb63c80aa4f9cd1a9ec56", "score": "0.5318296", "text": "get battery_charging_full () {\n return new IconData(0xe1a3,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "6c3f082e33bcb63c80aa4f9cd1a9ec56", "score": "0.5318296", "text": "get battery_charging_full () {\n return new IconData(0xe1a3,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "dc79dc0a977dd30a24763fb06fd8966c", "score": "0.53182", "text": "function togglePower() {\n if (gs.getState() == gs.powerOff) {\n gs.setState(gs.powerOn);\n reset();\n } else {\n gs.setState(gs.powerOff);\n strict = false;\n }\n }", "title": "" }, { "docid": "069740c95c00b9fd5ad1c980363c0415", "score": "0.53156877", "text": "function UpdateLevelFeatures(Typeswitch, raceLvl) {\n\tif (!IsNotReset) return; //stop this function on a reset\n\t\n\tthermoM(\"start\"); //start a progress dialog\n\tthermoM(\"Updating level-dependent features...\"); //change the progress \n\t\n\tvar tempThing = \"\";\n\tTypeswitch = Typeswitch === undefined ? \"all\" : Typeswitch;\n\tvar isWildShape = false;\n\n\tvar oldRaceLvl = Number(CurrentRace.level);\n\tvar newRaceLvl = raceLvl !== undefined ? raceLvl : What(\"Character Level\");\n\n\t//check if race level went up (RaceLevelUp[0] = true) down (RaceLevelUp[0] = false), or nothing has changed (RaceLevelUp[0] = \"stop\"); RaceLevelUp[1] = lowest lvl, RaceLevelUp[2] = highest lvl\n\tvar RaceLevelUp = [true, oldRaceLvl, newRaceLvl];\n\tif (oldRaceLvl > newRaceLvl) {\n\t\tRaceLevelUp = [false, newRaceLvl, oldRaceLvl];\n\t} else if (newRaceLvl === oldRaceLvl) {\n\t\tRaceLevelUp = [\"stop\", 0, 0];\n\t}\n\n\t//update racial level-dependent features\n\tif ((Typeswitch === \"all\" || Typeswitch === \"race\") && RaceLevelUp[0] !== \"stop\" && CurrentRace.known) {\n\t\tdelete UpdateSpellSheets.race;\n\t\tif (CurrentRace.features) {\n\t\t\tfor (var key in CurrentRace.features) {\n\t\t\t\t// now we know whether to add or remove features\n\t\t\t\tvar keyFea = CurrentRace.features[key];\n\t\t\t\tthermoM(\"Updating \" + CurrentRace.name + \"'s \" + keyFea.name + \"...\"); //change the progress dialog text\n\t\t\t\t\n\t\t\t\t//make a check to see if level-dependent features should be dealt with\n\t\t\t\tvar checkLVL = keyFea.minlevel <= RaceLevelUp[2] && keyFea.minlevel > RaceLevelUp[1];\n\t\t\t\t\n\t\t\t\t//see if we are going to add or remove a feature\n\t\t\t\tvar AddRemove = keyFea.minlevel <= newRaceLvl ? \"Add\" : \"Remove\"\n\n\t\t\t\t// --- add or remove Limited Features --- //\n\t\t\t\t\n\t\t\t\t// get all the attributes of this feature\n\t\t\t\tvar Fea = ReturnClassFeatures(\"race\", key, newRaceLvl, false, oldRaceLvl, false);\n\t\t\t\t\n\t\t\t\t//see if we need to force updating the limited feature section\n\t\t\t\tvar GoAnyway = newRaceLvl > 0 && keyFea.minlevel <= oldRaceLvl && (Fea.Add !== Fea.AddOld || Fea.Use !== Fea.UseOld || Fea.UseCalc !== Fea.UseCalcOld || Fea.Recov !== Fea.RecovOld);\n\t\t\t\tvar FeaTooltip = CurrentRace.name + (keyFea.tooltip ? keyFea.tooltip : \"\");\n\t\t\t\t\t\n\t\t\t\t//remove the limited feature if it should be removed because of downgrading the level --or-- the old feature was defined, but the new isn't --or-- if the old has a different name than the new --or-- if the new amount of usages is unlimited\n\t\t\t\tif (((Fea.UseOld || Fea.UseCalcOld) && keyFea.minlevel > newRaceLvl && keyFea.minlevel <= oldRaceLvl) || (((!Fea.Use && !Fea.UseCalc) || (Fea.Recov !== Fea.RecovOld)) && (Fea.UseOld || Fea.UseCalcOld)) || (/unlimited|\\u221E/i).test(Fea.Use)) {\n\t\t\t\t\tRemoveFeature(Fea.UseName, newRaceLvl === 0 ? \"\" : Fea.UseOld, \"\", \"\", \"\", \"\", Fea.UseCalcOld);\n\t\t\t\t\tFea.UseOld = 0;\n\t\t\t\t};\n\t\t\t\t// now add the limited feature depending on the changes of the level or changes of something else or if it is being forced, as long as the usages have been defined\n\t\t\t\tif ((Fea.UseCalc || Fea.Use) && !(/unlimited|\\u221E/i).test(Fea.Use) && (GoAnyway || (keyFea.minlevel <= newRaceLvl && keyFea.minlevel > oldRaceLvl))) {\n\t\t\t\t\tAddFeature(Fea.UseName, Fea.Use, Fea.Add ? \" (\" + Fea.Add + \")\" : \"\", Fea.Recov, FeaTooltip, Fea.UseOld, Fea.UseCalc);\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tthermoM(1/2); //increment the progress dialog's progress\n\n\t\t\t\t// --- add or remove action, if defined --- //\n\t\t\t\tif (keyFea.action && checkLVL) {\n\t\t\t\t\ttDoc[AddRemove + \"Action\"](keyFea.action[0], keyFea.name + keyFea.action[1], \"being a \" + CurrentRace.name);\n\t\t\t\t}\n\n\t\t\t\t// --- add or remove something via custom script, if defined --- //\n\t\t\t\tif (AddRemove === \"Add\" && keyFea.eval && checkLVL) {\n\t\t\t\t\teval(keyFea.eval);\n\t\t\t\t} else if (AddRemove === \"Remove\" && keyFea.removeeval && checkLVL) {\n\t\t\t\t\teval(keyFea.removeeval);\n\t\t\t\t}\n\n\t\t\t\t// --- add or remove bonus spells in the CurrentSpells variable, if defined --- //\n\t\t\t\tvar raceSpellBonus = !checkLVL ? false : (keyFea.spellcastingBonus ? keyFea.spellcastingBonus : false);\n\t\t\t\tif (raceSpellBonus && keyFea.minlevel <= newRaceLvl) {//if gaining the level\n\t\t\t\t\t//first see if the entry exists or not, and create it if it doesn't\n\t\t\t\t\tif (!CurrentSpells[CurrentRace.known]) {\n\t\t\t\t\t\tCurrentSpells[CurrentRace.known] = {\n\t\t\t\t\t\t\tname : CurrentRace.name,\n\t\t\t\t\t\t\tlevel : newRaceLvl,\n\t\t\t\t\t\t\tability : CurrentRace.spellcastingAbility,\n\t\t\t\t\t\t\ttypeSp : \"race\",\n\t\t\t\t\t\t\tbonus : {}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tCurrentSpells[CurrentRace.known].bonus[key] = raceSpellBonus;\n\t\t\t\t\tUpdateSpellSheets.race = true;\n\t\t\t\t} else if (raceSpellBonus && CurrentSpells[CurrentRace.known] && CurrentSpells[CurrentRace.known].bonus[key]) {//if losing the level and the thing is defined\n\t\t\t\t\tdelete CurrentSpells[CurrentRace.known].bonus[key];\n\t\t\t\t\tif (!CurrentRace.spellcastingBonus) { //the race has no level 1 spell ability, so maybe delete more than just this bonus entry\n\t\t\t\t\t\tvar bonusTest = true;\n\t\t\t\t\t\tfor (var tester in CurrentSpells[CurrentRace.known].bonus) {\n\t\t\t\t\t\t\tbonusTest = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (bonusTest) { //no additional bonus entries were found, so delete the entire CurrentSpells entry\n\t\t\t\t\t\t\tdelete CurrentSpells[CurrentRace.known];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tUpdateSpellSheets.race = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// --- add or remove custom calculations to the CurrentEvals variable --- //\n\t\t\t\tif (checkLVL && keyFea.calcChanges) {\n\t\t\t\t\taddEvals(keyFea.calcChanges, [CurrentRace.name, keyFea.name], keyFea.minlevel <= newRaceLvl);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// --- add or remove damage resistances --- //\n\t\t\t\tif (checkLVL && keyFea.dmgres) {\n\t\t\t\t\tfor (var i = 0; i < CurrentRace.dmgres.length; i++) {\n\t\t\t\t\t\tvar theDmgres = isArray(CurrentRace.dmgres[i]) ? CurrentRace.dmgres[i] : [CurrentRace.dmgres[i], false];\n\t\t\t\t\t\tSetProf(\"resistance\", keyFea.minlevel <= newRaceLvl, theDmgres[0], CurrentRace.name, theDmgres[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// --- add or remove modifiers from fields, if defined --- //\n\t\t\t\tif (checkLVL && keyFea.addMod) {\n\t\t\t\t\tprocessMods(keyFea.minlevel <= newRaceLvl, CurrentRace.name, keyFea.addMod);\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\t//update the racial level\n\t\tCurrentRace.level = newRaceLvl;\n\t\tif (CurrentSpells[CurrentRace.known]) {\n\t\t\tCurrentSpells[CurrentRace.known].level = newRaceLvl;\n\t\t}\n\t}\n\n\tvar oldClassLvl = {};\n\tvar newClassLvl = {};\n\tvar ClassLevelUp = {};\n\t//define level change per class\n\tfor (var aClass in classes.known) {\n\t\toldClassLvl[aClass] = classes.old[aClass] ? classes.old[aClass].classlevel : 0;\n\t\tnewClassLvl[aClass] = classes.known[aClass].level;\n\t\t//check if class level went up (ClassLevelUp[aClass][0] = true) down (ClassLevelUp[aClass][0] = false), or nothing has changed (ClassLevelUp[aClass][0] = \"stop\"); ClassLevelUp[aClass][1] = lowest lvl, ClassLevelUp[aClass][2] = highest lvl\n\t\tClassLevelUp[aClass] = [true, oldClassLvl[aClass], newClassLvl[aClass]];\n\t\tif (oldClassLvl[aClass] > newClassLvl[aClass]) {\n\t\t\tClassLevelUp[aClass] = [false, newClassLvl[aClass], oldClassLvl[aClass]];\n\t\t} else if (newClassLvl[aClass] === oldClassLvl[aClass] && classes.old[aClass] && classes.known[aClass].subclass === classes.old[aClass].subclass) { //only stop if the old and new levels are the same and the subclass hasn't changed\n\t\t\tClassLevelUp[aClass] = [\"stop\", newClassLvl[aClass], newClassLvl[aClass]];\n\t\t}\n\t}\n\t\n\t//make a list of the current wild shapes entered\n\tvar WSinUse = false;\n\tvar prefixA = What(\"Template.extras.WSfront\").split(\",\").slice(1);\n\tfor (var p = 0; p < prefixA.length; p++) {\n\t\tfor (var i = 1; i <= 4; i++) {\n\t\t\tvar theFld = What(prefixA[p] + \"Wildshape.Race.\" + i);\n\t\t\tif (!theFld || theFld.toLowerCase() === \"make a selection\") continue;\n\t\t\tvar theShape = ParseCreature(theFld);\n\t\t\tif (theShape) {\n\t\t\t\tWSinUse = true;\n\t\t\t\ti = 5;\n\t\t\t\tp = prefixA.length;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tvar ClassFeaFld = tDoc.getField(\"Class Features\");\n\t//add or remove proficiencies, features, and others gained from level-dependent class features\n\tif (Typeswitch === \"all\" || Typeswitch === \"class\" || Typeswitch === \"proficiencies\") {\n\t\tclasses.extraskills = [];\n\t\tfor (var aClass in classes.known) {\n\t\t\tvar temp = CurrentClasses[aClass];\n\t\t\tvar LastProp = \"\";\n\t\t\tthermoM(\"Updating \" + temp.fullname + \"'s features...\"); //change the progress dialog text\n\t\t\t\n\t\t\t//add or update class header if not only updating proficiencies\n\t\t\tif (Typeswitch !== \"proficiencies\" && Typeswitch !== \"stop\") {\n\t\t\t\tvar ClassHeaderString = \"\";\n\n\t\t\t\t//See if the class already exists and if the field is empty\n\t\t\t\tif (!(RegExp(temp.name.RegEscape())).test(ClassFeaFld.value) && ClassFeaFld.value) {\n\t\t\t\t\tClassHeaderString += \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t//make the string for the classheader\n\t\t\t\tClassHeaderString += temp.fullname + \", level \" + newClassLvl[aClass] + \":\";\n\t\t\t\tvar oldHeaderString = classes.old[aClass] ? classes.known[aClass].subclass !== classes.old[aClass].subclass ? ClassList[aClass].name.RegEscape() + \".*:\" : temp.fullname.RegEscape() + \".*:\" : \"\";\n\t\t\t\t\n\t\t\t\t//apply the string for the classheader, if the class has a level other than 0\n\t\t\t\tif (newClassLvl[aClass] !== 0) {\n\t\t\t\t\tReplaceString(\"Class Features\", ClassHeaderString, false, oldHeaderString, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var prop in temp.features) {\n\t\t\t\tvar propFea = temp.features[prop];\n\t\t\t\t\n\t\t\t\tthermoM(\"Updating \" + temp.fullname + \"'s \" + propFea.name + \"...\"); //change the progress dialog text\n\t\t\t\tthermoM(0); //increment the progress dialog's progress\n\t\t\t\t\n\t\t\t\t//find if there is a choice that has been made for this class feature\n\t\t\t\tvar FeaChoice = GetClassFeatureChoice(aClass, prop);\n\t\t\t\tvar FeaOldChoice = FeaChoice; // just here so the FeaChoice can be set by the eval property if needed\n\t\t\t\t\n\t\t\t\tif (propFea.minlevel <= newClassLvl[aClass]) {\n\t\t\t\t\tif (propFea.armor) {\n\t\t\t\t\t\tCurrentArmour.proficiencies[temp.fullname] = propFea.armor;\n\t\t\t\t\t}\n\t\t\t\t\tif (propFea.weapons) {\n\t\t\t\t\t\tCurrentWeapons.proficiencies[temp.fullname] = propFea.weapons;\n\t\t\t\t\t}\n\t\t\t\t\tif (propFea.skillstxt) {\n\t\t\t\t\t\tclasses.extraskills.push(propFea.skillstxt);\n\t\t\t\t\t}\n\t\t\t\t\tif (FeaChoice && propFea[FeaChoice].skillstxt) {\n\t\t\t\t\t\tclasses.extraskills.push(propFea[FeaChoice].skillstxt);\n\t\t\t\t\t}\n\t\t\t\t} else if (oldClassLvl[aClass] > newClassLvl[aClass] && propFea.minlevel > newClassLvl[aClass]) {\n\t\t\t\t\tif (propFea.armor && CurrentArmour.proficiencies[temp.fullname]) {\n\t\t\t\t\t\tdelete CurrentArmour.proficiencies[temp.fullname];\n\t\t\t\t\t}\n\t\t\t\t\tif (propFea.weapons && CurrentWeapons.proficiencies[temp.fullname]) {\n\t\t\t\t\t\tdelete CurrentWeapons.proficiencies[temp.fullname];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthermoM(1/8); //increment the progress dialog's progress\n\t\t\t\t\t\n\t\t\t\t/* add features, and others, gained from level-dependent class features only if not calling for proficiencies */\n\t\t\t\tif (Typeswitch !== \"proficiencies\" && ClassLevelUp[aClass][0] !== \"stop\") {\n\t\t\t\t\t\n\t\t\t\t\t//if this is about a feature only available to a subclass, but no subclass is defined, ask to add a subclass\n\t\t\t\t\tvar theSubClass = classes.known[aClass].subclass;\n\t\t\t\t\tif (prop.indexOf(\"subclassfeature\") !== -1 && propFea.minlevel <= ClassLevelUp[aClass][2] && !theSubClass && IsNotReset) {\n\t\t\t\t\t\tthermoM(\"No subclass known, asking for subclass to add...\"); //change the progress dialog text\n\t\t\t\t\t\tvar stopNow = PleaseSubclass(aClass); //ask to add a subclass\n\t\t\t\t\t\tif (stopNow) {\n\t\t\t\t\t\t\tthermoM(\"stop\");\n\t\t\t\t\t\t\tbreak; //this function is going to run again, so stop it now for this class\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if (IsSubclassException[aClass] && (prop.indexOf(\"subclassfeature\") !== -1 || (theSubClass && ClassSubList[theSubClass].features[prop]))) {\n\t\t\t\t\t\tdelete IsSubclassException[aClass];\n\t\t\t\t\t} else if (IsSubclassException[aClass]) {\n\t\t\t\t\t\tvar FeaNewString = ParseClassFeature(aClass, prop, newClassLvl[aClass], false, FeaChoice);\n\t\t\t\t\t\tLastProp = propFea.minlevel <= ClassLevelUp[aClass][2] ? FeaNewString : LastProp;\n\t\t\t\t\t\tcontinue; //an exception has been put in place for this class, so ignore all the entries before another subclassfeature, but do keep updating the LastProp variable\n\t\t\t\t\t}\n\t\t\t\t\tthermoM(\"Updating \" + temp.fullname + \"'s \" + propFea.name + \"...\"); //change the progress dialog text\n\t\t\t\t\t\n\t\t\t\t\t//make a check to see if level-dependent features should be dealt with\n\t\t\t\t\tvar CheckLVL = propFea.minlevel <= ClassLevelUp[aClass][2] && propFea.minlevel > ClassLevelUp[aClass][1];\n\t\t\t\t\t\n\t\t\t\t\tvar ForceAll = false;\n\t\t\t\t\tvar ForceSpecial = false;\n\t\t\t\t\t//if this is the first time adding in a subclass, its features must be forced. But only if the feature meets the level requirement both before and after the level change\n\t\t\t\t\tif (theSubClass && ClassSubList[theSubClass].features[prop] && classes.old[aClass] && theSubClass !== classes.old[aClass].subclass && ((prop.indexOf(\"subclassfeature\") === -1 && CheckLVL) || (propFea.minlevel <= ClassLevelUp[aClass][2] && propFea.minlevel <= ClassLevelUp[aClass][1]))) {\n\t\t\t\t\t\tForceAll = true;\n\t\t\t\t\t\tForceSpecial = prop.indexOf(\"subclassfeature\") === -1 && CheckLVL;\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tthermoM(2/8); //increment the progress dialog's progress\n\n\t\t\t\t\t//check for features that are not level-dependent\n\t\t\t\t\tvar CheckFea = ForceAll || CheckLVL;\n\t\t\t\t\t\n\t\t\t\t\t// get all the attributes of this feature\n\t\t\t\t\tvar Fea = ReturnClassFeatures(aClass, prop, newClassLvl[aClass], FeaChoice, oldClassLvl[aClass], FeaOldChoice);\n\n\t\t\t\t\t// --- add or remove something via custom script, if defined --- //\n\t\t\t\t\tvar evalAddRemove = CheckFea && propFea.minlevel <= newClassLvl[aClass] ? \"eval\" : \"removeeval\";\n\n\t\t\t\t\t// --- define some variables here so it can be used in the evals --- //\n\t\t\t\t\tvar profAddRemove = propFea.minlevel <= newClassLvl[aClass];\n\t\t\t\t\tvar profDisplNm = (prop.indexOf(\"subclassfeature\") !== -1 ? temp.fullname : temp.name) + \": \" + propFea.name;\n\t\t\t\t\tvar profChoiceDisplNm = FeaChoice ? (prop.indexOf(\"subclassfeature\") !== -1 ? temp.fullname : temp.name) + \": \" + propFea[FeaChoice].name : \"\";\n\n\t\t\t\t\tif (propFea[evalAddRemove] && CheckFea) {\n\t\t\t\t\t\tvar thePropFeaeval = What(\"Unit System\") === \"metric\" && propFea[evalAddRemove].indexOf(\"String\") !== -1 ? ConvertToMetric(propFea[evalAddRemove], 0.5) : propFea[evalAddRemove];\n\t\t\t\t\t\teval(thePropFeaeval);\n\t\t\t\t\t}\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice][evalAddRemove]) {\n\t\t\t\t\t\tvar thePropFeaChoiceeval = What(\"Unit System\") === \"metric\" && propFea[FeaChoice][evalAddRemove].indexOf(\"String\") !== -1 ? ConvertToMetric(propFea[FeaChoice][evalAddRemove], 0.5) : propFea[FeaChoice][evalAddRemove];\n\t\t\t\t\t\teval(thePropFeaChoiceeval);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// --- if the eval changed the choice, do some things with this new choice --- //\n\t\t\t\t\tif (FeaChoice !== FeaOldChoice) {\n\t\t\t\t\t\tFea = ReturnClassFeatures(aClass, prop, newClassLvl[aClass], FeaChoice, oldClassLvl[aClass], FeaOldChoice);\n\t\t\t\t\t\tif (propFea[FeaChoice].skillstxt) classes.extraskills.push(propFea[FeaChoice].skillstxt);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// --- add or remove bonus spells in the CurrentSpells variable, if defined --- //\n\t\t\t\t\tvar feaChoiceSpellBonus = FeaChoice && propFea[FeaChoice].spellcastingBonus;\n\t\t\t\t\tvar spellBonus = !CheckFea ? false : propFea.spellcastingBonus ? propFea.spellcastingBonus : feaChoiceSpellBonus ? propFea[FeaChoice].spellcastingBonus : false;\n\t\t\t\t\tvar spellProp = prop + (feaChoiceSpellBonus ? \"-\" + FeaChoice : \"\");\n\t\t\t\t\tif (spellBonus && propFea.minlevel <= newClassLvl[aClass]) {//if gaining the level\n\t\t\t\t\t\t//first see if the entry exists or not, and create it if it doesn't\n\t\t\t\t\t\tif (!CurrentSpells[aClass]) {\n\t\t\t\t\t\t\tCurrentSpells[aClass] = {\n\t\t\t\t\t\t\t\tname : temp.fullname,\n\t\t\t\t\t\t\t\tlevel : newClassLvl[aClass],\n\t\t\t\t\t\t\t\tability : temp.abilitySave ? temp.abilitySave : 0,\n\t\t\t\t\t\t\t\ttypeSp : \"known\",\n\t\t\t\t\t\t\t\tbonus : {}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (propFea.spellFirstColTitle) {\n\t\t\t\t\t\t\t\tCurrentSpells[aClass].firstCol = propFea.spellFirstColTitle;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tCurrentSpells[aClass].bonus[spellProp] = spellBonus;\n\t\t\t\t\t\tUpdateSpellSheets.class = true;\n\t\t\t\t\t} else if (spellBonus && CurrentSpells[aClass].bonus[spellProp]) {//if losing the level and the thing is defined\n\t\t\t\t\t\tdelete CurrentSpells[aClass].bonus[spellProp];\n\t\t\t\t\t\tif (!temp.spellcastingFactor) { //the class has no spellcasting other than these bonus things, so check if there is any left after deleting this one\n\t\t\t\t\t\t\tvar bonusTest = true;\n\t\t\t\t\t\t\tfor (var tester in CurrentSpells[aClass].bonus) {\n\t\t\t\t\t\t\t\tbonusTest = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (bonusTest) { //no additional bonus entries were found, so delete the entire CurrentSpells entry\n\t\t\t\t\t\t\t\tdelete CurrentSpells[aClass];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tUpdateSpellSheets.class = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// --- if a change was detected, do something via custom script, if defined --- //\n\t\t\t\t\tif (propFea.changeeval) {\n\t\t\t\t\t\tvar theChangeeval = What(\"Unit System\") === \"metric\" && propFea.changeeval.indexOf(\"String\") !== -1 ? ConvertToMetric(propFea.changeeval, 0.5) : propFea.changeeval;\n\t\t\t\t\t\teval(theChangeeval);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tthermoM(3/8); //increment the progress dialog's progress\n\n\t\t\t\t\t// --- add or remove action, if defined --- //\n\t\t\t\t\tvar ActionAddRemove = propFea.minlevel <= newClassLvl[aClass] ? \"Add\" : \"Remove\";\n\t\t\t\t\tif (propFea.action && CheckFea) {\n\t\t\t\t\t\tvar thePropFeaAct = What(\"Unit System\") === \"metric\" && propFea.action[1] ? ConvertToMetric(propFea.action[1], 0.5) : propFea.action[1];\n\t\t\t\t\t\ttDoc[ActionAddRemove + \"Action\"](propFea.action[0], propFea.name + thePropFeaAct, temp.fullname);\n\t\t\t\t\t}\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice].action) {\n\t\t\t\t\t\tvar thePropFeaChoiceAct = What(\"Unit System\") === \"metric\" ? ConvertToMetric(propFea[FeaChoice].action[1], 0.5) : propFea[FeaChoice].action[1];\n\t\t\t\t\t\ttDoc[ActionAddRemove + \"Action\"](propFea[FeaChoice].action[0], propFea[FeaChoice].name + thePropFeaChoiceAct, temp.fullname);\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tthermoM(4/8); //increment the progress dialog's progress\n\t\t\t\t\t\n\t\t\t\t\t/* PROFICIENCIES */\n\t\t\t\t\tvar profAddRemove = propFea.minlevel <= newClassLvl[aClass];\n\t\t\t\t\tvar profDisplNm = (prop.indexOf(\"subclassfeature\") !== -1 ? temp.fullname : temp.name) + \": \" + propFea.name;\n\t\t\t\t\tvar profChoiceDisplNm = FeaChoice ? (prop.indexOf(\"subclassfeature\") !== -1 ? temp.fullname : temp.name) + \": \" + propFea[FeaChoice].name : \"\";\n\t\t\t\t\t\n\t\t\t\t\t// --- add or remove custom calculations to the CurrentEvals variable --- //\n\t\t\t\t\tif (CheckFea && propFea.calcChanges) {\n\t\t\t\t\t\taddEvals(propFea.calcChanges, profDisplNm, propFea.minlevel <= newClassLvl[aClass]);\n\t\t\t\t\t}\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice].calcChanges) {\n\t\t\t\t\t\taddEvals(propFea[FeaChoice].calcChanges, profChoiceDisplNm, propFea.minlevel <= newClassLvl[aClass]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// --- add or remove skill proficiencies, if defined --- //\n\t\t\t\t\tif (propFea.skills && CheckFea) {\n\t\t\t\t\t\tfor (var sk = 0; sk < propFea.skills.length; sk++) {\n\t\t\t\t\t\t\tAddSkillProf(propFea.skills[sk], profAddRemove);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice].skills) {\n\t\t\t\t\t\tfor (var sk = 0; sk < propFea[FeaChoice].skills.length; sk++) {\n\t\t\t\t\t\t\tAddSkillProf(propFea[FeaChoice].skills[sk], profAddRemove);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\t// --- add or remove damage resistances --- //\n\t\t\t\t\tif (propFea.dmgres && CheckFea) {\n\t\t\t\t\t\tfor (var dr = 0; dr < propFea.dmgres.length; dr++) {\n\t\t\t\t\t\t\tvar theDmgres = isArray(propFea.dmgres[dr]) ? propFea.dmgres[dr] : [propFea.dmgres[dr], false];\n\t\t\t\t\t\t\tSetProf(\"resistance\", profAddRemove, theDmgres[0], profDisplNm, theDmgres[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice].dmgres) {\n\t\t\t\t\t\tfor (var dr = 0; dr < propFea[FeaChoice].dmgres.length; dr++) {\n\t\t\t\t\t\t\tvar theDmgres = isArray(propFea[FeaChoice].dmgres[dr]) ? propFea[FeaChoice].dmgres[dr] : [propFea[FeaChoice].dmgres[dr], false];\n\t\t\t\t\t\t\tSetProf(\"resistance\", profAddRemove, theDmgres[0], profChoiceDisplNm, theDmgres[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t// --- add or remove tool proficiencies, if defined --- //\n\t\t\t\t\tif (propFea.toolProfs && CheckFea) {\n\t\t\t\t\t\tprocessTools(profAddRemove, profDisplNm, propFea.toolProfs);\n\t\t\t\t\t};\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice].toolProfs) {\n\t\t\t\t\t\tprocessTools(profAddRemove, profChoiceDisplNm, propFea[FeaChoice].toolProfs);\n\t\t\t\t\t};\n\n\t\t\t\t\t// --- add or remove language proficiencies, if defined --- //\n\t\t\t\t\tif (propFea.languageProfs && CheckFea) {\n\t\t\t\t\t\tprocessLanguages(profAddRemove, profDisplNm, propFea.languageProfs);\n\t\t\t\t\t};\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice].languageProfs) {\n\t\t\t\t\t\tprocessLanguages(profAddRemove, profChoiceDisplNm, propFea[FeaChoice].languageProfs);\n\t\t\t\t\t};\n\n\t\t\t\t\t// --- add or remove vision text, if defined --- //\n\t\t\t\t\tif (propFea.vision && CheckFea) {\n\t\t\t\t\t\tprocessVision(profAddRemove, profDisplNm, propFea.vision);\n\t\t\t\t\t};\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice].vision) {\n\t\t\t\t\t\tprocessVision(profAddRemove, profChoiceDisplNm, propFea[FeaChoice].vision);\n\t\t\t\t\t};\n\n\t\t\t\t\t// --- add or remove modifiers from fields, if defined --- //\n\t\t\t\t\tif (propFea.addMod && CheckFea) {\n\t\t\t\t\t\tprocessMods(profAddRemove, profDisplNm, propFea.addMod);\n\t\t\t\t\t};\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice].addMod) {\n\t\t\t\t\t\tprocessMods(profAddRemove, profChoiceDisplNm, propFea[FeaChoice].addMod);\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\t// --- add or remove saving throw proficiencies --- //\n\t\t\t\t\tif (propFea.saves && CheckFea) {\n\t\t\t\t\t\tfor (var sa = 0; sa < propFea.saves.length; sa++) {\n\t\t\t\t\t\t\tSetProf(\"save\", profAddRemove, propFea.saves[sa], profDisplNm);\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice].saves) {\n\t\t\t\t\t\tfor (var sa = 0; sa < propFea[FeaChoice].saves.length; sa++) {\n\t\t\t\t\t\t\tSetProf(\"save\", profAddRemove, propFea[FeaChoice].saves[sa], profChoiceDisplNm);\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\n\t\t\t\t\t// --- add or remove save text, if defined --- //\n\t\t\t\t\tif (propFea.savetxt && CheckFea) {\n\t\t\t\t\t\tSetProf(\"savetxt\", profAddRemove, propFea.savetxt, profDisplNm);\n\t\t\t\t\t};\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice].savetxt) {\n\t\t\t\t\t\tSetProf(\"savetxt\", profAddRemove, propFea[FeaChoice].savetxt, profChoiceDisplNm);\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\t// --- add or remove armor string, if defined --- //\n\t\t\t\t\tif (propFea.addarmor && CheckFea) {\n\t\t\t\t\t\ttDoc[(profAddRemove ? \"Add\" : \"Remove\") + \"Armor\"](propFea.addarmor);\n\t\t\t\t\t};\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice].addarmor) {\n\t\t\t\t\t\ttDoc[(profAddRemove ? \"Add\" : \"Remove\") + \"Armor\"](propFea[FeaChoice].addarmor);\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tthermoM(5/8); //increment the progress dialog's progress\n\n\t\t\t\t\t// --- add or remove speed, if defined --- //\n\t\t\t\t\tif (propFea.speed && CheckFea) {\n\t\t\t\t\t\tSetProf(\"speed\", profAddRemove, propFea.speed, profDisplNm);\n\t\t\t\t\t};\n\t\t\t\t\tif (CheckFea && FeaChoice && propFea[FeaChoice].speed) {\n\t\t\t\t\t\tSetProf(\"speed\", profAddRemove, propFea[FeaChoice].speed, profChoiceDisplNm);\n\t\t\t\t\t};\n\n\t\t\t\t\t// --- add or remove extra spells in the CurrentSpells variable, if defined --- //\n\t\t\t\t\tvar spellExtra = !CheckFea ? false : (propFea.spellcastingExtra ? propFea.spellcastingExtra : (FeaChoice && propFea[FeaChoice].spellcastingExtra ? propFea[FeaChoice].spellcastingExtra : false));\n\t\t\t\t\tif (spellExtra && propFea.minlevel <= newClassLvl[aClass]) {//if gaining the level\n\t\t\t\t\t\tCurrentSpells[aClass].extra = spellExtra;\n\t\t\t\t\t} else if (spellExtra) {//if losing the level\n\t\t\t\t\t\tCurrentSpells[aClass].extra = \"\";\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tthermoM(6/8); //increment the progress dialog's progress\n\n\t\t\t\t\t// --- add or remove Limited Features --- //\n\t\t\t\t\t\n\t\t\t\t\t//check if feature needs to be forcibly replaced because there is a change in any one of them\n\t\t\t\t\tGoAnyway = ForceAll || (newClassLvl[aClass] > 0 && propFea.minlevel <= oldClassLvl[aClass] && (Fea.Add !== Fea.AddOld || Fea.Use !== Fea.UseOld || Fea.UseCalc !== Fea.UseCalcOld || Fea.Recov !== Fea.RecovOld || Fea.UseName !== Fea.UseNameOld));\n\t\t\t\t\t\n\t\t\t\t\t//remove the limited feature if it should be removed because of downgrading the level --or-- the old feature was defined, but the new isn't --or-- if the old has a different name than the new --or-- if the new amount of usages is unlimited\n\t\t\t\t\tif (((Fea.UseOld || Fea.UseCalcOld) && propFea.minlevel > newClassLvl[aClass] && propFea.minlevel <= oldClassLvl[aClass]) || ((Fea.UseName !== Fea.UseNameOld || (!Fea.Use && !Fea.UseCalc) || (Fea.Recov !== Fea.RecovOld)) && (Fea.UseOld || Fea.UseCalcOld)) || (/unlimited|\\u221E/i).test(Fea.Use)) {\n\t\t\t\t\t\tRemoveFeature(Fea.UseNameOld ? Fea.UseNameOld : Fea.UseName, newClassLvl[aClass] === 0 ? \"\" : Fea.UseOld, \"\", \"\", \"\", \"\", Fea.UseCalcOld);\n\t\t\t\t\t\tFea.UseOld = 0;\n\t\t\t\t\t};\n\t\t\t\t\t// now add the limited feature depending on the changes of the level or changes of something else or if it is being forced, as long as the usages have been defined\n\t\t\t\t\tif ((Fea.UseCalc || Fea.Use) && !(/unlimited|\\u221E/i).test(Fea.Use) && (GoAnyway || (propFea.minlevel <= newClassLvl[aClass] && propFea.minlevel > oldClassLvl[aClass]))) {\n\t\t\t\t\t\tAddFeature(Fea.UseName, Fea.Use, Fea.Add ? \" (\" + Fea.Add + \")\" : \"\", Fea.Recov, temp.fullname, Fea.UseOld, Fea.UseCalc);\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tthermoM(7/8); //increment the progress dialog's progress\n\n\t\t\t\t\t//--- get the new and old string of the class features\n\t\t\t\t\tvar FeaOldString = ParseClassFeature(aClass, prop, ForceSpecial ? newClassLvl[aClass] : oldClassLvl[aClass], ForceAll, FeaOldChoice);\n\t\t\t\t\tvar FeaNewString = ParseClassFeature(aClass, prop, newClassLvl[aClass], false, FeaChoice);\n\t\t\t\t\t\n\t\t\t\t\t//make variables for the text in the class features field\n\t\t\t\t\tvar SpliceReplaceRemove = GoAnyway && !ForceAll && propFea.minlevel <= newClassLvl[aClass] ? \"Replace\" : (propFea.minlevel <= newClassLvl[aClass] ? \"Splice\" : \"Remove\");\n\n\t\t\t\t\tif (ForceAll) { //if adding a feature for previous levels because of a sublevel change, first remove the old version\n\t\t\t\t\t\tRemoveString(\"Class Features\", FeaOldString, false);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//add, remove, or update the text in the class features field\n\t\t\t\t\tif (GoAnyway || CheckLVL) {\n\t\t\t\t\t\ttDoc[SpliceReplaceRemove + \"String\"](\"Class Features\", SpliceReplaceRemove === \"Remove\" ? FeaOldString : FeaNewString, false, SpliceReplaceRemove === \"Replace\" ? FeaOldString : (LastProp !== \"\" ? LastProp.slice(-55) : ClassHeaderString));\n\t\t\t\t\t\tif (SpliceReplaceRemove === \"Remove\" && propFea.choices) {\n\t\t\t\t\t\t\tRemoveClassFeatureChoice(aClass, prop);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (prop.indexOf(\"wild shape\") !== -1) {\n\t\t\t\t\t\tisWildShape = [newClassLvl[aClass], Fea.Use, Fea.Recov, Fea.Add];\n\t\t\t\t\t\tWSinUse = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//if the feature has extrachoices and old- or newlevel meets minlevel of the feature, go over them one by one to see if they changed with level\n\t\t\t\t\tif (propFea.extrachoices && propFea.minlevel <= ClassLevelUp[aClass][2]) {\n\t\t\t\t\t\tvar addRemoveEC = propFea.minlevel > newClassLvl[aClass] && propFea.minlevel <= oldClassLvl[aClass] ? \"remove\" : propFea.minlevel < newClassLvl[aClass] ? \"update\" : false;\n\t\t\t\t\t\tif (addRemoveEC) {propFea.extrachoices.forEach( function(extraF) {\n\t\t\t\t\t\t\textraF = extraF.toLowerCase();\n\t\t\t\t\t\t\tvar feaExtra = propFea[extraF];\n\t\t\t\t\t\t\tvar textFlds = [What(\"Extra.Notes\"), What(\"Class Features\")];\n\t\t\t\t\t\t\tvar testTxt = feaExtra.name + \" (\" + propFea.extraname;\n\t\t\t\t\t\t\tif (!feaExtra || textFlds.join(\"\").indexOf(testTxt) === -1 || (addRemoveEC === \"Update\" && !isArray(feaExtra.recovery) && !isArray(feaExtra.usages) && !isArray(feaExtra.additional))) return; //no need to do this feature\n\t\t\t\t\t\t\tif (addRemoveEC === \"remove\") { //remove the feature\n\t\t\t\t\t\t\t\tClassFeatureOptions([aClass, prop, extraF, \"extra\"], addRemoveEC, oldClassLvl[aClass]);\n\t\t\t\t\t\t\t} else if (addRemoveEC === \"update\") {\n\t\t\t\t\t\t\t\tvar ecFea = ReturnClassFeatures(aClass, prop, newClassLvl[aClass], extraF, oldClassLvl[aClass], extraF, false, true);\n\t\t\t\t\t\t\t\tvar ecFeaNewString = ParseClassFeatureExtra(aClass, prop, extraF, ecFea, false);\n\t\t\t\t\t\t\t\tvar ecFeaOldString = ParseClassFeatureExtra(aClass, prop, extraF, ecFea, true);\n\t\t\t\t\t\t\t\tif (ecFeaOldString !== ecFeaNewString) {\n\t\t\t\t\t\t\t\t\tReplaceString(textFlds[0].indexOf(testTxt) !== -1 ? \"Extra.Notes\" : \"Class Features\", ecFeaNewString, false, ecFeaOldString);\n\t\t\t\t\t\t\t\t\tif ((ecFea.Use || ecFea.UseCalc) && !(/unlimited|\\u221E/i).test(ecFea.Use)) {\n\t\t\t\t\t\t\t\t\t\tAddFeature(ecFea.UseName, ecFea.Use, ecFea.Add ? \" (\" + ecFea.Add + \")\" : \"\", ecFea.Recov, CurrentClasses[aClass].fullname, ecFea.UseOld, ecFea.UseCalc);\n\t\t\t\t\t\t\t\t\t} else if ((/unlimited|\\u221E/i).test(ecFea.Use) || (ecFea.UseOld || ecFea.UseCalcOld)) {\n\t\t\t\t\t\t\t\t\t\tRemoveFeature(ecFea.UseNameOld, ecFea.UseOld, \"\", \"\", \"\", \"\", ecFea.UseCalcOld);\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}); };\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tLastProp = propFea.minlevel <= ClassLevelUp[aClass][2] ? FeaNewString : LastProp;\n\t\t\t}\n\t\t}\n\t\t//now update the wild shapes on the seventh page, if appropriate\n\t\tif (WSinUse && Typeswitch !== \"proficiencies\") {\n\t\t\tWildshapeUpdate(isWildShape); //(re-)apply and re-calculate all the wild shapes as something might have changed after going level up\n\t\t}\n\t}\n\tthermoM(\"Finalizing updating level features...\"); //change the progress dialog text\n\tthermoM(\"stop\"); //stop the top progress dialog\n}", "title": "" }, { "docid": "8c89abeb2ca24aa4a0d639cdb26cc991", "score": "0.53146315", "text": "function upgradeLevel( e ) {\n let id = e.srcElement.id\n\n //===========================================\n // Check Clicked Upgrade Afforadability - Buy\n //===========================================\n if( $ST.getBuyOrSell( ) ) {\n if( $ST.isUpgradePurchaseable( id ) ) {\n //-Poo from Total Collected\n let pooStats = $D.id( \"totalPooCollected\" );\n $ST.subtractPoo( $PC.calcSumPrice( id, $ST.getUpgradeLevel( id ), $ST.getBuyOrSellQuantity( ) ) );\n pooStats.innerHTML = $ST.getDisplayNotation( \"totalPoo\");\n\n //Increase Level +Quantity\n $ST.upgradeLevelUp( id, $ST.getBuyOrSellQuantity( ) );\n let level = $D.id( id + \"Level\" );\n level.innerHTML = $ST.getUpgradeLevel( id );\n\n //Recalculate Cost\n let cost = $D.id( id + \"Cost\" );\t\n let sum = $PC.calcSumPrice( id, $ST.getUpgradeLevel( id ), $ST.getBuyOrSellQuantity( ) );\t\t\t\n cost.innerHTML = $ST.getDisplayNotation( sum );\n\n //Calculate the new PPS\n $ST.calcPPS( );\n\n //Calculate if you have enough Poo for next upgrade\n $ST.isUpgradePurchaseable( id )\n }\n }\n \n\n //=============================================\n // Check Clicked Upgrade Afforadability - Sell\n //=============================================\n else {\n // SELL UPGRADE AND ADD ONTO TOTAL POO\n let pooStats = $D.id( \"totalPooCollected\" );\n $ST.addPoo( $PC.calcSellPrice( id, $ST.getUpgradeLevel( id ), $ST.getBuyOrSellQuantity( ) ) );\n pooStats.innerHTML = $ST.getTotalPoo( );\n\n //===============================\n // Decrease Level -Quantity\n //===============================\n //IF QUANTITY AMOUNT IS GREATER THAN CURRENT LEVEL\n //SET LEVEL TO 0\n if( $ST.getBuyOrSellQuantity( ) > $ST.getUpgradeLevel( id ) ) {\n $ST.upgradeLevelDown( id, $ST.getUpgradeLevel( id ) );\n }\n\n //ELSE -QUANTITY\n else {\n $ST.upgradeLevelDown( id, $ST.getBuyOrSellQuantity( ) );\n }\n\n let level = $D.id( id + \"Level\" );\n level.innerHTML = $ST.getUpgradeLevel( id );\n \n //===============================\n // Recalculate Cost\n //===============================\n let cost = $D.id( id + \"Cost\" );\t\n cost.innerHTML = $PC.calcSellPrice( id, $ST.getUpgradeLevel( id ), $ST.getBuyOrSellQuantity( ) );\n\n\n //Calculate the new PPS\n $ST.calcPPS( );\n\n //Calculate if you have enough Poo for next upgrade\n $ST.isUpgradePurchaseable( id )\n }\n\n updateTechTree( );\n $PC.getMessageBoardUpdate( );\n }", "title": "" }, { "docid": "37a3573d22aee3edb1ae8d800069167b", "score": "0.531412", "text": "function battery (x, y) {\n rectangle(x-7,y-10,3,20); // Minuspol (links)\n rectangle(x+4,y-20,1,40); // Pluspol (rechts)\n line(x-20,y-15,x-10,y-15,\"#000000\",2); // Minuszeichen\n line(x+10,y-15,x+20,y-15,\"#000000\",2); // Pluszeichen, waagrechte Linie\n line(x+15,y-20,x+15,y-10,\"#000000\",2); // Pluszeichen, senkrechte Linie\n }", "title": "" }, { "docid": "9eccffea7d99330ffe34dd918d0f1629", "score": "0.53060347", "text": "async handleBatteryLevel(battteryLevelRequire) {\n if (battteryLevelRequire !== undefined) {\n const batteryLevel = await Battery.getBatteryLevelAsync()\n return ((batteryLevel * 100) >= battteryLevelRequire)\n } else {\n return true\n }\n }", "title": "" }, { "docid": "b608cd718de65bda4017db4d54c451bb", "score": "0.5301039", "text": "function onLowBattery() {\n app.exit();\n }", "title": "" }, { "docid": "f9fd946b8c55bbb27a9c9784dce9da18", "score": "0.5299964", "text": "reloadLevelUp(){\n if(SAVES.PLAYER.ReloadLevel >= CST.CONFIG.MaxSkillLevel || SAVES.SCORES.devilScore < SAVES.PLAYER.ReloadUpgradeCost){\n return;\n }\n this.levelUpSfx.play();\n\n SAVES.SCORES.devilScore -= SAVES.PLAYER.ReloadUpgradeCost;\n SAVES.PLAYER.ReloadUpgradeCost += 10;\n SAVES.PLAYER.ReloadLevel++;\n SAVES.PLAYER.ReloadCost -= 2;\n }", "title": "" }, { "docid": "d329bff6554afcef8a0e34046c65403f", "score": "0.52873147", "text": "function updatePlayerLevel() {\n let tempLevel = Math.floor(playerXP / playerXPperLevel); // Spieler-Level = XP / XPproLevel\n document.getElementById(\"xpCounter\").innerHTML = \"Player-Level: \" + tempLevel + \" (XP: \" + playerXP + \" / \" + playerXPperLevel + \")\"; // Baue den String für die Spieler-Info zusammen\n console.log(\"Spieler \" + playerName + \" hat nun Level \" + tempLevel + \" mit \" + playerXP + \" (\" + playerXPperLevel + \" pro Level)\"); // Spieler-Level in der Konsole.\n}", "title": "" }, { "docid": "3cf3539685e5ba3323e2fc628f02d0e0", "score": "0.5278489", "text": "_updateChangingWeather() {\r\n const [d, t] = [this._weatherDuration, this._weatherPowerTarget];\r\n this._weatherPower = (this._weatherPower * (d - 1) + t) / d;\r\n this._weatherDuration--;\r\n if (this._weatherDuration === 0 && this._weatherPowerTarget === 0) {\r\n this._weatherType = \"none\";\r\n }\r\n }", "title": "" }, { "docid": "f04588ae824f1122873b01e342b610cf", "score": "0.527366", "text": "function updateFull(old, by, levels) {\n return updateFull1(old, by, levels, 0);\n}", "title": "" }, { "docid": "7a1dc5db72169c7028f9d01a29970f5a", "score": "0.52537936", "text": "setPowerState(powerOn, callback) {\n this.log(`LIGHT: ${this.device.name} setPowerState(${powerOn})`);\n this.scheduleCharacteristicUpdate(callback, doneCallback => {\n const currentLightState = this.device.getCurrentLightState();\n this.log(\"LIGHT: \" + this.device.name + \" Changing powerstate to \" + powerOn + \", currentState=\" + currentLightState);\n if (powerOn != currentLightState && powerOn !== this.pendingPowerState) {\n this.pendingPowerState = powerOn;\n this.device.sendLightCommand(powerOn, () => {\n this.pendingPowerState = undefined;\n doneCallback();\n });\n }\n else {\n doneCallback();\n }\n });\n }", "title": "" }, { "docid": "a88e8e626f72581dfeba14112f1e9bd2", "score": "0.52537537", "text": "UpdateEffects(){\n\t\t\tthis.activeEffects.forEach(effect => {\n\t\t\t\tvar oldModifier = effect.amount;\n\t\t\t\tvar godWOMod = new Object(this);\n\t\t\t\tgodWOMod[effect.stat] -= effect.amount;\n\t\t\t\teffect.parseEffectChain(godWOMod);\n\t\t\t\tif (effect.amount !== oldModifier){\n\t\t\t\t\teffect.amount -= oldModifier;\n\t\t\t\t\tthis[effect.stat] = HF.convertOperators(effect.operator)(this[effect.stat], effect.amount);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "a70ce30a5568b811d8645cda12a1f2d6", "score": "0.52486074", "text": "function refreshVolumeControls() {\n chrome.storage.local.get(['volume', 'mute'], function(items) {\n // Retrieve volume preference from local storage\n if (items.volume) {\n VOLUME = items.volume;\n $(\"#ambient-slider\").val(VOLUME);\n onSliderDrag();\n }\n \n // Retrieve mute setting from local storage\n if (items.mute) {\n MUTE = true;\n } else {\n MUTE = false;\n }\n setMute(MUTE);\n applyMute();\n });\n}", "title": "" }, { "docid": "4339d6f2d5873c2c2e61aaeea6034c24", "score": "0.5246314", "text": "function updateData () {\n // Access the battery API of si and pass in a callback function\n si.battery(function (data) {\n // Force the value of updatedInfo in our Vue app to false,\n // this will show the text \"Updated\" on the page.\n app.updatedInfo = false;\n // Update the data in our Vue app with the data from si\n app.percent = Math.round(data.percent);\n app.isCharging = data.ischarging;\n app.cycles = data.cyclecount;\n // To force a CSS animation to occur we wait 1 second\n setTimeout(function () {\n // Then re-add the class of \"updated\" on the page so the text fades away\n app.updatedInfo = true;\n }, 1000);\n });\n}", "title": "" }, { "docid": "429cf7c1de216476a52d10c33bcd130d", "score": "0.52459234", "text": "function update() {\r\n var elapsedTime = clock.getElapsedTime();\r\n $('#scoreOutput').text(score);\r\n $('#levelOutput').text(currentLevel);\r\n updateGlobalSkills();\r\n\r\n if (currentState === gameState.level) {\r\n level.update();\r\n switch (level.getState()) {\r\n case levelState.preGame:\r\n $('#loadingScreen').show();\r\n sendSettings();\r\n level.setState(levelState.build);\r\n break;\r\n case levelState.ready:\r\n $('#loadingScreen').hide();\r\n //hide loading screen\r\n level.setState(levelState.play);\r\n break;\r\n case levelState.end:\r\n finishLevel();\r\n level.setState(levelState.preGame);\r\n break;\r\n case levelState.loss:\r\n resetGame();\r\n bus.publish(\"playerLoses\");\r\n level.setState(levelState.preGame);\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "f891838476fcb9a60a851d31b40c18b5", "score": "0.5241582", "text": "function power_1_Time(is){\r\n if(is== 'on'){\r\n a--;\r\n if(a>=0 && a%100 == 0){\r\n initialPower1Time -= 1;\r\n document.getElementById('power1').innerHTML = initialPower1Time;\r\n }\r\n \r\n if(initialPower1Time == 0){\r\n \r\n power1Status = false;\r\n power1Present = false;\r\n isPower1 = 'off';\r\n document.getElementById('power1').style.visibility = 'hidden';\r\n document.getElementById('power1').innerHTML = initialPower1Time;\r\n\r\n }\r\n\r\n }\r\n}", "title": "" }, { "docid": "de3217f5876ce90fbf14c9947f8e245a", "score": "0.52389365", "text": "function powerUp () {\n console.log(\"power up\");\n isPowered = true;\n pfio.digital_write(0,1);\n}", "title": "" }, { "docid": "789eb61c06b89c80b1f2f3193700992c", "score": "0.52249366", "text": "function enableDisplayAndShowBatteryState (batteryState) {\r\n\r\n batteryDisplay.textContent = batteryState;\r\n\r\n batteryDisplay.style.color = '';\r\n\r\n batteryLabel.style.color = '';\r\n\r\n}", "title": "" }, { "docid": "69f6d86e8def4b5b38323ac20073625e", "score": "0.5224796", "text": "function sleepBarHard() {\n if (energyRemaining >= 100) {\n return;\n } else {\n energyRemaining= energyRemaining + 6;\n energyBarUpdate();\n moneyRemaining= moneyRemaining - 4;\n moneyBarUpdate();\n foodRemaining= foodRemaining - 4;\n foodBarUpdate();\n }\n }", "title": "" }, { "docid": "3897467bdcd7155c47aed18df932ac65", "score": "0.5212107", "text": "setBrightness(level, callback) {\n this.logger(`Setting brightness to ${level}`);\n if (level !== this.device.brightnessLevel) {\n this.device.updateBrightnessLevel(level);\n }\n else {\n this.logger(`Ignoring redundant setBrightness`);\n callback();\n }\n }", "title": "" }, { "docid": "7ac0eec6404b1dcdcc0e412c90e022fd", "score": "0.52109665", "text": "updateHealth() {\n let healthTextValue = '';\n for (let i = 0; i < this.health; i++) {\n healthTextValue += '*';\n }\n\n if (this.healthText !== undefined) {\n try {\n this.healthText.text = healthTextValue;\n } catch (TypeError) {}\n }\n }", "title": "" }, { "docid": "c1e0a5d806f7bdb3371927861e1da993", "score": "0.52082956", "text": "function _update() {\n\n if( $scope.game.tower.level > 0 && $scope.game.wall.level > 0) {\n $scope.game.defense = $scope.game.tower.defense + $scope.game.wall.defense;\n }else if($scope.game.tower.level > 0 && $scope.game.wall.level == 0) {\n $scope.game.defense = $scope.game.tower.defense\n } else if($scope.game.tower.level == 0 && $scope.game.wall.level > 0) {\n $scope.game.defense = $scope.game.wall.defense;\n } else {\n $scope.game.defense = 0;\n }\n\n $scope.game.power = $scope.game.warrior.attack * $scope.game.warrior.number + $scope.game.archer.attack * $scope.game.archer.number;\n\n rest.game.update({_id: $scope.game._id}, $scope.game, function() {\n });\n }", "title": "" }, { "docid": "29230f26193f4fd96dd4165947c5ea38", "score": "0.51970637", "text": "activatePowers() {\n\t\t// TODO\n\t}", "title": "" }, { "docid": "d0c8890d6fca8ab60b02d7967398a02e", "score": "0.51916194", "text": "function changeVolumeAudio(wind) {\r\n\t\tif (wind <= 20) {\r\n\t\t\taudioWind.volume = 0.05\r\n\t\t}\r\n\r\n\t\telse if (wind <= 40) {\r\n\t\t\taudioWind.volume = 0.1\r\n\t\t}\r\n\r\n\t\telse if (wind <= 60) {\r\n\t\t\taudioWind.volume = 0.3\r\n\t\t}\r\n\r\n\t\telse if (wind <= 80) {\r\n\t\t\taudioWind.volume = 0.5\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\taudioWind.volume = 0.8\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "8bb047a5629845ace2572c0b80e4976a", "score": "0.5186077", "text": "function pay_robot(level) {\n if (costs['upgrade_robot']*level*0.8 <= Game.robot_count)\n Game.robot_count = Game.robot_count-costs['upgrade_robot']*level*0.8;\n update_clicker();\n affordable();\n}", "title": "" }, { "docid": "caa3496c8866f89dde7a8aa6feb6185c", "score": "0.5185469", "text": "function superPower() {\n console.log('superPower');\n }", "title": "" } ]
cdd365ffd8d55e244c84f4f36beec62c
function to see all departments
[ { "docid": "6ea008c411e4acc4b8fd7680472fb504", "score": "0.7393949", "text": "function viewEmployeesDepart(){\n connection.query(\"SELECT * FROM department_list\", function (err, answer) {\n console.log(\"\\n Departments Retreived from the Database \\n\");\n console.table(answer);\n });\n start();\n}", "title": "" } ]
[ { "docid": "27eb0e01530b2b2b27bd0ce7a2e1eb9f", "score": "0.8507782", "text": "function viewAllDepartments() {\n connection.query(\"SELECT * FROM department\", function (err, res) {\n console.table(res);\n if (err) throw err;\n startProgram();\n });\n}", "title": "" }, { "docid": "e2ee2f57e46c9ba481fb949ed8f1c152", "score": "0.84712833", "text": "function viewDepartments() {\n console.log(\"Selecting all departments...\\n\");\n connection.query(\"SELECT * FROM departments\", function(err, res) {\n if (err) throw err;\n console.log(res);\n console.table('All Departments:', res);\n \n });\n runSearch();\n }", "title": "" }, { "docid": "b90aa32d07ad850959bf593e14bf3677", "score": "0.8444402", "text": "function viewAllDepartments() {\n console.log(\"view all departments\")\n connection.query(\"SELECT * from department\", function (error, res) {\n console.table(res);\n endOrMenu();\n })\n}", "title": "" }, { "docid": "732d3accfa6d76e8428e984592c6319f", "score": "0.82540476", "text": "function viewAllDepartments() {\n return connection.query(viewAllDepartmentsQuery);\n}", "title": "" }, { "docid": "7bbb2433b4477c51162c6a91427cb843", "score": "0.82526726", "text": "function viewAllDepts() {\n connection.query(\"SELECT departmentName FROM department;\", (err, results) => {\n if (err) throw err;\n console.table(results);\n start();\n });\n}", "title": "" }, { "docid": "bf9895cdbeb7c6e0361715d6af5e7b83", "score": "0.82251716", "text": "function viewDepartments() {\n\n connection.query(\"SELECT * FROM department\", function(err, res) {\n if (err) throw err;\n //console.log(res);\n for (var i = 0; i < res.length; i++) {\n console.log(\"Dept ID: \" + res[i].id + \" || Name: \" + res[i].name);\n }\n runSearch();\n }); \n}", "title": "" }, { "docid": "7abc4e1c4749ac382daebf45e2957bdf", "score": "0.81882304", "text": "function viewDepartments(){\n connection.query(`SELECT department_name AS \"Department\" FROM departments ORDER BY department_name;`, function(err, res) {\n if (err) {\n throw err;\n }\n else{\n console.table(res);\n populateEmployees();\n }\n return;\n });\n}", "title": "" }, { "docid": "44054886343da75c56eb7980495e67cc", "score": "0.8181853", "text": "function viewDepartments() {\n\tvar query = \"SELECT * FROM department\";\n\tconnection.query(query, function (err, res) {\n\t\tif (err) throw err;\n\t\tconsole.log(`\\nDEPARTMENTS:\\n`);\n\t\tres.forEach((department) => {\n\t\t\tconsole.log(`ID: ${department.id} | ${department.name} Department`);\n\t\t});\n\t\tconsole.log(\"\\n--------------------------------------\\n\");\n\t\tfirstPrompt();\n\t});\n}", "title": "" }, { "docid": "dfcc3490d0828c73b4c96a57d909bb14", "score": "0.8150887", "text": "function viewAllDepartments() {\n connection.query(\"SELECT * FROM departments\", (err, res) => {\n console.log(\"\\n--Departments query complete--\");\n if (err) {\n throw err;\n }\n //log\n console.table(\"\\nDepartments:\", res);\n console.log(\"----------------------------------------------------\");\n mainPrompt();\n });\n}", "title": "" }, { "docid": "ab9522b4f66774cadccb45bd01455cfe", "score": "0.81314236", "text": "function viewAllDept() {\n connection.query(\"SELECT * FROM department\", (err, data) => {\n if (err) throw err;\n console.log(\"\\nDepartment Listing\\n--------------------------------------\");\n console.table(data);\n initApp();\n });\n}", "title": "" }, { "docid": "2179b4a31b9dd5069d081371a81811e7", "score": "0.80967027", "text": "function viewAllDept() {\n // query the database for all employees\n connection.query(\n \"SELECT employee.firstname, employee.lastname, department.departmentName FROM employee INNER JOIN jobrole ON employee.role_id = jobrole.id INNER JOIN department ON jobrole.department_id = department.id;\",\n function(err, results) {\n if (err) throw err;\n console.table(results);\n start();\n },\n );\n}", "title": "" }, { "docid": "9ff73ed81dd87b53d9b00975a7ec76ad", "score": "0.8038377", "text": "function viewDepartments(){\n connection.query(\"SELECT * FROM department\", function(err, results) {\n if (err) throw err;\n console.table(results);\n start();\n })\n}", "title": "" }, { "docid": "7373ea677fcde41a0064dd1a87bdc319", "score": "0.80308694", "text": "function viewAllDepartments() {\n db.query(`SELECT * FROM department`, (err, departments) => {\n console.table(departments)\n startApp();\n });\n}", "title": "" }, { "docid": "5be78f8b318838cf04e645df8752e366", "score": "0.80017424", "text": "viewDepartments() {\n return this.connection.query(\n 'SELECT * FROM department;'\n )\n }", "title": "" }, { "docid": "924de5910bd69e0ea6d22b37f8be1494", "score": "0.80014944", "text": "function viewAllDept() {\n connection.query('SELECT * FROM department', (err, res) => {\n if (err) throw err;\n console.table(res);\n optionFunction();\n });\n}", "title": "" }, { "docid": "d842234aea5de7097f56918708bc3838", "score": "0.7943439", "text": "function viewAllDepts(){\n connection.query(\"SELECT * FROM departments\", function(err, results){\n console.log(\"\\n\")\n console.table(results);\n init();\n })\n}", "title": "" }, { "docid": "8872ee55dbc6aaf35e96100349c96e3f", "score": "0.79167706", "text": "async viewDepartment() {\n const departments = await this.fetchData(\"department\", \"1\", \"1\");\n return departments;\n }", "title": "" }, { "docid": "318b62da7f63a5ceb16e01a8c44319fa", "score": "0.7904718", "text": "function viewDepartment(){\n connection.query('select * from department', function(err, results){\n if(err) throw err;\n console.table(results);\n start(); \n });\n }", "title": "" }, { "docid": "a8f1cc5dfc282ed10bd6351fdfe4b284", "score": "0.79017246", "text": "function viewAllDepartments() {\n const sql = 'SELECT * FROM department';\n db.query(sql, (err, res) => {\n if (err) {\n return err;\n } \n console.table(res);\n menu();\n });\n}", "title": "" }, { "docid": "ebb1b2cedc2e99c1463b20ef56d1d649", "score": "0.78581345", "text": "function viewDepartments() {\n // query the database for all departments\n connection.query('SELECT * FROM department', (err, res) => {\n if (err) throw err;\n console.log('DEPARTMENTS:')\n console.table(res);\n // re-prompt the user with the initial question\n start();\n });\n}", "title": "" }, { "docid": "9da91febf6c4481b9dd57a9549fabff6", "score": "0.78049356", "text": "function viewDepartments() {\n\n var query = \"SELECT * FROM department\"\n\n connection.query(query, function(err, results) {\n if (err) throw err;\n \n console.log();\n console.table(results);\n start(); \n });\n}", "title": "" }, { "docid": "bd46f379b18f89e677d2ffbeb755e8f4", "score": "0.7766799", "text": "function viewDepartments() {\n connection.query(\"SELECT * FROM department\", function (err, departments) {\n console.table(departments);\n startApp();\n })\n}", "title": "" }, { "docid": "dc4976aff64e2af9285ff3e57d1de123", "score": "0.7751784", "text": "function viewAllByDepartment(department) {\n return connection.query(viewAllEmployeesQuery + \" WHERE department.name = ?\", [department]);\n}", "title": "" }, { "docid": "94870afd0ac813ed5812b990fe86ae5a", "score": "0.7748336", "text": "function viewDepartment() {\n let query = \"SELECT * FROM dept\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.table(res);\n selectAction();\n });\n }", "title": "" }, { "docid": "024e68bbb8e1a6f0a2946993de9ca51d", "score": "0.77364767", "text": "function deptList() {\n return connection.query(\"SELECT id, dept_name FROM departments\");\n}", "title": "" }, { "docid": "5d081b9d569658299140000e3df9e7f1", "score": "0.7726647", "text": "function viewAllEmpByDept() {\n connection.query(\"SELECT * FROM department\", function (err, answer) {\n console.log(\"\\n Departments Retrieved from Database \\n\");\n console.table(answer);\n });\n main();\n}", "title": "" }, { "docid": "442c7ab5a26f73e64d8978e77c9402a0", "score": "0.7689627", "text": "function viewDepartment() {\n connection.query(\n \"SELECT * FROM department\",\n function(err, res) {\n if (err) throw err;\n console.table(res)\n start();\n }\n );\n}", "title": "" }, { "docid": "511b40e3baf88a6b55296d10be339e90", "score": "0.76397765", "text": "function seeDeparments() {\n connection.query(\n \"SELECT * FROM bamazon_departments\", function (err, response) {\n if (err) throw err;\n console.log(\"\\nThese are all the departments within Bamazon...\\n\");\n console.log(\"\\n----------------------------------------------\" + \"\\n\");\n for (var i = 0; i < response.length; i++) {\n console.log (response[i].department_name);\n \n }\n console.log(\"\\n----------------------------------------------\" + \"\\n\");\n console.log(\"What do you want to do next?\\n\");\n dashBoard();\n }\n );\n}", "title": "" }, { "docid": "e12ca503e341768d428d9d01a71a100b", "score": "0.7634234", "text": "static async getDepartments() {\n const res = await this.request(`hospital/departments`);\n return res;\n }", "title": "" }, { "docid": "c094cf91d1c2c2a46e6530cddad8d8ef", "score": "0.7602173", "text": "function getDepartmentList(){\n\t\tdoctorService.getDepartments().then(function(res){\n\t\t\t$scope.departmentList = res;\n\t\t});\n\t}", "title": "" }, { "docid": "1a7d29c8b1177c0ae9a6274ad67be011", "score": "0.7599959", "text": "function viewDepartments() {\n connection.query(\n \"SELECT name AS 'Department Name' FROM department\",\n function (err, res) {\n if (err) throw err;\n console.table(res);\n restartApp();\n });\n}", "title": "" }, { "docid": "010067fcf43a010e3846190de03fe279", "score": "0.7578738", "text": "GetAllDepartments() {\n const queryString = `SELECT * FROM department`;\n return this.ExecuteQuery(queryString, [])\n }", "title": "" }, { "docid": "92c36077f54f23c5f573768cccb54021", "score": "0.75597006", "text": "function viewDepartment() {\n var query = \"SELECT * FROM department\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.table(res);\n runSearch();\n });\n}", "title": "" }, { "docid": "1fab69c225d102d541d2fb5da64c9dfb", "score": "0.75477993", "text": "function listdepartments() {\n let departments = [];\n connection.query(\n \"SELECT name FROM department\",\n function (err, res) {\n if (err) throw err;\n for (i = 0; i < res.length; i++) {\n departments.push(res[i].name);\n }\n });\n return departments;\n}", "title": "" }, { "docid": "66944d757aa272a1b426c73acd61fc7d", "score": "0.753975", "text": "function viewAllEmpsByDept() {\n\t//\n\tconst query = 'SELECT name FROM department';\n\tconnection.query(query, function (err, res) {\n\t\tif (err) throw err;\n\t\tinquirer\n\t\t\t.prompt({\n\t\t\t\tname: 'deptChoice',\n\t\t\t\ttype: 'list',\n\t\t\t\tmessage: 'Choose a Department of whose Employees you would like to view: ',\n\t\t\t\tchoices: dept,\n\t\t\t})\n\t\t\t.then(function (answer) {\n\t\t\t\tconst query2 = `\n SELECT e.id AS employee_id, e.first_name, e.last_name, d.name AS department_name, r.title AS job_title, r.salary, CONCAT(x.first_name, \" \", x.last_name) AS manager_name \n FROM employee e\n LEFT JOIN role r\n ON e.role_id = r.id\n LEFT JOIN department d\n ON d.id = r.department_id\n LEFT JOIN employee x\n ON e.manager_id = x.id\n WHERE name = ?`;\n\t\t\t\tconnection.query(query2, [answer.deptChoice], function (err, res) {\n\t\t\t\t\tif (err) throw err;\n\t\t\t\t\t//Adds space between the console table\n\t\t\t\t\tconsole.log(`\t`);\n\t\t\t\t\tconsole.table(res);\n\t\t\t\t\treRun();\n\t\t\t\t});\n\t\t\t});\n\t});\n}", "title": "" }, { "docid": "626a0e07b4478d455f839f32503718a9", "score": "0.75329065", "text": "function viewAllDepartments() {\n dataB.allDepartments()\n .then(([rows]) => {\n let departments = rows;\n console.log(\"\\n\");\n console.table(departments);\n })\n .then(() => showPrompts());\n}", "title": "" }, { "docid": "56fb48b426b79c8566a32f5dde0f1fce", "score": "0.7523034", "text": "function viewDepartment() {\n connection.query(\"SELECT * FROM department\", (err, res) => {\n if (err) throw err;\n console.table(res);\n employeeQuesInit();\n });\n}", "title": "" }, { "docid": "d9ae163691bb0b40a15a2c37e80665f7", "score": "0.7518689", "text": "function viewDepartment() {\n console.log(\"Bringing up department...\\n\");\n connection.query(\"SELECT * FROM department\", function (err, res) {\n if (err) throw err;\n console.table(res);\n connection.end()\n });\n}", "title": "" }, { "docid": "31f3295ec956151a50c8a4b731df75b0", "score": "0.751389", "text": "function getAllDepartments(req, res) {\n Course.find().distinct('department',\n function(err, depts) {\n if (err) {\n res.send(err);\n } else {\n res.json(depts);\n }\n }\n );\n}", "title": "" }, { "docid": "f7961d860c6f191bddca117960dae34c", "score": "0.74865156", "text": "function getDepartments() {\n const constructedUrl = urlPrefix + departmentApiSuffix;\n return getAll(constructedUrl);\n}", "title": "" }, { "docid": "3bc7ca7974a14a450938d02d4cbb6b2b", "score": "0.748075", "text": "function getAllDepartments() {\n const sql = `SELECT departments.name AS Department, \n departments.id AS Department_ID \n FROM departments`;\n db.query(sql, (err, rows) => {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(rows);\n startPrompt();\n });\n}", "title": "" }, { "docid": "ac600bcb4e04a54a709b7cf21d002b42", "score": "0.74655735", "text": "function viewDepartments(db) {\n return db.queryDepartments().then(res => displayView(res, \"departments\"));\n}", "title": "" }, { "docid": "7eef6e80ca78d04b9340f8607be30082", "score": "0.740868", "text": "function viewDepartment() {\n const query = 'SELECT department.name, first_name, last_name FROM employee INNER JOIN department ON employee.role_id = department.id ORDER BY department.name';\n let deptList = [];\n connection.query(query, function (err, res) {\n for (let i = 0; i < res.length; i++) {\n deptList.push({Department: res[i].name, First_Name: res[i].first_name, Last_Name: res[i].last_name })\n }\n console.table(deptList);\n continuer()\n})\n}", "title": "" }, { "docid": "34c4f4fd85c88720fb133d842a030baf", "score": "0.74052024", "text": "function viewDepartments() {\n connection.query(\"SELECT * FROM department\", function (err, stuff) {\n if (err) {\n throw err;\n } else {\n console.table(stuff);\n start();\n }\n })\n\n}", "title": "" }, { "docid": "a1126a6f06a5e622f809d3980a729036", "score": "0.73957205", "text": "function viewAllbyDept(){\n connection.query(\n \"SELECT employee.`id`, employee.`first_name`, employee.`last_name`, employee.`manager_id`, role.`title`, role.`salary`, department.`dept_name` FROM `employee` LEFT JOIN `role` ON employee.`role_id` = role.`id` LEFT JOIN `department` on role.`department_id` = department.`id` ORDER BY department.`dept_name` ASC\",\n function (err, res){\n let employees = [];\n if (err) throw err;\n for (let i = 0; i < res.length; i++) {\n employees.push({\n \"Employee ID\": res[i].id,\n \"First Name\": res[i].first_name,\n \"Last Name\": res[i].last_name,\n \"Title\": res[i].title,\n \"Salary\": res[i].salary,\n \"Department\": res[i].dept_name,\n \"Manager ID\": res[i].manager_id\n });\n }\n console.table(employees);\n start();\n });\n}", "title": "" }, { "docid": "e1f600ba1bc77eaa5521529300566b0d", "score": "0.7322122", "text": "function viewDepartments(callback) {\n connection.query(\"SELECT dep_id, dep_name, over_head_costs, SUM(product_sales) AS product_sales, SUM(product_sales) - over_head_costs AS total_profit FROM departments JOIN products ON departments.dep_name = products.department_name GROUP BY dep_id\", function (err, res) {\n if (err) throw err;\n callback(res);\n });\n}", "title": "" }, { "docid": "42eb24e1c587e7e060252ee17928e13c", "score": "0.73046297", "text": "getDepartments(callback) {\n return connection.query(\"Select * from departments\", callback);\n }", "title": "" }, { "docid": "f54b26d715f518e83865a69f1c4bd305", "score": "0.7263509", "text": "function viewDepartment() {\n const query = 'SELECT * FROM employee_trackerdb.department';\n connection.query(query, (err, res) => {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(res);\n starterUp();\n return;\n })\n // console.log();\n // starterUp();\n}", "title": "" }, { "docid": "30f5d14fe1f95bd2dfb2a5978eb3138c", "score": "0.72550464", "text": "getListOfDept() {\n return new Promise(resolve => {\n connection.query(queryRun.viewListOfDept, function (err, res) {\n if (err) throw err;\n let listDept = [];\n for (var i = 0; i < res.length; i++) {\n listDept.push(res[i].name);\n }\n resolve(listDept);\n });\n });\n }", "title": "" }, { "docid": "111942383bb0eaec88ac31328b634d14", "score": "0.72540164", "text": "function viewDepartment() {\n var query = \"SELECT employee.id, employee.first_name, employee.last_name, department.name AS department FROM employee INNER JOIN role ON employee.role_id = role.id INNER JOIN department ON role.department_id = department.id ORDER BY employee.id\"\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.log(\"======================================\");\n console.table(res);\n console.log(\"======================================\");\n runSearch();\n });\n}", "title": "" }, { "docid": "0c1264f27e36e26d72045e7797590919", "score": "0.721295", "text": "function viewDepartment() {\n connection.query(\"SELECT * FROM departments\", function(err,res){\n if (err) throw err;\n for (var i = 0; i < res.length; i++){\n console.log(res[i].name);\n }\n connection.end();\n });\n\n}", "title": "" }, { "docid": "20aca31bf1412a4dac4ce6391c8e81fc", "score": "0.7159806", "text": "function allDepts() {\r\n // Connection to request all data from department table\r\n const sqlShow = `SELECT * FROM department`;\r\n dbConnector.query(sqlShow, (err, res) => {\r\n if (err) throw err;\r\n console.table(res);\r\n\r\n // Return to the choice prompt\r\n chooseOpt();\r\n })\r\n}", "title": "" }, { "docid": "d1fa6f2a320fe7976b6c1718ec1c8fa5", "score": "0.7141175", "text": "function viewDepartment() {\n connection.query(\"SELECT * FROM department\", function(err, res) {\n if (err) throw err;\n console.table(res);\n userQuestions();\n });\n}", "title": "" }, { "docid": "1d2cc8a2645d2e4caff9d480ad8c5a73", "score": "0.7128283", "text": "function queryDepartments() {\n let departments = [];\n connection.query('SELECT department_name FROM department', (error, response) => {\n if (error) throw error;\n\n response.forEach(department => {\n departments.push(department.department_name);\n })\n\n })\n\n return departments\n}", "title": "" }, { "docid": "37d8fedd57e08dbbce0fa91aa2d5eb4e", "score": "0.7126927", "text": "function loadDepartments() {\n console.clear();\n\n var query = \"SELECT department_name FROM departments ORDER BY department_name\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n\n res.forEach(function (ea) {\n departments.push(\n ea.department_name\n );\n })\n });\n}", "title": "" }, { "docid": "ada1e3d7b6347e20e3a3903c62c20824", "score": "0.71206665", "text": "function showDepartments() {\n connection.query('Select * from department', (err, res) => {\n if (err) {\n console.log(err)\n } else {\n console.table(res)\n }\n })\n userInteractionPrompt();\n}", "title": "" }, { "docid": "1e475fa94d0c2256324c30ab49a30407", "score": "0.7108911", "text": "function departmentList() {\n let departmentArr = [];\n connection.query(\"SELECT department_name FROM department\", function (\n err,\n res\n ) {\n if (err) throw err;\n res.forEach((role) => {\n departmentArr.push(role.department_name);\n });\n });\n return departmentArr;\n }", "title": "" }, { "docid": "045e10611e12e0689a32f02301914525", "score": "0.70982414", "text": "function byDepartment() {\n console.log(\"I'm viewing by dept\");\n connection.query(\"SELECT employee_id, first_name, last_name, dep_name, title FROM employee, my_role, department WHERE employee.role_id = my_role.role_id AND my_role.department_id = department.department_id ORDER BY department.department_id\", function (err, stuff) {\n if (err) {\n throw err;\n } else {\n console.table(stuff);\n start();\n }\n })\n}", "title": "" }, { "docid": "f34ad3b66bbec2db16e566eba36d2efe", "score": "0.70726216", "text": "function getDepartments(callback) {\n connection.query('SELECT * FROM departments', (err, data, fields) => {\n if (err) throw err;\n callback(data);\n })\n}", "title": "" }, { "docid": "3613eb6dec4ce119277b675a19fa4378", "score": "0.70496845", "text": "function getDepartments(res, mysql, context, complete){\r\n\t\tmysql.pool.query('SELECT dept_id, dept_name FROM department', \r\n\t\t\tfunction(error, results, fields){\r\n\t\t\t\tif(error){\r\n\t\t\t\t\tres.write(JSON.stringify(error));\r\n\t\t\t\t\tres.end();\r\n\t\t\t\t}\r\n\t\t\t\tcontext.department = results;\r\n\r\n\t\t\t\tcomplete();\r\n\t\t\t});\r\n\t}", "title": "" }, { "docid": "bf84435428ecd185adc01e374f886f9e", "score": "0.701294", "text": "function displayDepartments(departmentList) {\n console.table(departmentList);\n promptAction();\n}", "title": "" }, { "docid": "1e54e00e0e8d1a991d7d84a1979b354e", "score": "0.7000213", "text": "async function viewAllDepartments() {\n console.log(\"in function view all departments\");\n let query = \"SELECT * from department\";\n const departments = await db.query(query);\n console.table(departments);\n MainPrompt();\n //return departments;\n}", "title": "" }, { "docid": "5d8b2eef493a12429e0d3abf7c15ccf6", "score": "0.69846386", "text": "function getDepartments(res, mysql, context, complete){\n\t\tmysql.pool.query('SELECT dept_id, dept_name FROM department', \n\t\t\tfunction(error, results, fields){\n\t\t\t\tif(error){\n\t\t\t\t\tres.write(JSON.stringify(error));\n\t\t\t\t\tres.end();\n\t\t\t\t}\n\t\t\t\tcontext.department = results;\n\n\t\t\t\tcomplete();\n\t\t\t});\n\t}", "title": "" }, { "docid": "5d8ea6f1ca72dadbefcd8b0ed50ed48b", "score": "0.6977565", "text": "function allEmployeesDepartment() {\n var query = \"SELECT employee.first_name, employee.last_name, departmentName AS Department FROM employee JOIN role ON employee.role_id = role.id JOIN department ON role.department_id = department.id ORDER BY employee.id\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n });\n}", "title": "" }, { "docid": "9ccaf6a00de4c47a3297c15d08e05ded", "score": "0.6948032", "text": "function viewDepartments(db) {\n // this variable holds the sql request to view all information about the departments table\n const sql = `SELECT *\n FROM department`;\n\n // this query uses the above variable to query the database \n db.query(sql, (err, rows) => {\n if (err) {\n console.log(err);\n }\n\n // after the information is displayed the user is returned to the mwin menu\n console.table(rows);\n mainMenu(db);\n });\n}", "title": "" }, { "docid": "13974dc27a96c9314dddd03ca45f05e9", "score": "0.69297516", "text": "function getAlldepartments() {\n // return request and then connection.query is have the ablibly to have a promise.\n return connection.query('SELECT * FROM department')\n // a promise to run after request is fired\n // returns result in a table\n .then(results => {\n console.table(results);\n // a callback function to endProgram\n endProgram();\n })\n // if results are not obtainable, then \"catch\" the errer/ console.log errer\n .catch(err => console.log(err))\n}", "title": "" }, { "docid": "ca8f460071c99a3ba0a7bac83b56e0c3", "score": "0.69025606", "text": "function empByDept() {\n console.log(\"View all employees by department\");\n connection.query(\n `SELECT employee.id, employee.first_name, employee.last_name, roles.title, roles.salary, department.dept_name, concat(manager.first_name,\" \", manager.last_name) AS \"manager\"\n FROM employee\n LEFT JOIN employee AS manager ON employee.manager_id = manager.id\n LEFT JOIN roles ON employee.role_id = roles.id \n LEFT JOIN department ON roles.department_id = department.id\n ORDER BY department.dept_name`,\n function (err, res) {\n if (err) throw err;\n console.log(\n \"\\nEmployees by department\\n--------------------------------------\"\n );\n console.table(res);\n initApp();\n }\n );\n}", "title": "" }, { "docid": "7e8312609a959ce26a34a33266511050", "score": "0.68961394", "text": "async function viewEmployeesByDept(db) {\n return read.department(db)\n .then(answers => {\n if (!answers) {\n return [];\n }\n return db.queryEmployees(\"department\", answers.department);\n })\n .then(res => displayView(res, \"employees\"));\n}", "title": "" }, { "docid": "c4dd4eeb198248e7b1a5f36526995403", "score": "0.689613", "text": "function viewDepts() {\n let query = `SELECT department.name AS department, role.title, employee.id, employee.first_name, employee.last_name\n FROM employee\n LEFT JOIN role ON (role.id = employee.role_id)\n LEFT JOIN department ON (department.id = role.department_id)\n ORDER BY department.name;`;\n\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.table(res);\n mainMenu();\n })\n}", "title": "" }, { "docid": "31b5179807c7cd6f4a29dccd9d177fd4", "score": "0.68868995", "text": "function allDepartments() {\n return connection.query(\n \"SELECT department.id, department.name, SUM(role.salary) AS utilized_budget FROM department LEFT JOIN role ON role.department_id = department.id LEFT JOIN employee ON employee.role_id = role.id GROUP BY department.id, department.name\"\n );\n}", "title": "" }, { "docid": "12a61194df8e00fc425754a4bc7493a5", "score": "0.6881558", "text": "getAllDepartments() {\n\n return this.connection\n .promise()\n .query('SELECT * FROM departments')\n .catch(err=>err)\n\n }", "title": "" }, { "docid": "e6d1de1bc279c82c73d367d51ca67c07", "score": "0.68777514", "text": "function getDepartmentByName(name) {\n return connection.query(viewAllDepartmentsQuery + \" WHERE name = ?\", [name])\n}", "title": "" }, { "docid": "2311bd82ab32d7c54d6658b24d5ba816", "score": "0.6849656", "text": "function fetchDepartmentData() {\n \treturn DS.find('department', '')\n }", "title": "" }, { "docid": "da5f338bb69d21877288ff2046363d1d", "score": "0.68355894", "text": "function viewProductByDept() {\n // Prints the items for sale and their details\n connection.query('SELECT * FROM departments', function (err, products) {\n if (err) throw err;\n console.log('======================== PRODUCT SALES BY DEPARTMENTS =========================');\n console.log('----------------------------------------------------------------------------------------------------')\n\n for (var i = 0; i < products.length; i++) {\n console.log(\"Department id: \" + products[i].Departmentid + \" | \" + \"Department Name: \" + products[i].department_name + \" | \" + \"Over Head Cost: \" + (products[i].cost).toFixed(2) + \" | \" + \"Product Sales: \" + (products[i].total_sale).toFixed(2) + \" | \" + \"Total Profit: \" + (products[i].total_sale - products[i].cost).toFixed(2));\n console.log('--------------------------------------------------------------------------------------------------')\n }\n displayProducts();\n })\n}", "title": "" }, { "docid": "b5b123efe9510dc23f6e82b66415a2ad", "score": "0.68203413", "text": "function getAllDepartmentsQuery() {\n return new Promise((resolve, reject) =>\n pool.query(\n {\n sql: \"select * from Departments\",\n timeout: 40000 // 40s\n },\n function(error, result) {\n if (error) return reject(error);\n return resolve(\n result.map(({ ID, description, isSelectable, department }) => ({\n id: ID,\n description,\n isSelectable,\n department\n }))\n );\n }\n )\n );\n}", "title": "" }, { "docid": "5c442448aceebe92eac72217e7ca7689", "score": "0.6804373", "text": "function viewByDepartment(){\n let query = \"SELECT * FROM departments;\"\n connection.query(query, function (err, res){\n if (err) throw err;\n console.table(res);\n promptUser();\n })\n}", "title": "" }, { "docid": "7e84c92e7cd4667136cfcbcf2ac20571", "score": "0.6803654", "text": "function viewByDepartment() {\n inquirer\n .prompt({\n name: \"choice\",\n message: \"Which department you want to see?\",\n type: \"list\",\n choices: [\n \"Sales\",\n \"Engineering\",\n \"Finance\",\n \"Legal\"],\n }).then((result)=>{\n var department = result.choice;\n connection.query(\n \"SELECT * FROM employee WHERE department=?\", [department],\n \n function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n }\n );\n\n })\n }", "title": "" }, { "docid": "f002f3c59b8092a246446532202b6b5b", "score": "0.68000716", "text": "getDepartments() {\n return this.Department.findAll({ order: ['createdAt'] });\n }", "title": "" }, { "docid": "967846421f7ca11ea41c63df24dd818a", "score": "0.67878056", "text": "async function viewDepartments() {\n console.log(\"view departments\");\n try {\n let res = await fetchDepartments();\n console.table(res);\n displayQuestions();\n } catch (err) {\n console.log('error:', err);\n }\n}", "title": "" }, { "docid": "2e4e55088c32c56ab40794ef321b62bc", "score": "0.67834127", "text": "async function viewDepartments() {\n\n // Gets the database using \"MySQL syntax\" and returns an array with the requested objects inside.\n const [rows] = await connection.query('SELECT * FROM department')\n console.log(space)\n\n // Console table helps to display the array return from the query organize and clean.\n console.table(rows)\n console.log('\\n')\n\n // Go back to main menu.\n await userMenu();\n}", "title": "" }, { "docid": "24e9dec2444d6e23c62844aa2d41b547", "score": "0.67737687", "text": "function viewEmpsByDepartment(connection, department) {\n return new Promise((resolve, reject) => {\n let sqlQuery = 'SELECT emp.id, emp.first_name, emp.last_name, roles.title, departments.name AS department, CONCAT(mng.first_name, \" \", mng.last_name) AS manager';\n sqlQuery += \" FROM employees AS emp INNER JOIN roles ON emp.roles_id = roles.id\";\n sqlQuery += \" INNER JOIN departments on roles.department_id = departments.id LEFT JOIN employees AS mng ON emp.manager_id = mng.id\";\n sqlQuery += \" WHERE departments.name = ?\";\n connection.query(sqlQuery, department, function (err, data) {\n if (err)\n reject(err);\n else\n resolve(data);\n });\n });\n}", "title": "" }, { "docid": "0ae51dd2a194b67ec84ca477f33ad6c8", "score": "0.6765559", "text": "function departmentsTable() {\n connection.query(\n `\n SELECT \n id AS ID,\n department_name AS Department\n\n FROM departments\n `,\n function(err, res) {\n if (err) throw err;\n console.table(\"\\n\", res);\n return res;\n });\n begin();\n}", "title": "" }, { "docid": "93ebcf29f8f328cdb652f5b5ce0abbd3", "score": "0.67352116", "text": "async getDepartamentos(){\n return await axios.get(`${general.getServe()}universidad/departamentos/list`);\n }", "title": "" }, { "docid": "6ad89789f4e1c4a1ebdf63ad7854b7a7", "score": "0.6710074", "text": "function departments(){\n\tvar data = JSON.parse(this.responseText);\n\tdepartmentsDOM(data);\n}", "title": "" }, { "docid": "a6d06b66ed4003d63d73db7e7cdae225", "score": "0.6687456", "text": "function getDepartments(res,mysql,context,complete){\r\n mysql.pool.query(\"SELECT departmentID , departmentName FROM Departments\",function(error, results, fields){\r\n if(error){\r\n res.write(JSON.stringify(error));\r\n res.end();\r\n }context.departments = results;\r\n complete();\r\n });\r\n}", "title": "" }, { "docid": "c09d10e5c2e94d2133ccb399116d35df", "score": "0.6679127", "text": "function showDepartments() {\n // Call CRUD\n create.readDepartment();\n restart();\n\n\n\n}", "title": "" }, { "docid": "fcac368703fc71426f5e56d8cab799e9", "score": "0.66557086", "text": "function getDepartments() {\n return new Promise((resolve, reject) => {\n connection.query(\"SELECT departments.id, name FROM departments\", (err, res) => {\n if (err) {\n throw err;\n }\n for (let i = 0; i < res.length; i++) {\n departmentsList.push({ name: res[i].name, value: res[i].id });\n }\n resolve(departmentsList);\n });\n });\n}", "title": "" }, { "docid": "eacb3cf283e32d05a33895ab2ac3812f", "score": "0.66384584", "text": "function viewEmployeeByDepartment() {\n\tconsole.log(\"View employees by department\\n\");\n\n\tvar query = `SELECT d.id, d.name\n\tFROM employee e\n\tLEFT JOIN role r\n\tON e.role_id = r.id\n\tLEFT JOIN department d\n\tON d.id = r.department_id\n\tGROUP BY d.id, d.name`;\n\n\tconnection.query(query, function (err, res) {\n\t\tif (err) throw err;\n\n\t\t// Select department\n\t\tconst departmentChoices = res.map((data) => ({\n\t\t\tvalue: data.id,\n\t\t\tname: data.name,\n\t\t}));\n\n\t\tinquirer\n\t\t\t.prompt(prompt.departmentPrompt(departmentChoices))\n\t\t\t.then(function (answer) {\n\t\t\t\tvar query = `SELECT e.id, e.first_name, e.last_name, r.title, d.name AS department \n\t\t\tFROM employee e\n\t\t\tJOIN role r\n\t\t\t\tON e.role_id = r.id\n\t\t\tJOIN department d\n\t\t\tON d.id = r.department_id\n\t\t\tWHERE d.id = ?`;\n\n\t\t\t\tconnection.query(query, answer.departmentId, function (err, res) {\n\t\t\t\t\tif (err) throw err;\n\n\t\t\t\t\tconsole.table(\"\\nDepartment Role: \", res);\n\t\t\t\t\tconsole.log(\"\\n----------------------------\\n\");\n\n\t\t\t\t\tfirstPrompt();\n\t\t\t\t});\n\t\t\t});\n\t});\n}", "title": "" }, { "docid": "096a9e3d3dbb811b8fcebd39539054fa", "score": "0.6635411", "text": "function viewByDepartment() {\n return connection.query(\"SELECT * FROM department;\", (err, results) => {\n if (err) {\n throw err;\n }\n const listDepartments = results.map((row) => row.department_name);\n\n return inquirer\n .prompt([\n {\n name: \"choice\",\n type: \"list\",\n message: \"What department would you like to see?\",\n choices: listDepartments,\n },\n\n ])\n .then((answer) => {\n let query = \"SELECT department.department_name AS department, e.id, e.first_name, e.last_name, employee_role.title, employee_role.salary, CONCAT(m.first_name, ' ', m.last_name) AS manager\";\n query += \" FROM employees AS e LEFT JOIN employees AS m ON e.manager_id = m.id LEFT JOIN employee_role ON e.role_id= employee_role.id\";\n query += \" LEFT JOIN department ON employee_role.department_id= department.id WHERE department_name = ?;\";\n connection.query(query, [answer.choice], (err, result) => {\n if (err) {\n throw err;\n }\n console.table(result);\n start();\n\n });\n\n });\n });\n}", "title": "" }, { "docid": "1ff427d12a7a2ae3aadb8aca8eaa1aab", "score": "0.662895", "text": "function fetchDepartments() {\n return new Promise(function (resolve, reject) {\n connection.query(\"select * from department\", function(err, res) {\n if (err) {\n reject(err);\n } else {\n resolve(res);\n }\n \n });\n });\n}", "title": "" }, { "docid": "ce79d0924c30d099a10c1e74b3aad8a8", "score": "0.6612686", "text": "function get_departments(data, callback){\n var sql =\"SELECT DISTINCT department_name FROM products\"\n\n connection.query(sql, function(err, results){\n if (err) throw err;\n departments = results;\n\n return callback(results);\n })\n}", "title": "" }, { "docid": "b2c2390f2d54b828b65c3bca4c14a3c5", "score": "0.6573349", "text": "function viewByDepartment(){\n const query = \"SELECT e.id, CONCAT(e.first_name, ' ', e.last_name) AS Name,roles.title AS Title, roles.salary AS Salary, departments.dept_name AS Department, CONCAT(m.first_name, ' ', m.last_name) AS Manager FROM employees e INNER JOIN roles ON e.role_id = roles.id INNER JOIN departments ON roles.department_id = departments.id LEFT JOIN employees m ON e.manager_id = m.id ORDER BY departments.dept_name;\";\n \n \n connection.query(query, function (err, res){\n console.log(\"\\n\");\n console.table(res);\n init();\n })\n\n \n}", "title": "" }, { "docid": "79fe426daa53ce9eb07ad9f3756874bf", "score": "0.65729547", "text": "function GetDepartment(deptList)\n{\n let departments = '';\n for(const dept of deptList)\n {\n departments = `${departments} <div class='dept-label'>${dept}</div>`\n }\n return departments;\n}", "title": "" }, { "docid": "4c7b37c1372a90da6af2f9fbbb572cd5", "score": "0.6570325", "text": "function viewDepartmentBudget() {\n\tvar query = `SELECT d.name, \n\t\tr.salary, sum(r.salary) AS budget\n\t\tFROM employee e \n\t\tLEFT JOIN role r ON e.role_id = r.id\n\t\tLEFT JOIN department d ON r.department_id = d.id\n\t\tgroup by d.name`;\n\n\tconnection.query(query, function (err, res) {\n\t\tif (err) throw err;\n\n\t\tconsole.log(`\\nDEPARTMENT BUDGETS:\\n`);\n\t\tres.forEach((department) => {\n\t\t\tconsole.log(\n\t\t\t\t`Department: ${department.name}\\n Budget: ${department.budget}\\n`,\n\t\t\t);\n\t\t});\n\t\tconsole.log(\"\\n---------------------------------------------\\n\");\n\t\tfirstPrompt();\n\t});\n}", "title": "" }, { "docid": "e025f2aa4013ce545a0b11f251b280d0", "score": "0.6562107", "text": "function viewDepartment() {\n //query DB for all departments to form prompt list\n connection.query(\"SELECT dept_name FROM department\", (err, res) => {\n if (err) throw err;\n\n inquirer\n .prompt([\n {\n type: \"rawlist\",\n message: \"For which department do you wish to obtain info?\",\n choices() {\n const deptArray = [];\n res.forEach(({ dept_name }) => {\n deptArray.push(dept_name);\n });\n return deptArray;\n },\n name: \"deptChoice\",\n },\n ])\n .then((response) => {\n //query DB for relevant results to display\n connection.query(\n `SELECT first_name, last_name, title, MANAGER_ID, salary, dept_name FROM employee INNER JOIN role ON employee.role_id = role.id INNER JOIN department ON role.department_id = department.id WHERE dept_name = \"${response.deptChoice}\"`,\n (err, res) => {\n if (err) throw err;\n const table = cTable.getTable(res);\n console.log(table);\n\n mainMenu();\n }\n );\n });\n });\n}", "title": "" }, { "docid": "6bab1bfc2a34aacebf330b802b71e016", "score": "0.65515447", "text": "function showSpecial() {\n connection.query(\"SELECT * FROM department\", function (err, result, fields) {\n if (err) throw err;\n console.table(result);\n runSearch();\n });\n}", "title": "" }, { "docid": "58c8c55b6bed31747ab372feb08b804f", "score": "0.65338165", "text": "function viewProductDepartment() {\n connection.query(\"SELECT d.department_id, d.department_name, d.over_head_costs, p.product_sales * p.price as 'Product_Sales', (p.product_sales * p.price) - d.over_head_costs AS Profit FROM departments d, products p WHERE p.department_name = d.department_name ORDER BY department_id ASC\", function (err, results) {\n if (err) throw err;\n //console.log(results);\n console.log('-----------------------------------------------------------------------');\n console.log('____________.~\"~._.~\"~._.~Welcome to BAMazon~._.~\"~._.~\"~._____________');\n console.log('-----------------------------------------------------------------------');\n console.table(results);\n menuOptions();\n });\n}", "title": "" }, { "docid": "4dd208d52ba250a2ec795093a417c3a0", "score": "0.6498023", "text": "function displayEmployeesDepartment() {\n var query = \"SELECT employee_id, first_name, last_name, title, department_name, salary, manager_id \";\n query += \"FROM employee \";\n query += \"LEFT JOIN role ON employee.role_id = role.role_id \";\n query += \"LEFT JOIN department ON role.department_id = department.department_id \";\n query += \"ORDER BY department_name\"\n // console.log(query);\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.table(res);\n runSearch();\n })\n}", "title": "" }, { "docid": "a84e729de0b56be798734dad375ebdb8", "score": "0.648161", "text": "async function getAllDeparments() {\n try {\n const departmentList = await connection.query(viewAllDepartmentsQuery);\n const departmentNames = [];\n await departmentList.forEach(department => {\n departmentNames.push(department.name);\n });\n return { departmentNames };\n } catch (err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "e1ea5c9f8845ea58d1a8bc79370dd97a", "score": "0.6459079", "text": "async showAllDepartments() {\n let result = await this.db.query(\"SELECT id, title AS Name FROM departments\"); \n //print results to console\n let data = result[0];\n let t = new Table;\n\n data.forEach((department) => {\n t.cell('id', department.id);\n t.cell('Name', department.Name);\n t.newRow();\n })\n console.log('\\n\\n' + t.toString());\n }", "title": "" } ]
516ad70b96d72942db75e56c3f91ca54
Dequeue the next displayable and return it
[ { "docid": "3dd8e1b0d25e42e09efb3a3ccc1bbb7d", "score": "0.7530443", "text": "dequeue () {\n\t\treturn this[DISPLAY_LIST].shift();\n\t}", "title": "" } ]
[ { "docid": "fc05d31223ee1ce7881ed0f9173ee8b8", "score": "0.67623806", "text": "function DequeueNext() {\n\tm_refreshing = true;\n\t/*\n\tif( m_queue.length == 0 ) {\n\t\tm_refreshing = false;\n\t\treturn;\n\t}*/\n\tif( m_queued == 0 ) {\n\t\tm_refreshing = false;\n\t\treturn;\n\t}\n\tm_queued--;\n\t//m_current_serial = m_queue.shift();\n\tDoRefresh();\n}", "title": "" }, { "docid": "4f8b8877183804aac229ad8624f6f689", "score": "0.67303306", "text": "dequeue() {\n if (this.head !== null) {\n return 'No item !'\n } else {\n let itemToPop = this.head;\n this.head = this.head.next;\n return itemToPop;\n }\n }", "title": "" }, { "docid": "c33e00eb8875fc35168dc1bf8913946a", "score": "0.662921", "text": "displayNext ( callback ) {\n\t\tconst displayable = this.dequeue();\n\n\t\tif ( displayable ) {\n\t\t\tconst promise = displayable();\n\n\t\t\tthis[CURRENT_PROMISE] = promise;\n\t\t\tpromise\n\t\t\t\t.then(() => {\n\t\t\t\t\tthis.displayNext( callback );\n\t\t\t\t})\n\t\t\t\t.catch( err => {\n\t\t\t\t\tthis.displayNext( callback );\n\t\t\t\t});\n\t\t} else {\n\t\t\tthis[CURRENT_PROMISE] = null;\n\t\t\tif ( callback ) {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t\tthis.fireEvent( this.EVENTS.EMPTIED );\n\t\t}\n\t}", "title": "" }, { "docid": "93368f87bacb7128b1e467f2d6c074ee", "score": "0.6554379", "text": "dequeue() {\n // return the dequeued element \n // and remove it. \n // if the queue is empty \n // returns Underflow \n if (this.isEmpty())\n return \"Underflow\";\n return this.items.shift();\n }", "title": "" }, { "docid": "91b1524eac2b2b622f4e862d9f9b0e02", "score": "0.6486542", "text": "dequeue() {\n if (this.isEmpty()) {\n return null;\n }\n\n return this.list.shift().value;\n }", "title": "" }, { "docid": "92f4b52d8c889db21fc6813f41e01dfd", "score": "0.6482004", "text": "dequeue()\r\n {\r\n if (this.isEmpty()){\r\n return null;\r\n }\r\n return this.items.shift();\r\n }", "title": "" }, { "docid": "1d200ee94c3831e5a52c9046d57c9ccb", "score": "0.6464544", "text": "dequeue() {\n const value = _(this).collection.shift();\n return value[0];\n }", "title": "" }, { "docid": "db3cfd782dbe0f6bcea709a3e1df9e55", "score": "0.6438022", "text": "dequeue(){\n if(this.isEmpty()){\n return \"Empty Queue\"\n }\n return this.items.shift();\n }", "title": "" }, { "docid": "8697ebe284ad120c5fffe08ea7b14bb4", "score": "0.64312327", "text": "function dequeue(){\n return queue.shift();\n }", "title": "" }, { "docid": "27349c4def3035babc6c786c728e0a2a", "score": "0.6413989", "text": "dequeue() {\n this.list.remove(this.peekFront)\n }", "title": "" }, { "docid": "bbe98f67c26006482b9abd8a6cbde94a", "score": "0.6413351", "text": "dequeue() {\n if(! this.isEmpty()) return this.items.shift()\n else return undefined\n }", "title": "" }, { "docid": "bed76c6590ed3e65a1ee813eef732a1f", "score": "0.63888097", "text": "deQueue() {\n if (!this.head) {\n return \"No item\";\n } else {\n let itemToPop = this.head;\n this.head = this.head.next;\n return itemToPop;\n }\n }", "title": "" }, { "docid": "071bd3bb9cc135e17b1ad504e0e1efdf", "score": "0.63645136", "text": "dequeue() {\n this.size -= 1;\n return this.queue.shift();\n }", "title": "" }, { "docid": "723033acc93ab6a5ba1854c283b519b2", "score": "0.63421094", "text": "dequeue() {\n //if the queue is empty, there is nothing to return\n if (this.first === null) {\n return;\n }\n const node = this.first;\n this.first = node.next;\n //if this is the last item in the queue\n if (node === this.last) {\n this.last = null;\n }\n return node.value;\n }", "title": "" }, { "docid": "7ac438525920ff3a337e204da0e3014e", "score": "0.63401604", "text": "dequeue() {\n if (!this.first) return null;\n\n let current = this.first;\n if (this.first === this.last) this.last = null;\n this.first = this.first.next;\n this.size--;\n return current.val;\n }", "title": "" }, { "docid": "5d93f036b53bcf2d4de16170f92a5523", "score": "0.63260096", "text": "dequeue() {\n //if the queue is empty, there is nothing to return\n if (this.first === null) {\n return;\n }\n const node = this.first;\n this.first = this.first.next;\n //if this is the last item in the queue\n if (node === this.last) {\n this.last = null;\n }\n return node.value;\n }", "title": "" }, { "docid": "d99e0995d77284c1010958fd53262a95", "score": "0.63162637", "text": "dequeue(){\n //if queue is empty, nothing to remove\n if(this.first === null){\n return;\n }\n\n //set pointer to first item\n const node = this.first\n\n //move pointer to next in the queue and make it first\n this.first = this.first.next;\n\n //if this is the last item in the queue\n if(node === this.last){\n this.last = null;\n }\n return node.value;\n }", "title": "" }, { "docid": "9a73d949563f674b7d3d99b6fce3c04a", "score": "0.63115853", "text": "function dequeue() {\n return queue[index++];\n }", "title": "" }, { "docid": "c7dbfd14735f5cc4c72c2359a704f2dd", "score": "0.6294032", "text": "dequeue () {\n this.head.shift()\n }", "title": "" }, { "docid": "85597642fa193c7df5e58a84c1c7d53a", "score": "0.6282834", "text": "dequeue() {\n return this._queue.shift();\n }", "title": "" }, { "docid": "75fcea349bdf599fd5a1159041006a0c", "score": "0.62742406", "text": "dequeue() {\n if (this.size === 0) {\n return null\n }\n var temp = this.first;\n if (this.first === this.last) {\n this.last = null;\n }\n // remove from the head\n this.first = this.first.next\n this.size--\n return temp.value;\n }", "title": "" }, { "docid": "6a7cc96aee94d3e71fca8f4acd30b3ec", "score": "0.62694526", "text": "dequeue() {\n\t\t// the first item in the queue\n\t\tconst item = this.storage.remove_from_head();\n\t\tif (this.isEmpty() !== true) {\n\t\t\t// only do this if the item is not null\n\t\t\tthis.length--;\n\t\t}\n\n\t\treturn item;\n\t}", "title": "" }, { "docid": "9981e686390f4ae39f3120f7741312ff", "score": "0.62609583", "text": "dequeue() {\n const node = this.head;\n\n if (node === null) {\n console.log(new Error('No more items in the queue.'))\n return;\n }\n this.head = this.head.next;\n\n return node.value;\n }", "title": "" }, { "docid": "ca02e8e1d66fcd4e56955bc953a8541c", "score": "0.62582356", "text": "dequeue() {\n if (this.tail > this.head) {\n const value = this.storage[this.head];\n delete this.storage[this.head];\n this.head++;\n return value;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "bba08b225bd91fcf4d7d9bbfd3cc8acf", "score": "0.62573916", "text": "dequeue() {\n // Check if queue is empty\n if (this.first === null) {\n return null;\n }\n\n // Get the first node in the list\n let node = this.first;\n\n // Shift the next node in the queue to first\n this.first = this.first.next;\n\n // If the node is in the last position of the queue\n if (node === this.last) {\n this.last = null;\n }\n return node.value;\n }", "title": "" }, { "docid": "5bb261c5cbaa6e67567c4478a4879759", "score": "0.6250756", "text": "dequeue() { \n let removed = this.front\n this.front = this.front.next\n return removed\n }", "title": "" }, { "docid": "fc90ce41a89a5cea74212e93c4743ffb", "score": "0.6249441", "text": "dequeue(){\n //if queue is empty there is nothing to return\n if(this.first === null){\n return;\n }\n const node = this.first;\n this.first = this.first.next;\n //if this is last item in queue\n if(node === this.last){\n this.last = null;\n }\n return node.value\n }", "title": "" }, { "docid": "5c1479c1736947095ca313f40886fbfa", "score": "0.62480825", "text": "dequeue() {\n return queue.pop();\n }", "title": "" }, { "docid": "5c1479c1736947095ca313f40886fbfa", "score": "0.62480825", "text": "dequeue() {\n return queue.pop();\n }", "title": "" }, { "docid": "bab08858d7a6eff11dc86566a1bfc4c2", "score": "0.6247753", "text": "dequeue() {\n return queue.pop()\n }", "title": "" }, { "docid": "6ce8107cf13b5e947f56e2ff6b06cd93", "score": "0.6246765", "text": "dequeue() {\n if (!this.first) return null;\n const temp = this.first;\n if (this.first === this.last) {\n this.first = null;\n }\n this.first = this.first.next;\n this.size -= 1;\n return temp.val;\n }", "title": "" }, { "docid": "e3863102ff68ff8ee4c529b7bf95360d", "score": "0.62459993", "text": "dequeue() {\n if (this.first === null) {\n return;\n }\n // we need to save this first node before replacing it so that we can check\n // if it is the only item on the list\n const node = this.first;\n this.first = this.first.next;\n if (node === this.last) {\n this.last = null;\n }\n // need this to be returned so you can use its value later\n this.size--;\n return node.value;\n }", "title": "" }, { "docid": "72355c74a6c0aafdcf694b6d738de170", "score": "0.6236302", "text": "dequeue() {\n if(!this.front) return null;\n if(this.size === 1) {\n let retVal = this.front.value;\n this.front = null;\n this.back = null;\n this.size--;\n return retVal;\n } else {\n let iteratorNode = this.front;\n while(iteratorNode.next !== this.back) {\n iteratorNode = iteratorNode.next;\n }\n let retVal = this.back.value;\n iteratorNode.next = null;\n this.back = iteratorNode;\n this.size--;\n return retVal;\n }\n }", "title": "" }, { "docid": "48f7f8b9c6a48ab62fb720ca98c82efb", "score": "0.62327266", "text": "dequeue(){\n //if queue is empty return false\n if (this.size === 0) return false;\n //get dequeuednode\n const dequeuedNode = this.first;\n //get new first (could be NULL if stack is length 1)\n const newFirst = this.first.next;\n //if newFirst is null, reassign last to newFirst(null)\n if (!newFirst) {\n this.last = newFirst;\n }\n //assign new first\n this.first = newFirst;\n //remove reference to list\n dequeuedNode.next = null;\n //remove 1 from size\n this.size--;\n //return dequeuednode\n return dequeuedNode.value;\n }", "title": "" }, { "docid": "a7621a12a2d3f701678d742e97afee00", "score": "0.62311894", "text": "dequeue() {\n try {\n if(this.isEmpty) return null\n\n const firstValue = this._storage[this._head]\n delete this._storage[this._head]\n this._head++\n this._length--\n return firstValue\n } catch(err) {\n throw new Error(err)\n }\n }", "title": "" }, { "docid": "8e90e2c3483fa10ac34c88bf677dd755", "score": "0.62296075", "text": "dequeue() {\n if (!this.first) throw new Error(\"Cannot dequeue! Queue is empty\");\n let removed = this.first;\n // only one item in queue: remove it and set last to be null\n if (this.first === this.last) {\n this.last = null;\n }\n // set first to be what came after first, which will be null if queue has only one item\n this.first = this.first.next;\n this.size -= 1;\n return removed.val;\n }", "title": "" }, { "docid": "2683e2f0143a5dfbfa30ef270bedd574", "score": "0.62280303", "text": "dequeue(){\n let dequeue = this.linkedList.deleteHead();\n return dequeue ? dequeue.value : null;\n }", "title": "" }, { "docid": "68892f42f6924a72106447e644657b2a", "score": "0.62271386", "text": "next() {\n return queue.shift();\n }", "title": "" }, { "docid": "4c6648572998397c9b7b8b8092ff3bdc", "score": "0.6220729", "text": "dequeue() {\n return this.queue.shift()\n }", "title": "" }, { "docid": "ba77ce73115555572ac3546f3fd7c803", "score": "0.61664563", "text": "dequeue() {\n\t\treturn this.items.shift();\n\t}", "title": "" }, { "docid": "9b3c6b67e283b36653abd748b73f10bf", "score": "0.6161736", "text": "dequeue() {\n this._queue.shift();\n }", "title": "" }, { "docid": "d307dc27d66778fc59a5a43b9bed6738", "score": "0.61545926", "text": "dequeue() {\n if(this.items.length > 0) {\n return this.items.shift();\n }\n }", "title": "" }, { "docid": "fe29683a16d5901d65d8970920d528d2", "score": "0.6149904", "text": "dequeue() {\n return this.items.shift();\n }", "title": "" }, { "docid": "6e449e34d145085d50f749eb6e8ab716", "score": "0.61466265", "text": "function peek(){\n return queue[0];\n }", "title": "" }, { "docid": "88619991dbfd545f212029fa80803c36", "score": "0.6142055", "text": "dequeue() {\n\n //如果是剛建立,沒有任何node的queue,this._head的初始數值就是null\n if (!this.head) {\n return null;\n }\n\n const valueOfHeadNode = this._head;\n\n if (this.head === this.tail) {\n // 如果目前queue只有一個元素,這樣頭跟尾都的地址都是同一個node\n // 所以 this._head === this._tail 等於拿同一個node做比較\n this.head = null;\n this.tail = null; // 利用null值來清空目前的queue\n } else {\n this.head = this.head.nextNode;\n // tail 不變\n }\n\n // 無論是if或是else condition,都會減少一個元素,所以要更新nodesCounts\n this._subtractNodesCounter();\n return valueOfHeadNode;\n }", "title": "" }, { "docid": "8d6e2af3dc6de01589f9ac30e2ff9b06", "score": "0.6136999", "text": "dequeue() {\n\t\treturn this.shift();\n\t}", "title": "" }, { "docid": "855d1d8d6bad81f3c3cf401562ad61e8", "score": "0.6131398", "text": "dequeue() {\n // save item to return\n const item = this.first.item;\n\n // delete first node\n this.first = this.first.next;\n\n if (this.isEmpty()) {\n this.last = null;\n }\n \n // return saved item\n return item;\n }", "title": "" }, { "docid": "311845210e68f82ebc22f0f7c437fa19", "score": "0.6126518", "text": "dequeue() {\n return _(this).collection.shift();\n }", "title": "" }, { "docid": "e2a58f9bb3a92bdaedd8839fcd1ab5fe", "score": "0.6097764", "text": "dequeue() {\r\n return this.data.removeFromFront();\r\n }", "title": "" }, { "docid": "33d3aa085c25c2b83e26d8dd3ea0e3ea", "score": "0.6095885", "text": "dequeue() {\n if (this.isEmpty()) \n throw \"Queue is Empty\"; \n return this.queue.shift(); \n }", "title": "" }, { "docid": "6c8d0e05efd0c0d5a7b0ca88743f64da", "score": "0.60869205", "text": "dequeue () {\n if (this.length <= 1) {\n this.first = null\n this.last = null\n this.length = 0\n } else {\n const secondNode = this.first.next\n secondNode.prev = null\n\n this.first = secondNode\n\n this.length--\n }\n this.printQueue()\n }", "title": "" }, { "docid": "ad4a5efa3cbe4d8da22f507b1efbe635", "score": "0.60787886", "text": "peek() {\n if(this.queue.length) return this.queue[0]; \n else return null; \n }", "title": "" }, { "docid": "69a296dffb12f5e0f67ebce8ff47c546", "score": "0.6075202", "text": "deque() {\n if (this.front == -1) {\n console.log(\"Queue is empty\");\n return null;\n }\n var ele = this.items[this.front++];\n this.Size--;\n if (this.front > this.rear) {\n this.front = this.rear = -1;\n }\n return ele;\n }", "title": "" }, { "docid": "c87b3f38f32dd3fbe388dd38046c7b0a", "score": "0.6039562", "text": "dequeue() {\n if (this.length === 0) throw new Error(\"No more items in queue\");\n\n const oldHead = this.head;\n\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.head = oldHead.next;\n oldHead.next = null;\n }\n\n this.length--;\n\n return oldHead.val;\n }", "title": "" }, { "docid": "26399930e8ed1399a14410b06568abe4", "score": "0.6038091", "text": "dequeue() {\n if(!this.first) {\n return null;\n }\n if(this.first === this.last) {\n this.last = null;\n }\n this.first = this.first.next;\n this.size--;\n return true;\n }", "title": "" }, { "docid": "8f5dffc0f9041604d8cf05c4d47a5146", "score": "0.6036072", "text": "dequeue() {\n if (this.isEmpty()) {\n return \"Queue is empty: underflow.\";\n } else {\n return this.items.shift();\n }\n }", "title": "" }, { "docid": "329c97735dad62d3886e6e56d3f67d0b", "score": "0.6035563", "text": "dequeue() {\n return this.collection.shift()[0]\n }", "title": "" }, { "docid": "f52eb846f426ef37afee2401d139a423", "score": "0.6027736", "text": "dequeue() {\n if(this.size === 0){\n throw Error('queue is empty');\n }\n\n // linkedList\n // const returnVal = this._linkedList.shift();\n // this.first = this._linkedList.head;\n // this.last = this._linkedList.tail;\n // this.size = this._linkedList.length;\n\n // array\n const returnVal = this._array.shift().val;\n this.first = this._array[0];\n this.last = this._array[this._array.length - 1];\n this.size = this._array.length;\n\n return returnVal;\n }", "title": "" }, { "docid": "348fd8e9fdfcaa79b3d6699826b599e5", "score": "0.60221446", "text": "dequeue() {\n\t\treturn this.items.removeHead();\n\t}", "title": "" }, { "docid": "b690a6cb1870c7fba0bfe2f6bfab6b28", "score": "0.6013671", "text": "dequeue() {\n if (!this.first) {\n return null;\n }\n if (this.first === this.last) {\n this.last = null;\n }\n this.first = this.first.next;\n this.length--;\n\n return this;\n }", "title": "" }, { "docid": "32e34a0f5a6f5ab3e9631c2e0c1879fa", "score": "0.60064596", "text": "dequeue(){\n if(this.size === 0) return undefined;\n const node = this.first;\n\n this.first = this.first.next;\n\n this.size--;\n\n if(this.size === 0) this.last = undefined;\n\n node.next = undefined;\n return node;\n }", "title": "" }, { "docid": "6a093e504e3e25d95ec6195eded4b7fa", "score": "0.6003842", "text": "dequeue() {\n if (!this.first) return null;\n\n let temp = this.first;\n // 1 node left\n if (this.first === this.last) {\n this.last = null;\n }\n // so if one node left, this.first.next is also null\n // first and last pointer overlap\n this.first = this.first.next;\n this.size--;\n\n return temp.value;\n }", "title": "" }, { "docid": "56f479b9f638eb6ec74b0913f1f7007b", "score": "0.600293", "text": "dequeue() {\n return this.collection.shift();\n }", "title": "" }, { "docid": "de18a4318d6b4bf773f9f52c609a9e1f", "score": "0.60000527", "text": "dequeue() {\n const element = this.queue.binaryTree.shift();\n this.queue.binaryTree.unshift(this.queue.binaryTree.pop());\n this.queue.siftDown(0);\n return element;\n }", "title": "" }, { "docid": "2c1cab94f03b831d7bb56c2e50d7ac07", "score": "0.5996724", "text": "dequeue(){\n if(this.isEmpty()){\n throw Error ('The Queue is Empty, Unable to dequeue()');\n }else{\n const removingElement = this.queue[this.front];\n this.front +=1;\n return removingElement;\n }\n }", "title": "" }, { "docid": "389c8acccd65f78b41852895afc65783", "score": "0.5990811", "text": "dequeue() {\n\t\tif (this.head == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (this.head == this.tail) {\n\t\t\tvar temp = this.head;\n\t\t\tthis.head = null;\n\t\t\tthis.tail = null;\n\t\t\treturn temp.value\n\t\t}\n\n\t\tvar runner = this.head;\n\t\ttemp = this.tail;\n\t\tif (this.head == null || this.tail == null) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// 2nd to last's next will be tail\n\t\twhile (runner.next.next != null) {\n\t\t\trunner = runner.next;\n\t\t}\n\t\trunner.next = null;\n\t\tthis.tail = runner;\n\n\t\treturn temp.value;\n\t}", "title": "" }, { "docid": "11fb1e15292bd4d5d27e402fac4097d0", "score": "0.59874636", "text": "dequeue() {\n // If the queue is empty, there is nothing to dequeue\n if ( this.first === null ) {\n return;\n };\n\n // Declare our node to dequeue\n const node = this.first;\n // Set the 2nd item in queue to our first\n this.first = this.first.next;\n\n // If this is the last item in the queue\n if ( node === this.last ) {\n // Set our last to null\n this.last = null;\n };\n\n return node.val;\n }", "title": "" }, { "docid": "5a1dd3294927a0052d3f7ddea70759d9", "score": "0.5981788", "text": "dequeue() {\n if (this.front === null) {\n return null; // if empty return nothing\n };\n if (this.front === this.back) {\n this.back = null;\n };\n let node = this.front;\n this.front = node.next;\n node.next = null;\n this.length--;\n return node;\n }", "title": "" }, { "docid": "6540b83fa7f4ce7cb76175dbc5450924", "score": "0.59785086", "text": "dequeue(){\n if(!this.first){\n return null;\n }\n if(this.first === this.last){\n this.last = null;\n }\n this.first = this.first.next\n this.length --; \n return this;\n }", "title": "" }, { "docid": "eb1bd9a67694f7873d51b00a775186cb", "score": "0.59763664", "text": "dequeue() {\n if (this.isEmpty) { throw new Error(\"Can't remove from empty queue\") };\n return this.#queue.pop();\n }", "title": "" }, { "docid": "159575886db83a6ac9c11074c2fba255", "score": "0.59737134", "text": "dequeue () {\n this.head = this.head.next\n\n //make sure tail gets empty is it is the last item.\n if (!this.head) {\n this.tail = null\n }\n }", "title": "" }, { "docid": "3e58faddb1fa7bcf2e1739d604005163", "score": "0.59700656", "text": "dequeue(data) {\n if (this.size() === 0) {\n return null\n } else {\n let dequeuedData = this.get(0)\n this.remove(0)\n return dequeuedData\n }\n }", "title": "" }, { "docid": "7dfd84f470e97c6cfc0afe4e026d706d", "score": "0.596023", "text": "dequeue() {\n this.queue.shift()\n}", "title": "" }, { "docid": "58ddf5c6ed9b5a7064a224fe07de4b7b", "score": "0.59582347", "text": "dequeue(){\n if(!this.first) return null\n var node;\n if(this.length===1){\n node = this.first;\n this.first = null;\n this.last = null;\n }\n else{\n node = this.first;\n this.first = this.first.next;\n }\n this.length--;\n return node;\n }", "title": "" }, { "docid": "69edd9a1a615f0a02fbb8d1691863cc7", "score": "0.5954072", "text": "dequeue() {\n // Time Complexity O(n)\n return this.list.shift();\n }", "title": "" }, { "docid": "3dad40d07763926f47d7f9f77509a273", "score": "0.595182", "text": "dequeue() {\n if (!this.length) return null;\n\n const removedNode = this.first;\n if (this.length === 1) {\n this.first = null;\n this.last = null;\n }\n\n this.first = removedNode.next;\n this.length -= 1;\n removedNode.next = null;\n return removedNode.value;\n }", "title": "" }, { "docid": "623c3dfa41a96670bfa6e6fbeefbdf58", "score": "0.5950739", "text": "dequeue() {\n let firstElem = this.head;\n let returnNode = null;\n\n if (!firstElem) return (\"Empty Queue\");\n\n // If parent has child, set child as new parent\n else if (firstElem.next) {\n returnNode = firstElem;\n firstElem = firstElem.next\n this.head = firstElem;\n }\n\n // Set parent to null, emptying the queue.\n else {\n returnNode = firstElem;\n this.head = null\n }\n\n this.size--;\n return returnNode;\n }", "title": "" }, { "docid": "1d967a3a86621445c6c1919d60acc0df", "score": "0.59504044", "text": "dequeue() {\n while (this.list.size > 1) {\n this.helper.push(this.list.pop());\n }\n const returnNode = this.list.pop();\n\n while (this.helper.size > 0) {\n this.list.push(this.helper.pop());\n }\n return returnNode;\n }", "title": "" }, { "docid": "a1e16335f31bc63675b5956831f79a8e", "score": "0.5927563", "text": "pop() {\n // If head is null, there's nothing on the list\n if (this.head == null) {\n return null;\n } else {\n // Get the item that will be popped from the queue\n const extractedItem = this.head;\n\n // Set the next item in the queue as the new head\n this.head = this.head.next;\n\n // Returned the previous head\n return extractedItem;\n }\n}", "title": "" }, { "docid": "35c37bbdb92d4d35b668822d898d325e", "score": "0.59242225", "text": "remove() {\n if (!this.isEmpty()) {\n let firstElement = this.queue[0];\n this.queue.shift();\n this.length -= 1;\n return firstElement;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "0cbe89de02196cbc333a70e435618ea7", "score": "0.59189487", "text": "peek(){\n return queue[queue.length -1]\n }", "title": "" }, { "docid": "9f4cd080b3b6ef840f706f7e66183777", "score": "0.59171444", "text": "dequeue() {\n if (0 != this.q.length) {\n let c = this.q[0];\n this.q.splice(0, 1);\n return c\n }\n }", "title": "" }, { "docid": "4cad2566aae89728676781122e59af3a", "score": "0.5916348", "text": "dequeue() {\n return this.collection.shift();\n }", "title": "" }, { "docid": "85696b41ad7b9c97cd13395f3b7a7086", "score": "0.59063715", "text": "dequeue(){\n if (!this.first) {\n return null;\n }else if (this.size === 1) {\n this.first = null;\n this.last = null;\n }else{\n let oldStart = this.first.next;\n this.first.next = null;\n this.first = oldStart;\n }\n this.size--;\n return this;\n }", "title": "" }, { "docid": "cec60b6ee3a7fc92e810ccc31c45b080", "score": "0.58984035", "text": "dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }", "title": "" }, { "docid": "cec60b6ee3a7fc92e810ccc31c45b080", "score": "0.58984035", "text": "dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }", "title": "" }, { "docid": "cec60b6ee3a7fc92e810ccc31c45b080", "score": "0.58984035", "text": "dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }", "title": "" }, { "docid": "998c13259c80c6e11c01d2ff6238bdff", "score": "0.5895317", "text": "dequeue() {\n if(!this.isEmpty()) {\n return this.collection.shift();\n } else {\n console.log(\"Queue is already empty\");\n }\n }", "title": "" }, { "docid": "0ddaf4d899fce210eed1a92478e2bb73", "score": "0.58871716", "text": "dequeue() {\n if (!this.first) return null;\n let temp = this.first;\n if (this.first === this.last) {\n this.tail = null;\n } else {\n this.first = this.first.next;\n }\n this.size--;\n return this;\n }", "title": "" }, { "docid": "193e20919581d0ff83aba974a8bd5327", "score": "0.5876416", "text": "dequeue() {\n\t\tif (this.isEmpty()) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst node = this._dummyHead.prev;\n\t\tconst newFirst = node.prev;\n\t\tthis._dummyHead.prev = newFirst;\n\t\tnewFirst.next = this._dummyHead;\n\t\t// unlink the node to be dequeued.\n\t\tnode.prev = null;\n\t\tnode.next = null;\n\t\tthis._length--;\n\t\treturn node.value;\n\t}", "title": "" }, { "docid": "35700766d8c50190c59c446274308dde", "score": "0.5866841", "text": "next() {\n if(this.back) {\n this.back = false\n return this.current\n }\n do { this.current = this.obtain() }\n while(this.current!=null && this.remove && this.removable(this.current))\n return this.current\n }", "title": "" }, { "docid": "1ea815a9f66a48ba9322c30a17f29d3c", "score": "0.58442515", "text": "peek() { // must not be called on an empty queue\n const front = this._front;\n const cursor = this._cursor;\n return front._elements[cursor];\n }", "title": "" }, { "docid": "1ea815a9f66a48ba9322c30a17f29d3c", "score": "0.58442515", "text": "peek() { // must not be called on an empty queue\n const front = this._front;\n const cursor = this._cursor;\n return front._elements[cursor];\n }", "title": "" }, { "docid": "71baf3016f094276241cfe9934cc0287", "score": "0.58386475", "text": "peek() {\n return queue[queue.length - 1];\n }", "title": "" }, { "docid": "71baf3016f094276241cfe9934cc0287", "score": "0.58386475", "text": "peek() {\n return queue[queue.length - 1];\n }", "title": "" }, { "docid": "1efb897a9024cf1b24ca27bfa0e261d4", "score": "0.58220917", "text": "dequeue() {\n\n }", "title": "" }, { "docid": "b93fddb4e8ba9b407ce016fa446c358f", "score": "0.581897", "text": "dequeue(){\r\n // Dequeue is super simple. Removing from a queue is functionally the same\r\n // as removing from a stack.\r\n return this.stack1.pop();\r\n }", "title": "" }, { "docid": "87f4354a38c8c760d804d3c74b0cb8ae", "score": "0.581711", "text": "poll() {\n const top = this.queue.shift(); \n return top; \n }", "title": "" }, { "docid": "e2c4fea1b2e842e3bac91fd90290140d", "score": "0.5810057", "text": "dequeue() {\n if (this.isEmpty()) throw new Error('Can not dequeue. The priority queue is empty');\n\n return this.items.shift();\n }", "title": "" }, { "docid": "b47eb81795c47b453de7dfb553d67a81", "score": "0.58079886", "text": "dequeue() {\n this._treatNoValues();\n return this.storage.shift();\n }", "title": "" } ]
1918e405a967a53236ce177e34de3273
Turn duration of the movies from hours to minutes
[ { "docid": "a86d3d48b9c5e1f7380327efb8252366", "score": "0.0", "text": "function turnHoursToMinutes(array) {\n var newarray = array.map(function(elem) {\n elemcpy = Object.assign({}, elem);\n initduration = elemcpy.duration.toLowerCase();\n if (typeof initduration === \"number\") {\n return elemcpy;\n } else if (initduration.includes(\"h\") && initduration.includes(\"min\")) {\n durmin = initduration[3] + \"\" + initduration[4];\n elemcpy.duration = parseInt(initduration[0]) * 60 + parseInt(durmin);\n return elemcpy;\n } else if (initduration.includes(\"h\") && !initduration.includes(\"min\")) {\n elemcpy.duration = parseInt(initduration[0]) * 60;\n return elemcpy;\n } else if (!initduration.includes(\"h\") && initduration.includes(\"min\")) {\n elemcpy.duration = parseInt(initduration[0] + \"\" + initduration[1]);\n return elemcpy;\n } else {\n return [];\n }\n });\n return newarray;\n}", "title": "" } ]
[ { "docid": "8fd8825b1e12ca19d423610a08ca3f00", "score": "0.8185994", "text": "function turnHoursToMinutes(movies) {\n let durationsOfMovies = movies.map(movie => {\n let hm = movie.duration.split(\"h\");\n let durationInMinutes = 0;\n if (hm.length === 1){\n durationInMinutes = parseInt(hm[0]*60);\n } else if (hm[1].length === 0) {\n durationInMinutes = parseInt(hm[0])*60 || 0;\n } else {\n let minutes = parseInt(hm[1].trim());\n let hours = parseInt(hm[0]);\n durationInMinutes = minutes + hours*60;\n }\n\n let transformedMovie = {\n title: movie.title,\n year: movie.year,\n director: movie.director,\n duration: durationInMinutes,\n genre: movie.genre,\n rate: movie.rate\n }\n return transformedMovie;\n });\n return durationsOfMovies;\n}", "title": "" }, { "docid": "49bd1f972803a3e5c80112b947c885a4", "score": "0.8160382", "text": "function turnHoursToMinutes(movies) {\n\n let moviesWithDurations = movies.map((movie,i,arr) => {\n \n const newMovie = {...movie};\n \n if (movie.hasOwnProperty('duration') && movie.duration.length > 0) {\n \n let totalDuration = 0;\n let timeArr = movie.duration.split(\" \");\n timeArr.forEach((elem) => {\n \n if ( elem.includes(\"h\") ) {\n totalDuration += parseInt(elem.replace('h',''), 10) * 60;\n }\n \n if ( elem.includes(\"min\") ) {\n totalDuration += parseInt(elem.replace('min',''), 10);\n }\n \n });\n \n if ( totalDuration > 0 ) { newMovie.duration = totalDuration; }\n \n }\n \n return newMovie;\n \n });\n \n return moviesWithDurations;\n }", "title": "" }, { "docid": "e3acc70a977f57b6b9a0b915edd45e23", "score": "0.81258744", "text": "function turnHoursToMinutes(movies){\n var times=movies.map(function(movie){\n return movie.duration;\n }).split(\" \")\n time.array.forEach(function(time) {\n return time.Number(parseInt(time));\n });\n\n}", "title": "" }, { "docid": "99028a241a9bb6d785d743311333850d", "score": "0.8067002", "text": "function turnHoursToMinutes(movies) {\n return movies.map(movie => {\n let time = movie.duration.split(\" \")\n let duration\n let hours = 0\n let minutes = 0\n time.forEach((mov) => {\n if (mov.includes(\"h\")) {\n hours = +mov.replace(\"h\", \"\")\n }\n if (mov.includes(\"m\")) {\n minutes = +mov.replace(\"min\", \"\")\n }\n duration = hours * 60 + minutes\n })\n return ({\n ...movie,\n duration\n })\n })\n }", "title": "" }, { "docid": "fe928cba57f4d743f0b9189d37e6ef2a", "score": "0.8056927", "text": "function turnHoursToMinutes(movies) {\n return movies.map(function (movie) {\n let duration = movie.duration.split(' ').reduce(function (total, time) {\n if (time.indexOf('h') != -1) {\n return parseInt(time[0]) * 60 + total;\n }\n if (time.indexOf('min') != -1) {\n return parseInt(time.substr(0, 2)) + total;\n }\n }, 0)\n return {\n ...movie,\n duration: duration\n };\n })\n}", "title": "" }, { "docid": "7324ab9f5733791b3934e2466f9236fd", "score": "0.8023925", "text": "function turnHoursToMinutes(movies) {\n // #h ##min\n // we got the hours\n // transform them into minutes\n\n // we got the minutes\n\n // we sum the minutes plus the 'hours in minutes'\n\n\n return movies.map((m) => {\n let durationParts = m.duration.split(' ');\n let hours = parseInt(durationParts[0].replace(\"h\", \"\"));\n let hoursIntoMinutes = hours * 60;\n //console.log(hoursIntoMinutes);\n \n let minutes = 0;\n if(durationParts[1] !== null && durationParts[1] !== undefined) {\n minutes = parseInt(durationParts[1].replace(\"min\", \"\"));\n }\n\n\n let durationInMinutes = minutes + hoursIntoMinutes;\n //console.log(durationInMinutes);\n\n m.duration = durationInMinutes;\n return m;\n });\n}", "title": "" }, { "docid": "45e9068ec92416eee0fbff42586a9ecc", "score": "0.80076027", "text": "function turnHoursToMinutes(movies) {\n const moviesClone = JSON.parse(JSON.stringify(movies));\n\n moviesClone.forEach((x) => {\n if (x.duration.includes(\"h \")) {\n x.duration =\n x.duration.split(\"min\").join(\"\").split(\"h \").join(\"\")[0] * 60 +\n Number(\n x.duration.split(\"min\").join(\"\").split(\"h \").join(\"\")[1] +\n x.duration.split(\"min\").join(\"\").split(\"h \").join(\"\")[2]\n );\n } else if (x.duration.includes(\"h\")) {\n x.duration = Number(x.duration.split(\"h\").join(\"\") * 60);\n } else {\n x.duration = Number(x.duration.split(\"min\").join(\"\"));\n }\n });\n\n return moviesClone;\n}", "title": "" }, { "docid": "ac35307e77dcfa5262f1924bc9a4da10", "score": "0.79543877", "text": "function turnHoursToMinutes(movies) {\n var moviesWithMinutes = movies.map(movie => {\n var hours = movie.duration.indexOf(\"h\")\n if (hours !== -1) {\n hours = movie.duration.substring(0, hours)\n }\n else {\n hours = 0\n }\n var mins = movie.duration.indexOf(\"m\")\n if (mins !== -1) {\n mins = movie.duration.substring(movie.duration.indexOf(\"h\") + 1, mins)\n } else {\n mins = 0;\n }\n horas = Number(hours)\n minutos = Number(mins)\n movie.duration = (horas * 60) + minutos\n return movie;\n })\n return moviesWithMinutes;\n}", "title": "" }, { "docid": "eb7e2b4ad40f9ad2a591d321ebb84b8a", "score": "0.78879285", "text": "function turnHoursToMinutes(movies) {\n var moviesWithMinutes = movies.map(function(movie) {\n var hours = 0;\n var hoursToMinutes = 0;\n var minutes = 0;\n// .substring returns a subset of a string between one index and another\n// 0 => indexStart (first character to inclue in the returned substring)\n// indexHours => specifying the offset, first character not included\n var indexHour = movie.duration.indexOf('h');\n if(indexHour !== -1) {\n hours = parseInt(movie.duration.substring(0, indexHour));\n hoursToMinutes = hours * 60;\n }\n// e.g. turns 2 hours into 120; parseInt turns string into num\n\n var indexMinute = movie.duration.indexOf('min');\n if(indexMinute !== -1) {\n if(indexHour !== -1) {\n minutes = parseInt(movie.duration.substring(indexHour + 1, indexMinute));\n } \n else {\n minutes = parseInt(movie.duration.substring(0, indexMinute));\n }\n }\n // The Object.assign() method copies the values of all enumerable own properties \n // from one or more source objects to a target object; returns the target object\n // variables hoursToMinutes & Minutes are already altered, not containing 'h\n var movieWithMinutes = Object.assign({}, movie, { duration: hoursToMinutes + minutes });\n return movieWithMinutes;\n });\n \n return moviesWithMinutes;\n }", "title": "" }, { "docid": "e844377c8c2885b74252bc60a97f0a77", "score": "0.7862288", "text": "function turnHoursToMinutes(movies) {\n let newMoviesArr = [...movies]\n // Recorremos las peliculas y comprobamos el formato\n let moviesNumberHours = newMoviesArr.map(movie => {\n if (typeof movie.duration == 'number') {\n movie.duration = movie.duration + \"\"\n }\n if (movie.duration.includes(\"min\") && movie.duration.includes(\"h\")) {\n let hours = movie.duration.slice(0, 1)\n let minutes = movie.duration.slice(2, movie.duration.length - 3)\n let movieDurationMin = (parseInt(hours * 60) + parseInt(minutes))\n let movieDurationProp = {\n duration: movieDurationMin\n }\n return movieDurationProp\n } else if (!movie.duration.includes(\"min\")) {\n let hours = movie.duration.slice(0, 1)\n let movieDurationMin = parseInt(hours * 60)\n let movieDurationProp = {\n duration: movieDurationMin\n }\n return movieDurationProp\n } else if (!movie.duration.includes(\"h\")) {\n let minutes = movie.duration.slice(0, 2)\n let movieDurationMin = parseInt(minutes)\n let movieDurationProp = {\n duration: movieDurationMin\n }\n return movieDurationProp\n }\n })\n return moviesNumberHours\n}", "title": "" }, { "docid": "f336cade96dbad5b82d2f400e68c9314", "score": "0.7829425", "text": "function turnHoursToMinutes(movies) {\n\treturn movies.map((movie) => {\n\t\tlet newMovieTime = { ...movie };\n\t\tlet hours = 0;\n\t\tlet minutes = 0;\n\t\tif (movie.duration.indexOf('h') !== -1) {\n\t\t\thours = movie.duration.split('h')[0];\n\t\t}\n\t\tif (movie.duration.indexOf('min') !== -1) {\n\t\t\tif (movie.duration.indexOf(' ') !== -1) {\n\t\t\t\tminutes = movie.duration.split(' ')[1].split('min')[0];\n\t\t\t} else {\n\t\t\t\tminutes = movie.duration.split('min')[0];\n\t\t\t}\n\t\t}\n\t\tnewMovieTime.duration = parseInt(hours * 60) + parseInt(minutes);\n\t\treturn newMovieTime;\n\t});\n}", "title": "" }, { "docid": "d3ac4695e03bf9ab96c0ec5d93f4f536", "score": "0.78150064", "text": "function turnHoursToMinutes(movies) {\n\n return movies.map(movie => { \n let calcSum\n\n if (movie.duration.split(' ').lenght > 1) {\n let hours = movie.duration.split(' ')[0].slice(0, 1);\n let minutes = movie.duration.split(' ')[1].slice(-5, -3);\n\n calcSum = +(hours) * 60 + +(minutes)\n\n } else if (movie.duration.indexOf('min') >= 0) {\n\n let minutes = movie.duration.slice(-5, -3);\n\n calcSum = +(minutes)\n\n } else {\n let hours = movie.duration.slice(0, 1);\n calcSum = +(hours) * 60\n }\n\n return {...movies, duration: calcSum}\n\n })\n}", "title": "" }, { "docid": "e58f08f0685428aec338193db74354be", "score": "0.778423", "text": "function turnHoursToMinutes() {\n \n let convertDuration = str => {\n let clean = str.replace(\"h\", \"\").replace(\"min\", \"\").split(\" \")\n let minutes = clean.reduce( (acc, n, index, originalArray) => \n { if (index === 0 && originalArray.length > 1 ) \n {return acc += (parseInt(n )) * 60 }\n }, 0 )\n console.log(minutes)\n }\n \n let newMovies = movies.map( (m) => {\n let duracion = convertDuration(movies.duration);\n return {...m, \"duration\": duracion}; } )\n\n\n \n\n \n}", "title": "" }, { "docid": "904fc074c8abcc51ad185b327d980f8e", "score": "0.77568275", "text": "function turnHoursToMinutes(movies) {\n var time = movies.map(function(oneMovie) {\n var A = {};\n var hoursIntoMinutes = Number(oneMovie.duration.charAt(0) * 60);\n var minutes = Number(\n oneMovie.duration.charAt(3) + oneMovie.duration.charAt(4)\n );\n console.log(hoursIntoMinutes + minutes);\n return (oneMovie.duration = hoursIntoMinutes + minutes);\n });\n return time;\n}", "title": "" }, { "docid": "6bb17c2898763296de8db8ed885de38a", "score": "0.7706222", "text": "function turnHoursToMinutes(movies) {\n var minuteMovies = [];\n movies.forEach(m => {\n const newObj = Object.assign({}, m);\n minuteMovies.push(newObj)\n })\n\n minuteMovies.forEach((item) => {\n var convertedDuration = 0;\n if (item.duration.includes(\"h\") && item.duration.includes(\"min\")) {\n convertedDuration = parseFloat(item.duration[0]*60) +parseFloat(item.duration[3]*10) +parseFloat(item.duration[4]);\n }\n else if (item.duration.includes(\"h\") && !item.duration.includes(\"min\")) {\n convertedDuration = parseFloat(item.duration[0]*60);\n }\n else if (item.duration.includes(\"min\") && !item.duration.includes(\"h\")) {\n convertedDuration = parseFloat(item.duration[0]*10)+parseFloat(item.duration[1])\n }\n item.duration = convertedDuration;\n })\n return minuteMovies;\n}", "title": "" }, { "docid": "c7530c8561094b1bee07f94331c790e5", "score": "0.7699399", "text": "function turnHoursToMinutes(moviesArr){\n let toMinute = (string)=>{\n let hour=0;\n let minute=0;\n string.split('').forEach((char,index)=>{\n if (char === 'h'){\n hour = string[index-1];\n } else if(char === 'm'){\n minute = Number(string[index-2] + string[index-1])\n }\n })\n return Number(hour)*60 + Number(minute)\n }\n return moviesArr.map(movie=>({\n ...movie,\n duration: toMinute(movie.duration)\n }))\n }", "title": "" }, { "docid": "748ad48edec38aa2e91cf34e44a2ff84", "score": "0.7699091", "text": "function turnHoursToMinutes(moviesList) { \n let moviesInMinutes = [];\n moviesList.forEach(function (movie) {\n let textDuration= movie.duration.split(' ');\n let hours = 0;\n let minutes = 0;\n textDuration.forEach(element => {\n if (element.includes('h')) {\n hours = parseFloat(element.split('h').join(''));\n }else if(element.includes('min')) {\n minutes = parseFloat(element.split('min').join(''));\n }\n });\n let movieInMinutes = {\n title: movie.title,\n year: movie.year,\n director: movie.duration,\n duration: (hours *60 + minutes),\n genre: movie.genre,\n rate: movie.rate\n };\n moviesInMinutes.push(movieInMinutes);\n });\n return moviesInMinutes;\n}", "title": "" }, { "docid": "2a8243369282c374142a2a9bf3f79154", "score": "0.76721764", "text": "function turnHoursToMinutes(arrayOfMovies){\n return arrayOfMovies.map((theMovieObject)=>{\n let formattedMovie = {...theMovieObject};\n let totalMinutes;\n if(theMovieObject.duration.indexOf('h') > -1 && theMovieObject.duration.indexOf('min') > -1){\n let timeArray = theMovieObject.duration.split('h');\n timeArray[0] = parseInt(timeArray[0]);\n timeArray[1] = parseInt(timeArray[1]);\n totalMinutes = (timeArray[0]*60 + timeArray[1])\n } else if (theMovieObject.duration.indexOf('h') > -1){\n let numberOfHours = parseInt(theMovieObject.duration);\n totalMinutes = (numberOfHours * 60)\n } else {\n totalMinutes = parseInt(theMovieObject.duration)\n }\n formattedMovie.duration = totalMinutes;\n return formattedMovie;\n });\n }", "title": "" }, { "docid": "af0e8a2bc0acbf1b21b4ac3a30d84055", "score": "0.76075935", "text": "function turnHoursToMinutes(movies = []) {\n return movies.map((original) => {\n let movie = {...original}\n\n if (typeof(movie.duration) === 'number') {\n return movie;\n }\n\n let hours = (movie.duration.indexOf('h') >= 0 )? Number(movie.duration.slice(0, movie.duration.indexOf('h'))) : 0;\n let minutes = (movie.duration.indexOf('min') >= 0 )? Number(movie.duration.slice(movie.duration.indexOf('min') - 2, movie.duration.indexOf('min'))) : 0;\n movie.duration = hours * 60 + minutes;\n return movie;\n });\n}", "title": "" }, { "docid": "0ba97c7bce0840a51115a6e7e39f65ae", "score": "0.76002413", "text": "function turnHoursToMinutes(movies) {\n return JSON.parse(JSON.stringify(movies))\n .map(function (movie) {\n const hours = movie.duration.match(/\\d+(?=h)/g);\n const minutes = movie.duration.match(/\\d+(?=min)/g);\n if (hours !== \"\") {\n movie.duration = (Number(hours) * 60 + Number(minutes));\n return movie;\n }\n movie.duration = Number(minutes);\n return movie;\n })\n}", "title": "" }, { "docid": "4b95add0019164b44e6ae79a5cd9558f", "score": "0.7563467", "text": "function turnHoursToMinutes(moviesArr) {\n return newArr = moviesArr.map(function(movie) {\n let h_dur = movie.duration.indexOf(\"h\");\n let m_dur = movie.duration.indexOf(\"m\");\n let result = 0;\n if (movie.duration.indexOf(\"h\") > 0){\n //console.log(movie.duration.substr(0, movie.duration.indexOf(\"h\"))*60);\n result = Number(movie.duration.substr(0, movie.duration.indexOf(\"h\"))*60);\n }\n if (movie.duration.indexOf(\"m\") > 0) {\n result += Number(movie.duration.substr(movie.duration.indexOf(\" \")+1, (movie.duration.indexOf(\"m\"))-(movie.duration.indexOf(\" \")+1)));\n }\n return {...movie, duration: result };\n })\n}", "title": "" }, { "docid": "61d660a2ecefb4cd612ed7202d51b6d1", "score": "0.7550126", "text": "function turnHoursToMinutes(movies) {\n const arr = JSON.parse(JSON.stringify(movies));\n for (let i = 0; i < arr.length; i++) {\n arr[i].duration = timeStringToMinutes(arr[i].duration);\n }\n return arr;\n}", "title": "" }, { "docid": "6cd2f3ff9fffe6536cb7b2585ef6cb11", "score": "0.75109255", "text": "function turnHoursToMinutes(array) {\n let newArray = [];\n array.forEach(function(elem) { \n newArray.push(elem);\n })\n //filters out all the space/letters between the numbers in movies.duration\n const changedToMinutes = newArray.map(function(movie) {\n let numString = '';\n for(let i = 0; i < movie.duration.length; i ++) {\n if(movie.duration[i] === '1' || movie.duration[i] === '2' || movie.duration[i] === '3' || movie.duration[i] === '4' || movie.duration[i] === '5' || movie.duration[i] === '6' || movie.duration[i] === '7' || movie.duration[i] === '8' || movie.duration[i] === '9') {\n numString += movie.duration[i];\n }\n \n }\n return numString;\n });\n //takes the first digit, splices it out, converts it to a number, and multiplies it by 60 then adds it to the rest\n const firstDigitToNumber = changedToMinutes.map(function(movie) {\n //checks to see if it is a short movie of less than an hour\n if(movie.length < 3 && movie.length > 1) {\n let restOfNum = Number(movie);\n return restOfNum;\n }\n //checks to see if movie length is only in hours\n if(movie.length === 1) {\n let onlyHourslength = Number(movie) * 60;\n }\n let firstDigi = Number(movie[0]);\n let theRestOfNum = Number(movie.slice(1));\n return (firstDigi * 60) + theRestOfNum;\n \n });\n \n //constructs the final array with minutes as the duration\n let finalArray = [];\n array.forEach(function(elem) { \n finalArray.push(elem);\n })\n \n for(let i = 0; i < finalArray.length; i++) {\n finalArray[i].duration = firstDigitToNumber[i];\n \n }\n \n return finalArray;\n }", "title": "" }, { "docid": "7426dae71856b5343a9b3d35b59e97a4", "score": "0.7507078", "text": "function turnHoursToMinutes(arr) {\n function hoursToMinutes(time) {\n if (!time.includes(\"h\")) {\n return parseInt (time);\n }\n let hoursAndMinutes = time.split (\" \");\n return (\n parseInt (hoursAndMinutes[0])*60+parseInt(hoursAndMinutes[1] || 0)\n );\n}\n\nconst newTime = arr.map(function(movie) {\n const newMovies = Object.assign({}, movie);\n newMovies.duration = hoursToMinutes(movie.duration);\n return newMovies;\n});\nreturn newTime;\n}", "title": "" }, { "docid": "d7ad2b9b0045dc016d775a78e7c0c927", "score": "0.7444934", "text": "function turnHoursToMinutes(movies) {\n return movies.map(function (movie) {\n var totalMinutes;\n var hours = 0;\n var minutes = 0;\n var durationSplit = movie.duration.split(\" \");\n if (durationSplit.length > 1) {\n hours = durationSplit[0].split(\"h\")[0];\n minutes = durationSplit[1].split(\"min\")[0];\n } else if (durationSplit.length === 1 && durationSplit[0].indexOf(\"h\") > 0) {\n hours = durationSplit[0].split(\"h\")[0];\n } else if (durationSplit.length === 1 && durationSplit[0].indexOf(\"h\") < 0) {\n minutes = durationSplit[0].split(\"min\")[0];\n }\n\n minutes = parseInt(minutes, 10);\n hours = parseInt(hours, 10);\n totalMinutes = hours * 60 + minutes;\n\n var movieClone = Object.assign({}, movie); // make a clone of the `movie` object\n movieClone.duration = totalMinutes;\n\n return movieClone;\n });\n}", "title": "" }, { "docid": "4c1e13577bd701fa434e6295c145a7d3", "score": "0.74274266", "text": "function turnHoursToMinutes(moviesArray) {\n //.map because we will work on every element of the array\n return moviesArray.map(function(elem) {\n var hours = 0;\n var minutes = 0;\n\n // The indexOf() method returns the first index at which a given element can\n // be found in the array, or -1 if it is not present.\n // The parseInt() function parses a string argument and returns an integer of \n //the specified radix (the base in mathematical numeral systems, usually defaulting the value 10).\n if (elem.duration.indexOf(\"h\") !== -1) {\n hours = parseInt(elem.duration[0], 10) * 60;\n }\n if (elem.duration.indexOf(\"min\") !== -1) {\n minutes = parseInt(\n //parseInt has 2 arguments, the 1st is elem.duration.substring\n elem.duration.substring(\n // .substring has 2 arguments (start position and end position)\n elem.duration.length - 5,\n elem.duration.length - 3\n ),\n //this is the 2nd argument- called radix\n 10\n );\n }\n // The Object.assign() method is used to copy the values of all enumerable own properties from one or more source objects to a target object. \n //It will return the target object.\n return Object.assign({}, elem, { duration: hours + minutes });\n });\n}", "title": "" }, { "docid": "524631cc1783a1dfa7cf230dfe0f38fe", "score": "0.74207073", "text": "function turnHoursToMinutes(movies) {\n const newArray = movies.map(theMovies => {\n const timeArr = theMovies.duration.split(\" \");\n const hour = [];\n if (timeArr[0] === undefined) {\n hour.push(0 * 60);\n } else if (timeArr[0] === \"54min\") {\n hour.push(parseInt(timeArr[0]));\n } else {\n hour.push(parseInt(timeArr[0]) * 60);\n }\n const minutes = [];\n if (timeArr[1] === undefined) {\n minutes.push(0);\n } else {\n minutes.push(timeArr[1]);\n }\n const totalMin = parseInt(hour) + parseInt(minutes);\n return {\n ...theMovies,\n duration: totalMin\n };\n });\n\n return newArray;\n}", "title": "" }, { "docid": "49be27fd35a2e05b613d2be1202c13f2", "score": "0.7386285", "text": "function turnHoursToMinutes(movie_array){\n var new_movie_array = movie_array.map((movie)=>{\n //console.log(movie.title)\n var movie_hora = movie.duration.split(' ')[0].split('').filter(char=>char>0)[0]\n var movie_min = movie.duration.split(' ')[1].split('min').filter(char=>char>0)[0]\n\n //console.log(\"Horas \" + movie_hora + \" Minutos \" + movie_min)\n movie.duration = (movie_hora*60 + movie_min*1)\n return movie\n })\n //console.log(new_movie_array)\n return new_movie_array\n}", "title": "" }, { "docid": "e530728a25bf8a535b2ae6e16dbf378f", "score": "0.73706573", "text": "function turnHoursToMinutes (movieList) {\n\tvar newArray = movieList.map (function (movie) {\n\t\tvar title = movie.title;\n\t\tvar year = movie.year;\n\t\tvar director = movie.director;\n\t\tvar durationHourString = movie.duration;\n\t\tvar genre = movie.genre;\n\t\tvar rate = movie.rate;\n\n\t\tvar durationHour = durationHourString.split(\" \");\n\t\tvar durationHourNumber = [];\n\t\tvar durationMinutes;\n\n\t\tif (durationHour.length === 2) {\n\t\t\tdurationHourNumber[0] = durationHour[0].replace(\"h\", \"\");\n\t\t\tdurationHourNumber[1] = durationHour[1].replace(\"min\", \"\");\n\n\t\t\tdurationMinutes = Number(durationHourNumber[0]) * 60 + Number(durationHourNumber[1]);\n\t\t}\n\n\t\telse if (durationHour.length === 1 && durationHour[0][1] === \"h\") {\n\t\t\tdurationHourNumber[0] = durationHour[0].replace(\"h\", \"\");\n\t\t\tdurationMinutes = Number(durationHourNumber[0]) * 60\n\t\t}\n\n\t\telse if (durationHour.length === 1 && durationHour[0][2] === \"m\") {\n\t\t\tdurationHourNumber[0] = durationHour[0].replace(\"min\", \"\");\n\t\t\tdurationMinutes = Number(durationHourNumber[0]);\n\t\t};\n\n\t\treturn {\n\t\t\ttitle: title,\n\t\t\tyear: year,\n\t\t\tdirector: director,\n\t\t\tduration: durationMinutes,\n\t\t\tgenre: genre,\n\t\t\trate: rate};\n\n\t});\n\treturn newArray;\n}", "title": "" }, { "docid": "c751e73d5c228331403166acdd7f67f5", "score": "0.73681027", "text": "function turnHoursToMinutes(arr){\n var newArr = arr.map(function(movie){\n var movieLengthArr = movie.duration.split(\" \");\n if(movieLengthArr[0].includes(\"min\"))\n {\n movieLengthArr.unshift(\"0\");\n }\n if(movieLengthArr[0].includes(\"h\"))\n {\n movieLengthArr.push(\"0\");\n }\n movieLengthArr[0] = movieLengthArr[0].replace(/\\D/g,'');\n movieLengthArr[1] = movieLengthArr[1].replace(/\\D/g,'');\n minuteDuration = Number(movieLengthArr[0]) * 60 + Number(movieLengthArr[1]);\n movie.duration = minuteDuration;\n return movie;\n });\n return newArr;\n}", "title": "" }, { "docid": "4145058fde7ce18fc2ab65818a909cab", "score": "0.7344949", "text": "function turnHoursToMinutes (duration) {\n var duration2=duration.split(\" \");\n var durationTotal=0;\n \n if (duration2.length===1) {\n durationTotal+=parseInt(duration2[0]);\n return durationTotal;\n } else {\n var durationHour=parseInt(duration2[0]);\n var durationMin=parseInt(duration2[1]);\n var durationTotal=(durationHour*60)+durationMin;\n }\n return durationTotal;\n }", "title": "" }, { "docid": "658fcf83b42ad5dc838b5d70962f70f7", "score": "0.73425233", "text": "function turnHoursToMinutes (arr){\n return arr.map(function(movie){\n var duration;\n if(!movie.duration.includes('h')){\n duration = parseInt(movie.duration);\n } else if(!movie.duration.includes('min')){\n duration = parseInt(movie.duration)*60; \n }else{\n var aux = movie.duration.split(\" \");\n duration=parseInt(aux[0])*60 + parseInt(aux[1]);\n }\n return Object.assign({},movie,{duration:duration});\n });\n}", "title": "" }, { "docid": "85afb2b2652ec8d000cb4706de8bff0d", "score": "0.73301494", "text": "function turnHoursToMinutes(films){\n\n return films.map(function(film){\n \n var time;\n var min;\n time = film.duration.split(\" \");\n if (time.length<2){\n if (time[0].includes(\"h\")){\n time.push(0);\n min = parseInt(time[0])*60 + parseInt(time[1]);\n } else {\n time.unshift(0);\n min = parseInt(time[0])*60 + parseInt(time[1]);\n } \n } else {\n min = parseInt(time[0])*60 + parseInt(time[1]);\n }\n return Object.assign({},film,{duration:min}); \n })\n}", "title": "" }, { "docid": "4de07175338b390f5504654d2181a1bf", "score": "0.73205054", "text": "function turnHoursToMinutes(array) {\n if(array.length == 0) {\n return;\n }\n var movies2 = [];\n array.forEach(function(element) {\n var object1 = Object.assign({}, element);\n\n if(object1.duration.length > 5) {\n var dur = object1.duration.split(\"h \");\n var a = dur[1].slice(0, -3);\n dur[1] = a;\n dur[0] *= 60;\n var totalTime = dur[0] + parseInt(dur[1]);\n object1.duration = totalTime;\n movies2.push(object1);\n } else {\n var a;\n if(object1.duration.length > 3) {\n a = parseInt(object1.duration.slice(0, -3));\n } else {\n a = object1.duration.slice(0, -1);\n a *= 60;\n }\n object1.duration = a;\n movies2.push(object1);\n }\n });\n return movies2;\n }", "title": "" }, { "docid": "f6ec6d301626ac57b90f09f3239ae17e", "score": "0.731173", "text": "function turnHoursToMinutes(array) {\n let copia = array.map(movie => movie);\n copia.forEach(movie => {\n let timeStamp = movie.duration;\n let timeData = timeStamp.split(' ');\n let totalMinutes = 0;\n let minutesFromHours = 0;\n let minutesFromMinutes = 0;\n if (timeData.length > 1) {\n minutesFromHours = parseInt(timeData[0].replace('h', '')) * 60;\n minutesFromMinutes = parseInt(timeData[1].replace('min', ''));\n } else {\n if (timeStamp.includes('h')) {\n minutesFromHours = parseInt(timeData[0].replace('h', '')) * 60;\n } else {\n minutesFromMinutes = parseInt(timeData[0].replace('min', ''));\n }\n }\n totalMinutes = parseInt(minutesFromHours + minutesFromMinutes);\n movie.duration = totalMinutes;\n console.log(typeof movie.duration);\n //return movie;\n });\n\n // console.log(copia);\n console.log(typeof copia);\n return copia;\n}", "title": "" }, { "docid": "83eb64fa545b3f65c604e9b1cc7b270d", "score": "0.7296102", "text": "function turnHoursToMinutes(array) {\n return array.map(movie => {\n if (typeof(movie.duration) === \"number\") {\n let movieCopy = Object.assign({}, movie)\n movieCopy.duration = movie.duration\n return movieCopy\n }\n if (movie.duration.includes(\"h\") && movie.duration.includes(\"min\")) {\n\n let hrs = movie.duration.split(\"h\")[0]\n let mins = movie.duration.split(\" \")[1].split(\"min\")[0]\n \n let movieCopy = Object.assign({}, movie)\n if (hrs == 0) movieCopy.duration = Number(mins)\n if (mins == 0) movieCopy.duration = Number(hrs * 60)\n else movieCopy.duration = Number(hrs * 60) + Number(mins)\n return movieCopy\n }\n else if (movie.duration.includes(\"h\")) {\n let movieCopy = Object.assign({}, movie)\n movieCopy.duration = Number(movie.duration.split(\"h\")[0] * 60)\n return movieCopy\n }\n else if (movie.duration.includes(\"min\")) {\n let movieCopy = Object.assign({}, movie)\n movieCopy.duration = Number(movie.duration.split(\"min\")[0])\n return movieCopy\n }\n })\n}", "title": "" }, { "docid": "af8221fb91f826063d3226877893b3a1", "score": "0.7282852", "text": "function turnHoursToMinutes(moviesArr) {\n var movieMinutesHours = moviesArr.map(function(movie){\n\n var tiempoMinHours = movie.duration.split(\" \");\n if (tiempoMinHours.length==2) {\n var horas = parseInt(tiempoMinHours[0]);\n var minutos = parseInt(tiempoMinHours[1]);\n var tiempoSuma = (horas * 60) + minutos;\n }else{\n if (tiempoMinHours[0].endsWith(\"h\")) {\n var tiempoSuma = parseInt(tiempoMinHours[0]) * 60 ;\n } else {\n var tiempoSuma = parseInt(tiempoMinHours[0]);\n }\n }\nconsole.log(tiempoSuma);\nconsole.log(movie);\n return Objetc.assign({}, movie, {duration: tiempoSuma});\n\n });\n\n console.log(movieMinutesHours);\n\n return movieMinutesHours\n }", "title": "" }, { "docid": "51a70e5f40071ffd95f7912889346d82", "score": "0.7280514", "text": "function turnHoursToMinutes(movies){\n \n let durationArray = movies.map(function(eachMovie){\n return eachMovie.duration.split(', ');\n });\n\n // let removeH = String(durationArray).replace(/h/g,'');\n // let removeMin = removeH.replace(/min/g,'');\n \n\n let newDurationArray = durationArray.map(function(n){\n return parseInt(n);\n });\n\n // for (i=0; i < durationArray.length; i++){\n // if(durationArray[i].length % 2 === 0){\n // newDuration.push(durationArray[i]);\n // }\n // }\n \n console.log(newDurationArray);\n // if (durationArray.includes('h')) {\n // let hours = durationArray.map(function(eachHour){\n // return eachHour\n // });\n // return hours;\n // } \n\n return newDurationArray;\n}", "title": "" }, { "docid": "e9977c25cf84405b33cb4f6be5575f9d", "score": "0.7254115", "text": "function turnHoursToMinutes(mv) {\n let mp_mv = mv.map(a => {\n let num = a.duration\n if ((num.includes('h'))&&(num.includes('min')))\n {\n let n = num.split(' ')\n num = parseFloat(n[0])*60 + parseFloat(n[1])\n }\n else if (num.includes('h'))\n num = parseFloat(num)*60\n else if (num.includes('min'))\n num = parseFloat(num)\n a.duration = num\n return a\n })\n return mp_mv\n}", "title": "" }, { "docid": "316ca8e1a09bf0aa27febf71e9f38182", "score": "0.7241772", "text": "function turnHoursToMinutes(array) {\n const moviesCopy = array.map(function(movie) {\n if (movie.duration.indexOf(\"h\") === 1) {\n const time = movie.duration.split(\" \");\n if (parseInt(time[0]) === 0) {\n // if the movie is 0 hours and some minutes\n movie.duration = parseInt(time[1]);\n } else {\n const time = movie.duration.split(\" \");\n if (time[1] === undefined) {\n // if there are only hours provided\n movie.duration = parseInt(time[0]) * 60;\n } else {\n // hours and minutes provided\n const time = movie.duration.split(\" \");\n movie.duration = parseInt(time[0]) * 60 + parseInt(time[1]);\n }\n }\n } else if (movie.duration.indexOf(\"h\") === -1) {\n // no hours only minutes\n movie.duration = parseInt(movie.duration);\n }\n return movie;\n });\n return moviesCopy;\n}", "title": "" }, { "docid": "4a3985fc5e4e003251fd49c9aea99e49", "score": "0.7190258", "text": "function hoursToMinutes(movies) {\n\n //should return a new array, not update the original one -------------ERROR ------------\n //should return an array of movies with duration as a number\n\n let hourMin = movies.map(obj => obj)\n\n hourMin.forEach(movie => {\n let duration = movie.duration;\n let hour = duration.charAt(0);\n hour = parseInt(hour) * 60;\n let minute = 0;\n\n if (duration.length == 8) {\n let x = duration.charAt(3)\n let y = duration.charAt(4)\n let sum = x + y;\n sum = parseInt(sum)\n minute = sum;\n }\n if (duration.length == 7) {\n let x = duration.charAt(3)\n x = parseInt(x)\n minute = x;\n }\n movie.duration = parseInt(hour + minute)\n\n })\n return hourMin\n}", "title": "" }, { "docid": "c1b2828e3d84a93ef09132f13a2e60a0", "score": "0.71717584", "text": "function turnHoursToMinutes(arrMovies) {\n let newArray = JSON.parse(JSON.stringify(arrMovies));\n for (let i = 0; i < newArray.length; i++) {\n let splitDuration = newArray[i].duration.split(\" \");\n let hoursConversion = parseInt(splitDuration[0]) * 60;\n let minutesConversion = parseInt(splitDuration[1]);\n let minutesCounter = hoursConversion + minutesConversion;\n newArray[i].duration = minutesCounter;\n\n if (splitDuration[0] === 1) {\n newArray[i].duration = hoursConversion;\n } else if (splitDuration[0] === undefined) {\n newArray[i].duration = minutesConversion;\n }\n }\n return newArray;\n}", "title": "" }, { "docid": "cf9bd275d2c9e1431aed7fbe21227190", "score": "0.71205574", "text": "function turnHoursToMinutes (movieArray){\n\n let newArray = movieArray.map((mov)=>{\n\n let movie = {...mov};\n\n if(movie.duration.includes(\"h\") && movie.duration.includes(\"min\")){\n\n let hourLength = movie.duration.split(\"h\");\n let hours = parseInt(hourLength[0]) * 60;\n let mins = parseInt(hourLength[1].slice(0, -3));\n movie.duration = hours + mins;\n return movie;\n }else if(movie.duration.includes(\"h\") && !movie.duration.includes(\"min\")){\n\n let hourLength = movie.duration.split(\"h\");\n let hours = parseInt(hourLength[0]) * 60;\n movie.duration = hours;\n return movie;\n }else{\n\n let mins = parseInt(movie.duration.slice(0, -3));\n movie.duration = mins;\n return movie;\n }\n\n });\n\n return newArray;\n}", "title": "" }, { "docid": "99c28cda4d1357b1c13c6a8acaf37c22", "score": "0.7081733", "text": "function turnHoursToMinutes(unArray) {\n var newArray = unArray.map(function(movie){\n\n var arr = movie.duration.split(\" \")\n\n if (arr.length == 2) {\n var duration = parseInt(arr[0].replace(\"h\",\"\")*60) + parseInt(arr[1].replace(\"min\",\"\"))\n return Object.assign({},movie, {duration: duration})\n } else {\n if (arr[0].includes(\"h\")) {\n var duration = parseInt(arr[0].replace(\"h\",\"\")*60)\n return Object.assign({},movie, {duration: duration})\n } else {\n var duration = parseInt(arr[0].replace(\"min\",\"\"))\n return Object.assign({},movie, {duration: duration})\n }\n }\n })\n \n return newArray\n \n}", "title": "" }, { "docid": "affb0fc4c479a63ed0e0f2bcdd5f3014", "score": "0.70526356", "text": "function turnHoursToMinutes(tabMovies){\n var tabModified=tabMovies.map(movie=> {\n return {\n ...movie,\n duration:calculateMinutes(movie)\n }\n }); \n return tabModified; \n\n}", "title": "" }, { "docid": "c2e1e7009ff309be7c50fafc29e80dea", "score": "0.70393914", "text": "function turnHoursToMinutes(givenArray) {\n\n const hourstomin = givenArray.map(movie => {\n const newArray = {\n \"title\": movie.title,\n \"year\": movie.year,\n \"director\": movie.director,\n \"duration\": movie.duration,\n \"genre\": movie.genre,\n \"rate\": movie.rate\n }\n\n if (newArray.duration.includes(\"h\") && newArray.duration.includes(\"min\")) {\n newArray.duration = newArray.duration.slice(0, -3).split(\"h\");\n newArray.duration = Number(newArray.duration[0])*60 + Number(newArray.duration[1])\n } else if (newArray.duration.includes(\"h\")) {\n newArray.duration = Number(newArray.duration.slice(0, -1))*60\n } else {\n newArray.duration = Number(newArray.duration.slice(0, -3))\n }\n return newArray\n });\n return hourstomin\n}", "title": "" }, { "docid": "c7aefb573c735d77381ed34c5f767eb7", "score": "0.69972277", "text": "function convertTime(duration) { \n\t\tvar v_minutes = parseInt(duration / 60, 10) % 60;\n\t\tvar v_seconds = duration % 60;\n\t\tvar v_playtime = (v_minutes < 10 ? \"0\" + v_minutes : v_minutes) + \":\" + (v_seconds < 10 ? \"0\" + v_seconds : v_seconds);\n\t\treturn v_playtime;\n\t}", "title": "" }, { "docid": "efad3058c5b9dec5c18617ecb1b87573", "score": "0.69857484", "text": "function hourstoMinsAux(duration){\n\t\n\tlet totalTime = duration.split(\"\");\n\tlet hours = parseInt(totalTime[0]) * 60;\n\tlet minutes = 0\n\n\tif (!isNaN(totalTime[4])) {\n\t\tminutes = parseInt(totalTime[3]) * 10 + parseInt(totalTime[4]);\n\t}\n\telse if ((!isNaN(totalTime[3]))) {\n\t\tminutes = parseInt(totalTime[3]);\n\t}\n\treturn hours + minutes;\n}", "title": "" }, { "docid": "ec5c7e6160bbdc51a2fdd7cd89d95a9c", "score": "0.6971785", "text": "function turnHoursToMinutes(duration){\n \n var timeChunks = duration.split(\" \");\n var a = calculateHours(timeChunks[0]);\n var b = calculateMinutes(timeChunks[1])\n // console.log(b)\n}", "title": "" }, { "docid": "7568aeeffae538d1fd880047ad4123b6", "score": "0.69668067", "text": "function turnHoursToMinutes(movies) {\n let newMovies = JSON.parse(JSON.stringify(movies));\n\n let auxArr = newMovies.map(movie => {\n movie.duration = stringToMinutes(movie.duration);\n\n return movie;\n });\n\n return auxArr;\n}", "title": "" }, { "docid": "9a78002f7ba065fa0bcf1bf99174ed42", "score": "0.6961424", "text": "function turnHoursToMinutes(array){\n const newDuration = array.map(movie => {\n return movie.duration.split(\"\");\n });\nreturn newDuration;\n}", "title": "" }, { "docid": "6ed46bf5a681b739060eeb9cb87f0a58", "score": "0.69567394", "text": "function turnHoursToMinutes(arr) {\n let time;\n let hours;\n let mins;\n let newArr = arr.map(function(movie) {\n time = movie.duration;\n if (!time.includes(\"h\")){\n time = \"0h \" + time;\n }\n if (!time.includes(\"min\")) {\n time = time + \" 0min\"\n }\n time = time.split(\"h\");\n hours = parseInt(time[0]) * 60;\n mins = time[1].split(\"min\");\n mins = parseInt(mins[0]);\n time = hours + mins;\n \n movie.duration = time;\n return movie;\n })\n\n return newArr;\n}", "title": "" }, { "docid": "9457891a7c580c94c843e73b14d71306", "score": "0.68969214", "text": "function turnHoursToMinutes(array) {\n let newDumbArray = [...array];\n let finalArrayThankGod = newDumbArray.map( (newMovie) => {\n let duration = newMovie.duration\n let min = 0;\n let hour = 0;\n let final = 0;\n let floater;\n if (duration.includes('h') & duration.includes('min')) {\n floater = duration.replace('h', ' ').replace('min', ' ').trim();\n let hour = Number(floater.substring(0, floater.indexOf(\" \") ) );\n let min = Number(floater.substring(floater.indexOf(\" \") + 1) );\n final = ((hour * 60) + min);\n\n }\n else if (duration.includes('h')) {\n hour = Number(duration.substring(0, duration.indexOf(\"h\") ) );\n final = hour * 60;\n\n }\n else if (duration.includes('min')) {\n min = Number(duration.substring(0,duration.indexOf(\"min\") ) );\n final = min;\n }\n\n return {\n title: newMovie.title,\n year: newMovie.year,\n director: newMovie.director,\n duration: final,\n genre: newMovie.genre,\n rate: newMovie.rate\n }\n }\n )\n return finalArrayThankGod;\n}", "title": "" }, { "docid": "2cc47b55026a94ea53d20122ba3a1365", "score": "0.6883608", "text": "function turnHoursToMinutes(array) {\n return array.map(function(item) {\n let checkValueHour = false;\n let checkValueMinutes = false;\n if (item.duration.indexOf(\"h\", \"\") >= 0) {\n checkValueHour = true;\n }\n if (item.duration.indexOf(\"min\", \"\") >= 0) {\n checkValueMinutes = true;\n }\n let res = item.duration.replace(/[^0-9 ]/gi, \"\").split(\" \");\n let newMovie = Object.assign({}, item);\n if (checkValueHour === true && checkValueMinutes === true) {\n let hour = parseInt(res[0]);\n let minutes = parseInt(res[1]);\n newMovie.duration = hour * 60 + minutes;\n } else if (checkValueHour === true && checkValueMinutes === false) {\n let hour = parseInt(res[0]);\n newMovie.duration = hour * 60;\n } else if (checkValueHour === false && checkValueMinutes === true) {\n let minutes = parseInt(res[0]);\n newMovie.duration = minutes;\n }\n return newMovie;\n });\n}", "title": "" }, { "docid": "1811c2ec471610d47c854e7e368dccd3", "score": "0.6847329", "text": "function turnHoursToMinutes(movies){\n var copy = Object.assign({}, movies);\n var horas=[];\n var tiempo=[];\n var minuto=[];\n var hour=[];\n var cont=0;\n var espacio=\" \";\n var tiemTo=0;\n \n var resul=movies.map(function(n){\n //console.log('n',n);\n hour=n['duration'];\n console.log(\" caracter horas---------\",hour.length);\n if(hour.length >=6){\n console.log(\"---------IF\",n)\n tiempo=(hour.toString()).split(espacio);\n horas=(tiempo[0].substring(0,1)*60);\n minuto=(tiempo[1].substring(0,2));\n console.log(\"minuto\",minuto);\n tiemTo=parseInt(horas)+ parseInt( minuto);\n console.log(\"horas totales:\",tiemTo);\n movies[cont]['duration']=tiemTo;\n console.log(\"movies\",movies[cont]['duration']);\n }\n console.log(\"llego aqui\");\n if(hour.length<=3) \n {\n console.log(\"---------else horas\",hour)\n \n horas=(hour.substring(0,1)*60); \n tiemTo=parseInt(horas);\n movies[cont]['duration']=tiemTo\n console.log(\"solo horas\",tiemTo);\n \n } if(hour.length<=5&&hour.length>3){\n console.log(\"---------else2 horas\",hour);\n\n minuto=(hour.substring(0,2));\n console.log(\"minuto\",minuto); \n tiemTo=parseInt(minuto);\n movies[cont]['duration']=tiemTo\n console.log(\"solo horas\",tiemTo);\n }\n console.log(\"resul\",n)\n return n;\n }); \nconsole.log(\"resul\",resul)\nreturn copy;\n\n}", "title": "" }, { "docid": "897e1c361e71c8ecd86c3b11ce2d1c4f", "score": "0.68342024", "text": "function turnHoursToMinutes(array){\n var newArr = [];\n array.map((movie) => {\n if(movie.duration === null){\n return;\n }\n var mins = parseInt(movie.duration.substring(0,1)) * 60;\n var totalminutos= parseInt(movie.duration.substring(3,5)) + mins;\n if(!movie.duration.includes(\"min\")){\n movie.duration = mins;\n }else{\n movie.duration = totalminutos;\n }\n });\n for (i = 0; i < array.length; i++) {\n newArr.push(array[i]);\n }\n return newArr;\n}", "title": "" }, { "docid": "5ed02876cd813e2969af13ca272cf58f", "score": "0.6772553", "text": "function turnHoursToMinutes(array){\n workingArray = JSON.parse(JSON.stringify(array));\n let newArray;\n newArray = workingArray.map(function(movie){\n let hoursRegex = /([\\d])h/\n let minsRegex = /(\\d\\d?)min/\n let hours = movie.duration.match(hoursRegex);\n let mins = movie.duration.match(minsRegex);\n newDuration = 0;\n if(hours){\n newDuration += parseInt(hours[1]) * 60;\n }\n if(mins){\n newDuration += parseInt(mins[1])\n }\n movie.duration = newDuration;\n return movie;\n })\n return newArray;\n}", "title": "" }, { "docid": "aefdd6cd47486c60420936b26251cae2", "score": "0.67646325", "text": "function msToTime(duration) {\n var minutes = parseInt((duration/(60))%60);\n var hours = parseInt((duration/(60*60))%24);\n if (hours < 1){\n return minutes+\"mins\";\n } else {\n return hours + \"hrs \" + minutes+\"mins\";\n }\n}", "title": "" }, { "docid": "81c4205e5b20a956a38e4cc3ac9a1d69", "score": "0.6726084", "text": "function convert_to_mins_and_secs(seconds, minus1) {\n // var mins = (seconds >= 60) ? Math.round(seconds / 60) : 0;\n // var secs = (seconds % 60 != 0) ? Math.round(seconds % 60) : 0;\n // var secs = (minus1 == true) ? (secs - 1) : secs; //Youtube always displays 1 sec less than its duration time!!! Then we have to set minus1 flag to true for converting player.getDuration()\n var time = Math.ceil(seconds); /*mins + \"m\" + ((secs < 10) ? \"0\" + secs : secs) + \"s\";*/\n return time;\n }", "title": "" }, { "docid": "d572daebb8b59641526c104c26874d43", "score": "0.66985834", "text": "function turnHoursToMinutes(array){\n let realArr = array.map((each)=>{\n return {\n title: each.title,\n year: each.year,\n director: each.director,\n duration: each.duration,\n genre: each.genre,\n rate: each.rate\n }\n })\n realArr.forEach(each => {\n let time = 0;\n let otherTime = \"\";\n //Fixes hours\n if (each.duration.match(\"h\")){\n time += Number(each.duration.substr(0, each.duration.indexOf(\"h\")))*60;\n }\n \n //Removes m and turns to a number\n if(each.duration.match(\"m\")){\n otherTime = each.duration.substr(each.duration.indexOf(' ')+1);\n otherTime = Number(otherTime.substr(0, otherTime.indexOf(\"m\")));\n \n //Adds minutes to the time\n time += otherTime;\n }\n \n each.duration = time;\n })\n \n return realArr.sort((a,b)=>{\n if(a.duration > b.duration){\n return -1;\n }else if(b.duration > a.duration){\n return 1;\n }else{\n return 0;\n }\n }, 0);\n}", "title": "" }, { "docid": "08c3f9cb2557eb20303026ba3ee6461f", "score": "0.6668546", "text": "function turnHoursToMinutes (array){\n var mov = array.map(function(elem){\n var newElem = Object.assign({},elem);\n\n var time = 0;\n var dur = newElem.duration.split(' '); \n if (dur.length === 1){\n if (dur[0].indexOf('h') === -1){\n var min = parseInt(dur[0].slice(0,3));\n time += min;\n } else {\n var hours = parseInt(dur[0].slice(0,1));\n time += hours*60; \n }\n }\n else {\n var hours = parseInt(dur[0].slice(0,1));\n var min = parseInt(dur[1].slice(0,3));\n time += hours * 60;\n time += min;\n } \n newElem.duration = time;\n return newElem; \n }); \nreturn mov;\n}", "title": "" }, { "docid": "d0799b0ba5a53481aff171b72e7ce47d", "score": "0.66555125", "text": "function turnHoursToMinutes (arraytest) {\n let out = arraytest.map( s => {\n let numHour=0;\n let numMin=0;\n let min=\"\";\n let hours= s.duration.split('h');\n if (hours.length > 1 ) {\n numHour=Number(hours[0])*60;\n min= hours[1].split('min');\n }else \n min=s.duration.split('min');\n \n if ( min.length > 1 ) {\n numMin=Number(min[0]);\n }\n return {\n title: s.name,\n year: s.year,\n director: s.director,\n duration:numHour+numMin ,\n genre: s.genre,\n rate: s.rate }\n });\n return out;\n}", "title": "" }, { "docid": "3a0e258573eccf2d3e23008971cead44", "score": "0.6654695", "text": "function turnHoursToMinutes(){}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.66545296", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.66545296", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.66545296", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.66545296", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.66545296", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.66545296", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.66545296", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "aa32be6f9be98e5ba97199220e573d9f", "score": "0.66164917", "text": "duration() {\n var seconds = (this.props.song.duration) % 60\n if (seconds < 10) { seconds = '0' + seconds }\n var minutes = Math.floor(this.props.song.duration / 60)\n let duration = minutes + \":\" + seconds;\n return duration\n }", "title": "" }, { "docid": "cb1e5a7a6c87eb4113c10fe64e867b41", "score": "0.65960956", "text": "function turnHoursToMinutes(arr) {\n\n console.log(arr)\n\n let newArr = arr.map((eachMovie)=>{\n let element = eachMovie.duration\n let hoursArr = element.split('h');\n let minsArr = element.split('min');\n\n let hours = parseFloat(minsArr[0]);\n let minutes = parseFloat(hoursArr[1]);\n eachMovie.duration = hours + minutes\n return eachMovie\n })\n console.log(newArr)\n return newArr;\n\n}", "title": "" }, { "docid": "51ae3df83a3dcf08d9f5db3daeb1481f", "score": "0.65579474", "text": "function turnHoursToMinutes() { }", "title": "" }, { "docid": "6aa99b87038bd36c9960298adc11d6d5", "score": "0.65368026", "text": "function duration(item) {\n var pluralise = function(n) {\n return n > 1 ? \"s\" : \"\";\n };\n var dur = item.duration,\n hours = Math.floor(dur / (60 * 60));\n\n dur -= hours * 60 * 60;\n var minutes = Math.floor(dur / 60);\n item.duration -= minutes * 60;\n if (hours > 0 && minutes > 0) {\n return hours + \" hour\"+pluralise(hours)+\", \"+minutes+\" min\"+pluralise(minutes);\n } else if (hours > 0 && minutes == 0) {\n return hours + \" hour\"+pluralise(hours);\n } else {\n return minutes+\" min\"+pluralise(minutes);\n }\n }", "title": "" }, { "docid": "02ea4bb261d0ee43f9661c9658a1dfc5", "score": "0.651096", "text": "function turnHoursToMinutes(array){\n array.forEach(function(element){\n var hours= parseInt(element.duration.substring(0,1));\n var minutes = parseInt(element.duration.split(\"min\")[0].substring(2));\n element.duration = hour * 60 + minutes;\n });\n return array;\n }", "title": "" }, { "docid": "d1301fce3a9b9bc409ddff31a95a795b", "score": "0.6504363", "text": "function turnHoursToMinutes(array){\n array.forEach(function(element) {\n var hour = parseInt(element.duration.substring(0,1));\n var minutes = parseInt(element.duration.split(\"min\")[0].substring(2));\n element.duration = hour *60 + minutes;\n });\n return array\n }", "title": "" }, { "docid": "8d9e51db95e5887986130ee5a40ed6fa", "score": "0.6500818", "text": "function orderByDuration(movies) {\n var withNumbers = turnHoursToMinutes(movies);\n console.log(withNumbers)\n withNumbers.sort((left, right) => left.title - right.title)\n console.log(withNumbers)\n}", "title": "" }, { "docid": "33742a2393ed933ba63f7d0ca907b92b", "score": "0.6499363", "text": "function turnHoursToMinutes(array){\n return array.map((value) => { \n const duration = value.duration.split(' ');\n let minutes = 0;\n for (let time of duration) { \n if(time.includes('h')) { \n minutes += parseInt(time) *60;\n } else { \n minutes += parseInt(time); \n }\n }\n return { \n ...value,\n duration: minutes\n }; \n }); \n}", "title": "" }, { "docid": "bad47f5cfdda143d00ab382ac93e312a", "score": "0.6498201", "text": "function turnHoursToMinutes(arr) {\n const time = arr.map ((movie) => movie.duration);\n const arrMinutes = time.map ((str) => Number(str.replace(/[^0-9\\.-]+/g, \"\")));\n return arrMinutes;\n}", "title": "" }, { "docid": "3c721ceb356d5ca42c7a5687803b5eee", "score": "0.6480334", "text": "function orderByDuration(movies) {\n //if (movies.length === 1) return movies;\n const convertedMovies = turnHoursToMinutes(movies);\n convertedMovies.sort((a, b) => {\n return a.duration - b.duration;\n });\n\n return convertedMovies;\n}", "title": "" }, { "docid": "2d5e01463d02aefc861545ec3421a573", "score": "0.6464003", "text": "function hoursToMinutes(movies) {\n //Create new array with JSON.stringify() & JSON.parse() to avoid changing the original array while being a deep clone & assigns it to newMovies\n const newMovies = JSON.parse(JSON.stringify( movies));\n //Create the method which will allow us to get the number of hours from the string value the \"duration\" property\n //the element recived (\"elemToSplit\") will be converted into string to then use .split() to get the number\n const hourSplitter = (elemToSplit) => elemToSplit.toString().split(\"h\", 1);\n //Create the method which will allow us to get the number of minutes from the string value the \"duration\" property\n //the element recived (\"elemToSplit\") will be converted into string to then use .split() to separate the string in two arr elem\n //use .pop() to get the last element (the one with the minutes) & then use .split() again to get the number\n const minuteSplitter = (elemToSplit) => elemToSplit.toString().split(\" \").pop().split(\"min\", 1);\n //Use .map() to apply the different methods and calc the value in minutes\n newMovies.map( elem => {\n //if the \"duration\" property of the checked movie contains \"min\" \n if(elem[\"duration\"].includes(\"min\")){\n //Assign to the the value calc to the movie \"duration\" property value\n elem[\"duration\"] = \n //To calc the value we use the method to get the hours number, multiply it by 60 & sum the minutes abtained of applying the minutes method\n parseInt(hourSplitter(elem[\"duration\"])) * 60 + parseInt(minuteSplitter(elem[\"duration\"]));\n }\n //if the \"duration\" property of the checked movie does not contain \"min\" \n else{\n //Assign to the the value calc to the movie \"duration\" property value\n //To calc the value we use the method to get the hours number, multiply it by 60\n elem[\"duration\"] = parseInt(hourSplitter(elem[\"duration\"])) * 60;\n }\n });\n //Assign \"newMovies\" to the created \"result\"\n let result = newMovies;\n console.log(\"EXERCICE 7 ->\", result);\n return result;\n}", "title": "" }, { "docid": "61b86e617e04642d3b85ea47cb50c017", "score": "0.6423128", "text": "function turnHoursToMinutes(array){\n array.forEach(function(element) {\n var hour = parseInt(element.duration.substring(0,1));\n var minutes = parseInt(element.duration.split(\"min\")[0].substring(2));\n element.duration = hour * 60 + minutes;\n });\n return array;\n}", "title": "" }, { "docid": "14c13adb48cb5a559c87faed74f15823", "score": "0.6411809", "text": "function hoursToMinutes() {\n\n}", "title": "" }, { "docid": "14c13adb48cb5a559c87faed74f15823", "score": "0.6411809", "text": "function hoursToMinutes() {\n\n}", "title": "" }, { "docid": "a8570c5c7bde951d3654292c7dde54b6", "score": "0.6400821", "text": "set duration(value) {}", "title": "" }, { "docid": "422fb844a358c7934e68a71cca9863ab", "score": "0.6388293", "text": "timeConvert(numOfMins) {\n // store numOfMins in a variable\n // minutes equals seconds by 60 \n // dividing by 60 counts hours before decimal or remainder\n // what's left as a whole integer counts minutes\n // the remainder counts seconds\n // return results \n\n let hours = Math.floor(numOfMins / 60);\n let minutes = Math.trunc(numOfMins) % 60;\n let seconds = (numOfMins % 60 % 1);\n seconds = Math.floor(seconds * 60);\n let results = `${hours}:${minutes}:${seconds}`;\n return results;\n }", "title": "" }, { "docid": "906ef881246ebb33ff1a5a4c4c1619a1", "score": "0.6364328", "text": "function turnHoursToMinutes(arr){\n\n let newArray = []\n arr.forEach(elem =>{\n let obj = {...elem}\n newArray.push(obj)\n } )\n\n let result = newArray.map(elem =>{\n let durationString = elem['duration']\n let h = durationString.indexOf(\"h\")\n let min = durationString.indexOf('min')\n let minutes = 0\n let hours = 0\n if (min >=0){\n minutes = parseInt(durationString.slice(min-2, min))\n }\n if (h >= 0){\n hours = parseInt(durationString.slice(h-1, h))\n }\n \n hours = hours*60\n let result = hours + minutes\n elem['duration'] = result\n return elem\n })\n return result\n}", "title": "" }, { "docid": "2495c70b63a808925ed9c305e9e4a9f3", "score": "0.63338053", "text": "timeConvert(numOfMins){\n // Return the hours only and round down\n let hours = math.floor(numOfMins/60);\n // Return the remaining value left over from hours\n let mins = math.floor(numOfMins % 60);\n // Return the remaining value left from mins\n let sec = math.floor(numOfMins % 60)\n // Return sum of hours, mins, and sec\n return hours + \":\" + mins + \":\" + sec;\n }", "title": "" }, { "docid": "39bf4c2dc0c972095056b351e1f17f3f", "score": "0.63275427", "text": "function turnHoursToMinutes(array){\n var arr = array.map(function(e) {\n var a = parseInt(e.duration[0])\n var sum = 0;\n if(e.duration[4] == \"m\") {\n sum = a*60 + parseInt(e.duration[3]);\n } else {\n sum = a*60 + parseInt(e.duration[3])*10 + parseInt(e.duration[4]);\n }\n //e.duration = sum;\n return {duration: sum}; \n })\n return arr;\n}", "title": "" }, { "docid": "70c83f49eca83ba41d8b6d3831c273ca", "score": "0.6319667", "text": "function turnHoursToMinutes (){\n \n}", "title": "" }, { "docid": "b6f43f0b2fc565f0e58da79d03debb0a", "score": "0.6301394", "text": "function setSecondsToTime(duration) {\r\n // Hours, minutes and seconds\r\n var hrs = ~~(duration / 3600);\r\n var mins = ~~((duration % 3600) / 60);\r\n var secs = ~~duration % 60;\r\n\r\n var ret = \"\";\r\n \r\n if (hrs > 0) {\r\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\r\n }\r\n \r\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\r\n ret += \"\" + secs;\r\n \r\n // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\r\n return ret;\r\n}", "title": "" }, { "docid": "3a4d79c1d498db951ce1158245b93e8d", "score": "0.625373", "text": "function turnHoursToMinutes(array) {\n var newArray = []; \n\n newArray = array.map(function (elem) {\n var newElem = Object.assign({}, el);\n if(newElem.duration.search('h') < 0){\n newElem.duration = newElem.duration.replace('min','');\n \n }else{\n var newDuration = newElem.duration.replace('h','').replace('min','').split(' ');\n newElem.duration = ((Number(newDuration[0])* 60) + Number(newDuration[1])).toString();\n }\n });\n\n return newArray;\n}", "title": "" }, { "docid": "9ed669bdb9a1e428e08ced05cdac09d4", "score": "0.62347865", "text": "function calculateDuration(time) {\n let minutes = time % 60;\n let hour = (time - minutes) / 60;\n return hour + 'h ' + minutes + 'min';\n }", "title": "" }, { "docid": "372a18a968b1e6092bba9eb37d1c4111", "score": "0.6201109", "text": "function orderByDuration(movies){\n var sortedMovies = turnHoursToMinutes(movies)\n\n sortedMovies.sort(function(a,b) {\n if (a.title > b.title) {\n return 1;\n } else if (a.title < b.title) {\n return -1;\n }\n return 0;\n })\n sortedMovies.sort(function(a, b){\n return a.duration - b.duration\n })\n \n return sortedMovies\n}", "title": "" }, { "docid": "ccbe2d8f51e25e37b3030a56d8af4628", "score": "0.61932397", "text": "function orderByDuration(movies = []) {\n\n if (movies.length === 1) {\n return movies;\n }\n\n let moviesInMinutes = turnHoursToMinutes(movies);\n\n moviesInMinutes.sort((movie1, movie2) => {\n if ((movie1.duration < movie2.duration) || (movie1.title < movie2.title)) {\n return -1;\n }\n\n if ((movie1.duration > movie2.duration) || (movie1.title > movie2.title) ){\n return 1;\n }\n\n return 0;\n });\n return moviesInMinutes;\n}", "title": "" }, { "docid": "40612c61baae45d36763d0c149f04869", "score": "0.6159341", "text": "function durationchange(){ //when video duration changes, a new video has been loaded, print the new video duration\n if(!isNaN(video.duration/video.playbackRate)){\n duration.textContent = formatTime(video.duration/video.playbackRate);\n currentTime.textContent = formatTime(video.currentTime/video.playbackRate);\n }\n}", "title": "" }, { "docid": "6188dcb3017d99128f4b36c734946622", "score": "0.61591876", "text": "function convertTime() {\n if (Game.timeLivedSeconds == 59) {\n Game.timeLivedSeconds = 0;\n Game.timeLivedMinutes++;\n } else if (Game.timeLivedMinutes == 59) {\n Game.timeLivedMinutes = 0;\n Game.timeLivedHours++;\n } else if (Game.timeLivedHours == 24) {\n Game.timeLivedHours = 0;\n Game.timeLivedDays++;\n }\n}", "title": "" }, { "docid": "5bc338145232e3f779a83351a9bfaa4f", "score": "0.61481464", "text": "function convert_to_minutes(){\n\t\n\t\tfor (var i=0; i<schedules.length; i++){\n\t\t\tvar time = schedules[i][\"Seconds\"];\n\t\t\tvar minutes = Math.floor(time / 60);\n\t\t\tvar seconds = time - minutes * 60;\n\t\t\tschedules[i][\"Seconds\"] = minutes + \".\" + seconds;\n\t\t} \n\n\t}", "title": "" }, { "docid": "c10c66d4b5110b7bd513468997127ed7", "score": "0.614428", "text": "get duration() {}", "title": "" }, { "docid": "e706ba2828bd534981a6f9b7adbc648e", "score": "0.6139176", "text": "function renderTime(duration) {\n if(isNaN(duration)) {\n console.log(\"NEED A NUMBER in renderTime()\");\n return;\n }\n\n let minutes, seconds, indicatorbar;\n\n minutes = parseInt(duration/60, 10);\n seconds = parseInt(duration%60, 10);\n\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n seconds = seconds < 10 ? \"0\" + seconds : seconds;\n\n pomodoroText.html(minutes + \":\" + seconds );\n state.pauseDuration = duration;\n\n indicatorbar = duration /state.workDuration * 100;\n $(\".progress-bar\").css(\"width\", indicatorbar + \"%\");\n\n }", "title": "" }, { "docid": "2f3b43840e057c392a01441c70ed3961", "score": "0.6134411", "text": "function turnHoursToMinutes(arr) {\n let newArray = [];\n for (let i = 0; i < arr.length; i++) {\n let hoursInMinutes = arr[i].duration[0] * 60;\n let minutesTogether = arr[i].duration[3] + arr[i].duration[4];\n let completeLength = hoursInMinutes + +minutesTogether;\n newArray.push(completeLength)\n }\n return newArray\n}", "title": "" } ]
e5796345e92fbbb06bd42058d9ba9ad3
unused harmony export quadIn / unused harmony export quadOut / unused harmony export quadInOut
[ { "docid": "df037f546a951a7c183911e8d51885d2", "score": "0.62003905", "text": "function quadIn(t) {\n return t * t;\n}", "title": "" } ]
[ { "docid": "b8867bb0b116b057f9205acb7936472c", "score": "0.6089919", "text": "function UVQuad(){\n\t\t\n\t}", "title": "" }, { "docid": "967fc1cc8e96084bc558af89417e6ee8", "score": "0.6009366", "text": "function quad(a, b, c, d, cubenum)\n{\n\t//define vertices for all 27 .32x.32x.32 cubes in one single vertices definition, with .02 spacing\n var vertices = [\n vec4( -0.5 +(cubenum%3)*0.34, -0.5 +(Math.floor(cubenum/3)%3)*0.34, 0.5 -(Math.floor(cubenum/9)%3)*0.34, 1.0 ),\n vec4( -0.5 +(cubenum%3)*0.34, -0.18+(Math.floor(cubenum/3)%3)*0.34, 0.5 -(Math.floor(cubenum/9)%3)*0.34, 1.0 ),\n vec4( -0.18+(cubenum%3)*0.34, -0.18+(Math.floor(cubenum/3)%3)*0.34, 0.5 -(Math.floor(cubenum/9)%3)*0.34, 1.0 ),\n vec4( -0.18+(cubenum%3)*0.34, -0.5 +(Math.floor(cubenum/3)%3)*0.34, 0.5 -(Math.floor(cubenum/9)%3)*0.34, 1.0 ),\n vec4( -0.5 +(cubenum%3)*0.34, -0.5 +(Math.floor(cubenum/3)%3)*0.34, 0.18-(Math.floor(cubenum/9)%3)*0.34, 1.0 ),\n vec4( -0.5 +(cubenum%3)*0.34, -0.18+(Math.floor(cubenum/3)%3)*0.34, 0.18-(Math.floor(cubenum/9)%3)*0.34, 1.0 ),\n vec4( -0.18+(cubenum%3)*0.34, -0.18+(Math.floor(cubenum/3)%3)*0.34, 0.18-(Math.floor(cubenum/9)%3)*0.34, 1.0 ),\n vec4( -0.18+(cubenum%3)*0.34, -0.5 +(Math.floor(cubenum/3)%3)*0.34, 0.18-(Math.floor(cubenum/9)%3)*0.34, 1.0 )\n ];\n\n var vertexColors = [\n [ 0.0, 0.0, 0.0, 1.0 ], // black\n [ 0.0, 0.0, 1.0, 1.0 ], // blue\n [ 1.0, 1.0, 0.0, 1.0 ], // yellow\n [ 1.0, 0.0, 0.0, 1.0 ], // red\n [ 0.0, 1.0, 0.0, 1.0 ], // green\n [ 1.0, 1.0, 1.0, 1.0 ], // white\n [ 1.0, 0.65, 0.0, 1.0 ], //orange\n [ 0.0, 1.0, 1.0, 1.0 ] // cyan\n\n ];\n\n // We need to parition the quad into two triangles in order for\n // WebGL to be able to render it. In this case, we create two\n // triangles from the quad indices\n\n //vertex color assigned by the index of the vertex\n var indices = [ a, b, c, a, c, d ];\n\tfor ( var i = 0; i < indices.length; ++i ) {\n\t points.push( vertices[indices[i]] );\n\t totpoints.push( vertices[indices[i]] );\n\t \n\n\t // If it isn't an outer face, make it black\n\t if(!(outerFace(vertices[a])&&outerFace(vertices[b])&&outerFace(vertices[b])&&outerFace(vertices[c])&&outerFace(vertices[d]))){\n\t \tcolors.push(vertexColors[0]);\n\t \ttotcolors.push(vertexColors[0]);\n\t }\n\t // for solid colored faces use\n\t else{\n\t \tcolors.push(vertexColors[a]);\n\t \ttotcolors.push(vertexColors[a]);\n\t }\n\n\t}\n}", "title": "" }, { "docid": "55632f6a9d290b28c02dd345feaac69a", "score": "0.5991208", "text": "static outQuad(t, b, c, d) {\n return -c * (t /= d) * (t - 2) + b;\n }", "title": "" }, { "docid": "b74977350f5152820c9e4f89add2fdb0", "score": "0.59517336", "text": "function quad(a, b, c, d) {\n colors.push(vertexColors[a]);\n pointsArray.push(vertices[a]);\n colors.push(vertexColors[a]);\n pointsArray.push(vertices[b]);\n colors.push(vertexColors[a]);\n pointsArray.push(vertices[c]);\n colors.push(vertexColors[a]);\n pointsArray.push(vertices[d]);\n}", "title": "" }, { "docid": "781876ff3cb6a2ba8bd913c46624921c", "score": "0.59373784", "text": "static EaseInQuad(t) {\n return t * t\n }", "title": "" }, { "docid": "ca4e9ee8b227039226d4b219e2e7374e", "score": "0.584085", "text": "function quad(a, b, c, d, triLinear) {\n if(triLinear){\n var coord = zoom;\n }\n else{\n var coord = texCoord;\n }\n pointsArray.push(vertices[a]); \n colorsArray.push(vertexColors[0]); \n texCoordsArray.push(coord[2]);\n\n pointsArray.push(vertices[b]); \n colorsArray.push(vertexColors[0]);\n texCoordsArray.push(coord[3]); \n\n pointsArray.push(vertices[c]); \n colorsArray.push(vertexColors[0]);\n texCoordsArray.push(coord[0]); \n \n pointsArray.push(vertices[a]); \n colorsArray.push(vertexColors[0]);\n texCoordsArray.push(coord[2]); \n\n pointsArray.push(vertices[c]); \n colorsArray.push(vertexColors[0]);\n texCoordsArray.push(coord[0]); \n\n pointsArray.push(vertices[d]); \n colorsArray.push(vertexColors[0]);\n texCoordsArray.push(coord[1]); \n}", "title": "" }, { "docid": "e03d45ede6bb81697ee42a5d1b7f63ae", "score": "0.5811598", "text": "function quad(a, b, c, d)\n{\n var verts = [];\n\n var vertices = [\n vec4(-0.5, -0.5, 0.5, 1.0),\n vec4(-0.5, 0.5, 0.5, 1.0),\n vec4(0.5, 0.5, 0.5, 1.0),\n vec4(0.5, -0.5, 0.5, 1.0),\n vec4(-0.5, -0.5, -0.5, 1.0),\n vec4(-0.5, 0.5, -0.5, 1.0),\n vec4(0.5, 0.5, -0.5, 1.0),\n vec4(0.5, -0.5, -0.5, 1.0)\n ];\n\n var indi = [ a, b, c, a, c, d ];\n var indiclength = indi.length;\n\n for (var i = 0; i < indiclength; ++i)\n {\n verts.push(vertices[indi[i]]);\n }\n quadTex();\n return verts;\n}", "title": "" }, { "docid": "d87ff745a726208cc02666e19f0ec54b", "score": "0.5783402", "text": "function Q$5(Q){const X=new o$1u,{vertex:Y,fragment:Z,varyings:ee}=X;return v$M(Y,Q),X.include(o$1f),ee.add(\"vpos\",\"vec3\"),X.include(s$Y,Q),X.include(p$G,Q),X.include(a$W,Q),Q.hasColorTextureTransform&&X.include(s$H),Q.output!==h$1c.Color&&Q.output!==h$1c.Alpha||(Q.hasNormalTextureTransform&&X.include(i$D),Q.hasEmissionTextureTransform&&X.include(t$N),Q.hasOcclusionTextureTransform&&X.include(n$N),Q.hasMetallicRoughnessTextureTransform&&X.include(x$q),c$18(Y,Q),X.include(o$H,Q),X.include(r$1b,Q),Q.normalType===i$M.Attribute&&Q.offsetBackfaces&&X.include(e$H),X.include(c$J,Q),X.include(n$V,Q),Q.instancedColor&&X.attributes.add(O$O.INSTANCECOLOR,\"vec4\"),ee.add(\"localvpos\",\"vec3\"),X.include(o$1x,Q),X.include(d$1k,Q),X.include(i$E,Q),X.include(e$F,Q),Y.uniforms.add(new e$1B(\"externalColor\",(e=>e.externalColor))),ee.add(\"vcolorExt\",\"vec4\"),Q.hasMultipassTerrain&&ee.add(\"depth\",\"float\"),Q.hasModelTransformation&&Y.uniforms.add(new e$1A(\"model\",(o=>r$3A(o.modelTransformation)?o.modelTransformation:o$1F))),Y.code.add(n$1x`\n void main(void) {\n forwardNormalizedVertexColor();\n vcolorExt = externalColor;\n ${Q.instancedColor?\"vcolorExt *= instanceColor;\":\"\"}\n vcolorExt *= vvColor();\n vcolorExt *= getSymbolColor();\n forwardColorMixMode();\n\n if (vcolorExt.a < ${n$1x.float(t$14)}) {\n gl_Position = vec4(1e38, 1e38, 1e38, 1.0);\n } else {\n vpos = calculateVPos();\n localvpos = vpos - view[3].xyz;\n vpos = subtractOrigin(vpos);\n ${Q.normalType===i$M.Attribute?n$1x`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:\"\"}\n vpos = addVerticalOffset(vpos, localOrigin);\n ${Q.hasVertexTangents?\"vTangent = dpTransformVertexTangent(tangent);\":\"\"}\n gl_Position = transformPosition(proj, view, ${Q.hasModelTransformation?\"model,\":\"\"} vpos);\n ${Q.normalType===i$M.Attribute&&Q.offsetBackfaces?\"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);\":\"\"}\n }\n\n ${Q.hasMultipassTerrain?\"depth = (view * vec4(vpos, 1.0)).z;\":\"\"}\n forwardLinearDepth();\n forwardTextureCoordinates();\n ${Q.hasColorTextureTransform?n$1x`forwardColorUV();`:\"\"}\n ${Q.hasNormalTextureTransform?n$1x`forwardNormalUV();`:\"\"}\n ${Q.hasEmissionTextureTransform?n$1x`forwardEmissiveUV();`:\"\"}\n ${Q.hasOcclusionTextureTransform?n$1x`forwardOcclusionUV();`:\"\"}\n ${Q.hasMetallicRoughnessTextureTransform?n$1x`forwardMetallicRoughnessUV();`:\"\"}\n }\n `)),Q.output===h$1c.Alpha&&(X.include(u$R,Q),X.include(s$I,Q),X.include(n$1n,Q),Z.uniforms.add([new o$1w(\"opacity\",(e=>e.opacity)),new o$1w(\"layerOpacity\",(e=>e.layerOpacity))]),Q.hasColorTexture&&Z.uniforms.add(new f$1s(\"tex\",(e=>e.texture))),Z.include(i$C),Z.code.add(n$1x`\n void main() {\n discardBySlice(vpos);\n ${Q.hasMultipassTerrain?\"terrainDepthTest(gl_FragCoord, depth);\":\"\"}\n ${Q.hasColorTexture?n$1x`\n vec4 texColor = texture2D(tex, ${Q.hasColorTextureTransform?n$1x`colorUV`:n$1x`vuv0`});\n ${Q.textureAlphaPremultiplied?\"texColor.rgb /= texColor.a;\":\"\"}\n discardOrAdjustAlpha(texColor);`:n$1x`vec4 texColor = vec4(1.0);`}\n ${Q.hasVertexColors?n$1x`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:n$1x`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}\n gl_FragColor = vec4(opacity_);\n }\n `)),Q.output===h$1c.Color&&(X.include(u$R,Q),X.include(p$F,Q),X.include(n$O,Q),X.include(s$I,Q),X.include(Q.instancedDoublePrecision?h$D:v$B,Q),X.include(n$1n,Q),c$18(Z,Q),Z.uniforms.add([Y.uniforms.get(\"localOrigin\"),new e$1E(\"ambient\",(e=>e.ambient)),new e$1E(\"diffuse\",(e=>e.diffuse)),new o$1w(\"opacity\",(e=>e.opacity)),new o$1w(\"layerOpacity\",(e=>e.layerOpacity))]),Q.hasColorTexture&&Z.uniforms.add(new f$1s(\"tex\",(e=>e.texture))),X.include(x$W,Q),X.include(n$S,Q),Z.include(i$C),X.include(e$I,Q),h$A(Z),u$B(Z),a$1m(Z),Z.code.add(n$1x`\n void main() {\n discardBySlice(vpos);\n ${Q.hasMultipassTerrain?\"terrainDepthTest(gl_FragCoord, depth);\":\"\"}\n ${Q.hasColorTexture?n$1x`\n vec4 texColor = texture2D(tex, ${Q.hasColorTextureTransform?n$1x`colorUV`:n$1x`vuv0`});\n ${Q.textureAlphaPremultiplied?\"texColor.rgb /= texColor.a;\":\"\"}\n discardOrAdjustAlpha(texColor);`:n$1x`vec4 texColor = vec4(1.0);`}\n shadingParams.viewDirection = normalize(vpos - cameraPosition);\n ${Q.normalType===i$M.ScreenDerivative?n$1x`\n vec3 normal = screenDerivativeNormal(localvpos);`:n$1x`\n shadingParams.normalView = vNormalWorld;\n vec3 normal = shadingNormal(shadingParams);`}\n ${Q.pbrMode===d$1p.Normal?\"applyPBRFactors();\":\"\"}\n float ssao = evaluateAmbientOcclusionInverse();\n ssao *= getBakedOcclusion();\n\n vec3 posWorld = vpos + localOrigin;\n\n float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);\n float shadow = ${Q.receiveShadows?\"readShadowMap(vpos, linearDepth)\":Q.spherical?\"lightingGlobalFactor * (1.0 - additionalAmbientScale)\":\"0.0\"};\n\n vec3 matColor = max(ambient, diffuse);\n ${Q.hasVertexColors?n$1x`\n vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\n float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:n$1x`\n vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\n float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}\n ${Q.hasNormalTexture?n$1x`\n mat3 tangentSpace = ${Q.hasVertexTangents?\"computeTangentSpace(normal);\":\"computeTangentSpace(normal, vpos, vuv0);\"}\n vec3 shadingNormal = computeTextureNormal(tangentSpace, vuv0);`:n$1x`vec3 shadingNormal = normal;`}\n vec3 normalGround = ${Q.spherical?n$1x`normalize(posWorld);`:n$1x`vec3(0.0, 0.0, 1.0);`}\n\n ${Q.snowCover?n$1x`\n float snow = smoothstep(0.5, 0.55, dot(normal, normalGround));\n albedo = mix(albedo, vec3(1), snow);\n shadingNormal = mix(shadingNormal, normal, snow);\n ssao = mix(ssao, 1.0, snow);`:\"\"}\n\n vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;\n\n ${Q.pbrMode===d$1p.Normal||Q.pbrMode===d$1p.Schematic?n$1x`\n float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];\n ${Q.snowCover?n$1x`\n mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);\n emission = mix(emission, vec3(0.0), snow);`:\"\"}\n\n vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:n$1x`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}\n gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);\n ${Q.transparencyPassType===o$V.Color?n$1x`gl_FragColor = premultiplyAlpha(gl_FragColor);`:\"\"}\n }\n `)),X.include(b$q,Q),X}", "title": "" }, { "docid": "00612b6c5751c31ca48b9f17b3216988", "score": "0.57451046", "text": "function quad(a, b, c, d, v)\n{\n // Vertices of one cubelet (8 to choose from)\n var vertices = [\n vec4( -v, -v, v, 1.0 ),\n vec4( -v, v, v, 1.0 ),\n vec4( v, v, v, 1.0 ),\n vec4( v, -v, v, 1.0 ),\n vec4( -v, -v, -v, 1.0 ),\n vec4( -v, v, -v, 1.0 ),\n vec4( v, v, -v, 1.0 ),\n vec4( v, -v, -v, 1.0 )\n ];\n\n // Normals\n var t1 = subtract(vertices[b], vertices[a]);\n var t2 = subtract(vertices[c], vertices[b]);\n var normal = vec3(cross(t1, t2));\n\n // 6 vertices determine a face in a quad (2 triangles)\n var indices = [ a, b, c, a, c, d ];\n for ( var i = 0; i < indices.length; ++i ) {\n // Push the vertices into the vertex array\n points.push( vertices[indices[i]] );\n // Push the normals into the array\n normals.push(normal);\n }\n}", "title": "" }, { "docid": "0c40f0452756dde4212dc9a6d7633155", "score": "0.571721", "text": "static inOutQuad(t, b, c, d) {\n if ((t /= d / 2) < 1) return c / 2 * t * t + b;\n return -c / 2 * (--t * (t - 2) - 1) + b;\n }", "title": "" }, { "docid": "20f9f36b5c0ef87048217f7446857255", "score": "0.57112837", "text": "function quad(a, b, c, d, e)\n {\n var indices = [a, b, c, a, c, d];\n for (var i = 0; i < indices.length; i++)\n {\n for (var j = 0; j < 3; j++)\n {\n cubeVertices.push(cubePoints[indices[i]][j]);\n }\n for (var j = 0; j < 3; j++)\n {\n cubeVertices.push(cubeNormals[a][j]);\n }\n for (var j = 0; j < 2; j++)\n {\n switch (indices[i])\n {\n case a:\n cubeVertices.push(cubeTexCoords[e][j]);\n break;\n case b:\n cubeVertices.push(cubeTexCoords[e+1][j]);\n break;\n case c:\n cubeVertices.push(cubeTexCoords[e+2][j]);\n break;\n case d:\n cubeVertices.push(cubeTexCoords[e+3][j]);\n break;\n \n default:\n break;\n }\n }\n }\n }", "title": "" }, { "docid": "fbcfd2e115364e06d4e835147d7223e5", "score": "0.5711134", "text": "function cube(){\n quad( 1, 0, 3, 2 );\n quad( 2, 3, 7, 6 );\n quad( 3, 0, 4, 7 );\n quad( 6, 5, 1, 2 );\n quad( 4, 5, 6, 7 );\n quad( 5, 4, 0, 1 );\n}", "title": "" }, { "docid": "3ad1e47e42f21834c67f07d08b1719e4", "score": "0.563761", "text": "function quadIndices(qind)\n{\n for(var i = 0; i < qind.length; i+=4)\n {\n quad(qind[i], qind[i+1], qind[i+2], qind[i+3]);\n }\n index += 1;\n}", "title": "" }, { "docid": "5981215b1bf7188e3f5b65528da779e8", "score": "0.56337124", "text": "function quad(a, b, c, d) {\n var verts = [];\n var vertices = [\n vec4(-1.0, -1.0, 1.0, 1.0),\n vec4(-1.0, 1.0, 1.0, 1.0),\n vec4(1.0, 1.0, 1.0, 1.0),\n vec4(1.0, -1.0, 1.0, 1.0),\n vec4(-1.0, -1.0, -1.0, 1.0),\n vec4(-1.0, 1.0, -1.0, 1.0),\n vec4(1.0, 1.0, -1.0, 1.0),\n vec4(1.0, -1.0, -1.0, 1.0)\n ];\n var indices = [a, b, c, a, c, d];\n var ver;\n\n for (var i = 0; i < indices.length; ++i){\n ver = vertices[indices[i]];\n verts.push(ver);\n }\n\n return verts;\n}", "title": "" }, { "docid": "d8954822a9855cbb0401404401b5745c", "score": "0.5594282", "text": "function quad( a, b, c, d )\n{\n var t1 = subtract(cubeVertices[b], cubeVertices[a]);\n var t2 = subtract(cubeVertices[c], cubeVertices[b]);\n var normal = cross(t1, t2);\n\n var vertexOrder = [a, b, c, a, c, d];\n\n for (var i = 0; i < 6; i++) {\n cubePoints.push(cubeVertices[vertexOrder[i]]);\n normalsArray.push(normal);\n }\n }", "title": "" }, { "docid": "b18991e61456c6db129f696af22290cf", "score": "0.5537724", "text": "function quad(a, b, c, d)\r\n{\r\n var vertices = [\r\n vec4(-0.5, -0.5, 0.5, 1.0),\r\n vec4(-0.5, 0.5, 0.5, 1.0),\r\n vec4( 0.5, 0.5, 0.5, 1.0),\r\n vec4( 0.5, -0.5, 0.5, 1.0),\r\n vec4(-0.5, -0.5, -0.5, 1.0),\r\n vec4(-0.5, 0.5, -0.5, 1.0),\r\n vec4( 0.5, 0.5, -0.5, 1.0),\r\n vec4( 0.5, -0.5, -0.5, 1.0)\r\n ];\r\n\r\n var vertexColors = [\r\n [0.0, 0.0, 0.0, 1.0], // black\r\n [0.294, 0.000, 0.510, 1.0], // indigo\r\n [0.498, 1.000, 0.000, 1.0], // chartreuse \r\n [0.000, 0.980, 0.604, 1.0], // spring green\r\n [0.400, 0.804, 0.667, 1.0], // aquamarine\r\n [0.416, 0.353, 0.804, 1.0], // slate blue\r\n [0.0, 1.0, 1.0, 1.0], // cyan\r\n [1.0, 1.0, 1.0, 1.0] // white\r\n ];\r\n\r\n //assign colors to each vertex\r\n var indices = [a, b, c, a, c, d];\r\n for (var i = 0; i < indices.length; ++i) {\r\n points.push(vertices[indices[i]]);\r\n colors.push(vertexColors[a]);\r\n }\r\n}", "title": "" }, { "docid": "4676cf4bf5b1354f84b7ab58d74bad3d", "score": "0.55080116", "text": "function quad(a, b, c, d, col) {\n var u = subtract(vertices[b], vertices[a]);\n var v = subtract(vertices[c], vertices[a]);\n var normal = cross(u, v);\n console.log(normal[0] + \" \" + normal[1] + \" \" + normal[2]);\n\n // triangle 1\n pointsArray.push(vertices[a]);\n normalsArray.push(normal);\n BC_Array.push(vec3(1.0, 0.0, 0.0));\n\n pointsArray.push(vertices[b]);\n normalsArray.push(normal);\n BC_Array.push(vec3(0.0, 1.0, 0.0));\n\n pointsArray.push(vertices[c]);\n normalsArray.push(normal);\n BC_Array.push(vec3(0.0, 0.0, 1.0));\n\n // triangle 2\n pointsArray.push(vertices[a]);\n normalsArray.push(normal);\n BC_Array.push(vec3(1.0, 0.0, 0.0));\n\n pointsArray.push(vertices[c]);\n normalsArray.push(normal);\n BC_Array.push(vec3(0.0, 1.0, 0.0));\n\n pointsArray.push(vertices[d]);\n normalsArray.push(normal); \n BC_Array.push(vec3(0.0, 0.0, 1.0));\n}", "title": "" }, { "docid": "2d25070dbff5890890531b4e3e984f20", "score": "0.5482784", "text": "static EaseOutQuad(t) {\n return t * (2 - t)\n }", "title": "" }, { "docid": "cd2e5612ee2d20ca179df4e1f542c4ec", "score": "0.5400079", "text": "function quadToArray (quad) {\n return [quad.subject, quad.predicate, quad.object, quad.graph]\n}", "title": "" }, { "docid": "fb041691fba3d40847dfd408355d0d56", "score": "0.5393671", "text": "function quad(a, b, c, d) {\n var vertices = vertList[index];\n if(gouraud | phong)\n {\n //true vertex normals\n normalsArray.push(vec4(vertices[a][0],vertices[a][1], vertices[a][2], 0.0));\n normalsArray.push(vec4(vertices[b][0],vertices[b][1], vertices[b][2], 0.0));\n normalsArray.push(vec4(vertices[c][0],vertices[c][1], vertices[c][2], 0.0));\n normalsArray.push(vec4(vertices[a][0],vertices[a][1], vertices[a][2], 0.0));\n normalsArray.push(vec4(vertices[c][0],vertices[c][1], vertices[c][2], 0.0));\n normalsArray.push(vec4(vertices[d][0],vertices[d][1], vertices[d][2], 0.0));\n }\n \n if(flat)\n {\n //normals computed from three vertices\n var t1 = subtract(vertices[b], vertices[a]);\n var t2 = subtract(vertices[c], vertices[b]);\n var normal = normalize(cross(t1, t2));\n normalsArray.push(vec4(normal[0], normal[1], normal[2], 0.0));\n normalsArray.push(vec4(normal[0], normal[1], normal[2], 0.0));\n normalsArray.push(vec4(normal[0], normal[1], normal[2], 0.0));\n normalsArray.push(vec4(normal[0], normal[1], normal[2], 0.0));\n normalsArray.push(vec4(normal[0], normal[1], normal[2], 0.0));\n normalsArray.push(vec4(normal[0], normal[1], normal[2], 0.0));\n }\n \n positionsArray.push(vertices[a]);\n positionsArray.push(vertices[b]);\n positionsArray.push(vertices[c]);\n positionsArray.push(vertices[a]);\n positionsArray.push(vertices[c]);\n positionsArray.push(vertices[d]);\n}", "title": "" }, { "docid": "c8ef5b244a3babf2f618407071387ac6", "score": "0.53657883", "text": "function quad(vertices, points, a, b, c, d, e, f, g, h) {\n\tvar indices = [a, b, c, d, b, f, d, h, f, e, h, g, e, a, g, c, e, f, a, b, c, d, g, h];\n\tfor(var i=0; i<indices.length; i++) {\n\t\tpoints.push(vertices[indices[i]]);\n\t}\t\n}", "title": "" }, { "docid": "8e7dba8fe4df49db3ed4036e24d430a4", "score": "0.5352327", "text": "function b$q(b,O){const{vertex:w,fragment:C}=b,T=O.hasModelTransformation;T&&w.uniforms.add(new e$1A(\"model\",(e=>r$3A(e.modelTransformation)?e.modelTransformation:o$1F)));const V=O.hasColorTexture&&O.alphaDiscardMode!==C$J.Opaque;switch(O.output){case h$1c.Depth:case h$1c.Shadow:case h$1c.ShadowHighlight:case h$1c.ShadowExludeHighlight:case h$1c.ObjectAndLayerIdColor:v$M(w,O),b.include(r$1b,O),b.include(o$1x,O),b.include(s$Y,O),b.include(o$L,O),b.include(u$R,O),b.include(d$$,O),i$1l(b),b.varyings.add(\"depth\",\"float\"),V&&C.uniforms.add(new f$1s(\"tex\",(o=>o.texture))),w.code.add(n$1x`\n void main(void) {\n vpos = calculateVPos();\n vpos = subtractOrigin(vpos);\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPositionWithDepth(proj, view, ${T?\"model,\":\"\"} vpos, nearFar, depth);\n forwardTextureCoordinates();\n forwardObjectAndLayerIdColor();\n }\n `),b.include(s$I,O),C.code.add(n$1x`\n void main(void) {\n discardBySlice(vpos);\n ${V?n$1x`\n vec4 texColor = texture2D(tex, ${O.hasColorTextureTransform?n$1x`colorUV`:n$1x`vuv0`});\n discardOrAdjustAlpha(texColor);`:\"\"}\n ${O.output===h$1c.ObjectAndLayerIdColor?n$1x`outputObjectAndLayerIdColor();`:n$1x`outputDepth(depth);`}\n }\n `);break;case h$1c.Normal:v$M(w,O),b.include(r$1b,O),b.include(o$H,O),b.include(n$V,O),b.include(o$1x,O),b.include(s$Y,O),V&&C.uniforms.add(new f$1s(\"tex\",(o=>o.texture))),b.varyings.add(\"vPositionView\",\"vec3\"),w.code.add(n$1x`\n void main(void) {\n vpos = calculateVPos();\n vpos = subtractOrigin(vpos);\n ${O.normalType===i$M.Attribute?n$1x`\n vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:\"\"}\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPosition(proj, view, ${T?\"model,\":\"\"} vpos);\n forwardTextureCoordinates();\n }\n `),b.include(u$R,O),b.include(s$I,O),C.code.add(n$1x`\n void main() {\n discardBySlice(vpos);\n ${V?n$1x`\n vec4 texColor = texture2D(tex, ${O.hasColorTextureTransform?n$1x`colorUV`:n$1x`vuv0`});\n discardOrAdjustAlpha(texColor);`:\"\"}\n\n ${O.normalType===i$M.ScreenDerivative?n$1x`\n vec3 normal = screenDerivativeNormal(vPositionView);`:n$1x`\n vec3 normal = normalize(vNormalWorld);\n if (gl_FrontFacing == false) normal = -normal;`}\n gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);\n }\n `);break;case h$1c.Highlight:v$M(w,O),b.include(r$1b,O),b.include(o$1x,O),b.include(s$Y,O),V&&C.uniforms.add(new f$1s(\"tex\",(o=>o.texture))),w.code.add(n$1x`\n void main(void) {\n vpos = calculateVPos();\n vpos = subtractOrigin(vpos);\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPosition(proj, view, ${T?\"model,\":\"\"} vpos);\n forwardTextureCoordinates();\n }\n `),b.include(u$R,O),b.include(s$I,O),b.include(a$U,O),C.code.add(n$1x`\n void main() {\n discardBySlice(vpos);\n ${V?n$1x`\n vec4 texColor = texture2D(tex, ${O.hasColorTextureTransform?n$1x`colorUV`:n$1x`vuv0`});\n discardOrAdjustAlpha(texColor);`:\"\"}\n outputHighlight();\n }\n `);}}", "title": "" }, { "docid": "acf37351656bb64abafbc46e0d5c7362", "score": "0.52927744", "text": "static inQuad(t, b, c, d) {\n return c * (t /= d) * t + b;\n }", "title": "" }, { "docid": "9ac6c8fc32bd93d557287b4bedf05928", "score": "0.52912074", "text": "function t$1t(t){t.vertex.code.add(n$1x`const float PI = 3.141592653589793;`),t.fragment.code.add(n$1x`const float PI = 3.141592653589793;\nconst float LIGHT_NORMALIZATION = 1.0 / PI;\nconst float INV_PI = 0.3183098861837907;\nconst float HALF_PI = 1.570796326794897;`);}", "title": "" }, { "docid": "6e6c3a9d09366a50e5ceba1bbc86ceef", "score": "0.52749103", "text": "function w$4(i){const r=new o$1u,{vertex:w,fragment:L}=r;return i.antialiasing&&(w.code.add(n$1x`#define ANTIALIASING 1`),L.code.add(n$1x`#define ANTIALIASING 1`)),i.legacy&&w.uniforms.add([new A$4(\"model\"),new A$4(\"localView\")]),r.include(i$5,i),r.include(p$4,i),r.include(d$3,i),r.include(i$3,i),r.include(f$8,i),r.include(u$R,i),r.include(o$5,i),r.include(a$4,i),r.include(i$4,i),r.include(n$1n,i),r.varyings.add(\"vColor\",\"vec4\"),r.varyings.add(\"vRadius\",\"float\"),r.varyings.add(\"vPosition\",\"vec3\"),r.varyings.add(\"vWorldPosition\",\"vec3\"),r.varyings.add(\"vViewPos\",\"vec3\"),r.varyings.add(\"vLineLengthPixels\",\"float\"),r.varyings.add(\"vSizeFalloffFactor\",\"float\"),w.uniforms.add([new e$1C(\"pixelToNDC\",((i,o)=>r$23(h$5,2/o.camera.fullViewport[2],2/o.camera.fullViewport[3]))),new e$1B(\"viewport\",((e,i)=>i.camera.fullViewport)),new o$1w(\"pixelRatio\",((e,i)=>i.camera.pixelRatio))]),r.attributes.add(O$O.POSITION0,\"vec3\"),r.attributes.add(O$O.POSITION1,\"vec3\"),r.attributes.add(O$O.VARIANTOFFSET,\"float\"),r.attributes.add(O$O.VARIANTSTROKE,\"float\"),r.attributes.add(O$O.VARIANTEXTENSION,\"float\"),w.code.add(n$1x`const float opaqueCutoff = 1.0 / 255.0;\nvoid calculateGeometricOutputs(vec3 viewPosV0, vec3 viewPosV1, vec3 worldPosV0, vec3 worldPosV1, vec3 worldNormal, UnpackedAttributes unpackedAttributes) {\nvec2 sideness = unpackedAttributes.sideness;\nvec2 sidenessNorm = unpackedAttributes.sidenessNorm;\nvWorldPosition = mix(worldPosV0, worldPosV1, sidenessNorm.y).xyz;\nvec3 viewPos = mix(viewPosV0, viewPosV1, sidenessNorm.y);\nvViewPos = viewPos;\nvec4 projPosV0 = projFromViewPosition(viewPosV0);\nvec4 projPosV1 = projFromViewPosition(viewPosV1);\nvec4 projPos = projFromViewPosition(viewPos);\nvec3 screenSpaceLineNDC = (projPosV1.xyz / projPosV1.w - projPosV0.xyz / projPosV0.w);\nvec2 ndcToPixel = viewport.zw * 0.5;\nvec2 screenSpaceLinePixels = screenSpaceLineNDC.xy * ndcToPixel;\nfloat lineLengthPixels = length(screenSpaceLinePixels);\nfloat dzPerPixel = screenSpaceLineNDC.z / lineLengthPixels;\nvec2 screenSpaceDirection = screenSpaceLinePixels / lineLengthPixels;\nvec2 perpendicularScreenSpaceDirection = vec2(screenSpaceDirection.y, -screenSpaceDirection.x) * sideness.x;\nfloat falloffFactor = distanceBasedPerspectiveFactor(-viewPos.z) * pixelRatio;\nfloat lineWidthPixels = unpackedAttributes.lineWidthPixels * falloffFactor;\nfloat extensionLengthPixels = calculateExtensionLength(unpackedAttributes.extensionLengthPixels, lineLengthPixels) * falloffFactor;\nfloat lineAmplitudePixels = calculateLineAmplitude(unpackedAttributes) * pixelRatio;\nvSizeFalloffFactor = falloffFactor;\nfloat lineWidthAndAmplitudePixels = lineWidthPixels + lineAmplitudePixels + lineAmplitudePixels;\nfloat extendedLineLengthPixels = lineLengthPixels + extensionLengthPixels + extensionLengthPixels;\n#ifdef ANTIALIASING\nconst float aaPaddingPixels = 1.0;\nfloat halfAAPaddedLineWidthAndAmplitudePixels = lineWidthAndAmplitudePixels * 0.5 + aaPaddingPixels;\nfloat aaPaddedRoundedCapSizePixels = lineWidthPixels * 0.5 + aaPaddingPixels;\n#else\nfloat halfAAPaddedLineWidthAndAmplitudePixels = max(lineWidthAndAmplitudePixels, 1.0) * 0.5;\nfloat aaPaddedRoundedCapSizePixels = max(lineWidthPixels, 1.0) * 0.5;\n#endif\nvec2 halfAAPaddedLineWidthAndAmplitudeNDC = halfAAPaddedLineWidthAndAmplitudePixels * pixelToNDC;\nvec2 aaPaddedRoundedCapSizeNDC = aaPaddedRoundedCapSizePixels * pixelToNDC;\nvec2 extensionLengthNDC = extensionLengthPixels * pixelToNDC;\nvec2 ndcOffset = (\nscreenSpaceDirection * sideness.y * (aaPaddedRoundedCapSizeNDC + extensionLengthNDC)\n+ perpendicularScreenSpaceDirection * halfAAPaddedLineWidthAndAmplitudeNDC\n);\nprojPos.xy += ndcOffset * projPos.w;\nprojPos.z += (dzPerPixel * (aaPaddedRoundedCapSizePixels + extensionLengthPixels)) * sideness.y * projPos.w;\nprojPos = adjustProjectedPosition(projPos, worldNormal, 1.0 + max((lineWidthAndAmplitudePixels - 1.0) * 0.5, 0.0));\nfloat aaPaddedLineWithCapsLengthPixels = extendedLineLengthPixels + aaPaddedRoundedCapSizePixels + aaPaddedRoundedCapSizePixels;\nfloat pixelPositionAlongLine = aaPaddedLineWithCapsLengthPixels * sidenessNorm.y - aaPaddedRoundedCapSizePixels;\nvPosition = vec3(\nhalfAAPaddedLineWidthAndAmplitudePixels * sideness.x,\npixelPositionAlongLine,\npixelPositionAlongLine / extendedLineLengthPixels\n);\nvRadius = lineWidthPixels * 0.5;\nvLineLengthPixels = extendedLineLengthPixels;\ndiscardShortEdges(unpackedAttributes, lineLengthPixels);\ngl_Position = projPos;\n}\nvoid main() {\nComponentData component = readComponentData();\nUnpackedAttributes unpackedAttributes = unpackAttributes(component);\nvec3 worldPosV0, worldPosV1, viewPosV0, viewPosV1;\nworldAndViewFromModelPosition(position0, component.verticalOffset, worldPosV0, viewPosV0);\nworldAndViewFromModelPosition(position1, component.verticalOffset, worldPosV1, viewPosV1);\nvColor = component.color;\nif (vColor.a < opaqueCutoff) {\ngl_Position = vec4(10.0, 10.0, 10.0, 1.0);\nreturn;\n}\nif (discardNonSilhouetteEdges(viewPosV0, worldPosV0)) {\nreturn;\n}\ncalculateGeometricOutputs(viewPosV0, viewPosV1, worldPosV0, worldPosV1, worldNormal(), unpackedAttributes);\ncalculateStyleOutputs(unpackedAttributes);\n}`),r.fragment.code.add(n$1x`\n vec2 lineWithCapsDistance(float radius, vec2 position, float lineLength) {\n float lineOffset = calculateLineOffset();\n float positionX = position.x - lineOffset;\n\n if (radius < 1.0) {\n // Handle this specifically for subpixel sizes:\n // 1. Compute correct coverage (note coverage is computed by\n // 0.5 - dist, so we make sure that that will lead to correct\n // subpixel coverage\n // 2. Ignore rounded caps\n float coverageX = clamp(min(radius, positionX + 0.5) - max(-radius, positionX - 0.5), 0.0, 1.0);\n float coverageY = clamp(min(lineLength, position.y + 0.5) - max(0.0, position.y - 0.5), 0.0, 1.0);\n\n float coverage = min(coverageX, coverageY);\n\n return vec2(0.5 - coverage, 0.0);\n }\n else {\n // Between -radius -> 0 for start cap, 0 for line, 0 -> radius\n float positionOnCap = position.y - clamp(position.y, 0.0, lineLength);\n\n vec2 lineToPosition = vec2(positionX, positionOnCap);\n return vec2(length(lineToPosition) - radius, positionOnCap / radius);\n }\n }\n\n void main() {\n ${i.hasMultipassTerrain?\"terrainDepthTest(gl_FragCoord, vViewPos.z);\":\"\"}\n float radius = vRadius * calculateLinePressure();\n\n vec2 distance = lineWithCapsDistance(radius, vPosition.xy, vLineLengthPixels);\n float coverage = clamp(0.5 - distance.x, 0.0, 1.0);\n\n discardByCoverage(radius, coverage);\n discardBySlice(vWorldPosition);\n\n float alpha = vColor.a * coverage;\n\n gl_FragColor = vec4(vColor.rgb, alpha);\n\n }\n `),r}", "title": "" }, { "docid": "94d1f179ca4772f706eb80ce829dce92", "score": "0.5242521", "text": "static serializeQuad(quad) {\n const s = quad.subject;\n const p = quad.predicate;\n const o = quad.object;\n const g = quad.graph;\n let nquad = ''; // subject can only be NamedNode or BlankNode\n\n if (s.termType === TYPE_NAMED_NODE) {\n nquad += `<${s.value}>`;\n } else {\n nquad += `${s.value}`;\n } // predicate can only be NamedNode\n\n\n nquad += ` <${p.value}> `; // object is NamedNode, BlankNode, or Literal\n\n if (o.termType === TYPE_NAMED_NODE) {\n nquad += `<${o.value}>`;\n } else if (o.termType === TYPE_BLANK_NODE) {\n nquad += o.value;\n } else {\n nquad += `\"${_escape(o.value)}\"`;\n\n if (o.datatype.value === RDF_LANGSTRING) {\n if (o.language) {\n nquad += `@${o.language}`;\n }\n } else if (o.datatype.value !== XSD_STRING) {\n nquad += `^^<${o.datatype.value}>`;\n }\n } // graph can only be NamedNode or BlankNode (or DefaultGraph, but that\n // does not add to `nquad`)\n\n\n if (g.termType === TYPE_NAMED_NODE) {\n nquad += ` <${g.value}>`;\n } else if (g.termType === TYPE_BLANK_NODE) {\n nquad += ` ${g.value}`;\n }\n\n nquad += ' .\\n';\n return nquad;\n }", "title": "" }, { "docid": "a750066c8ec806fdc9766aeb00f67cbb", "score": "0.52261436", "text": "function asmModule(stdlib, imports, buffer) {\r\n \"use asm\";\r\n\r\n var log = stdlib.Math.log;\r\n var toF = stdlib.Math.fround;\r\n var imul = stdlib.Math.imul;\r\n\r\n var i4 = stdlib.SIMD.Int32x4;\r\n var i4store = i4.store;\r\n var i4load = i4.load\r\n var i4swizzle = i4.swizzle;\r\n var i4check = i4.check;\r\n var i4add = i4.add;\r\n var i4sub = i4.sub;\r\n var i4lessThan = i4.lessThan;\r\n var i4splat = i4.splat;\r\n\r\n var f4 = stdlib.SIMD.Float32x4;\r\n var f4equal = f4.equal;\r\n var f4lessThan = f4.lessThan;\r\n var f4splat = f4.splat;\r\n var f4store = f4.store;\r\n var f4load = f4.load;\r\n var f4check = f4.check;\r\n var f4abs = f4.abs;\r\n var f4add = f4.add;\r\n var f4sub = f4.sub;\r\n\r\n var Float32Heap = new stdlib.Float32Array(buffer);\r\n var Int32Heap = new stdlib.Int32Array(buffer);\r\n var BLOCK_SIZE = 4;\r\n\r\n function matrixMultiplication(aIndex, bIndex, cIndex) {\r\n aIndex = aIndex|0;\r\n bIndex = bIndex|0;\r\n cIndex = cIndex|0;\r\n\r\n var i = 0, j = 0, dim1 = 0, dim2 = 0, intersectionNum = 0, matrixSize = 0;\r\n\r\n var newPiece = i4(0, 0, 0, 0), cPiece = i4(0, 0, 0, 0);\r\n\r\n //array dimensions don't match\r\n if((Int32Heap[aIndex + 1 << 2 >> 2]|0) != (Int32Heap[bIndex << 2 >> 2]|0)) {\r\n return -1;\r\n }\r\n\r\n dim1 = Int32Heap[aIndex << 2 >> 2]|0;\r\n dim2 = Int32Heap[bIndex + 1 << 2 >> 2]|0;\r\n intersectionNum = Int32Heap[bIndex << 2 >> 2]|0;\r\n matrixSize = imul(dim1, dim2);\r\n\r\n Int32Heap[cIndex << 2 >> 2] = dim1;\r\n Int32Heap[cIndex + 1 << 2 >> 2] = dim2;\r\n\r\n while((i|0) < (matrixSize|0)) {\r\n cPiece = i4(0, 0, 0, 0);\r\n j = 0;\r\n while( (j|0) < (intersectionNum|0)) {\r\n newPiece = i4((getIntersectionPiece(aIndex, bIndex, dim2, i, 0, j)|0),\r\n (getIntersectionPiece(aIndex, bIndex, dim2, i, 1, j)|0),\r\n (getIntersectionPiece(aIndex, bIndex, dim2, i, 2, j)|0),\r\n (getIntersectionPiece(aIndex, bIndex, dim2, i, 3, j)|0));\r\n cPiece = i4add(cPiece, newPiece);\r\n j = (j + 1)|0;\r\n }\r\n i4store(Int32Heap, cIndex + 2 + i << 2 >> 2, cPiece);\r\n\r\n i = (i + BLOCK_SIZE)|0;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n function getIntersectionPiece(aIndex, bIndex, dim2, resultBlock, resultIndex, intersectionNum) {\r\n aIndex = aIndex|0;\r\n bIndex = bIndex|0;\r\n dim2 = dim2|0;\r\n resultBlock = resultBlock|0;\r\n resultIndex = resultIndex|0;\r\n intersectionNum = intersectionNum|0;\r\n var aElem = 0, bElem = 0, cElem = 0;\r\n\r\n aElem = (getElement(aIndex, ((resultBlock|0) / (dim2|0))|0, intersectionNum))|0;\r\n bElem = (getElement(bIndex, intersectionNum, (resultBlock + resultIndex)|0))|0;\r\n\r\n return (aElem * bElem)|0;\r\n }\r\n\r\n function getElement(start, row, column) {\r\n start = start|0;\r\n row = row|0;\r\n column = column|0;\r\n var dim1 = 0, dim2 = 0;\r\n\r\n dim2 = Int32Heap[start << 2 >> 2]|0;\r\n dim1 = Int32Heap[start + 1 << 2 >> 2]|0;\r\n return (Int32Heap[(start + 2 + imul(row, dim1) + column) << 2 >> 2])|0;\r\n\r\n }\r\n\r\n function new2DMatrix(startIndex, dim1, dim2) {\r\n startIndex = startIndex|0;\r\n dim1 = dim1|0;\r\n dim2 = dim2|0;\r\n\r\n var i = 0, matrixSize = 0;\r\n matrixSize = imul(dim1, dim2);\r\n Int32Heap[startIndex << 2 >> 2] = dim1;\r\n Int32Heap[startIndex + 1 << 2 >> 2] = dim2;\r\n for(i = 0; (i|0) < ((matrixSize - BLOCK_SIZE)|0); i = (i + BLOCK_SIZE)|0) {\r\n i4store(Int32Heap, startIndex + 2 + i << 2 >> 2, i4((i+1), (i+2), (i+3), (i+4)));\r\n }\r\n for(; (i|0) < (matrixSize|0); i = (i + 1)|0) {\r\n Int32Heap[(startIndex + 2 + i) << 2 >> 2] = (i+1)|0;\r\n }\r\n return (startIndex + 2 + i)|0;\r\n }\r\n\r\n return {new2DMatrix: new2DMatrix,\r\n matrixMultiplication:matrixMultiplication};\r\n}", "title": "" }, { "docid": "28071059680b7e97eaa4a9bf73cdb291", "score": "0.5214836", "text": "function referenceCube() {\n\tquad(1, 0, 3, 2);\n\tquad(2, 3, 7, 6);\n\tquad(3, 0, 4, 7);\n\tquad(6, 5, 1, 2);\n\tquad(4, 5, 6, 7);\n\tquad(5, 4, 0, 1);\n} // End function referenceCube()", "title": "" }, { "docid": "997830411c51b4dadccff1adc5a2b961", "score": "0.520655", "text": "set quadratic( v ){ this.dv.setFloat32( 56, v, true ); }", "title": "" }, { "docid": "996d54cadd09cf865f858e63814c90da", "score": "0.519365", "text": "static EaseInOutQuad(t) {\n return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t\n }", "title": "" }, { "docid": "ff89c9c35fce22ef67e4cc24374531c4", "score": "0.51934046", "text": "function draw() {\n background(355);\n line(windowWidth/2,0,250,500);\n line(0,windowHeight/2,500,250);\n quad1();\n quad2();\n quad3();\n quad4();\n\n\n}", "title": "" }, { "docid": "e85733761a65bd9f52434c97c8edddd1", "score": "0.5187969", "text": "function easeInOutQuad( t ) {\n return t < 0.5 ? 2 * t * t : - 1 + ( 4 - 2 * t ) * t;\n}", "title": "" }, { "docid": "01bc28a4bf8fd02fee8d6106150d3a76", "score": "0.51869065", "text": "function testBiquadNode() {\n\n var sampleRate = 44100;\n var bufferSize = 512;\n var numChannels = 4;\n\n /// create an offline audio context\n var audioContext1 = new OfflineAudioContext(numChannels, bufferSize, sampleRate);\n\n /// create a test buffer\n var buffer = audioContext1.createBuffer(numChannels, bufferSize, sampleRate);\n\n /// just a precaution\n _bufferutils2.default.clearBuffer(buffer);\n _bufferutils2.default.makeImpulse(buffer, 0, 0);\n _bufferutils2.default.makeImpulse(buffer, 1, 10);\n\n /// create a buffer source\n var bufferSource = audioContext1.createBufferSource();\n\n /// reference the test buffer with the buffer source\n bufferSource.buffer = buffer;\n\n /// create a node\n var biquadNode = audioContext1.createBiquadFilter();\n\n /// configure the biquad filter\n {\n biquadNode.type = \"lowpass\";\n\n /// It is expressed in dB, has a default value of 0 and can take a value in a nominal range of -40 to 40\n biquadNode.gain.value = 10;\n\n /// measured in hertz (Hz)\n biquadNode.frequency.value = 1000;\n\n /// It is a dimensionless value with a default value of 1 and a nominal range of 0.0001 to 1000.\n biquadNode.Q.value = 10;\n }\n\n /// connect the node to the buffer source\n bufferSource.connect(biquadNode);\n\n /// connect the node to the destination of the audio context\n biquadNode.connect(audioContext1.destination);\n\n /// prepare the rendering\n var localTime = 0;\n bufferSource.start(localTime);\n\n /// receive notification when the rendering is completed\n audioContext1.oncomplete = function (output) {\n\n var buf = output.renderedBuffer;\n\n var bufUrl = _bufferutils2.default.writeBufferToTextFileWithMatlabFormat(buf);\n console.log(\"buffer URL : \" + bufUrl);\n\n debugger;\n };\n\n /// start rendering\n audioContext1.startRendering();\n}", "title": "" }, { "docid": "e6373f65bc71fef6fee29336a54f3503", "score": "0.5186406", "text": "import(stream) {\n stream.on('data', quad => {\n this.addQuad(quad);\n });\n return stream;\n }", "title": "" }, { "docid": "c08e31041a868d44aeb323096586677e", "score": "0.51863146", "text": "addQuads(quads) {\n for (let i = 0; i < quads.length; i++) this.addQuad(quads[i]);\n }", "title": "" }, { "docid": "c08e31041a868d44aeb323096586677e", "score": "0.51863146", "text": "addQuads(quads) {\n for (let i = 0; i < quads.length; i++) this.addQuad(quads[i]);\n }", "title": "" }, { "docid": "cd2bcbf8c8689a73b341d1a119cec142", "score": "0.51492006", "text": "function r$1Q(r,t){if(n$2H(r))return {createVertexArray:r.createVertexArray.bind(r),deleteVertexArray:r.deleteVertexArray.bind(r),bindVertexArray:r.bindVertexArray.bind(r)};if(t.vao)return null;const n=r.getExtension(\"OES_vertex_array_object\")||r.getExtension(\"MOZ_OES_vertex_array_object\")||r.getExtension(\"WEBKIT_OES_vertex_array_object\");return n?{createVertexArray:n.createVertexArrayOES.bind(n),deleteVertexArray:n.deleteVertexArrayOES.bind(n),bindVertexArray:n.bindVertexArrayOES.bind(n)}:null}", "title": "" }, { "docid": "21d46c0474e0b00f0725af07f59427d9", "score": "0.5147294", "text": "addQuads(quads) {\n for (let i = 0; i < quads.length; i++)\n this.addQuad(quads[i]);\n }", "title": "" }, { "docid": "21d46c0474e0b00f0725af07f59427d9", "score": "0.5147294", "text": "addQuads(quads) {\n for (let i = 0; i < quads.length; i++)\n this.addQuad(quads[i]);\n }", "title": "" }, { "docid": "e3f180b4bdff0799734e20d127d8e37e", "score": "0.5140651", "text": "function q8() {}", "title": "" }, { "docid": "62357eb7e26394cba77e0af6944006e3", "score": "0.51311886", "text": "import(stream) {\n var self = this;\n stream.on('data', function (quad) { self.addQuad(quad); });\n return stream;\n }", "title": "" }, { "docid": "899ac60425f754a25c14429a9033bc29", "score": "0.5131088", "text": "import(stream) {\n stream.on('data', quad => { this.addQuad(quad); });\n return stream;\n }", "title": "" }, { "docid": "6f94c6d9533cabc73b441e69841a8178", "score": "0.5128359", "text": "function ShaderLibExtra() {}", "title": "" }, { "docid": "ea23ce403686341146406dd01d31333e", "score": "0.5125065", "text": "import(stream) {\n var self = this;\n stream.on('data', function (quad) {\n self.addQuad(quad);\n });\n return stream;\n }", "title": "" }, { "docid": "087787e359e6dfd22784448310005a58", "score": "0.51224506", "text": "function easeOutQuad( t ) {\n return t * ( 2 - t );\n}", "title": "" }, { "docid": "b2b0e6a645eb03b701625c6ce024ab5e", "score": "0.51105076", "text": "function addQuad(u, v, a, b, c, d) {\n\n // EACH VERTEX IS: x,y,z, nx,ny,nz, u,v\n\n\t vertices.push(a[0],a[1],a[2], a[3],a[4],a[5], u , v );\n\t vertices.push(b[0],b[1],b[2], b[3],b[4],b[5], u+du, v );\n\t vertices.push(c[0],c[1],c[2], c[3],c[4],c[5], u+du, v+dv);\n\t vertices.push(d[0],d[1],d[2], d[3],d[4],d[5], u , v+dv);\n\t vertices.push(a[0],a[1],a[2], a[3],a[4],a[5], u , v );\n }", "title": "" }, { "docid": "0ad1dc5e09695533cabb59a76a0df586", "score": "0.511039", "text": "function test1(){\r\n q = new Quad(new NamedNode(\"dc:toto\"), new NamedNode(\"a\"),\r\n new Literal(\"Rouboudou\", \"en\"), new DefaultGraph(\"books\"));\r\n console.log(q.to_str());\r\n}", "title": "" }, { "docid": "633ceebf2ab4c5cf5c8041dc37875b71", "score": "0.5107209", "text": "function side(a, b, c, d)\n{\n\t//define vertices for all 27 .32x.32x.32 cubes in one single vertices definition, with .02 spacing\n var vertices = [\n \t\t//corners of the train:\n \t\tvec4(-8229.5,- 680, 1473,1),\n \t\tvec4( 8229.5,- 680, 1473,1),\n \t\tvec4(-8229.5,- 680,-1473,1),\n \t\tvec4( 8229.5,- 680,-1473,1),\n \t\tvec4(-8229.5, 1848, 1473,1),\n \t\tvec4( 8229.5, 1848, 1473,1),\n \t\tvec4(-8229.5, 1848,-1473,1),\n \t\tvec4( 8229.5, 1848,-1473,1),\n \t\t\n ];\n\n var vertexColors = [\n [ 0.0, 0.0, 0.0, 1.0 ], // black\n [ 0.0, 0.0, 1.0, 1.0 ], // blue\n [ 1.0, 1.0, 0.0, 1.0 ], // yellow\n [ 1.0, 0.0, 0.0, 1.0 ], // red\n [ 0.0, 1.0, 0.0, 1.0 ], // green\n [ 1.0, 1.0, 1.0, 1.0 ], // white\n [ 1.0, .65, 0.0, 1.0 ], //orange\n [ 0.0, 1.0, 1.0, 1.0 ] // cyan\n\n ];\n\n // We need to parition the quad into two triangles in order for\n // WebGL to be able to render it. In this case, we create two\n // triangles from the quad indices\n\n //vertex color assigned by the index of the vertex\n /* var indices = [ a, b, c, a, c, d ];\n\tfor ( var i = 0; i < indices.length; ++i ) {\n\t points.push( vertices[indices[i]] );\n\t totpoints.push( vertices[indices[i]] );\n\t \n\n\t // If it isn't an outer face, make it black\n\t if(!(outerFace(vertices[a])&&outerFace(vertices[b])&&outerFace(vertices[b])&&outerFace(vertices[c])&&outerFace(vertices[d]))){\n\t \tcolors.push(vertexColors[0]);\n\t \ttotcolors.push(vertexColors[0]);\n\t }\n\t // for solid colored faces use\n\t else{\n\t \tcolors.push(vertexColors[a]);\n\t \ttotcolors.push(vertexColors[a]);\n\t }\n\n\t}*/\n}", "title": "" }, { "docid": "668d041a2619b2276f82a998f37529ea", "score": "0.510265", "text": "function colorCube()\r\n{\r\n quad(1, 0, 3, 2);\r\n quad(2, 3, 7, 6);\r\n quad(3, 0, 4, 7);\r\n quad(6, 5, 1, 2);\r\n quad(4, 5, 6, 7);\r\n quad(5, 4, 0, 1);\r\n}", "title": "" }, { "docid": "b584628b60f105a8dd839f060983492f", "score": "0.50959694", "text": "static serializeQuad(quad) {\n const s = quad.subject;\n const p = quad.predicate;\n const o = quad.object;\n const g = quad.graph;\n\n let nquad = '';\n\n // subject can only be NamedNode or BlankNode\n if(s.termType === TYPE_NAMED_NODE) {\n nquad += `<${s.value}>`;\n } else {\n nquad += `${s.value}`;\n }\n\n // predicate can only be NamedNode\n nquad += ` <${p.value}> `;\n\n // object is NamedNode, BlankNode, or Literal\n if(o.termType === TYPE_NAMED_NODE) {\n nquad += `<${o.value}>`;\n } else if(o.termType === TYPE_BLANK_NODE) {\n nquad += o.value;\n } else {\n nquad += `\"${_escape(o.value)}\"`;\n if(o.datatype.value === RDF_LANGSTRING) {\n if(o.language) {\n nquad += `@${o.language}`;\n }\n } else if(o.datatype.value !== XSD_STRING) {\n nquad += `^^<${o.datatype.value}>`;\n }\n }\n\n // graph can only be NamedNode or BlankNode (or DefaultGraph, but that\n // does not add to `nquad`)\n if(g.termType === TYPE_NAMED_NODE) {\n nquad += ` <${g.value}>`;\n } else if(g.termType === TYPE_BLANK_NODE) {\n nquad += ` ${g.value}`;\n }\n\n nquad += ' .\\n';\n return nquad;\n }", "title": "" }, { "docid": "690958a20df2e129eb25609eb7110002", "score": "0.50918937", "text": "static serializeQuad(quad) {\n const s = quad.subject;\n const p = quad.predicate;\n const o = quad.object;\n const g = quad.graph;\n\n let nquad = '';\n\n // subject and predicate can only be NamedNode or BlankNode\n [s, p].forEach(term => {\n if(term.termType === 'NamedNode') {\n nquad += '<' + term.value + '>';\n } else {\n nquad += term.value;\n }\n nquad += ' ';\n });\n\n // object is NamedNode, BlankNode, or Literal\n if(o.termType === 'NamedNode') {\n nquad += '<' + o.value + '>';\n } else if(o.termType === 'BlankNode') {\n nquad += o.value;\n } else {\n nquad += '\"' + _escape(o.value) + '\"';\n if(o.datatype.value === RDF_LANGSTRING) {\n if(o.language) {\n nquad += '@' + o.language;\n }\n } else if(o.datatype.value !== XSD_STRING) {\n nquad += '^^<' + o.datatype.value + '>';\n }\n }\n\n // graph can only be NamedNode or BlankNode (or DefaultGraph, but that\n // does not add to `nquad`)\n if(g.termType === 'NamedNode') {\n nquad += ' <' + g.value + '>';\n } else if(g.termType === 'BlankNode') {\n nquad += ' ' + g.value;\n }\n\n nquad += ' .\\n';\n return nquad;\n }", "title": "" }, { "docid": "e4480d0f3a90636372893773ecce6fa4", "score": "0.50873893", "text": "addQuads(quads) {\n for (var i = 0; i < quads.length; i++)\n this.addQuad(quads[i]);\n }", "title": "" }, { "docid": "e4480d0f3a90636372893773ecce6fa4", "score": "0.50873893", "text": "addQuads(quads) {\n for (var i = 0; i < quads.length; i++)\n this.addQuad(quads[i]);\n }", "title": "" }, { "docid": "2144ecb632de526b59be04299314c096", "score": "0.5086828", "text": "static genIndices(subdiv, vrows, out) {\n let a_len, b_len, q_cnt, q_loop, a, b, c, d;\n // Create a ring of triangles bases on 2 rows of vertices\n // The Bottom Half of the sphere's vertices are mirrored, this causes a problem\n // where the face winding needs to be in reverse.\n const ring = (ai, bi, rev) => {\n let aii = 0, bii = 0; // rows are iregular, so need to move 2 indices\n for (let j = 0; j < q_loop; j++) {\n //---------------------------------\n // Define the Quad by suing the top and bottom row\n a = ai + aii;\n b = bi + bii;\n c = b + 1;\n d = a + 1;\n //---------------------------------\n if (aii + 1 >= a_len)\n d = ai; // At end of ring, Loop back to start of the ring\n if (!rev)\n out.push(a, b, c, c, d, a);\n else\n out.push(c, b, a, a, d, c);\n //---------------------------------\n // Test for the extra triangle, With iregular sizes per row, the only\n // I see is that for each corner there is a set of quads, but with an extra\n // triangle at the end, \n if (((j + 1) % q_cnt) == 0) {\n bii += 1; // Move ahead to start fresh with a quad at the next corner \n if (bii + 1 < b_len)\n (!rev) ? out.push(d, c, c + 1) : out.push(c + 1, c, d); // Extra tri\n else\n (!rev) ? out.push(d, c, bi) : out.push(bi, c, d); // FINAL extra tri,tie back to start\n }\n //---------------------------------\n // Move the row indicies forward\n aii++;\n bii++;\n }\n };\n // Last two vrows items are the index of the poles.\n // So the triangles just links the final row woth the pole point\n const pole = (pidx, rev) => {\n b_len = vrows[pidx - 1] - vrows[pidx - 2];\n a = vrows[pidx];\n b = vrows[pidx - 2];\n for (let j = 0; j < b_len; j++) {\n c = b + j; // Compute the bottom row start\n d = b + ((j + 1) % b_len); // If last point, need to loop back to start\n if (!rev)\n out.push(a, c, d);\n else\n out.push(d, c, a);\n }\n };\n //----------------------------------------\n // Build the EQUATOR Rows\n a_len = vrows[2] - vrows[1]; // Hoq Long is the Top Row, Determine by using the starting index of each row\n b_len = vrows[1] - vrows[0]; // How long is the bot row, \n q_cnt = b_len / 4 - 1; // How many quads per corner can be created \n q_loop = q_cnt * 4; // Total Number of quads being made per row\n ring(vrows[1], vrows[0], false); // Make top Ring\n ring(vrows[2], vrows[0], true); // Make Bot Ring, with rev winding\n //----------------------------------------\n // Build Rings between Equator and Poles\n for (let i = 1; i < vrows.length - 4; i += 2) {\n a_len = vrows[i + 3] - vrows[i + 2];\n b_len = vrows[i + 1] - vrows[i];\n q_cnt = b_len / 4 - 1;\n q_loop = q_cnt * 4;\n ring(vrows[i + 2], vrows[i], false);\n ring(vrows[i + 3], vrows[i + 1], true);\n }\n //----------------------------------------\n // Use the Pole points and final rows to finish the sphere.\n const ri_last = vrows.length - 1;\n pole(ri_last - 1, false);\n pole(ri_last, true);\n }", "title": "" }, { "docid": "1bfe28f2d42a736b33bd9757d9f06aa4", "score": "0.5079067", "text": "function easeOutQuad (t, b, c, d) {\n return -c *(t/=d)*(t-2) + b;\n}", "title": "" }, { "docid": "00a3105c1530245d01f8fcfc8d0e345e", "score": "0.50756097", "text": "function Qo(e,t,n,r){var o=4,a=.001,i=1e-7,l=10,s=11,u=1/(s-1),c=\"undefined\"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if(\"number\"!=typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var f=c?new Float32Array(s):new Array(s);function p(e,t){return 1-3*t+3*e}function m(e,t){return 3*t-6*e}function h(e){return 3*e}function b(e,t,n){return((p(t,n)*e+m(t,n))*e+h(t))*e}function g(e,t,n){return 3*p(t,n)*e*e+2*m(t,n)*e+h(t)}function v(t){for(var r=0,c=1,d=s-1;c!==d&&f[c]<=t;++c)r+=u;var p=r+(t-f[--c])/(f[c+1]-f[c])*u,m=g(p,e,n);return m>=a?function(t,r){for(var a=0;a<o;++a){var i=g(r,e,n);if(0===i)return r;r-=(b(r,e,n)-t)/i}return r}(t,p):0===m?p:function(t,r,o){var a,s,u=0;do{(a=b(s=r+(o-r)/2,e,n)-t)>0?o=s:r=s}while(Math.abs(a)>i&&++u<l);return s}(t,r,r+u)}var y=!1;function _(){y=!0,e===t&&n===r||function(){for(var t=0;t<s;++t)f[t]=b(t*u,e,n)}()}var x=function(o){return y||_(),e===t&&n===r?o:0===o?0:1===o?1:b(v(o),t,r)};x.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var w=\"generateBezier(\"+[e,t,n,r]+\")\";return x.toString=function(){return w},x}", "title": "" }, { "docid": "fc29b4bbb7ce1b47152430cbfa0059c0", "score": "0.5074988", "text": "function u$u(u){const v=new o$1u,{vertex:h,fragment:w}=v;return v.include(r$1b,u),v.include(e$F,u),v.include(u$H,u),v$M(h,u),u.stippleEnabled&&(v.attributes.add(O$O.UV0,\"vec2\"),v.attributes.add(O$O.AUXPOS1,\"vec3\"),h.uniforms.add(new e$1B(\"viewport\",((e,o)=>o.camera.fullViewport)))),v.attributes.add(O$O.POSITION,\"vec3\"),v.varyings.add(\"vpos\",\"vec3\"),h.code.add(n$1x`void main(void) {\nvpos = position;\nforwardNormalizedVertexColor();\ngl_Position = transformPosition(proj, view, vpos);`),u.stippleEnabled&&(h.code.add(n$1x`vec4 vpos2 = transformPosition(proj, view, auxpos1);\nvec2 ndcToPixel = viewport.zw * 0.5;\nfloat lineSegmentPixelSize = length((vpos2.xy / vpos2.w - gl_Position.xy / gl_Position.w) * ndcToPixel);`),u.draped?h.uniforms.add(new o$1w(\"worldToScreenRatio\",((e,o)=>1/o.screenToPCSRatio))):h.code.add(n$1x`vec3 segmentCenter = (position + auxpos1) * 0.5;\nfloat worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),h.code.add(n$1x`float discreteWorldToScreenRatio = discretizeWorldToScreenRatio(worldToScreenRatio);`),u.draped?h.code.add(n$1x`float startPseudoScreen = uv0.y * discreteWorldToScreenRatio - mix(0.0, lineSegmentPixelSize, uv0.x);\nfloat segmentLengthPseudoScreen = lineSegmentPixelSize;`):h.code.add(n$1x`float segmentLengthRender = length(position - auxpos1);\nfloat startPseudoScreen = mix(uv0.y, uv0.y - segmentLengthRender, uv0.x) * discreteWorldToScreenRatio;\nfloat segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),h.uniforms.add(new o$1w(\"stipplePatternPixelSize\",(e=>g$z(e)))),h.code.add(n$1x`vec2 stippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, lineSegmentPixelSize, stipplePatternPixelSize);\nvStippleDistance = mix(stippleDistanceLimits.x, stippleDistanceLimits.y, uv0.x);\nvStippleDistance *= gl_Position.w;`)),h.code.add(n$1x`}`),u.output===h$1c.Highlight&&v.include(a$U,u),v.include(u$R,u),w.uniforms.add(new o$1w(\"alphaCoverage\",((e,o)=>Math.min(1,e.width*o.camera.pixelRatio)))),u.hasVertexColors||w.uniforms.add(new e$1B(\"constantColor\",(e=>e.color))),w.code.add(n$1x`\n void main() {\n discardBySlice(vpos);\n\n vec4 color = ${u.hasVertexColors?\"vColor\":\"constantColor\"};\n\n float stippleAlpha = getStippleAlpha();\n discardByStippleAlpha(stippleAlpha, stippleAlphaColorDiscard);\n\n vec4 finalColor = blendStipple(vec4(color.rgb, color.a * alphaCoverage), stippleAlpha);\n\n if (finalColor.a < ${n$1x.float(t$14)}) {\n discard;\n }\n\n ${u.output===h$1c.Color?n$1x`gl_FragColor = highlightSlice(finalColor, vpos);`:\"\"}\n ${u.output===h$1c.Highlight?n$1x`outputHighlight();`:\"\"}\n }\n `),v}", "title": "" }, { "docid": "67339ceeed4938e0d2d7bf5d84f1a437", "score": "0.5067355", "text": "function quad(vert, pts, norm, a, b, c, d, n){\n for(var i=0; i <6; i++)\n norm.push(n);\n pts.push(vert[a]);\n pts.push(vert[c]);\n pts.push(vert[d]);\n pts.push(vert[a]);\n pts.push(vert[d]);\n pts.push(vert[b]);\n}", "title": "" }, { "docid": "c74b5c1bc95f1c3975465b24411e12f2", "score": "0.50606346", "text": "function B$o(r){const l=new o$1u,B=r.signedDistanceFieldEnabled;if(l.include(c$1o),l.include(u$W,r),l.include(u$R,r),r.occlusionPass)return l.include(p$S,r),l;const{vertex:T,fragment:V}=l;l.include(c$19),V.include(a$1p),V.include(e$1t),l.include(s$Y,r),l.include(d$$,r),l.varyings.add(\"vcolor\",\"vec4\"),l.varyings.add(\"vtc\",\"vec2\"),l.varyings.add(\"vsize\",\"vec2\"),r.binaryHighlightOcclusionEnabled&&l.varyings.add(\"voccluded\",\"float\"),T.uniforms.add([new e$1B(\"viewport\",((e,o)=>o.camera.fullViewport)),new e$1C(\"screenOffset\",((e,r)=>r$23(U$j,2*e.screenOffset[0]*r.camera.pixelRatio,2*e.screenOffset[1]*r.camera.pixelRatio))),new e$1C(\"anchorPosition\",(e=>H$l(e))),new e$1B(\"materialColor\",(e=>e.color)),new o$1w(\"pixelRatio\",((e,o)=>o.camera.pixelRatio))]),B&&(T.uniforms.add(new e$1B(\"outlineColor\",(e=>e.outlineColor))),V.uniforms.add([new e$1B(\"outlineColor\",(e=>_$A(e)?e.outlineColor:l$3N)),new o$1w(\"outlineSize\",(e=>_$A(e)?e.outlineSize:0))])),r.hasScreenSizePerspective&&(t$16(T),i$11(T)),(r.debugDrawLabelBorder||r.binaryHighlightOcclusionEnabled)&&l.varyings.add(\"debugBorderCoords\",\"vec4\"),l.attributes.add(O$O.UV0,\"vec2\"),l.attributes.add(O$O.COLOR,\"vec4\"),l.attributes.add(O$O.SIZE,\"vec2\"),l.attributes.add(O$O.AUXPOS2,\"vec4\"),T.code.add(n$1x`\n void main(void) {\n ProjectHUDAux projectAux;\n vec4 posProj = projectPositionHUD(projectAux);\n forwardObjectAndLayerIdColor();\n\n if (rejectBySlice(projectAux.posModel)) {\n // Project outside of clip plane\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n vec2 inputSize;\n ${r.hasScreenSizePerspective?n$1x`\n inputSize = screenSizePerspectiveScaleVec2(size, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspective);\n vec2 screenOffsetScaled = screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);\n `:n$1x`\n inputSize = size;\n vec2 screenOffsetScaled = screenOffset;`}\n\n ${r.vvSize?\"inputSize *= vvScale(auxpos2).xx;\":\"\"}\n\n vec2 combinedSize = inputSize * pixelRatio;\n vec4 quadOffset = vec4(0.0);\n\n ${r.occlusionTestEnabled||r.binaryHighlightOcclusionEnabled?\"bool visible = testVisibilityHUD(posProj);\":\"\"}\n\n ${r.binaryHighlightOcclusionEnabled?\"voccluded = visible ? 0.0 : 1.0;\":\"\"}\n `);const E=n$1x`vec2 uv01 = floor(uv0);\nvec2 uv = uv0 - uv01;\nquadOffset.xy = ((uv01 - anchorPosition) * 2.0 * combinedSize + screenOffsetScaled) / viewport.zw * posProj.w;`,M=r.pixelSnappingEnabled?B?n$1x`posProj = alignToPixelOrigin(posProj, viewport.zw) + quadOffset;`:n$1x`posProj += quadOffset;\nif (inputSize.x == size.x) {\nposProj = alignToPixelOrigin(posProj, viewport.zw);\n}`:n$1x`posProj += quadOffset;`;r.vvColor&&T.uniforms.add([new e$11(\"vvColorColors\",(e=>e.vvColorColors),o$X),new o$Y(\"vvColorValues\",(e=>e.vvColorValues),o$X)]),T.uniforms.add(new e$1C(\"textureCoordinateScaleFactor\",(o=>r$3A(o.texture)&&r$3A(o.texture.descriptor.textureCoordinateScaleFactor)?o.texture.descriptor.textureCoordinateScaleFactor:i$2C))),T.code.add(n$1x`\n ${r.occlusionTestEnabled?\"if (visible) {\":\"\"}\n ${E}\n ${r.vvColor?\"vcolor = vvGetColor(auxpos2, vvColorValues, vvColorColors) * materialColor;\":\"vcolor = color / 255.0 * materialColor;\"}\n\n bool alphaDiscard = vcolor.a < ${n$1x.float(t$14)};\n ${B?`alphaDiscard = alphaDiscard && outlineColor.a < ${n$1x.float(t$14)};`:\"\"}\n if (alphaDiscard) {\n // \"early discard\" if both symbol color (= fill) and outline color (if applicable) are transparent\n gl_Position = vec4(1e38, 1e38, 1e38, 1.0);\n return;\n } else {\n ${M}\n gl_Position = posProj;\n }\n\n vtc = uv * textureCoordinateScaleFactor;\n\n ${r.debugDrawLabelBorder?\"debugBorderCoords = vec4(uv01, 1.5 / combinedSize);\":\"\"}\n vsize = inputSize;\n ${r.occlusionTestEnabled?n$1x`} else { vtc = vec2(0.0);\n ${r.debugDrawLabelBorder?\"debugBorderCoords = vec4(0.5, 0.5, 1.5 / combinedSize);}\":\"}\"}`:\"\"}\n }\n `),V.uniforms.add(new f$1s(\"tex\",(e=>e.texture)));const R=r.debugDrawLabelBorder?n$1x`(isBorder > 0.0 ? 0.0 : ${n$1x.float(o$W)})`:n$1x.float(o$W),I=n$1x`\n ${r.debugDrawLabelBorder?n$1x`\n float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`:\"\"}\n\n ${B?n$1x`\n vec4 fillPixelColor = vcolor;\n\n // Attempt to sample texel centers to avoid that thin cross outlines\n // disappear with large symbol sizes.\n // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/7058#issuecomment-603041\n const float txSize = ${n$1x.float(e$12)};\n const float texelSize = 1.0 / txSize;\n // Calculate how much we have to add/subtract to/from each texel to reach the size of an onscreen pixel\n vec2 scaleFactor = (vsize - txSize) * texelSize;\n vec2 samplePos = vtc + (vec2(1.0, -1.0) * texelSize) * scaleFactor;\n\n // Get distance and map it into [-0.5, 0.5]\n float d = rgba2float(texture2D(tex, samplePos)) - 0.5;\n\n // Distance in output units (i.e. pixels)\n float dist = d * vsize.x;\n\n // Create smooth transition from the icon into its outline\n float fillAlphaFactor = clamp(0.5 - dist, 0.0, 1.0);\n fillPixelColor.a *= fillAlphaFactor;\n\n if (outlineSize > 0.25) {\n vec4 outlinePixelColor = outlineColor;\n float clampedOutlineSize = min(outlineSize, 0.5*vsize.x);\n\n // Create smooth transition around outline\n float outlineAlphaFactor = clamp(0.5 - (abs(dist) - 0.5*clampedOutlineSize), 0.0, 1.0);\n outlinePixelColor.a *= outlineAlphaFactor;\n\n if (\n outlineAlphaFactor + fillAlphaFactor < ${R} ||\n fillPixelColor.a + outlinePixelColor.a < ${n$1x.float(t$14)}\n ) {\n discard;\n }\n\n // perform un-premultiplied over operator (see https://en.wikipedia.org/wiki/Alpha_compositing#Description)\n float compositeAlpha = outlinePixelColor.a + fillPixelColor.a * (1.0 - outlinePixelColor.a);\n vec3 compositeColor = vec3(outlinePixelColor) * outlinePixelColor.a +\n vec3(fillPixelColor) * fillPixelColor.a * (1.0 - outlinePixelColor.a);\n\n gl_FragColor = vec4(compositeColor, compositeAlpha);\n } else {\n if (fillAlphaFactor < ${R}) {\n discard;\n }\n\n gl_FragColor = premultiplyAlpha(fillPixelColor);\n }\n\n // visualize SDF:\n // gl_FragColor = vec4(clamp(-dist/vsize.x*2.0, 0.0, 1.0), clamp(dist/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0);\n `:n$1x`\n vec4 texColor = texture2D(tex, vtc, -0.5);\n if (texColor.a < ${R}) {\n discard;\n }\n gl_FragColor = texColor * premultiplyAlpha(vcolor);\n `}\n\n // Draw debug border with transparency, so that original texels along border are still partially visible\n ${r.debugDrawLabelBorder?n$1x`gl_FragColor = mix(gl_FragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`:\"\"}\n `;return r.output===h$1c.Alpha&&V.code.add(n$1x`\n void main() {\n ${I}\n gl_FragColor = vec4(gl_FragColor.a);\n }\n `),r.output===h$1c.ObjectAndLayerIdColor&&V.code.add(n$1x`\n void main() {\n ${I}\n outputObjectAndLayerIdColor();\n }\n `),r.output===h$1c.Color&&V.code.add(n$1x`\n void main() {\n ${I}\n ${r.transparencyPassType===o$V.FrontFace?\"gl_FragColor.rgb /= gl_FragColor.a;\":\"\"}\n }\n `),r.output===h$1c.Highlight&&(l.include(a$U,r),V.code.add(n$1x`\n void main() {\n ${I}\n ${r.binaryHighlightOcclusionEnabled?n$1x`\n if (voccluded == 1.0) {\n gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n } else {\n gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);\n }`:\"outputHighlight();\"}\n }\n `)),l}", "title": "" }, { "docid": "642a95cb20884e288b974cf826549efe", "score": "0.50566983", "text": "function c$J(c,u){const l=c.fragment;if(u.hasVertexTangents?(c.attributes.add(O$O.TANGENT,\"vec4\"),c.varyings.add(\"vTangent\",\"vec4\"),u.doubleSidedMode===i$G.WindingOrder?l.code.add(n$1x`mat3 computeTangentSpace(vec3 normal) {\nfloat tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;\nvec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);\nvec3 bitangent = cross(normal, tangent) * tangentHeadedness;\nreturn mat3(tangent, bitangent, normal);\n}`):l.code.add(n$1x`mat3 computeTangentSpace(vec3 normal) {\nfloat tangentHeadedness = vTangent.w;\nvec3 tangent = normalize(vTangent.xyz);\nvec3 bitangent = cross(normal, tangent) * tangentHeadedness;\nreturn mat3(tangent, bitangent, normal);\n}`)):(c.extensions.add(\"GL_OES_standard_derivatives\"),l.code.add(n$1x`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {\nvec3 Q1 = dFdx(pos);\nvec3 Q2 = dFdy(pos);\nvec2 stx = dFdx(st);\nvec2 sty = dFdy(st);\nfloat det = stx.t * sty.s - sty.t * stx.s;\nvec3 T = stx.t * Q2 - sty.t * Q1;\nT = T - normal * dot(normal, T);\nT *= inversesqrt(max(dot(T,T), 1.e-10));\nvec3 B = sign(det) * cross(normal, T);\nreturn mat3(T, B, normal);\n}`)),u.textureCoordinateType!==d$1t.None){c.include(a$1e,u);const e=u.supportsTextureAtlas?u.hasWebGL2Context?e$1z.None:e$1z.Size:e$1z.None;l.uniforms.add(u.pbrTextureBindType===a$1n.Pass?u$1t(\"normalTexture\",(e=>e.textureNormal),e):u$1j(\"normalTexture\",(e=>e.textureNormal),e)),l.code.add(n$1x`\n vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {\n vtc.uv = uv;\n ${u.supportsTextureAtlas?n$1x`vtc.size = ${r$1l(u,\"normalTexture\")};`:\"\"}\n vec3 rawNormal = textureLookup(normalTexture, vtc).rgb * 2.0 - 1.0;\n return tangentSpace * rawNormal;\n }\n `);}}", "title": "" }, { "docid": "52ab29ac868f919b102b8e9178ad3545", "score": "0.5052896", "text": "function easeOutQuad( t, b, c ) { return -c *(t/=1)*(t-2) + b; }", "title": "" }, { "docid": "f88a2a85b9341685598a900656aab819", "score": "0.50489604", "text": "function Quux() {}", "title": "" }, { "docid": "b790b63d567113f63927359d112aa383", "score": "0.5045574", "text": "function QuadSD_ak1(NN, u, v, p, q, iPar){\n // Divides p by the quadratic 1, u, v placing the quotient in q and the remainder in a, b\n // iPar is a dummy variable for passing in the two parameters--a and b--by reference\n q[0] = iPar.b = p[0];\n q[1] = iPar.a = -(u*iPar.b) + p[1];\n\n for (var i = 2; i < NN; i++){\n q[i] = -(u*iPar.a + v*iPar.b) + p[i];\n iPar.b = iPar.a;\n iPar.a = q[i];\n } \n return;\n }", "title": "" }, { "docid": "dff62482dd7722b8df3ed417692711e0", "score": "0.504373", "text": "easeOutQuad(t, b, c, d) {\n\t\tt /= d;\n\t\treturn -c * t * (t - 2) + b;\n\t}", "title": "" }, { "docid": "cd1fb5c2f9c36497be1cbf6b339edaa2", "score": "0.5040502", "text": "function DrawPrimitives() {}", "title": "" }, { "docid": "b643f75c0afcb3452811d78021f5a7b4", "score": "0.50229955", "text": "function Quad(){ // QUAD MODEL Constructor\n this.attack += Helper.rndNum(20, 15); // BUFF/NERF to default attack range - top of range first, bottom of range second\n this.heath += Helper.rndNum(21, 16); // BUFF/NERF to default health range - top of range first, bottom of range second\n}", "title": "" }, { "docid": "61d619e854afc8fb7b7c63d2b723e74f", "score": "0.5021926", "text": "addQuads(quads) {\n for (var i = 0; i < quads.length; i++) this.addQuad(quads[i]);\n }", "title": "" }, { "docid": "61d619e854afc8fb7b7c63d2b723e74f", "score": "0.5021926", "text": "addQuads(quads) {\n for (var i = 0; i < quads.length; i++) this.addQuad(quads[i]);\n }", "title": "" }, { "docid": "91a4ee3031ea2ec0cc6f12c5472bb6d5", "score": "0.50192904", "text": "function Takehiro() {\n\n var qupvt = null;\n this.qupvt = null;\n\n this.setModules = function (_qupvt) {\n this.qupvt = _qupvt;\n qupvt = _qupvt;\n }\n\n function Bits(b) {\n this.bits = 0 | b;\n }\n\n var subdv_table = [[0, 0], /* 0 bands */\n [0, 0], /* 1 bands */\n [0, 0], /* 2 bands */\n [0, 0], /* 3 bands */\n [0, 0], /* 4 bands */\n [0, 1], /* 5 bands */\n [1, 1], /* 6 bands */\n [1, 1], /* 7 bands */\n [1, 2], /* 8 bands */\n [2, 2], /* 9 bands */\n [2, 3], /* 10 bands */\n [2, 3], /* 11 bands */\n [3, 4], /* 12 bands */\n [3, 4], /* 13 bands */\n [3, 4], /* 14 bands */\n [4, 5], /* 15 bands */\n [4, 5], /* 16 bands */\n [4, 6], /* 17 bands */\n [5, 6], /* 18 bands */\n [5, 6], /* 19 bands */\n [5, 7], /* 20 bands */\n [6, 7], /* 21 bands */\n [6, 7], /* 22 bands */\n ];\n\n\n /**\n * nonlinear quantization of xr More accurate formula than the ISO formula.\n * Takes into account the fact that we are quantizing xr . ix, but we want\n * ix^4/3 to be as close as possible to x^4/3. (taking the nearest int would\n * mean ix is as close as possible to xr, which is different.)\n *\n * From Segher Boessenkool <[email protected]> 11/1999\n *\n * 09/2000: ASM code removed in favor of IEEE754 hack by Takehiro Tominaga.\n * If you need the ASM code, check CVS circa Aug 2000.\n *\n * 01/2004: Optimizations by Gabriel Bouvigne\n */\n function quantize_lines_xrpow_01(l, istep, xr, xrPos, ix, ixPos) {\n var compareval0 = (1.0 - 0.4054) / istep;\n\n l = l >> 1;\n while ((l--) != 0) {\n ix[ixPos++] = (compareval0 > xr[xrPos++]) ? 0 : 1;\n ix[ixPos++] = (compareval0 > xr[xrPos++]) ? 0 : 1;\n }\n }\n\n /**\n * XRPOW_FTOI is a macro to convert floats to ints.<BR>\n * if XRPOW_FTOI(x) = nearest_int(x), then QUANTFAC(x)=adj43asm[x]<BR>\n * ROUNDFAC= -0.0946<BR>\n *\n * if XRPOW_FTOI(x) = floor(x), then QUANTFAC(x)=asj43[x]<BR>\n * ROUNDFAC=0.4054<BR>\n *\n * Note: using floor() or 0| is extremely slow. On machines where the\n * TAKEHIRO_IEEE754_HACK code above does not work, it is worthwile to write\n * some ASM for XRPOW_FTOI().\n */\n function quantize_lines_xrpow(l, istep, xr, xrPos, ix, ixPos) {\n\n l = l >> 1;\n var remaining = l % 2;\n l = l >> 1;\n while (l-- != 0) {\n var x0, x1, x2, x3;\n var rx0, rx1, rx2, rx3;\n\n x0 = xr[xrPos++] * istep;\n x1 = xr[xrPos++] * istep;\n rx0 = 0 | x0;\n x2 = xr[xrPos++] * istep;\n rx1 = 0 | x1;\n x3 = xr[xrPos++] * istep;\n rx2 = 0 | x2;\n x0 += qupvt.adj43[rx0];\n rx3 = 0 | x3;\n x1 += qupvt.adj43[rx1];\n ix[ixPos++] = 0 | x0;\n x2 += qupvt.adj43[rx2];\n ix[ixPos++] = 0 | x1;\n x3 += qupvt.adj43[rx3];\n ix[ixPos++] = 0 | x2;\n ix[ixPos++] = 0 | x3;\n }\n if (remaining != 0) {\n var x0, x1;\n var rx0, rx1;\n\n x0 = xr[xrPos++] * istep;\n x1 = xr[xrPos++] * istep;\n rx0 = 0 | x0;\n rx1 = 0 | x1;\n x0 += qupvt.adj43[rx0];\n x1 += qupvt.adj43[rx1];\n ix[ixPos++] = 0 | x0;\n ix[ixPos++] = 0 | x1;\n }\n }\n\n /**\n * Quantization function This function will select which lines to quantize\n * and call the proper quantization function\n */\n function quantize_xrpow(xp, pi, istep, codInfo, prevNoise) {\n /* quantize on xr^(3/4) instead of xr */\n var sfb;\n var sfbmax;\n var j = 0;\n var prev_data_use;\n var accumulate = 0;\n var accumulate01 = 0;\n var xpPos = 0;\n var iData = pi;\n var iDataPos = 0;\n var acc_iData = iData;\n var acc_iDataPos = 0;\n var acc_xp = xp;\n var acc_xpPos = 0;\n\n /*\n * Reusing previously computed data does not seems to work if global\n * gain is changed. Finding why it behaves this way would allow to use a\n * cache of previously computed values (let's 10 cached values per sfb)\n * that would probably provide a noticeable speedup\n */\n prev_data_use = (prevNoise != null && (codInfo.global_gain == prevNoise.global_gain));\n\n if (codInfo.block_type == Encoder.SHORT_TYPE)\n sfbmax = 38;\n else\n sfbmax = 21;\n\n for (sfb = 0; sfb <= sfbmax; sfb++) {\n var step = -1;\n\n if (prev_data_use || codInfo.block_type == Encoder.NORM_TYPE) {\n step = codInfo.global_gain\n - ((codInfo.scalefac[sfb] + (codInfo.preflag != 0 ? qupvt.pretab[sfb]\n : 0)) << (codInfo.scalefac_scale + 1))\n - codInfo.subblock_gain[codInfo.window[sfb]] * 8;\n }\n if (prev_data_use && (prevNoise.step[sfb] == step)) {\n /*\n * do not recompute this part, but compute accumulated lines\n */\n if (accumulate != 0) {\n quantize_lines_xrpow(accumulate, istep, acc_xp, acc_xpPos,\n acc_iData, acc_iDataPos);\n accumulate = 0;\n }\n if (accumulate01 != 0) {\n quantize_lines_xrpow_01(accumulate01, istep, acc_xp,\n acc_xpPos, acc_iData, acc_iDataPos);\n accumulate01 = 0;\n }\n } else { /* should compute this part */\n var l = codInfo.width[sfb];\n\n if ((j + codInfo.width[sfb]) > codInfo.max_nonzero_coeff) {\n /* do not compute upper zero part */\n var usefullsize;\n usefullsize = codInfo.max_nonzero_coeff - j + 1;\n Arrays.fill(pi, codInfo.max_nonzero_coeff, 576, 0);\n l = usefullsize;\n\n if (l < 0) {\n l = 0;\n }\n\n /* no need to compute higher sfb values */\n sfb = sfbmax + 1;\n }\n\n /* accumulate lines to quantize */\n if (0 == accumulate && 0 == accumulate01) {\n acc_iData = iData;\n acc_iDataPos = iDataPos;\n acc_xp = xp;\n acc_xpPos = xpPos;\n }\n if (prevNoise != null && prevNoise.sfb_count1 > 0\n && sfb >= prevNoise.sfb_count1\n && prevNoise.step[sfb] > 0\n && step >= prevNoise.step[sfb]) {\n\n if (accumulate != 0) {\n quantize_lines_xrpow(accumulate, istep, acc_xp,\n acc_xpPos, acc_iData, acc_iDataPos);\n accumulate = 0;\n acc_iData = iData;\n acc_iDataPos = iDataPos;\n acc_xp = xp;\n acc_xpPos = xpPos;\n }\n accumulate01 += l;\n } else {\n if (accumulate01 != 0) {\n quantize_lines_xrpow_01(accumulate01, istep, acc_xp,\n acc_xpPos, acc_iData, acc_iDataPos);\n accumulate01 = 0;\n acc_iData = iData;\n acc_iDataPos = iDataPos;\n acc_xp = xp;\n acc_xpPos = xpPos;\n }\n accumulate += l;\n }\n\n if (l <= 0) {\n /*\n * rh: 20040215 may happen due to \"prev_data_use\"\n * optimization\n */\n if (accumulate01 != 0) {\n quantize_lines_xrpow_01(accumulate01, istep, acc_xp,\n acc_xpPos, acc_iData, acc_iDataPos);\n accumulate01 = 0;\n }\n if (accumulate != 0) {\n quantize_lines_xrpow(accumulate, istep, acc_xp,\n acc_xpPos, acc_iData, acc_iDataPos);\n accumulate = 0;\n }\n\n break;\n /* ends for-loop */\n }\n }\n if (sfb <= sfbmax) {\n iDataPos += codInfo.width[sfb];\n xpPos += codInfo.width[sfb];\n j += codInfo.width[sfb];\n }\n }\n if (accumulate != 0) { /* last data part */\n quantize_lines_xrpow(accumulate, istep, acc_xp, acc_xpPos,\n acc_iData, acc_iDataPos);\n accumulate = 0;\n }\n if (accumulate01 != 0) { /* last data part */\n quantize_lines_xrpow_01(accumulate01, istep, acc_xp, acc_xpPos,\n acc_iData, acc_iDataPos);\n accumulate01 = 0;\n }\n\n }\n\n /**\n * ix_max\n */\n function ix_max(ix, ixPos, endPos) {\n var max1 = 0, max2 = 0;\n\n do {\n var x1 = ix[ixPos++];\n var x2 = ix[ixPos++];\n if (max1 < x1)\n max1 = x1;\n\n if (max2 < x2)\n max2 = x2;\n } while (ixPos < endPos);\n if (max1 < max2)\n max1 = max2;\n return max1;\n }\n\n function count_bit_ESC(ix, ixPos, end, t1, t2, s) {\n /* ESC-table is used */\n var linbits = Tables.ht[t1].xlen * 65536 + Tables.ht[t2].xlen;\n var sum = 0, sum2;\n\n do {\n var x = ix[ixPos++];\n var y = ix[ixPos++];\n\n if (x != 0) {\n if (x > 14) {\n x = 15;\n sum += linbits;\n }\n x *= 16;\n }\n\n if (y != 0) {\n if (y > 14) {\n y = 15;\n sum += linbits;\n }\n x += y;\n }\n\n sum += Tables.largetbl[x];\n } while (ixPos < end);\n\n sum2 = sum & 0xffff;\n sum >>= 16;\n\n if (sum > sum2) {\n sum = sum2;\n t1 = t2;\n }\n\n s.bits += sum;\n return t1;\n }\n\n function count_bit_noESC(ix, ixPos, end, s) {\n /* No ESC-words */\n var sum1 = 0;\n var hlen1 = Tables.ht[1].hlen;\n\n do {\n var x = ix[ixPos + 0] * 2 + ix[ixPos + 1];\n ixPos += 2;\n sum1 += hlen1[x];\n } while (ixPos < end);\n\n s.bits += sum1;\n return 1;\n }\n\n function count_bit_noESC_from2(ix, ixPos, end, t1, s) {\n /* No ESC-words */\n var sum = 0, sum2;\n var xlen = Tables.ht[t1].xlen;\n var hlen;\n if (t1 == 2)\n hlen = Tables.table23;\n else\n hlen = Tables.table56;\n\n do {\n var x = ix[ixPos + 0] * xlen + ix[ixPos + 1];\n ixPos += 2;\n sum += hlen[x];\n } while (ixPos < end);\n\n sum2 = sum & 0xffff;\n sum >>= 16;\n\n if (sum > sum2) {\n sum = sum2;\n t1++;\n }\n\n s.bits += sum;\n return t1;\n }\n\n function count_bit_noESC_from3(ix, ixPos, end, t1, s) {\n /* No ESC-words */\n var sum1 = 0;\n var sum2 = 0;\n var sum3 = 0;\n var xlen = Tables.ht[t1].xlen;\n var hlen1 = Tables.ht[t1].hlen;\n var hlen2 = Tables.ht[t1 + 1].hlen;\n var hlen3 = Tables.ht[t1 + 2].hlen;\n\n do {\n var x = ix[ixPos + 0] * xlen + ix[ixPos + 1];\n ixPos += 2;\n sum1 += hlen1[x];\n sum2 += hlen2[x];\n sum3 += hlen3[x];\n } while (ixPos < end);\n var t = t1;\n if (sum1 > sum2) {\n sum1 = sum2;\n t++;\n }\n if (sum1 > sum3) {\n sum1 = sum3;\n t = t1 + 2;\n }\n s.bits += sum1;\n\n return t;\n }\n\n /*************************************************************************/\n /* choose table */\n /*************************************************************************/\n\n var huf_tbl_noESC = [1, 2, 5, 7, 7, 10, 10, 13, 13,\n 13, 13, 13, 13, 13, 13];\n\n /**\n * Choose the Huffman table that will encode ix[begin..end] with the fewest\n * bits.\n *\n * Note: This code contains knowledge about the sizes and characteristics of\n * the Huffman tables as defined in the IS (Table B.7), and will not work\n * with any arbitrary tables.\n */\n function choose_table(ix, ixPos, endPos, s) {\n var max = ix_max(ix, ixPos, endPos);\n\n switch (max) {\n case 0:\n return max;\n\n case 1:\n return count_bit_noESC(ix, ixPos, endPos, s);\n\n case 2:\n case 3:\n return count_bit_noESC_from2(ix, ixPos, endPos,\n huf_tbl_noESC[max - 1], s);\n\n case 4:\n case 5:\n case 6:\n case 7:\n case 8:\n case 9:\n case 10:\n case 11:\n case 12:\n case 13:\n case 14:\n case 15:\n return count_bit_noESC_from3(ix, ixPos, endPos,\n huf_tbl_noESC[max - 1], s);\n\n default:\n /* try tables with linbits */\n if (max > QuantizePVT.IXMAX_VAL) {\n s.bits = QuantizePVT.LARGE_BITS;\n return -1;\n }\n max -= 15;\n var choice2;\n for (choice2 = 24; choice2 < 32; choice2++) {\n if (Tables.ht[choice2].linmax >= max) {\n break;\n }\n }\n var choice;\n for (choice = choice2 - 8; choice < 24; choice++) {\n if (Tables.ht[choice].linmax >= max) {\n break;\n }\n }\n return count_bit_ESC(ix, ixPos, endPos, choice, choice2, s);\n }\n }\n\n /**\n * count_bit\n */\n this.noquant_count_bits = function (gfc, gi, prev_noise) {\n var ix = gi.l3_enc;\n var i = Math.min(576, ((gi.max_nonzero_coeff + 2) >> 1) << 1);\n\n if (prev_noise != null)\n prev_noise.sfb_count1 = 0;\n\n /* Determine count1 region */\n for (; i > 1; i -= 2)\n if ((ix[i - 1] | ix[i - 2]) != 0)\n break;\n gi.count1 = i;\n\n /* Determines the number of bits to encode the quadruples. */\n var a1 = 0;\n var a2 = 0;\n for (; i > 3; i -= 4) {\n var p;\n /* hack to check if all values <= 1 */\n //throw \"TODO: HACK if ((((long) ix[i - 1] | (long) ix[i - 2] | (long) ix[i - 3] | (long) ix[i - 4]) & 0xffffffffL) > 1L \"\n //if (true) {\n if (((ix[i - 1] | ix[i - 2] | ix[i - 3] | ix[i - 4]) & 0x7fffffff) > 1) {\n break;\n }\n p = ((ix[i - 4] * 2 + ix[i - 3]) * 2 + ix[i - 2]) * 2 + ix[i - 1];\n a1 += Tables.t32l[p];\n a2 += Tables.t33l[p];\n }\n var bits = a1;\n gi.count1table_select = 0;\n if (a1 > a2) {\n bits = a2;\n gi.count1table_select = 1;\n }\n\n gi.count1bits = bits;\n gi.big_values = i;\n if (i == 0)\n return bits;\n\n if (gi.block_type == Encoder.SHORT_TYPE) {\n a1 = 3 * gfc.scalefac_band.s[3];\n if (a1 > gi.big_values)\n a1 = gi.big_values;\n a2 = gi.big_values;\n\n } else if (gi.block_type == Encoder.NORM_TYPE) {\n /* bv_scf has 576 entries (0..575) */\n a1 = gi.region0_count = gfc.bv_scf[i - 2];\n a2 = gi.region1_count = gfc.bv_scf[i - 1];\n\n a2 = gfc.scalefac_band.l[a1 + a2 + 2];\n a1 = gfc.scalefac_band.l[a1 + 1];\n if (a2 < i) {\n var bi = new Bits(bits);\n gi.table_select[2] = choose_table(ix, a2, i, bi);\n bits = bi.bits;\n }\n } else {\n gi.region0_count = 7;\n /* gi.region1_count = SBPSY_l - 7 - 1; */\n gi.region1_count = Encoder.SBMAX_l - 1 - 7 - 1;\n a1 = gfc.scalefac_band.l[7 + 1];\n a2 = i;\n if (a1 > a2) {\n a1 = a2;\n }\n }\n\n /* have to allow for the case when bigvalues < region0 < region1 */\n /* (and region0, region1 are ignored) */\n a1 = Math.min(a1, i);\n a2 = Math.min(a2, i);\n\n\n /* Count the number of bits necessary to code the bigvalues region. */\n if (0 < a1) {\n var bi = new Bits(bits);\n gi.table_select[0] = choose_table(ix, 0, a1, bi);\n bits = bi.bits;\n }\n if (a1 < a2) {\n var bi = new Bits(bits);\n gi.table_select[1] = choose_table(ix, a1, a2, bi);\n bits = bi.bits;\n }\n if (gfc.use_best_huffman == 2) {\n gi.part2_3_length = bits;\n best_huffman_divide(gfc, gi);\n bits = gi.part2_3_length;\n }\n\n if (prev_noise != null) {\n if (gi.block_type == Encoder.NORM_TYPE) {\n var sfb = 0;\n while (gfc.scalefac_band.l[sfb] < gi.big_values) {\n sfb++;\n }\n prev_noise.sfb_count1 = sfb;\n }\n }\n\n return bits;\n }\n\n this.count_bits = function (gfc, xr, gi, prev_noise) {\n var ix = gi.l3_enc;\n\n /* since quantize_xrpow uses table lookup, we need to check this first: */\n var w = (QuantizePVT.IXMAX_VAL) / qupvt.IPOW20(gi.global_gain);\n\n if (gi.xrpow_max > w)\n return QuantizePVT.LARGE_BITS;\n\n quantize_xrpow(xr, ix, qupvt.IPOW20(gi.global_gain), gi, prev_noise);\n\n if ((gfc.substep_shaping & 2) != 0) {\n var j = 0;\n /* 0.634521682242439 = 0.5946*2**(.5*0.1875) */\n var gain = gi.global_gain + gi.scalefac_scale;\n var roundfac = 0.634521682242439 / qupvt.IPOW20(gain);\n for (var sfb = 0; sfb < gi.sfbmax; sfb++) {\n var width = gi.width[sfb];\n if (0 == gfc.pseudohalf[sfb]) {\n j += width;\n } else {\n var k;\n for (k = j, j += width; k < j; ++k) {\n ix[k] = (xr[k] >= roundfac) ? ix[k] : 0;\n }\n }\n }\n }\n return this.noquant_count_bits(gfc, gi, prev_noise);\n }\n\n /**\n * re-calculate the best scalefac_compress using scfsi the saved bits are\n * kept in the bit reservoir.\n */\n function recalc_divide_init(gfc, cod_info, ix, r01_bits, r01_div, r0_tbl, r1_tbl) {\n var bigv = cod_info.big_values;\n\n for (var r0 = 0; r0 <= 7 + 15; r0++) {\n r01_bits[r0] = QuantizePVT.LARGE_BITS;\n }\n\n for (var r0 = 0; r0 < 16; r0++) {\n var a1 = gfc.scalefac_band.l[r0 + 1];\n if (a1 >= bigv)\n break;\n var r0bits = 0;\n var bi = new Bits(r0bits);\n var r0t = choose_table(ix, 0, a1, bi);\n r0bits = bi.bits;\n\n for (var r1 = 0; r1 < 8; r1++) {\n var a2 = gfc.scalefac_band.l[r0 + r1 + 2];\n if (a2 >= bigv)\n break;\n var bits = r0bits;\n bi = new Bits(bits);\n var r1t = choose_table(ix, a1, a2, bi);\n bits = bi.bits;\n if (r01_bits[r0 + r1] > bits) {\n r01_bits[r0 + r1] = bits;\n r01_div[r0 + r1] = r0;\n r0_tbl[r0 + r1] = r0t;\n r1_tbl[r0 + r1] = r1t;\n }\n }\n }\n }\n\n function recalc_divide_sub(gfc, cod_info2, gi, ix, r01_bits, r01_div, r0_tbl, r1_tbl) {\n var bigv = cod_info2.big_values;\n\n for (var r2 = 2; r2 < Encoder.SBMAX_l + 1; r2++) {\n var a2 = gfc.scalefac_band.l[r2];\n if (a2 >= bigv)\n break;\n var bits = r01_bits[r2 - 2] + cod_info2.count1bits;\n if (gi.part2_3_length <= bits)\n break;\n\n var bi = new Bits(bits);\n var r2t = choose_table(ix, a2, bigv, bi);\n bits = bi.bits;\n if (gi.part2_3_length <= bits)\n continue;\n\n gi.assign(cod_info2);\n gi.part2_3_length = bits;\n gi.region0_count = r01_div[r2 - 2];\n gi.region1_count = r2 - 2 - r01_div[r2 - 2];\n gi.table_select[0] = r0_tbl[r2 - 2];\n gi.table_select[1] = r1_tbl[r2 - 2];\n gi.table_select[2] = r2t;\n }\n }\n\n this.best_huffman_divide = function (gfc, gi) {\n var cod_info2 = new GrInfo();\n var ix = gi.l3_enc;\n var r01_bits = new_int(7 + 15 + 1);\n var r01_div = new_int(7 + 15 + 1);\n var r0_tbl = new_int(7 + 15 + 1);\n var r1_tbl = new_int(7 + 15 + 1);\n\n /* SHORT BLOCK stuff fails for MPEG2 */\n if (gi.block_type == Encoder.SHORT_TYPE && gfc.mode_gr == 1)\n return;\n\n cod_info2.assign(gi);\n if (gi.block_type == Encoder.NORM_TYPE) {\n recalc_divide_init(gfc, gi, ix, r01_bits, r01_div, r0_tbl, r1_tbl);\n recalc_divide_sub(gfc, cod_info2, gi, ix, r01_bits, r01_div,\n r0_tbl, r1_tbl);\n }\n var i = cod_info2.big_values;\n if (i == 0 || (ix[i - 2] | ix[i - 1]) > 1)\n return;\n\n i = gi.count1 + 2;\n if (i > 576)\n return;\n\n /* Determines the number of bits to encode the quadruples. */\n cod_info2.assign(gi);\n cod_info2.count1 = i;\n var a1 = 0;\n var a2 = 0;\n\n\n for (; i > cod_info2.big_values; i -= 4) {\n var p = ((ix[i - 4] * 2 + ix[i - 3]) * 2 + ix[i - 2]) * 2\n + ix[i - 1];\n a1 += Tables.t32l[p];\n a2 += Tables.t33l[p];\n }\n cod_info2.big_values = i;\n\n cod_info2.count1table_select = 0;\n if (a1 > a2) {\n a1 = a2;\n cod_info2.count1table_select = 1;\n }\n\n cod_info2.count1bits = a1;\n\n if (cod_info2.block_type == Encoder.NORM_TYPE)\n recalc_divide_sub(gfc, cod_info2, gi, ix, r01_bits, r01_div,\n r0_tbl, r1_tbl);\n else {\n /* Count the number of bits necessary to code the bigvalues region. */\n cod_info2.part2_3_length = a1;\n a1 = gfc.scalefac_band.l[7 + 1];\n if (a1 > i) {\n a1 = i;\n }\n if (a1 > 0) {\n var bi = new Bits(cod_info2.part2_3_length);\n cod_info2.table_select[0] = choose_table(ix, 0, a1, bi);\n cod_info2.part2_3_length = bi.bits;\n }\n if (i > a1) {\n var bi = new Bits(cod_info2.part2_3_length);\n cod_info2.table_select[1] = choose_table(ix, a1, i, bi);\n cod_info2.part2_3_length = bi.bits;\n }\n if (gi.part2_3_length > cod_info2.part2_3_length)\n gi.assign(cod_info2);\n }\n }\n\n var slen1_n = [1, 1, 1, 1, 8, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16];\n var slen2_n = [1, 2, 4, 8, 1, 2, 4, 8, 2, 4, 8, 2, 4, 8, 4, 8];\n var slen1_tab = [0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4];\n var slen2_tab = [0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3];\n Takehiro.slen1_tab = slen1_tab;\n Takehiro.slen2_tab = slen2_tab;\n\n function scfsi_calc(ch, l3_side) {\n var sfb;\n var gi = l3_side.tt[1][ch];\n var g0 = l3_side.tt[0][ch];\n\n for (var i = 0; i < Tables.scfsi_band.length - 1; i++) {\n for (sfb = Tables.scfsi_band[i]; sfb < Tables.scfsi_band[i + 1]; sfb++) {\n if (g0.scalefac[sfb] != gi.scalefac[sfb]\n && gi.scalefac[sfb] >= 0)\n break;\n }\n if (sfb == Tables.scfsi_band[i + 1]) {\n for (sfb = Tables.scfsi_band[i]; sfb < Tables.scfsi_band[i + 1]; sfb++) {\n gi.scalefac[sfb] = -1;\n }\n l3_side.scfsi[ch][i] = 1;\n }\n }\n var s1 = 0;\n var c1 = 0;\n for (sfb = 0; sfb < 11; sfb++) {\n if (gi.scalefac[sfb] == -1)\n continue;\n c1++;\n if (s1 < gi.scalefac[sfb])\n s1 = gi.scalefac[sfb];\n }\n var s2 = 0;\n var c2 = 0;\n for (; sfb < Encoder.SBPSY_l; sfb++) {\n if (gi.scalefac[sfb] == -1)\n continue;\n c2++;\n if (s2 < gi.scalefac[sfb])\n s2 = gi.scalefac[sfb];\n }\n\n for (var i = 0; i < 16; i++) {\n if (s1 < slen1_n[i] && s2 < slen2_n[i]) {\n var c = slen1_tab[i] * c1 + slen2_tab[i] * c2;\n if (gi.part2_length > c) {\n gi.part2_length = c;\n gi.scalefac_compress = i;\n }\n }\n }\n }\n\n /**\n * Find the optimal way to store the scalefactors. Only call this routine\n * after final scalefactors have been chosen and the channel/granule will\n * not be re-encoded.\n */\n this.best_scalefac_store = function (gfc, gr, ch, l3_side) {\n /* use scalefac_scale if we can */\n var gi = l3_side.tt[gr][ch];\n var sfb, i, j, l;\n var recalc = 0;\n\n /*\n * remove scalefacs from bands with ix=0. This idea comes from the AAC\n * ISO docs. added mt 3/00\n */\n /* check if l3_enc=0 */\n j = 0;\n for (sfb = 0; sfb < gi.sfbmax; sfb++) {\n var width = gi.width[sfb];\n j += width;\n for (l = -width; l < 0; l++) {\n if (gi.l3_enc[l + j] != 0)\n break;\n }\n if (l == 0)\n gi.scalefac[sfb] = recalc = -2;\n /* anything goes. */\n /*\n * only best_scalefac_store and calc_scfsi know--and only they\n * should know--about the magic number -2.\n */\n }\n\n if (0 == gi.scalefac_scale && 0 == gi.preflag) {\n var s = 0;\n for (sfb = 0; sfb < gi.sfbmax; sfb++)\n if (gi.scalefac[sfb] > 0)\n s |= gi.scalefac[sfb];\n\n if (0 == (s & 1) && s != 0) {\n for (sfb = 0; sfb < gi.sfbmax; sfb++)\n if (gi.scalefac[sfb] > 0)\n gi.scalefac[sfb] >>= 1;\n\n gi.scalefac_scale = recalc = 1;\n }\n }\n\n if (0 == gi.preflag && gi.block_type != Encoder.SHORT_TYPE\n && gfc.mode_gr == 2) {\n for (sfb = 11; sfb < Encoder.SBPSY_l; sfb++)\n if (gi.scalefac[sfb] < qupvt.pretab[sfb]\n && gi.scalefac[sfb] != -2)\n break;\n if (sfb == Encoder.SBPSY_l) {\n for (sfb = 11; sfb < Encoder.SBPSY_l; sfb++)\n if (gi.scalefac[sfb] > 0)\n gi.scalefac[sfb] -= qupvt.pretab[sfb];\n\n gi.preflag = recalc = 1;\n }\n }\n\n for (i = 0; i < 4; i++)\n l3_side.scfsi[ch][i] = 0;\n\n if (gfc.mode_gr == 2 && gr == 1\n && l3_side.tt[0][ch].block_type != Encoder.SHORT_TYPE\n && l3_side.tt[1][ch].block_type != Encoder.SHORT_TYPE) {\n scfsi_calc(ch, l3_side);\n recalc = 0;\n }\n for (sfb = 0; sfb < gi.sfbmax; sfb++) {\n if (gi.scalefac[sfb] == -2) {\n gi.scalefac[sfb] = 0;\n /* if anything goes, then 0 is a good choice */\n }\n }\n if (recalc != 0) {\n if (gfc.mode_gr == 2) {\n this.scale_bitcount(gi);\n } else {\n this.scale_bitcount_lsf(gfc, gi);\n }\n }\n }\n\n function all_scalefactors_not_negative(scalefac, n) {\n for (var i = 0; i < n; ++i) {\n if (scalefac[i] < 0)\n return false;\n }\n return true;\n }\n\n /**\n * number of bits used to encode scalefacs.\n *\n * 18*slen1_tab[i] + 18*slen2_tab[i]\n */\n var scale_short = [0, 18, 36, 54, 54, 36, 54, 72,\n 54, 72, 90, 72, 90, 108, 108, 126];\n\n /**\n * number of bits used to encode scalefacs.\n *\n * 17*slen1_tab[i] + 18*slen2_tab[i]\n */\n var scale_mixed = [0, 18, 36, 54, 51, 35, 53, 71,\n 52, 70, 88, 69, 87, 105, 104, 122];\n\n /**\n * number of bits used to encode scalefacs.\n *\n * 11*slen1_tab[i] + 10*slen2_tab[i]\n */\n var scale_long = [0, 10, 20, 30, 33, 21, 31, 41, 32, 42,\n 52, 43, 53, 63, 64, 74];\n\n /**\n * Also calculates the number of bits necessary to code the scalefactors.\n */\n this.scale_bitcount = function (cod_info) {\n var k, sfb, max_slen1 = 0, max_slen2 = 0;\n\n /* maximum values */\n var tab;\n var scalefac = cod_info.scalefac;\n\n\n if (cod_info.block_type == Encoder.SHORT_TYPE) {\n tab = scale_short;\n if (cod_info.mixed_block_flag != 0)\n tab = scale_mixed;\n } else { /* block_type == 1,2,or 3 */\n tab = scale_long;\n if (0 == cod_info.preflag) {\n for (sfb = 11; sfb < Encoder.SBPSY_l; sfb++)\n if (scalefac[sfb] < qupvt.pretab[sfb])\n break;\n\n if (sfb == Encoder.SBPSY_l) {\n cod_info.preflag = 1;\n for (sfb = 11; sfb < Encoder.SBPSY_l; sfb++)\n scalefac[sfb] -= qupvt.pretab[sfb];\n }\n }\n }\n\n for (sfb = 0; sfb < cod_info.sfbdivide; sfb++)\n if (max_slen1 < scalefac[sfb])\n max_slen1 = scalefac[sfb];\n\n for (; sfb < cod_info.sfbmax; sfb++)\n if (max_slen2 < scalefac[sfb])\n max_slen2 = scalefac[sfb];\n\n /*\n * from Takehiro TOMINAGA <[email protected]> 10/99 loop over *all*\n * posible values of scalefac_compress to find the one which uses the\n * smallest number of bits. ISO would stop at first valid index\n */\n cod_info.part2_length = QuantizePVT.LARGE_BITS;\n for (k = 0; k < 16; k++) {\n if (max_slen1 < slen1_n[k] && max_slen2 < slen2_n[k]\n && cod_info.part2_length > tab[k]) {\n cod_info.part2_length = tab[k];\n cod_info.scalefac_compress = k;\n }\n }\n return cod_info.part2_length == QuantizePVT.LARGE_BITS;\n }\n\n /**\n * table of largest scalefactor values for MPEG2\n */\n var max_range_sfac_tab = [[15, 15, 7, 7],\n [15, 15, 7, 0], [7, 3, 0, 0], [15, 31, 31, 0],\n [7, 7, 7, 0], [3, 3, 0, 0]];\n\n /**\n * Also counts the number of bits to encode the scalefacs but for MPEG 2\n * Lower sampling frequencies (24, 22.05 and 16 kHz.)\n *\n * This is reverse-engineered from section 2.4.3.2 of the MPEG2 IS,\n * \"Audio Decoding Layer III\"\n */\n this.scale_bitcount_lsf = function (gfc, cod_info) {\n var table_number, row_in_table, partition, nr_sfb, window;\n var over;\n var i, sfb;\n var max_sfac = new_int(4);\n//var partition_table;\n var scalefac = cod_info.scalefac;\n\n /*\n * Set partition table. Note that should try to use table one, but do\n * not yet...\n */\n if (cod_info.preflag != 0)\n table_number = 2;\n else\n table_number = 0;\n\n for (i = 0; i < 4; i++)\n max_sfac[i] = 0;\n\n if (cod_info.block_type == Encoder.SHORT_TYPE) {\n row_in_table = 1;\n var partition_table = qupvt.nr_of_sfb_block[table_number][row_in_table];\n for (sfb = 0, partition = 0; partition < 4; partition++) {\n nr_sfb = partition_table[partition] / 3;\n for (i = 0; i < nr_sfb; i++, sfb++)\n for (window = 0; window < 3; window++)\n if (scalefac[sfb * 3 + window] > max_sfac[partition])\n max_sfac[partition] = scalefac[sfb * 3 + window];\n }\n } else {\n row_in_table = 0;\n var partition_table = qupvt.nr_of_sfb_block[table_number][row_in_table];\n for (sfb = 0, partition = 0; partition < 4; partition++) {\n nr_sfb = partition_table[partition];\n for (i = 0; i < nr_sfb; i++, sfb++)\n if (scalefac[sfb] > max_sfac[partition])\n max_sfac[partition] = scalefac[sfb];\n }\n }\n\n for (over = false, partition = 0; partition < 4; partition++) {\n if (max_sfac[partition] > max_range_sfac_tab[table_number][partition])\n over = true;\n }\n if (!over) {\n var slen1, slen2, slen3, slen4;\n\n cod_info.sfb_partition_table = qupvt.nr_of_sfb_block[table_number][row_in_table];\n for (partition = 0; partition < 4; partition++)\n cod_info.slen[partition] = log2tab[max_sfac[partition]];\n\n /* set scalefac_compress */\n slen1 = cod_info.slen[0];\n slen2 = cod_info.slen[1];\n slen3 = cod_info.slen[2];\n slen4 = cod_info.slen[3];\n\n switch (table_number) {\n case 0:\n cod_info.scalefac_compress = (((slen1 * 5) + slen2) << 4)\n + (slen3 << 2) + slen4;\n break;\n\n case 1:\n cod_info.scalefac_compress = 400 + (((slen1 * 5) + slen2) << 2)\n + slen3;\n break;\n\n case 2:\n cod_info.scalefac_compress = 500 + (slen1 * 3) + slen2;\n break;\n\n default:\n System.err.printf(\"intensity stereo not implemented yet\\n\");\n break;\n }\n }\n if (!over) {\n cod_info.part2_length = 0;\n for (partition = 0; partition < 4; partition++)\n cod_info.part2_length += cod_info.slen[partition]\n * cod_info.sfb_partition_table[partition];\n }\n return over;\n }\n\n /*\n * Since no bands have been over-amplified, we can set scalefac_compress and\n * slen[] for the formatter\n */\n var log2tab = [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4,\n 4, 4, 4, 4];\n\n this.huffman_init = function (gfc) {\n for (var i = 2; i <= 576; i += 2) {\n var scfb_anz = 0, bv_index;\n while (gfc.scalefac_band.l[++scfb_anz] < i)\n ;\n\n bv_index = subdv_table[scfb_anz][0]; // .region0_count\n while (gfc.scalefac_band.l[bv_index + 1] > i)\n bv_index--;\n\n if (bv_index < 0) {\n /*\n * this is an indication that everything is going to be encoded\n * as region0: bigvalues < region0 < region1 so lets set\n * region0, region1 to some value larger than bigvalues\n */\n bv_index = subdv_table[scfb_anz][0]; // .region0_count\n }\n\n gfc.bv_scf[i - 2] = bv_index;\n\n bv_index = subdv_table[scfb_anz][1]; // .region1_count\n while (gfc.scalefac_band.l[bv_index + gfc.bv_scf[i - 2] + 2] > i)\n bv_index--;\n\n if (bv_index < 0) {\n bv_index = subdv_table[scfb_anz][1]; // .region1_count\n }\n\n gfc.bv_scf[i - 1] = bv_index;\n }\n }\n}", "title": "" }, { "docid": "abef641f8699ca7715ce4f68ae843094", "score": "0.5014969", "text": "function easeInOutQuad (t, b, c, d) {\n t /= d/2;\n if (t < 1) return c/2*t*t + b;\n t--;\n return -c/2 * (t*(t-2) - 1) + b;\n }", "title": "" }, { "docid": "215b2509bfd442d71293265c6ba1b9ae", "score": "0.5011625", "text": "function colorCube()\n{\n quad( 1, 0, 3, 2 );\n quad( 2, 3, 7, 6 );\n quad( 3, 0, 4, 7 );\n quad( 6, 5, 1, 2 );\n quad( 4, 5, 6, 7 );\n quad( 5, 4, 0, 1 );\n}", "title": "" }, { "docid": "f8f2a73202c02c60f8be65b35840a505", "score": "0.50084996", "text": "function d$1(t,d){t.resetState();const B=new x$U(t,{colorTarget:Y$i.TEXTURE,depthStencilTarget:V$A.NONE},{target:M$E.TEXTURE_2D,wrapMode:D$y.CLAMP_TO_EDGE,pixelFormat:P$J.RGBA,dataType:G$u.UNSIGNED_BYTE,samplingMode:L$F.NEAREST,width:1,height:1}),E=E$Z.createVertex(t,F$D.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),g=new a$1g(t,new Map([[\"position\",0]]),{geometry:[new t$1y(\"position\",2,C$K.UNSIGNED_SHORT,0,4)]},{geometry:E}),T=r$3z(5633261.287538229,2626832.878767164,1434988.0495278358),b=r$3z(5633271.46742708,2626873.6381334523,1434963.231608387),F=_$3(t,T,b,d);t.bindFramebuffer(B),t.setViewport(0,0,1,1),t.bindVAO(g),t.drawArrays(E$10.TRIANGLE_STRIP,0,4);const U=new Uint8Array(4);B.readPixels(0,0,1,1,P$J.RGBA,G$u.UNSIGNED_BYTE,U),F.dispose(),g.dispose(!1),E.dispose(),B.dispose();const w=(T[2]-b[2])/25,O=r$Z(U);return Math.abs(w-O)}", "title": "" }, { "docid": "0445392622ad0bdbbacbbc3461fa8b1b", "score": "0.50078833", "text": "function computeQuad(width, height)\n{\n // We are only in 2d space, so we can save a vertex coordinate\n // We are using draw coordinates here, not openGL conventions\n var quad = new Float32Array([\n 0.0, height, // bottom left\n 0.0, 0.0, //top left\n width, 0.0, // top right\n width, height, // bottom right\n ]);\n return quad;\n}", "title": "" }, { "docid": "cac41979e1bcc40f3801a3cf13eaeb2e", "score": "0.50031424", "text": "function t$b(t,s){const l=t.fragment;switch(s.doubleSidedMode){case i$G.None:l.code.add(n$1x`vec3 _adjustDoublesided(vec3 normal) {\nreturn normal;\n}`);break;case i$G.View:t.include(F$A,s),l.code.add(n$1x`vec3 _adjustDoublesided(vec3 normal) {\nreturn dot(normal, vPositionWorldCameraRelative) > 0.0 ? -normal : normal;\n}`);break;case i$G.WindingOrder:l.code.add(n$1x`vec3 _adjustDoublesided(vec3 normal) {\nreturn gl_FrontFacing ? normal : -normal;\n}`);break;default:n$4c(s.doubleSidedMode);case i$G.COUNT:}switch(s.normalType){case i$M.Attribute:case i$M.CompressedAttribute:t.include(n$V,s),l.code.add(n$1x`vec3 shadingNormalWorld() {\nreturn _adjustDoublesided(normalize(vNormalWorld));\n}\nvec3 shadingNormal_view() {\nvec3 normal = normalize(vNormalView);\nreturn gl_FrontFacing ? normal : -normal;\n}`);break;case i$M.ScreenDerivative:t.extensions.add(\"GL_OES_standard_derivatives\"),t.include(F$A,s),l.code.add(n$1x`vec3 shadingNormalWorld() {\nreturn normalize(cross(\ndFdx(vPositionWorldCameraRelative),\ndFdy(vPositionWorldCameraRelative)\n));\n}\nvec3 shadingNormal_view() {\nreturn normalize(cross(dFdx(vPosition_view),dFdy(vPosition_view)));\n}`);break;case i$M.Ground:s.spherical?(t.include(F$A,s),l.code.add(n$1x`vec3 shadingNormalWorld() {\nreturn normalize(positionWorld());\n}`)):l.code.add(n$1x`vec3 shadingNormalWorld() {\nreturn vec3(0.0, 0.0, 1.0);\n}`),t.extensions.add(\"GL_OES_standard_derivatives\"),l.code.add(n$1x`vec3 shadingNormal_view() {\nreturn normalize(cross(dFdx(vPosition_view),dFdy(vPosition_view))).xyz;\n}`);break;default:n$4c(s.normalType);case i$M.COUNT:}}", "title": "" }, { "docid": "f7e4bb192ae598b90b8cd30a312bf512", "score": "0.5001459", "text": "function c$1n(){const e=new o$1u;return e.attributes.add(O$O.POSITION,\"vec3\"),e.attributes.add(O$O.COLOR,\"vec4\"),e.attributes.add(O$O.SIZE,\"float\"),e.varyings.add(\"vcolor\",\"vec4\"),e.varyings.add(\"vsize\",\"float\"),e.vertex.uniforms.add([new e$1A(\"transform\",((e,o)=>m$14(e,o))),new e$1B(\"viewport\",((e,o)=>o.camera.fullViewport)),new o$1w(\"pixelRatio\",((e,o)=>o.camera.pixelRatio))]),e.include(c$1o),e.vertex.code.add(n$1x`void main(void) {\nvec4 posProj = transform * vec4(position, 0);\ngl_Position = alignToPixelCenter(posProj, viewport.zw);\nvcolor = color / 1.2;\nvsize = size * 5.0 * pixelRatio;\ngl_PointSize = vsize;\n}`),e.fragment.code.add(n$1x`void main() {\nfloat cap = 0.7;\nfloat scale = 1.0 / cap;\nfloat helper = clamp(length(abs(gl_PointCoord - vec2(0.5))), 0.0, cap);\nfloat alpha = clamp((cap - helper) * scale, 0.0, 1.0);\nfloat intensity = alpha * alpha * alpha;\nif (vsize < 3.0) {\nintensity *= 0.5;\n}\ngl_FragColor = vec4(vcolor.xyz, intensity);\n}`),e}", "title": "" }, { "docid": "8027a2f3580a4f385e349becc66f6ba1", "score": "0.50010407", "text": "function easeInOutQuad(t, b, c, d)\n{\n\tt = t/(d/2);\n\tif (t < 1) return c/2*t*t + b;\n\tt--;\n\treturn -c/2 * (t*(t-2) - 1) + b;\n}", "title": "" }, { "docid": "f6eb716adb93606fb6ac0bd75dc12090", "score": "0.4998209", "text": "function e$j(e,t){e.varyings.add(\"tbnTangent\",\"vec3\"),e.varyings.add(\"tbnBiTangent\",\"vec3\"),t.spherical?e.vertex.code.add(n$1x`void forwardVertexTangent(vec3 n) {\ntbnTangent = normalize(cross(vec3(0.0, 0.0, 1.0), n));\ntbnBiTangent = normalize(cross(n, tbnTangent));\n}`):e.vertex.code.add(n$1x`void forwardVertexTangent(vec3 n) {\ntbnTangent = vec3(1.0, 0.0, 0.0);\ntbnBiTangent = normalize(cross(n, tbnTangent));\n}`),e.fragment.code.add(n$1x`mat3 getTBNMatrix(vec3 n) {\nreturn mat3(tbnTangent, tbnBiTangent, n);\n}`);}", "title": "" }, { "docid": "666a59ccc6ccd66cc40622f6dc0bfeec", "score": "0.4997055", "text": "function i$3(i,o){const d=i.vertex;switch(i.attributes.add(O$O.SIDENESS,\"vec2\"),o.mode===w$5.MIXED?d.code.add(n$1x`struct UnpackedAttributes {\nvec2 sideness;\nvec2 sidenessNorm;\nfloat lineWidthPixels;\nfloat extensionLengthPixels;\nfloat type;\n};`):d.code.add(n$1x`struct UnpackedAttributes {\nvec2 sideness;\nvec2 sidenessNorm;\nfloat lineWidthPixels;\nfloat extensionLengthPixels;\n};`),o.mode){case w$5.MIXED:d.code.add(n$1x`UnpackedAttributes unpackAttributes(ComponentData component) {\nvec2 sidenessNorm = sideness;\nvec2 sideness = sidenessNorm * 2.0 - 1.0;\nfloat fType = component.type;\nfloat extensionLengthPixels = component.extensionLength;\nfloat lineWidth = component.lineWidth;\nif (fType <= 0.0) {\nextensionLengthPixels *= variantExtension * 2.0 - 1.0;\n}\nreturn UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels, fType);\n}`);break;case w$5.SKETCH:d.code.add(n$1x`UnpackedAttributes unpackAttributes(ComponentData component) {\nvec2 sidenessNorm = sideness;\nvec2 sideness = sidenessNorm * 2.0 - 1.0;\nfloat extensionLengthPixels = component.extensionLength;\nextensionLengthPixels *= variantExtension * 2.0 - 1.0;\nfloat lineWidth = component.lineWidth;\nreturn UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels);\n}`);break;case w$5.SOLID:d.code.add(n$1x`UnpackedAttributes unpackAttributes(ComponentData component) {\nvec2 sidenessNorm = sideness;\nvec2 sideness = sidenessNorm * 2.0 - 1.0;\nfloat extensionLengthPixels = component.extensionLength;\nfloat lineWidth = component.lineWidth;\nreturn UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels);\n}`);break;case w$5.COUNT:break;default:n$4c(o.mode);}}", "title": "" }, { "docid": "e41a66f4a4e9589f5990bd69d30536e7", "score": "0.4991939", "text": "function Qux() { }", "title": "" }, { "docid": "d56daf9d71e380df78c8c274faa3903c", "score": "0.49873614", "text": "get termType() {\n return 'Quad';\n }", "title": "" }, { "docid": "585e4d5117cdfdb068252124ae2dc4c7", "score": "0.4974491", "text": "function easeInOutQuad(t, b, c, d) {\n t /= d / 2;\n if (t < 1)\n return c / 2 * t * t + b;\n t--;\n return -c / 2 * (t * (t - 2) - 1) + b;\n}", "title": "" }, { "docid": "b98823ccbdf7413d64bf7579ccfe7953", "score": "0.49692228", "text": "import(stream) {\n var self = this;\n stream.on('data', function (quad) { self.addQuad(quad); });\n return stream;\n }", "title": "" }, { "docid": "efe9495dc1c71cc75b8e89f1236d0f34", "score": "0.49538046", "text": "function easeInOutQuad(t, b, c, d) {\n t /= d / 2;\n if (t < 1) return c / 2 * t * t + b;\n t--;\n return -c / 2 * (t * (t - 2) - 1) + b;\n }", "title": "" }, { "docid": "a9d2b17c7f6f146b846a9f09c8a87247", "score": "0.4945546", "text": "addQuads(quads) {\n for (var i = 0; i < quads.length; i++)\n this.addQuad(quads[i]);\n }", "title": "" }, { "docid": "a9d2b17c7f6f146b846a9f09c8a87247", "score": "0.4945546", "text": "addQuads(quads) {\n for (var i = 0; i < quads.length; i++)\n this.addQuad(quads[i]);\n }", "title": "" }, { "docid": "495867d38bdb1ecb8a9986af46b6a86f", "score": "0.494547", "text": "function quadTex()\n{\n var coords = [];\n texturecoords.push(texCoord[0]);\n texturecoords.push(texCoord[1]);\n texturecoords.push(texCoord[2]);\n texturecoords.push(texCoord[0]);\n texturecoords.push(texCoord[2]);\n texturecoords.push(texCoord[3]);\n\n coords.push(texCoord[0]);\n coords.push(texCoord[1]);\n coords.push(texCoord[2]);\n coords.push(texCoord[0]);\n coords.push(texCoord[2]);\n coords.push(texCoord[3]);\n return coords;\n}", "title": "" }, { "docid": "deb9cb99b0072dec2076f06f9312a4d0", "score": "0.49352488", "text": "function easeInOutQuad (t, b, c, d) {\n if ((t /= (d/2)) < 1) return c/2*t*t + b;\n return -c/2 * ((--t)*(t-2) - 1) + b;\n}", "title": "" }, { "docid": "33795a134a9577c6865c12afffae71c6", "score": "0.49264017", "text": "function easeInQuad( t ) {\n return t * t;\n}", "title": "" }, { "docid": "0b149f7bab745e3b67f84b7ab5d07292", "score": "0.49256134", "text": "function F$h(F){const _=new o$1u,{vertex:M,fragment:O}=_;switch(v$M(M,F),_.varyings.add(\"vpos\",\"vec3\"),_.include(n$y,F),F.output!==h$1c.Color&&F.output!==h$1c.Alpha||(_.include(r$1b,F),_.include(v$B,F),_.include(d$1k,F),_.varyings.add(\"vnormal\",\"vec3\"),_.varyings.add(\"vcolor\",\"vec4\"),F.hasMultipassTerrain&&_.varyings.add(\"depth\",\"float\"),M.code.add(n$1x`\n void main() {\n vpos = calculateVPos();\n vnormal = normalize(localNormal());\n\n ${F.hasMultipassTerrain?\"depth = (view * vec4(vpos, 1.0)).z;\":\"\"}\n gl_Position = transformPosition(proj, view, vpos);\n\n ${F.output===h$1c.Color?\"forwardLinearDepth();\":\"\"}\n\n vcolor = getColor();\n }\n `)),_.include(n$1n,F),F.output){case h$1c.Alpha:_.include(u$R,F),O.uniforms.add(new o$1w(\"opacity\",(e=>e.opacity))),O.code.add(n$1x`\n void main() {\n discardBySlice(vpos);\n ${F.hasMultipassTerrain?\"terrainDepthTest(gl_FragCoord, depth);\":\"\"}\n float combinedOpacity = vcolor.a * opacity;\n gl_FragColor = vec4(combinedOpacity);\n }\n `);break;case h$1c.Color:_.include(u$R,F),_.include(p$F,F),_.include(n$O,F),_.include(v$B,F),_.include(e$I,F),c$18(O,F),h$A(O),u$B(O),O.uniforms.add([M.uniforms.get(\"localOrigin\"),new e$1E(\"ambient\",(e=>e.ambient)),new e$1E(\"diffuse\",(e=>e.diffuse)),new e$1E(\"specular\",(e=>e.specular)),new o$1w(\"opacity\",(e=>e.opacity))]),O.include(e$1t),a$1m(O),O.code.add(n$1x`\n void main() {\n discardBySlice(vpos);\n ${F.hasMultipassTerrain?\"terrainDepthTest(gl_FragCoord, depth);\":\"\"}\n\n shadingParams.viewDirection = normalize(vpos - cameraPosition);\n shadingParams.normalView = vnormal;\n vec3 normal = shadingNormal(shadingParams);\n float ssao = evaluateAmbientOcclusionInverse();\n\n float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);\n vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;\n ${F.receiveShadows?\"float shadow = readShadowMap(vpos, linearDepth);\":F.spherical?\"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);\":\"float shadow = 0.0;\"}\n vec3 albedo = vcolor.rgb * max(ambient, diffuse); // combine the old material parameters into a single one\n float combinedOpacity = vcolor.a * opacity;\n albedo += 0.25 * specular; // don't completely ignore specular for now\n\n vec3 shadedColor = evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight);\n gl_FragColor = vec4(shadedColor, combinedOpacity);\n gl_FragColor = highlightSlice(gl_FragColor, vpos);\n ${F.transparencyPassType===o$V.Color?\"gl_FragColor = premultiplyAlpha(gl_FragColor);\":\"\"}\n }\n `);break;case h$1c.Depth:case h$1c.Shadow:case h$1c.ShadowHighlight:case h$1c.ShadowExludeHighlight:_.include(r$1b,F),i$1l(_),_.varyings.add(\"depth\",\"float\"),M.code.add(n$1x`void main() {\nvpos = calculateVPos();\ngl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);\n}`),_.include(u$R,F),_.include(o$L,F),O.code.add(n$1x`void main() {\ndiscardBySlice(vpos);\noutputDepth(depth);\n}`);break;case h$1c.Normal:_.include(r$1b,F),_.include(r$N,F),d$14(M),_.varyings.add(\"vnormal\",\"vec3\"),M.code.add(n$1x`void main(void) {\nvpos = calculateVPos();\nvnormal = normalize((viewNormal * vec4(localNormal(), 1.0)).xyz);\ngl_Position = transformPosition(proj, view, vpos);\n}`),_.include(u$R,F),O.code.add(n$1x`void main() {\ndiscardBySlice(vpos);\nvec3 normal = normalize(vnormal);\nif (gl_FrontFacing == false) normal = -normal;\ngl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);\n}`);break;case h$1c.Highlight:_.include(r$1b,F),_.include(r$N,F),_.varyings.add(\"vnormal\",\"vec3\"),M.code.add(n$1x`void main(void) {\nvpos = calculateVPos();\ngl_Position = transformPosition(proj, view, vpos);\n}`),_.include(u$R,F),_.include(a$U,F),O.code.add(n$1x`void main() {\ndiscardBySlice(vpos);\noutputHighlight();\n}`);}return _}", "title": "" }, { "docid": "26685309ff4b3370b3aa8ee381fb13a6", "score": "0.49176243", "text": "function nvgQuadTo(ctx, cx, cy, x, y) {\n bind.nvgQuadTo(ctx, cx, cy, x, y);\n }", "title": "" }, { "docid": "7af8c3a7eb4f163b08ba9aa3d3c30e4f", "score": "0.49118266", "text": "function I$l(I){const R=new o$1u,{vertex:z,fragment:k,varyings:G}=R;return v$M(z,I),R.include(o$1f),G.add(\"vpos\",\"vec3\"),R.include(s$Y,I),R.include(p$G,I),R.include(a$W,I),I.output!==h$1c.Color&&I.output!==h$1c.Alpha||(c$18(R.vertex,I),R.include(o$H,I),R.include(r$1b,I),I.offsetBackfaces&&R.include(e$H),I.instancedColor&&R.attributes.add(O$O.INSTANCECOLOR,\"vec4\"),G.add(\"vNormalWorld\",\"vec3\"),G.add(\"localvpos\",\"vec3\"),I.hasMultipassTerrain&&G.add(\"depth\",\"float\"),R.include(o$1x,I),R.include(d$1k,I),R.include(i$E,I),R.include(e$F,I),z.uniforms.add(new e$1B(\"externalColor\",(e=>e.externalColor))),G.add(\"vcolorExt\",\"vec4\"),z.code.add(n$1x`\n void main(void) {\n forwardNormalizedVertexColor();\n vcolorExt = externalColor;\n ${I.instancedColor?\"vcolorExt *= instanceColor;\":\"\"}\n vcolorExt *= vvColor();\n vcolorExt *= getSymbolColor();\n forwardColorMixMode();\n\n if (vcolorExt.a < ${n$1x.float(t$14)}) {\n gl_Position = vec4(1e38, 1e38, 1e38, 1.0);\n } else {\n vpos = calculateVPos();\n localvpos = vpos - view[3].xyz;\n vpos = subtractOrigin(vpos);\n vNormalWorld = dpNormal(vvLocalNormal(normalModel()));\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPosition(proj, view, vpos);\n ${I.offsetBackfaces?\"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);\":\"\"}\n }\n ${I.hasMultipassTerrain?n$1x`depth = (view * vec4(vpos, 1.0)).z;`:\"\"}\n forwardLinearDepth();\n forwardTextureCoordinates();\n }\n `)),I.output===h$1c.Alpha&&(R.include(u$R,I),R.include(s$I,I),R.include(n$1n,I),k.uniforms.add([new o$1w(\"opacity\",(e=>e.opacity)),new o$1w(\"layerOpacity\",(e=>e.layerOpacity))]),I.hasColorTexture&&k.uniforms.add(new f$1s(\"tex\",(e=>e.texture))),k.include(i$C),k.code.add(n$1x`\n void main() {\n discardBySlice(vpos);\n ${I.hasMultipassTerrain?n$1x`terrainDepthTest(gl_FragCoord, depth);`:\"\"}\n ${I.hasColorTexture?n$1x`\n vec4 texColor = texture2D(tex, ${I.hasColorTextureTransform?n$1x`colorUV`:n$1x`vuv0`});\n ${I.textureAlphaPremultiplied?\"texColor.rgb /= texColor.a;\":\"\"}\n discardOrAdjustAlpha(texColor);`:n$1x`vec4 texColor = vec4(1.0);`}\n ${I.hasVertexColors?n$1x`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:n$1x`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}\n\n gl_FragColor = vec4(opacity_);\n }\n `)),I.output===h$1c.Color&&(R.include(u$R,I),R.include(p$F,I),R.include(n$O,I),R.include(s$I,I),R.include(I.instancedDoublePrecision?h$D:v$B,I),R.include(n$1n,I),c$18(R.fragment,I),o$1v(k),h$A(k),u$B(k),k.uniforms.add([z.uniforms.get(\"localOrigin\"),z.uniforms.get(\"view\"),new e$1E(\"ambient\",(e=>e.ambient)),new e$1E(\"diffuse\",(e=>e.diffuse)),new o$1w(\"opacity\",(e=>e.opacity)),new o$1w(\"layerOpacity\",(e=>e.layerOpacity))]),I.hasColorTexture&&k.uniforms.add(new f$1s(\"tex\",(e=>e.texture))),R.include(x$W,I),R.include(n$S,I),k.include(i$C),R.extensions.add(\"GL_OES_standard_derivatives\"),a$1m(k),k.code.add(n$1x`\n void main() {\n discardBySlice(vpos);\n ${I.hasMultipassTerrain?n$1x`terrainDepthTest(gl_FragCoord, depth);`:\"\"}\n ${I.hasColorTexture?n$1x`\n vec4 texColor = texture2D(tex, ${I.hasColorTextureTransform?n$1x`colorUV`:n$1x`vuv0`});\n ${I.textureAlphaPremultiplied?\"texColor.rgb /= texColor.a;\":\"\"}\n discardOrAdjustAlpha(texColor);`:n$1x`vec4 texColor = vec4(1.0);`}\n vec3 viewDirection = normalize(vpos - cameraPosition);\n ${I.pbrMode===d$1p.Normal?\"applyPBRFactors();\":\"\"}\n float ssao = evaluateAmbientOcclusionInverse();\n ssao *= getBakedOcclusion();\n\n float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);\n vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;\n ${I.receiveShadows?\"float shadow = readShadowMap(vpos, linearDepth);\":I.spherical?\"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);\":\"float shadow = 0.0;\"}\n vec3 matColor = max(ambient, diffuse);\n ${I.hasVertexColors?n$1x`\n vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\n float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:n$1x`\n vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\n float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}\n ${I.snowCover?n$1x`albedo = mix(albedo, vec3(1), 0.9);`:n$1x``}\n ${n$1x`\n vec3 shadingNormal = normalize(vNormalWorld);\n albedo *= 1.2;\n vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);\n float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);\n float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);\n float treeRadialFalloff = vColor.r;\n float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);\n additionalLight += backLightFactor * mainLightIntensity;`}\n ${I.pbrMode===d$1p.Normal||I.pbrMode===d$1p.Schematic?I.spherical?n$1x`vec3 normalGround = normalize(vpos + localOrigin);`:n$1x`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:n$1x``}\n ${I.pbrMode===d$1p.Normal||I.pbrMode===d$1p.Schematic?n$1x`\n float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];\n ${I.snowCover?n$1x`\n mrr = vec3(0.0, 1.0, 0.04);\n emission = vec3(0.0);`:\"\"}\n\n vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:n$1x`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}\n gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);\n ${I.transparencyPassType===o$V.Color?n$1x`gl_FragColor = premultiplyAlpha(gl_FragColor);`:n$1x``}\n }\n `)),R.include(b$q,I),R}", "title": "" }, { "docid": "7cee8bf9159cc3ce53ef7081c5cb0682", "score": "0.49095896", "text": "function quadOutline(a, b, c, d, v)\n{\n var vertices = [\n vec4( -v, -v, v, 1.0 ),\n vec4( -v, v, v, 1.0 ),\n vec4( v, v, v, 1.0 ),\n vec4( v, -v, v, 1.0 ),\n vec4( -v, -v, -v, 1.0 ),\n vec4( -v, v, -v, 1.0 ),\n vec4( v, v, -v, 1.0 ),\n vec4( v, -v, -v, 1.0 )\n ];\n\n var t1 = subtract(vertices[b], vertices[a]);\n var t2 = subtract(vertices[c], vertices[b]);\n var normal = vec3(cross(t1, t2));\n\n var indices = [ a, b, c, d ];\n for ( var i = 0; i < indices.length; ++i ) {\n points.push( vertices[indices[i]] );\n normals.push(normal);\n }\n}", "title": "" }, { "docid": "87280d360f53217215d7535ed0c4524a", "score": "0.49035794", "text": "function _UnboxOptimizeCommand() {\n}", "title": "" }, { "docid": "08010384d4d20a086453bd0ac943365f", "score": "0.48986003", "text": "get termType() {\n return 'Quad';\n }", "title": "" }, { "docid": "08010384d4d20a086453bd0ac943365f", "score": "0.48986003", "text": "get termType() {\n return 'Quad';\n }", "title": "" }, { "docid": "08be03ec02d48318e735ec98fd2dc3a4", "score": "0.48881215", "text": "easeInOutQuad(t, b, c, d) {\n\t\tt /= d / 2;\n\t\tif (t < 1) return (c / 2) * t * t + b;\n\t\tt--;\n\t\treturn (-c / 2) * (t * (t - 2) - 1) + b;\n\t}", "title": "" } ]
b54816579f20ef7c9d6c2e921942703f
isExtend : a > Boolean
[ { "docid": "fae68b941d986aa0e8c635bb10b06ce3", "score": "0.793107", "text": "function isExtend(m) {\n return isFunctor(m)\n && hasAlg('extend', m)\n}", "title": "" } ]
[ { "docid": "7af2af6109764dba7889145a8b385919", "score": "0.73792815", "text": "isExtensible(o) {\n return false;\n }", "title": "" }, { "docid": "0707e2276203dfe049e92d77ca4d36f7", "score": "0.61771774", "text": "extend() {}", "title": "" }, { "docid": "fcf6771a69742fb8cf0e65379379da58", "score": "0.6163856", "text": "function testcase() {\n var o = new Object();\n\n if (Object.isExtensible(o) === true) {\n return true;\n }\n }", "title": "" }, { "docid": "c67a7db18deb7bf35ebbb77b4fd12dda", "score": "0.6103201", "text": "function isExtendOf(name, variable) {\n\t\tvar offset = typeof variable === 'object' && variable ? Object.getPrototypeOf(variable) : null,\n\t\t\tpattern = offset ? new RegExp('^' + name + '$') : null;\n\n\t\t// It is not quite feasible to compare the inheritance using `instanceof` (all constructors would have to\n\t\t// be registered somehow then) we simply compare the constructor function names.\n\t\t// As a side effect, this enables polymorphic to compare against the exact type (unless a developer has\n\t\t// altered the constructor name, which is not protected from overwriting)\n\t\twhile (offset && offset.constructor) {\n\t\t\tif (pattern.test(offset.constructor.name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\toffset = Object.getPrototypeOf(offset);\n\t\t}\n\n\t\treturn false;\n\t}", "title": "" }, { "docid": "2ccfc4597632d19d52668d57de24e554", "score": "0.60608315", "text": "['fantasy-land/extend'](e) {\n return this.extend(e);\n }", "title": "" }, { "docid": "84a98037c9d0e0a0510cb0701ecf502c", "score": "0.5923614", "text": "function extend(){\n var extended; // what to extend\n var deep = false;\n var i = 0;\n var length = arguments.length;\n if (length <= 1){\n extended = this;\n }\n else if ( Object.prototype.toString.call( arguments[0] ) === '[object Boolean]' ) {\n deep = arguments[0];\n extended = arguments[1];\n i = 2;\n }\n else {\n extended = arguments[0];\n i = 1;\n }\n\n // Merge the object into the extended object\n var merge = function (obj) {\n for ( var prop in obj ) {\n if ( Object.prototype.hasOwnProperty.call( obj, prop ) ) {\n // If deep merge and property is an object, merge properties\n if ( deep && Object.prototype.toString.call(obj[prop]) === '[object Object]' ) {\n extended[prop] = extend( true, extended[prop], obj[prop] );\n } else {\n extended[prop] = obj[prop];\n }\n }\n }\n };\n\n // Loop through each object and conduct a merge\n for ( ; i < length; i++ ) {\n var obj = arguments[i];\n merge(obj);\n }\n return extended;\n }", "title": "" }, { "docid": "b505bb526d79df96c0aa6f73e397edbb", "score": "0.57920206", "text": "extend(options) {\n if(typeof options === 'object' && options.constructor === Object && Object.hasOwnProperty.call(options.constructor.prototype, 'isPrototypeOf')){\n relatedFunction.customType.push(options);\n }else {\n throw new Error(\"the extend method's argument(options) is not a valid object!\");\n }\n }", "title": "" }, { "docid": "d628df2d4bac2188a74a84d2d1b0357f", "score": "0.5739537", "text": "function a(a,b,c){Object.keys(c).forEach(function(d){if(b[d]=c[d],\"function\"!=typeof c[d])throw new TypeError(\"extend: Method `\"+d+\"` is not a function\");Object.defineProperty(a.prototype,d,{configurable:!0,value:c[d]})})}", "title": "" }, { "docid": "60839a5c23f489c35b7bfa2faeddb483", "score": "0.56921184", "text": "function extend(a, b){\n\tvar p, type;\n\tfor(p in b) {\n\t\ttype = typeof b[p];\n\t\tif(type !== \"object\" && type !== \"function\") {\n\t\t\ta[p] = b[p];\n\t\t}\n\t}\n\treturn a;\n}", "title": "" }, { "docid": "4a5669ccb7b0dff6cf722eec93e31f2a", "score": "0.55948436", "text": "function extend(a,b){for(var prop in b){a[prop]=b[prop];}return a;}", "title": "" }, { "docid": "cde2d5711656e1221dc1446b542f8882", "score": "0.5523118", "text": "function extend(b, a) {\n var prop;\n if (b === undefined) {\n return a;\n }\n for (prop in a) {\n if (a.hasOwnProperty(prop) && b.hasOwnProperty(prop) === false) {\n b[prop] = a[prop];\n }\n }\n return b;\n}", "title": "" }, { "docid": "27a54722a03f0bf7de3086fa90d399ff", "score": "0.5518378", "text": "function ea(e,t){return e&&Xo.prototype.hasOwnProperty.call(e,t)}", "title": "" }, { "docid": "faaefaf4990bb24390ba658f3899c21a", "score": "0.54932505", "text": "function extend () {\n\n // Variables\n var extended = {};\n var deep = false;\n var i = 0;\n var length = arguments.length;\n\n // Check if a deep merge\n if ( Object.prototype.toString.call( arguments[0] ) === '[object Boolean]' ) {\n deep = arguments[0];\n i++;\n }\n\n // Merge the object into the extended object\n var merge = function (obj) {\n for ( var prop in obj ) {\n if ( Object.prototype.hasOwnProperty.call( obj, prop ) ) {\n // If deep merge and property is an object, merge properties\n if ( deep && Object.prototype.toString.call(obj[prop]) === '[object Object]' ) {\n extended[prop] = extend( true, extended[prop], obj[prop] );\n } else {\n extended[prop] = obj[prop];\n }\n }\n }\n };\n\n // Loop through each object and conduct a merge\n for ( ; i < length; i++ ) {\n var obj = arguments[i];\n merge(obj);\n }\n\n return extended;\n}", "title": "" }, { "docid": "808b14fd8bd9df3b1bd2cef5455ca93c", "score": "0.5485763", "text": "function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}", "title": "" }, { "docid": "808b14fd8bd9df3b1bd2cef5455ca93c", "score": "0.5485763", "text": "function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}", "title": "" }, { "docid": "808b14fd8bd9df3b1bd2cef5455ca93c", "score": "0.5485763", "text": "function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}", "title": "" }, { "docid": "6609892f957ee28be6fdf0aa04c242ba", "score": "0.5473001", "text": "hasInheritance(node) {\n let inherits = false;\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (match_1.default(child, 'extends', 'implements')) {\n inherits = true;\n }\n }\n return inherits;\n }", "title": "" }, { "docid": "6442197994b95ad5fc8a21133ba94915", "score": "0.5462776", "text": "get allowsExtensions() {\n return this._memoize('allowsExtensions', () => {\n if (this.originalTagName === '#') {\n return false\n }\n const extensionAllowedAttribute = 'extensionAllowed'\n if (this.hasAttribute(extensionAllowedAttribute)) {\n return true\n }\n return getTagLevels(this.formattedTag).some((tagSubstring) =>\n this.schema.tagHasAttribute(tagSubstring, extensionAllowedAttribute),\n )\n })\n }", "title": "" }, { "docid": "20ec3af9eb2d390b053910f7682b665a", "score": "0.54438215", "text": "function extend(a, b) {\r\n // a type of inheritance strategy\r\n for (var name in b) {\r\n if (b.hasOwnProperty(name)) {\r\n a[name] = b[name];\r\n }\r\n }\r\n }", "title": "" }, { "docid": "b82483aa8f7df2d815d84697ecc299bb", "score": "0.54195225", "text": "function test_NON_EXTENSIBLES_EXTENSIBLE() {\n var someVar = 33;\n var a = void 0;\n function Obj() {\n this.x = 0;\n Object.preventExtensions(this);\n }\n var i = 0;\n function test() {\n var A = new Obj();\n a = A;\n while (i < 2000) {\n i++;\n if (Object.isExtensible(A)) {\n return;\n }\n }\n A.length1 = someVar;\n }\n try {\n test();\n } catch (e) {\n if (e instanceof TypeError && i === 2000) {\n return false;\n } else {\n return 'Unexpected error: ' + e;\n }\n }\n try {\n a.randomProperty = someVar;\n a.length1 = someVar;\n } catch (e2) {\n return 'Extending failed: ' + e2;\n }\n if (a.randomProperty !== someVar || a.length1 !== someVar) {\n return 'Did not extend correctly: ' + a;\n }\n return true;\n }", "title": "" }, { "docid": "4dfab84f2ca50cbdfa20df78bfa18ddb", "score": "0.54116964", "text": "get extensible() {\n\t\treturn this.__extensible;\n\t}", "title": "" }, { "docid": "e18471d706a011d7f49502e147e100dc", "score": "0.54002696", "text": "function isInheritable(obj) {\n\t\treturn obj && typeof obj === 'object' && !(obj instanceof RegExp || obj instanceof Array);\n\t}", "title": "" }, { "docid": "03d01a24236dd953a58eb64c05cc0b49", "score": "0.5361281", "text": "function extend( a, b ) {\n\n\t\tfor( var i in b ) {\n\t\t\ta[ i ] = b[ i ];\n\t\t}\n\n\t}", "title": "" }, { "docid": "03d01a24236dd953a58eb64c05cc0b49", "score": "0.5361281", "text": "function extend( a, b ) {\n\n\t\tfor( var i in b ) {\n\t\t\ta[ i ] = b[ i ];\n\t\t}\n\n\t}", "title": "" }, { "docid": "6a2a61e7656aca2f5d92d0444ead9135", "score": "0.533394", "text": "function has_sub_extension(e) {\n\t//if(process.env.DEBUG_MVC) {\n\t//\tdebug.log('has_sub_extension(', e, ')');\n\t//}\n\tdebug.assert(e).is('string');\n\treturn function has_sub_extension_2(p) {\n\t\tvar name = PATH.basename(p, PATH.extname(p));\n\t\treturn PATH.extname(name) === e;\n\t};\n}", "title": "" }, { "docid": "b768f85cd255ba4e8fb7a438509a8795", "score": "0.53309387", "text": "static __extend () {\n var crm = this\n var extended = {}\n var deep = false\n var i = 0\n var length = arguments.length\n\n // Check if a deep merge\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\n deep = arguments[0]\n i++\n }\n\n // Merge the object into the extended object\n var merge = function (obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n // If deep merge and property is an object, merge properties\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\n extended[prop] = crm.__extend(true, extended[prop], obj[prop])\n } else {\n extended[prop] = obj[prop]\n }\n }\n }\n }\n\n // Loop through each object and conduct a merge\n for (; i < length; i++) {\n var obj = arguments[i]\n merge(obj)\n }\n\n return extended\n }", "title": "" }, { "docid": "5bd9616ecac81bf1322975e3b7229a11", "score": "0.5304243", "text": "function extend( a, b ){\n for( var key in b )\n if( b.hasOwnProperty(key) )\n a[key] = b[key];\n return a;\n}", "title": "" }, { "docid": "5bd9616ecac81bf1322975e3b7229a11", "score": "0.5304243", "text": "function extend( a, b ){\n for( var key in b )\n if( b.hasOwnProperty(key) )\n a[key] = b[key];\n return a;\n}", "title": "" }, { "docid": "0e4a329657707d5a9746832a5c336141", "score": "0.5280895", "text": "function extend (base, extension) {\n if (isUndefined(base)) {\n return copy(extension);\n }\n if (isUndefined(extension)) {\n return copy(base);\n }\n if (isPureObject(base) && isPureObject(extension)) {\n return utils.extendDeep(base, extension);\n }\n return copy(extension);\n }", "title": "" }, { "docid": "0e4a329657707d5a9746832a5c336141", "score": "0.5280895", "text": "function extend (base, extension) {\n if (isUndefined(base)) {\n return copy(extension);\n }\n if (isUndefined(extension)) {\n return copy(base);\n }\n if (isPureObject(base) && isPureObject(extension)) {\n return utils.extendDeep(base, extension);\n }\n return copy(extension);\n }", "title": "" }, { "docid": "d21a4c7c7e2e557a751af9080ac332fe", "score": "0.5279074", "text": "function isAlternative(m) {\n return isPlus(m)\n && isApplicative(m)\n}", "title": "" }, { "docid": "702265df8b122e759c153c66db17db27", "score": "0.527391", "text": "function extend(a, b) {\n for (let i in b) {\n if (b.hasOwnProperty(i)) {\n const g = Object.getOwnPropertyDescriptor(b, i).get;\n const s = Object.getOwnPropertyDescriptor(b, i).set;\n\n if (g || s) {\n if (g && s) {\n Object.defineProperty(a, i, {\n get: g,\n set: s\n });\n } else if (g) {\n Object.defineProperty(a, i, {\n get: g\n });\n } else {\n Object.defineProperty(a, i, {\n set: s\n });\n }\n } else {\n a[i] = b[i];\n }\n }\n }\n return a;\n }", "title": "" }, { "docid": "ff4170c0d8f7512c15d1459e1b18afd1", "score": "0.5256347", "text": "function baseExtendClass() {}", "title": "" }, { "docid": "32947ba8cddf30d75b1ad58e86d95a83", "score": "0.5204373", "text": "GetIsOverridable() {}", "title": "" }, { "docid": "72d2c1e6c3782a9929ec79b63255a46d", "score": "0.5203154", "text": "function extend( a, b ) {\n for( var key in b ) { \n if( b.hasOwnProperty( key ) ) {\n a[key] = b[key];\n }\n }\n return a;\n }", "title": "" }, { "docid": "19d7b7527cc8b817bb8db6557c0b3c1d", "score": "0.5175265", "text": "function extendMandadory(original, extendObj) {\n return _.extend(original, extendObj);\n}", "title": "" }, { "docid": "150bf7ca343f7905b048d415090225e1", "score": "0.51684916", "text": "function extend(a, b) {\r\r\n for (var prop in b) {\r\r\n a[prop] = b[prop];\r\r\n }\r\r\n return a;\r\r\n }", "title": "" }, { "docid": "31c18c93876865d285ec0c0e4d294009", "score": "0.5164393", "text": "function extend( a, b ) {\n for( var key in b ) { \n if( b.hasOwnProperty( key ) ) {\n a[key] = b[key];\n }\n }\n return a;\n}", "title": "" }, { "docid": "31c18c93876865d285ec0c0e4d294009", "score": "0.5164393", "text": "function extend( a, b ) {\n for( var key in b ) { \n if( b.hasOwnProperty( key ) ) {\n a[key] = b[key];\n }\n }\n return a;\n}", "title": "" }, { "docid": "24e32045ef02559fe5db4b8ce3b49a2c", "score": "0.5164337", "text": "function has_extension(e) {\n\t//if(process.env.DEBUG_MVC) {\n\t//\tdebug.log('has_extension(', e, ')');\n\t//}\n\tdebug.assert(e).is('string');\n\treturn function has_extension_2(p) {\n\t\treturn PATH.extname(p) === e;\n\t};\n}", "title": "" }, { "docid": "4b7c06fb410b5c50ee533106147db336", "score": "0.51530004", "text": "function extend( a, b ) {\n\t for ( var prop in b ) {\n\t a[ prop ] = b[ prop ];\n\t }\n\t return a;\n\t}", "title": "" }, { "docid": "4b7c06fb410b5c50ee533106147db336", "score": "0.51530004", "text": "function extend( a, b ) {\n\t for ( var prop in b ) {\n\t a[ prop ] = b[ prop ];\n\t }\n\t return a;\n\t}", "title": "" }, { "docid": "4b7c06fb410b5c50ee533106147db336", "score": "0.51530004", "text": "function extend( a, b ) {\n\t for ( var prop in b ) {\n\t a[ prop ] = b[ prop ];\n\t }\n\t return a;\n\t}", "title": "" }, { "docid": "4b7c06fb410b5c50ee533106147db336", "score": "0.51530004", "text": "function extend( a, b ) {\n\t for ( var prop in b ) {\n\t a[ prop ] = b[ prop ];\n\t }\n\t return a;\n\t}", "title": "" }, { "docid": "4b7c06fb410b5c50ee533106147db336", "score": "0.51530004", "text": "function extend( a, b ) {\n\t for ( var prop in b ) {\n\t a[ prop ] = b[ prop ];\n\t }\n\t return a;\n\t}", "title": "" }, { "docid": "82123d9a46213b7d56284f746e7fe6ae", "score": "0.5152903", "text": "function extendDeep() {\n return FRAMEWORK.extend.apply(this, [true].concat([].slice.call(arguments)));\n }", "title": "" }, { "docid": "769a8b0b23b24e5856b1c144e7068038", "score": "0.51469153", "text": "function extend( a, b ) {\r\n for ( var prop in b ) {\r\n a[ prop ] = b[ prop ];\r\n }\r\n return a;\r\n}", "title": "" }, { "docid": "04e90a69d6a7f5d522fb3cccccdd2dc8", "score": "0.51326996", "text": "function extend(a, b)\n\t{\n\t\tfor (var prop in b)\n\t\t{\n\t\t\ta[prop] = b[prop];\n\t\t}\n\t\treturn a;\n\t}", "title": "" }, { "docid": "ceb925791fef0c8ee65045254976475a", "score": "0.5122639", "text": "function extend(a, b) {\n for (var prop in b) {\n a[prop] = b[prop];\n }\n return a;\n }", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" }, { "docid": "0458080f62f68d580e569679587efd72", "score": "0.5113265", "text": "function extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}", "title": "" } ]
6a5d404c3fe4e7ff1a7d47bbd5ac40af
Returns the most recent camera frame texture.
[ { "docid": "558ec4ceffc22b9897e4707f043421d5", "score": "0.7684672", "text": "cameraFrameTextureGL() {\n return this._z.pipeline_camera_frame_texture_gl(this._impl);\n }", "title": "" } ]
[ { "docid": "b292e905b01731f780ca557d5628f800", "score": "0.67493147", "text": "getFrameTexture(frameID) {\n if (frameID < 0 || frameID >= this.numFrames)\n throw new Error('[ArgumentError] Invalid frame id')\n return this._frames[frameID].texture\n }", "title": "" }, { "docid": "e3a4920c1f70da40303f945bf5f34b85", "score": "0.6710975", "text": "get _texture_raw() {\n\t\ttry {\n\t\t\treturn map_sprite.Back[this._raw.bS][\"back\"][this._raw.no];\n\t\t}\n\t\tcatch (ex) {\n\t\t\tdebugger;\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "bb055176a50f17370892607dc0744507", "score": "0.65008426", "text": "get _texture_raw() {\n\t\ttry {\n\t\t\treturn map_sprite.Back[this._raw.bS][\"ani\"][this._raw.no];\n\t\t}\n\t\tcatch (ex) {\n\t\t\tdebugger;\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "3ce24a6aea4f05e07c71e94241fe1933", "score": "0.6146867", "text": "get _texture_raw() {\n\t\ttry {\n\t\t\treturn map_sprite.Obj[this._raw.oS][this._raw.l0][this._raw.l1][this._raw.l2];\n\t\t}\n\t\tcatch (ex) {\n\t\t\tdebugger;\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "eec8ae520a1cba8348d5c913a8f21b46", "score": "0.61080253", "text": "get TextureId() {\n return ImGuiContext.getTexture(this.native.TextureId);\n }", "title": "" }, { "docid": "37098ccd97e037cc47acd1702c758307", "score": "0.60890543", "text": "get texture() {\n return textureAsset.getGFXTexture();\n }", "title": "" }, { "docid": "b64bc495a4801bb86a845785b6d388d4", "score": "0.6081193", "text": "get _texture_raw() {\n\t\ttry{\n\t\t\treturn map_sprite.Tile[this._info.tS][this._raw.u][this._raw.no];\n\t\t}\n\t\tcatch (ex) {\n\t\t\tdebugger;\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "e5166a0add1e2ec4df6a364174602ef4", "score": "0.60005116", "text": "get _texture_raw() {\n\t\ttry {\n\t\t\treturn this._pts[this.type];\n\t\t}\n\t\tcatch (ex) {\n\t\t\tdebugger;\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "3001e4671aded1b3d1e5a767f5fdcbf5", "score": "0.5916289", "text": "get TextureId() { return this.native.TextureId; }", "title": "" }, { "docid": "e187ac2182c1c842c68d33c9855edeff", "score": "0.59063864", "text": "drawFirstFrame() {\n const url = this.materials.getFrame(0);\n const texture = this.getAsset(url);\n this.draw({ texture });\n this.setDisplaySize();\n }", "title": "" }, { "docid": "fcd4d76c555b95b91ad43e5c12118be9", "score": "0.5778827", "text": "get sRGBTexture() {}", "title": "" }, { "docid": "4dc121adb829ff34f83257293edcd9bf", "score": "0.5778438", "text": "get canvasTexture() {\n let texture = this.app.renderer.generateTexture(this.app.stage, undefined, undefined, this.app.screen);\n return texture;\n }", "title": "" }, { "docid": "1061f0f683fd49b845351932a2cb64d8", "score": "0.57549816", "text": "async getUncachedSnapshot() {\n await this.camera.requestSnapshotUpdate()\n await utils.sleep(1)\n const newSnapshot = await this.camera.restClient.request({\n url: clientApi(`snapshots/image/${this.camera.id}`),\n responseType: 'buffer',\n })\n return newSnapshot\n }", "title": "" }, { "docid": "4cc5818ae925a5d61e59ecc933261923", "score": "0.5671644", "text": "frame(source, x, y, width, height) {\n\n let texture, imageFrame;\n\n //If the source is a string, it's either a texture in the\n //cache or an image file\n if (typeof source === \"string\") {\n if (this.TextureCache[source]) {\n texture = new this.Texture(this.TextureCache[source]);\n }\n }\n\n //If the `source` is a texture, use it\n else if (source instanceof this.Texture) {\n texture = new this.Texture(source);\n }\n if (!texture) {\n console.log(`Please load the ${source} texture into the cache.`);\n } else {\n\n //Make a rectangle the size of the sub-image\n imageFrame = new this.Rectangle(x, y, width, height);\n texture.frame = imageFrame;\n return texture;\n }\n }", "title": "" }, { "docid": "0867cb7309cdd580729c26c9af960017", "score": "0.56712127", "text": "get textureType() {}", "title": "" }, { "docid": "a88c6688409b3428eb7873b732c3505d", "score": "0.5649065", "text": "function frame(source, x, y, width, height) {\n let texture, imageFrame;\n \n //If the source is a string, it's either a texture in the\n //cache or an image file\n if (typeof source === \"string\") {\n if (resources[source].texture){\n texture = new Texture(resources[source].texture);\n }\n }\n //If the source is a texture, use it\n else if (source instanceof Texture) {\n texture = new Texture(source);\n }\n \n if(!texture) {\n console.log(`Please load the ${source} texture into the cache.`);\n } else {\n //Make a rectangle the size of the sub-image\n imageFrame = new Rectangle(x, y, width, height);\n texture.frame = imageFrame;\n return texture;\n }\n}", "title": "" }, { "docid": "c8ddaf6d26960adc56c7760b297e26fe", "score": "0.5619914", "text": "getFrame(frameNumber) {\n if (frameNumber < 1 || frameNumber > this.currentFrame) {\n return null;\n }\n return this.frames[frameNumber - 1];\n }", "title": "" }, { "docid": "51fd7d146149767ce8caeccbf8cfbc0c", "score": "0.5610414", "text": "function getLastPlayerPic() {\n playerPics.unshift(playerPics.pop());\n let pic = playerPics.pop();\n playerPics.push(pic);\n return pic;\n}", "title": "" }, { "docid": "babc7dc9c3ab7d137abe260f8c538df4", "score": "0.5603537", "text": "getMaxTextureSize(){\n return this.getParameter(this.gl.MAX_TEXTURE_SIZE);\n }", "title": "" }, { "docid": "520de93965859dfaf078089e08ef2f30", "score": "0.5598653", "text": "getTexture( textureMap, id ) {\n\n \t\t// if the texture is a layered texture, just use the first layer and issue a warning\n \t\tif ( 'LayeredTexture' in fbxTree.Objects && id in fbxTree.Objects.LayeredTexture ) {\n\n \t\t\tconsole.warn( 'THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer.' );\n \t\t\tid = connections.get( id ).children[ 0 ].ID;\n\n \t\t}\n\n \t\treturn textureMap.get( id );\n\n \t}", "title": "" }, { "docid": "59b46152c3d580d46b83427339b0c3d0", "score": "0.55898535", "text": "getMaxTextureSize() {\r\n return this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE);\r\n }", "title": "" }, { "docid": "f8fe7c8b4efaaed42a7af23503495b7b", "score": "0.5505933", "text": "function getTexture( FBXTree, textureMap, id, connections ) {\n\n\t\t// if the texture is a layered texture, just use the first layer and issue a warning\n\t\tif ( 'LayeredTexture' in FBXTree.Objects && id in FBXTree.Objects.LayeredTexture ) {\n\n\t\t\tconsole.warn( 'THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer.' );\n\t\t\tid = connections.get( id ).children[ 0 ].ID;\n\n\t\t}\n\n\t\treturn textureMap.get( id );\n\n\t}", "title": "" }, { "docid": "1037ae9a3500a256ccef9b999f4f9980", "score": "0.546974", "text": "function getTexture(name) {\n\treturn textures[name];\n}", "title": "" }, { "docid": "1e0c48a673f2c652cc5c2120298b8ffc", "score": "0.546829", "text": "function captureCurrentFrame(videoElement){\n return getTempCanvasAndContext(videoElement).canvas.toDataURL('image/png');\n }", "title": "" }, { "docid": "da3f404a635c7982065ef900d643df32", "score": "0.5447525", "text": "getFrame(isLastFrame)\n {\n let newFrame = Object.assign({}, this.lastFrame());\n\n if (isLastFrame)\n {\n // Reset position\n newFrame.position = 0;\n // Transition to next frame\n this.lastLerp = this.lastLerp - this.lastFrame().position;\n }\n\n return spring(newFrame.position, this.target, newFrame.velocity, this.mass, this.damping);\n }", "title": "" }, { "docid": "8c27421b015e112510f42fbaf65440ef", "score": "0.5443375", "text": "getCurrentImageInfo() {\n\t\treturn this.gameImages[ this.imageIndex ];\n\t}", "title": "" }, { "docid": "edb3e242b7aafa69d672e44fddfcb496", "score": "0.5430656", "text": "get TexID() {\n return ImGuiContext.getTexture(this.native.TexID);\n }", "title": "" }, { "docid": "45e12f5857edc87f20ce30e34e0e8812", "score": "0.542537", "text": "getRGBABufferOfFrame() {\n return this._enc.getBufferOfFrame();\n }", "title": "" }, { "docid": "dab7918950c5433c9ff86729b4d83a25", "score": "0.5412273", "text": "get texture() { return this[PAGE]; }", "title": "" }, { "docid": "54b466627962cac29294003e34f479e4", "score": "0.54096264", "text": "function readCamera() {\n ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, 300, 150);\n\n }", "title": "" }, { "docid": "c5941b9dbf43d5c57bf12f55a641f63b", "score": "0.54004204", "text": "cameraFrameTextureMatrix(renderWidth, renderHeight, mirror) {\n return this._z.pipeline_camera_frame_texture_matrix(this._impl, renderWidth, renderHeight, mirror === true);\n }", "title": "" }, { "docid": "2e94b4e24dc08f6d7ff2cf5618f21bbb", "score": "0.535001", "text": "function temperatureTexture( texture, time ) {\n\n var pixels = texture.image.data;\n\n var p = 0;\n for ( var i = 0; i < WIDTH; i++ ) {\n for ( var j = 0; j < WIDTH; j++ ) {\n\n var height = window.arrData[time][i][j]['T'] * 10;\n\n pixels[ p + 0 ] = height;\n pixels[ p + 1 ] = height;\n pixels[ p + 2 ] = height;\n pixels[ p + 3 ] = height;\n\n p += 4;\n }\n }\n }", "title": "" }, { "docid": "ab6056b78aa1b7e021a8ccb5fcacb900", "score": "0.53167284", "text": "getFrame(isLastFrame)\n {\n return Object(_SimulatorBase__WEBPACK_IMPORTED_MODULE_1__[\"spring\"])(this.lastFrame().position, this.target, this.lastFrame().velocity, this.mass, this.damping);\n }", "title": "" }, { "docid": "57e3363914d65e4c9451b4c9c575c0bb", "score": "0.5302061", "text": "getLastFrameStatistics() {\n return this.getAsPlainObject(true);\n }", "title": "" }, { "docid": "ac5d0afa52ef6f2df13b8d202edd62b2", "score": "0.5298795", "text": "function getPicture() {\n if (gameState === GameState.WIN) {\n return pictureStates[maxLives + 1];\n } else if (gameState === GameState.LOSE) {\n //technically this is redundant but makes it clearer \n return pictureStates[maxLives];\n } else {\n return pictureStates[maxLives - lives];\n }\n}", "title": "" }, { "docid": "a69c75b201df9b5af3e807a73b6389da", "score": "0.5291282", "text": "get textureUid() {\r\n return this._data.uid;\r\n }", "title": "" }, { "docid": "ebe723b5e2f9e68e18e8484d049d5dc2", "score": "0.5287535", "text": "function getActiveCamera() {\n return activeCamera;\n }", "title": "" }, { "docid": "7a066368f70d1a9101ffbaedc055729f", "score": "0.5285439", "text": "function getActiveCamera()\t{\n return activeCamera;\n }", "title": "" }, { "docid": "b095611aa8b6ce79a3e70e68c8b56c7b", "score": "0.5269993", "text": "function loadReflectiveTexture(url) {\n function callback(material) {\n if(material) {\n material.envMap = texture;\n material.needsUpdate = true;\n }\n }\n let texture = cubeTextureLoader.load(url, callback);\n texture.anisotropy = renderer.capabilities.getMaxAnisotropy(); // Max reduction in texture blur at glancing angles\n texture.encoding = THREE.sRGBEncoding;\n texture.flipY = false;\n return texture;\n}", "title": "" }, { "docid": "c72594880a6c01dbe81d0989b9274d6e", "score": "0.5267271", "text": "getFrame(InputImage,frame) {\n return smoothreslice.imageExtractFrame(InputImage,frame);\n }", "title": "" }, { "docid": "0fe3f94acf7d3a10cef706cc0d73682d", "score": "0.52602786", "text": "getMoment(frame) {\n var frameIndex = this.moments[0].state.frame - frame;\n assert(\n frameIndex >= 0,\n `The frame ${frame} was newer than the last frame ${this.moments[0].state.frame}`\n );\n assert(\n frameIndex < this.moments.length,\n `The frame ${frame} was too old! (max ${this.moments.length})`\n );\n return this.moments[frameIndex];\n }", "title": "" }, { "docid": "1a0bb98633dcd2c48a06526916e525d2", "score": "0.5254042", "text": "get currentFrame() {\n return this._frames[this._currentFrame];\n }", "title": "" }, { "docid": "fb09b6414b7106888d6ca7b3723e60d6", "score": "0.52436954", "text": "getCurrentTerrain(){\n\t\tvar bestTerrain = null;\n\t\tfor (var i = 0; i < this.collidedActors.length; i++){\n\t\t\tif (this.collidedActors[i] instanceof TerrainActor){\n\t\t\t\tif (bestTerrain == null){\n\t\t\t\t\tbestTerrain = this.collidedActors[i];\n\t\t\t\t}\n\t\t\t\telse if (bestTerrain.layer < this.collidedActors[i].layer){\n\t\t\t\t\tbestTerrain = this.collidedActors[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn bestTerrain;\n\t}", "title": "" }, { "docid": "0fc8bea42867c52f28f9f2f20fb595e7", "score": "0.52351856", "text": "get image() {\n return this._backbufferResource ? this._backbufferResource : this._image;\n }", "title": "" }, { "docid": "908c7ff57a403aa78611d44fd1941050", "score": "0.52313036", "text": "function getFrame(frame) {\n return allHeadTurns[frame.data('identifier')];\n }", "title": "" }, { "docid": "a39c50739291d3875409d49c17622679", "score": "0.52246445", "text": "function getCameraData() {\n if (mediaStream || kinect) {\n rawContext.drawImage(video, 0, 0, rawCanvas.width, rawCanvas.height);\n stackBlurCanvasRGB('rawCanvas', 0, 0, rawCanvas.width, rawCanvas.height, STACK_BLUR_RADIUS); \n var pixelData = rawContext.getImageData(0, 0, rawCanvas.width, rawCanvas.height);\n return pixelData;\n } \n}", "title": "" }, { "docid": "fa76be22fb981e2d8435e1557f837907", "score": "0.5214389", "text": "getFrame(isLastFrame)\n {\n let newFrame = Object.assign({}, this.lastFrame());\n\n if (isLastFrame)\n {\n // Reset position\n newFrame.position = 0;\n // Transition to next frame\n this.lastLerp = this.lastLerp - this.lastFrame().position;\n }\n\n return Object(_SimulatorBase__WEBPACK_IMPORTED_MODULE_1__[\"spring\"])(newFrame.position, this.target, newFrame.velocity, this.mass, this.damping);\n }", "title": "" }, { "docid": "a6f39e7f69f58b19cec20febeab741e4", "score": "0.52043563", "text": "get textureShape() {}", "title": "" }, { "docid": "87608b4396597323b06c8c6963145262", "score": "0.5166817", "text": "getVideoFrameByTime(req, res) {\n let time = req.params.time;\n let cameraName = req.params.cameraName;\n cameraName = formURLFromCameraName(cameraName);\n dngCameraService.loadVideoFrameFromUrl(cameraName).then((listOfVideoFrames) => {\n let videoFrame = null;\n if (time === 'now') {\n videoFrame = dngCameraService.getLastestVideoFrame(listOfVideoFrames);\n } else {\n videoFrame = dngCameraService.getVideoFrameAt(listOfVideoFrames, time);\n }\n res.json(videoFrame);\n }).catch((err) => {\n console.log(err);\n res.status(500).json(err);\n });;\n }", "title": "" }, { "docid": "9159fe587ff827dea6aa4863a5f86da5", "score": "0.515944", "text": "static get CAPTURE_FRAMES() { return _CAPTURE_FRAMES; }", "title": "" }, { "docid": "2b3522b143eccf749890107d5b87f441", "score": "0.514571", "text": "getCurrentFrame() {\r\n return this.frames[this.index]\r\n }", "title": "" }, { "docid": "0209dbe1f1d5c18a1d31a7319733d5b2", "score": "0.5140991", "text": "getCurrentState() {\n // check if there is any game history, and return the last game state\n // entry if there is\n var l = this.history.length;\n if (l == 0) {\n return null;\n }\n else {\n return this.history[l-1].state;\n }\n }", "title": "" }, { "docid": "a7e4493cfce11eed62fc4b99f9b73af9", "score": "0.51287645", "text": "get texture_map2() {\r\n\r\n const t00 = [0,0];\r\n const t01 = [0,2];\r\n const t10 = [2,0];\r\n const t11 = [2,2];\r\n\r\n const tface = [t00, t11, t01, t11, t00, t10];\r\n const face3 = tface.concat(tface).concat(tface);\r\n return face3.concat(face3);\r\n }", "title": "" }, { "docid": "6eddb61421521c7d8b674fafca3cd7a7", "score": "0.51259476", "text": "readback() {\n // Uint8Array long enough to hold pixel data for one layer\n const buffer = new Uint8Array(this.layerWidth * this.layerHeight * 4);\n const fb = gl.createFramebuffer();\n const layers = [];\n\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, fb);\n\n for (let layer = 0; layer < this.layers; layer++) {\n gl.framebufferTextureLayer(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, this.texture, 0, layer);\n gl.readPixels(0, 0, this.layerWidth, this.layerHeight, gl.RGBA, gl.UNSIGNED_BYTE, buffer);\n layers.push(new ImageData(new Uint8ClampedArray(buffer), this.layerWidth, this.layerHeight));\n }\n\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, null);\n\n return layers;\n }", "title": "" }, { "docid": "8b5fe951407c0a8986b30c00962b8d0e", "score": "0.51220477", "text": "get textureSize() { return this._textureSize; }", "title": "" }, { "docid": "8ef18752b5e91eaa5a922ae57866283c", "score": "0.509338", "text": "frames(source, coordinates, frameWidth, frameHeight) {\n\n let baseTexture, textures;\n\n //If the source is a string, it's either a texture in the\n //cache or an image file\n if (typeof source === \"string\") {\n if (this.TextureCache[source]) {\n baseTexture = new this.Texture(this.TextureCache[source]);\n }\n }\n //If the `source` is a texture, use it\n else if (source instanceof this.Texture) {\n baseTexture = new this.Texture(source);\n }\n if (!baseTexture) {\n console.log(`Please load the ${source} texture into the cache.`);\n } else {\n let textures = coordinates.map((position) => {\n let x = position[0],\n y = position[1];\n let imageFrame = new this.Rectangle(x, y, frameWidth, frameHeight);\n let frameTexture = new this.Texture(baseTexture);\n frameTexture.frame = imageFrame;\n return frameTexture\n });\n return textures;\n }\n }", "title": "" }, { "docid": "fe3347eb0ba8f5e1f6ef27c23bae21b1", "score": "0.5046267", "text": "renderf(time) {\n return {\n sprite_sheet: this.background,\n left: 0,\n top: 0,\n sprite_height: this.background.height,\n sprite_width: this.background.width,\n opacity: 1\n };\n }", "title": "" }, { "docid": "d460db6b2a8085f75deefb28b2d0a928", "score": "0.5034325", "text": "getMainCamera(): ?Camera {\n\t\tif (this._ctx && !this._camera) {\n\t\t\tthis._camera = new Camera(this._ctx);\n\t\t}\n\t\treturn this._camera;\n\t}", "title": "" }, { "docid": "0f0310897286ea4ba6e8ba0ff2b75219", "score": "0.50251234", "text": "getTexture(marker: OccupancyGridMessage) {\n if (this.marker === marker) {\n return this.texture;\n }\n this.marker = marker;\n const { info, data } = marker;\n this.texture = this.texture({\n format: \"alpha\",\n mipmap: false,\n data: toTypedArray(data),\n width: info.width,\n height: info.height,\n });\n return this.texture;\n }", "title": "" }, { "docid": "cc7f93aaa871877d8f2d49fedb446cb0", "score": "0.5024893", "text": "createTextures(frames, images, useRaw = false) {\n if (useRaw) {\n return _.map(frames, (frame) => {\n let texture = THREE.ImageUtils.loadTexture(frame.url)\n texture.minFilter = THREE.NearestFilter\n return texture\n })\n } else {\n // create temporary canvas element for offscreen rendering\n let canvas = document.createElement('canvas')\n canvas.width = this.width\n canvas.height = this.height\n\n // todo: enhance this to really respect the disposal rules of a frame\n // we currently just layer the next frame on top of the previous, always\n // which is, in most cases, the right solution\n let context = canvas.getContext('2d')\n let textures = _.map(images, (image) => {\n context.drawImage(image, 0, 0)\n let texture = THREE.ImageUtils.loadTexture(canvas.toDataURL())\n texture.minFilter = THREE.NearestFilter\n return texture\n })\n\n return textures\n }\n }", "title": "" }, { "docid": "595dbcaa011328db0c844dbfdc47d061", "score": "0.5018287", "text": "getCurrentFrame(params, postProcessFrame) {\n const {vehiclePose} = params;\n if (!vehiclePose) {\n return null;\n }\n\n const {OBJECT_STREAM} = getXVIZConfig();\n\n const frame = {\n ...params,\n ...getTransformsFromPose(vehiclePose),\n vehiclePose,\n features: this.features,\n lookAheads: this.lookAheads,\n variables: this.variables,\n pointCloud: this.pointCloud,\n components: this.components,\n streams: this.streams,\n links: this.links\n };\n\n // OBJECTS\n XVIZObject.resetAll();\n if (postProcessFrame) {\n postProcessFrame(frame);\n }\n\n // OBJECT_STREAM is deprecated, only keeping for backward compatibility\n if (OBJECT_STREAM) {\n updateObjects(OBJECT_STREAM, this.features[OBJECT_STREAM] || []);\n } else {\n for (const streamName in this.features) {\n const features = this.features[streamName];\n if (features.length && features[0].id) {\n updateObjects(streamName, features);\n }\n }\n }\n\n frame.objects = XVIZObject.getAllInCurrentFrame(); // Map of XVIZ ids in current slice\n\n return frame;\n }", "title": "" }, { "docid": "faa3079cf202ec0b292d96a35cd4c9bc", "score": "0.5009323", "text": "getActorsUnderPointerLastFrame() {\n return this._actorsLastFrame;\n }", "title": "" }, { "docid": "cb2efdbe566b7ac4303db667504ae22d", "score": "0.5007238", "text": "get currentFrame() {\n return this._currentFrameID\n }", "title": "" }, { "docid": "83a9febf3a3ca9092211cdb05609a5ea", "score": "0.49820614", "text": "get texture_map1() {\r\n\r\n const t00 = [0,0];\r\n const t01 = [0,1];\r\n const t10 = [1,0];\r\n const t11 = [1,1];\r\n\r\n const tface = [t00, t11, t01, t11, t00, t10];\r\n const face3 = tface.concat(tface).concat(tface);\r\n return face3.concat(face3);\r\n }", "title": "" }, { "docid": "3de16320b5d92af49bb698fc612e26f7", "score": "0.49820608", "text": "getFrame() {\n this.frameInt++;\n this.addFireworks();\n this.clearOldFireworks();\n this.animateFireworks();\n fadeCanvas(this.ctx, this.canvas.width, this.canvas.height, {r: 0, g: 0, b: 0}); // TODO: set fade to color in config instead of 0, 0, 0\n return this.canvas;\n }", "title": "" }, { "docid": "b773b9b615b201efb7f32cd5fc88a32e", "score": "0.497619", "text": "getCamera() {\n return this.camera;\n }", "title": "" }, { "docid": "ae4dbbbf7c924d1b6e8fa7543a82ffe6", "score": "0.49739078", "text": "function loadTexture(gl, src, textureIndex, callback)\n {\n var texture = gl.createTexture();\n var image = new Image();\n image.onload = function()\n {\n onTextureLoaded(gl, image, texture, textureIndex, callback);\n }\n image.src = src;\n return texture;\n }", "title": "" }, { "docid": "57362d5fc55a812faa54aef7d7dc83ae", "score": "0.49710977", "text": "getCamera () {\n return this.camera;\n }", "title": "" }, { "docid": "4ce7f5cfde48e49d9d30949ed2ac0044", "score": "0.49639228", "text": "getCurrentID() {\n // check if there is any game history, and return the last game id\n // entry if there is\n var l = this.history.length;\n if (l == 0) {\n return null;\n }\n else {\n return this.history[l-1].id;\n }\n }", "title": "" }, { "docid": "636a91918bd85fb5b4936fbf932b6d8b", "score": "0.49543217", "text": "function getDepthTextureSize(){\n if(depthTextureSize === undefined){\n depthTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); //Ottengo la dimensione massima in base a quella supportata dalla GPU\n if(depthTextureSize > 8192) depthTextureSize = 8192; //Limito la dimensione massima per la texture\n console.log(\"Using shadow projection texture of size: \" + depthTextureSize);\n }\n return depthTextureSize;\n}", "title": "" }, { "docid": "19390ddfed0e8174e9f3b5e87854542b", "score": "0.49475047", "text": "getCurrentTime() {\n return this.media.currentTime;\n }", "title": "" }, { "docid": "c10f27f6e6f647b4b669937b67cafd6a", "score": "0.49440643", "text": "getTextureImages() {\n return this.textureImages;\n }", "title": "" }, { "docid": "b18eae327339dd316b9e228a66faae01", "score": "0.49317107", "text": "prevFrame () {\n if (this[_video].src) {\n this[_setFrame](-1);\n }\n }", "title": "" }, { "docid": "8e599c1621bedc9cc7cc010de913e997", "score": "0.49264285", "text": "nearestImageFrame (offset = TimelineWorker.currentOffset()) {\n let segment = this.props.currentSegment || this.props.nextSegment;\n if (!segment) {\n return '';\n }\n offset = offset - segment.routeOffset;\n var seconds = Math.max(1, Math.floor(offset / 1000) * 1);\n\n return segment.url + '/sec' + seconds + '.jpg';\n }", "title": "" }, { "docid": "a63621b92393029c1f2469f2b3b7400f", "score": "0.49245098", "text": "get Camera()\n {\n return this._camera;\n }", "title": "" }, { "docid": "673dff49e68ff192f16d76796b0e0b10", "score": "0.4919378", "text": "function getCurTrans() {\n var nc=scene.meshes.count;\n var tA=new Array(nc);\n for(var i=0; i<nc; i++){\n var cm=scene.meshes.getByIndex(i);\n tA[cm.name]=new Matrix4x4(cm.transform);\n }\n return tA;\n}", "title": "" }, { "docid": "cae48548dacb4616ffefe1dd31314826", "score": "0.49181235", "text": "function glActiveTexture(texture) //OpenGLES?\n{\n\tactiveTexture(texture);\n}", "title": "" }, { "docid": "9ec028e045045cddaa8da5bbbe8cda9b", "score": "0.49181128", "text": "getFrameAtAngle(angle){\n let mod;\n\n if(angle < 0){\n //- js does negative modulos weird\n mod = ((angle % 360) + 360) % 360;\n }else{\n mod = angle % 360;\n }\n\n return Math.floor((mod / 360) * this.props.curSpin.images.length);\n }", "title": "" }, { "docid": "3ac6dc183228b330b6528d13a8cadf1f", "score": "0.49126288", "text": "async _getCameraTelem() {\n return await request({\n uri: `http://${this._telemUrl}/api/camera-telem`,\n encoding: null,\n transform: buffer => telemetry.CameraTelem.decode(buffer),\n transform2xxOnly: true,\n // The timeout is short because telemetry data loses it's\n // relevance quickly while the plane is flying.\n timeout: 1500\n });\n }", "title": "" }, { "docid": "f58a3e98bf42742b8f43819c47ede046", "score": "0.49116406", "text": "get last() {\n return this._history.slice(-1)[0];\n }", "title": "" }, { "docid": "ff06300e7879f35260f55128d7ba2b1b", "score": "0.49029118", "text": "function snapshot() {\n\t\tvar video = $(element).find(\"video\").first()[0];\n\t\tvar canvas = $(\"<canvas></canvas>\")[0];\n\t\tvar context = canvas.getContext('2d');\n\t\tcontext.drawImage(video,0,0,canvas.width, canvas.height);\n\n\t\tvar dataUrl = canvas.toDataURL();\n\t\t$(canvas).remove();\n\n\t\treturn dataUrl;\n\n\t}", "title": "" }, { "docid": "1bc96d3c1a991512af20dfa0d05a8a3a", "score": "0.48974767", "text": "function drawBack()\n{\n\tctx.drawImage(field, 0, 0, 1200, 720);\n}", "title": "" }, { "docid": "8707cf22f706d7e46c883a965ad98796", "score": "0.48886952", "text": "function captureWebcam() {\n\tvar canvas = document.createElement(\"canvas\");\n\tvar context = canvas.getContext('2d');\n\tcanvas.width = video.width;\n\tcanvas.height = video.height;\n\n\tcontext.drawImage(video, 0, 0, video.width, video.height);\n\ttensor_image = preprocessImage(canvas);\n\n\treturn tensor_image;\n}", "title": "" }, { "docid": "ff753f42fcf2b1d868f6aa09a5cee6c8", "score": "0.48758367", "text": "function lastEffect() {\n for (var i = effectArr.length - 1; i >= 0; --i) {\n if (effectArr[i] !== undefined) {\n return effectArr[i];\n }\n }\n return null;\n }", "title": "" }, { "docid": "3296efa686573c358853f35ba397a0a6", "score": "0.48727468", "text": "drawing() {\n const texture = this.materials.getFrame(this.frameIndex);\n this.display.updateBaseTexture(texture, true);\n this.nextFrame();\n }", "title": "" }, { "docid": "864c31018a47eb70a794f970a08908c6", "score": "0.4871654", "text": "get latestBlock() {\n return this.chain[this.chain.length - 1];\n }", "title": "" }, { "docid": "252c80922a414f349a76203d5b97dd2a", "score": "0.48701066", "text": "get lastTime() {\n return this.times[this.times.length - 1];\n }", "title": "" }, { "docid": "93324bcbdab77ac6e96e074ea2e6e628", "score": "0.48696685", "text": "getMostRecentPlace() {\n if (this.recentLocations.length) {\n return this.recentLocations[0];\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "1816b807fcfc09a3c116c5124f25274b", "score": "0.48638463", "text": "function cameraPop() {\n var pInst = this;\n\n if(pInst.camera.active)\n {\n pInst.pop();\n pInst.camera.active = false;\n }\n}", "title": "" }, { "docid": "5600b40576607787071ae67b005baeb4", "score": "0.48632494", "text": "function get_image() {\n const img = new Image();\n img.crossOrigin = 'anonymous';\n img.src = \"https://www.marazzigroup.com/media/Marazzi_Grande_Solid_Color_Look_M38G.jpg.400x0_q500.jpg\";\n const texture = gl.createTexture();\n\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([255, 255, 255, 255]));\n \n img.addEventListener('load', () => {\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);\n draw_surface();\n });\n}", "title": "" }, { "docid": "9a04e1a803a85a878014e4a655c1a7a3", "score": "0.48622444", "text": "getFrame(isLastFrame)\n\t{\n\t\t// Deep clone data from previous frame\n\t\tlet newSpring = new SimulationFrameVector(this.lastFrame().position.clone(), this.lastFrame().velocity.clone());\n\t\t\n\t\t// Calculate new Spring\n\t\tspringV(newSpring.position, this.target, newSpring.velocity, this.mass, this.damping);\n\n\t\t// Return new Spring\n\t\treturn newSpring;\n\t}", "title": "" }, { "docid": "0128d8297cf472307f402dc212a2cc9a", "score": "0.485892", "text": "function createTexture(){\n var texture = new THREE.Texture(video),\n object = new THREE.Object3D(),\n geometry = new THREE.PlaneGeometry(1.0, 1.0, 0.0),\n material = new THREE.MeshBasicMaterial( {map: texture, depthTest: false, depthWrite: false} ),\n mesh = new THREE.Mesh(geometry, material);\n \n object.position.z = -1;\n \n object.add(mesh);\n \n return object;\n }", "title": "" }, { "docid": "41a954bf1abeab880f00393b7c86bec4", "score": "0.48570788", "text": "getLatestBlock(){\n \n return this.chain[this.chain.length - 1];\n }", "title": "" }, { "docid": "d78a5b4575d5bda239ebea47e07f447a", "score": "0.4854492", "text": "getLatestBlock(){\n\t\treturn this.chain[this.chain.length - 1];\n\t}", "title": "" }, { "docid": "19e8528e081f2e0176d98ece5f2dcb01", "score": "0.48535746", "text": "function createTexture() {\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n const pixels = new Uint8Array(4 * width * height);\n pixels[0] = 255;\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n width,\n height,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n pixels\n );\n\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);\n\n return texture;\n}", "title": "" }, { "docid": "b4d571f492a6b8f3c7bd24851c1928f9", "score": "0.48478088", "text": "get texture_map4() {\r\n const t00 = [0,0,0,1];\r\n const t01 = [0,1,0,1];\r\n const t10 = [1,0,0,1];\r\n const t11 = [1,1,0,1];\r\n\r\n // top front bottom back left right\r\n const tfTop = [t00, t11, t01, t11, t00, t10].map(p => scale(.5, p));\r\n const tfFront = tfTop.map(p => mult(translate(.5, 0), p));\r\n const tfBottom = tfTop.map(p => mult(translate(.5, .5), p));\r\n const tfBack = tfFront;\r\n const tfLeft = tfTop.map(p => mult(translate(0, .5), p));\r\n const tfRight = tfLeft;\r\n const tfAll = tfTop.concat(tfFront.concat(tfBottom.concat(tfBack.concat(tfLeft.concat(tfRight)))));\r\n return tfAll.map(p => [p[0], p[1]]);\r\n }", "title": "" }, { "docid": "7dd7e5dfd39d44e00fd76d279256215c", "score": "0.48427796", "text": "function initTextureCache(resourceDir){\n\tvar resourceDirSplited = resourceDir.split(\"/\");\n\tvar resourceName = resourceDirSplited[resourceDirSplited.length-1];\n\tvar phaseNumber = resourceName.split(\"_\")[1];\n\n\tvar texture = cc.textureCache.addImage(resourceDir);\n\tvar width = 512;\n\tvar height = 300;\n\tvar frameList = [];\n\tvar xPos = 0;\n\tvar yPos = 0;\n\n\tif (phaseNumber < 8){\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tif (i < 3){\n\t\t\t\tfor (var j = 0; j < 13; j++){\n\t\t\t\t\tframeList.push(new cc.SpriteFrame(texture, cc.rect(xPos, yPos, width, height)));\n\t\t\t\t\txPos += width;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tframeList.push(new cc.SpriteFrame(texture, cc.rect(xPos, yPos, width, height)));\n\t\t\t}\n\t\t\txPos = 0;\n\t\t\tyPos += height;\n\t\t}\n\t} else {\n\t\tframeList.push(new cc.SpriteFrame(texture, cc.rect(xPos, yPos, width, height)));\n\t}\n\n\treturn frameList;\n}", "title": "" }, { "docid": "29d2891d1b7c1a3c8ced7a2312f3fed6", "score": "0.48427236", "text": "async _getMeta() {\n // By default, we'll always list the current time.\n let metadata = imagery.Image.create({\n time: (new Date()).getTime() / 1000\n });\n\n // If a telemetry service url was given, we'll try requesting\n // the latest camera telemetry. If it works, then we'll add\n // it to the metadata.\n if (!!this._telemUrl) {\n try {\n let telem = await this._getCameraTelem();\n\n // FIXME: since we don't have gimbal data we'll just\n // have to assume that the camera is pointed\n // straight down.\n telem.roll = 0;\n telem.pitch = 0;\n\n metadata.has_telem = true;\n metadata.telem = telem;\n } catch (err) {\n let message = err.name + ': ' + err.message;\n console.error('Error while requesting telemetry: ' + message);\n }\n }\n\n return metadata;\n }", "title": "" }, { "docid": "7c8e63d17fd2ab4ce7472735a43b3e9e", "score": "0.4838801", "text": "function getCamera() {\n var aspectRatio = window.innerWidth / window.innerHeight;\n var camera = new THREE.PerspectiveCamera(50, 1.481073, 0.01, 10000);\n camera.position.set(-662, 212, -3);\n // console.log(camera.rotation)\n return camera;\n}", "title": "" }, { "docid": "c55c1a94691943f185c280290568f80a", "score": "0.48373157", "text": "getLatestBlock() {\n return this.chain[this.chain.length - 1];\n }", "title": "" } ]
8c3b5b5e803a02c3a3937e2f57989626
Aligns the given edge to the target coordinate.
[ { "docid": "9885096fd292a9a4f784e6ce97e4e245", "score": "0.56012964", "text": "function _alignEdgeToCoordinate(rect, coordinate, direction) {\n\t switch (direction) {\n\t case RectangleEdge.top:\n\t return _moveTopLeftOfRectangleToPoint(rect, { x: rect.left, y: coordinate });\n\t case RectangleEdge.bottom:\n\t return _moveTopLeftOfRectangleToPoint(rect, { x: rect.left, y: coordinate - rect.height });\n\t case RectangleEdge.left:\n\t return _moveTopLeftOfRectangleToPoint(rect, { x: coordinate, y: rect.top });\n\t case RectangleEdge.right:\n\t return _moveTopLeftOfRectangleToPoint(rect, { x: coordinate - rect.width, y: rect.top });\n\t }\n\t return new Rectangle_1.default();\n\t }", "title": "" } ]
[ { "docid": "13d10b819f16a0f2b9670866bf34a9d9", "score": "0.56992847", "text": "function _flipAlignmentEdge(elementEstimate, target, gap, coverTarget) {\n var alignmentEdge = elementEstimate.alignmentEdge, targetEdge = elementEstimate.targetEdge, elementRectangle = elementEstimate.elementRectangle;\n var oppositeEdge = alignmentEdge * -1;\n var newEstimate = _estimatePosition(elementRectangle, target, { targetEdge: targetEdge, alignmentEdge: oppositeEdge }, gap, coverTarget);\n return {\n elementRectangle: newEstimate,\n targetEdge: targetEdge,\n alignmentEdge: oppositeEdge\n };\n}", "title": "" }, { "docid": "13d10b819f16a0f2b9670866bf34a9d9", "score": "0.56992847", "text": "function _flipAlignmentEdge(elementEstimate, target, gap, coverTarget) {\n var alignmentEdge = elementEstimate.alignmentEdge, targetEdge = elementEstimate.targetEdge, elementRectangle = elementEstimate.elementRectangle;\n var oppositeEdge = alignmentEdge * -1;\n var newEstimate = _estimatePosition(elementRectangle, target, { targetEdge: targetEdge, alignmentEdge: oppositeEdge }, gap, coverTarget);\n return {\n elementRectangle: newEstimate,\n targetEdge: targetEdge,\n alignmentEdge: oppositeEdge\n };\n}", "title": "" }, { "docid": "13d10b819f16a0f2b9670866bf34a9d9", "score": "0.56992847", "text": "function _flipAlignmentEdge(elementEstimate, target, gap, coverTarget) {\n var alignmentEdge = elementEstimate.alignmentEdge, targetEdge = elementEstimate.targetEdge, elementRectangle = elementEstimate.elementRectangle;\n var oppositeEdge = alignmentEdge * -1;\n var newEstimate = _estimatePosition(elementRectangle, target, { targetEdge: targetEdge, alignmentEdge: oppositeEdge }, gap, coverTarget);\n return {\n elementRectangle: newEstimate,\n targetEdge: targetEdge,\n alignmentEdge: oppositeEdge\n };\n}", "title": "" }, { "docid": "08bba51b6cc1b8a535f1f9d89b119aef", "score": "0.5527204", "text": "static create_edge(ui, source, target) {\n // We attempt to guess what the intended label alignment is and what the intended edge\n // offset is, if the cells being connected form some path with existing connections.\n // Otherwise we revert to the currently-selected label alignment in the panel and the\n // default offset (0).\n const options = {\n // By default, 2-cells and above have a little padding for aesthetic purposes.\n shorten: {\n source: source.level === 0 ? 0 : CONSTANTS.EDGE_EDGE_PADDING,\n target: target.level === 0 ? 0 : CONSTANTS.EDGE_EDGE_PADDING,\n },\n // We will guess the label alignment below, but in case there's no selected label\n // alignment, we default to \"left\".\n label_alignment: \"left\",\n // The default settings for the other options are fine.\n };\n const selected_alignment\n = ui.panel.element.query_selector('input[name=\"label_alignment\"]:checked');\n if (selected_alignment !== null) {\n // If multiple edges are selected and not all selected edges have the same label\n // alignment, there will be no checked input.\n options.label_alignment = selected_alignment.element.value;\n }\n // If *every* existing connection to source and target has a consistent label alignment,\n // then `align` will be a singleton, in which case we use that element as the alignment.\n // If it has `left` and `right` in equal measure (regardless of `centre`), then\n // we will pick `centre`. Otherwise we keep the default. And similarly for `offset` and\n // `curve`.\n const align = new Map();\n const offset = new Map();\n const curve = new Map();\n // We only want to pick `centre` when the source and target are equally constraining\n // (otherwise we end up picking `centre` far too often). So we check that they're both\n // being considered equally. This means `centre` is chosen only rarely, but often in\n // the situations you want it. (This has no analogue in `offset` or `curve`.)\n let balance = 0;\n\n const swap = (options) => {\n return {\n label_alignment: {\n left: \"right\",\n centre: \"centre\",\n over: \"over\",\n right: \"left\",\n }[options.label_alignment],\n offset: -options.offset,\n curve: -options.curve,\n };\n };\n\n const conserve = (options, between) => {\n return {\n label_alignment: options.label_alignment,\n // We ignore the offsets and curves of edges that aren't directly `between` the\n // source and target.\n offset: between ? options.offset : null,\n curve: between ? options.curve : null,\n };\n };\n\n const consider = (options, tip) => {\n if (!align.has(options.label_alignment)) {\n align.set(options.label_alignment, 0);\n }\n align.set(options.label_alignment, align.get(options.label_alignment) + 1);\n if (options.offset !== null) {\n if (!offset.has(options.offset)) {\n offset.set(options.offset, 0);\n }\n offset.set(options.offset, offset.get(options.offset) + 1);\n }\n if (options.curve !== null) {\n if (!curve.has(options.curve)) {\n curve.set(options.curve, 0);\n }\n curve.set(options.curve, curve.get(options.curve) + 1);\n }\n balance += tip;\n };\n\n const source_dependencies = ui.quiver.dependencies_of(source);\n const target_dependencies = ui.quiver.dependencies_of(target);\n for (const [edge, relationship] of source_dependencies) {\n consider({\n source: swap,\n target: options => conserve(options, target_dependencies.has(edge)),\n }[relationship](edge.options), -1);\n }\n for (const [edge, relationship] of target_dependencies) {\n consider({\n source: options => conserve(options, source_dependencies.has(edge)),\n target: swap,\n }[relationship](edge.options), 1);\n }\n\n if (align.size === 1) {\n options.label_alignment = align.keys().next().value;\n } else if (align.size > 0 && align.get(\"left\") === align.get(\"right\") && balance === 0) {\n options.label_alignment = \"centre\";\n }\n\n if (offset.size === 1) {\n options.offset = offset.keys().next().value;\n }\n if (curve.size === 1) {\n options.curve = curve.keys().next().value;\n }\n\n const label = \"\";\n // The edge itself does all the set up, such as adding itself to the page.\n return new Edge(ui, label, source, target, options);\n }", "title": "" }, { "docid": "479d47703ee2605eccd90faac4ee3a74", "score": "0.5453984", "text": "function _alignEdgeToCoordinate(rect, coordinate, direction) {\n switch (direction) {\n case RectangleEdge.top:\n return _moveTopLeftOfRectangleToPoint(rect, { x: rect.left, y: coordinate });\n case RectangleEdge.bottom:\n return _moveTopLeftOfRectangleToPoint(rect, { x: rect.left, y: coordinate - rect.height });\n case RectangleEdge.left:\n return _moveTopLeftOfRectangleToPoint(rect, { x: coordinate, y: rect.top });\n case RectangleEdge.right:\n return _moveTopLeftOfRectangleToPoint(rect, { x: coordinate - rect.width, y: rect.top });\n }\n return new Utilities_1.Rectangle();\n }", "title": "" }, { "docid": "3f67c7ce74d4a5048c490d9f36846b33", "score": "0.5218559", "text": "static addEdge(source, target) {\n graph.setEdge(source, target, {\n curve: d3.curveBasis,\n labelType: 'html',\n labelPos: 'c',\n label: `<i source=${source} target=${target}>content_cut</i>`\n });\n }", "title": "" }, { "docid": "c3d22da866af20da5e06d54c04b20b3f", "score": "0.519833", "text": "function setLabelAnchor(d) {\r\n if (d.target.x >= (d.source.x + 20)) return \"start\";\r\n if (d.target.x <= (d.source.x - 20)) return \"end\";\r\n return \"middle\";\r\n }", "title": "" }, { "docid": "34542191fd84a02b70fb793fabf46662", "score": "0.48807344", "text": "function translateEdge(e, dx, dy) {\n\t e.dagre.points.forEach(function(p) {\n\t p.x = Math.max(0, Math.min(800, p.x + dx));\n\t p.y = Math.max(0, Math.min(600, p.y + dy));\n\t });\n\t}", "title": "" }, { "docid": "9a31be96c53a114bba6cef66809ef0cf", "score": "0.4844879", "text": "function alignCoordinates(xss,alignTo){var alignToMin=_.min(alignTo),alignToMax=_.max(alignTo);_.each([\"u\",\"d\"],function(vert){_.each([\"l\",\"r\"],function(horiz){var alignment=vert+horiz,xs=xss[alignment],delta;if(xs===alignTo)return;delta=horiz===\"l\"?alignToMin-_.min(xs):alignToMax-_.max(xs);if(delta){xss[alignment]=_.mapValues(xs,function(x){return x+delta;});}});});}", "title": "" }, { "docid": "5743a81d867f349914b9c3fafb6e4736", "score": "0.4793262", "text": "function adjust(pos, labelBBox, node) {\r\n var neighbours = getNeighbours(node),\r\n self = getCorrdinates(node),\r\n prev = getCorrdinates(neighbours.prev),\r\n next = getCorrdinates(neighbours.next),\r\n uphill = (prev.y >= self.y && self.y >= next.y),\r\n upper = uphill ? next : prev,\r\n basex = pos[0] + (uphill ? labelBBox.width : 0),\r\n refy = pos[1],\r\n refx, slope, offset;\r\n\r\n slope = (self.x - upper.x) / (self.y - upper.y);\r\n offset = self.x - slope * self.y;\r\n\r\n refx = slope * refy + offset;\r\n\r\n if (uphill && basex >= (refx - HARD_OFFSET)) {\r\n pos[0] -= (basex - refx + HARD_OFFSET);\r\n }\r\n\r\n if (!uphill && basex <= (refx + HARD_OFFSET)) {\r\n pos[0] += (refx + HARD_OFFSET - basex);\r\n }\r\n\r\n return pos;\r\n }", "title": "" }, { "docid": "324058c31f9fd0fbf21ee50704c0a1c3", "score": "0.47645393", "text": "function positionLink(d) {\n var offset = 30;\n\n var midpoint_x = (d.source.x + d.target.x) / 2;\n var midpoint_y = (d.source.y + d.target.y) / 2;\n\n var dx = (d.target.x - d.source.x);\n var dy = (d.target.y - d.source.y);\n\n var normalise = Math.sqrt((dx * dx) + (dy * dy));\n\n var offSetX = midpoint_x + offset*(dy/normalise);\n var offSetY = midpoint_y - offset*(dx/normalise);\n\n return \"M\" + d.source.x + \",\" + d.source.y +\n \"S\" + offSetX + \",\" + offSetY +\n \" \" + d.target.x + \",\" + d.target.y;\n }", "title": "" }, { "docid": "9c9f4fbe8097353df83f7e2ffd2420a4", "score": "0.47616714", "text": "function moveAround( p, m, target ) {\n // Compute vectors pointing from marker-to-target and Marker-to-pusher\n var mToT = vecSub( target, m.pos ).norm();\n var mToP = vecSub( p.pos, m.pos ).norm();\n \n // See if we're already close to behind the marker.\n if ( vecDot( mToT, mToP ) < -0.8 )\n return true;\n\n // Figure out how far around the target we need to go, we're\n // going to move around a little bit at a time so we don't hit\n // the target.\n var moveAngle = Math.acos( vecDot( mToT, mToP ) );\n if ( moveAngle > Math.PI * 0.25 )\n moveAngle = Math.PI * 0.25;\n\n // We're not, decide which way to go around.\n if ( cross( mToT, mToP ) > 0 ) {\n // Try to go around to the right.\n moveTo( p, vecAdd( m.pos, mToP.rotate( moveAngle ).scale( 4 ) ) );\n } else {\n // Try to go around to the left.\n moveTo( p, vecAdd( m.pos, mToP.rotate( -moveAngle ).scale( 4 ) ) );\n }\n \n return false;\n}", "title": "" }, { "docid": "604d218616632fc2a8790c9cc182ea0b", "score": "0.47371173", "text": "function ensureCentre(o, target) {\n o.cx = o.cx == null ? target.bbox().cx : o.cx\n o.cy = o.cy == null ? target.bbox().cy : o.cy\n}", "title": "" }, { "docid": "604d218616632fc2a8790c9cc182ea0b", "score": "0.47371173", "text": "function ensureCentre(o, target) {\n o.cx = o.cx == null ? target.bbox().cx : o.cx\n o.cy = o.cy == null ? target.bbox().cy : o.cy\n}", "title": "" }, { "docid": "cc7543e25acc111e85aaa7125f145471", "score": "0.47148526", "text": "function verticalAlignment(g,layering,conflicts,neighborFn){var root={},align={},pos={};// We cache the position here based on the layering because the graph and\n\t// layering may be out of sync. The layering matrix is manipulated to\n\t// generate different extreme alignments.\n\t_.each(layering,function(layer){_.each(layer,function(v,order){root[v]=v;align[v]=v;pos[v]=order;});});_.each(layering,function(layer){var prevIdx=-1;_.each(layer,function(v){var ws=neighborFn(v);if(ws.length){ws=_.sortBy(ws,function(w){return pos[w];});var mp=(ws.length-1)/2;for(var i=Math.floor(mp),il=Math.ceil(mp);i<=il;++i){var w=ws[i];if(align[v]===v&&prevIdx<pos[w]&&!hasConflict(conflicts,v,w)){align[w]=v;align[v]=root[v]=root[w];prevIdx=pos[w];}}}});});return{root:root,align:align};}", "title": "" }, { "docid": "6c3398e66ac445602abdef4d875ff34f", "score": "0.4704401", "text": "function ensureCentre(o, target) {\r\n o.cx = o.cx == null ? target.bbox().cx : o.cx\r\n o.cy = o.cy == null ? target.bbox().cy : o.cy\r\n}", "title": "" }, { "docid": "6c3398e66ac445602abdef4d875ff34f", "score": "0.4704401", "text": "function ensureCentre(o, target) {\r\n o.cx = o.cx == null ? target.bbox().cx : o.cx\r\n o.cy = o.cy == null ? target.bbox().cy : o.cy\r\n}", "title": "" }, { "docid": "b7d350dc0000bd1711aa112f76e0dcb8", "score": "0.4674855", "text": "function adjusAlign(el) {\r\n var p = $(el);\r\n var w = p.width()/2;\r\n p.css( \"margin-left\",-w );\r\n }", "title": "" }, { "docid": "f043ee5e1f6b36ba266e909c9c758eac", "score": "0.4668126", "text": "function getAlignTarget() {\n if (point) {\n return point;\n }\n\n return getRootDomNode;\n }", "title": "" }, { "docid": "f043ee5e1f6b36ba266e909c9c758eac", "score": "0.4668126", "text": "function getAlignTarget() {\n if (point) {\n return point;\n }\n\n return getRootDomNode;\n }", "title": "" }, { "docid": "f043ee5e1f6b36ba266e909c9c758eac", "score": "0.4668126", "text": "function getAlignTarget() {\n if (point) {\n return point;\n }\n\n return getRootDomNode;\n }", "title": "" }, { "docid": "f043ee5e1f6b36ba266e909c9c758eac", "score": "0.4668126", "text": "function getAlignTarget() {\n if (point) {\n return point;\n }\n\n return getRootDomNode;\n }", "title": "" }, { "docid": "fef6484a5861e7ed127e676fe3e42740", "score": "0.46601388", "text": "function right(x) { currentAlignment = alignRight }", "title": "" }, { "docid": "e9ac1533dd8864c59a32439852c940e7", "score": "0.4660033", "text": "function shiftAnchor (selectedLayer, direction) {\n\n var anchorMap = buildAnchorGrid(selectedLayer);\n\n var position = selectedLayer.transform.position.value;\n var ancorCurrent = selectedLayer.transform.anchorPoint.value;\n var scale = selectedLayer.transform.scale.value;\n\n var\n newAncorX = 0,\n newAncorY = 0,\n positionXCompensator,\n positionYCompensator;\n\n var skipPosition = direction.match(/_al/);\n\n switch (direction.charAt(0)) {\n case 'L' :\n newAncorX = anchorMap['left'];\n break;\n\n case 'C' :\n newAncorX = anchorMap['centerV'];\n break;\n\n case 'R' :\n newAncorX = anchorMap['right'];\n break;\n }\n\n switch (direction.charAt(1)) {\n case 'T' :\n newAncorY = anchorMap['top'];\n break;\n\n case 'C' :\n newAncorY = anchorMap['centerH'];\n break;\n\n case 'B' :\n newAncorY = anchorMap['bottom'];\n break;\n }\n\n if (!skipPosition) {\n app.beginUndoGroup('Anchor Manipulator (anchor to object)');\n\n positionXCompensator = (ancorCurrent[0] - newAncorX) / 100 * scale[0];\n position[0] -= positionXCompensator;\n\n positionYCompensator = (ancorCurrent[1] - newAncorY) / 100 * scale[1];\n position[1] -= positionYCompensator;\n\n selectedLayer.transform.position.setValue(position);\n } else {\n app.beginUndoGroup('Anchor Manipulator (object to anchor)');\n }\n\n ancorCurrent[0] = newAncorX;\n ancorCurrent[1] = newAncorY;\n selectedLayer.transform.anchorPoint.setValue(ancorCurrent);\n\n app.endUndoGroup();\n}", "title": "" }, { "docid": "02324d2464678f3dbc3ce0b03944941c", "score": "0.46434516", "text": "function ConstrainDistance(point, anchor, distance) {\n return ((point - anchor).normalize() * distance) + anchor;\n}", "title": "" }, { "docid": "ab177c1af7a7b1393a5d3f6f0cd4132f", "score": "0.46339366", "text": "function drawEdge(source, target) {\n lineGeometry.vertices.push(new THREE.Vertex(source.data.draw_object.position));\n lineGeometry.vertices.push(new THREE.Vertex(target.data.draw_object.position));\n }", "title": "" }, { "docid": "43a5a58bbed76cee5ad11155760f9440", "score": "0.463373", "text": "function adjustMiddleWire ( edge, connection, wireIndex, edgeSeparation, xOrY, leftright ) {\n\n var segmentAtEnd1,\n segmentAtEnd2,\n segment1X,\n segment2X;\n\n segmentAtEnd1 = connection[wireIndex - 1];\n segmentAtEnd2 = connection[wireIndex + 1];\n\n if ( xOrY == \"x\" ) {\n // For the two attached segments, need to know which endpoint is connected to edge\n // as this is the endpoint we are modifying.\n segment1X = segmentAtEnd1.x1 === edge.x1 ? \"x1\" : \"x2\";\n segment2X = segmentAtEnd2.x2 === edge.x1 ? \"x2\" : \"x1\";\n\n if (leftright === \"left\") {\n\n edge.x1 -= edgeSeparation;\n edge.x2 -= edgeSeparation;\n\n segmentAtEnd1[segment1X] -= edgeSeparation;\n segmentAtEnd2[segment2X] -= edgeSeparation;\n }\n else {\n edge.x1 += edgeSeparation;\n edge.x2 += edgeSeparation;\n\n segmentAtEnd1[segment1X] += edgeSeparation;\n segmentAtEnd2[segment2X] += edgeSeparation;\n }\n }\n else {\n\n segment1X = segmentAtEnd1.y1 === edge.y1 ? \"y1\" : \"y2\";\n segment2X = segmentAtEnd2.y2 === edge.y1 ? \"y2\" : \"y1\";\n\n if (leftright === \"left\") {\n\n edge.y1 -= edgeSeparation;\n edge.y2 -= edgeSeparation;\n\n segmentAtEnd1[segment1X] -= edgeSeparation;\n segmentAtEnd2[segment2X] -= edgeSeparation;\n }\n else {\n edge.y1 += edgeSeparation;\n edge.y2 += edgeSeparation;\n\n segmentAtEnd1[segment1X] += edgeSeparation;\n segmentAtEnd2[segment2X] += edgeSeparation;\n }\n }\n }", "title": "" }, { "docid": "37c64110484d8f72a3063ff007ec9512", "score": "0.459352", "text": "function drawEdge(source, target) {\n material = new THREE.LineBasicMaterial({ color: 0x99ffcc, opacity: 0.9, linewidth: 1.0 });\n\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\n line = new THREE.Line( tmp_geo, material, THREE.LinePieces );\n line.scale.x = line.scale.y = line.scale.z = 1;\n line.originalScale = 1;\n\n geometries.push(tmp_geo);\n\n scene.add( line );\n }", "title": "" }, { "docid": "440e2c2057f7419708d7b45b5ff5908d", "score": "0.45921305", "text": "function alignToAttribute( element ) {\n\t\t\t\t\t\tif ( element.styles[ 'text-align' ] ) {\n\t\t\t\t\t\t\telement.attributes.align = element.styles[ 'text-align' ];\n\t\t\t\t\t\t\tdelete element.styles[ 'text-align' ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "title": "" }, { "docid": "ef478654804f5828cdaaf60b0076491b", "score": "0.45773986", "text": "function edge ( event, Dt, Op ) {\n\n\t\t\tvar handles = Dt.base.data('handles'), to, i;\n\n\t\t\ti = Op['orientation'] ? event['pointY'] : event['pointX'];\n\t\t\ti = i < Dt.base.offset()[Op['style']];\n\n\t\t\tto = i ? 0 : 100;\n\t\t\ti = i ? 0 : handles.length - 1;\n\n\t\t\tjump ( Dt.base, handles[i], to, [ Op['slide'], Op['set'] ]);\n\t\t}", "title": "" }, { "docid": "dac4b2357c77e8486abf2893a7f17b4a", "score": "0.45653006", "text": "function edge ( event, Dt, Op ) {\r\n\r\n\t\t\tvar handles = Dt.base.data('handles'), to, i;\r\n\r\n\t\t\ti = Op['orientation'] ? event['pointY'] : event['pointX'];\r\n\t\t\ti = i < Dt.base.offset()[Op['style']];\r\n\r\n\t\t\tto = i ? 0 : 100;\r\n\t\t\ti = i ? 0 : handles.length - 1;\r\n\r\n\t\t\tjump ( Dt.base, handles[i], to, [ Op['slide'], Op['set'] ]);\r\n\t\t}", "title": "" }, { "docid": "f5f6dbae77205a7baa1344090ab5c590", "score": "0.45641664", "text": "function attachBoundary(target, top, down, left, right) {\n\tvar renderingTool = new renderTool(),\n\t\tX = target.getAttribute(\"width\"),\n\t\tY = target.getAttribute(\"height\");\n\n\tif (top === true) {\n\t\ttarget.appendChild(renderingTool.drawLine(0, X, 0, 0, \"svgAxis\"));\n\t}\n\tif (down === true) {\n\t\ttarget.appendChild(renderingTool.drawLine(0, X, Y, Y, \"svgAxis\"));\n\t}\n\tif (left === true) {\n\t\ttarget.appendChild(renderingTool.drawLine(0, 0, 0, Y, \"svgAxis\"));\n\t}\n\tif (right === true) {\n\t\ttarget.appendChild(renderingTool.drawLine(X, X, 0, Y, \"svgAxis\"));\n\t}\n}", "title": "" }, { "docid": "989d8e2232bc0467e7d7ea0462d9e565", "score": "0.45598772", "text": "function getLinkTextX (source, target) {\n var cx = (source.x + target.x) / 2;\n return cx;\n }", "title": "" }, { "docid": "f8a9e257d344046868cd2646c83990df", "score": "0.45549226", "text": "function makeSpaceForEdgeLabels(g){var graph=g.graph();graph.ranksep/=2;_.each(g.edges(),function(e){var edge=g.edge(e);edge.minlen*=2;if(edge.labelpos.toLowerCase()!==\"c\"){if(graph.rankdir===\"TB\"||graph.rankdir===\"BT\"){edge.width+=edge.labeloffset;}else{edge.height+=edge.labeloffset;}}});}", "title": "" }, { "docid": "c015c9a3063fbcf63a31b52b8f558287", "score": "0.45518476", "text": "_realign() {\n this._addTriedPosition(this.position, this.alignment)\n this.alignment = nextItem(this.alignment, ALIGNMENTS[this.position])\n }", "title": "" }, { "docid": "29a0a57f81f729908313e0f9669c35ae", "score": "0.4547608", "text": "set hAlign(value) {\n\t\tif (value == 'center') {\n\t\t\tthis.pivot.x = this.getBounds().width * 0.5;\n\t\t} else if (value == 'right') {\n\t\t\tthis.pivot.x = this.getBounds().width;\n\t\t} else {\n\t\t\tthis.pivot.x = 0.0;\n\t\t}\n\t}", "title": "" }, { "docid": "5703386a18a5e36b2d80b62370ce3fd9", "score": "0.45367107", "text": "enteredEdge(e) {\n let targetBounds = e.target.getBoundingClientRect();\n let mouseX = e.clientX;\n let mouseY = e.clientY;\n\n let topDist = Math.abs(targetBounds.top - mouseY);\n let bottomDist = Math.abs(targetBounds.bottom - mouseY);\n let leftDist = Math.abs(targetBounds.left - mouseX);\n let rightDist = Math.abs(targetBounds.right - mouseX);\n\n let min = Math.min(topDist, bottomDist, leftDist, rightDist);\n\n switch (min) {\n case leftDist:\n return \"left\";\n case rightDist:\n return \"right\";\n case topDist:\n return \"top\";\n case bottomDist:\n return \"bottom\";\n }\n }", "title": "" }, { "docid": "49d10f2cb14a91245bb46535f719ad79", "score": "0.452466", "text": "function SetVAlignAction(spread, options) {\n _super.call(this, spread, options);\n }", "title": "" }, { "docid": "a84a50d13053ced7ef66b22cde475122", "score": "0.4519478", "text": "function align(offset, alignment) {\n return alignment * Math.ceil(offset / alignment);\n}", "title": "" }, { "docid": "10797eb8227cd21f0c6d97e1fa966c3a", "score": "0.45185423", "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": "10797eb8227cd21f0c6d97e1fa966c3a", "score": "0.45185423", "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": "d790b003b02659eaa67aa33c8102bc93", "score": "0.4516393", "text": "function positionLink(d) {\n/* var offset = 30;\n\n var midpoint_x = (d.source.x + d.target.x) / 2;\n var midpoint_y = (d.source.y + d.target.y) / 2;\n\n var dx = (d.target.x - d.source.x);\n var dy = (d.target.y - d.source.y);\n\n var normalise = Math.sqrt((dx * dx) + (dy * dy));\n\n var offSetX = midpoint_x + offset*(dy/normalise);\n var offSetY = midpoint_y - offset*(dx/normalise);\n\n return \"M\" + d.source.x + \",\" + d.source.y +\n \"S\" + offSetX + \",\" + offSetY +\n \" \" + d.target.x + \",\" + d.target.y; */\n\n // Link to itself reference http://jsfiddle.net/LUrKR/\n var x1 = d.source.x,\n y1 = d.source.y,\n x2 = d.target.x,\n y2 = d.target.y,\n dx = x2 - x1,\n dy = y2 - y1,\n dr = Math.sqrt(dx * dx + dy * dy),\n\n // Defaults for normal edge.\n drx = dr,\n dry = dr,\n xRotation = 30, // degrees\n largeArc = 0, // 1 or 0\n sweep = 0; // 1 or 0\n\n // Flip curves based on target / source X/Y coord relationship \n if (d.target.y < d.source.y && d.target.x < d.source.x) {\n sweep = 1;\n } \n if (d.target.y > d.source.y && d.target.x < d.source.x) {\n sweep = 0;\n } \n if (d.target.y < d.source.y && d.target.x > d.source.x) {\n sweep = 0;\n } \n if (d.target.y > d.source.y && d.target.x > d.source.x) {\n sweep = 1;\n } \n \n // Self edge.\n if ( x1 === x2 && y1 === y2 ) {\n // Fiddle with this angle to get loop oriented.\n xRotation = -45;\n\n // Needs to be 1.\n largeArc = 1;\n\n // Change sweep to change orientation of loop. \n //sweep = 0;\n\n // Make drx and dry different to get an ellipse\n // instead of a circle.\n drx = 10;\n dry = 75;\n \n // For whatever reason the arc collapses to a point if the beginning\n // and ending points of the arc are the same, so kludge it.\n x2 = x2 + 1;\n y2 = y2 + 1;\n } \n \n return \"M\" + x1 + \",\" + y1 + \"A\" + drx + \",\" + dry + \" \" + xRotation + \",\" + largeArc + \",\" + sweep + \" \" + x2 + \",\" + y2;\n \n }", "title": "" }, { "docid": "de1d1aee8698bc8a5e5a1184d5c30268", "score": "0.4513383", "text": "static expand(aabb,dx,dy) {\n return new AxisAlignedBB2(aabb.minX-dx,aabb.minY-dy,aabb.maxX+dx,aabb.maxY+dy);\n }", "title": "" }, { "docid": "34e677b229f0b0b47277d9ed2725b8ae", "score": "0.45108283", "text": "function alignCoordinates(xss, alignTo) {\n var alignToVals = _.values(alignTo),\n alignToMin = _.min(alignToVals),\n alignToMax = _.max(alignToVals);\n\n _.forEach([\"u\", \"d\"], function(vert) {\n _.forEach([\"l\", \"r\"], function(horiz) {\n var alignment = vert + horiz,\n xs = xss[alignment],\n delta;\n if (xs === alignTo) return;\n\n var xsVals = _.values(xs);\n delta = horiz === \"l\" ? alignToMin - _.min(xsVals) : alignToMax - _.max(xsVals);\n\n if (delta) {\n xss[alignment] = _.mapValues(xs, function(x) { return x + delta; });\n }\n });\n });\n}", "title": "" }, { "docid": "34e677b229f0b0b47277d9ed2725b8ae", "score": "0.45108283", "text": "function alignCoordinates(xss, alignTo) {\n var alignToVals = _.values(alignTo),\n alignToMin = _.min(alignToVals),\n alignToMax = _.max(alignToVals);\n\n _.forEach([\"u\", \"d\"], function(vert) {\n _.forEach([\"l\", \"r\"], function(horiz) {\n var alignment = vert + horiz,\n xs = xss[alignment],\n delta;\n if (xs === alignTo) return;\n\n var xsVals = _.values(xs);\n delta = horiz === \"l\" ? alignToMin - _.min(xsVals) : alignToMax - _.max(xsVals);\n\n if (delta) {\n xss[alignment] = _.mapValues(xs, function(x) { return x + delta; });\n }\n });\n });\n}", "title": "" }, { "docid": "34e677b229f0b0b47277d9ed2725b8ae", "score": "0.45108283", "text": "function alignCoordinates(xss, alignTo) {\n var alignToVals = _.values(alignTo),\n alignToMin = _.min(alignToVals),\n alignToMax = _.max(alignToVals);\n\n _.forEach([\"u\", \"d\"], function(vert) {\n _.forEach([\"l\", \"r\"], function(horiz) {\n var alignment = vert + horiz,\n xs = xss[alignment],\n delta;\n if (xs === alignTo) return;\n\n var xsVals = _.values(xs);\n delta = horiz === \"l\" ? alignToMin - _.min(xsVals) : alignToMax - _.max(xsVals);\n\n if (delta) {\n xss[alignment] = _.mapValues(xs, function(x) { return x + delta; });\n }\n });\n });\n}", "title": "" }, { "docid": "7c1daa1a14a10cbcba8c62f421174d25", "score": "0.4505741", "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": "90213399cf7553286056e5e67a114f51", "score": "0.4503742", "text": "adjustForLength(e) {\n if (this.getNodeAtPos(e.endpoint2) != undefined) {\n return;\n }\n let extendRadius = this.gridLength * 1.5;\n let tempEndpt = vec2.fromValues(e.endpoint2[0], e.endpoint2[1]);\n let tempEndpt2 = vec2.create();\n vec2.scale(tempEndpt2, e.getDirectionVector(), extendRadius);\n vec2.add(tempEndpt2, tempEndpt2, tempEndpt);\n // create a dummy edge\n let tempEdge = new Edge(tempEndpt, tempEndpt2, -1, false);\n if (!this.fixForBounds(tempEdge) && !this.fixForWater(tempEdge)) {\n return;\n }\n let danglingEdge = this.adjustForIntersection(tempEdge);\n //danglingEdge = danglingEdge && this.adjustForEnd(tempEdge);\n if (!danglingEdge) {\n vec2.copy(e.endpoint2, tempEndpt2);\n }\n }", "title": "" }, { "docid": "d7b0bea1ba109f8591d85324db41a552", "score": "0.4498486", "text": "function alignCoordinates(xss, alignTo) {\n var alignToVals = _.values(alignTo),\n alignToMin = _.min(alignToVals),\n alignToMax = _.max(alignToVals);\n\n _.forEach([\"u\", \"d\"], function (vert) {\n _.forEach([\"l\", \"r\"], function (horiz) {\n var alignment = vert + horiz,\n xs = xss[alignment],\n delta;\n if (xs === alignTo) return;\n\n var xsVals = _.values(xs);\n delta = horiz === \"l\" ? alignToMin - _.min(xsVals) : alignToMax - _.max(xsVals);\n\n if (delta) {\n xss[alignment] = _.mapValues(xs, function (x) {\n return x + delta;\n });\n }\n });\n });\n}", "title": "" }, { "docid": "8b1dd4eed09b5f07848317429fcddcca", "score": "0.44939515", "text": "function alignCoordinates(xss, alignTo) {\n var alignToMin = _.min(alignTo),\n alignToMax = _.max(alignTo);\n\n _.each([\"u\", \"d\"], function(vert) {\n _.each([\"l\", \"r\"], function(horiz) {\n var alignment = vert + horiz,\n xs = xss[alignment],\n delta;\n if (xs === alignTo) return;\n\n delta = horiz === \"l\" ? alignToMin - _.min(xs) : alignToMax - _.max(xs);\n\n if (delta) {\n xss[alignment] = _.mapValues(xs, function(x) { return x + delta; });\n }\n });\n });\n}", "title": "" }, { "docid": "1fa9b9146ea35d67d240dc6c4cb1d4ea", "score": "0.44900575", "text": "function alignCoordinates(xss, alignTo) {\n var alignToVals = _.values(alignTo),\n alignToMin = _.min(alignToVals),\n alignToMax = _.max(alignToVals);\n\n _.forEach([\"u\", \"d\"], function(vert) {\n _.forEach([\"l\", \"r\"], function(horiz) {\n var alignment = vert + horiz,\n xs = xss[alignment],\n delta;\n if (xs === alignTo) return;\n\n var xsVals = _.values(xs);\n delta = horiz === \"l\" ? alignToMin - _.min(xsVals) : alignToMax - _.max(xsVals);\n\n if (delta) {\n xss[alignment] = _.mapValues(xs, function(x) { return x + delta; });\n }\n });\n });\n}", "title": "" }, { "docid": "3b66493c11c1f647c68d829282a90d6c", "score": "0.44785157", "text": "normalize() {\n return 'align-self'\n }", "title": "" }, { "docid": "3b66493c11c1f647c68d829282a90d6c", "score": "0.44785157", "text": "normalize() {\n return 'align-self'\n }", "title": "" }, { "docid": "241f1009a40a452eced68fb03c0956e4", "score": "0.44741982", "text": "function bottomAlignAdjust({ isSmall, orientTop }) {\n const text = select(this);\n const numLines = text.selectAll('tspan').nodes().length / 2;\n let transY = -(numLines - 1) * LINE_HEIGHT;\n\n // Making small spacing adjustements\n if (isSmall) {\n if (orientTop) transY -= 16; // Lift label above the point\n else transY = 28; // Label already hangs baseline, just push a tad more\n } else {\n transY -= CONNECTOR_LENGTH + 7; // Pad label from connector\n }\n\n return transY;\n}", "title": "" }, { "docid": "330ca76b524fc13fb84b1d050270d955", "score": "0.4465511", "text": "act() {\n if (this.target &&\n Math.abs(this.target[0] - this.x) < 5 &&\n Math.abs(this.target[1] - this.y) < 5) {\n this.moveToTarget();\n }\n }", "title": "" }, { "docid": "49662fbebc3e600d1a26495d871173fc", "score": "0.4465196", "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": "388bcabf33053c07a4af9072078eabb6", "score": "0.4434143", "text": "calculateAngleBetweenDirections(origin, target) {\n\n\t\tconst n = origin - target + 180\n\n\t\treturn (n - Math.floor(n / 360) * 360) - 180\n\n\t}", "title": "" }, { "docid": "f344dadd106b3e72a1532bbb56dd6c5e", "score": "0.4433011", "text": "angleTo(other) {\n return Math.atan2(other.y - this.y, other.x - this.x);\n }", "title": "" }, { "docid": "6f1d7d55acad347bc5b3d81ee6a455dc", "score": "0.44214958", "text": "swapEdge (source, target, edge) {\n if (edge.edgeType === this.linkEdgeType)\n this.swapLinkEdge (source, target, edge);\n else\n this.swapIncludeEdge (source, target, edge);\n this.selected = { edge: { source, target } };\n }", "title": "" }, { "docid": "6b88e5620fc362c219ce0aecb723d0b0", "score": "0.44118655", "text": "function moveTo(sourceTag, targetTag) {\r\n gl5.forEach(sourceTag, targetTag, function (source, target) {\r\n source.pos.x = target.pos.x;\r\n source.pos.y = target.pos.y;\r\n });\r\n}", "title": "" }, { "docid": "7359411b35e55d385c1ae58d8a1f9fd7", "score": "0.44041473", "text": "function tick() {\n edge.attr(\"x1\", function(d) { return d.source.x; })\n .attr(\"y1\", function(d) { return d.source.y; })\n .attr(\"x2\", function(d) { return d.target.x; })\n .attr(\"y2\", function(d) { return d.target.y; });\n\n vertex.attr(\"transform\", function(d) { \n return \"translate(\" + d.x + \",\" + d.y + \")\"; \n });\n}", "title": "" }, { "docid": "89ad44e770c0fa72868d21f4d6488a60", "score": "0.43988508", "text": "function assignMarriageOffset(familyTree, node, targetId) {\n\tconst targetPerson = familyTree.find(person => person._id === targetId);\n\tconst spouse = familyTree.find(person => person._id === node.spouse);\n\tif (!spouse) {\n\t\treturn;\n\t}\n\tconst father = familyTree.find(person => person._id === node.father);\n\tconst mother = familyTree.find(person => person._id === node.mother);\n\n\tif (!father || !mother || node.gen >= targetPerson.gen) {\n\t\t// If node is an ancestor (no parents), set leftWidth and rightWidth to 0\n\t\t// Or node is in the same generation as the target person but not the target person themself\n\t\t// since the parents of their spouses won't be shown\n\t\tnode.leftWidth = 0;\n\t\tnode.rightWidth = 0;\n\t} else {\n\t\t// If node has parents, add parent's width and parent's marriage offset\n\t\tnode.leftWidth = father.marriageOffset - node.xOffset + father.leftWidth;\n\t\tnode.rightWidth = mother.marriageOffset - node.xOffset + mother.rightWidth;\n\n\t\t// If the child node is within the width of the parent, reset leftWidth or rightWidth\n\t\t// to 0\n\t\tif (node.leftWidth > 0) {\n\t\t\tnode.leftWidth = 0;\n\t\t}\n\t\tif (node.rightWidth < 0) {\n\t\t\tnode.rightWidth = 0;\n\t\t}\n\t}\n\n\tconst baseMarriageOffset = baseWidth / 4;\n\t// node.marriageOffset = node.gender === 'm'\n\t// \t? -(node.rightWidth + radius + baseMarriageOffset)\n\t// \t: -(node.leftWidth - radius - baseMarriageOffset);\n\tnode.marriageOffset = node.gender === 'm'\n\t\t? -(node.rightWidth + baseMarriageOffset)\n\t\t: -(node.leftWidth - baseMarriageOffset);\n}", "title": "" }, { "docid": "706537b7379ef7556271c57e4980908b", "score": "0.43851262", "text": "function SetHAlignAction(spread, options) {\n _super.call(this, spread, options);\n }", "title": "" }, { "docid": "0b74305ad349e75bf0c7523dcd9776ad", "score": "0.437644", "text": "function calculateTranslationToArcCenter(d) {\n\t\n\t//alert(\"dsourcex\" + d.source.x);\n\t\n\tvar x = 100, y = 110;\n\t\n \tvar manualArcLabelPositionCorrection = 27, // works well for stroke widths between 5 and 20\n \t\ticonsize = 0; // TODO: remove global \n \t\t\n\t\t// switch direction if not in positive x-direction\n\t\tvar sx,sy,tx,ty;\n\t\tif (d.source.x <= d.target.x ) {\n\t\t\tsx = d.source.x;\n\t\t\tsy = d.source.y;\n\t\t\ttx = d.target.x;\n\t\t\tty = d.target.y;\n\t\t} else {\n\t\t\tsx = d.target.x;\n\t\t\tsy = d.target.y;\n\t\t\ttx = d.source.x;\n\t\t\tty = d.source.y;\n\t\t}\n\t\t\n\t\tvar dx = tx - sx,\n dy = (ty - sy),\n dr = Math.sqrt(dx * dx + dy * dy);\n\t\t\n\t\tvar xmid = sx + (dx - iconsize) / 2;\n\t var ymid = sy + (dy - iconsize) / 2;\n\t\t\n\t\tvar c = manualArcLabelPositionCorrection;\n\t\t\n\t\tvar m = -(dx/dy);\n\t\t\n\t\tvar b = Math.sqrt((c*c)/(m*m+1));\n\t\tvar a = Math.sqrt((c*c)-b*b); \n\t\t\n\t\t// hack: strech for larger node distances\n\t\tb = b*0.005*dr;\n\t\ta = a*0.005*dr;\n\t\t\n\t\t//mInfo.html(\"m = \" + m + \"<br> b = \" + b + \"<br>a = \" + a);\n\t\t\n\t\t// adapt position differently depending on 4 quadrants\n\t\t//var x,y;\n\t\tif (d.source.x <= d.target.x) {\n\t\t\tif (m > 0) {\n\t\t\t\tx = xmid - b;\n\t\t\t\ty = ymid - a;\n\t\t\t}\n\t\t\telse if (m <= 0) {\n\t\t\t\tx = xmid + b;\n\t\t\t\ty = ymid - a;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (m < 0) {\n\t\t\t\tx = xmid - b;\n\t\t\t\ty = ymid + a;\n\t\t\t}\n\t\t\telse if (m >= 0) {\n\t\t\t\tx = xmid + b;\n\t\t\t\ty = ymid + a;\n\t\t\t}\n\t\t} \n\n return \"translate(\" + x + \",\" + y + \")\";\n }", "title": "" }, { "docid": "91f408b65f3660de265a8f8ed04d31cd", "score": "0.43712157", "text": "replaceLinkEdge (edge, newText, newTarget) {\n const nodeByID = this.getNodesByID();\n const source = nodeByID[edge.source], oldTarget = nodeByID[edge.target];\n const isImplicit = oldTarget.nodeType === this.implicitNodeType;\n newTarget = (!isImplicit && newTarget) || oldTarget;\n const newLinkText = this.makeMarkdownStyleLink (isImplicit ? newTarget : null,\n newText || this.edgeText (edge, nodeByID),\n (isImplicit\n ? newTarget.defText\n : this.makeLinkTargetBracery (newTarget)));\n\n this.replaceDefTextSubstr ({ node: source,\n pos: edge.pos,\n newSubstr: newLinkText,\n rebuild: true });\n }", "title": "" }, { "docid": "5dd800ffbd30e0847a8744687695d71d", "score": "0.43683457", "text": "function addEdge(v,w,e){\r\n var weight = e.weight || 1\r\n if(!g.node(v) || !g.node(w)) throw new Error('Trying to set an edge to a node that does not exist')\r\n if(g.edge(v,w)==undefined){\r\n g.setEdge(v,w,{weight:weight,indirect:true})\r\n } else {\r\n g.edge(v,w).weight+=weight\r\n }\r\n }", "title": "" }, { "docid": "3dd6eacf8ec850a20a78bbd8bffe46d0", "score": "0.43675926", "text": "function splitEdge(linkerNode, targetEdge, x , y) {\r\n //Update the node color for all nodes\r\n if(linkerNode.type == \"Hallway\")\r\n linkerNode.visual.fill(nodeColor.blue);\r\n //setNodeColor(nodeColor.blue);\r\n\r\n var n = targetEdge.splitEdge(x, y);\r\n\r\n //Link the new nodes\r\n insertNode(linkerNode, n);\r\n}", "title": "" }, { "docid": "51ceafc0df697df32e665284e9c922ea", "score": "0.4362178", "text": "function hAlignRight ( key, otherObjects )\n{\n\tvar kp = key.left + key.width;\n\tfor ( var x = 0; x < otherObjects.length; x++ )\n\t{\n\t\totherObjects[ x ].left = kp - otherObjects[ x ].width;\n\t}\n}", "title": "" }, { "docid": "4bdf0b162a976ade25f31c3ceb5eaaba", "score": "0.43596637", "text": "function linkArc(d) {\r\n let targetX = d.target.x - d.target.started,\r\n targetY = d.target.y - d.target.started,\r\n dx = targetX - d.source.x,\r\n dy = targetY - d.source.y,\r\n dr = (d.straight == 0)?Math.sqrt(dx * dx + dy * dy):0;\r\n return \"M\" + d.source.x + \",\" + d.source.y +\r\n \" L \" + targetX + \",\" + targetY;\r\n}", "title": "" }, { "docid": "91b1f9e3b0537bf6ec05486d0d38b632", "score": "0.43561113", "text": "function linkArc(d) {\n var dx = d.target.x - d.source.x,\n dy = d.target.y - d.source.y,\n dr = (dx * dx + dy * dy);\n return \"M\" + d.source.x + \",\" + d.source.y + \"A\" + dr + \",\" + dr + \" 0 0,1 \" + d.target.x + \",\" + d.target.y;\n }", "title": "" }, { "docid": "00a3c83c40107ce02d0d4b2992b5a732", "score": "0.4349996", "text": "function addEdge(e) {\n var v = e.from();\n var w = e.to();\n adj[v].add(e);\n indegree[w]++;\n E++;\n }", "title": "" }, { "docid": "32d64110cace91517f6bbaa1152899ec", "score": "0.433685", "text": "function linkArc(d) {\n\t\t\t\tconst r = Math.hypot(d.target.x - d.source.x, d.target.y - d.source.y);\n\t\t\t\treturn `\n\t\t\t\t\tM${d.source.x},${d.source.y}\n\t\t\t\t\tA${r},${r} 0 0,1 ${d.target.x},${d.target.y}\n\t\t\t\t`;\n\t\t\t}", "title": "" }, { "docid": "f43bc119422f5e894fa22c310bb1c9e4", "score": "0.43333453", "text": "getAttachmentPoint(p, q, arrow, d, center)\r\n{ \r\n const GAP = 3\r\n let xoff = GAP\r\n let yoff = -GAP - this.label.size\r\n let attach = q\r\n if (center)\r\n { \r\n if (p.x > q.x) \r\n { \r\n return this.getAttachmentPoint(q, p, arrow, d, center)\r\n }\r\n attach = new Point2D((p.x + q.x) / 2, (p.y + q.y) / 2)\r\n if (p.y < q.y)\r\n yoff = - GAP - this.label.size\r\n else if (p.y === q.y)\r\n xoff = -d.width / 2\r\n else\r\n yoff = GAP\r\n }\r\n else \r\n {\r\n if (p.x < q.x)\r\n {\r\n xoff = -GAP - d.width\r\n }\r\n if (p.y > q.y)\r\n {\r\n yoff = GAP\r\n }\r\n if (arrow !== undefined)\r\n {\r\n if (p.x < q.x)\r\n {\r\n xoff -= arrow.ENDSIZE\r\n }\r\n else\r\n {\r\n xoff += arrow.ENDSIZE\r\n }\r\n }\r\n }\r\n return new Point2D(attach.x + xoff, attach.y + yoff)\r\n}", "title": "" }, { "docid": "f62d7601119fba1c3196e4c3c537d7a5", "score": "0.43328908", "text": "function applywvel(target, wvel) {\n target.angle += wvel;\n}", "title": "" }, { "docid": "f62d7601119fba1c3196e4c3c537d7a5", "score": "0.43328908", "text": "function applywvel(target, wvel) {\n target.angle += wvel;\n}", "title": "" }, { "docid": "5845e81966e6e6eb5eb9000452cdc659", "score": "0.4330365", "text": "function center(x) { currentAlignment = alignCenter }", "title": "" }, { "docid": "027bc5ab5c9a9c8465aa79bb5f4d78de", "score": "0.43205863", "text": "function alignNode(){\n var centerX = w/2;\n var centerY = 80;\n var nearestNode = findNodeNearestToCenter();\n\n var translateX, translateY;\n console.log(nearestNode);\n translateX = (centerX - nearestNode.data.x);\n translateY = (centerY - nearestNode.data.y);\n // console.log(zoomListener.scale());\n // console.log(centerX + \" \" + centerY);\n // console.log(translateX + \" \" + translateY);\n \n // vis.transition().duration(500)\n // .attr(\"transform\", \"translate(\" + translateX + \",\" + translateY + \")\" + \"\n // scale(\" + zoomListener.scale() + \")\");\n // zoomListener.translate([translateX,translateY]).scale(zoomListener.scale());\n vis.transition().duration(500)\n .attr(\"transform\", \"translate(\" + translateX + \",\" + translateY + \")\");\n zoomListener.translate([translateX,translateY]);\n}", "title": "" }, { "docid": "b58f244464caecd77cab5a5a0bc89115", "score": "0.43154964", "text": "function moveTo( p, target ) {\n // Compute a frame with axis a1 pointing at the target.\n var a1, a2;\n\n // Build a frame (a trivial one if we're already too close).\n var dist = vecSub( target, p.pos ).mag();\n if ( dist < 0.0001 ) {\n a1 = new Vector2D( 1.0, 0.0 );\n a2 = new Vector2D( 0.0, 1.0 );\n } else {\n a1 = vecSub( target, p.pos ).scale( 1.0 / dist );\n a2 = a1.perp();\n }\n \n // Represent the pusher velocity WRT that frame.\n var v1 = vecDot( a1, p.vel );\n var v2 = vecDot( a2, p.vel );\n\n // Compute a force vector in this frame, first cancel out velocity\n // perp to the target.\n var f1 = 0;\n var f2 = -v2;\n\n // If we have remaining force to spend, use it to move toward the target.\n if ( Math.abs( f2 ) < PUSHER_ACCEL_LIMIT ) {\n var raccel = Math.sqrt( PUSHER_ACCEL_LIMIT * PUSHER_ACCEL_LIMIT - \n v2 * v2 );\n f1 = moveToLinear( -dist, v1, 0.0, raccel );\n }\n\n // Convert force \n var force = vecAdd( a1.scale( f1 ), a2.scale( f2 ) );\n System.out.print( force.x + \" \" + force.y );\n}", "title": "" }, { "docid": "6baa224f4fd7102e4e5c7b563e1b63fa", "score": "0.43129122", "text": "add_edge(start, end) {\n start.adj_vertices.push(end);\n end.in_vertices.push(start);\n }", "title": "" }, { "docid": "f9c404d4fff897c7174b7cfb04b45d9f", "score": "0.4306302", "text": "function edgeVector([beginPoint, endPoint]) {return fromTo(beginPoint, endPoint);}", "title": "" }, { "docid": "3d5814e242442892fbe9a08640ae5f47", "score": "0.4292022", "text": "function addAnchor(space){\n const ctx = myGameArea.context;\n let defaultColor = ctx.strokeStyle;\n if (anchorSquare) {\n anchorSquare.hasAnchor = false;\n updateSpace(anchorSquare);\n }\n ctx.lineWidth = 5;\n ctx.strokeStyle = \"black\";\n ctx.strokeRect(space.x + 5, space.y + 5, space.width - 10, space.height -10);\n ctx.lineWidth = 1;\n ctx.strokeStyle = defaultColor;\n anchorSquare = space;\n space.hasAnchor = true;\n}", "title": "" }, { "docid": "2cfaa7627539082d1e60ca6c4648b8ad", "score": "0.4289364", "text": "function tick() {\n path\n .style(\"stroke-width\", function (d) {\n return (d.value) * edge_factor;\n })\n .attr(\"d\", function (d) {\n var dx = d.target.x - d.source.x,\n dy = d.target.y - d.source.y,\n dr = Math.sqrt(dx * dx + dy * dy);\n return \"M\" +\n d.source.x + \",\" +\n d.source.y + \"A\" +\n dr + \",\" + dr + \" 0 0,1 \" +\n d.target.x + \",\" +\n d.target.y;\n });\n\n node\n .attr(\"transform\", function (d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n }", "title": "" }, { "docid": "f2a7bb6a61bf706b31e92df6db3cffc7", "score": "0.42824036", "text": "function addAlignment(x, y) {\n var i;\n\n frameBuffer[x + width * y] = 1;\n\n for (i = -2; i < 2; i++) {\n frameBuffer[(x + i) + width * (y - 2)] = 1;\n frameBuffer[(x - 2) + width * (y + i + 1)] = 1;\n frameBuffer[(x + 2) + width * (y + i)] = 1;\n frameBuffer[(x + i + 1) + width * (y + 2)] = 1;\n }\n\n for (i = 0; i < 2; i++) {\n setMask(x - 1, y + i);\n setMask(x + 1, y - i);\n setMask(x - i, y - 1);\n setMask(x + i, y + 1);\n }\n }", "title": "" }, { "docid": "6c2081a1543b3d9c94bd0be653a7f951", "score": "0.42816293", "text": "function align(param) {\n var xPos = param[0]; var yPos = param[1];\n for(i=2; i<param.length; i++) {\n var vname = param[i];\n var shape = STACK.get(vname);\n shape.absolutePosition({x: xPos, y: yPos});\n layer.draw();\n xPos+=shape.width() * 1.2;\n }\n PC++; loop();\n}", "title": "" }, { "docid": "7c2c8438f754e87e8cc9c27f4e57a307", "score": "0.42789555", "text": "function setBoundingClientRect(target, {x, y, width, height}) {\n target.getBoundingClientRect = function () {\n return {\n width,\n height,\n left: x,\n right: x + width,\n top: y,\n bottom: y + height,\n };\n };\n }", "title": "" }, { "docid": "7c2c8438f754e87e8cc9c27f4e57a307", "score": "0.42789555", "text": "function setBoundingClientRect(target, {x, y, width, height}) {\n target.getBoundingClientRect = function () {\n return {\n width,\n height,\n left: x,\n right: x + width,\n top: y,\n bottom: y + height,\n };\n };\n }", "title": "" }, { "docid": "4195356ac3c6080c2ac92179484e457f", "score": "0.42724785", "text": "function addEdge(edge) {\r\n var fromNode = edge[0], toNode = edge[1];\r\n var children = graph.get(toNode);\r\n if (children) {\r\n children.push(fromNode);\r\n }\r\n else {\r\n graph.set(toNode, [fromNode]);\r\n }\r\n }", "title": "" }, { "docid": "cbe5f2771e2f45670f0ed718c59e4a45", "score": "0.42656165", "text": "alignLegend(start, size, legendSize, alignment) {\n switch (alignment) {\n case 'Far':\n start = (size - legendSize) - start;\n break;\n case 'Center':\n start = ((size - legendSize) / 2);\n break;\n }\n return start;\n }", "title": "" }, { "docid": "699d3d08b7c119b3812eabed6baeaac4", "score": "0.4260495", "text": "function addEdge(edge) {\n var fromNode = edge[0], toNode = edge[1];\n var children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }", "title": "" }, { "docid": "699d3d08b7c119b3812eabed6baeaac4", "score": "0.4260495", "text": "function addEdge(edge) {\n var fromNode = edge[0], toNode = edge[1];\n var children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }", "title": "" }, { "docid": "699d3d08b7c119b3812eabed6baeaac4", "score": "0.4260495", "text": "function addEdge(edge) {\n var fromNode = edge[0], toNode = edge[1];\n var children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }", "title": "" }, { "docid": "eb5eeb2ecb5369ba83cd72f06fdbfef6", "score": "0.42557192", "text": "function _modifyBorderAroundTarget() {\n if (Utils.isValid(Components.rect)) {\n var borderOverlay = Utils.getEleFromClassName(Constants.TARGET_BORDER, true);\n borderOverlay.css({\n width: Components.rect.width + Constants.PX,\n height: Components.rect.height + Constants.PX,\n top: Components.rect.top + Constants.PX,\n left: Components.rect.left + Constants.PX\n });\n\n if (Components.stepDescription[Constants.CAN_INTERACT]) {\n borderOverlay.addClass(Constants.TARGET_INTERACTABLE);\n } else {\n borderOverlay.removeClass(Constants.TARGET_INTERACTABLE);\n }\n }\n}", "title": "" }, { "docid": "0e0e251a39cedeb5a93084568640f70d", "score": "0.4251819", "text": "function setLabelYshift(d) {\r\n // set y shift to either 5 for left and right\r\n if ((d.target.x >= (d.source.x + 20)) || (d.target.x <= (d.source.x - 20))) { return (0.5 * 0.85 / 2)\r\n + \"em\"; }\r\n // 30 if below\r\n if (d.target.y > d.source.y) { return \"2.5em\"; }\r\n // if above\r\n return \"-1.5em\";\r\n }", "title": "" }, { "docid": "09b1e6d4f7fb7181214735aeb9944eb4", "score": "0.42494857", "text": "rotateTo(targetPosition){\n\t\tvar normalVector = new Pair(0, -1);\n\t\tvar targetVector = targetPosition.minus(this.getTruePosition());\n\t\tvar dotProduct = normalVector.dot(targetVector);\n\t\tvar aMag = normalVector.magnitude();\n\t\tvar bMag = targetVector.magnitude();\n\n\t\tvar radianAngle = Math.acos(dotProduct / (aMag * bMag));\n\t\tvar rawAngle = radianAngle * 180 / Math.PI;\n\t\tif (targetVector.x < 0){\n\t\t\trawAngle = -rawAngle;\n\t\t}\n\t\tthis.setRotation(rawAngle);\n\t}", "title": "" }, { "docid": "16567a5c072497f20e893713176fdbdc", "score": "0.42449883", "text": "function calculateMid(d) {\n let xpos1 = parseInt(d.source.attr(\"x\")) + 50;\n let ypos1 = parseInt(d.source.attr(\"y\"));\n let xpos2 = parseInt(d.target.attr(\"x\")) + 50;\n let initialOffset = xpos1 - Math.sign(xpos1 - xpos2) * 20;\n let dist = initialOffset - xpos2;\n let height = ypos1 - 65 * tokenDist(d);\n return [(initialOffset + xpos2) / 2, height];\n}", "title": "" }, { "docid": "a4fd6c31ed57ee00787d6efa58eb0d0b", "score": "0.42286214", "text": "function adj(x) { if (x < 0) return -x; return x; }", "title": "" }, { "docid": "22b2cf3f361ef8c14246a3131d492317", "score": "0.42218295", "text": "function halign(){\n var elem = getFlElements(attributesNames._HALIGN_ATTR_PREFIX_);\n for (var i=elem.length-1 ; i >= 0 ; i--) {\n elem[i].style.margin = null;\n switch(getHalignMode(elem[i])) {\n case hAlignMode._HALIGNMODE_LEFT_:\n elem[i].style.left = parseInt(window.getComputedStyle(elem[i].parentNode).paddingLeft) + \"px\";\n elem[i].style.right = 'auto';\n elem[i].style.marginLeft = parseInt(window.getComputedStyle(elem[i]).marginLeft) + \"px\";\n break;\n case hAlignMode._HALIGNMODE_RIGHT_:\n elem[i].style.right = parseInt(window.getComputedStyle(elem[i].parentNode).paddingRight) + \"px\";\n elem[i].style.left = 'auto';\n elem[i].style.marginRight = parseInt(window.getComputedStyle(elem[i]).marginRight) + \"px\"; \n break;\n case hAlignMode._HALIGNMODE_CENTER_:\n var tempWidth = parseInt(elem[i].trueWidth);\n var parentWidth = parseInt(elem[i].parentNode.trueWidth);\n elem[i].style.left = Math.round((parentWidth - tempWidth) /2) + 'px';\n elem[i].style.right = Math.round((parentWidth - tempWidth) /2) + 'px';\n elem[i].style.marginLeft = parseInt(window.getComputedStyle(elem[i]).marginLeft) + \"px\";\n elem[i].style.marginRight = parseInt(window.getComputedStyle(elem[i]).marginRight) + \"px\";\n break;\n }\n }\n }", "title": "" }, { "docid": "bac2c6319b775c1bf9b7cd569147d9a9", "score": "0.42156816", "text": "set vAlign(value) {\n\t\tif (value == 'middle') {\n\t\t\tthis.pivot.y = this.getBounds().height * 0.5;\n\t\t} else if (value == 'bottom') {\n\t\t\tthis.pivot.y = this.getBounds().height;\n\t\t} else {\n\t\t\tthis.pivot.y = 0.0;\n\t\t}\n\t}", "title": "" }, { "docid": "53ca702aa73983b72efbe78888e2919d", "score": "0.42136967", "text": "updateDirection () {\r\n var diffX = this.x - player.x\r\n var diffY = this.y - player.y\r\n var norm = Math.sqrt(diffX * diffX + diffY * diffY)\r\n this.target.x = diffX / norm\r\n this.target.y = diffY / norm\r\n }", "title": "" } ]
cb1bd8c0397caf9a15447cc42aef961a
IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it also only supports 2 arguments and doesn't care what "this" is, so we can just call the original function directly.
[ { "docid": "695e1d6f7f0cbb9827db43964d29a384", "score": "0.0", "text": "function applyPatch(irrelevantThis, args) {\n return this(args[0], args[1])\n }", "title": "" } ]
[ { "docid": "06e0f4ef3aee117098f227424b137ef8", "score": "0.60434073", "text": "interval(func, time) {\n setInterval(func.bind(this), time);\n }", "title": "" }, { "docid": "42eaf84b5288326e514f3f246ce64120", "score": "0.6039086", "text": "function setInterval(cb, ms)\n{\n}", "title": "" }, { "docid": "cb1d43302fc74f156244a012d824746f", "score": "0.60135984", "text": "setIntervalAndExecute(fn, t) {\n // showSpinner();\n fn();\n return(setInterval(fn, t));\n }", "title": "" }, { "docid": "27120d76d22f1930662b870e4339bc04", "score": "0.59817165", "text": "function callIt(fn) {\r\n return fn.apply(this,Array.prototype.slice.call(arguments,1)); \r\n}", "title": "" }, { "docid": "97a46d59b23b23f3a6477a3b910e9b0b", "score": "0.5805249", "text": "function setThisWithCall(fn, thisValue, arg) {\n return fn.call(thisValue, arg)\n}", "title": "" }, { "docid": "97a46d59b23b23f3a6477a3b910e9b0b", "score": "0.5805249", "text": "function setThisWithCall(fn, thisValue, arg) {\n return fn.call(thisValue, arg)\n}", "title": "" }, { "docid": "2a294c43473c71b6910fb8f70e6444a0", "score": "0.5799675", "text": "function setIntervalFunction(fn, milliseconds) {\n intervalFunction = fn;\n return 1;\n }", "title": "" }, { "docid": "2da6b0cfa36d4298042e1cf4f0ba7d7e", "score": "0.57569855", "text": "function TimerHandler(contextObj, funcObj)\n{\n var _arguments = null;\n\n if( arguments.length > 2)\n {\n _arguments = new Array();\n\n for( var i = 2; i < arguments.length; i ++ )\n {\n _arguments[i - 2] = arguments[i];\n }\n }\n\n var _delegate = function()\n {\n if( _arguments )\n {\n funcObj.apply( contextObj, _arguments );\n }\n else\n {\n funcObj.apply( contextObj );\n }\n };\n return _delegate;\n}", "title": "" }, { "docid": "dfd982b55fc7b64075f8fa7b139d989e", "score": "0.56698513", "text": "function super_fn() {\n if (!oldFn) {\n return\n }\n each(arguments, function(arg, i) {\n args[i] = arg\n })\n return oldFn.apply(self, args)\n }", "title": "" }, { "docid": "929ab624c55dcced7580ec0f7d8bea19", "score": "0.5626889", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "title": "" }, { "docid": "929ab624c55dcced7580ec0f7d8bea19", "score": "0.5626889", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "title": "" }, { "docid": "929ab624c55dcced7580ec0f7d8bea19", "score": "0.5626889", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "title": "" }, { "docid": "929ab624c55dcced7580ec0f7d8bea19", "score": "0.5626889", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "title": "" }, { "docid": "929ab624c55dcced7580ec0f7d8bea19", "score": "0.5626889", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "title": "" }, { "docid": "929ab624c55dcced7580ec0f7d8bea19", "score": "0.5626889", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "title": "" }, { "docid": "929ab624c55dcced7580ec0f7d8bea19", "score": "0.5626889", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "title": "" }, { "docid": "929ab624c55dcced7580ec0f7d8bea19", "score": "0.5626889", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "title": "" }, { "docid": "929ab624c55dcced7580ec0f7d8bea19", "score": "0.5626889", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "title": "" }, { "docid": "064768090e3fcb40d35959a94a1fb948", "score": "0.5607356", "text": "function invokeFunPre(iid, f, base, args, isConstructor) {\n if (f === SET_INTERVAL) {\n if (args[1]) {\n var timeInterval = parseInt(args[1]);\n if (!IS_NAN(timeInterval)) {\n if (timeInterval <= 50) {\n console.log('[warning] call setInterval with interval ' + timeInterval + ' ms (less than ' + threshold + ' ms)');\n }\n }\n }\n }\n }", "title": "" }, { "docid": "e58c42817a4184c42dbf5778ad77fedf", "score": "0.5604074", "text": "function setImmediateInterval(funcToRun, ms) {\n // right away call that function\n funcToRun();\n // run a regular interval\n return setInterval(funcToRun, ms);\n }", "title": "" }, { "docid": "c402aa0186d5ada38ef4b784f525ee40", "score": "0.55583256", "text": "static looper(Function, delay, numberOfLoop, ...funcArgs) {\n return new TimerReapeter(Function, delay, numberOfLoop, ...funcArgs)\n }", "title": "" }, { "docid": "3f6a406aa4052beeffe82bde92ada19a", "score": "0.5555917", "text": "function superCall(context,methodName){var args=zrUtil.slice(arguments,2);return this.superClass.prototype[methodName].apply(context,args);}", "title": "" }, { "docid": "34b15df92bc9cf545758d2a5c3e55bd5", "score": "0.55163", "text": "function call() {\n var args = _.toArray(arguments);\n if (_.isFunction(args[0])) {\n var func = args[0];\n if (args.length === 1) {\n func();\n } else if (args.length === 2) {\n if (_.isArray(args[1])) {\n func.apply(this, args[1]);\n } else {\n func.apply(args[1]);\n }\n } else {\n if (_.isArray(args[2])) {\n func.apply(args[1], args[2]);\n } else if (_.isArray(args[1])) {\n func.apply(args[2], args[1]);\n } else {\n func();\n }\n }\n }\n }", "title": "" }, { "docid": "4e96800b94bc9b1dd5142f68e71eebdc", "score": "0.5489944", "text": "function protectSetIntervalAndSetTimeout(){\n // This protects setTimeout\n var originalSetTimeout = window.setTimeout;\n window.setTimeout = function(fn, delay){\n return originalSetTimeout(getProtectedFn(fn), delay)\n };\n\n // And this does the same with setInterval\n var originalSetInterval = window.setInterval;\n window.setInterval = function(fn, delay){\n return originalSetInterval(getProtectedFn(fn), delay);\n }\n }", "title": "" }, { "docid": "f10e053259a60b594d52ae5dc03d6d50", "score": "0.5473816", "text": "function quoteTimer(func) {\nwindow.setInterval(func, 10000);\n}", "title": "" }, { "docid": "869a3611950cb035100bd9a6969bb847", "score": "0.5469403", "text": "function wrapperedOrigCall(orgFunc, newFunc) {\n return function() {\n var args = [].slice.call(arguments);\n try { orgFunc.apply(WinConsole, args); } catch (e) {}\n try { newFunc.apply(console, args); } catch (e) {}\n };\n}", "title": "" }, { "docid": "14e7c0ee871e7f5bb8fcb0e497a01d82", "score": "0.54399616", "text": "function timerCall() {\n\n }", "title": "" }, { "docid": "823b38f4476b89d275ecd997722cb93b", "score": "0.54375637", "text": "function safeWrap(f) {\r\n return function() {\r\n setTimeout.apply(window, [f, 0].concat([].slice.call(arguments)));\r\n };\r\n}", "title": "" }, { "docid": "e6bc2f3e0273fa0d9708119e88dcbad8", "score": "0.5415881", "text": "function throttled(originalFunc, delay) {\n\n\t\tvar deferId = null,\n\t\t\tcontext = null,\n\t\t\targs = null;\n\n\t\tfunction execute() {\n\n\t\t\tvar currentContext = context,\n\t\t\t\tcurrentArgs = args;\n\n\t\t\tdeferId = null;\n\t\t\tcontext = null;\n\t\t\targs = null;\n\t\t\toriginalFunc.apply(currentContext, currentArgs);\n\t\t}\n\n\t\treturn function wrapper() {\n\n\t\t\tvar i;\n\n\t\t\tcontext = this;\n\t\t\targs = [];\n\t\t\tfor (i = 0; i < arguments.length; i += 1) {\n\t\t\t\targs.push(arguments[i]);\n\t\t\t}\n\n\t\t\tif (!deferId) {\n\t\t\t\tdeferId = setTimeout(execute, delay);\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "8fe9e865f007b1536d1524e6e1747255", "score": "0.5413532", "text": "governed(callback, args = [], callingContext = null) {\n return callback.apply(callingContext, args);\n }", "title": "" }, { "docid": "99492cefa611d7c9e9fa6f974172ff60", "score": "0.54122305", "text": "static looperInstant(Function, delay, numberOfLoop, ...funcArgs) {\n return new TimerReapeterInstant(Function, delay, numberOfLoop, ...funcArgs)\n }", "title": "" }, { "docid": "3ce24f1a86c27058df93bf1fea2fb2fe", "score": "0.53899515", "text": "function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,n=0,i=null,r=void 0,o=void 0,a=void 0,s=function(){n=Date.now(),i=null,r=t.apply(o,a),i||(o=null,a=[])};return function(){var u=Date.now(),c=e-(u-n);o=this;for(var h=arguments.length,l=Array(h),d=0;d<h;d++)l[d]=arguments[d];return a=l,c<=0||c>e?(i&&(clearTimeout(i),i=null),n=u,r=t.apply(o,a),i||(o=null,a=[])):i||(i=window.setTimeout(s,c)),r}}", "title": "" }, { "docid": "2948f34e5e0d1bcb4bc0ef8bbcb95501", "score": "0.53616667", "text": "function invoke(fn) {\n if (fn) {\n var args = Array.prototype.slice.call(arguments, 1);\n process.nextTick(function() {\n fn.apply(null, args);\n });\n }\n}", "title": "" }, { "docid": "2948f34e5e0d1bcb4bc0ef8bbcb95501", "score": "0.53616667", "text": "function invoke(fn) {\n if (fn) {\n var args = Array.prototype.slice.call(arguments, 1);\n process.nextTick(function() {\n fn.apply(null, args);\n });\n }\n}", "title": "" }, { "docid": "64374702f2a9f7c69dc694c2d6417f0a", "score": "0.5351395", "text": "call (ctime){\n if (this.lastCall > ctime ){\n this.lastCall = ctime ;\n }\n this.timeDiff = ctime - this.lastCall ;\n if ( this.timeDiff >= this.interval ){\n this.lastCall = ctime ;\n this.timeDiff = 0 ;\n if ( this.active == true ){\n this.callback() ;\n }\n }\n }", "title": "" }, { "docid": "5cd4473a48295031314901021c6081d2", "score": "0.53513265", "text": "function wrapper(fn, time, cb) {\n\treturn function () {\n\t\tfn.apply(this, arguments);\n\t\tif (time-- <= 0) {\n\t\t\tcb.apply(this, arguments);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "d00f2d62834f1298cfd95f3711b158b5", "score": "0.53493476", "text": "function wrappedOrigCall(orgFunc, newFunc) {\n return function() {\n var args = [].slice.call(arguments);\n try { orgFunc.apply(WinConsole, args); } catch (e) {}\n try { newFunc.apply(console, args); } catch (e) {}\n };\n }", "title": "" }, { "docid": "c3d3a46c3558be6cf2adf66fcdab3bd6", "score": "0.5341463", "text": "function wrappedOrigCall(orgFunc, newFunc) {\n return function() {\n var args = [].slice.call(arguments);\n try { orgFunc.apply(WinConsole, args); } catch (e) {}\n try { newFunc.apply(console, args); } catch (e) {}\n };\n }", "title": "" }, { "docid": "4ede96f109c3e73f41d6be5a743a01b6", "score": "0.5338306", "text": "function actionWrapper(arg) {\n try {\n if (passArg) {\n action(+arg); // requestAnimationFrame\n } else {\n action(); // setTimeout, setInterval\n }\n } catch (e) {\n Domado_.handleUncaughtException(\n target, e, '<setName callback>');\n }\n }", "title": "" }, { "docid": "f8549104ee8814febfc303398b4e085d", "score": "0.53337914", "text": "function wrappedOrigCall(orgFunc, newFunc) {\n return function() {\n var args = [].slice.call(arguments);\n try { orgFunc.apply(WinConsole, args); } catch (e) {}\n try { newFunc.apply(console, args); } catch (e) {}\n };\n}", "title": "" }, { "docid": "1de4290bc7c94cd9b47fde389c7c1365", "score": "0.53299093", "text": "wrapCallback(thisArg, callback){\n return (...args) => {\n try {\n callback.bind(thisArg)(...args);\n } catch (e) {\n console.error(e);\n this.tacticalRestart();\n }\n };\n }", "title": "" }, { "docid": "1b265ac30c9a8672182159572af541cc", "score": "0.5327928", "text": "function wrapper(fn, time, cb) {\n\treturn function() {\n\t\tif (time-- < 0) return\n\t\tfn.apply(this, arguments)\n\t\tif (time <= 0) cb && cb.apply(this, arguments)\n\t}\n}", "title": "" }, { "docid": "622994eb8a1c9871195e67957bb37a3d", "score": "0.5300808", "text": "function $o(f,t,i){return i?setInterval(f,t):((T(t,3))?setTimeout(f,t):(t?clearInterval(f):clearTimeout(f)))}", "title": "" }, { "docid": "8199a3bc7761adde286daff7912c332b", "score": "0.5219954", "text": "function d(a,b){b?setTimeout(a,b):a()}", "title": "" }, { "docid": "8199a3bc7761adde286daff7912c332b", "score": "0.5219954", "text": "function d(a,b){b?setTimeout(a,b):a()}", "title": "" }, { "docid": "8199a3bc7761adde286daff7912c332b", "score": "0.5219954", "text": "function d(a,b){b?setTimeout(a,b):a()}", "title": "" }, { "docid": "8199a3bc7761adde286daff7912c332b", "score": "0.5219954", "text": "function d(a,b){b?setTimeout(a,b):a()}", "title": "" }, { "docid": "49479d93f80b86a6ab3da9d6a94b5019", "score": "0.5217101", "text": "function setThisWithApply(fn, thisValue, args) {\n return fn.apply(thisValue, [args[0], args[1]])\n}", "title": "" }, { "docid": "4611461ff712609c692a557be30e7c0c", "score": "0.52171004", "text": "call(){\n this.func(this.obj);\n }", "title": "" }, { "docid": "d9bdece2eff89a909aac979fa6f55a26", "score": "0.5212902", "text": "function throttle(fn, interval) {\n\t\tvar lastCall, timeoutId;\n\t\treturn function () {\n\t\t\tvar now = new Date().getTime();\n\t\t\tif (lastCall && now < (lastCall + interval)) {\n\t\t\t\t// if we are inside the interval we wait\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\ttimeoutId = setTimeout(function () {\n\t\t\t\t\tlastCall = now;\n\t\t\t\t\tfn.call();\n\t\t\t\t}, interval - (now - lastCall));\n\t\t\t} else {\n\t\t\t\t// otherwise, we directly call the function \n\t\t\t\tlastCall = now;\n\t\t\t\tfn.call();\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "867542e0ac347e6de5ad5890a339f71c", "score": "0.5189043", "text": "function setThisWithApply(fn, thisValue, args) {\n return fn.apply(thisValue, args)\n}", "title": "" }, { "docid": "c5d910519df13ea487c910c2bafc5c11", "score": "0.5179318", "text": "function runNow(){cancelTimer=null,start=null,runScheduledForNextTick=!1,fn.apply(ctx,args)}", "title": "" }, { "docid": "f56e6910654141358fcf28fced243945", "score": "0.51628983", "text": "function executeAndRepeat(options, callback){\n\tsetTimeout(function(){\n\t\t var interval = setInterval(options.fn, options.repeatEvery);\n\t\t options.fn();\n\t\t // console.log(interval);\n\t\t if(callback) return callback(null, interval);\n\t}, options.startIn)\n}", "title": "" }, { "docid": "551652476b135aedc3196c6f24ccf1f8", "score": "0.51514775", "text": "function throttle(fn, interval) {\n var lastCall, timeoutId;\n return function () {\n var now = new Date().getTime();\n if (lastCall && now < (lastCall + interval) ) {\n // if we are inside the interval we wait\n clearTimeout(timeoutId);\n timeoutId = setTimeout(function () {\n lastCall = now;\n fn.call();\n }, interval - (now - lastCall) );\n } else {\n // otherwise, we directly call the function \n lastCall = now;\n fn.call();\n }\n };\n }", "title": "" }, { "docid": "855923f5af190c9ed3f9b253dd87b98d", "score": "0.5143059", "text": "static looperInstantRunAfter(Function, delay, numberOfLoop, ...funcArgs) {\n return new TimerReapeaterInstantWithFunctionAfter(Function, delay, numberOfLoop, ...funcArgs)\n }", "title": "" }, { "docid": "b05c819945776435468221707ac789de", "score": "0.51283395", "text": "function superCall(context, methodName) {\n var args = [];\n\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n\n return this.superClass.prototype[methodName].apply(context, args);\n}", "title": "" }, { "docid": "570128d29c5292f0325a2705165551c3", "score": "0.5123776", "text": "function setTimeout(cb, ms)\n{\n}", "title": "" }, { "docid": "31a0c6c3be6c3e09304387c65e75a080", "score": "0.5121003", "text": "function interval(func, wait, times, _this) {\n var inner = function (t) {\n return function () {\n if (typeof t !== \"undefined\" && t-- > 0) {\n return;\n }\n _interval = setTimeout(inner, wait);\n try {\n func.call(_this);\n } catch (e) {\n t = 0; // Don't call again\n throw e; // Throw orriginal error\n }\n };\n }(times);\n setTimeout(inner, wait);\n}", "title": "" }, { "docid": "a5ed81d06279e820e0c7a69a76dbba93", "score": "0.5112899", "text": "function fastScheduler(fn, val) {\n fn(val);\n}", "title": "" }, { "docid": "7b3b3a1d5c66b7e9d4be70b30bec68f5", "score": "0.51019", "text": "function runNow() {\n cancelTimer = null;\n start = null;\n runScheduledForNextTick = false;\n fn.apply(ctx, args);\n }", "title": "" }, { "docid": "925888d46eaac99a858eeb492462d662", "score": "0.5088897", "text": "function friendlyScheduler(fn, val) {\n setImmediate(fn, val);\n}", "title": "" }, { "docid": "bd652fd6b76ef5862cf589f3ce312fac", "score": "0.5087978", "text": "function defer(func) {\n var args = Array[PROTOTYPE].slice[CALL](arguments, 1);\n setTimeout(function(){ return func[APPLY](NULL, args); }, 1);\n }", "title": "" }, { "docid": "eac31339c775838fcdd12493342d56f6", "score": "0.5081383", "text": "function wrapped() {\n var warned = false;\n\n if (!warned) {\n process.emitWarning(string, 'DeprecationWarning');\n warned = true;\n }\n\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n return func.apply(this, args);\n }", "title": "" }, { "docid": "c35239c259de33646d022fdaee86fd64", "score": "0.5079216", "text": "start() {\n // don't do anything if we're already started\n if (this._timerId) return;\n\n this._timerId = setInterval(() => {\n this._fn(this);\n }, this._time);\n\n return this;\n }", "title": "" }, { "docid": "1683f97dabeaffee18ef2ad3a40a2d4f", "score": "0.50783527", "text": "function transparentWrapping( fun ){\n return function(arg){\n return fun.apply(null, arguments);\n }\n}", "title": "" }, { "docid": "ee5cf2d63829ca03eb14c770396d8958", "score": "0.50712633", "text": "function setIntervalSafe(func, time) {\n\tif (isNaN(time) || parseInt(time) < 1000) {\n\t\tthrow Error(\"jerror with setinterval safe: \" + time + \" is NAN or too small\");\n\t} else {\n\t\treturn setInterval(func, time); \n\t}\n}", "title": "" }, { "docid": "1786d5a1c1b03d5f8327ca0673587d3c", "score": "0.50590575", "text": "function disfuncCall($dis, self, var_args) {\n return $dis.apply(self, Array.slice(arguments, 2));\n }", "title": "" }, { "docid": "709b1167730947551862bcbaa55cf485", "score": "0.50526", "text": "Timer(fn, t) {\n var timerObj = setInterval(fn, t);\n\n // stop the timer\n this.stop = function() {\n if (timerObj) {\n clearInterval(timerObj);\n timerObj = null;\n }\n return this;\n }\n\n // start timer using current settings (if it's not already running)\n this.start = function() {\n if (!timerObj) {\n this.stop();\n timerObj = setInterval(fn, t);\n }\n return this;\n }\n\n // start with new interval, stop current interval\n this.reset = function(newT) {\n t = newT;\n return this.stop().start();\n }\n }", "title": "" }, { "docid": "68ef21383d2d0d4032bf8749a63b2cb9", "score": "0.50447536", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t/*\n\t\t * If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t * to allow future `callback` executions.\n\t\t */\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t/*\n\t\t\t * Since `wrapper` is being called for the first time and\n\t\t\t * `debounceMode` is true (at begin), execute `callback`.\n\t\t\t */\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t/*\n\t\t\t * In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t * `callback`.\n\t\t\t */\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t/*\n\t\t\t * In trailing throttle mode, since `delay` time has not been\n\t\t\t * exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t * recent execution.\n\t\t\t *\n\t\t\t * If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t * after `delay` ms.\n\t\t\t *\n\t\t\t * If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t * execute after `delay` ms.\n\t\t\t */\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "68ef21383d2d0d4032bf8749a63b2cb9", "score": "0.50447536", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t/*\n\t\t * If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t * to allow future `callback` executions.\n\t\t */\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t/*\n\t\t\t * Since `wrapper` is being called for the first time and\n\t\t\t * `debounceMode` is true (at begin), execute `callback`.\n\t\t\t */\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t/*\n\t\t\t * In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t * `callback`.\n\t\t\t */\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t/*\n\t\t\t * In trailing throttle mode, since `delay` time has not been\n\t\t\t * exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t * recent execution.\n\t\t\t *\n\t\t\t * If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t * after `delay` ms.\n\t\t\t *\n\t\t\t * If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t * execute after `delay` ms.\n\t\t\t */\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "68ef21383d2d0d4032bf8749a63b2cb9", "score": "0.50447536", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t/*\n\t\t * If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t * to allow future `callback` executions.\n\t\t */\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t/*\n\t\t\t * Since `wrapper` is being called for the first time and\n\t\t\t * `debounceMode` is true (at begin), execute `callback`.\n\t\t\t */\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t/*\n\t\t\t * In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t * `callback`.\n\t\t\t */\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t/*\n\t\t\t * In trailing throttle mode, since `delay` time has not been\n\t\t\t * exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t * recent execution.\n\t\t\t *\n\t\t\t * If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t * after `delay` ms.\n\t\t\t *\n\t\t\t * If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t * execute after `delay` ms.\n\t\t\t */\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "a751b34009e4ea5416fa167fab851b0b", "score": "0.50425464", "text": "function defer1(f, ms) {\n return function(...args) {\n let ctx = this;\n setTimeout(function() {\n return f.apply(ctx, args);\n }, ms);\n };\n }", "title": "" }, { "docid": "6d013ba654b80bc9fb10745dfb0c4e29", "score": "0.5036176", "text": "function wrapper () {\n\n\t\t\tvar self = this;\n\t\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\t\tvar args = arguments;\n\n\t\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\t\tfunction exec () {\n\t\t\t\tlastExec = Number(new Date());\n\t\t\t\tcallback.apply(self, args);\n\t\t\t}\n\n\t\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t\t// to allow future `callback` executions.\n\t\t\tfunction clear () {\n\t\t\t\ttimeoutID = undefined;\n\t\t\t}\n\n\t\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\t\texec();\n\t\t\t}\n\n\t\t\t// Clear any existing timeout.\n\t\t\tif ( timeoutID ) {\n\t\t\t\tclearTimeout(timeoutID);\n\t\t\t}\n\n\t\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t\t// `callback`.\n\t\t\t\texec();\n\n\t\t\t} else if ( noTrailing !== true ) {\n\t\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t\t// recent execution.\n\t\t\t\t//\n\t\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t\t// after `delay` ms.\n\t\t\t\t//\n\t\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t\t// execute after `delay` ms.\n\t\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "6d013ba654b80bc9fb10745dfb0c4e29", "score": "0.5036176", "text": "function wrapper () {\n\n\t\t\tvar self = this;\n\t\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\t\tvar args = arguments;\n\n\t\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\t\tfunction exec () {\n\t\t\t\tlastExec = Number(new Date());\n\t\t\t\tcallback.apply(self, args);\n\t\t\t}\n\n\t\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t\t// to allow future `callback` executions.\n\t\t\tfunction clear () {\n\t\t\t\ttimeoutID = undefined;\n\t\t\t}\n\n\t\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\t\texec();\n\t\t\t}\n\n\t\t\t// Clear any existing timeout.\n\t\t\tif ( timeoutID ) {\n\t\t\t\tclearTimeout(timeoutID);\n\t\t\t}\n\n\t\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t\t// `callback`.\n\t\t\t\texec();\n\n\t\t\t} else if ( noTrailing !== true ) {\n\t\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t\t// recent execution.\n\t\t\t\t//\n\t\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t\t// after `delay` ms.\n\t\t\t\t//\n\t\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t\t// execute after `delay` ms.\n\t\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "f0b9eca7ba24fdcdc8d6cd47d6cefa8e", "score": "0.503115", "text": "extendFunc( oldFunc, newFunc ) {\n\n return function() {\n\n oldFunc.apply(this);\n newFunc.apply(this);\n\n };\n\n }", "title": "" }, { "docid": "a800f6edf75d8eb244b296e908c82c39", "score": "0.5026529", "text": "function wrapper() {\n\t for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {\n\t arguments_[_key] = arguments[_key];\n\t }\n\n\t var self = this;\n\t var elapsed = Date.now() - lastExec;\n\n\t if (cancelled) {\n\t return;\n\t } // Execute `callback` and update the `lastExec` timestamp.\n\n\n\t function exec() {\n\t lastExec = Date.now();\n\t callback.apply(self, arguments_);\n\t }\n\t /*\n\t * If `debounceMode` is true (at begin) this is used to clear the flag\n\t * to allow future `callback` executions.\n\t */\n\n\n\t function clear() {\n\t timeoutID = undefined;\n\t }\n\n\t if (debounceMode && !timeoutID) {\n\t /*\n\t * Since `wrapper` is being called for the first time and\n\t * `debounceMode` is true (at begin), execute `callback`.\n\t */\n\t exec();\n\t }\n\n\t clearExistingTimeout();\n\n\t if (debounceMode === undefined && elapsed > delay) {\n\t /*\n\t * In throttle mode, if `delay` time has been exceeded, execute\n\t * `callback`.\n\t */\n\t exec();\n\t } else if (noTrailing !== true) {\n\t /*\n\t * In trailing throttle mode, since `delay` time has not been\n\t * exceeded, schedule `callback` to execute `delay` ms after most\n\t * recent execution.\n\t *\n\t * If `debounceMode` is true (at begin), schedule `clear` to execute\n\t * after `delay` ms.\n\t *\n\t * If `debounceMode` is false (at end), schedule `callback` to\n\t * execute after `delay` ms.\n\t */\n\t timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t }\n\t }", "title": "" }, { "docid": "ae5581d02b3d43535f099048024cef3e", "score": "0.5024939", "text": "clockWork() {\n const that = this;\n that.interval(that.setDate.bind(this), 1000);\n }", "title": "" }, { "docid": "aaf82fc2620a176ae9175d75ee3c81a2", "score": "0.5024423", "text": "function throttle(fn, interval) {\n\t\tlet lastCall, timeoutId;\n\t\treturn function() {\n\t\t\tlet now = new Date().getTime();\n\t\t\tif (lastCall && now < lastCall + interval) {\n\t\t\t\t// if we are inside the interval we wait\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\ttimeoutId = setTimeout(function() {\n\t\t\t\t\tlastCall = now;\n\t\t\t\t\tfn.call();\n\t\t\t\t}, interval - (now - lastCall));\n\t\t\t} else {\n\t\t\t\t// otherwise, we directly call the function\n\t\t\t\tlastCall = now;\n\t\t\t\tfn.call();\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "21d28c91d60f37144cf201c13ab3444f", "score": "0.50219727", "text": "function wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}", "title": "" }, { "docid": "d5fc653006de0ef6212cacc9bd609f93", "score": "0.5014027", "text": "function superCall(context, methodName) {\n var args = slice(arguments, 2);\n return this.superClass.prototype[methodName].apply(context, args);\n }", "title": "" }, { "docid": "3474e5281b6e4e4428db1bacc4e5c58a", "score": "0.50109375", "text": "static looperRunAfter(Function, delay, numberOfLoop, ...funcArgs) {\n return new TimerReapeaterWithFunctionAfter(Function, delay, numberOfLoop, ...funcArgs)\n }", "title": "" }, { "docid": "8f50c9b56b2b48c7ed9778d25bf8e9e1", "score": "0.50088066", "text": "function callBackFunction(){\n function luki1(num, str){\n console.log(`Number: ${num}, string: ${str}`);\n console.log(this);\n }\n\n const baseObject = {\n name: 'Luki',\n cars: 2,\n methodLuki: function(fn){\n fn();\n }\n }\n\n baseObject.methodLuki(luki1.bind(this, 13, 'Hello'));//wywołuje funkcje z parametrami, this = window\n luki1.call(this, 15, 'luki15');//wywołanie funkcji z parametrami, this = window\n luki1.call(baseObject, 16, 'luki16');//wywołanie funkcji z parametrami, this = obiekt baseObject\n\n luki1.apply(this, [17, 'luki17']);//wywołuje funkcje z parametrami, this = window\n luki1.apply(baseObject, [17, 'luki17']);//wywołuje funkcje z parametrami, this = window\n}", "title": "" }, { "docid": "382fa1228c1e3dfcdf2a4543a4785314", "score": "0.49957433", "text": "function apply_invocation() {\r\n\t// basic example\r\n\tvar add = function(x, y) { return x + y; };\r\n\tvar sum = add.apply(null, [2,3]);\t\t// invokes add on 2 and 3 setting this to null\r\n\tvar sum2 = add.call(null, 2, 3);\t\t// same thing \r\n\tconsole.log(sum);\r\n\tconsole.log(sum2);\r\n\r\n\t// example with object \r\n\tvar Robot = function(str) { this.status = str; };\r\n\tvar myRobot = new Robot(\"speaking\");\r\n\tRobot.prototype.getStatus = function() { return this.status; };\r\n\tconsole.log(myRobot.getStatus());\r\n\tvar myOtherRobot = { status: \"searching\" };\r\n\t\r\n\t// Can apply getStatus to myOtherRobot\r\n\tvar returned_status = Robot.prototype.getStatus.apply(myOtherRobot);\t// set myOtherRobot as this, no arguments\r\n\tconsole.log(returned_status);\r\n\r\n}", "title": "" }, { "docid": "0b1d1b66f6c17fca7dbed8bae10d23b0", "score": "0.49929872", "text": "function cumulativeDelayed (fn, ms, ctx) {\n var args = slice(arguments, 3),\n timeout = null;\n return function cumulativeDelayeder () {\n var _args = slice(arguments),\n f = function cumulativeDelayedCaller () {\n return fn.apply(ctx || null, args.concat(_args));\n };\n if (timeout != null) {\n clearTimeout(timeout);\n }\n return timeout = setTimeout(f, ms);\n };\n }", "title": "" }, { "docid": "46127e3aa780b8323421f26c576f8894", "score": "0.49919745", "text": "function wrapper() {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec() {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear() {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif (debounceMode && !timeoutID) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif (timeoutID) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif (debounceMode === undefined && elapsed > delay) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\t\t} else if (noTrailing !== true) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\t}", "title": "" } ]
b5eb7db206c6af6ec29ebf2b8f8f68f4
transformToObject json to object
[ { "docid": "99b19eb03075fe46779d88d792b7f64f", "score": "0.6862238", "text": "function transformToObject(text) {\n return JSON.parse(text);\n}", "title": "" } ]
[ { "docid": "f1aa3d0948735d883dfd58f17e850bcc", "score": "0.7051359", "text": "extractFromJson(obj) {\n if (obj) {\n obj = JSON.parse(obj);\n return obj;\n }\n }", "title": "" }, { "docid": "b194947809a9a157daa5af86d87e3378", "score": "0.671697", "text": "deserialize (obj) {\n return CircularJSON.parse(obj, (key, value) => {\n try {\n if (typeof value !== 'string') return value\n\n // Stringified function? (Not recommended)\n if (value.substring(0, 8) == 'function' || value.includes(' => ')) {\n return eval('(' + value + ')')\n }\n\n // Primitive datatype\n else {\n return value\n }\n } catch (err) {\n return undefined\n }\n })\n }", "title": "" }, { "docid": "7aed63c550bb18a5313cd6a3e8fe944c", "score": "0.66527945", "text": "function transformJson (json, fn) {\n return JSON.stringify(\n fn(\n JSON.parse(json)\n )\n )\n}", "title": "" }, { "docid": "b95b4b1e5b70e7ba402f1d809552cdf9", "score": "0.64719445", "text": "function convertToObject(jsonString){\n if (typeof jsonString === 'undefined' ||\n jsonString === null){\n throw new Error('argument jsonString is null or undefined');\n }\n try {\n return JSON.parse(jsonString);\n }\n catch (error){\n throw new Error('Item found is not in JSON format.')\n }\n}", "title": "" }, { "docid": "f70cbb7c4bb4c19ad033a0e6dc670c0d", "score": "0.6050757", "text": "static deserialize(obj,data) {\n\n if(!data) {\n throw new Error(\"No data given!\")\n }\n\n let parsed = JSON.parse(data);\n Object.assign(obj, parsed);\n return obj;\n\n }", "title": "" }, { "docid": "27154e7b6d9d696ee2c869f9b82c42bd", "score": "0.604179", "text": "deserializeTo(obj) {\n return obj.decode(this.data)\n }", "title": "" }, { "docid": "0f99e66675e0e5cf777e78dd7d214055", "score": "0.59487426", "text": "function createJsonFromObject(element) {\n const result = { v: {}, m: {}, r: \"\", w: \"\" };\n const values = result.v;\n function convertValue(elementValue) {\n if (Array.isArray(elementValue)) {\n // Do not send out arrays or objects\n const value = {};\n for (let n in elementValue) {\n const childItem = elementValue[n];\n value[n] = convertValue(childItem);\n }\n return value;\n }\n else if (((typeof elementValue === \"object\" || typeof elementValue === \"function\") && (elementValue !== null))) {\n // This is an object, so perform the transformation\n return createJsonFromObject(elementValue);\n }\n else {\n return elementValue;\n }\n }\n if (!element.isReference) {\n for (const key in element.getPropertyValues()) {\n let elementValue = element.get(key);\n values[key] = convertValue(elementValue);\n }\n }\n else {\n // Object is reference\n result.r = element.uri;\n result.w = element.workspace;\n }\n if (element.metaClass !== undefined && element.metaClass !== null) {\n result.m = element.metaClass;\n }\n return result;\n }", "title": "" }, { "docid": "c69b80df5be9323e94a193466cc6b608", "score": "0.5937333", "text": "function fromJSON(cls, result, json) {\n if (((json) === (null)) || ((json).isNull())) {\n return null;\n }\n var idx = 0;\n if ((result) === (null)) {\n if (((cls).name) === (\"builtin.String\")) {\n var s = (json).getString();\n return s;\n }\n if (((cls).name) === (\"builtin.float\")) {\n var flt = (json).getNumber();\n return flt;\n }\n if (((cls).name) === (\"builtin.int\")) {\n var i = Math.round((json).getNumber());\n return i;\n }\n if (((cls).name) === (\"builtin.bool\")) {\n var b = (json).getBool();\n return b;\n }\n result = (cls).construct([]);\n }\n if (((cls).name) === (\"builtin.List\")) {\n var list = result;\n while ((idx) < ((json).size())) {\n (list).push(fromJSON(((cls).getParameters())[0], null, (json).getListItem(idx)));\n idx = (idx) + (1);\n }\n return list;\n }\n var fields = (cls).getFields();\n while ((idx) < ((fields).length)) {\n var f = (fields)[idx];\n idx = (idx) + (1);\n if ((((f).name).indexOf(\"_\")===0)) {\n continue;\n }\n if (!(((json).getObjectItem((f).name)).isNull())) {\n (result)._setField(((f).name), (fromJSON((f).getType(), null, (json).getObjectItem((f).name))));\n }\n }\n return result;\n}", "title": "" }, { "docid": "d39feb35d6cc77b8fe0f1b22ad1373a0", "score": "0.5897129", "text": "function turnResponseIntoObject(response) {\n return response.json();\n}", "title": "" }, { "docid": "f6c954a43ce4c2e770246d80f87419f9", "score": "0.5855356", "text": "function TypedJSON(json) {\n var copy;\n // Handle the 3 simple types, and null or undefined\n if (null == json || \"object\" != typeof json)\n return json;\n // Handle Date\n if (json instanceof Date) {\n copy = new Date();\n copy.setTime(json.getTime());\n return copy;\n }\n // Handle Array\n if (json instanceof Array) {\n copy = [];\n for (var i = 0, len = json.length; i < len; i++) {\n copy[i] = TypedJSON(json[i]);\n }\n return copy;\n }\n // Handle Object\n if (json instanceof Object) {\n var TypeName = \"TypeName\";\n var name;\n if (json.hasOwnProperty(TypeName)) {\n //to use eval to create new class;\n name = json[TypeName];\n copy = eval(\"new \" + name + \"()\");\n }\n else {\n copy = {};\n }\n for (var attr in json) {\n if (attr != \"TypeName\" && json.hasOwnProperty(attr))\n copy[attr] = TypedJSON(json[attr]);\n }\n return copy;\n }\n }", "title": "" }, { "docid": "f2cdb0b43678cee8905808e7953d84f5", "score": "0.5849127", "text": "function processObject(json) {\n var obj = {};\n var objStr = getOuterObject(json); // Returns the outermost object\n var body = getBody(objStr).trim(); // Returns body of outer object\n\n if (body.length > 0) {\n processPairs(body);\n }\n\n return obj;\n\n function processPairs(str) {\n // Receives body of object\n // If body is another object/array, call checkType to handle\n // If body is a value, process the next pair\n // If the body contains more pairs, slice the remaining body\n // Recursively call processPairs on the rest of the pairs\n if (str[0] === '[' || str[0] === '{') {\n return checkType(str);\n } else {\n // The next set of open/close quotes is a key\n // The remainder of the body after the next colon is the key's value\n // (plus potential other pairs)\n var key = getValueString(str);\n var strRemainder = str.slice(key.length);\n strRemainder = strRemainder.slice(strRemainder.indexOf(':') + 1).trim();\n\n if (strRemainder[0] === '[' || strRemainder[0] === '{') {\n var val = getOuterObject(strRemainder);\n obj[clean(key)] = checkType(strRemainder);\n } else {\n if (strRemainder[0] === '\"') {\n var val = getValueString(strRemainder);\n } else {\n var val = strRemainder.indexOf(',') >= 0\n ? strRemainder.slice(0, strRemainder.indexOf(','))\n : strRemainder;\n }\n obj[clean(key)] = clean(val);\n }\n\n // If there are more pairs after the value, we move the stringRemainder\n // past the previous value and after the following comma\n // Then we make the recursive call to processPairs\n if (strRemainder.length > val.length) {\n var tmp = strRemainder.substr(val.length);\n tmp = tmp.substr(tmp.indexOf(',') + 1);\n processPairs(tmp.trim());\n }\n }\n }\n }", "title": "" }, { "docid": "9379ff304760965ffc82d64894a00ad3", "score": "0.58354336", "text": "function jsonToObj(str) { // Fix? Remove these from global scope.\n\t\tif (!_.isString(str)) { return str; }\n\t\tstr = $.trim(str);\n\t\tvar b = str.charAt(0),\n\t\t\te = str.charAt(str.length-1);\n\t\t\n\t\tif (!(b=='{'&&e=='}')&&!(b=='['&&e==']')) { \n\t\t\tflagError('Invalid JSON str', str);\n\t\t\treturn str; // Fix? Return null?\n\t\t}\n\t\t// Fix. Complete these checks.\n\t\tvar obj = JSON.parse(str);\n\t\treturn obj || str; // (obj && !_.isString(obj)) ? obj : str;\n\t}", "title": "" }, { "docid": "549756cbeaa2cf525e5f59dd6e9ab0ae", "score": "0.58274084", "text": "function _getobj(json){\n try{\n return JSON.parse(json)\n }catch(e){\n return {'OK':false} \n }\n}", "title": "" }, { "docid": "79cc472b195c422a0b36a3bb92266578", "score": "0.58167845", "text": "function toLdtkJSON(json) {\n return cast(JSON.parse(json), r(\"LdtkJSON\"));\n}", "title": "" }, { "docid": "0804d530cefb33c62b525e5853e39bcc", "score": "0.5778572", "text": "function convertJsonObjectToObjects(element) {\n if (Array.isArray(element)) {\n const arrayResult = [];\n for (let m in element) {\n const inner = element[m];\n arrayResult.push(convertJsonObjectToObjects(inner));\n }\n return arrayResult;\n }\n else if ((typeof element === \"object\" || typeof element === \"function\") && (element !== null)) {\n return convertJsonObjectToDmObject(element);\n }\n return element;\n }", "title": "" }, { "docid": "6ade8ba00bdf84dc71ed706e351a7dba", "score": "0.5776749", "text": "function toPojo(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "c04f641072b021388a050ef287ef3d42", "score": "0.5750576", "text": "function extractJSONOld(jsonData) {\r\n\t/*\r\n\t * Eval the json into a temporary object\r\n\t */\r\n\tvar d = decodeURIComponent(jsonData);\r\n\tvar ds = d.replace(/\\+/g,\" \");\r\n\tds=ds.replace(/\\\\/ig,\"\\\\\\\\\");\r\n\r\n\t/**\r\n\t * Randy suggests we do a json encode here before an eval\r\n\t */\r\n\r\n\teval(\"var tmp=\"+ds+\";\");\r\n\r\n\t/**\r\n\t * See if this looks like a compressed json object\r\n\t */\r\n\tif (!tmp.m || !tmp.d) {\r\n\t\t/**\r\n\t\t * This doesn't look like compressed json so just return the object\r\n\t\t */\r\n\t\treturn tmp;\r\n\t}\r\n\r\n\tvar newObject;\r\n\ttry {\r\n\t\tnewObject = cloneObject(tmp.d, tmp.m);\r\n\t}catch(e){\r\n\t}\r\n\treturn newObject;\r\n}", "title": "" }, { "docid": "772645142328c9ebbe7af05d1479ad8f", "score": "0.5745742", "text": "function convertJsonObjectToDmObject(element) {\n if (element === undefined || element === null) {\n return undefined;\n }\n if (typeof element === 'string' || element instanceof String) {\n element = JSON.parse(element);\n }\n const result = new DmObject();\n const elementValues = element[\"v\"];\n if (elementValues !== undefined && elementValues !== null) {\n for (let key in elementValues) {\n if (Object.prototype.hasOwnProperty.call(elementValues, key)) {\n let value = elementValues[key];\n if (Array.isArray(value)) {\n // Converts array\n const finalValue = [];\n for (const m in value) {\n if (!(value.hasOwnProperty(m))) {\n continue;\n }\n let arrayValue = value[m];\n if ((typeof arrayValue === \"object\" || typeof arrayValue === \"function\") && (arrayValue !== null)) {\n arrayValue = convertJsonObjectToDmObject(arrayValue);\n }\n finalValue.push(arrayValue);\n }\n value = finalValue;\n }\n else if ((typeof value === \"object\" || typeof value === \"function\") && (value !== null)) {\n // Converts to DmObject, if item is an object\n value = convertJsonObjectToDmObject(value);\n }\n result.set(key, value);\n }\n }\n }\n const elementMetaClass = element[\"m\"];\n if (elementMetaClass !== undefined && elementMetaClass !== null) {\n result.metaClass = elementMetaClass;\n }\n const elementUri = element[\"u\"];\n if (elementUri !== undefined && elementUri !== null) {\n result.uri = elementUri;\n }\n const elementReferenceUri = element[\"r\"];\n if (elementReferenceUri !== undefined && elementReferenceUri !== null) {\n result.uri = elementReferenceUri;\n result.isReference = true;\n }\n const extentUri = element[\"e\"];\n if (extentUri !== undefined && extentUri !== null) {\n result.extentUri = extentUri;\n }\n const workspace = element[\"w\"];\n if (workspace !== undefined && workspace !== null) {\n result.workspace = workspace;\n }\n return result;\n }", "title": "" }, { "docid": "f8c33799554c568d641fb8f2e7d8b02e", "score": "0.5729404", "text": "function convertToObject(sourceFile,errors){return convertToObjectWorker(sourceFile,errors,/*returnValue*/true,/*knownRootOptions*/undefined,/*jsonConversionNotifier*/undefined);}", "title": "" }, { "docid": "3518bf0d9976d2e9fc52cbc39ed6978e", "score": "0.5690692", "text": "function decode(value) {\n if (value === null || (typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) !== 'object') {\n return value;\n }\n if (Array.isArray(value)) {\n var dup = [];\n value.forEach(function (v, i) {\n dup[i] = decode(v);\n });\n return dup;\n }\n if (typeof value.__op === 'string') {\n return (0, _ParseOp.opFromJSON)(value);\n }\n if (value.__type === 'Pointer' && value.className) {\n return _ParseObject2.default.fromJSON(value);\n }\n if (value.__type === 'Object' && value.className) {\n return _ParseObject2.default.fromJSON(value);\n }\n if (value.__type === 'Relation') {\n // The parent and key fields will be populated by the parent\n var relation = new _ParseRelation2.default(null, null);\n relation.targetClassName = value.className;\n return relation;\n }\n if (value.__type === 'Date') {\n return new Date(value.iso);\n }\n if (value.__type === 'File') {\n return _ParseFile2.default.fromJSON(value);\n }\n if (value.__type === 'GeoPoint') {\n return new _ParseGeoPoint2.default({\n latitude: value.latitude,\n longitude: value.longitude\n });\n }\n var copy = {};\n for (var k in value) {\n copy[k] = decode(value[k]);\n }\n return copy;\n}", "title": "" }, { "docid": "09dbe12234286550c1245ca1aa35fdf6", "score": "0.5668733", "text": "function json_decode(json) {\n return Ext.JSON.decode(json);\n}", "title": "" }, { "docid": "8ff9806019b785adfc2a6736d7c6805d", "score": "0.56599784", "text": "toObject(value) {\n return value;\n }", "title": "" }, { "docid": "5f74ac305d5f5f35e3284065f86a5329", "score": "0.56268954", "text": "function toJson(object, jsonFn, space) {\n\t if (jsonFn) {\n\t // We reparse the stringified json so that we can lean on JSON.stringify's\n\t // avoiding-infinite-recursion capabilities when stripping out any\n\t // remaining properties that begin with a dollar sign ($)\n\t object = JSON.parse(jsonFn(object));\n\t }\n\t return JSON.stringify(object, replacer, space);\n\t}", "title": "" }, { "docid": "4b58a998eba5419d35c2c3166cd378fa", "score": "0.5625815", "text": "convertToJSON (data) {\n if (typeof data === 'string' || data instanceof String) {\n return JSON.parse(data.replace(/\\\\\\\\/g, '\\\\')\n .replace(/\\\\'/g, '\\''));\n }\n return data;\n }", "title": "" }, { "docid": "07de04f30b3b58dd63402334ce604fe2", "score": "0.5621148", "text": "_convertObject(obj) {\n if (util_1.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n obj[i] = this._convertObject(obj[i]);\n }\n return obj;\n }\n else if (util_1.isObject(obj)) {\n const map = new Map();\n for (const key in obj) {\n map.set(key, this._convertObject(obj[key]));\n }\n return map;\n }\n else {\n return obj;\n }\n }", "title": "" }, { "docid": "4dd200e46f5f185333b0e23970e29094", "score": "0.5581382", "text": "static convertJsonProject(projectJSON) {\n var newProjectJSON = projectJSON;\n newProjectJSON.pan = {\n x: 0,\n y: 0\n };\n newProjectJSON.zoom = 1;\n var newProjectObjects = {};\n Wick.WickFile.Alpha.flattenWickObject(projectJSON, null, newProjectObjects);\n return {\n project: newProjectJSON,\n objects: newProjectObjects\n };\n }", "title": "" }, { "docid": "95ce195a02477bc451a89a6911f710e3", "score": "0.55724573", "text": "static FromJson ({id, tarea, completado, creado}) {\n const tempTodo = new Todo(tarea);\n\n\ntempTodo.id = id;\ntempTodo.completado = completado;\ntempTodo.creado = creado;\nreturn tempTodo;\n }", "title": "" }, { "docid": "7788d67d1d1135af107e06989216f731", "score": "0.55607665", "text": "_toJsonObject(str) {\n let obj = JSON.parse(str);\n return obj;\n }", "title": "" }, { "docid": "412e3074fbb23d4d7e050f428620a716", "score": "0.5549976", "text": "function transformJsonValue(value) {\n\n // handle simple scalars\n if (value === undefined || value === null ||\n typeof value === 'number' || typeof value === 'string' ||\n typeof value === 'boolean' || Buffer.isBuffer(value) ||\n util.isDate(value))\n return value;\n\n // arrays are transformed to a new array with processed values\n if (Array.isArray(value)) {\n const outValue = new Array(value.length);\n for (let i = 0; i < value.length; i++) {\n outValue[i] = transformJsonValue(value[i]);\n }\n return outValue;\n }\n\n // database objects are treated as empty objects\n if (value instanceof BaseDbObject)\n return {fields: [], values: []};\n\n // all other objects are transformed to an object with two arrays (fields\n // and values)\n const outValue = {};\n outValue.fields = Object.getOwnPropertyNames(value);\n outValue.values = new Array(outValue.fields.length);\n for (let i = 0; i < outValue.fields.length; i++) {\n outValue.values[i] = transformJsonValue(value[outValue.fields[i]]);\n }\n return outValue;\n\n}", "title": "" }, { "docid": "e08a36025dd7107ab4d7ecf7aae93d0f", "score": "0.5544088", "text": "function convertInputToJson(input){\n let convertedStringToJson = input[0]\n console.log(input[0]);\n console.log(convertedStringToJson,\"convertedStringToJson\")\n let output ;\n //if its array \n if(typeof convertedStringToJson == \"object\" || typeof convertedStringToJson == \"array\"){\n for(let key in convertedStringToJson){\n output[key] =( typeof convertedStringToJson[key] == \"object\" || typeof convertedStringToJson[key] == \"array\") ? convertInputToJson(convertedStringToJson[key]) : convertedStringToJson[key]\n \n }\n }\n //if its simple string value \n else {\n \n }\n \n return output;\n }", "title": "" }, { "docid": "9b88bbaee95091d58dec02ca9d949d51", "score": "0.5543953", "text": "function deserializeObject(string)\n {\n return JSON.parse(string);\n\n }", "title": "" }, { "docid": "6ae5fae8b9acfdd97d635965d0136669", "score": "0.5536454", "text": "function transformJsonResp(body, req, res) {\n // console.log(body)\n return { data: body }\n}", "title": "" }, { "docid": "449f671d397370aacdc3f830d7839dc2", "score": "0.5527046", "text": "function serializeTojson(o) {\n return JSON.parse(JSON.stringify(o));\n}", "title": "" }, { "docid": "40b7166a44c52a09014d5f86e543aae6", "score": "0.54985446", "text": "function parseJsonString(json) {\n var result = JSON.parse(json);\n return result;\n}", "title": "" }, { "docid": "5ccae14c516998bda98d26c5421b99a9", "score": "0.5485574", "text": "static restoreFromJson(jsonObj) {\n let task = new Task(jsonObj.name);\n task.state = jsonObj.state;\n task.creationDate = new Date(jsonObj.creationDate);\n if (jsonObj.dueDate) {\n task.dueDate = new Date(jsonObj.dueDate);\n }\n task.id = jsonObj.id;\n return task;\n }", "title": "" }, { "docid": "f1fe69795584c71857cd2ad1900ed90f", "score": "0.5484267", "text": "handleArrayToObject (data) {\n return {}\n }", "title": "" }, { "docid": "a20ccf8b16c991c8d125cc01ccd3af76", "score": "0.54826224", "text": "function stringToJsonObject() {\n return function (name, mixed) {\n if (typeof mixed != \"string\") {\n try {\n var str = JSON.stringify(mixed);\n if (typeof str == \"string\" && str[0] == \"{\") {\n if (type_util_1.isBigIntNativelySupported() || !type_util_1.isBigInt(mixed)) {\n return JSON.parse(str);\n }\n }\n throw error_util_1.makeMappingError({\n message: name + \" must be JSON Object; received \" + type_util_1.toTypeStr(mixed),\n inputName: name,\n actualValue: mixed,\n expected: \"JSON Object\",\n });\n }\n catch (err) {\n throw error_util_1.makeMappingError({\n message: name + \" must be JSON Object; \" + err.message,\n inputName: name,\n actualValue: mixed,\n expected: \"JSON Object\",\n });\n }\n }\n if (!/^\\s*\\{/.test(mixed)) {\n throw error_util_1.makeMappingError({\n message: name + \" must be JSON Object string\",\n inputName: name,\n actualValue: mixed,\n expected: \"JSON Object string\",\n });\n }\n try {\n return JSON.parse(mixed);\n }\n catch (err) {\n throw error_util_1.makeMappingError({\n message: name + \" must be valid JSON Object string; \" + err.message,\n inputName: name,\n actualValue: mixed,\n expected: \"valid JSON Object string\",\n });\n }\n };\n}", "title": "" }, { "docid": "0ccdb1242c5f91383ad762b29688dc36", "score": "0.5478812", "text": "function jsonObjectToJsonObjectString() {\n return function (name, mixed) {\n if (typeof mixed == \"string\") {\n if (!/^\\s*\\{/.test(mixed)) {\n throw error_util_1.makeMappingError({\n message: name + \" must be JSON Object string\",\n inputName: name,\n actualValue: mixed,\n expected: \"JSON Object string\",\n });\n }\n try {\n JSON.parse(mixed);\n }\n catch (err) {\n throw error_util_1.makeMappingError({\n message: name + \" must be valid JSON Object string; \" + err.message,\n inputName: name,\n actualValue: mixed,\n expected: \"valid JSON Object string\",\n });\n }\n return mixed;\n }\n try {\n var str = JSON.stringify(mixed);\n if (typeof str == \"string\" && str[0] == \"{\") {\n if (type_util_1.isBigIntNativelySupported() || !type_util_1.isBigInt(mixed)) {\n return str;\n }\n }\n throw error_util_1.makeMappingError({\n message: name + \" must be JSON Object; received \" + type_util_1.toTypeStr(mixed),\n inputName: name,\n actualValue: mixed,\n expected: \"JSON Object\",\n });\n }\n catch (err) {\n throw error_util_1.makeMappingError({\n message: name + \" must be JSON Object; \" + err.message,\n inputName: name,\n actualValue: mixed,\n expected: \"JSON Object\",\n });\n }\n };\n}", "title": "" }, { "docid": "b2ab6215bd61501c8bb183c47e5dbe7d", "score": "0.546487", "text": "_normalize(obj)\n {\n valid(obj, 'object')\n\n var temp = {}\n\n // translations, routing (?)\n\n if ('parameters' in obj) {\n for (let prefix in obj['parameters']) {\n var prefixValue = obj['parameters'][prefix]\n for (let key in prefixValue) {\n var value = prefixValue[key]\n temp['parameters.' + prefix + '.' + key] = value\n }\n }\n\n delete obj['parameters']\n }\n\n if ('translations' in obj) {\n var value = obj['translations']\n temp['parameters.translations'] = value\n\n delete obj['translations']\n }\n\n if ('routing' in obj) {\n var value = obj['routing']\n temp['parameters.routing'] = value\n\n delete obj['routing']\n }\n\n if ('services' in obj) {\n for (let prefix in obj['services']) {\n var prefixValue = obj['services'][prefix]\n for (let key in prefixValue) {\n var value = prefixValue[key]\n temp['services.' + prefix + '.' + key] = value\n }\n }\n\n delete obj['services']\n }\n\n return temp\n }", "title": "" }, { "docid": "4a575b798c3b7d4c17030cc2e2f2e269", "score": "0.5451855", "text": "static parseObjectProp(object) {\n console.log('parseObjectProp(): ', object); // TODO --DM-- Remove\n \n // If not an object or value_type is not json, return original variable\n if ((Object.prototype.toString.call( object ) !== '[object Object]') || \n (object.value_type[0] !== '{')) { return object; } \n\n // If object is JSON string, parse to object\n // Convert string to JSON string\n let objString = object.value_type.replace(/=>/g, \":\");\n\n // Set value_type to 'object', initialize properties\n object.value_type = 'object';\n object.properties = [];\n\n // Parse string to object\n let props = JSON.parse(objString);\n \n\n // Iterate over properties and assign each property\n Object.keys(props).forEach(function(key) {\n // If is an array, stringify array into proper format, otherwise assign value\n let value;\n if (Object.prototype.toString.call( props[key] ) === '[object Array]' ) {\n value = JSON.stringify(props[key]);\n } else {\n value = props[key];\n }\n\n // Assign properties\n object.properties.push({\n key: key,\n value_type: value\n });\n });\n\n return object;\n }", "title": "" }, { "docid": "2ac46b178847451800b295bda2f0559f", "score": "0.54400635", "text": "function extractJSON(jsonData) {\r\n\t//console.info(\"extracting JSON...\");\r\n\tif (!jsonData) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar newObject;\r\n\r\n\ttry {\r\n\t\t/*\r\n\t\t * Eval the json into a temporary object\r\n\t\t */\r\n\t\tvar tmp1=jsonData.replace(/\\+/g,\" \");\r\n\t\tif (!tmp1) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\teval(\"var tmp=\"+tmp1+\";\");\r\n\t} catch (e) {\r\n\t\tconsole.group(\" > Problems Parsing JSON\");\r\n\t\t\tconsole.warn(e);\r\n\t\tconsole.groupEnd();\r\n\t}\r\n\r\n\t/**\r\n\t * See if this looks like a compressed json object\r\n\t */\r\n\tif (!tmp.m || !tmp.d) {\r\n\t\t/**\r\n\t\t * This doesn't look like compressed json so just return the object\r\n\t\t */\r\n\t\treturn tmp;\r\n\t}\r\n\r\n\r\n\ttry {\r\n\t\tnewObject = cloneObject(tmp.d, tmp.m);\r\n\t}catch(e){\r\n\t\tconsole.group(\" > Problems Cloning JSON\");\r\n\t\t\tconsole.warn(e);\r\n\t\tconsole.groupEnd();\r\n\t}\r\n\treturn newObject;\r\n}", "title": "" }, { "docid": "b57cf6c20a7aeff3adaa375bcecf4b11", "score": "0.5433244", "text": "function Generic_fromJSON(ctor, data) {\n var obj, name;\n\n obj = new ctor();\n for (name in data) {\n obj[name] = data[name];\n }\n return obj;\n}", "title": "" }, { "docid": "bebc7bd7e24631af9a44e01006d14278", "score": "0.54326725", "text": "function fromJSON(jsonObject) {\n return new MapData(jsonObject);\n }", "title": "" }, { "docid": "7fc23803e2348a55ac9b94a9c549dd2f", "score": "0.54184043", "text": "function jsonToGroup(json){\n var listOfMembers = parseMembers(json.members,json.admins);\n var group = new Group(json.groupid,\n json.groupname,\n listOfMembers,\n json.description,\n json.groupcreator);\n return group;\n}", "title": "" }, { "docid": "396d06c69b7c25cab4aa77a9ff2448a3", "score": "0.5414969", "text": "_jsonParseFormData(formData) {\n return mapValues(formData, (value) => {\n try {\n const parsedValue = JSON.parse(value);\n if (isObjectLike(parsedValue)) {\n return parsedValue;\n }\n return value;\n } catch(e) {\n return value === undefined ? null : value;\n }\n });\n }", "title": "" }, { "docid": "fa0f3e529ac2faf6383c917d4f2ae99b", "score": "0.5413675", "text": "function ConvertJson (prepareJSON, generateUUID) {\n return function (data, currentVersion) {\n return {\n md5: prepareJSON.getMD5(data),\n file: data,\n headers: _.extend(prepareJSON.getVersionUpdateHeaders(data, currentVersion), {\n 'X-FILE-UUID': generateUUID()\n })\n };\n }\n}", "title": "" }, { "docid": "c5ca16397c06a4b9d03445cc98998f72", "score": "0.5403102", "text": "function JSONClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "c5ca16397c06a4b9d03445cc98998f72", "score": "0.5403102", "text": "function JSONClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "c5ca16397c06a4b9d03445cc98998f72", "score": "0.5403102", "text": "function JSONClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "c5ca16397c06a4b9d03445cc98998f72", "score": "0.5403102", "text": "function JSONClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "c5ca16397c06a4b9d03445cc98998f72", "score": "0.5403102", "text": "function JSONClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "c5ca16397c06a4b9d03445cc98998f72", "score": "0.5403102", "text": "function JSONClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "8edf75bbcb6b29472eeaf20dc282f1cc", "score": "0.5396569", "text": "function parseJsonWithRevivers(json) {\n return json ? JSON.parse(json, function (key, initialValue) {\n // Invoke each reviver in order, passing the output from the previous reviver,\n // so that each one gets a chance to transform the value\n return jsonRevivers.reduce(function (latestValue, reviver) { return reviver(key, latestValue); }, initialValue);\n }) : null;\n }", "title": "" }, { "docid": "763d725e4109a4401d0e77d681b608c8", "score": "0.53795075", "text": "function toObject(value) {\n\n if(!angular.isDefined(value)) {\n return null;\n }\n\t\t\telse if(value.isPrimitive) {\n\t\t\t\treturn value.data;\n\t\t\t}\n\t\t\telse {\n\n\t\t\t \tif (value.toString().indexOf(\"[object]\") == 0) {\n\t\t\t\t\tvar result = {};\n\n\t\t\t\t\tfor(var key in value.properties) {\n\t\t\t\t\t\t\tresult[key] = toObject(value.properties[key]);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn result;\n\t\t\t \t}\n\t\t\t \telse {\n\t\t\t\t\tvar result = [];\n\n\t\t\t\t\tfor(var key in value.properties) {\n\t\t\t\t\t\t\tresult.push(toObject(value.properties[key]));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "570212f072d3163dbe1e1397aa8e1628", "score": "0.5366534", "text": "function newInstance(object){\n return JSON.parse(JSON.stringify(object));\n}", "title": "" }, { "docid": "4a96ce362e20aae3b0a91d8331531e7f", "score": "0.53647494", "text": "to_object(entity)\n\t{\n\t\tif (!entity)\n\t\t{\n\t\t\treturn\n\t\t}\n\n\t\tconst object = entity //.toObject()\n\t\tobject.id = object._id.toString()\n\t\tdelete object._id\n\n\t\treturn object\n\t}", "title": "" }, { "docid": "dcc5e1c70d310340cb1b8f738159f904", "score": "0.5360786", "text": "deserialize(value) {\n return value && JSON.parse(value);\n }", "title": "" }, { "docid": "d19906a46abdf14c9016fcf74acfa1a1", "score": "0.5357823", "text": "function parseJSON(result){\n return result.json();\n}", "title": "" }, { "docid": "c087188be342263cc4d75ba18f8e4a83", "score": "0.5357822", "text": "function userFromJson(jsonUser) {\n let user = Object.create(User.prototype);\n return Object.assign(user, jsonUser);\n}", "title": "" }, { "docid": "b0b3639828d13073ea57a789ebf6268a", "score": "0.53559744", "text": "json () {\n return consumeBody.call(this).then(buffer => parseJson(buffer.toString()))\n }", "title": "" }, { "docid": "ccec297f0280d27fdf5987cec4efa5f5", "score": "0.53516227", "text": "static fromJson({ id, tarea, completado, creado }){ // usamos como argumentos la desestructuracion de objetos, donde recibira al objeto tipo Object\n // que tiene la tarea.\n const auxTarea = new Todo(tarea);\n\n auxTarea.id = id;\n auxTarea.completado = completado;\n auxTarea.creado = creado;\n\n //Ahora ya tenemos un objeto tipo Todo en el auxiliar, entonces lo regresamos:\n return auxTarea; \n }", "title": "" }, { "docid": "ca37eb87170af76bac7a953197521245", "score": "0.53428364", "text": "function parseJSONValues(obj, o2, from) {\n if(typeof from === \"undefined\") {\n var from = '';\n }\n for(var c in obj) {\n if(typeof obj[c] === 'string') {\n if(from === '') {\n var val = o2[obj[c]];\n if(typeof val !== \"undefined\") {\n obj[c] = val;\n }\n }\n } else {\n if(from === c) {\n from = '';\n }\n parseJSONValues(obj[c], o2, from);\n }\n }\n}", "title": "" }, { "docid": "99d99dbfa1548bae4ee5c04733ff18e9", "score": "0.53421015", "text": "function json(json, filter) {\n if (!initialized) return {}\n\n var jsonstring = JSON.stringify(json)\n var result = raw(jsonstring, filter, ['-c']).trim()\n\n if (result.indexOf('\\n') !== -1) {\n return result\n .split('\\n')\n .filter(function(x) {\n return x\n })\n .reduce(function(acc, line) {\n return acc.concat(JSON.parse(line))\n }, [])\n } else {\n return JSON.parse(result)\n }\n}", "title": "" }, { "docid": "cf2ae4cb3df0e7a975e8c4bb13275b48", "score": "0.5339094", "text": "function translateJSON(response) {\n return response\n\n // return {\n // datasets: response.recordsets || [],\n // counts: response.recordsAffected || []\n // }\n}", "title": "" }, { "docid": "a5c43b92f8746fa337ab6be9cb7650b1", "score": "0.5324044", "text": "function fromJsonObject(that,object){var array;var length=0;if(object.type==='Buffer'&&isArray(object.data)){array=object.data;length=checked(array.length)|0;}that=allocate(that,length);for(var i=0;i<length;i+=1){that[i]=array[i]&255;}return that;}", "title": "" }, { "docid": "871b03aa6e5b5b8d40b070c192bddb54", "score": "0.5323694", "text": "function clonify(obj) {\n if ( typeof obj === \"object\" ) {\n let cv = JSON.parse(JSON.toString(obj))\n return(cv);\n } else {\n return(obj)\n }\n}", "title": "" }, { "docid": "fcaa113e06a5970f6775113bade60241", "score": "0.53221107", "text": "constructor(json) {\n this.json = json;\n }", "title": "" }, { "docid": "fcaa113e06a5970f6775113bade60241", "score": "0.53221107", "text": "constructor(json) {\n this.json = json;\n }", "title": "" }, { "docid": "d387cbe7ab29d922c923c7bad475213a", "score": "0.5318842", "text": "function convertToObject(name, value) {\n __result.push({\n name: name,\n value: value\n });\n }", "title": "" }, { "docid": "11f7ef6b07ed987ab75c298846106fe0", "score": "0.5312222", "text": "static resolve(object) {\n if (object && object['__jsonclass__'] && object['__jsonclass__'][0]) {\n const ctor = constructors[object['__jsonclass__'][0]];\n if (ctor) {\n return new ctor(object);\n }\n }\n return object;\n }", "title": "" }, { "docid": "e58dc217900c236b25f60f23f533dc88", "score": "0.5307206", "text": "function toTopLevel(json) {\n return cast(JSON.parse(json), a(r(\"TopLevel\")));\n}", "title": "" }, { "docid": "d57c9464d8bca1c536f104d3c5fc6032", "score": "0.529988", "text": "function convertToObject(name, value) {\n __result.push({\n name: name,\n value: value\n });\n }", "title": "" }, { "docid": "7aefe3a897b5a02ca3d83111d8273c40", "score": "0.52943355", "text": "decodeObject(encodedObject) {\n const objString = atob(encodedObject);\n return JSON.parse(objString);\n }", "title": "" }, { "docid": "37aa6e27e3f0b3dc75330794a4b84da6", "score": "0.5291113", "text": "static fromJson({id, tarea, completado, creado}) {\n const tempTodo = new Todo(tarea);\n tempTodo.id = id;\n tempTodo.completado = completado;\n tempTodo.creado = creado;\n\n return tempTodo;\n }", "title": "" }, { "docid": "8b5d042c33a37d720c91cb19a6ec5aa7", "score": "0.5290901", "text": "function jsonTransform(options) {\n return function(key, value) {\n var ret = value;\n if (options.stripNulls && (value === null || value === undefined)) {\n // prune nulls\n ret = undefined;\n } else if (options.stripSerializerType && key === 'serializerType') {\n // prune serializerType\n ret = undefined;\n }\n return ret;\n };\n}", "title": "" }, { "docid": "fd9a48d39b1ee603bd656790167beccd", "score": "0.5287303", "text": "static fromJSON(json, host = exports.defaultHost) {\n const newContext = Object.assign({}, json);\n newContext[\"host\"] = host;\n const ctx = new Context();\n ctx._context = newContext;\n return ctx;\n }", "title": "" }, { "docid": "ca9cf21c228100428791880f77417c0c", "score": "0.5280697", "text": "function JSONtoDatatype(json){\n // Clean up the JSON for better comparisons\n delete json.formattedValue;\n // Ignore/fix patterns and strictness of validation\n if (json.hasOwnProperty(\"userEnteredFormat\")){\n json.userEnteredFormat.numberFormat.pattern = \"\";\n }\n if (json.hasOwnProperty(\"dataValidation\")){\n json.dataValidation.strict = true;\n } \n \n // See which datatype it matches\n for (var type in datatypes){\n // Clean up datatype format for comparison\n let format = datatypes[type]().cell;\n if (type !== \"boolean\"){ format.userEnteredFormat.numberFormat.pattern = \"\"; }\n // Do comparison\n if (JSON.stringify(format) === JSON.stringify(json)){\n if (type === \"number\" || type === \"unumber\"){\n // Converts existing number pattern to number of decimals\n return new Datatype(type,json.userEnteredFormat.numberFormat.pattern.replace(/[^0#\\.]/g,\"\").replace(/([0#]+)?\\.?/,\"\").length);\n }\n else { return new Datatype(type); }\n }\n }\n return undefined;\n }", "title": "" }, { "docid": "fbdd70eb9f7a0358922ba01da72c39d7", "score": "0.5279027", "text": "function jsonToStr(obj, format) { // Fix? Remove these from global scope.\n\t\tif (!_.isObject(obj)) { return obj; }\n\t\t\n\t\tfunction convertFuncs(obj) {\n\t\t\t_.each(obj, function(val,key,obj){\n\t\t\t\tif (_.isFunction(val)) { \n\t\t\t\t\tobj[key] = {\n\t\t\t\t\t\ttyp: 'fnc',\n\t\t\t\t\t\tbod: val.toString(),\n\t\t\t\t\t\targ: val.arguments\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tobj[key] = JSON.stringify(val);\n\t\t\t\t}\n\t\t\t\t// Fix. Complete safety checks, prevent infinite recursion from looped references.\n\t\t\t});\n\t\t}\n\t\t\n\t\tvar str = JSON.stringify(obj);\n\t\treturn _.isString(str) ? str : obj;\n\t}", "title": "" }, { "docid": "bbe5db101a0d7f616e670f1a5786ccf6", "score": "0.52744013", "text": "function localizeObject(s, locPar, isRJson) {\n if (isRJson === void 0) { isRJson = false; }\n s = localizeJSON(s, locPar);\n var res = JSON.parse(s);\n return isRJson ? RJSON.unpack(res) : res; //ev. RJSON\n }", "title": "" }, { "docid": "01d9d3b03fc5e3cc018c33de462ac741", "score": "0.526515", "text": "function m(o){try{throw new Error(\"fromJson is deprecated, use fromJSON instead\")}catch(o){console.warn(o.stack)}return p(o)}", "title": "" }, { "docid": "6d68b21d2fbab71e20054733eea2aa83", "score": "0.5262147", "text": "function fun_a(){\r\n //console.log(json2);\r\n //console.log(json2[0].account); klein testje\r\n\r\n for(i = 0 ; i < Object.keys(json2).length; i++){\r\n final_object[i] = json2[i].object;\r\n }\r\n console.log(final_object);\r\n}", "title": "" }, { "docid": "4fb3c8d1574e11522a2c96698a3676a2", "score": "0.5259278", "text": "function toClient(obj) {\n\n // process objects only\n if(obj instanceof Object) {\n\n // perform conversions \n convertId(obj);\n stripVersion(obj);\n\n // process all properties\n recurseProperties(obj);\n }\n}", "title": "" }, { "docid": "2be8a63558c15a53126760b9a917c4d6", "score": "0.5255834", "text": "static fromJSON(json, host = exports.defaultHost) {\n const newContext = Object.assign({}, json);\n newContext[\"host\"] = host;\n const ctx = new Context();\n ctx._context = newContext;\n return ctx;\n }", "title": "" }, { "docid": "8de2920f2ea96c65c1f0cfcf8d982ee9", "score": "0.5254125", "text": "rehydrate(json) {\n Object.keys(json).forEach((key) => {\n let _key = this.normalizeKey(key);\n let value = json[_key];\n this._cache.set(_key, value);\n });\n }", "title": "" }, { "docid": "a7405285b46abe4f670400442303c6bb", "score": "0.524718", "text": "function parseJson(str){if(str.length===0){// special-case empty json body, as it's a common client-side mistake\nreturn{};}try{return JSON.parse(str);}catch(e){throw new ApiError(400,'Invalid JSON');}}", "title": "" }, { "docid": "a7405285b46abe4f670400442303c6bb", "score": "0.524718", "text": "function parseJson(str){if(str.length===0){// special-case empty json body, as it's a common client-side mistake\nreturn{};}try{return JSON.parse(str);}catch(e){throw new ApiError(400,'Invalid JSON');}}", "title": "" }, { "docid": "a7405285b46abe4f670400442303c6bb", "score": "0.524718", "text": "function parseJson(str){if(str.length===0){// special-case empty json body, as it's a common client-side mistake\nreturn{};}try{return JSON.parse(str);}catch(e){throw new ApiError(400,'Invalid JSON');}}", "title": "" }, { "docid": "a7405285b46abe4f670400442303c6bb", "score": "0.524718", "text": "function parseJson(str){if(str.length===0){// special-case empty json body, as it's a common client-side mistake\nreturn{};}try{return JSON.parse(str);}catch(e){throw new ApiError(400,'Invalid JSON');}}", "title": "" }, { "docid": "b6bc03a6dda7f2b85eb59e20687a8c0f", "score": "0.5243661", "text": "static fromJSON(json, host = defaultHost) {\n const newContext = Object.assign({}, json);\n newContext[\"host\"] = host;\n const ctx = new Context();\n ctx._context = newContext;\n return ctx;\n }", "title": "" }, { "docid": "c4d3f7714c4ec7612f2501b41dc3f9b4", "score": "0.523687", "text": "function makeProjectFromJSON(json){\n let raw;\n try {\n raw = JSON.parse(json);\n } catch (e){\n return {};\n }\n if(!verifyProjectIntegrity(raw, true))\n return {};\n let out = Object.assign({}, raw);\n\n // Convert scene array to an object\n out.scenes = {};\n for(let i = 0; i < raw.scenes.length; i++){\n if (raw.scenes[i].key == undefined || raw.scenes[i].name == undefined || raw.scenes[i].namespace == undefined || raw.scenes[i].text == undefined)\n return {};\n out.scenes[raw.scenes[i].key] = { name: raw.scenes[i].name, namespace: raw.scenes[i].namespace, text: raw.scenes[i].text };\n }\n\n // Convert def group array to an object\n out.definitionGroups = {};\n for(let i = 0; i < raw.definitionGroups.length; i++){\n if (raw.definitionGroups[i].key == undefined || raw.definitionGroups[i].name == undefined || raw.definitionGroups[i].namespace == undefined || raw.definitionGroups[i].text == undefined)\n return {};\n out.definitionGroups[raw.definitionGroups[i].key] = { name: raw.definitionGroups[i].name, namespace: raw.definitionGroups[i].namespace, text: raw.definitionGroups[i].text };\n }\n\n return out;\n}", "title": "" }, { "docid": "f0c4216185b1ca5f84834bbc6ae8c250", "score": "0.5227606", "text": "static fromJSON(json, host = defaultHost) {\n const newContext = Object.assign({}, json);\n newContext['host'] = host;\n const ctx = new Context();\n ctx._context = newContext;\n return ctx;\n }", "title": "" }, { "docid": "d721b3b14a95510ac124b48770efbeae", "score": "0.5212034", "text": "function retrieveCarritoFromString(jsonString){\n return JSON.parse(jsonString,revive);\n}", "title": "" }, { "docid": "0c07eb61448692b0e2ddaa10a9ee1613", "score": "0.5207342", "text": "[_normalizeUser]() {\n const user = {};\n let json = this._json;\n if (!json.user) {\n if (json.user_id) {\n user.id = json.user_id;\n delete json.user_id;\n }\n if (json.user_name) {\n user.name = json.user_name;\n delete json.user_name;\n } else if (json.username) {\n user.name = json.username;\n delete json.username;\n }\n } else if (_.isString(json.user)) {\n user.id = json.user;\n }\n if (user.id) {\n json.user = user;\n }\n }", "title": "" }, { "docid": "6327ec4ace752f25b1cdd903f6c3ab63", "score": "0.5206959", "text": "function transformToJson(text) {\n return JSON.stringify(text, null, 4);\n}", "title": "" }, { "docid": "388220211a588768f62b680f3bd3d38b", "score": "0.52058315", "text": "function parse(json) {\n return jQuery.parseJSON(json);\n }", "title": "" }, { "docid": "9f8436f764349ea5ea77988a8f2af8ca", "score": "0.5202443", "text": "function _EsriRestJson2GeoJson(obj) {\n if (obj.geometryType === undefined || obj.features === undefined || obj.type === 'FeatureCollection') {\n return obj;\n }\n\n var pts;\n var geom;\n\n obj.type = \"FeatureCollection\";\n var code = obj.spatialReference.latestWkid || obj.spatialReference.wkid;\n if (defined(code)) {\n obj.crs = {\"type\":\"EPSG\",\"properties\":{\"code\": code}};\n }\n for (var i = 0; i < obj.features.length; i++) {\n var feature = obj.features[i];\n feature.type = \"Feature\";\n feature.properties = feature.attributes;\n if (obj.geometryType === \"esriGeometryPoint\") {\n pts = [feature.geometry.x, feature.geometry.y ];\n geom = { \"type\": \"Point\", \"coordinates\": pts };\n feature.geometry = geom;\n }\n else if (obj.geometryType === \"esriGeometryPolyline\") {\n pts = feature.geometry.paths[0];\n geom = { \"type\": \"LineString\", \"coordinates\": pts };\n feature.geometry = geom;\n }\n else if (obj.geometryType === \"esriGeometryPolygon\") {\n pts = feature.geometry.paths[0];\n geom = { \"type\": \"Polygon\", \"coordinates\": pts };\n feature.geometry = geom;\n }\n }\n return obj;\n}", "title": "" }, { "docid": "59758c299ad57df0f730bf63890f7f41", "score": "0.5191926", "text": "function parse_json(json_str) {\n\ttry {\n\t\treturn JSON.parse(json_str);\n\t} catch(e) {\n\t\treturn;\n\t}\n}", "title": "" }, { "docid": "36e7192d841432518252ddad34652d53", "score": "0.51894397", "text": "function parseJson(jsonData){\n return eval(\"(\" + jsonData + \")\");\n}", "title": "" }, { "docid": "03da9b3aadfba979dc1bd283f2feadf9", "score": "0.5183229", "text": "function fromJS(value) {\n if (Array.isArray(value)) {\n return createList(value);\n }\n if (value && value.constructor && value.constructor.meta) {\n // This adds support for tcomb objects which are native JS objects\n // but are not \"plain\", so the above checks fail. Since they\n // behave the same we can use the same constructors, but we need\n // special checks for them.\n const kind = value.constructor.meta.kind;\n if (kind === \"struct\") {\n return createMap(value);\n } else if (kind === \"list\") {\n return createList(value);\n }\n }\n\n // If it's a primitive type, just return the value. Note `==` check\n // for null, which is intentionally used to match either `null` or\n // `undefined`.\n if (value == null || typeof value !== \"object\") {\n return value;\n }\n\n // Otherwise, treat it like an object. We can't reliably detect if\n // it's a plain object because we might be objects from other JS\n // contexts so `Object !== Object`.\n\n return createMap(value);\n}", "title": "" }, { "docid": "9af2d9d8879079d2475fab082eb55a39", "score": "0.5180485", "text": "static detokenize(json, dictionary) {\n const rv = {};\n const smoKey = (key) => {\n return typeof (dictionary[key]) !== 'undefined' ? dictionary[key] : key;\n }\n const _tokenRecurse = (input, output) => {\n if (input === null) {\n return;\n }\n const keys = Object.keys(input);\n keys.forEach((key) => {\n const val = input[key];\n const dkey = smoKey(key);\n if (typeof (val) == 'string' || typeof (val) == 'number' || typeof (val) == 'boolean') {\n output[dkey] = val;\n // console.log('240: output[' + dkey + '] = ' + val);\n }\n if (typeof (val) == 'object' && key != 'dictionary') {\n if (Array.isArray(val)) {\n output[dkey] = [];\n // console.log('245: processing array ' + dkey);\n val.forEach((arobj) => {\n if (typeof (arobj) === 'string' || typeof (arobj) === 'number' || typeof (arobj) === 'boolean') {\n output[dkey].push(arobj);\n // console.log('249: ar element ' + arobj);\n }\n else if (arobj && typeof (arobj) === 'object') {\n const nobj = {};\n _tokenRecurse(arobj, nobj);\n output[dkey].push(nobj);\n }\n });\n } else {\n const nobj = {};\n // console.log('259: processing child object of ' + dkey);\n _tokenRecurse(val, nobj);\n output[dkey] = nobj;\n }\n }\n });\n }\n _tokenRecurse(json, rv);\n // console.log(JSON.stringify(rv,null,' '));\n return rv;\n }", "title": "" } ]
feaf6cde5cfa8536b5ca81de343a10aa
Sync the scrollable area and scrollbars, ensure the viewport covers the visible area.
[ { "docid": "22d1f74f9a2f5f5e45aa0181b9516873", "score": "0.0", "text": "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "title": "" } ]
[ { "docid": "61a01fb8c8844e38efb82c645f72f0fc", "score": "0.6211292", "text": "syncScrollPositions() {\n if (this.destroyed) {\n return;\n }\n\n const { rootWindow } = this.domBindings;\n const topHolder = this.topOverlay.clone.wtTable.holder; // todo rethink\n const leftHolder = this.inlineStartOverlay.clone.wtTable.holder; // todo rethink\n\n const [scrollLeft, scrollTop] = [this.scrollableElement.scrollLeft, this.scrollableElement.scrollTop];\n\n this.horizontalScrolling = (topHolder.scrollLeft !== scrollLeft || this.lastScrollX !== rootWindow.scrollX);\n this.verticalScrolling = (leftHolder.scrollTop !== scrollTop || this.lastScrollY !== rootWindow.scrollY);\n this.lastScrollX = rootWindow.scrollX;\n this.lastScrollY = rootWindow.scrollY;\n\n if (this.horizontalScrolling) {\n topHolder.scrollLeft = scrollLeft;\n\n const bottomHolder = this.bottomOverlay.needFullRender ? this.bottomOverlay.clone.wtTable.holder : null; // todo rethink\n\n if (bottomHolder) {\n bottomHolder.scrollLeft = scrollLeft;\n }\n }\n\n if (this.verticalScrolling) {\n leftHolder.scrollTop = scrollTop;\n }\n\n this.refreshAll();\n }", "title": "" }, { "docid": "2d558b3e6fafb44e2b982c68c7ba3a78", "score": "0.6028751", "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": "2d558b3e6fafb44e2b982c68c7ba3a78", "score": "0.6028751", "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": "416e30696668c4b324f443af51f97ee9", "score": "0.6000202", "text": "evaluateScroll() {\n this.needScrollHeight = this.getBoundingClientRect().height < this.$.container.getBoundingClientRect().height;\n if(this.isScrollWidth)this.__adjustWidthOfContainer();\n this.needScrollWidth = this.getBoundingClientRect().width < this.$.container.getBoundingClientRect().width;\n if(this.needScrollHeight)this.__resizescrollElement();\n }", "title": "" }, { "docid": "c0bbaeb9401d2a2127bf7de670dbbfea", "score": "0.5990571", "text": "update() {\n if (this._total === 0 || this._total < this._visibleArea) {\n // No scroll bar visible (either no document size or the entire document\n // is visible).\n this._scrollBar.style.display = 'none';\n } else {\n this._scrollBar.style.display = 'block';\n let barHeight = Math.max(24, (this._visibleArea / this._total) * this._scrollArea.offsetHeight);\n this._scrollBar.style.top = (this._position / (this._total - this._visibleArea)) * (this._scrollArea.offsetHeight - barHeight) + 'px';\n this._scrollBar.style.height = barHeight + 'px';\n }\n }", "title": "" }, { "docid": "85a740b188910e9035deffc93465d094", "score": "0.5982868", "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": "85a740b188910e9035deffc93465d094", "score": "0.5982868", "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": "368a86c41fcc74d76362e10c3e560e5f", "score": "0.59800303", "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": "368a86c41fcc74d76362e10c3e560e5f", "score": "0.59800303", "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": "2b154da649fe9bf68137065bb8099efe", "score": "0.59190696", "text": "recalculateScrollBounds () {\n if (!this.rect) return\n const scale = this.transform.scale\n const { width, height } = this.rect\n let minX = 0\n let minY = 0\n let maxX = 0\n let maxY = 0\n for (const script of this.scripts) {\n if (!script.measurements) continue\n const { x, y } = script.position\n const { width, height } = script.measurements\n if (y < minY) minY = y\n if (y + height > maxY) maxY = y + height\n if (this.blocks.dir === 'rtl') {\n if (x - width < minX) minX = x - width\n if (x > maxX) maxX = x\n } else {\n if (x < minX) minX = x\n if (x + width > maxX) maxX = x + width\n }\n }\n minX *= scale\n maxX *= scale\n minY *= scale\n maxY *= scale\n const padding = ScriptsWorkspace.padding\n const scrollPadding = ScriptsWorkspace.scrollPadding\n minY -= padding\n maxY = Math.max(maxY + scrollPadding, minY + height)\n if (this.blocks.dir === 'rtl') {\n // Reverse of LTR, ish; only doing X in the if/else because RTL\n // flips horizontally.\n maxX += scrollPadding\n minX = Math.min(minX - padding, maxX - width)\n } else {\n minX -= padding\n // If the maxX + padding will make the scroll width shorter than the\n // viewable width, then use the viewable width instead as the scroll width.\n maxX = Math.max(maxX + scrollPadding, minX + width)\n }\n this._scrollBounds = { minX, minY, maxX, maxY }\n this.trigger('scroll-bounds', this._scrollBounds)\n }", "title": "" }, { "docid": "3ed722cb4d148d1a9606d90ee4e882bc", "score": "0.59174764", "text": "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "title": "" }, { "docid": "b42731974d6443d8762776c213220097", "score": "0.59024996", "text": "resizeContents() {\n if (!this.resizesEnabled_ || !this.rendered) {\n return;\n }\n if (this.scrollbar) {\n this.scrollbar.resize();\n }\n this.updateInverseScreenCTM();\n }", "title": "" }, { "docid": "3aac4308338e40edca6d43919f21be23", "score": "0.5890867", "text": "scroll() {\n instance.checkVisibility();\n }", "title": "" }, { "docid": "0e51aa5cab7c71195ed44407aa624e38", "score": "0.58850497", "text": "applyViewport() {\n if (!this.viewport) {\n return;\n }\n\n log.debug2('applyViewport', this.viewport);\n const { top, bottom, columns } = this.viewport;\n const [viewportTop, viewportBottom] = this.getCachedViewportRowRange(\n top,\n bottom\n );\n this.applyBufferedViewport(viewportTop, viewportBottom, columns);\n }", "title": "" }, { "docid": "399ffd422315407286672b777a6e82e7", "score": "0.58810335", "text": "syncScrollWithMaster() {\n const master = this.topOverlay.mainTableScrollableElement;\n const { scrollLeft, scrollTop } = master;\n\n if (this.topOverlay.needFullRender) {\n this.topOverlay.clone.wtTable.holder.scrollLeft = scrollLeft; // todo rethink, *overlay.setScroll*()\n }\n if (this.bottomOverlay.needFullRender) {\n this.bottomOverlay.clone.wtTable.holder.scrollLeft = scrollLeft; // todo rethink, *overlay.setScroll*()\n }\n if (this.inlineStartOverlay.needFullRender) {\n this.inlineStartOverlay.clone.wtTable.holder.scrollTop = scrollTop; // todo rethink, *overlay.setScroll*()\n }\n }", "title": "" }, { "docid": "5c721cc3a30edeabd7702dca267642da", "score": "0.58421576", "text": "setViewportRange(x1, x2, y1, y2) {\n if (x1 != null && x2 != null) {\n var x1Pos = this.getDateXPosition(x1);\n var x2Pos = this.getDateXPosition(x2);\n\n // make sure it's in bounds\n if (x2Pos > x1Pos) {\n if (x1Pos < this.getMinimumPositionX()) x1Pos = this.getMinimumPositionX();\n if (x2Pos > this.getMaximumPositionX()) x2Pos = this.getMaximumPositionX();\n\n var width = Math.max(x2Pos - x1Pos, this.getMinimumWindowWidth());\n var slidingWindow = this.getSlidingWindow();\n if (this.isRTL()) this.setSlidingWindowPosX(slidingWindow, this.Width - (x1Pos + width));\n else this.setSlidingWindowPosX(slidingWindow, x1Pos);\n\n DvtOverviewRenderer._setSlidingWindowWidth(this, slidingWindow, width);\n }\n }\n if (y1 != null && y2 != null) {\n var y1Pos = this.getDateYPosition(y1);\n var y2Pos = this.getDateYPosition(y2);\n\n // make sure it's in bounds\n if (y2Pos > y1Pos) {\n if (y1Pos < this.getMinimumPositionY()) y1Pos = this.getMinimumPositionY();\n if (y2Pos > this.getMaximumPositionY()) y2Pos = this.getMaximumPositionY();\n\n var height = Math.max(y2Pos - y1Pos, this.getMinimumWindowHeight());\n slidingWindow = this.getSlidingWindow();\n this.setSlidingWindowPosY(slidingWindow, y1Pos);\n\n DvtOverviewRenderer._setSlidingWindowHeight(this, slidingWindow, height);\n }\n }\n DvtOverviewRenderer._updateBorderAroundSlidingWindow(this);\n }", "title": "" }, { "docid": "92a09d80a64d588d359cfcfb84e2c85b", "score": "0.57836545", "text": "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n let firstVisibleIndex = (this._itemSize > 0) ? scrollOffset / this._itemSize : 0;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "title": "" }, { "docid": "92a09d80a64d588d359cfcfb84e2c85b", "score": "0.57836545", "text": "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n let firstVisibleIndex = (this._itemSize > 0) ? scrollOffset / this._itemSize : 0;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "title": "" }, { "docid": "306547a6cf25d7757e93f819e41993bd", "score": "0.5748334", "text": "update() {\n let {widget, strut, container, scrollBody} = this.$refs;\n let {style: widgetStyle} = widget;\n let {clientWidth, scrollWidth} = container;\n widgetStyle.width = `${clientWidth}px`;\n if (!scrollBody) {\n widgetStyle.left = `${container.getBoundingClientRect().left}px`;\n }\n strut.style.width = `${scrollWidth}px`;\n // Fit widget height to the native scrollbar height if needed\n if (scrollWidth > clientWidth) {\n widgetStyle.height = `${widget.offsetHeight - widget.clientHeight + 1}px`; // +1px JIC\n }\n this.syncWidget();\n this.checkVisibility(); // fixes issue Amphiluke/floating-scroll#2\n }", "title": "" }, { "docid": "6da708f7c0f4b4fd192ea6725a3b9cb0", "score": "0.5731945", "text": "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = `${totalHeight }px`;\n d.gutters.style.height = `${Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) }px`;\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = 'block';\n d.scrollbarV.style.bottom = needsH ? `${scrollbarWidth(d.measure) }px` : '0';\n d.scrollbarV.firstChild.style.height =\n `${scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight }px`;\n } else {\n d.scrollbarV.style.display = '';\n d.scrollbarV.firstChild.style.height = '0';\n }\n if (needsH) {\n d.scrollbarH.style.display = 'block';\n d.scrollbarH.style.right = needsV ? `${scrollbarWidth(d.measure) }px` : '0';\n d.scrollbarH.firstChild.style.width =\n `${d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth }px`;\n } else {\n d.scrollbarH.style.display = '';\n d.scrollbarH.firstChild.style.width = '0';\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = 'block';\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = `${scrollbarWidth(d.measure) }px`;\n } else d.scrollbarFiller.style.display = '';\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = 'block';\n d.gutterFiller.style.height = `${scrollbarWidth(d.measure) }px`;\n d.gutterFiller.style.width = `${d.gutters.offsetWidth }px`;\n } else d.gutterFiller.style.display = '';\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? '18px' : '12px';\n }", "title": "" }, { "docid": "5099566e19f7b6eb3d4ef7c57de6ea0f", "score": "0.5726734", "text": "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n let firstVisibleIndex = scrollOffset / this._itemSize;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "title": "" }, { "docid": "3e3baa649422db129749483ca8be8d5d", "score": "0.5721265", "text": "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "title": "" }, { "docid": "58d8caa33adbfcee308e0c0d5ec8c1fe", "score": "0.5721265", "text": "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "title": "" }, { "docid": "01397d98193386ee32dbbdd4c7698d7b", "score": "0.5712079", "text": "ensureScrollable() {\n\n if (this._ensureScrollableInterval) return;\n\n //if we are using a load more button this is also not required\n if (this.buttonOptions && this.buttonOptions.show) return;\n\n // repeat until we have enough items\n this._ensureScrollableInterval = this.$interval.interval(() => {\n\n // if we are currently loading or have loaded all pages then do nothing\n if (this.loading || this.complete || document.hidden || this.$element.is(':hidden')) {\n return;\n }\n\n // check if scrollbar is visible\n if (!this.scrollbarAdapter.getScrollbarVisible()) {\n this.getNextPage();\n }\n\n }, 250, 0, false);\n }", "title": "" }, { "docid": "64b6d490205b4586da25dd38de498848", "score": "0.57021976", "text": "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "title": "" }, { "docid": "d298cf5e28dff6a1ebde2a25aa82120a", "score": "0.56828207", "text": "lockBodyScroll () {\n viewport.on('scroll', () => {\n let scrollTop = viewport.getScrollTop()\n let totalScroll = viewport.getScrollHeight()\n if (scrollTop === 0) {\n viewport.setScrollTop(1)\n } else if (scrollTop === totalScroll) {\n viewport.setScrollTop(scrollTop - 1)\n }\n }, eventListenerOptions)\n\n // scroll 1px\n document.documentElement.classList.add('trigger-layout')\n document.body.classList.add('trigger-layout')\n viewport.setScrollTop(1)\n }", "title": "" }, { "docid": "424a9d3fc4b1599ba6deac397933519e", "score": "0.568195", "text": "updateMainScrollableElements() {\n this.deregisterListeners();\n\n this.inlineStartOverlay.updateMainScrollableElement();\n this.topOverlay.updateMainScrollableElement();\n\n if (this.bottomOverlay.needFullRender) {\n this.bottomOverlay.updateMainScrollableElement();\n }\n const { wtTable } = this;\n const { rootWindow } = this.domBindings;\n\n if (rootWindow.getComputedStyle(wtTable.wtRootElement.parentNode).getPropertyValue('overflow') === 'hidden') {\n this.scrollableElement = wtTable.holder;\n } else {\n this.scrollableElement = getScrollableElement(wtTable.TABLE);\n }\n\n this.registerListeners();\n }", "title": "" }, { "docid": "4588782f58976f9adbab875d43afab0b", "score": "0.56672627", "text": "function updateScrollbars(cm) {\r\n var d = cm.display, docHeight = cm.doc.height;\r\n var totalHeight = docHeight + paddingVert(d);\r\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\r\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\r\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\r\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\r\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\r\n if (needsV) {\r\n d.scrollbarV.style.display = \"block\";\r\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\r\n d.scrollbarV.firstChild.style.height =\r\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\r\n } else d.scrollbarV.style.display = \"\";\r\n if (needsH) {\r\n d.scrollbarH.style.display = \"block\";\r\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\r\n d.scrollbarH.firstChild.style.width =\r\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\r\n } else d.scrollbarH.style.display = \"\";\r\n if (needsH && needsV) {\r\n d.scrollbarFiller.style.display = \"block\";\r\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\r\n } else d.scrollbarFiller.style.display = \"\";\r\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\r\n d.gutterFiller.style.display = \"block\";\r\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\r\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\r\n } else d.gutterFiller.style.display = \"\";\r\n\r\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\r\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\r\n }", "title": "" }, { "docid": "b9d077bd1f1503771d2f1a8f7003de69", "score": "0.56452626", "text": "enable() {\n if (this._scrollSubscription) {\n return;\n }\n const stream = this._scrollDispatcher.scrolled(0);\n if (this._config && this._config.threshold && this._config.threshold > 1) {\n this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n this._scrollSubscription = stream.subscribe(() => {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n if (Math.abs(scrollPosition - this._initialScrollPosition) > this._config.threshold) {\n this._detach();\n }\n else {\n this._overlayRef.updatePosition();\n }\n });\n }\n else {\n this._scrollSubscription = stream.subscribe(this._detach);\n }\n }", "title": "" }, { "docid": "b9d077bd1f1503771d2f1a8f7003de69", "score": "0.56452626", "text": "enable() {\n if (this._scrollSubscription) {\n return;\n }\n const stream = this._scrollDispatcher.scrolled(0);\n if (this._config && this._config.threshold && this._config.threshold > 1) {\n this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n this._scrollSubscription = stream.subscribe(() => {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n if (Math.abs(scrollPosition - this._initialScrollPosition) > this._config.threshold) {\n this._detach();\n }\n else {\n this._overlayRef.updatePosition();\n }\n });\n }\n else {\n this._scrollSubscription = stream.subscribe(this._detach);\n }\n }", "title": "" }, { "docid": "b9d077bd1f1503771d2f1a8f7003de69", "score": "0.56452626", "text": "enable() {\n if (this._scrollSubscription) {\n return;\n }\n const stream = this._scrollDispatcher.scrolled(0);\n if (this._config && this._config.threshold && this._config.threshold > 1) {\n this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n this._scrollSubscription = stream.subscribe(() => {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n if (Math.abs(scrollPosition - this._initialScrollPosition) > this._config.threshold) {\n this._detach();\n }\n else {\n this._overlayRef.updatePosition();\n }\n });\n }\n else {\n this._scrollSubscription = stream.subscribe(this._detach);\n }\n }", "title": "" }, { "docid": "853cc047082e1bfe2db6fd7fc72f9eb3", "score": "0.5609352", "text": "function qodefCompareHolderScroll(){\n var compareHolderScroll = $('.qodef-re-compare-holder .qodef-re-compare-holder-scroll');\n if(compareHolderScroll.length){\n var itemsHolder = compareHolderScroll.find('.qodef-re-compare-items-holder'),\n titleHolder = $( '.qodef-re-compare-holder-title' ),\n actionsHolder = compareHolderScroll.find('.qodef-re-compare-actions'),\n itemsHolderHeight = titleHolder.outerHeight( true ) + actionsHolder.outerHeight( true );\n\n itemsHolder.css('height', 'calc(100% - ' + itemsHolderHeight + 'px)');\n\n var $defaultParams = {\n wheelSpeed: 0.6,\n suppressScrollX: true\n };\n\n var $compareHolderPS = new PerfectScrollbar(\n itemsHolder[0],\n $defaultParams\n );\n\n $( window ).resize(\n function () {\n $compareHolderPS.update();\n }\n );\n }\n }", "title": "" }, { "docid": "2ece326453fa5a4d2aa5aa9b48815717", "score": "0.56056964", "text": "checkViewportSize() {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n this._scrollStrategy.onDataLengthChanged();\n }", "title": "" }, { "docid": "2ece326453fa5a4d2aa5aa9b48815717", "score": "0.56056964", "text": "checkViewportSize() {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n this._scrollStrategy.onDataLengthChanged();\n }", "title": "" }, { "docid": "2ece326453fa5a4d2aa5aa9b48815717", "score": "0.56056964", "text": "checkViewportSize() {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n this._scrollStrategy.onDataLengthChanged();\n }", "title": "" }, { "docid": "cb72b1fe43c0f96a75f307e6ece21098", "score": "0.55998576", "text": "function refreshScrollbar() {\n $timeout(function() {\n $scope.$broadcast('rebuild:assignedAnswers');\n $scope.$broadcast('reload:assignedAnswers');\n }, 50);\n }", "title": "" }, { "docid": "994bfcedb00a30dcdcd9499f6f9d300a", "score": "0.5598615", "text": "viewportChanged_() {\n if (!this.documentDimensions) {\n return;\n }\n\n this.updateUIForViewportChange();\n\n const visiblePage = this.viewport_.getMostVisiblePage();\n const visiblePageDimensions = this.viewport_.getPageScreenRect(visiblePage);\n const size = this.viewport_.size;\n this.sendScriptingMessage({\n type: 'viewport',\n pageX: visiblePageDimensions.x,\n pageY: visiblePageDimensions.y,\n pageWidth: visiblePageDimensions.width,\n viewportWidth: size.width,\n viewportHeight: size.height\n });\n }", "title": "" }, { "docid": "628645e4929f7fede1cf8671a5602865", "score": "0.55690557", "text": "_initScrollbars() {\n if (typeof OverlayScrollbars !== 'undefined') {\n OverlayScrollbars(this.messagesListContainer, {scrollbars: {autoHide: 'leave', autoHideDelay: 600}, overflowBehavior: {x: 'hidden', y: 'scroll'}});\n OverlayScrollbars(this.contactsListContainer, {scrollbars: {autoHide: 'leave', autoHideDelay: 600}, overflowBehavior: {x: 'hidden', y: 'scroll'}});\n this.chatContentScroll = OverlayScrollbars(this.chatContentContainer, {\n scrollbars: {autoHide: 'leave', autoHideDelay: 600},\n overflowBehavior: {x: 'hidden', y: 'scroll'},\n });\n }\n }", "title": "" }, { "docid": "b49c718939fdc2931073942ad4c4ed07", "score": "0.5551734", "text": "updateAPI() {\n let instance = this;\n let {widget, container, scrollBody} = instance;\n let {clientWidth, scrollWidth} = container;\n widget.width(clientWidth);\n if (!scrollBody) {\n widget.css(\"left\", `${container.getBoundingClientRect().left}px`);\n }\n $(\"div\", widget).width(scrollWidth);\n // Fit widget height to the native scroll bar height if needed\n if (scrollWidth > clientWidth) {\n widget.height(widget[0].offsetHeight - widget[0].clientHeight + 1); // +1px JIC\n }\n instance.syncWidget();\n instance.checkVisibility(); // fixes issue #2\n }", "title": "" }, { "docid": "5e72f781fc1cbd682adb032d4e99fd3f", "score": "0.5536976", "text": "updateGridScrollbars() {\n\n var collectionHeight = this._private.configFunctions.getCollectionLength() * this._private.rowHeight + (this._private.rowHeight / 2);\n var bodyHeight = this._private.htmlCache.content.offsetHeight;\n //_private.largeScrollLimit = bodyHeight; why was this here... leave it here incase there is something Im missing atm\n\n if (collectionHeight <= bodyHeight) {\n this._private.htmlCache.content.scrollTop = 0;\n //_private.htmlCache.content.scrollLeft = 0;\n this._private.htmlCache.content.style.overflow = \"\";\n this._private.htmlCache.content.style.overflowY = \"hidden\";\n this._private.htmlCache.content.style.overflowX = \"hidden\";\n this._private.htmlCache.header.style.overflowY = \"hidden\";\n\n } else {\n // this._private.htmlCache.content.scrollLeft = 0;\n this._private.htmlCache.content.style.overflow = \"\";\n this._private.htmlCache.content.style.overflowY = \"scroll\";\n this._private.htmlCache.content.style.overflowX = \"hidden\";\n this._private.htmlCache.header.style.overflowY = \"scroll\";\n\n }\n\n if (this._private.htmlCache.content.offsetWidth - 5 < this.getTotalColumnWidth()) {\n this._private.htmlCache.content.style.overflowX = \"scroll\";\n }\n\n }", "title": "" }, { "docid": "52ea05a768cdc1e4e4065396f046bc84", "score": "0.5535098", "text": "updateUIForViewportChange() {}", "title": "" }, { "docid": "e407706f3fc51ae9d411cd91754065ff", "score": "0.5534792", "text": "function setScroller( tRanges, bPreventEvent )\n {\n // Set up selection range\n var tXaxis = plot.getAxes().xaxis;\n g_tSelection.first.x = tXaxis.p2c( tRanges.xaxis.from );\n g_tSelection.second.x = tXaxis.p2c( tRanges.xaxis.to );\n g_tSelection.first.y = 0;\n g_tSelection.second.y = plot.height();\n\n // Draw the scroller\n plot.triggerRedrawOverlay();\n }", "title": "" }, { "docid": "1984260a5cef58042c047cfa0cd005dc", "score": "0.551952", "text": "function scrollUpdate() {\n\t\t// Get container scroll position\n\t\tvar fromTop = $(this).scrollTop();\n\n\t\t// Test every scroll item to see if it's in view\n\t\tvar onScreen = scrollItems.map(function(){\n\t\t\tif ($(this).offset().top <= (fromTop + heightOffset))\n\t\t\t\treturn this;\n\t\t});\n\n\t\t// Treat the last one as current\n\t\tvar current = onScreen[onScreen.length-1];\n\n\t\tif (current && (callback != 'undefined')) {\n\t\t\t\tvar\tcurrentElement = $(current),\n\t\t\t\t\t\toffset = 0;\n\t\t\t\tif (currentElement.offset()) {\n\t\t\t\t\t\toffset = Math.min((fromTop - currentElement.offset().top) / (currentElement.height()),1.0);\n\t\t\t\t}\n\t\t\t\tcallback(currentElement, offset);\n\t\t}\n\n\t\t\tscrollTicking = false;\n\t}", "title": "" }, { "docid": "690325b5e6ca11f6e7e5e326086b8626", "score": "0.551626", "text": "checkScrollbar() {\n this.isBodyOverflowing = document.body.clientWidth < window.innerWidth;\n this.scrollbarWidth = this.getScrollbarWidth();\n }", "title": "" }, { "docid": "dc17104d187380f32aa8dcc9c726ef9a", "score": "0.5495115", "text": "function checkScroll() {\n if (window.pageXOffset != scroll.left) {\n scroll.top = window.pageYOffset;\n scroll.left = window.pageXOffset;\n \n Stickyfill.refreshAll();\n } else if (window.pageYOffset != scroll.top) {\n scroll.top = window.pageYOffset;\n scroll.left = window.pageXOffset;\n \n // recalc position for all stickies\n stickies.forEach(function (sticky) {\n return sticky._recalcPosition();\n });\n }\n }", "title": "" }, { "docid": "71d64a7c7eb130636ed8ac6973f05226", "score": "0.54726136", "text": "function _isInViewport() {\n _calculateOptionsDimensions();\n $items.css('top', ($outerWrapper.offset().top + $outerWrapper.outerHeight() + itemsHeight > $win.scrollTop() + $win.height()) ? -itemsHeight : '');\n }", "title": "" }, { "docid": "b7762a91e0c825d4c4e1cb0ffef32ba1", "score": "0.5469955", "text": "function lockScroll() {\n let body = document.querySelector('body');\n let fixedEls = document.querySelectorAll('.js-fixed') || null;\n if (fixedEls) {\n for (let i = 0; i < fixedEls.length; i++) {\n fixedEls[i].style.width = `calc(100vw - ${getScrollBarWidth()}px)`;\n }\n }\n body.style.overflow = 'hidden';\n body.style.width = `calc(100vw - ${getScrollBarWidth()}px)`;\n }", "title": "" }, { "docid": "43145c8a13742a77a8c625107ae692dd", "score": "0.54697675", "text": "function updateScroll () {\n if (contentBox !== null && contentBox.width > 0 &&\n contentBox.height > 0) {\n var scrollBy = {\n x: 0,\n y: 0\n };\n var scrollBox = scrollBounds.getBBox();\n var scrollRange = {\n x: contentBox.width,\n y: contentBox.height\n };\n\n var minScroll = {\n x: -contentBox.width + scrollBox.width / 2,\n y: -contentBox.height + scrollBox.height / 2\n\n };\n\n var maxScroll = {\n x: scrollBox.width / 2,\n y: scrollBox.height / 2\n };\n\n var sx, sy;\n\n // Account for dampering or other effects.\n computeActualSpeed();\n\n previousScrollSpeed.x = actualScrollSpeed.x;\n previousScrollSpeed.y = actualScrollSpeed.y;\n\n scrollBy.x = actualScrollSpeed.x * config.scrollUnit.x;\n scrollBy.y = actualScrollSpeed.y * config.scrollUnit.y;\n\n curScroll.x += scrollBy.x / scrollRange.x;\n curScroll.y += scrollBy.y / scrollRange.y;\n\n // Clip to allowed range\n if (curScroll.x > 1) {\n curScroll.x = 1;\n } else if (curScroll.x < 0) {\n curScroll.x = 0;\n }\n\n if (curScroll.y > 1) {\n curScroll.y = 1;\n } else if (curScroll.y < 0) {\n curScroll.y = 0;\n }\n\n // Move the content to the origin, then to the scrollBox's\n // origin and and then apply the scroll'\n sx = -contentBox.x + scrollBox.x +\n curScroll.x * maxScroll.x + (1 - curScroll.x) * minScroll.x;\n sy = -contentBox.y + scrollBox.y +\n curScroll.y * maxScroll.y + (1 - curScroll.y) * minScroll.y;\n content.moveTo(sx, sy);\n\n events.onScrollUpdate.fire({x: curScroll.x, y: curScroll.y});\n\n // In case we have reached zero speed, stop the setInterval.\n checkScrollState();\n }\n }", "title": "" }, { "docid": "f2b56a24c5e68afe11b7f588ec81d38c", "score": "0.54686445", "text": "update() {\n this.content.mask = null;\n this._maskContent.clear();\n if (!this._disabled) {\n this._drawScrollbars();\n this._drawMask();\n if (this.options.dragScroll) {\n const direction =\n this.isScrollbarHorizontal && this.isScrollbarVertical\n ? 'all'\n : this.isScrollbarHorizontal\n ? 'x'\n : 'y';\n if (direction !== null) {\n this.content\n .drag({ clampWheel: true, direction })\n .clamp({ direction, underflow: this.options.underflow });\n }\n }\n }\n }", "title": "" }, { "docid": "faf57f4c0fe64afa8fa48822c1d6081a", "score": "0.54519874", "text": "handleWindowScroll() {\n\n const sectionHTMLElement = this.sectionHTMLElement.current;\n const { top } = sectionHTMLElement.getBoundingClientRect();\n\n const shouldUpdateForScroll = Section.insideScrollRangeForUpdates.call(this, top);\n if ( shouldUpdateForScroll ) {\n this.updateParallaxForSectionScrollPosition(top);\n this.conditionallyDisplaySectionTextForScrollPosition(top);\n this.conditionallyDisplayJackForScrollPosition(top);\n this.conditionallyHidePumpkinAndSkullsForScrollPosition(top);\n }\n }", "title": "" }, { "docid": "b6de427649c54e7d787cacab4e3c656a", "score": "0.5442847", "text": "function checkScroll() {\n if (window.pageXOffset != scroll.left) {\n scroll.top = window.pageYOffset;\n scroll.left = window.pageXOffset;\n Polyficky.refreshAll();\n } else if (window.pageYOffset != scroll.top) {\n scroll.top = window.pageYOffset;\n scroll.left = window.pageXOffset; // recalc position for all stickies\n\n stickies.forEach(function (sticky) {\n return sticky._recalcPosition();\n });\n }\n }", "title": "" }, { "docid": "17960357b122def3ba766ca82e24af12", "score": "0.5431234", "text": "function updateViewportAboveIO() {\n io.viewportAbove = stepEl.map(function (el, i) {\n var marginTop = pageH - stepOffsetTop[i];\n var marginBottom = offsetMargin - viewH - stepOffsetHeight[i];\n var rootMargin = marginTop + \"px 0px \" + marginBottom + \"px 0px\";\n var options = { rootMargin: rootMargin };\n // console.log(options);\n var obs = new IntersectionObserver(intersectViewportAbove, options);\n obs.observe(el);\n return obs;\n });\n }", "title": "" }, { "docid": "17960357b122def3ba766ca82e24af12", "score": "0.5431234", "text": "function updateViewportAboveIO() {\n io.viewportAbove = stepEl.map(function (el, i) {\n var marginTop = pageH - stepOffsetTop[i];\n var marginBottom = offsetMargin - viewH - stepOffsetHeight[i];\n var rootMargin = marginTop + \"px 0px \" + marginBottom + \"px 0px\";\n var options = { rootMargin: rootMargin };\n // console.log(options);\n var obs = new IntersectionObserver(intersectViewportAbove, options);\n obs.observe(el);\n return obs;\n });\n }", "title": "" }, { "docid": "17960357b122def3ba766ca82e24af12", "score": "0.5431234", "text": "function updateViewportAboveIO() {\n io.viewportAbove = stepEl.map(function (el, i) {\n var marginTop = pageH - stepOffsetTop[i];\n var marginBottom = offsetMargin - viewH - stepOffsetHeight[i];\n var rootMargin = marginTop + \"px 0px \" + marginBottom + \"px 0px\";\n var options = { rootMargin: rootMargin };\n // console.log(options);\n var obs = new IntersectionObserver(intersectViewportAbove, options);\n obs.observe(el);\n return obs;\n });\n }", "title": "" }, { "docid": "17960357b122def3ba766ca82e24af12", "score": "0.5431234", "text": "function updateViewportAboveIO() {\n io.viewportAbove = stepEl.map(function (el, i) {\n var marginTop = pageH - stepOffsetTop[i];\n var marginBottom = offsetMargin - viewH - stepOffsetHeight[i];\n var rootMargin = marginTop + \"px 0px \" + marginBottom + \"px 0px\";\n var options = { rootMargin: rootMargin };\n // console.log(options);\n var obs = new IntersectionObserver(intersectViewportAbove, options);\n obs.observe(el);\n return obs;\n });\n }", "title": "" }, { "docid": "f9a35f58a813d809fe8a23c117be4f7d", "score": "0.54202247", "text": "_calcDimensionsWithScroll(){\n var dims = this.dimensions;\n \n dims.sidebarLeft = StickySidebar.offsetRelative(this.sidebar).left;\n \n dims.viewportTop = document.documentElement.scrollTop || document.body.scrollTop;\n dims.viewportBottom = dims.viewportTop + dims.viewportHeight;\n dims.viewportLeft = document.documentElement.scrollLeft || document.body.scrollLeft;\n \n dims.topSpacing = this.options.topSpacing;\n dims.bottomSpacing = this.options.bottomSpacing;\n \n if( 'function' === typeof dims.topSpacing )\n dims.topSpacing = parseInt(dims.topSpacing(this.sidebar)) || 0;\n \n if( 'function' === typeof dims.bottomSpacing )\n dims.bottomSpacing = parseInt(dims.bottomSpacing(this.sidebar)) || 0;\n \n if( 'VIEWPORT-TOP' === this.affixedType ){\n // Adjust translate Y in the case decrease top spacing value.\n if( dims.topSpacing < dims.lastTopSpacing ){\n dims.translateY += dims.lastTopSpacing - dims.topSpacing;\n this._reStyle = true; \n }\n \n } else if( 'VIEWPORT-BOTTOM' === this.affixedType ){\n // Adjust translate Y in the case decrease bottom spacing value.\n if( dims.bottomSpacing < dims.lastBottomSpacing ){\n dims.translateY += dims.lastBottomSpacing - dims.bottomSpacing;\n this._reStyle = true;\n }\n }\n \n dims.lastTopSpacing = dims.topSpacing;\n dims.lastBottomSpacing = dims.bottomSpacing;\n }", "title": "" }, { "docid": "ef719c4184da14fac31c28b174437f71", "score": "0.53874975", "text": "static async lockScroll() {\n return await browser.runtime.sendMessage(kTST_ID, {\n type: tstAPI.SCROLL_LOCK\n });\n }", "title": "" }, { "docid": "d8cf213bfd88ece7b450878da1b30908", "score": "0.53815293", "text": "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "title": "" }, { "docid": "d8cf213bfd88ece7b450878da1b30908", "score": "0.53815293", "text": "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "title": "" }, { "docid": "d8cf213bfd88ece7b450878da1b30908", "score": "0.53815293", "text": "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "title": "" }, { "docid": "d8cf213bfd88ece7b450878da1b30908", "score": "0.53815293", "text": "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "title": "" }, { "docid": "1653aac7ecf048e0aa3af16eeb851c72", "score": "0.5381137", "text": "function onScroll() {\n // unique tick id\n ++ticks;\n\n // viewport rectangle\n //var top = jWindow.scrollTop(),\n var top = jWindow.offset() ? jWindow.offset().top : jWindow.scrollTop(),\n left = jWindow.scrollLeft(),\n right = left + jWindow.width(),\n bottom = top + jWindow.height();\n //bottom = jWindow.height();\n\n // determine which elements are in view\n // + 60 accounts for fixed nav\n /* MOD START */\n // var intersections = findElements(top+offset.top + 200, right+offset.right, bottom+offset.bottom, left+offset.left);\n var intersections = findElements(top + offset.top, right + offset.right, bottom + offset.bottom, left + offset.left);\n //var intersections = findElements(top, right, bottom, left);\n /* MOD END */\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": "a6c79f97fc5f108fee962f5937447e39", "score": "0.5376621", "text": "function handleWindowScroll() {}", "title": "" }, { "docid": "4b5c9a853141c08de93340e8108ad1cc", "score": "0.53726894", "text": "function hostOnMouseMove() {\r\n if (_scrollbarsAutoHideMove) {\r\n refreshScrollbarsAutoHide(true);\r\n clearTimeout(_scrollbarsAutoHideMoveTimeoutId);\r\n _scrollbarsAutoHideMoveTimeoutId = setTimeout(function () {\r\n if (_scrollbarsAutoHideMove && !_destroyed)\r\n refreshScrollbarsAutoHide(false);\r\n }, 100);\r\n }\r\n }", "title": "" }, { "docid": "ec430353a8f10ae3d5f3fd50c6999c79", "score": "0.5372005", "text": "function update(){\r\n\t\t\tvar pos = $window.scrollTop();\r\n\r\n\t\t\t$this.each(function(){\r\n\t\t\t\tif (($(this).data('firstTop') - $window.height() + finalSettings.visibleGap) < pos) {\r\n\t\t\t\t\t// viewport entrance\r\n\t\t\t\t\tif (!$(this).data('isVisible')) {\r\n\r\n\t\t\t\t\t\t(function(i, that, timeout) {\r\n\t\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\t\tthat.data('isVisible', true);\r\n\t\t\t\t\t\t\t\tthat.attr('data-appear', 'appear');\r\n\t\t\t\t\t\t\t}, (i * timeout));\r\n\t\t\t\t\t\t}( $(this).data('indexEl'), $(this), finalSettings.timeOut ));\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// exit viewport\r\n\t\t\t\t\t$(this).data('isVisible', false);\r\n\t\t\t\t\t$(this).attr('data-appear', 'disappear');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "2ec2e7e30dd97abe297f6fea0990696f", "score": "0.5343106", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display, sizes = d.scrollbars.update(measure);\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\", d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\", \n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\", sizes.right && sizes.bottom ? (d.scrollbarFiller.style.display = \"block\", \n d.scrollbarFiller.style.height = sizes.bottom + \"px\", d.scrollbarFiller.style.width = sizes.right + \"px\") : d.scrollbarFiller.style.display = \"\", \n sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter ? (d.gutterFiller.style.display = \"block\", \n d.gutterFiller.style.height = sizes.bottom + \"px\", d.gutterFiller.style.width = measure.gutterWidth + \"px\") : d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "44975d38c36faba37c3aedd15bbc9661", "score": "0.53382045", "text": "syncScroll(type) {\r\n if (this.modelInvalid()) {\r\n return;\r\n }\r\n if (!this.lockScroll) {\r\n return;\r\n }\r\n // editor: What triggered event, other: What needs to be synced\r\n let editor;\r\n let other;\r\n if (type === EventDirection.OUTGOING) {\r\n editor = this.baseEditor;\r\n other = this.ownEditor;\r\n }\r\n else {\r\n editor = this.ownEditor;\r\n other = this.baseEditor;\r\n }\r\n if (editor.state.scrollSetBy === this) {\r\n editor.state.scrollSetBy = null;\r\n return;\r\n }\r\n // Position to update to\r\n other.state.scrollPosition = editor.getScrollInfo();\r\n // If ticking, we already have a scroll queued\r\n if (other.state.scrollTicking) {\r\n return;\r\n }\r\n let sInfo = other.getScrollInfo();\r\n // Don't queue an event if already synced.\r\n if (other.state.scrollPosition.top === sInfo.top &&\r\n other.state.scrollPosition.left === sInfo.left) {\r\n return;\r\n }\r\n // Throttle by requestAnimationFrame().\r\n // If event is outgoing, this will lead to a one frame delay of other DiffViews\r\n let self = this;\r\n window.requestAnimationFrame(function () {\r\n other.scrollTo(other.state.scrollPosition.left, other.state.scrollPosition.top);\r\n other.state.scrollTicking = false;\r\n other.state.scrollSetBy = self;\r\n });\r\n other.state.scrollTicking = true;\r\n return;\r\n }", "title": "" }, { "docid": "7d8cfa3da4d83b7f7f7c4b764305e2df", "score": "0.53290784", "text": "function ScrollSync(srcElementId)\n{\n\tvar srcElement = document.getElementById(srcElementId);\n\n\tvar pane = srcElementId == 'diff_source' ? sourcePane : targetPane;\n\tpane.SyncOtherPane();\n}", "title": "" }, { "docid": "37655fcb87d588d2f433ca231936081f", "score": "0.53250086", "text": "function onScroll() {\n // ensure that events don't stack\n if (!busy) {\n // find elements to update\n var elementsToUpdate = getElementsToUpdate();\n\n if (elementsToUpdate.length > 0) {\n // suspend accepting scroll events\n busy = true;\n\n // asynchronuously update elements\n window.requestAnimationFrame(function() {\n updateElements(elementsToUpdate);\n });\n }\n }\n }", "title": "" }, { "docid": "822c6a53906aeb9a268873785c894985", "score": "0.5314353", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n }\n else {\n d.scrollbarFiller.style.display = \"\";\n }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n }\n else {\n d.gutterFiller.style.display = \"\";\n }\n }", "title": "" }, { "docid": "dcd8f1f984e0abb750a66acccb19e048", "score": "0.5309068", "text": "function refreshScrollArea()\n{\n\tcontentarea.object.refresh();\n}", "title": "" }, { "docid": "a9a0da9c435a385c51462025a4438484", "score": "0.5302663", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else\n d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else\n d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "3b16bb4cc823d2d48079485ff8b3979c", "score": "0.52943766", "text": "function refreshScrollbar() {\n $scope.$broadcast('rebuild:regQuestions');\n $timeout(function() {\n $scope.$broadcast('reload:regQuestions');\n }, 50);\n }", "title": "" }, { "docid": "2f7b83217c1d62b05e5911836296cea4", "score": "0.5277153", "text": "function CGMZ_Window_Scrollable() {\n this.initialize(...arguments);\n}", "title": "" }, { "docid": "1973c8675d7a47a7bdca9d38367d210c", "score": "0.52756137", "text": "onUpdate(prevProps, prevState, prevSnape){\n const {visablePercentX, visablePercentY, displayScrollbarX, displayScrollbarY, scrollMaxX, scrollMaxY, scrollY, scrollX} = this.state;\n const {maxHeight, minHeight} = this.props;\n\n //measure container and content\n if(!this.containerRef.current || !this.contentRef.current || !this.outerRef.current) return;\n var container = ink.measureElement(this.containerRef.current);\n var content = ink.measureElement(this.contentRef.current);\n var outer = ink.measureElement(this.outerRef.current);\n\n var tmpState = {\n scrollX: scrollX,\n scrollY: scrollY,\n container:container,\n content:content,\n outer:outer,\n displayScrollbarX: displayScrollbarX,\n displayScrollbarY: displayScrollbarY,\n scrollbarWidth: this.scrollbarWidth,\n maxHeight:maxHeight,\n minHeight:minHeight,\n scrollMaxX: scrollMaxX,\n scrollMaxY: scrollMaxY,\n visablePercentX:visablePercentX,\n visablePercentY:visablePercentY\n }\n\n tmpState = this.setScrollbarX(tmpState, \"none\");\n tmpState = this.setScrollbarY(tmpState, \"none\");\n\n tmpState = this.calculateScrollMax(tmpState);\n tmpState = this.calculateSize(tmpState);\n tmpState = this.calculateScrollMax(tmpState);\n tmpState = this.calculateScrollbars(tmpState);\n tmpState = this.calculateSize(tmpState);\n tmpState = this.calculateScrollMax(tmpState);\n tmpState = this.calculateScrollbars(tmpState);\n\n \n tmpState.scrollMaxX = Math.max(0, tmpState.scrollMaxX);\n tmpState.scrollMaxY = Math.max(0, tmpState.scrollMaxY);\n\n if(tmpState.scrollX > tmpState.scrollMaxX) tmpState.scrollX = tmpState.scrollMaxX;\n if(tmpState.scrollY > tmpState.scrollMaxY) tmpState.scrollY = tmpState.scrollMaxY;\n\n tmpState.visablePercentX = Math.min(Math.max(0, container.width / content.width), 1);\n tmpState.visablePercentY = Math.min(Math.max(0, container.height / content.height), 1);\n\n this.setState({\n scrollY: tmpState.scrollY,\n scrollX: tmpState.scrollX,\n scrollMaxX: tmpState.scrollMaxX,\n scrollMaxY: tmpState.scrollMaxY,\n displayScrollbarX: tmpState.displayScrollbarX,\n displayScrollbarY: tmpState.displayScrollbarY,\n internalHeight: tmpState.outer.height,\n visablePercentX:tmpState.visablePercentX,\n visablePercentY:tmpState.visablePercentY\n })\n }", "title": "" }, { "docid": "54e2afe72755b0834fa145fe8b1a71d5", "score": "0.52742034", "text": "function triggerBody() {\n $(window).scroll();\n $(window).resize();\n\n initScrollMonitor();\n }", "title": "" }, { "docid": "e9f8a2faf1eb8505ad32b02e23e5e90d", "score": "0.52739215", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "e9f8a2faf1eb8505ad32b02e23e5e90d", "score": "0.52739215", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "e9f8a2faf1eb8505ad32b02e23e5e90d", "score": "0.52739215", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.52695286", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" } ]
ca4944d1dd963d9cd9cc5b188caebb6a
import Bar from './Bar';
[ { "docid": "fa5beba19305f6fd713c0350bb63a7f0", "score": "0.0", "text": "function Home(){\r\n return (\r\n <div>\r\n <div className=\"container\">\r\n <div className=\"row justify-content-center\">\r\n <div className=\"col-md-8\">\r\n <div className=\"card\">\r\n <div className=\"card-header\">Welcome to home</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}", "title": "" } ]
[ { "docid": "96dad832d9991d80bed710c4704adbc2", "score": "0.5786769", "text": "export() {}", "title": "" }, { "docid": "96dad832d9991d80bed710c4704adbc2", "score": "0.5786769", "text": "export() {}", "title": "" }, { "docid": "d2799aafca2cb27dbf2b4dbdb7df2591", "score": "0.5781561", "text": "constructor() {\n super();\n this.#barUtils = new BarUtils();\n }", "title": "" }, { "docid": "4a5949b8a035a6757c8e587a831313e6", "score": "0.57094693", "text": "import() {}", "title": "" }, { "docid": "f8dbcbad6252c2ce976d0ad90be9797a", "score": "0.5677166", "text": "function Bar() { }", "title": "" }, { "docid": "4500e5ba05252240831753c8891d4f59", "score": "0.51551425", "text": "constructor() {\n super('Main');\n }", "title": "" }, { "docid": "ec4a1e3eb52ab660d7a1708e6b951f4f", "score": "0.5051841", "text": "function Import(){\n console.log(\"yes\");\n }", "title": "" }, { "docid": "8192b8155bcb8b7bb2b1ddb14469d8b2", "score": "0.50203145", "text": "function Bar2(name) {\n Foo.call(this, name)\n}", "title": "" }, { "docid": "b564c776fc4166aa0af9e2e4e8830ed6", "score": "0.5020247", "text": "function bar() {\n\tconsole.log(\"Bar\");\n}", "title": "" }, { "docid": "c486c11845168b3ac76d29bee02e1c6e", "score": "0.49513906", "text": "function __WEBPACK_DEFAULT_EXPORT__() {}", "title": "" }, { "docid": "ca7c2efbe8dbbb39a5ba61ada75024ba", "score": "0.49407545", "text": "#import() {\n if (this.pathExists) {\n delete require.cache[require.resolve(this.#path)];\n this.#module = require(this.#path);\n } else {\n this.#module = null;\n }\n }", "title": "" }, { "docid": "4dbad73f5565958a907fdee6ae00fc86", "score": "0.49016035", "text": "constructor()\n {\n var modelName = this.constructor.name.replace(\"Controller\",\"\");\n this.model = require(\"../models/\"+modelName);\n }", "title": "" }, { "docid": "20d682802f939096d5a36e3aa0a2d002", "score": "0.49009484", "text": "function bar() {}", "title": "" }, { "docid": "20d682802f939096d5a36e3aa0a2d002", "score": "0.49009484", "text": "function bar() {}", "title": "" }, { "docid": "3592222a25bceb44ece240f02c6cb46f", "score": "0.48952922", "text": "function importWidgets() {\n return require(\"./widget/\").default;\n}", "title": "" }, { "docid": "d4cad196c5ac4c4e7d1e1eec04f0482c", "score": "0.48393777", "text": "function App() {\n // creating function that brings will be exported to the index.js\n return (\n //react-route tag that lets the page direct between different routes.\n <Router>\n <div>\n <Nav />\n {/* navbar that's imported from the navbar file. */}\n <Switch>\n {/* exact path lets the page direct to the correct place, depending on which route is hit. without the exact path of the pages that are in the website, it directs to a 404. */}\n <Route exact path=\"/\" component={Home} />\n <Route exact path=\"/saved\" component={Saved} />\n <Route component={NoMatch} />\n </Switch>\n </div>\n </Router>\n );\n}", "title": "" }, { "docid": "3e5758a874da0270d19545398a87fd98", "score": "0.48334172", "text": "function App() {\n let randomNumber = Math.round(Math.random() * 10);\n\n return (\n <div className=\"App\">\n <Home />\n <Bar randomNumber={randomNumber} />\n </div>\n );\n}", "title": "" }, { "docid": "99cdd64fca1890362e018c6a1af4b826", "score": "0.48017585", "text": "import(value) {}", "title": "" }, { "docid": "3a671ef1b4c9e1e53a43f8d5fba9fdcd", "score": "0.47632867", "text": "function App() {\r\n return <div className=\"App\"></div>\r\n}", "title": "" }, { "docid": "eea1da582f6ba18750c8c0331a1bd608", "score": "0.47515333", "text": "function App() {\n return <TodoApp />;\n}", "title": "" }, { "docid": "9b593b7e102ea3100ee568a81ad1de01", "score": "0.4688198", "text": "function CsvExportComponent() {\n }", "title": "" }, { "docid": "20c4c877bcab9c104aa8c68be0ba0373", "score": "0.46770737", "text": "function main() {\r\n\tconst routes = require(\"./routes\").default();\r\n\tReactDOM.render(\r\n\t\t<Router history = {history}>\r\n\t\t\t{routes}\r\n\t\t</Router>, \r\n\t\tdocument.getElementById(\"mount\"));\r\n}", "title": "" }, { "docid": "0bedd75e70178146751a42df55a86df4", "score": "0.46603346", "text": "detectBar(){\n}", "title": "" }, { "docid": "d1c987fd07273bf301a91048bdfa4a6e", "score": "0.4643409", "text": "import(dirname) {\n return this.importer(this.get('module root'))(dirname);\n }", "title": "" }, { "docid": "5d97f045b19cfa33226983b2d00e6e9f", "score": "0.4621167", "text": "function bar() {\r\n console.log('hello');\r\n}", "title": "" }, { "docid": "8841d36a9a662168b977e1cabd08b18a", "score": "0.46137914", "text": "constructor() {\n // TODO\n }", "title": "" }, { "docid": "8841d36a9a662168b977e1cabd08b18a", "score": "0.46137914", "text": "constructor() {\n // TODO\n }", "title": "" }, { "docid": "a51e8c8b3b3a3c0a3d6b3c916c9baf32", "score": "0.46019003", "text": "function Barrel ( ) {\n}", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" }, { "docid": "5b5ad8b7e51f7bea27226f01f31b0c73", "score": "0.4598832", "text": "constructor() {\n super();\n }", "title": "" } ]
06f858f9eaaf975c5fa07c009f718c8a
Try to merge this container upwards.
[ { "docid": "7b91aaef7fa378ee0da4c4c5d551f537", "score": "0.5851729", "text": "merge() {\n\t\tif( this.parent instanceof Container ) {\n\t\t\tthis.parent.children.splice(\n\t\t\t\tthis.parent.children.indexOf(this),\n\t\t\t\t1,\n\t\t\t\tthis.children[0]);\n\t\t\tthis.children[0].parent = this.parent;\n\t\t\tif( this.parent.children.length === 1 ) {\n\t\t\t\tthis.parent.merge();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.parent.redraw();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis.redraw();\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "05a1c10bc8e3d18262ba1c9d42951004", "score": "0.59236723", "text": "ascend() {\n\n\t\tthis._curPointer = this._pointerStack.pop();\n\t\tthis._containersChain.pop();\n\t}", "title": "" }, { "docid": "f51bb4b889c6e033f5f69230c77461d6", "score": "0.5447619", "text": "function moveUp() {\n moveEntryUpInArray(data, index);\n updateData(data);\n }", "title": "" }, { "docid": "06013340c91ed4de5cc5a7287f04e7ad", "score": "0.5432122", "text": "function distribute_outputs_upwards (self) {\n if (self.has_no_containerQ ()) {\n } else {\n\t{ /*let*/\n\t let parent = self.container ();\n\t parent.distribute_output_events ();\n\t} /* end let */\n }\n}", "title": "" }, { "docid": "ab52a0aca9fb2102e18cf14cb38b7725", "score": "0.53776443", "text": "static moveBackwards(items) {\n PaperJSOrderingUtils._sortItemsByLayer(items).forEach(layerItems => {\n PaperJSOrderingUtils._sortItemsByZIndex(layerItems).forEach(item => {\n if (item.previousSibling && items.indexOf(item.previousSibling) === -1) {\n item.insertBelow(item.previousSibling);\n }\n });\n });\n }", "title": "" }, { "docid": "7820e5d3bb69fb5b669e06c755bfb217", "score": "0.5222032", "text": "function moveParseUp(node) {\n\t var parent = node.parent;\n\t // move parse up by merging or swapping\n\t if (node instanceof formatparse.ParseNode) {\n\t if (parent instanceof source$1.SourceNode) {\n\t return false;\n\t }\n\t if (parent.numChildren() > 1) {\n\t // don't move parse further up but continue with parent.\n\t return true;\n\t }\n\t if (parent instanceof formatparse.ParseNode) {\n\t parent.merge(node);\n\t }\n\t else {\n\t // don't swap with nodes that produce something that the parse node depends on (e.g. lookup)\n\t if (util$1.hasIntersection(parent.producedFields(), node.dependentFields())) {\n\t return true;\n\t }\n\t node.swapWithParent();\n\t }\n\t }\n\t return true;\n\t}", "title": "" }, { "docid": "7baf782f330dd6b3869757ed3f1831ba", "score": "0.5207515", "text": "moveToTop() {\n if (\n this.parentLayer &&\n this.parentLayer.children.length > 1 &&\n this.parentLayer.children[0] !== this\n ) {\n this.parentLayer.children.splice(\n this.parentLayer.children.indexOf(this),\n 1\n )\n\n this.parentLayer.children.unshift(this)\n }\n }", "title": "" }, { "docid": "d2310e65b6e7b813bc0dbf7ff016a2be", "score": "0.51981235", "text": "moveUp(gameboard) {\n let tempGameboard = this.compressUp(gameboard);\n let finalGameboard = this.mergeUp(tempGameboard)\n return (this.compressUp(finalGameboard));\n }", "title": "" }, { "docid": "449109a499d0e2f3463f4097e063935b", "score": "0.51620454", "text": "movePrev() {\n const stack = this.stack;\n\n if (stack.length === 0) {\n return;\n }\n\n let n = stack[stack.length - 1];\n\n if (n && n.left) {\n n = n.left;\n\n while (n) {\n stack.push(n);\n n = n.right;\n }\n } else {\n stack.pop();\n\n while (stack.length > 0 && stack[stack.length - 1].left === n) {\n n = stack[stack.length - 1];\n stack.pop();\n }\n }\n }", "title": "" }, { "docid": "95d0ed528ac123705419308fb96ed642", "score": "0.5149958", "text": "shift () {\n\t\tvar c;\n\t\tfor ( var i=0; i<this.containers.length; ++i ) {\n\t\t\tif ( ! this.dataset[this.offset + i] ) continue; // prevent boundary error\n\t\t\tc = this.containers[i];\n\t\t\tif ( c.firstChild ) c.removeChild(c.firstChild);\n\t\t\tc.appendChild(this.dataset[this.offset + i]);\n\t\t}\n\t}", "title": "" }, { "docid": "e172123cd6376685c12bc25a42fe7646", "score": "0.5131004", "text": "bubbleUp() {\n let idx = this.values.length - 1;\n const element = this.values[idx];\n while (idx > 0) {//if index is zero means the top element\n let parentIdx = Math.floor((idx - 1) / 2);//(n-1)/2\n let parent = this.values[parentIdx];\n if (parent >= element) break;\n this.values[parentIdx] = element;\n this.values[idx] = parent;\n idx = parentIdx;\n }\n }", "title": "" }, { "docid": "51372f641f2a66fe56776f7ca574747f", "score": "0.5121275", "text": "function moveJunctionCollectionsBack(a,b) {\n\tif (isJunctionCollection(a.note) || isJunctionCollection(b.note)) {\n\t\tif (isJunctionCollection(a.note)) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (isJunctionCollection(b.note)) {\n\t\t\treturn -1;\n\t\t}\n\t}\n\n\treturn 0;\n}", "title": "" }, { "docid": "e407542258a186976f0b406ae321f243", "score": "0.51111954", "text": "heapifyUp() {\n let currentIndex = this.size - 1;\n // looping and swapping elements while parent is greater than child.\n while(this.hasParent(currentIndex) &&\n this.items[currentIndex] < this.getParent(currentIndex)) {\n this.swap(currentIndex, this.getParentIndex(currentIndex));\n currentIndex = this.getParentIndex(currentIndex);\n }\n }", "title": "" }, { "docid": "6123aedf21815213ee170c7e89ce2d4d", "score": "0.50978506", "text": "bubbleUp() {\n let idx = this.values.length - 1;\n const lastElement = this.values[idx];\n while (idx > 0) {\n //finding the parent element\n let parentIdx = Math.floor((idx - 1) / 2)\n let parent = this.values[parentIdx];\n if (lastElement.priority <= parent.priority) break;\n this.values[parentIdx] = lastElement;\n this.values[idx] = parent;\n idx = parentIdx;\n\n }\n }", "title": "" }, { "docid": "c174f529db5f2d982dba003ded6a6f57", "score": "0.5086208", "text": "function moveUp() {\r\n // need tiles to move all the way up - scan top->bottom\r\n // row decreases\r\n for (let row = 1; row < boardSize; row++) {\r\n for (let col = 0; col < boardSize; col++) {\r\n let offset = 1;\r\n while (row - offset >= 0 && state[row - offset][col] == null) {\r\n offset++;\r\n }\r\n if (offset > 1) {\r\n state[row - offset + 1][col] = state[row][col];\r\n state[row][col] = null;\r\n }\r\n if (row - offset >= 0 && state[row - offset][col] === state[row - offset + 1][col]) {\r\n state[row - offset][col] *= 2;\r\n state[row - offset + 1][col] = null;\r\n }\r\n // then merge\r\n }\r\n }\r\n}", "title": "" }, { "docid": "a7b3fe74f2fc21342e4e7c337eb7f98e", "score": "0.50636345", "text": "function moveParseUp(node) {\n var parent = node.parent;\n // move parse up by merging or swapping\n if (node instanceof formatparse_1.ParseNode) {\n if (parent instanceof source_1.SourceNode) {\n return false;\n }\n if (parent.numChildren() > 1) {\n // don't move parse further up but continue with parent.\n return true;\n }\n if (parent instanceof formatparse_1.ParseNode) {\n parent.merge(node);\n }\n else {\n // don't swap with nodes that produce something that the parse node depends on (e.g. lookup)\n if (util_1.hasIntersection(parent.producedFields(), node.dependentFields())) {\n return true;\n }\n node.swapWithParent();\n }\n }\n return true;\n}", "title": "" }, { "docid": "a7b3fe74f2fc21342e4e7c337eb7f98e", "score": "0.50636345", "text": "function moveParseUp(node) {\n var parent = node.parent;\n // move parse up by merging or swapping\n if (node instanceof formatparse_1.ParseNode) {\n if (parent instanceof source_1.SourceNode) {\n return false;\n }\n if (parent.numChildren() > 1) {\n // don't move parse further up but continue with parent.\n return true;\n }\n if (parent instanceof formatparse_1.ParseNode) {\n parent.merge(node);\n }\n else {\n // don't swap with nodes that produce something that the parse node depends on (e.g. lookup)\n if (util_1.hasIntersection(parent.producedFields(), node.dependentFields())) {\n return true;\n }\n node.swapWithParent();\n }\n }\n return true;\n}", "title": "" }, { "docid": "a7b3fe74f2fc21342e4e7c337eb7f98e", "score": "0.50636345", "text": "function moveParseUp(node) {\n var parent = node.parent;\n // move parse up by merging or swapping\n if (node instanceof formatparse_1.ParseNode) {\n if (parent instanceof source_1.SourceNode) {\n return false;\n }\n if (parent.numChildren() > 1) {\n // don't move parse further up but continue with parent.\n return true;\n }\n if (parent instanceof formatparse_1.ParseNode) {\n parent.merge(node);\n }\n else {\n // don't swap with nodes that produce something that the parse node depends on (e.g. lookup)\n if (util_1.hasIntersection(parent.producedFields(), node.dependentFields())) {\n return true;\n }\n node.swapWithParent();\n }\n }\n return true;\n}", "title": "" }, { "docid": "a7b3fe74f2fc21342e4e7c337eb7f98e", "score": "0.50636345", "text": "function moveParseUp(node) {\n var parent = node.parent;\n // move parse up by merging or swapping\n if (node instanceof formatparse_1.ParseNode) {\n if (parent instanceof source_1.SourceNode) {\n return false;\n }\n if (parent.numChildren() > 1) {\n // don't move parse further up but continue with parent.\n return true;\n }\n if (parent instanceof formatparse_1.ParseNode) {\n parent.merge(node);\n }\n else {\n // don't swap with nodes that produce something that the parse node depends on (e.g. lookup)\n if (util_1.hasIntersection(parent.producedFields(), node.dependentFields())) {\n return true;\n }\n node.swapWithParent();\n }\n }\n return true;\n}", "title": "" }, { "docid": "13ee5dceb015803f66046218eebed1d9", "score": "0.50555354", "text": "static moveForwards(items) {\n PaperJSOrderingUtils._sortItemsByLayer(items).forEach(layerItems => {\n PaperJSOrderingUtils._sortItemsByZIndex(layerItems).reverse().forEach(item => {\n if (item.nextSibling && items.indexOf(item.nextSibling) === -1) {\n item.insertAbove(item.nextSibling);\n }\n });\n });\n }", "title": "" }, { "docid": "2ea1eaaccbed30760bf307431e70eed8", "score": "0.50500536", "text": "bringForward() {\n const _index = this.zIndex();\n // don't do anything if already in front:\n if (_index !== this.parent.viewsZOrder.length - 1 && this.zOrderDisabled === false) {\n this.parent.viewsZOrder.splice(_index, 1);\n this.parent.viewsZOrder.splice(_index + 1, 0, this.viewId);\n this._updateZIndexAllSiblings();\n }\n return this;\n }", "title": "" }, { "docid": "1eec8f900589451e38dd1f0b75e1c634", "score": "0.5033882", "text": "forceMergeRuns () {\n while (this.stackSize > 1) {\n let n = this.stackSize - 2\n\n if (n > 0 && this.runLength[n - 1] < this.runLength[n + 1]) {\n n --\n }\n\n this.mergeAt(n)\n }\n }", "title": "" }, { "docid": "b6f6fc56e2307df4bd80577a714411d3", "score": "0.50222313", "text": "moveUp() {\n if (this.stay == false && this.y > 0) {\n this.y -= this.size;\n }\n }", "title": "" }, { "docid": "20e98faad68f5cf3db00942d270983bb", "score": "0.5004781", "text": "function merge(elevator, up, nextRound, index){\n if(up){\n elevator.destinationQueue=nextRound;\n elevator.checkDestinationQueue();\n nextRoundUpMap.set(index,[]);\n }else{\n elevator.destinationQueue=nextRound;\n elevator.checkDestinationQueue();\n nextRoundDownMap.set(index,[]);\n }\n }", "title": "" }, { "docid": "0827be5787982a4173a7569e6a205ce4", "score": "0.5001317", "text": "function moveAssetsbacktoleft(){\n\t\t\t/**\n\t\t\t * STORE ALL ASSET DATA COLLECTION SECTIONS IN AN ARRAY\n\t\t\t */\n\t\t\tconst asset_categories = [\"#house\", \"#rentals\", '#land', '#image_upload', '#collection_success'];\n\t\t\tvar asset_category_counter;\n\t\t\tfor (asset_category_counter = 0; asset_category_counter < asset_categories.length; ++asset_category_counter) {\n\t\t\t\telementMotion(asset_categories[asset_category_counter], 'move_left', 'move_right', 'Data collection completed successfully');\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "eb36f56055d7b7d1c69105822263f0da", "score": "0.4949103", "text": "function moveUp() {\n var isAgenda = checkIsAgendaMode();\n var cursor = getCursor();\n if (isAgenda) {\n warn('Moving task up does not work in agenda mode (yet).');\n } else if (!cursor) {\n warn('No cursor to move up.');\n } else {\n dragTaskOver(cursor, function() {\n var tasks = getTasks();\n var cursorIndex = tasks.indexOf(cursor);\n var cursorIndent = getTaskIndentClass(cursor);\n for (var i = cursorIndex - 1; i >= 0; i--) {\n var task = tasks[i];\n var indent = getTaskIndentClass(task);\n if (indent === cursorIndent) {\n return {\n destination: task,\n horizontalOffset: 0,\n verticalOffset: cursor.clientHeight / -3\n };\n } else if (indent < cursorIndent) {\n warn('Refusing to dedent task to move it up.');\n return null;\n }\n }\n warn('Couldn\\'t find task above cursor to move it above.');\n return null;\n });\n }\n }", "title": "" }, { "docid": "81e129719ff1eae95583ef5c114ab9e0", "score": "0.49488658", "text": "shrinkAndPullOtherFrames() {\n if (this.length === 1) return;\n this.parentLayer.getFramesInRange(this.end + 1, Infinity).forEach(frame => {\n frame.start -= 1;\n frame.end -= 1;\n });\n this.end -= 1;\n }", "title": "" }, { "docid": "fe3b0430703134a565e6ce8ffda89f4c", "score": "0.49294358", "text": "function windUp() {\n\t\tvar thrasherSection = document.querySelector('.wc-2018-next-up__wrapper').closest('section');\n\t\tvar prevSection = thrasherSection.previousElementSibling;\n\n\t\tif (prevSection.classList.contains('fc-container__mpu--mobile')\n\t\t|| prevSection.classList.contains('fc-container--commercial')) {\n\t\t\tvar front = thrasherSection.parentElement;\n\t\t\tfront.insertBefore(thrasherSection, prevSection);\n\t\t}\n\t\t\n\t\trepositionWithWorldCupSection();\n\t}", "title": "" }, { "docid": "c47f12b808c54ac55714cf6a36a90ca2", "score": "0.49184936", "text": "bubbleUp() {\n let idx = this.values.length - 1\n const element = this.values[idx]\n\n while (idx > 0) {\n let parentIdx = Math.floor((idx - 1) / 2)\n let parent = this.values[parentIdx]\n\n if (element <= parent) break\n\n this.values[parentIdx] = element\n this.values[idx] = parent\n idx = parentIdx\n }\n }", "title": "" }, { "docid": "298f8d0ace5b0662eef1211d08a7e0b9", "score": "0.4894735", "text": "concat() {\n const current = this.sequences.pop();\n const previous = this.sequences.pop();\n\n previous.concat(current);\n\n this.sequences.push(previous);\n }", "title": "" }, { "docid": "9535399ced632f473ce10d599bca5546", "score": "0.48941132", "text": "function moveUp()\n{\n\ttotalSwitch = false;\n\tfor(i = 0 ; i < 4; i++)\n\t{\n\t\tvar boxes = getBoxesByColumn(i+1);\n\t\tfor( j = 0 ; j < boxes.length; j ++)\n\t\t{\n\t\t\tvar box1_value =boxes[j].querySelector(\".v\").innerHTML;\n\n\t\t\tif( box1_value != \"\")\n\t\t\t{\n\t\t\t\tvar count = 0; \n\t\t\t\tvar switched = false;\n\t\t\t\twhile(count < j && !switched)\n\t\t\t\t{\n\t\t\t\t\tbox2_value = boxes[count].querySelector(\".v\").innerHTML;\n\t\t\t\t\tif( box2_value == \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tswapValues(boxes[j], boxes[count]);\n\t\t\t\t\t\tif(count != 0){\n\t\t\t\t\t\t\tmergeUp(boxes[count], boxes[count-1]); //implement\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttotalSwitch = true;\n\t\t\t\t\t\tswitched = true;\n\t\t\t\t\t}\n\t\t\t\t\tif(j != 0){\n\t\t\t\t\t\t\tvar mergeSwitch = mergeUp(boxes[j], boxes[j-1]); //implement\n\t\t\t\t\t\t\tif(mergeSwitch){\n\t\t\t\t\t\t\t\ttotalSwitch = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn totalSwitch;\n\n}", "title": "" }, { "docid": "95478ee180e3c3a89702483b5885ab83", "score": "0.4875215", "text": "bubbleUp() {\n\t\tlet insertedIdx = this.values.length - 1;\n\t\tconst value = this.values[insertedIdx];\n\n\t\t// its parent index is (n-1) / 2\n\t\tlet parentIdx;\n\t\twhile (insertedIdx >= 0) {\n\t\t\tparentIdx = Math.floor((insertedIdx - 1) / 2);\n\t\t\tif (value > this.values[parentIdx]) {\n\t\t\t\t[ this.values[insertedIdx], this.values[parentIdx] ] = [\n\t\t\t\t\tthis.values[parentIdx],\n\t\t\t\t\tthis.values[insertedIdx]\n\t\t\t\t];\n\t\t\t\tinsertedIdx = parentIdx;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7b3f6312824b98e152e4368c886f56d0", "score": "0.4851742", "text": "function moveChildrenUpstairs(source, target) {\r var gCount = source.groupItems.length;\r\tfor (var gNo = gCount - 1; gNo >= 0; gNo--) {\r var aGroup = source.groupItems[gNo];\r\t\taGroup.move(target, ElementPlacement.PLACEATBEGINNING);\r\t}\r\ttry {\r source.remove();\r\t}\r\tcatch(e) {};\r}", "title": "" }, { "docid": "912216f053dd6054dda5921bbf12e895", "score": "0.4844077", "text": "shiftStacks() {\n\t\tif (!this.stackOldest.values.length) {\n\t\t\twhile (this.stackNewest.length) {\n\t\t\t\tthis.stackOldest.push(this.stackNewest.pop());\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a12225ec75ccb97698b080afd454ac2f", "score": "0.4826734", "text": "function pushContainers( absMove ) {\n\t\t\t\tif( instance.settings.containersToPush == null ) return false;\n\t\t\t\t$.each( instance.settings.containersToPush, function() {\n\t\t\t\t\t$( this ).stop().animate({\n\t\t\t\t\t\tmarginLeft: $( this ).offset().left - $( this ).position().left + ( ( instance.settings.direction == 'rtl' ) ? (-1) : 1 ) * absMove\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "10eec4d96696e8383a64ac35f9a23bbb", "score": "0.48265135", "text": "insertBehind(item) {\r\n item.insertBefore(this);\r\n if (this.behind) {\r\n let itemChainEnd = item;\r\n while (itemChainEnd.behind)\r\n itemChainEnd = itemChainEnd.behind;\r\n this.behind.insertBefore(itemChainEnd);\r\n itemChainEnd.insertBehind(this.behind);\r\n }\r\n this.behind = item;\r\n }", "title": "" }, { "docid": "89da78411f099749ef09fbfc1b88c495", "score": "0.48260906", "text": "function moveElementUp(element) {\n\t\t\tvar newUp = $(element).position().top - 1;\n\t\t\t$(element).css('top', newUp + 'px');\n\t\t}", "title": "" }, { "docid": "ebac2b1e70f3ea1a9a16d27bacc29029", "score": "0.48193896", "text": "mergeUp(gameboard) {\n for(let i=0; i < gameboard.length; i++) {\n for(let j = 0; j < gameboard[i].length; j++) {\n //Si deux tuiles adjacentes se touchent, les merge ensemble et doubler la valeur de la tuile résultante\n if(j != gameboard.length-1) {\n if (gameboard[j][i] != 0 && gameboard[j][i] == gameboard[j + 1][i]) {\n gameboard[j][i] = (gameboard[j][i]) * 2;\n gameboard[j + 1][i] = 0;\n }\n }\n }\n }\n return gameboard;\n }", "title": "" }, { "docid": "54d025c7ac8c2d80dba40a99da9a7b50", "score": "0.4805085", "text": "function containerRefreshEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertNodeType(previousOrParentTNode, 2 /* View */);\n ngDevMode && assertHasParent();\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 0 /* Container */);\n var lContainer = getViewData()[previousOrParentTNode.index];\n var nextIndex = lContainer[ACTIVE_INDEX];\n // remove extra views at the end of the container\n while (nextIndex < lContainer[VIEWS].length) {\n removeView(lContainer, previousOrParentTNode, nextIndex);\n }\n}", "title": "" }, { "docid": "1822fae2dcda769a5d5ed1af29200f43", "score": "0.4798996", "text": "function moveColUpBox() {\r\n\tvar userAnimeLayoutSelect = document.getElementById('userAnimeLayoutSelect');\r\n\tvar selIndex = userAnimeLayoutSelect.selectedIndex;\r\n\tif (selIndex < 1) return; // either no selection or selection is the top option\r\n\tvar curOption = userAnimeLayoutSelect.options[selIndex];\r\n\tvar prevOption = userAnimeLayoutSelect.options[selIndex-1];\r\n\tuserAnimeLayoutSelect.insertBefore(curOption,prevOption);\r\n}", "title": "" }, { "docid": "5f26bab1b6f09b7661ccdedab09e66d6", "score": "0.47796294", "text": "_updatePosFromTop() {\n this._bottomRight = this._topLeft.$add(this._size);\n this._updateCenter();\n }", "title": "" }, { "docid": "08bff0d9969024057dd83fb3b26d823b", "score": "0.4776077", "text": "pop (){\n const top = this.top;\n \n if(top){\n const next = top.next;\n this.top = next;\n this.length--;\n }\n if (this.length === 0) {\n this.bottom = null;\n }\n }", "title": "" }, { "docid": "d0f1b5b6ccfbc4c9c21e4ed841ac5fe0", "score": "0.47758222", "text": "function moveSectionUp(){\n var prev = $(SECTION_ACTIVE_SEL).prev(SECTION_SEL);\n\n //looping to the bottom if there's no more sections above\n if (!prev.length && (options.loopTop || options.continuousVertical)) {\n prev = $(SECTION_SEL).last();\n }\n\n if (prev.length) {\n scrollPage(prev, null, true);\n }\n }", "title": "" }, { "docid": "d0f1b5b6ccfbc4c9c21e4ed841ac5fe0", "score": "0.47758222", "text": "function moveSectionUp(){\n var prev = $(SECTION_ACTIVE_SEL).prev(SECTION_SEL);\n\n //looping to the bottom if there's no more sections above\n if (!prev.length && (options.loopTop || options.continuousVertical)) {\n prev = $(SECTION_SEL).last();\n }\n\n if (prev.length) {\n scrollPage(prev, null, true);\n }\n }", "title": "" }, { "docid": "d0f1b5b6ccfbc4c9c21e4ed841ac5fe0", "score": "0.47758222", "text": "function moveSectionUp(){\n var prev = $(SECTION_ACTIVE_SEL).prev(SECTION_SEL);\n\n //looping to the bottom if there's no more sections above\n if (!prev.length && (options.loopTop || options.continuousVertical)) {\n prev = $(SECTION_SEL).last();\n }\n\n if (prev.length) {\n scrollPage(prev, null, true);\n }\n }", "title": "" }, { "docid": "d0f1b5b6ccfbc4c9c21e4ed841ac5fe0", "score": "0.47758222", "text": "function moveSectionUp(){\n var prev = $(SECTION_ACTIVE_SEL).prev(SECTION_SEL);\n\n //looping to the bottom if there's no more sections above\n if (!prev.length && (options.loopTop || options.continuousVertical)) {\n prev = $(SECTION_SEL).last();\n }\n\n if (prev.length) {\n scrollPage(prev, null, true);\n }\n }", "title": "" }, { "docid": "d0f1b5b6ccfbc4c9c21e4ed841ac5fe0", "score": "0.47758222", "text": "function moveSectionUp(){\n var prev = $(SECTION_ACTIVE_SEL).prev(SECTION_SEL);\n\n //looping to the bottom if there's no more sections above\n if (!prev.length && (options.loopTop || options.continuousVertical)) {\n prev = $(SECTION_SEL).last();\n }\n\n if (prev.length) {\n scrollPage(prev, null, true);\n }\n }", "title": "" }, { "docid": "d0f1b5b6ccfbc4c9c21e4ed841ac5fe0", "score": "0.47758222", "text": "function moveSectionUp(){\n var prev = $(SECTION_ACTIVE_SEL).prev(SECTION_SEL);\n\n //looping to the bottom if there's no more sections above\n if (!prev.length && (options.loopTop || options.continuousVertical)) {\n prev = $(SECTION_SEL).last();\n }\n\n if (prev.length) {\n scrollPage(prev, null, true);\n }\n }", "title": "" }, { "docid": "47355c1d1e74b530477cc07e6cd19a51", "score": "0.4755209", "text": "function moveSectionUp(){\n var prev = prevUntil($(SECTION_ACTIVE_SEL)[0], SECTION_SEL);\n\n //looping to the bottom if there's no more sections above\n if (!prev && (options.loopTop || options.continuousVertical)) {\n prev = last($(SECTION_SEL));\n }\n\n if (prev != null) {\n scrollPage(prev, null, true);\n }\n }", "title": "" }, { "docid": "47355c1d1e74b530477cc07e6cd19a51", "score": "0.4755209", "text": "function moveSectionUp(){\n var prev = prevUntil($(SECTION_ACTIVE_SEL)[0], SECTION_SEL);\n\n //looping to the bottom if there's no more sections above\n if (!prev && (options.loopTop || options.continuousVertical)) {\n prev = last($(SECTION_SEL));\n }\n\n if (prev != null) {\n scrollPage(prev, null, true);\n }\n }", "title": "" }, { "docid": "e1807de10f1a0e789c8eb4fbb74ae494", "score": "0.47536308", "text": "function moveSlideUp()\n{\n var property_slide = $(this).closest('.property-slide');\n var prev_slide = property_slide.prev();\n\n if (prev_slide.length === 1) {\n prev_slide.insertAfter(property_slide);\n resetGallerySorting();\n }\n}", "title": "" }, { "docid": "f961500b6d6ca446db556f6091eae4ec", "score": "0.47521275", "text": "function containerRefreshEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertNodeType(previousOrParentTNode, 2 /* View */);\n ngDevMode && assertHasParent(previousOrParentTNode);\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 0 /* Container */);\n var lContainer = getLView()[previousOrParentTNode.index];\n var nextIndex = lContainer[ACTIVE_INDEX];\n // remove extra views at the end of the container\n while (nextIndex < lContainer[VIEWS].length) {\n removeView(lContainer, previousOrParentTNode, nextIndex);\n }\n}", "title": "" }, { "docid": "f961500b6d6ca446db556f6091eae4ec", "score": "0.47521275", "text": "function containerRefreshEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertNodeType(previousOrParentTNode, 2 /* View */);\n ngDevMode && assertHasParent(previousOrParentTNode);\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 0 /* Container */);\n var lContainer = getLView()[previousOrParentTNode.index];\n var nextIndex = lContainer[ACTIVE_INDEX];\n // remove extra views at the end of the container\n while (nextIndex < lContainer[VIEWS].length) {\n removeView(lContainer, previousOrParentTNode, nextIndex);\n }\n}", "title": "" }, { "docid": "c1fe30528d94fc28ea720a4314e6fc61", "score": "0.47517806", "text": "up () {\n const currStage = this.getLastStage();\n let futureIndex = this.currentIndex - 1;\n while (futureIndex >= 0) {\n const futureStage = currStage.getChildByIndex(futureIndex);\n if (futureStage.pointable) {\n this.currentIndex = futureIndex;\n this.emit('cursor');\n break;\n }\n futureIndex--;\n }\n }", "title": "" }, { "docid": "7348f7408b72b796715cf4aa731574d5", "score": "0.47317034", "text": "bubbleUp(index){\n if (index < 1 || index >= this.size()){\n return;\n }\n\n var childIndex = index;\n var parentIndex;\n\n if (childIndex % 2 === 0){\n // even childIndex\n parentIndex = (childIndex - 2) / 2;\n } else{\n // odd childIndex\n parentIndex = (childIndex - 1) / 2;\n }\n\n while (childIndex > 0 && !this.compare(parentIndex, childIndex)){\n this.swap(parentIndex, childIndex);\n\n childIndex = parentIndex;\n if (childIndex % 2 === 0){\n parentIndex = (childIndex - 2) / 2;\n } else{\n parentIndex = (childIndex - 1) / 2;\n }\n }\n }", "title": "" }, { "docid": "5d241084bb9d6eda016c870ab05a0927", "score": "0.47193852", "text": "function containerRefreshEnd() {\n if (isParent) {\n isParent = false;\n }\n else {\n ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);\n ngDevMode && assertHasParent();\n previousOrParentNode = (previousOrParentNode.parent);\n }\n ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */);\n var container = previousOrParentNode;\n container.native = undefined;\n ngDevMode && assertNodeType(container, 0 /* Container */);\n var nextIndex = container.data.nextIndex;\n // remove extra views at the end of the container\n while (nextIndex < container.data.views.length) {\n removeView(container, nextIndex);\n }\n}", "title": "" }, { "docid": "ccb82c828137b472c9b198479ceac1c2", "score": "0.47182098", "text": "_swimUp(index) {\n let idx = index;\n while (idx > 0) {\n let parent = Math.floor((idx - 1) / 2);\n // Swim up if parent is greater than children\n if (this._comparator(this.heap[parent], this.heap[idx]) > 0) {\n // swap\n let temp = this.heap[parent];\n this.heap[parent] = this.heap[idx];\n this.heap[idx] = temp;\n\n idx = parent;\n } else {\n return;\n }\n }\n }", "title": "" }, { "docid": "0e8aacf12d18180d5fca1d3ec291b5c8", "score": "0.47107485", "text": "function reverse() {\n if (st.size() > 0) {\n var x = st.top();\n st.pop();\n reverse();\n insert_at_bottom(x);\n }\n}", "title": "" }, { "docid": "4b58340e824f77b5c108dcf41570e7ee", "score": "0.47080317", "text": "resizeUp() {\r\n\t\tthis.size *= 2;\r\n\t\tthis.items.length = this.size;\r\n\t\treturn this; \r\n\t}", "title": "" }, { "docid": "4e7f89f738c020132d6e61fa431d60b6", "score": "0.47067088", "text": "_optionalTransform(item, done) {\n const pushedCount = this._pushedCount;\n this._transform(item, () => {\n if (pushedCount === this._pushedCount)\n this._push(item);\n done();\n }, this._boundPush);\n }", "title": "" }, { "docid": "67fcf70721bc1e98df441e5840fd3236", "score": "0.4702942", "text": "_updateStackingOrder() {\n if (this._host.nextSibling) {\n this._host.parentNode.appendChild(this._host);\n }\n }", "title": "" }, { "docid": "67fcf70721bc1e98df441e5840fd3236", "score": "0.4702942", "text": "_updateStackingOrder() {\n if (this._host.nextSibling) {\n this._host.parentNode.appendChild(this._host);\n }\n }", "title": "" }, { "docid": "67fcf70721bc1e98df441e5840fd3236", "score": "0.4702942", "text": "_updateStackingOrder() {\n if (this._host.nextSibling) {\n this._host.parentNode.appendChild(this._host);\n }\n }", "title": "" }, { "docid": "67fcf70721bc1e98df441e5840fd3236", "score": "0.4702942", "text": "_updateStackingOrder() {\n if (this._host.nextSibling) {\n this._host.parentNode.appendChild(this._host);\n }\n }", "title": "" }, { "docid": "67fcf70721bc1e98df441e5840fd3236", "score": "0.4702942", "text": "_updateStackingOrder() {\n if (this._host.nextSibling) {\n this._host.parentNode.appendChild(this._host);\n }\n }", "title": "" }, { "docid": "67fcf70721bc1e98df441e5840fd3236", "score": "0.4702942", "text": "_updateStackingOrder() {\n if (this._host.nextSibling) {\n this._host.parentNode.appendChild(this._host);\n }\n }", "title": "" }, { "docid": "67fcf70721bc1e98df441e5840fd3236", "score": "0.4702942", "text": "_updateStackingOrder() {\n if (this._host.nextSibling) {\n this._host.parentNode.appendChild(this._host);\n }\n }", "title": "" }, { "docid": "2c63105b0e6f3249db2405c0ff0b425b", "score": "0.47019497", "text": "function moveRowUp() {\n\tvar row = this.parentNode.parentNode;\n\tif(row.rowIndex > 1) {\n\t\tvar prevRow = row.previousSibling;\n\t\tprevRow.parentNode.removeChild(row);\n\t\tprevRow.parentNode.insertBefore(row, prevRow);\n\t}\n}", "title": "" }, { "docid": "be8bf73f5dff1d569c4c114f22c07746", "score": "0.46971965", "text": "addToContainer(){\n if(!this.container.parentNode) \n {\n this.parentContainer.appendChild(this.container);\n }\n }", "title": "" }, { "docid": "245409c7007c1a103d475622f0d08b20", "score": "0.46947935", "text": "function merge(left, right) {\n let arr = [];\n // While loop to compare left and right arrays to sort as they merge into one array\n while (left.length && right.length) {\n if (left[0].height < right[0].height) {\n if (left[0].curPosition < right[0].curPosition) { // Left has smaller height and position\n arr.push(left.shift())\n }\n else { // left has smaller height but higher position\n let temp = right[0].height\n right[0].height = left[0].height\n left[0].height = temp;\n $(`#${left[0].curPosition}`).css({\"height\": `${left[0].height}`, \"background-color\": \"green\"})\n $(`#${right[0].curPosition}`).css({\"height\": `${right[0].height}`, \"background-color\": \"green\"})\n arr.push(right.shift())\n }\n }\n else {\n if (left[0].curPosition > right[0].curPosition) { // Left has larger height and large position\n arr.push(right.shift())\n }\n else { // Left has larger height but smaller position\n let temp = left[0].height\n left[0].height = right[0].height\n right[0].height = temp\n $(`#${left[0].curPosition}`).css({\"height\": `${left[0].height}`, \"background-color\": \"green\"})\n $(`#${right[0].curPosition}`).css({\"height\": `${right[0].height}`, \"background-color\": \"green\"})\n arr.push(left.shift())\n }\n }\n }\n // When the left array still has items in it\n while (left.length > 0) {\n arr.push(left.shift())\n }\n // When the right array still has items in it\n while (right.length > 0) {\n arr.push(right.shift())\n }\n return arr\n}", "title": "" }, { "docid": "285462b6eaa479f9cd056408004b014a", "score": "0.46941096", "text": "function containerRefreshEnd() {\n if (isParent) {\n isParent = false;\n }\n else {\n ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);\n ngDevMode && assertHasParent();\n previousOrParentNode = getParentLNode(previousOrParentNode);\n }\n ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */);\n var container = previousOrParentNode;\n ngDevMode && assertNodeType(container, 0 /* Container */);\n var nextIndex = container.data[ACTIVE_INDEX];\n // remove extra views at the end of the container\n while (nextIndex < container.data[VIEWS].length) {\n removeView(container, nextIndex);\n }\n}", "title": "" }, { "docid": "285462b6eaa479f9cd056408004b014a", "score": "0.46941096", "text": "function containerRefreshEnd() {\n if (isParent) {\n isParent = false;\n }\n else {\n ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);\n ngDevMode && assertHasParent();\n previousOrParentNode = getParentLNode(previousOrParentNode);\n }\n ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */);\n var container = previousOrParentNode;\n ngDevMode && assertNodeType(container, 0 /* Container */);\n var nextIndex = container.data[ACTIVE_INDEX];\n // remove extra views at the end of the container\n while (nextIndex < container.data[VIEWS].length) {\n removeView(container, nextIndex);\n }\n}", "title": "" }, { "docid": "2c269ac6851ccb449e47ebe4a6fe2e52", "score": "0.46932018", "text": "function containerRefreshEnd() {\n if (isParent) {\n isParent = false;\n }\n else {\n ngDevMode && assertNodeType(previousOrParentTNode, 2 /* View */);\n ngDevMode && assertHasParent();\n previousOrParentTNode = previousOrParentTNode.parent;\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 0 /* Container */);\n var lContainer = viewData[previousOrParentTNode.index];\n var nextIndex = lContainer[ACTIVE_INDEX];\n // remove extra views at the end of the container\n while (nextIndex < lContainer[VIEWS].length) {\n removeView(lContainer, previousOrParentTNode, nextIndex);\n }\n}", "title": "" }, { "docid": "9fa88f40a8f2a77ba52415b7ee1b8a70", "score": "0.46884176", "text": "function mergeChildren(from, into, refNode, forward) {\n var child, itemDir;\n while ((child = from[forward ? 'getLast' : 'getFirst'](elementType))) {\n if ((itemDir = child.getDirection(1)) !== into.getDirection(1))\n child.setAttribute('dir', itemDir);\n\n child.remove();\n\n refNode ?\n child[forward ? 'insertBefore' : 'insertAfter'](refNode) :\n into.append(child, forward);\n }\n }", "title": "" }, { "docid": "a8730208a6c3816be4b2fc14fe98f0df", "score": "0.46809545", "text": "_updatePosFromBottom() {\n this._topLeft = this._bottomRight.$subtract(this._size);\n this._updateCenter();\n }", "title": "" }, { "docid": "d3e5773aaa9d95b0a1c60d286c1561f6", "score": "0.4671158", "text": "union(itemIndex1, itemIndex2) {\n const root1 = this.find(itemIndex1);\n const root2 = this.find(itemIndex2);\n\n if (root1 === root2) {\n // same set, nothing to union\n return;\n }\n\n if (this.ranks.get(root1) < this.ranks.get(root2)) {\n this.parents.set(root1, root2);\n } else if (this.ranks.get(root1) > this.ranks.get(root2)) {\n this.parents.set(root2, root1);\n } else {\n this.parents.set(root2, root1);\n this.ranks.set(root1, this.ranks.get(root1) + 1);\n }\n }", "title": "" }, { "docid": "19dc4ced88a89096aa4289e3f9079858", "score": "0.4652194", "text": "union(x, y) {\n const parentX = this.find(x);\n const parentY = this.find(y);\n\n const parentArr = this.parentArr;\n const parentXRank = -(parentArr[parentX]);\n const parentYRank = -(parentArr[parentY]);\n\n if(parentXRank >= parentYRank) {\n parentArr[parentX] += parentArr[parentY];\n parentArr[parentY] = parentX;\n } else {\n parentArr[parentY] += parentArr[parentX];\n parentArr[parentX] = parentY;\n }\n }", "title": "" }, { "docid": "d12edb272d3e73e8cc61b80d8e557430", "score": "0.46494675", "text": "function mergeUps(oldP, newP, oldUp, newUp) {\n\tif (oldP === newP)\n\t\treturn oldUp.union(newUp);\n\telse\n\t\treturn oldUp;\n}", "title": "" }, { "docid": "91bbdeee6e8567b68d44672952159d8d", "score": "0.4643988", "text": "function pushToTop(item) {\n var toTheTopEl,\n index,\n toTheTopElOffset,\n animateCloneEl,\n topIndex;\n\n index = vm.options.data.indexOf(item);\n\n if (vm.sortable && index > vm.options.fixed) {\n\n topIndex = vm.options.fixed;\n\n containerEl.sortable('disable'); // don't allow sorting during animation\n\n toTheTopEl = $(containerEl.children()[index]);\n toTheTopElOffset = toTheTopEl.position();\n\n // create a clone of the element being moved to the top so we can animate it without messing with the ng-repeat\n animateCloneEl = toTheTopEl.clone();\n animateCloneEl.addClass('bb-reorder-table-animate-element');\n animateCloneEl.css({ top: toTheTopElOffset.top + 'px', left: toTheTopElOffset.left + 'px', width: toTheTopEl.outerWidth() + 'px' });\n\n containerEl.append(animateCloneEl);\n\n toTheTopEl.addClass('bb-reorder-table-row-placeholder');\n\n // animate that we are moving the item to the top of the list\n $(animateCloneEl).fadeOut({\n duration: 500, queue: false, always: function () {\n toTheTopEl.removeClass('bb-reorder-table-row-placeholder');\n\n animateCloneEl.remove();\n containerEl.sortable('enable');\n\n $scope.$apply(function () {\n // perform the swap moving the item to the top of the list\n vm.options.data.splice(\n topIndex, 0,\n vm.options.data.splice(index, 1)[0]);\n });\n }\n });\n }\n }", "title": "" }, { "docid": "08f07372a847ac147d5bcaef9dd2bed5", "score": "0.46416453", "text": "moveUp() {\n this.dir = -1;\n }", "title": "" }, { "docid": "4b3af1122b2bf5db76f059b718cae2c8", "score": "0.46377638", "text": "function moveUp(sColumnName){\n\t\tvar index = findDimensionIndexByColumnName(sColumnName, selectedDimensions);\n\t\tif (index > -1 && index >= 1){\n\t\t\tvar dimension = selectedDimensions[index];\n\t\t\tselectedDimensions[index] = selectedDimensions[index - 1];\n\t\t\tselectedDimensions[index - 1] = dimension ;\n\t\t\trenderDimensionContainer(selectedDimensions);\n\t\t\tsaveResource(null, true);\n\t\t}\n\t}", "title": "" }, { "docid": "a2228d3eaa3bbc297a10280aa338d97a", "score": "0.46336576", "text": "function mergeUp(box1, box2){\n\tvar box1_value = box1.querySelector(\".v\").innerHTML;\n\tvar box2_value = box2.querySelector(\".v\").innerHTML;\n\tif(box1_value == box2_value && box1_value != \"\"){\n\t\tbox2.querySelector(\".v\").innerHTML = box2_value*2;\n\t\tbox1.querySelector(\".v\").innerHTML = \"\";\n\t\tbox1.className = \"box_empty\";\n\t\tbox2.className = \"box_\" + (box2_value*2);\n\n\t\t//console.log(\"Merge, incrementing points by \" + (box2_value*2) );\n\t\tpoints_var += box2_value*2;\n\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "085d82225e281897cf0354807698aac3", "score": "0.46308148", "text": "siftUp(currentIdx, heap) {\n let parentIdx = Math.floor((currentIdx - 1) / 2);\n while (currentIdx > 0 && heap[currentIdx][1] < heap[parentIdx][1]) {\n this.swap(currentIdx, parentIdx, heap);\n currentIdx = parentIdx;\n parentIdx = Math.floor((currentIdx - 1) / 2);\n }\n }", "title": "" }, { "docid": "d96a36a48f1488a452e02075c73eac3d", "score": "0.4627638", "text": "mergeUp(nums) {\n let upMergeNums = nums;\n let colPos = upMergeNums.length - 1;\n // let hasMerged = false;\n\n while (colPos >= 0) {\n if (upMergeNums[colPos] == 0) {\n upMergeNums.splice(colPos, 1);\n upMergeNums.push(0);\n }\n colPos--;\n }\n\n colPos = 0;\n\n while (colPos < upMergeNums.length - 1) {\n if (upMergeNums[colPos] == upMergeNums[colPos + 1]) {\n upMergeNums[colPos] = upMergeNums[colPos] + upMergeNums[colPos];\n this.setScore(upMergeNums[colPos]);\n upMergeNums.splice(colPos + 1, 1);\n upMergeNums.push(0);\n // hasMerged = true;\n }\n colPos++;\n }\n\n return upMergeNums;\n }", "title": "" }, { "docid": "c58aeeb344c7bffc7c6ffadd0145e7cd", "score": "0.46275", "text": "function mergeLayer(src, dst) {\n\tvar s = src.duplicate();\n\ts.move(dst, ElementPlacement.PLACEBEFORE);\n\tapp.activeDocument.activeLayer = s;\n\tclipMask();\n\ts.merge();\n}", "title": "" }, { "docid": "4d6f39852bc759a95a10fdf2e0234995", "score": "0.46244466", "text": "function goUpHarmonically(current) {\n\tmoveHarmonically(current, +1);\n}", "title": "" }, { "docid": "a601ea8759003c43a37c7375e799f87d", "score": "0.4623054", "text": "moveUp() {\r\n const currTop = parseInt(this.moveeStyle.top.replace(\"px\", \"\"))\r\n if (currTop - this.pxPerMovement < 0) {\r\n return\r\n }\r\n\r\n this.movee.style.top = currTop - this.pxPerMovement + \"px\"\r\n }", "title": "" }, { "docid": "e76678de06c80511cae83b00ff9e16ec", "score": "0.46203658", "text": "function concatUp(array1, array2){\n if(array1.length > array2.length){\n let array3 = array2.concat(array1)\n return array3\n } else if (array1.length === array2.length){\n let array3 = array1.concat(array2)\n return array3\n } else {\n let array3 = array1.concat(array2)\n return array3\n }\n}", "title": "" }, { "docid": "57ddbc203bd8d8f332fcb69db2228f9f", "score": "0.46198094", "text": "insert() {\n this.container.parentNode.insertBefore(this.el, this.container.nextSibling);\n }", "title": "" }, { "docid": "c019b0f5075d1243a1b7e954a67feee5", "score": "0.46075234", "text": "function elementContainerEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n var lView = getLView();\n var tView = lView[TVIEW];\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 4 /* ElementContainer */);\n var currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(tView, previousOrParentTNode);\n}", "title": "" }, { "docid": "c019b0f5075d1243a1b7e954a67feee5", "score": "0.46075234", "text": "function elementContainerEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n var lView = getLView();\n var tView = lView[TVIEW];\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 4 /* ElementContainer */);\n var currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(tView, previousOrParentTNode);\n}", "title": "" }, { "docid": "0c15b8d3867649ad76caccced6db7f77", "score": "0.45987162", "text": "siftUp(currentIdx, heap) {\n let parentIdx = Math.floor((currentIdx - 1) / 2)\n while (currentIdx > 0 && heap[currentIdx] < heap[parentIdx]) {\n this.swap(currentIdx, parentIdx, heap)\n currentIdx = parentIdx\n parentIdx = Math.floor((currentIdx - 1) / 2)\n }\n }", "title": "" }, { "docid": "5a2616613b657236c7cb43877b1ed8d0", "score": "0.4593461", "text": "fixLayout() {\n // TODO: Implement new\n let collided = this.collisions()\n let sorted = this.layout.sort((a, b) => {\n if (a.position.y < b.position.y) {\n return 1\n } else if (a.position.y > b.position.y) {\n return -1\n } else {\n if (a.position.x < b.position.x) {\n return 1\n } else if (a.position.x > b.position.x) {\n return -1\n }\n }\n return 0\n })\n return sorted + collided\n }", "title": "" }, { "docid": "9eb87c7a54e33b67f8a5939fb0650b86", "score": "0.45824978", "text": "siftUp(currentIdx, heap) {\n\t\tlet parentIdx = Math.floor((currentIdx - 1) / 2);\n\t\twhile (currentIdx > 0 && heap[currentIdx] < heap[parentIdx]) {\n\t\t\tthis.swap(currentIdx, parentIdx, heap);\n\t\t\tcurrentIdx = parentIdx;\n\t\t\tparentIdx = Math.floor((currentIdx - 1) / 2);\n\t\t}\n }", "title": "" }, { "docid": "0284a9274fa5caf0de087f6025519358", "score": "0.45804787", "text": "function moveDropdown() {\n if (!elements.$.root.length) return;\n $mdTheming(elements.$.scrollContainer);\n elements.$.scrollContainer.detach();\n elements.$.root.append(elements.$.scrollContainer);\n if ($animate.pin) $animate.pin(elements.$.scrollContainer, $rootElement);\n }", "title": "" }, { "docid": "1655e45db626503326636f04ac241c30", "score": "0.457275", "text": "function shiftUp(i, j){\n\t\tif(j == 0){\n\t\t\ttileArray[i][j].solved = true;\n\t\t\treturn;\n\t\t}\n\t\tif(tileArray[i][j - 1] == null){\n\t\t\ttileArray[i][j - 1] = tileArray[i][j];\n\t\t\ttileArray[i][j] = null;\n\t\t\treturn;\n\t\t} else{\n\t\t\tif(tileArray[i][j - 1].color == tileArray[i][j].color || tileArray[i][j - 1].count == tileArray[i][j].count){\n\t\t\t\ttileArray[i][j - 1].count += tileArray[i][j].count;\n\t\t\t\tstage.removeChild(tileArray[i][j].container);\n\t\t\t\ttileArray[i][j] = null;\n\t\t\t\treturn;\n\t\t\t}else{\n\t\t\t\tif(tileArray[i][j - 1].solved == true){\n\t\t\t\t\ttileArray[i][j].solved = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a631c27fb587034ca785ebc3c84dc11a", "score": "0.45711598", "text": "addFront(element) {\n return this.items.unshift(element);\n }", "title": "" }, { "docid": "f8f07768354f3b7081dd1b9c46de7e04", "score": "0.4570719", "text": "moveNext() {\n const stack = this.stack;\n\n if (stack.length === 0) {\n return;\n }\n\n let n = stack[stack.length - 1];\n\n if (n.right) {\n n = n.right;\n\n while (n) {\n stack.push(n);\n n = n.left;\n }\n } else {\n stack.pop();\n\n while (stack.length > 0 && stack[stack.length - 1].right === n) {\n n = stack[stack.length - 1];\n stack.pop();\n }\n }\n }", "title": "" }, { "docid": "3d88c0a128efc6119263f931b744ce22", "score": "0.4570506", "text": "function moveDropdown () {\n\t if (!elements.$.root.length) return;\n\t $mdTheming(elements.$.scrollContainer);\n\t elements.$.scrollContainer.detach();\n\t elements.$.root.append(elements.$.scrollContainer);\n\t if ($animate.pin) $animate.pin(elements.$.scrollContainer, $rootElement);\n\t }", "title": "" }, { "docid": "9eb0f9e769329eabc5b6b63c1983378c", "score": "0.45619583", "text": "unshift(value) {\n if (this.sizeUsed === this.sizeAvailable) {\n this.resize()\n }\n for (let i = this.data.length; i > 0; i--) {\n this.data[i] = this.data[i - 1]\n }\n this.data[0] = value\n this.sizeUsed++\n return this // allow chaining\n }", "title": "" }, { "docid": "98ed597789587ac1008d779489941b03", "score": "0.4546873", "text": "function moveDropdown () { // 18732\n if (!elements.$.root.length) return; // 18733\n $mdTheming(elements.$.scrollContainer); // 18734\n elements.$.scrollContainer.detach(); // 18735\n elements.$.root.append(elements.$.scrollContainer); // 18736\n if ($animate.pin) $animate.pin(elements.$.scrollContainer, $rootElement); // 18737\n } // 18738", "title": "" } ]
bf1090d3327d5679c18590ccdcd1629a
Initializes the scene lights with the values read from the XML file.
[ { "docid": "677de28bb37216c688d58f7cf40da84e", "score": "0.7143092", "text": "initLights() {\n var i = 0;\n // Lights index.\n\n // Reads the lights from the scene graph.\n for (var key in this.graph.lights) {\n if (i >= 8)\n break; // Only eight lights allowed by WebGL.\n\n if (this.graph.lights.hasOwnProperty(key)) {\n var light = this.graph.lights[key];\n\n //lights are predefined in cgfscene\n this.lights[i].setPosition(light[2][0], light[2][1], light[2][2],light[2][3]);\n this.lights[i].setAmbient(light[3][0], light[3][1], light[3][2], light[3][3]);\n this.lights[i].setDiffuse(light[4][0], light[4][1], light[4][2], light[4][3]);\n this.lights[i].setSpecular(light[5][0], light[5][1], light[5][2], light[5][3]);\n\n if(this.lights[0] == \"spot\"){\n this.lights[i].setSpotCutOff(light[7][0]);\n this.lights[i].setSpotDirection(light[6][0] - light[2][0], light[6][1] - light[2][1], light[6][2] - light[2][2]);\n this.lights[i].setSpotExponent(light[7][1]);\n }\n this.lights[i].setVisible(true);\n if (light[1])\n this.lights[i].enable();\n else\n this.lights[i].disable();\n\n this.lights[i].update();\n\n i++;\n }\n }\n }", "title": "" } ]
[ { "docid": "2c74394b1e974ef5310644986189594f", "score": "0.71154916", "text": "initLights() {\n var i = 0;\n // Lights index.\n\n // Reads the lights from the scene graph.\n for (var key in this.graph.lights) {\n if (i >= 8)\n break; // Only eight lights allowed by WebGL.\n\n if (this.graph.lights.hasOwnProperty(key)) {\n var light = this.graph.lights[key];\n \n //lights are predefined in cgfscene\n this.lights[i].setPosition(light.location.x, light.location.y, light.location.z, light.location.w);\n this.lights[i].setAmbient(light.ambient.r, light.ambient.g, light.ambient.b, light.ambient.a);\n this.lights[i].setDiffuse(light.diffuse.r, light.diffuse.g, light.diffuse.b, light.diffuse.a);\n this.lights[i].setSpecular(light.specular.r, light.specular.g, light.specular.b, light.specular.a);\n\n if(light.type == \"spot\")\n {\n this.lights[i].setSpotCutOff(parseInt(light.angle,10));\n this.lights[i].setSpotExponent(parseInt(light.exponent,10));\n this.lights[i].setSpotDirection(light.target.x - light.location.x, light.target.y - light.location.y, light.target.z - light.location.z);\n }\n \n this.lights[i].setVisible(true);\n if (light.enable)\n {\n this.lights[i].enable();\n this['Light_'+this.lights[i].id+\"_on\"] = true;\n }\n else\n {\n this.lights[i].disable();\n this['Light_'+this.lights[i].id+\"_on\"] = false;\n }\n\n this.lights[i].update();\n i++;\n }\n }\n }", "title": "" }, { "docid": "eaf400fad369bee0f0f205726a9bb2e9", "score": "0.7000897", "text": "initLights() {\n\n // {light : enabled/disabled, ...}\n this.lightsStatus = {};\n\n // Lights index.\n var i = 0;\n\n // Reads the lights from the scene graph.\n for (var key in this.graph.lights) {\n if (i >= 8)\n break; // Only eight lights allowed by WebCGF on default shaders.\n\n if (this.graph.lights.hasOwnProperty(key)) {\n var graphLight = this.graph.lights[key];\n\n this.lights[i].setPosition(...graphLight[1]);\n this.lights[i].setAmbient(...graphLight[2]);\n this.lights[i].setDiffuse(...graphLight[3]);\n this.lights[i].setSpecular(...graphLight[4]);\n\n this.lights[i].setVisible(true);\n if (graphLight[0])\n this.lights[i].enable();\n else\n this.lights[i].disable();\n\n this.lights[i].update();\n\n this.lightsStatus[\"light\" + i] = graphLight[0];\n\n i++;\n }\n }\n\n\n }", "title": "" }, { "docid": "aacc911bce4fe67469218666dcb00096", "score": "0.68529177", "text": "setupLights() {\n //setup lights\n this.light1 = new BABYLON.DirectionalLight(\"dir01\", new BABYLON.Vector3(0.0, -1.0, 0.0), src_1.MfgScene.scene);\n this.light1.intensity = 1.0;\n this.light1.position = new BABYLON.Vector3(0.0, 0.0, 0.0);\n }", "title": "" }, { "docid": "1e39c695875bd6900860e14abb314ce5", "score": "0.68262935", "text": "_initLights() {\n this._ambientLight = new THREE.AmbientLight(0xffffff, 0.6);\n this._directionalLight = new THREE.DirectionalLight(0xffffff, 0.7);\n this._directionalLight.position.set(10, 20, 10);\n this.add3DObjects(this._ambientLight, this._directionalLight);\n\n this._debug(\"Lights setup done!\")\n }", "title": "" }, { "docid": "667b6ecf48f740c395ad00779d8fcab4", "score": "0.67688286", "text": "initLights() {\n var i = 0; // Light index in this.lights array\n this.lightsMap = new Map(); // Map that associates light id with index for use with MyInterface\n\n // Reads the lights from the scene graph.\n for (let [key, light] of this.graph.lights) {\n if (i >= 8)\n break; // Only eight lights allowed by WebCGF on default shaders.\n\n // Sets light parameters\n this.lights[i].setPosition(...light[1]);\n this.lights[i].setAmbient(...light[2]);\n this.lights[i].setDiffuse(...light[3]);\n this.lights[i].setSpecular(...light[4]);\n this.lights[i].setVisible(true);\n if (light[0])\n this.lights[i].enable();\n else\n this.lights[i].disable();\n\n this.lights[i].update();\n\n this.lightsMap.set(key, i);\n\n i++;\n }\n }", "title": "" }, { "docid": "0c1896ab68c0d343fb6ceed0a203eff9", "score": "0.65763825", "text": "initLights() {\n\n let i = 0;\n // Lights index.\n\n // Reads the lights from the scene graph.\n for (let key in this.graph.lights) {\n if (i >= 8)\n break; // Only eight lights allowed by WebGL.\n\n if (this.graph.lights.hasOwnProperty(key)) {\n let light = this.graph.lights[key];\n\n //lights are predefined in cgfscene\n let lightProp = light.properties;\n this.lights[i].setPosition(lightProp.location.x, lightProp.location.y, lightProp.location.z, lightProp.location.w);\n this.lights[i].setAmbient(lightProp.ambient.r, lightProp.ambient.g, lightProp.ambient.b, lightProp.ambient.a);\n this.lights[i].setDiffuse(lightProp.diffuse.r, lightProp.diffuse.g, lightProp.diffuse.b, lightProp.diffuse.a);\n this.lights[i].setSpecular(lightProp.specular.r, lightProp.specular.g, lightProp.specular.b, lightProp.specular.a);\n\n if (light.type == \"spot\") {\n let target = vec4.fromValues(lightProp.target.x, lightProp.target.y, lightProp.target.z, lightProp.target.w);\n let direction = vec4.create();\n vec4.sub(direction, target, this.lights[i].position);\n vec4.normalize(direction, direction);\n this.lights[i].setSpotDirection(direction[0], direction[1], direction[2]);\n this.lights[i].setSpotExponent(light.exponent);\n this.lights[i].setSpotCutOff(light.angle);\n\n }\n\n this.lightValues[key] = light.enabled;\n\n this.lights[i].setVisible(true);\n\n if (light.enabled)\n this.lights[i].enable();\n else\n this.lights[i].disable();\n\n this.lights[i].update();\n\n i++;\n }\n }\n\n }", "title": "" }, { "docid": "ba26bb71b2e9d261a0f36889603b1d90", "score": "0.64463454", "text": "initLights() {\n var i = 0;\n // Lights index.\n\n for (let j = 0; j < this.lights.length; j++) {\n this.lights[j] = new CGFlight(this, j);\n }\n\n // Reads the lights from the scene graph.\n for (var key in this.graph.lights) {\n if (i >= 8)\n break; // Only eight lights allowed by WebGL.\n\n if (this.graph.lights.hasOwnProperty(key)) {\n var light = this.graph.lights[key];\n\n this.lights[i].setPosition(light[2][0], light[2][1], light[2][2], light[2][3]);\n this.lights[i].setAmbient(light[3][0], light[3][1], light[3][2], light[3][3]);\n this.lights[i].setDiffuse(light[4][0], light[4][1], light[4][2], light[4][3]);\n this.lights[i].setSpecular(light[5][0], light[5][1], light[5][2], light[5][3]);\n this.lights[i].setConstantAttenuation(light[6][0]);\n this.lights[i].setLinearAttenuation(light[6][1]);\n this.lights[i].setQuadraticAttenuation(light[6][2]);\n\n if (light[1] == \"spot\") {\n this.lights[i].setSpotCutOff(light[7]);\n this.lights[i].setSpotExponent(light[8]);\n this.lights[i].setSpotDirection(\n light[9][0] - light[2][0],\n light[9][1] - light[2][1],\n light[9][2] - light[2][2]\n );\n }\n\n this.lights[i].setVisible(this.displayLights);\n if (light[0])\n this.lights[i].enable();\n else\n this.lights[i].disable();\n\n this.lights[i].update();\n\n i++;\n }\n }\n }", "title": "" }, { "docid": "8fe956b8fdab113931fdec1810578d68", "score": "0.6419332", "text": "function setUpLights(scene) {\n lights = []; // Array of lights\n\n for (var light of scene.lights) {\n if (light.source === \"Ambient\") {\n // Create and add Ambient light to array\n lights.push(new AmbientLight(light.source, light.color));\n } else if (light.source === \"Point\") {\n // Create and add Point light to array\n lights.push(new PointLight(light.source, light.color, light.position));\n } else if (light.source === \"Directional\") {\n // Create and add Directional light to array\n lights.push(new DirectionalLight(light.source, light.color, light.direction));\n }\n }\n}", "title": "" }, { "docid": "b4113f26472014acb95f2b208894fa53", "score": "0.6346138", "text": "initLights() {\n\n this.ambientLight = new THREE.AmbientLight(0xffffff, 0.6);\n this.scene.add(this.ambientLight );\n\n\t\tthis.pointLights.pointLightColor.color = this.sceneColors[0]\n\n\t\tfor (const key in this.pointLights) {\n\t\t\tif (!this.pointLights.hasOwnProperty(key)) continue;\n\t\t\t\tconst light = this.pointLights[key];\n\t\t\t\tlight.obj = new THREE.PointLight(light.color)\n\t\t\t\tlight.obj.position.set(light.initPos.x, light.initPos.y, light.initPos.z)\n\t\t\t\tlight.obj.intensity = light.intensity\n\t\t\t\tthis.lightGroup.add(light.obj);\n\t\t}\n\n\t\tthis.scene.add(this.lightGroup);\n\n\t\t// HELPERS\n // let sphereSize = 4;\n // const pointLightHelper = new THREE.PointLightHelper( this.pointLights.pointLightColor.obj, sphereSize );\n // this.scene.add( pointLightHelper );\n\n // sphereSize = 2;\n // const pointLightHelper3 = new THREE.PointLightHelper( this.pointLights.pointLightDarkenCenter.obj, sphereSize );\n // this.scene.add( pointLightHelper3 );\n\n //\n // var sphereSize = 1;\n // var pointLightHelper4 = new THREE.PointLightHelper( this.bottomLight, sphereSize );\n // this.scene.add( pointLightHelper4 );\n\n }", "title": "" }, { "docid": "9102a596e71b7a2abcd391e7c6b5f295", "score": "0.6324612", "text": "_addLights() {\n this.lights = [\n new DirectionalLight('dir01', new Vector3(0.5, -1, 2), this.scene),\n new DirectionalLight('dir02', new Vector3(-1.5, 1, 2), this.scene),\n ];\n\n this.lights[0].intensity = 15;\n this.lights[1].intensity = 5;\n }", "title": "" }, { "docid": "3b1e7a31bdb1aee5b67b46c8ddc3f21f", "score": "0.63111657", "text": "initLights() {\n var i = 0;\n // Lights index.\n for (var key in this.graph.lights) {\n if(i >= 8){\n break;\n }\n\n if (this.graph.lights.hasOwnProperty(key)) {\n var light = this.graph.lights[key];\n\n if(light.type==\"spot\"){\n var xDirct;\n var yDirct;\n var zDirct;\n\n this.lights[i].setSpotCutOff(light.angle);\n this.lights[i].setSpotExponent(light.exponent);\n\n xDirct=light.target.x-light.location.x;\n yDirct=light.target.y-light.location.y;\n zDirct=light.target.z-light.location.z;\n\n this.lights[i].setSpotDirection(xDirct,yDirct,zDirct);\n }\n\n this.lights[i].setPosition(light.location.x, light.location.y, light.location.z, light.location.w);\n this.lights[i].setAmbient(light.ambient.red, light.ambient.green, light.ambient.blue, light.ambient.alpha);\n this.lights[i].setDiffuse(light.diffuse.red, light.diffuse.green, light.diffuse.blue, light.diffuse.alpha);\n this.lights[i].setSpecular(light.specular.red, light.specular.green, light.specular.blue, light.specular.alpha);\n this.lights[i].setVisible(true);\n\n if (light.enabled) {\n this.lights[i].enable();\n }\n else {\n this.lights[i].disable();\n }\n\n this.lights[i].update();\n i++;\n }\n }\n }", "title": "" }, { "docid": "4d07e01f6a4eb8330b8b2f27e0b5a8ee", "score": "0.63071865", "text": "function initLights()\n{\n //Light uniforms\n gl.uniform3fv(prg.uLightPosition, [8.0,8.0,15.0]);\n gl.uniform4fv(prg.uLightAmbient , [1.0,1.0,1.0,1.0]);\n gl.uniform4fv(prg.uLightDiffuse, [1.0,1.0,1.0,1.0]);\n gl.uniform4fv(prg.uLightSpecular, [1.0,1.0,1.0,1.0]);\n\n //Object Uniforms\n gl.uniform4fv(prg.uMaterialAmbient, [0.1,0.1,0.1,1.0]);\n gl.uniform4fv(prg.uMaterialDiffuse, [0.5,0.8,0.1,1.0]);\n gl.uniform4fv(prg.uMaterialSpecular, [0.6,0.6,0.6,1.0]);\n gl.uniform1f(prg.uShininess, 200.0);\n\n}", "title": "" }, { "docid": "82f74896779725ec21178532d5b01bbf", "score": "0.62187004", "text": "function initialisationLights(scene) {\n //Lumiere 1\n var light = new BABYLON.SpotLight(\"spot01\", new BABYLON.Vector3(-50, 40, -32),\n new BABYLON.Vector3(-1, -2, -1), 1.1, 16, scene);\n light.intensity = 108;\n\n var lightSphere1 = BABYLON.Mesh.CreateSphere(\"sphere\", 10, 2, scene);\n lightSphere1.position = light.position;\n lightSphere1.material = new BABYLON.StandardMaterial(\"light\", scene);\n lightSphere1.material.emissiveColor = new BABYLON.Color3(1, 1, 0);\n\n // Lumiere 2\n var light2 = new BABYLON.SpotLight(\"spot02\", new BABYLON.Vector3(-150, 250, 150),\n new BABYLON.Vector3(1, -1, -4), 1.1, 16, scene);\n light2.intensity = 100;\n\n var lightSphere2 = BABYLON.Mesh.CreateSphere(\"sphere\", 10, 2, scene);\n lightSphere2.position = light2.position;\n lightSphere2.material = new BABYLON.StandardMaterial(\"light\", scene);\n lightSphere2.material.emissiveColor = new BABYLON.Color3(1, 1, 0);\n\n // Lumiere 3\n var light3 = new BABYLON.SpotLight(\"spot03\", new BABYLON.Vector3(-30, 50, 630),\n new BABYLON.Vector3(1, -1, -10), 1.1, 16, scene);\n light3.intensity = 100.4;\n\n var lightSphere3 = BABYLON.Mesh.CreateSphere(\"sphere\", 10, 2, scene);\n lightSphere3.position = light3.position;\n lightSphere3.material = new BABYLON.StandardMaterial(\"light\", scene);\n lightSphere3.material.emissiveColor = new BABYLON.Color3(1, 1, 0);\n}", "title": "" }, { "docid": "958f8f418568cbeec98007528901e53e", "score": "0.61920863", "text": "function loadLights(map) {\n\n // Create global lighting in form of an infinite-range directional light\n var globalLight = new Light(gameView.scene);\n globalLight.range = 10000000000; // The light should be visible anywhere on the map\n globalLight.type = 'Directional';\n globalLight.color = map.globalLighting.color.slice(0, 3); // The color is actually used\n globalLight.direction = [-0.6324094, -0.7746344, 0]; // the direction is fixed for *all* maps, regardless of lighting.\n var sceneNode = gameView.scene.createNode();\n\n sceneNode.position = [480 * 28, 0, 480 * 28];\n sceneNode.attachObject(globalLight);\n\n map.renderGlobalLight = globalLight;\n\n if (!map.lights)\n return;\n\n var lights = readJson(map.lights);\n\n print(\"Creating \" + lights.length + \" lights.\");\n\n for (var i = 0; i < lights.length; ++i) {\n var obj = lights[i];\n\n sceneNode = gameView.scene.createNode();\n sceneNode.interactive = false;\n sceneNode.position = obj.position;\n\n var light = new Light(gameView.scene);\n switch (obj.type) {\n default:\n case 1:\n light.type = 'Point';\n break;\n case 2:\n light.type = 'Spot';\n continue;\n case 3:\n light.type = 'Directional';\n continue;\n }\n\n light.range = obj.range;\n light.attenuation = 4 / (obj.range * obj.range);\n // Enable this to see the range of lights\n // light.debugging = true;\n light.color = obj.color;\n\n sceneNode.attachObject(light);\n }\n }", "title": "" }, { "docid": "de53f0dd5a800e0bc6d1cfbbf18869eb", "score": "0.61179984", "text": "_addLights() {\n this.lights = [\n new DirectionalLight('dir01', new Vector3(0.5, -1, 2), this.scene),\n new SpotLight('spot01', new Vector3(30, 40, 20), new Vector3(-1, -2, -1), 1.1, 16, this.scene),\n new HemisphericLight('hem01', new Vector3(0, 10, 0), this.scene),\n ];\n\n this.lights[1].intensity = 0.5;\n this.lights[2].intensity = 0.3;\n\n this.shadowGenerator = new ShadowGenerator(1024, this.lights[0]);\n\n this.shadowGenerator.useExponentialShadowMap = true;\n }", "title": "" }, { "docid": "ca026199788e3c561a464da51ac1803e", "score": "0.60950905", "text": "initLights(graph) {\n const lights = [...this.lights];\n const lightValues = [];\n\n let i = 0;\n // Lights index.\n\n // Reads the lights from the scene graph.\n for (let key in graph.lights) {\n if (i >= 8)\n break; // Only eight lights allowed by WebGL.\n\n if (graph.lights.hasOwnProperty(key)) {\n let light = graph.lights[key];\n\n //lights are predefined in cgfscene\n let lightProp = light.properties;\n lights[i].setPosition(lightProp.location.x, lightProp.location.y, lightProp.location.z, lightProp.location.w);\n lights[i].setAmbient(lightProp.ambient.r, lightProp.ambient.g, lightProp.ambient.b, lightProp.ambient.a);\n lights[i].setDiffuse(lightProp.diffuse.r, lightProp.diffuse.g, lightProp.diffuse.b, lightProp.diffuse.a);\n lights[i].setSpecular(lightProp.specular.r, lightProp.specular.g, lightProp.specular.b, lightProp.specular.a);\n\n if (light.type == \"spot\") {\n let target = vec4.fromValues(lightProp.target.x, lightProp.target.y, lightProp.target.z, lightProp.target.w);\n let direction = vec4.create();\n vec4.sub(direction, target, lights[i].position);\n vec4.normalize(direction, direction);\n lights[i].setSpotDirection(direction[0], direction[1], direction[2]);\n lights[i].setSpotExponent(light.exponent);\n lights[i].setSpotCutOff(light.angle);\n\n }\n\n lightValues[key] = light.enabled;\n\n lights[i].setVisible(true);\n\n if (light.enabled)\n lights[i].enable();\n else\n lights[i].disable();\n\n lights[i].update();\n\n i++;\n }\n }\n if (!this.hasOwnProperty('graphLights')) {\n this.graphLights = [lights];\n this.lightValues = [lightValues];\n } else {\n this.graphLights.push(lights);\n this.lightValues.push(lightValues);\n }\n\n }", "title": "" }, { "docid": "b2dbfff61fd96ce4ac86acbb18f6ecac", "score": "0.60791665", "text": "function init() {\n const sun = scenegraph.createNodeWithModel(\"Sonne\", \"sphere\", {recursionDepth: 2, scale: 120, color: 5});\n const earth = scenegraph.createNodeWithModel(\"Erde\", \"sphere\", {recursionDepth: 2, scale: 75, color: 2}, sun);\n const moon = scenegraph.createNodeWithModel(\"Mond\", \"sphere\", {recursionDepth: 2, scale: 20, color: 0}, earth);\n const moon2 = scenegraph.createNodeWithModel(\"Mond2\", \"sphere\", {recursionDepth: 2, scale: 40, color: 7}, earth);\n\n sun.rotate([-50, -100, 0]);\n\n earth.translate([500, 0, 0]);\n moon.translate([150, 0, 20]);\n moon2.translate([250, 0, -50]);\n\n animation.assign(sun, \"rotate\", {rotationSpeed: [0, 0.002, 0]});\n animation.assign(earth, \"rotate\", {rotationSpeed: [0.001, 0.03, 0]});\n animation.assign(moon, \"rotate\", {rotationSpeed: [0.009, 0.009, 0.09]});\n animation.assign(moon2, \"rotate\", {rotationSpeed: [0.05, 0.08, 0.05], });\n\n sun.setVisible(true);\n earth.setVisible(true);\n moon.setVisible(true);\n moon2.setVisible(true);\n // end animation\n\n var lightnode = scenegraph.createPointLightNode(\"light\", \"diamond\");\n scenegraph.setLights(0.5, 0.6, [200, 200, 300], 4.0, 10);\n }", "title": "" }, { "docid": "0135972760fbc657be11f3dd502e2429", "score": "0.59785223", "text": "function initScene(){\n\tinitSceneOptions();\n\tinitCamera();\n\tinitElementArrays();\n\tinitLight();\n\tinitColours();\n\tinitSceneObjects();\n\tbuildObjects();\n\tinitFaces();\n\tinitMovingPoints();\n\tinitCustom();\n}", "title": "" }, { "docid": "a9d4401b3b64ea4cdc7209a5a9e2a616", "score": "0.5966012", "text": "function initLight(){\n\t\n\t// Should the light source be 'Far' from the scene -- eg: very distant like the sun is to us here on Earth, where light rays are assumed to be parallel\n\t// Or should the light source be 'Close' to the scene -- eg: like a lamp illuminating objects. The light rays are not parallel, assumed to be uniformly radial\n\t\n\tlightType = 'Close'; // 'Far' or 'Close'\n\t\n\t\n\tif (lightType==='Far'){\n\t\t// This would be the direction that a ray of light would be travelling in when incident on scene\n\t\tlightDir = new Vector3(-0.3,-0.2,-0.5).unit();\n\t} else if (lightType==='Close') {\n\t\t// Here we have modelled the 'Close' light source as a moving point with a predetermined path, with design 'light'.\n\t\t// However here there is a lot of freedom, we could have modelled it as a standard moving point for example, just travelling in a straight line.\n\t\t// If that was the case it could collide with non-rotating objects, or it could even be of type moving point but it just doesn't travel (ie: have 0 speed).\n\t\t// Or it could not be a moving point at all and there be no 'source of light' drawn on the screen, again here it could follow a custom path, straight line or not move at all.\n\t\tmp.push(new MP({x:0,y:0,z:0},false,30,'light',lightPath));\n\t\tlightPos = mp[0].p3;\n\t\tlightPathSpeed = 0.4;\n\t}\n\t\n\t// Should the source of light be mobile (can it move) --> if this is true then the shading on every face of the scene will have to be recalculated, since the light could have moved\n\tmobilelight = true;\n}", "title": "" }, { "docid": "f4d87349e217880abdd1b8316d297be1", "score": "0.59276795", "text": "function setLightning(scene) { //createLights\n var light0 = new BABYLON.DirectionalLight(\"dir0\", new BABYLON.Vector3(-.1, -1, 0), scene);\n var light1 = new BABYLON.DirectionalLight(\"dir1\", new BABYLON.Vector3(-1, -1, 0), scene);\n\n}", "title": "" }, { "docid": "8c7843d8770048b5961a6fbcebf212b1", "score": "0.5898344", "text": "createLights() {\n // add subtle ambient lighting\n this.ambientLight = new THREE.AmbientLight(0xffffff, 1);\n this.add(this.ambientLight);\n }", "title": "" }, { "docid": "b99ff31f715c48f697a82fa25364d682", "score": "0.58483535", "text": "function Scene()\n{\n\tthis.objects = [];\n\t\n\tthis.pointLights = [];\n\tthis.ambientLights = [];\n\tthis.directionalLights = [];\n}", "title": "" }, { "docid": "3940bd5d6a62e0f46c03d386227bcf4f", "score": "0.58447415", "text": "function addLights() {\n var ambientLight = new THREE.AmbientLight(0xfaebd7);\n self.scene.add(ambientLight);\n }", "title": "" }, { "docid": "2084976cdf1f8549b703f63608ff61a5", "score": "0.58103925", "text": "function initLighting() {\n\tlight1 = new THREE.PointLight( 0xFFFFFF );\n\tlight1.position.set( -20, 15, 25 );\n\n\tlight2 = new THREE.PointLight( 0xFFFFFF );\n\tlight2.position.set( 20, 15, 25);\n\t\t\n\t// add the light to the scene\n\tscene.add( light1 );\n\tscene.add( light2 );\n}", "title": "" }, { "docid": "90b4bff5e9329f5bbaf7350e6154f4da", "score": "0.5787444", "text": "function init() {\n scene = new THREE.Scene();\n scene.background = new THREE.Color( 0x111111 );\n\t\n createRenderer();\n createCamera();\n //create all the lights\n createLights();\n\n document.body.appendChild(renderer.domElement);\n\n render();\n}", "title": "" }, { "docid": "4d18b44bd331d8d667466162e0214aed", "score": "0.5784569", "text": "function addLights() {\n light = new THREE.DirectionalLight(0x3333ee, 3.5, 500);\n scene.add(light);\n light.position.set(POS_X, POS_Y, POS_Z);\n }", "title": "" }, { "docid": "71e4c83126a2706725160a519795e774", "score": "0.57409203", "text": "function init_lighting()\n{\n\tvar pointLight= new THREE.PointLight(0xe1ad24, 1.5, 6);\n\n var spriteTexture= new THREE.ImageUtils.loadTexture('./Components/spark1.png');\n\n var sprite = new THREE.Sprite( new THREE.SpriteMaterial( { map: spriteTexture, color: 0xffae3f} ) );\n sprite.scale.set( .08, .08 , .08 );\n sprite.position.set(pointLight.position.x, pointLight.position.y, pointLight.position.z)\n pointLight.add( sprite );\n for(var i=0; i< lightPositions.length; i++)\n {\n var newLight = pointLight.clone();\n newLight.position.set(lightPositions[i][0], lightPositions[i][1], lightPositions[i][2])\n lights.push(newLight);\n scene.add(newLight);\n }\n\n var ambientLight= new THREE.AmbientLight(0x303030);\n scene.add(ambientLight);\n}", "title": "" }, { "docid": "d78109f158db8fca689610c9c87c79de", "score": "0.57163835", "text": "function initLighting(){\n var color = new THREE.Color(0.2, 0.2, 0.2);\n var ambient = new THREE.AmbientLight(color.getHex());\n scene.add(ambient);\n\n var light = new THREE.PointLight(0xFFFFFF);\n light.position.x = 10;\n light.position.y = 10;\n light.position.z = 5;\n scene.add(light);\n}", "title": "" }, { "docid": "a57ec777d591d73d07ee8216a220e94c", "score": "0.5705251", "text": "initLights(graph) {\n\n for (let light of this.lights) {\n delete light.name;\n light.disable();\n light.update();\n }\n\n // Lights index.\n let i = 0;\n\n // Reads the lights from the scene graph.\n for (let key in graph.lights) {\n if (i >= 8)\n break; // Only eight lights allowed by WebCGF on default shaders.\n\n if (graph.lights.hasOwnProperty(key)) {\n let graphLight = graph.lights[key];\n\n this.lights[i].setPosition(...graphLight[1]);\n this.lights[i].setAmbient(...graphLight[2]);\n this.lights[i].setDiffuse(...graphLight[3]);\n this.lights[i].setSpecular(...graphLight[4]);\n this.lights[i].name = key;\n\n this.lights[i].setVisible(true);\n if (graphLight[0])\n this.lights[i].enable();\n else\n this.lights[i].disable();\n\n this.lights[i].update();\n\n i++;\n }\n }\n\n // Add Lights Enabled Option to Interface Gui\n this.interface.initLights(this.lights, 'enabled');\n }", "title": "" }, { "docid": "8c6452f9e106fcfd25cba3ba7d6e0648", "score": "0.5690697", "text": "initElements(){\n\n this.font = new MyLedFont(this.scene);\n this.quad=new MyQuad(this.scene, 0, 0, 1, 1);\n this.cil=new MyCylinder(this.scene, 1,1,1,60,20);\n\n\t this.grayMaterial = new CGFappearance(this.scene);\n this.grayMaterial.setDiffuse(0.2,0.2,0.2,1);\n this.grayMaterial.setSpecular(0.2,0.2,0.2,1);\n this.grayMaterial.setAmbient(0.2,0.2,0.2,1);\n\n\t this.boardMaterial = new CGFappearance(this.scene);\n\t this.boardMaterial.setAmbient(0.8,0.8,0.8,1);\n\t this.boardMaterial.setDiffuse(0.8,0.8,0.8,1);\n\t this.boardMaterial.setSpecular(0.8,0.8,0.8,1);\n this.boardMaterial.loadTexture(\"../scenes/images/scoreboard.jpg\");\n\n this.lightAppearance = new CGFappearance(this.scene);\n this.lightAppearance.setAmbient(0.4,0.4,0.4,1);\n\t this.lightAppearance.setDiffuse(0.8,0.8,0.8,1);\n this.lightAppearance.setSpecular(0.8,0.8,0.8,1);\n \n this.regularText=new CGFtexture(this.scene,\"../scenes/images/white.jpg\");\n this.redText = new CGFtexture(this.scene,\"../scenes/images/red.png\");\n this.greenText = new CGFtexture(this.scene,\"../scenes/images/selected.jpg\");\n this.player1=new CGFtexture(this.scene,\"../scenes/images/player1.png\");\n this.player2=new CGFtexture(this.scene,\"../scenes/images/player2.png\");\n this.draw=new CGFtexture(this.scene,\"../scenes/images/draw.png\");\n\n this.lightAppearance.setTexture(this.regularText);\n this.gameOver=false;\n \n\n }", "title": "" }, { "docid": "1ee9aa403c97827732e8405663cb34c9", "score": "0.56803674", "text": "function loadCurrentLights() {\n\t$(\".currentLights > div\").each(function(i) {\n\t\tclassname = \".\"+$(this).attr('class').split(' ')[1];\n\t\tlight = lightElements[classname];\n\t\tcolor = \"#\"+hue.getColorHex(light[0]);\n\t\talpha = hue.getBrightnessValue(light[0]) / 255;\n\t\t$(this).css(\"background-color\", color);\n\t\t$(this).spectrum(\"set\", colors.hexToRGBAString(color, alpha));\n\t});\n}", "title": "" }, { "docid": "1ee9aa403c97827732e8405663cb34c9", "score": "0.56803674", "text": "function loadCurrentLights() {\n\t$(\".currentLights > div\").each(function(i) {\n\t\tclassname = \".\"+$(this).attr('class').split(' ')[1];\n\t\tlight = lightElements[classname];\n\t\tcolor = \"#\"+hue.getColorHex(light[0]);\n\t\talpha = hue.getBrightnessValue(light[0]) / 255;\n\t\t$(this).css(\"background-color\", color);\n\t\t$(this).spectrum(\"set\", colors.hexToRGBAString(color, alpha));\n\t});\n}", "title": "" }, { "docid": "15b1d26faaffd52c1712b1dede7c58b7", "score": "0.5670652", "text": "function addLights() {\r\n\t\tvar ambientLight = new THREE.AmbientLight( View.colors.ambientLight );\r\n\t\tscene.add( ambientLight );\r\n\r\n\t\tvar hemisphereLight = new THREE.HemisphereLight( View.colors.ambientLight, View.colors. reticleLight, 0.6 );\r\n\t\tscene.add( hemisphereLight );\r\n\r\n\t\tcameraLight = new THREE.PointLight( View.colors.cameraLight, 3, property.maxDimension );\r\n\t\tscene.add( cameraLight );\r\n\r\n\t\treticleLight = new THREE.PointLight( \r\n\t\t\tView.colors.reticleLight,\r\n\t\t\t5,\r\n\t\t\tproperty.maxDimension / 15 );\r\n\t\tscene.add( reticleLight );\r\n\t}", "title": "" }, { "docid": "c7880e1ff2ca12f4f105c1f374bd06b6", "score": "0.56608576", "text": "function resetLights() {\n lightColors.fill(0);\n lightPositions.fill(0);\n nextLight = 0;\n}", "title": "" }, { "docid": "005dea1c86e00e37053235bf3f17a9fb", "score": "0.566052", "text": "createLights() {\n // add subtle ambient lighting\n this.ambientLight = new THREE.AmbientLight(0xccddee, 0.35);\n this.add(this.ambientLight);\n\n // add spotlight for the shadows\n this.spotLight = new THREE.SpotLight(0xffffff, 0.3);\n this.spotLight.position.set(150, 60, 0);\n this.spotLight.castShadow = true;\n // the shadow resolution\n this.spotLight.shadow.mapSize.width = 2048;\n this.spotLight.shadow.mapSize.height = 2048;\n this.add(this.spotLight);\n }", "title": "" }, { "docid": "d41c3d9eb02cc33d39767a9686d7fed7", "score": "0.5642741", "text": "function XMLscene(interface) {\n CGFscene.call(this);\n\n this.zoom = 0.7;\n\n this.initialTime = 0;\n this.deltaTime = 0;\n\n this.interface = interface;\n this.lightValues = {};\n\n this.red = 0;\n this.green = 0;\n this.blue = 0;\n \n}", "title": "" }, { "docid": "d0987779a0c87f197c0cf83c5cd32659", "score": "0.5640908", "text": "function initLightsSwitch() {\n\t$(\".square\").each(function(index, value){\n\t\tvar square_id = $(this).attr('id');\n\t\tvar rowcolsplit = square_id.split(/(\\d)/);\n\t\tvar row = parseInt(rowcolsplit[1]);\n\t\tvar col = parseInt(rowcolsplit[3]);\n\t\t$(this).on('mousedown', function () {\n\t\t\tswitchLights(row, col);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "7687c312e299af1e1d186a14b10ceab6", "score": "0.56299406", "text": "function initCustom(){\n\trandomStars();\n\tinitLightTrail(lightPath);\n}", "title": "" }, { "docid": "0af044f5b25abf1a31c71f07a8e44c42", "score": "0.5625754", "text": "addEnvLight(){\n /*\n * Read light intensity\n * Format: data-brightness=\"...\"\n * Value: 'high', 'medium', 'low'\n */ \n let intensity = 0xffffff;\n if (this.el.dTarget.dataset && this.el.dTarget.dataset.brightness){\n if (this.el.dTarget.dataset.brightness==='high'){ intensity = 0xffffff; }\n else if (this.el.dTarget.dataset.brightness==='medium'){ intensity = 0x808080; }\n else if (this.el.dTarget.dataset.brightness==='low'){ intensity = 0x404040; }\n }\n\n // Create the ambient light and add it to the screen\n this.ambientLight = new THREE.AmbientLight(intensity);\n this.scene.add(this.ambientLight);\n }", "title": "" }, { "docid": "ec0c331fe6abdebce746bfb221b53306", "score": "0.56251", "text": "init()\n { // Define how many boxes (buildings) to draw:\n Object.assign( this, { rows: 20, columns: 35 } );\n\n this.shapes = { cube: new defs.Cube() };\n const shader = new defs.Fake_Bump_Map();\n this.brick = { shader, color: color( 1,1,1,1 ),\n ambient: .05, diffusivity: .5, specularity: .5, smoothness: 10,\n texture: new Texture( \"assets/rgb.jpg\" ) };\n\n // Don't create any DOM elements to control this scene:\n this.widget_options = { make_controls: false };\n\n this.box_positions = []; this.row_lights = {}; this.column_lights = {};\n // Make initial grid of boxes at random heights:\n for( let row = 0; row < this.rows; row++ )\n for( let column = 0; column < this.columns; column++ )\n this.box_positions.push( vec3( row, -2-2*Math.random(), -column ).randomized( 1 ) );\n\n // The lights lists will function as a lookup table for the light in a current row and column:\n // Make initial light positions. One light per row, and one light per column:\n for( let c = 0; c < this.columns; c++ )\n this.row_lights [ ~~(-c) ] = vec3( 2*Math.random()*this.rows, -Math.random(), -c );\n for( let r = 0; r < this.rows; r++ )\n this.column_lights [ ~~( r) ] = vec3( r, -Math.random(), -2*Math.random()*this.columns );\n }", "title": "" }, { "docid": "c5ae3959cae8b1fb1efebdd2bf77efec", "score": "0.5613998", "text": "function ParseXMLToScene(xmlInput) {\n const parser = new DOMParser();\n const xml = parser.parseFromString(xmlInput, 'application/xml');\n console.log('xml', xml);\n const parserErrorNode = xml.getElementsByTagName('parsererror');\n if (parserErrorNode.length != 0) {\n throw new SyntaxError();\n }\n const objects = [];\n const lights = [];\n let camera = new Camera(new Vector(3.0, 2.0, 4.0), new Vector(-1.0, 0.5, 0.0));\n //Level 1\n const sceneNode = xml.getElementsByTagName('scene')[0];\n // console.log(sceneNode);\n //Level 2\n const cameraNode = sceneNode.getElementsByTagName('camera')[0];\n const objectsNode = sceneNode.getElementsByTagName('objects')[0];\n const lightsNode = sceneNode.getElementsByTagName('lights')[0];\n //Level 3\n const planeNodes = objectsNode.getElementsByTagName('plane');\n const sphereNodes = objectsNode.getElementsByTagName('sphere');\n const lightNodes = lightsNode.getElementsByTagName('light');\n // xml nodes to typescript objects\n for (let p of planeNodes) {\n const requiredAttributes = ['pos', 'offset', 'surface'];\n if (requiredAttributes.every(a => p.hasAttribute(a))) {\n const posAtt = p.getAttribute('pos');\n const offsetAtt = p.getAttribute('offset');\n const surfaceAtt = p.getAttribute('surface');\n const numbers = posAtt.split(',').slice(0, 3).map(s => parseFloat(s));\n const vec = new Vector(numbers[0], numbers[1], numbers[2]);\n const offset = parseFloat(offsetAtt);\n let surface = Surfaces.checkerboard;\n if (surfaceAtt === 'shiny') {\n surface = Surfaces.shiny;\n }\n // console.log('vec:', vec);\n // console.log('numbers:', numbers);\n // console.log('offset:', offset);\n // console.log('surface:', surface);\n objects.push(new Plane(vec, offset, surface));\n }\n }\n for (let s of sphereNodes) {\n const requiredAttributes = ['pos', 'size', 'surface'];\n if (requiredAttributes.every(a => s.hasAttribute(a))) {\n const posAtt = s.getAttribute('pos');\n const sizeAtt = s.getAttribute('size');\n const surfaceAtt = s.getAttribute('surface');\n console.log({ posAtt, sizeAtt, surfaceAtt });\n const numbers = posAtt.split(',').slice(0, 3).map(s => parseFloat(s));\n const vec = new Vector(numbers[0], numbers[1], numbers[2]);\n const size = parseFloat(sizeAtt);\n let surface = Surfaces.checkerboard;\n if (surfaceAtt === 'shiny') {\n surface = Surfaces.shiny;\n }\n // console.log('vec:', vec);\n // console.log('numbers:', numbers);\n // console.log('size:', size);\n // console.log('surface:', surface);\n objects.push(new Sphere(vec, size, surface));\n }\n }\n for (let l of lightNodes) {\n const requiredAttributes = ['pos', 'color'];\n if (requiredAttributes.every(a => l.hasAttribute(a))) {\n const posAtt = l.getAttribute('pos');\n const colorAtt = l.getAttribute('color');\n console.log({ posAtt, colorAtt });\n const numbers = posAtt.split(',').slice(0, 3).map(s => parseFloat(s));\n const vec = new Vector(numbers[0], numbers[1], numbers[2]);\n const color = colorAtt.split(',').slice(0, 3).map(s => parseFloat(s));\n // console.log('vec:', vec);\n // console.log('numbers:', numbers);\n // console.log('color:', color);\n lights.push({ pos: vec, color: new Color(color[0], color[1], color[2]) });\n }\n }\n (function parseLight(cameraNode) {\n console.log(cameraNode);\n const requiredAttributes = ['pos', 'lookAt'];\n if (requiredAttributes.every(a => cameraNode.hasAttribute(a))) {\n const posAtt = cameraNode.getAttribute('pos');\n const lookAtAtt = cameraNode.getAttribute('lookAt');\n console.log({ posAtt, lookAtAtt });\n let numbers = posAtt.split(',').slice(0, 3).map(s => parseFloat(s));\n const pos = new Vector(numbers[0], numbers[1], numbers[2]);\n numbers = lookAtAtt.split(',').slice(0, 3).map(s => parseFloat(s));\n const lookAt = new Vector(numbers[0], numbers[1], numbers[2]);\n // console.log({ pos, lookAt })\n camera = new Camera(pos, lookAt);\n }\n })(cameraNode);\n console.log(objects);\n console.log(lights);\n const scene = {\n things: objects,\n lights: lights,\n camera\n };\n console.log('parsed scene : ', scene);\n return scene;\n}", "title": "" }, { "docid": "410b730405e6e80977d141cc414d9662", "score": "0.5608971", "text": "initThemes() {\n // list of themes\n this.themes = [];\n this.themes.push('basic.xml');\n this.themes.push('stadium.xml');\n this.themes.push('hp_chess.xml');\n // theme selected\n this.currentTheme = new MySceneGraph(this.themes[2], this.scene);\n }", "title": "" }, { "docid": "c1df937544ced5ba5fc03fdebd98a243", "score": "0.5597068", "text": "function updateLightColor() {\n sceneLights[parseFloat(selectedObject.value)].color = [parseFloat(lightRedSlider.value),\n parseFloat(lightGreenSlider.value),\n parseFloat(lightBlueSlider.value)]\n }", "title": "" }, { "docid": "3e2ea30a3e7614a688eaeb4f155ac16b", "score": "0.55442834", "text": "function GeneralLights(scene) {\n\t\tvar lights = [];\n\t\tlights[0] = new THREE.PointLight(0xffffff, 1, 0);\n\t\tlights[1] = new THREE.PointLight(0xffffff, 1, 0);\n\t\tlights[2] = new THREE.PointLight(0xffffff, 1, 0);\n\t\tlights[0].position.set(0, 200, 0);\n\t\tlights[1].position.set(100, 200, 100);\n\t\tlights[2].position.set(-100, -200, -100);\n\t\t// scene.add( lights[ 0 ] );\n\t\t// scene.add( lights[ 1 ] );\n\t\t// scene.add( lights[ 2 ] );\n\t\tthis.update = function(time) {\n\t\t\t// light.intensity = (Math.sin(time)+1.5)/1.5;\n\t\t\t// light.color.setHSL( Math.sin(time), 0.5, 0.5 );\n\t\t};\n\t}", "title": "" }, { "docid": "eb8fda74eaba8446dbfc8942d0c7df75", "score": "0.55237937", "text": "function Scene_Load() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "648cc6997a634282c2a361593873e28f", "score": "0.55137163", "text": "function createLights(scene) {\n lights[0] = new THREE.PointLight(\"#ffffff\", .5, 0);\n lights[1] = new THREE.PointLight(\"#ffffff\", .5, 0);\n lights[2] = new THREE.PointLight(\"#ffffff\", .8);\n lights[3] = new THREE.AmbientLight(\"#ffffff\", 0.2);\n\n lights[0].position.set(50, 30, 50);\n lights[1].position.set(50, -30, 50);\n lights[2].position.set(-50, 30, -50);\n\n scene.add(lights[0]);\n scene.add(lights[1]);\n scene.add(lights[2]);\n scene.add(lights[3]);\n const Helper = new THREE.PointLightHelper(lights[2]);\n scene.add(Helper);\n}", "title": "" }, { "docid": "670a443121c79e0b87ed517a6a49b139", "score": "0.54903156", "text": "function initLighting() {\n var spotlight = new THREE.SpotLight(0x404040);\n camera.add(spotlight);\n\n spotlight.target = group;\n var lightAmbient = new THREE.AmbientLight(0x404040);\n scene.add(lightAmbient);\n}", "title": "" }, { "docid": "670a443121c79e0b87ed517a6a49b139", "score": "0.54903156", "text": "function initLighting() {\n var spotlight = new THREE.SpotLight(0x404040);\n camera.add(spotlight);\n\n spotlight.target = group;\n var lightAmbient = new THREE.AmbientLight(0x404040);\n scene.add(lightAmbient);\n}", "title": "" }, { "docid": "4c1f234170db98f628ecd1e7fa077a56", "score": "0.54702777", "text": "function setLight() {\n document.documentElement.style.setProperty(\n '--color-black',\n 'rgb(18, 21, 25)'\n )\n document.documentElement.style.setProperty(\n '--color-white',\n 'rgb(250, 249, 248)'\n )\n document.documentElement.style.setProperty(\n '--color-gray',\n 'rgb(238, 238, 238)'\n )\n }", "title": "" }, { "docid": "82f3a31bc9662ae76ce69c36f40d46b5", "score": "0.5468374", "text": "constructor() {\n super(new BABYLON.Vector3(-20.0, 0.0, -20.0), new BABYLON.Vector3(0.0, 0.0, 0.0), lib_1.LibUI.COLOR_ORANGE_MAYFLOWER);\n this.light1 = null;\n this.setupLights();\n this.setupGround();\n src_1.MfgInit.onInitCompleted();\n }", "title": "" }, { "docid": "dc840e36d2ff185752fe6bd222e46edc", "score": "0.54616886", "text": "function setScene() {\n // Color and Material ------------------\n material_1 = new THREE.MeshLambertMaterial({\n color:'#D8FFA9'\n });\n material_2 = new THREE.MeshLambertMaterial({\n color:'#FFA9CA'\n });\n field_material = new THREE.MeshLambertMaterial({\n color:'#FFE0BD'\n });\n ground_material = new THREE.MeshBasicMaterial({\n color: '#ECCCC9'\n });\n color_1 = new THREE.Color('#FFCD82');\n color_2 = new THREE.Color('#82E4FF');\n\n // Scene ------------------------------\n scene.background = new THREE.Color( '#E0F4C0' );\n light = new THREE.HemisphereLight(0xfffff, 0x000000, 0.6 );\n scene.add(light);\n light.position.set(0,30,0)\n rectLight.position.set( -5, 10, -10 );\n rectLight.lookAt( 0, 0, 0 );\n rectLight.castShadow = true;\n rectLight.shadow.mapSize.width = 512; \n rectLight.shadow.mapSize.height = 512; \n rectLight.shadow.camera.near = 0.5;\n rectLight.shadow.camera.far = 500; \n scene.add( rectLight )\n}", "title": "" }, { "docid": "07e55bbbbf716471e7666aa42c612ea4", "score": "0.54289335", "text": "init() {\n if(this._loadState != LoadStates.NOT_LOADING){\n return;\n }\n\n this._loadState = LoadStates.LOADING;\n\n var selfRef = this;\n loadOBJModel(\"models/\", \"Tugboat.obj\", \"textures/\", \"Tugboat.mtl\", (mesh) => {\n var textureLoader = new THREE.TextureLoader();\n var map = textureLoader.load('textures/Tugboat_BaseColor.png');\n var material = new THREE.MeshPhongMaterial({ map: map });\n \n mesh.traverse(function (node) {\n if (node.isMesh) node.material = material;\n });\n mesh.scale.set(1, 1, 1);\n mesh.castShadow = true; \n selfRef.add(mesh);\n\n addSpotLight(selfRef, 0xfff000, -1, 2, 10, 2, 15, 1 ,1 ,2 );\n\n selfRef._loadState = LoadStates.LOADED;\n });\n }", "title": "" }, { "docid": "81959a01f943fd59cde92054defb35f0", "score": "0.54268146", "text": "function addLights() {\n var lightOne = new THREE.DirectionalLight(0xffffff);\n lightOne.position.set(1, 1, 1);\n scene.add(lightOne);\n\n var lightTwo = new THREE.DirectionalLight(0xffffff, .4);\n lightTwo.position.set(1, -1, -1);\n scene.add(lightTwo);\n}", "title": "" }, { "docid": "94ed434f4eaea9f668d5444fe0571fdb", "score": "0.54263765", "text": "function initializeData() {\r\n data.vertices = new Float32Array([\r\n // -0.75, -0.75, 0.0,\r\n // -0.75, 0.75, 0.0,\r\n // 0.75, 0.75, 0.0,\r\n // 0.75, -0.75, 0.0\r\n -1.0, -1.00, 0.0,\r\n -1.0, 1.00, 0.0,\r\n 1.0, 1.00, 0.0,\r\n 1.0, -1.00, 0.0\r\n ]);\r\n\r\n data.indices = new Uint16Array([ 0, 1, 2, 3, 0, 2 ]);\r\n\r\n\r\n //Initialize lights\r\n let Ka = [1.0, 1.0, 1.0];\r\n let La = [0.1, 0.1, 0.1];\r\n let Kd = [1.0, 1.0, 1.0];\r\n let Ld = [\r\n // 1000.0, 1000.0, 1000.0,\r\n // 2000.0, 2000.0, 1200.0,\r\n // 0.0, 0.0, 2000.0\r\n\r\n 0.5, 0.5, 0.5,\r\n 0.2, 0.2, 0.0,\r\n 0.0, 0.0, 0.0\r\n\r\n ];\r\n light.matLight = lightMat(Ka, La);\r\n light.diffuseLight = diffuseLightMat(Kd, Ld);\r\n light.lightPosition =[\r\n 0.0, 0.0, -1.0,\r\n 0.0, 10.0, -3.0,\r\n 10.0, 5.0, -3.0\r\n ];\r\n\r\n //initialize scene\r\n scene.vEye = new Float32Array([0.0, 0.0, 3.0]);\r\n // scene.sphere1 = {\r\n // center: {\r\n // x:0,\r\n // y:0,\r\n // z:0\r\n // },\r\n // radius: 10\r\n\r\n\r\n // };\r\n \r\n\r\n }", "title": "" }, { "docid": "e410e14454782ff35a89d48bd1cd99aa", "score": "0.53952044", "text": "function initScene() {\n \n // refresh global objects\n ARCH.refreshSelection(scene);\n}", "title": "" }, { "docid": "be5163a8f42b7d35f4a5ff53366b7eac", "score": "0.53751475", "text": "function init() {\n document.getElementById(\"digital-body\").style.backgroundImage = BACKGROUND_URL;\n updateDate(0);\n\n // Set up objects\n try {\n lightSensor = tizen.sensorservice.getDefaultSensor('LIGHT');\n } catch (err) {\n console.error('Could not access light sensor.',\n err.message);\n }\n\n // Sign up to read services\n // These should be listed in config.xml\n tizen.ppm.requestPermission(\n \"http://tizen.org/privilege/healthinfo\",\n () => {\n healthAvailable = true\n tizen.humanactivitymonitor.start(\"PEDOMETER\", showStepData, reportError); \n }, \n (e) => {\n console.log(\"Healthinfo error \" + JSON.stringify(e))\n });\n\n bindEvents();\n }", "title": "" }, { "docid": "cc0e1de983aa68758b0940975a01adf7", "score": "0.53718424", "text": "function buildLight() {\n let light = new THREE.DirectionalLight(0xffffff, 0.26);\n light.position.set(1, 1, 1).normalize();\n addScene(light);\n}", "title": "" }, { "docid": "4209270ec74c60a7ede2f0c5c8aeb8c7", "score": "0.53538144", "text": "onGraphLoaded() {\n \n //TODO: Change reference length according to parsed graph ✓\n this.axis = new CGFaxis(this,this.graph.axis_length);\n // TODO: Change ambient and background details according to parsed graph ✓\n var ambient = this.graph.ambient;\n var background = this.graph.background;\n this.gl.clearColor(background[0],background[1],background[2],background[3]); //global from parser ✓\n this.setGlobalAmbientLight(ambient[0],ambient[1],ambient[2],ambient[3]);//global from parser ✓\n this.initLights();\n this.initViews();\n // Adds lights group ✓\n this.interface.addLightsGroup(this.graph.lights); //add all lights ✓\n this.interface.addViewsGroup(this.viewValues);\n this.sceneInited = true;\n this.setUpdatePeriod(20);\n\n }", "title": "" }, { "docid": "af222d71d4044a374b9c3bfd98bf6d35", "score": "0.5351551", "text": "function initScene() {\n scene.background = new THREE.Color('#e6e6e6');\n \n // refresh global objects\n gb = new ARCH.GeometryFactory(scene);\n let mt = new ARCH.MaterialFactory();\n \n const light = new THREE.SpotLight(0xffffff, 1.5);\n light.position.set(0, 0, 1000);\n scene.add(light);\n \n let num = 12;\n let portion = Math.PI / num * 2;\n let radius = 300;\n let circles = [];\n for (let i = 0; i < num; ++i) {\n let color = new THREE.Color().setHSL(i / num, 0.6, 0.6).getHex();\n circles.push(gb.Cylinder([\n radius * Math.sin(i * portion),\n radius * Math.cos(i * portion),\n 0],\n [10, 10],\n mt.Matte(color)));\n }\n \n let title = [\"archiweb\"];\n title.forEach((s) => stringSegments(circles, s, num));\n \n circles.forEach((it) => it.visible = false);\n //\n ARCH.refreshSelection(scene);\n}", "title": "" }, { "docid": "2dfa830c23e8f565ef80df05e699be23", "score": "0.53316003", "text": "constructor() {\n super(\"MainScene\");\n // Monster variables\n this.monsterImage = null;\n this.hp = 5;\n this.name = null;\n this.hpText = null;\n this.crystalsText = null;\n this.crystals = 0;\n // Levels in upgrades\n this.levels = {\n tap: 1,\n knight: 0\n }\n this.bg = null;\n // Status of monster\n this.alive = false;\n this.stage = 0;\n this.levelup = false;\n this.lvltext = null;\n this.maxlevel = 9;\n this.tween;\n this.lvlprice = null;\n }", "title": "" }, { "docid": "a98ad66024e3a8298d69a3616cefb72b", "score": "0.5319332", "text": "function init () {\n\t\n\t// obtain a reference to the SVG document\n\tvar objectElement = document.getElementById('svgMap');\n\tif (objectElement.contentDocument && objectElement.contentDocument.getElementById) {\n\t\tsvgDocument = objectElement.contentDocument;\n\t}\n\telse {\n\t\t// this for compatibility with legacy User Agents\n\t\tsvgDocument = objectElement.getSVGDocument();\n\t}\n\t\n\t// get the XML reference by loading the XML file through an XMLHttpRequest\n\tloadXmlDocument('XML/data.xml', function (xmlDocument) {\n\t\tvar data = xmlDocument.documentElement;\n\t\t\n\t\t// after the XML was loaded successfully, apply its data to the map\n\t\tvar classes = outputChoropleths(data);\n\t\toutputLegend(classes);\n\t\toutputMapText(data);\n\t});\n}", "title": "" }, { "docid": "942fccc3c0045a13fb141b85bc0c0d6e", "score": "0.5314331", "text": "function init() {\n\t// Put all volume level ids into an array\n for (i=0;i<6;i++) {\n volLevels[i] = document.getElementById(\"vl\"+i.toString());\n }\n\n // Fill the first 3 volume levels with color\n for (i=0;i<3;i++) {\n volLevels[i].style.backgroundColor = \"#9f5cc4\";\n }\n}", "title": "" }, { "docid": "92cce199e3fa466c11c5fba6c23429cb", "score": "0.5307542", "text": "function createLights(){\n globalLight = new THREE.AmbientLight(0xffffff, .9);\n\n shadowLight = new THREE.DirectionalLight(0xffffff, 1);\n shadowLight.position.set(-30, 40, 20);\n shadowLight.castShadow = true;\n shadowLight.shadow.camera.left = -400;\n shadowLight.shadow.camera.right = 400;\n shadowLight.shadow.camera.top = 400;\n shadowLight.shadow.camera.bottom = -400;\n shadowLight.shadow.camera.near = 1;\n shadowLight.shadow.camera.far = 2000;\n shadowLight.shadow.mapSize.width = shadowLight.shadow.mapSize.height = 2048;\n\n scene.add(globalLight);\n scene.add(shadowLight);\n}", "title": "" }, { "docid": "d734034643bd29361a506d1e677d6e37", "score": "0.52993923", "text": "function initLight(){\n var pointLight = new THREE.PointLight(0x0000FF); // blue\n pointLight.position.set (CUBE_LEN/2, CUBE_LEN/2, 300);\n\n scene.add(pointLight);\n return pointLight;\n}", "title": "" }, { "docid": "5217fee947da810d410d125ba1ce3c75", "score": "0.52815396", "text": "constructor(num_lights = 2) {\n super();\n this.num_lights = num_lights;\n }", "title": "" }, { "docid": "010ece7204b1ec77da441465bc8a3fb4", "score": "0.52805084", "text": "onGraphLoaded() {\n //this.camera.near =this.graph.views[this.graph.default_view].near;\n //this.camera.far =this.graph.views[this.graph.default_view].far;\n this.camera=this.graph.views[this.graph.default_view];\n this.interface.setActiveCamera(this.camera);\n\n\n // Change reference length according to parsed graph\n this.axis = new CGFaxis(this, this.graph.axis_length);\n\n // Change ambient and background details according to parsed graph\n this.setGlobalAmbientLight(this.graph.ambient.ambient.red,\n this.graph.ambient.ambient.green,\n this.graph.ambient.ambient.blue,\n this.graph.ambient.ambient.alpha);\n this.gl.clearColor(this.graph.ambient.background.red,\n this.graph.ambient.background.green,\n this.graph.ambient.background.blue,\n this.graph.ambient.background.alpha);\n\n this.initLights();\n\n // Adds lights group.\n this.interface.addLightsGroup(this.graph.lights);\n\n //this.interface.addViewssGroup(this.graph.views);\n\n this.sceneInited = true;\n }", "title": "" }, { "docid": "5f180121f50140b662231f279e6e6ef5", "score": "0.52732533", "text": "function main() {\n var lighting = (document.getElementById(\"e_lights\").checked);\n setupWebGL(); // set up the webGL environment\n setupShaders(); // setup the webGL shaders\n //createPMatrix(); // build the initial setup\n gl.oMatrix = mat4.create();\n mat4.ortho(gl.oMatrix,WIN_LEFT,WIN_RIGHT,WIN_BOTTOM,WIN_TOP,WIN_Z,1);\n viewport = new Viewport(gl,shaderProgram);\n viewport.SetPosition([Eye[0], Eye[1], Eye[2]]);\n viewport.SetViewVector([0,0,1]);\n viewport.SetMoveSpeed(5);\n viewport.SetRotationsPerSecond(0.5);\n viewport.SetViewInformation(Math.PI/2, 0.1, 5.0, [0,0,0]);\n viewport.UpdateLookMatrix();\n // var inputLights = getJSONFile(INPUT_LIGHTS_URL, \"lights\");\n // if (inputLights != String.null) {\n // for(var i = 0; i < inputLights.length; i++) {\n // var light = vec3.fromValues();\n // }\n // }\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // clear frame/depth buffers\n gl.uniform1i(shaderProgram.useLightingUniform, lighting);\n loadSpheres();\n loadTriangles(); // load in the triangles from tri file\n viewport.StartRenderLoop();\n} // end main", "title": "" }, { "docid": "a0027799fbb7fe9b770111ef402aa9af", "score": "0.52418804", "text": "checkLights() {\n\n\t\tthis.checkLight(this.light1, this.lights[0]);\n\t\tthis.checkLight(this.light2, this.lights[1]);\n\t\tthis.checkLight(this.light3, this.lights[2]);\n\t\tthis.checkLight(this.light4, this.lights[3]);\n\t\tthis.checkLight(this.light5, this.lights[4]);\n\n\t}", "title": "" }, { "docid": "e4499187298342db688fe11193953062", "score": "0.5239399", "text": "function registerLights(lightList)\n{\n for (i in lightList)\n {\n // add color to uniform shader attributes\n lightUniforms.push({\n intensity: {type: \"v3\",\n value: new Vector3(lightList[i].intensity.r,\n lightList[i].intensity.g,\n lightList[i].intensity.b)\n }});\n var id = lightUniforms.length - 1;\n \n // create shader for light shape\n var lightMaterial = new THREE.ShaderMaterial({\n uniforms: lightUniforms[id],\n attributes: {},\n vertexShader: vertexShaderLight(),\n fragmentShader: fragmentShaderLight()\n });\n \n // create light shape as child of new scene node\n var lightNode = new THREE.Object3D();\n lightNode.add(new THREE.Mesh(new THREE.SphereGeometry(2.0, 8, 8),\n lightMaterial));\n \n // add light rays\n lightNode.add(new THREE.Mesh(new THREE.CylinderGeometry(0.2, 0.2, 6,\n 8, 1, true),\n lightMaterial));\n for (var lambda = 0.25; lambda <= 1.75; lambda += 0.25)\n {\n for (var phi = 0.25; phi <= 0.75; phi += 0.25)\n {\n var lightRay = new THREE.Mesh(new THREE.CylinderGeometry(0.2, 0.2, 6,\n 8, 1, true),\n lightMaterial);\n lightRay.rotation.z = phi * Math.PI;\n lightRay.rotation.y = lambda * Math.PI;\n lightNode.add(lightRay);\n }\n }\n \n // set position of light shape and add to scene\n lightNode.position.x = lightList[i].position.x;\n lightNode.position.y = lightList[i].position.y;\n lightNode.position.z = lightList[i].position.z;\n \n scene.add(lightNode);\n }\n}", "title": "" }, { "docid": "e2a2038791079119d123947104e60727", "score": "0.52373374", "text": "onGraphLoaded() {\n\n this.initCameras();\n\n this.interface.addViewsGroup(this.cameras);\n\n this.interface.addAnimationsGroup();\n\n this.axis = new CGFaxis(this, this.graph.axisLength);\n\n if (this.graph.ambient.background != null) {\n let bg = this.graph.ambient.background;\n this.gl.clearColor(bg.r, bg.g, bg.b, bg.a);\n }\n\n if (this.graph.ambient.ambient != null) {\n let amb = this.graph.ambient.ambient;\n this.setGlobalAmbientLight(amb.r, amb.g, amb.b, amb.a);\n }\n\n this.initLights();\n\n // Adds lights group.\n this.interface.addLightsGroup(this.lightValues);\n\n this.setUpdatePeriod(1 / 60 * 1000);\n this.lastUpdate = (new Date()).getTime();\n\n this.sceneInited = true;\n }", "title": "" }, { "docid": "7e0788d78b809cb5f043090a9eed5b35", "score": "0.52287287", "text": "inited() {\n const defaultColor = this.data.get('defaultColor');\n this.onColorChange(defaultColor);\n }", "title": "" }, { "docid": "4ead4c99fb0072201bab7f27d94d57c4", "score": "0.5220311", "text": "function initializeNodes() {\n for (let i = 0; i < SlideImageUrls.length; i++) {\n const slideID = i + 1;\n const node = createNode(slideID);\n styleNode(node, SlideImageUrls[i]);\n SlideShowState.slideNodes.push(node);\n }\n}", "title": "" }, { "docid": "69900f46a35f84cadc2d2f40001f4a69", "score": "0.52148694", "text": "createAmbientLight() {\n\n\t\tif ( 'GlobalSettings' in fbxTree && 'AmbientColor' in fbxTree.GlobalSettings ) {\n\n\t\t\tconst ambientColor = fbxTree.GlobalSettings.AmbientColor.value;\n\t\t\tconst r = ambientColor[ 0 ];\n\t\t\tconst g = ambientColor[ 1 ];\n\t\t\tconst b = ambientColor[ 2 ];\n\n\t\t\tif ( r !== 0 || g !== 0 || b !== 0 ) {\n\n\t\t\t\tconst color = new Color( r, g, b ).convertSRGBToLinear();\n\t\t\t\tsceneGraph.add( new AmbientLight( color, 1 ) );\n\n\t\t\t}\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "dbda349087c50cb77ff449c1559c0af7", "score": "0.5213888", "text": "constructor() {\n this.h = 155;\n this.s = 0;\n this.l = 0;\n this.a = 1\n\n this.lightnessIncreasing = true;\n this.saturationIncreasing = true;\n }", "title": "" }, { "docid": "21614b29483e934f5cc31f6d0ee676fa", "score": "0.5210602", "text": "function loadWallLight() {\n var pos = 0; // count the index of the array\n var r = 30;\n for (var row = 0; row < 25; row++) {\n for (var col = 0; col < 9; col++) {\n wallLights[pos] = (new WallLight(50 * row + r + 10, 50 * col + r * 0.8));\n pos++;\n }\n }\n}", "title": "" }, { "docid": "d7e451f24b01495f61e8a12ae45fe7fd", "score": "0.5191056", "text": "function scene_init() {\n\tscene_render();\n\tscene_activate();\n}", "title": "" }, { "docid": "0aa601853e8bcc4c8388c46a617dbb82", "score": "0.5189296", "text": "function initialisationOfImages(scope) {\n\t\n\t/** Set the initial display of light images */\n\t\n\tmain_stage.getChildByName(\"detector_switch_on\").alpha = 0; /** Hide power on initially */\n\tmain_stage.getChildByName(\"laser\").alpha = 0; /** Hide laser on initially */\n\tmain_stage.getChildByName(\"laser_line_two\").alpha = 0; /** Hide laser on initially */\n\tmain_stage.getChildByName(\"laser_line_one\").alpha = 0; /** Hide laser on initially */\n\tmain_stage.getChildByName(\"display_text\").alpha = 0;\n\tmain_stage.getChildByName(\"zoom_rotator\").rotation = 90;\n\tmain_stage.update();\n}", "title": "" }, { "docid": "00a616ac7ee8c8e32a64e7777ef05cd0", "score": "0.5188046", "text": "loadVisuals() {\n\t\tthis.visuals = {\n\t\t\tnoTexture: new CGFappearance(this.scene),\n\t\t\ttileTexture: new CGFappearance(this.scene),\n\t\t\tlightWood : new CGFappearance(this.scene),\n\t\t\tredMaterial: new CGFtexture(this.scene, '../scenes/images/red_marble2.jpg'),\n\t\t\tblueMaterial: new CGFtexture(this.scene, '../scenes/images/blue_marble2.jpg'),\n\t\t\tgreenMaterial: new CGFtexture(this.scene, '../scenes/images/green_marble2.jpg'),\n\t\t\ttopTex: new CGFtexture(this.scene, '../scenes/images/box_top.jpg'),\n\t\t\tredTex: new CGFtexture(this.scene, '../scenes/images/box_red.jpg'),\n\t\t\tblueTex: new CGFtexture(this.scene, '../scenes/images/box_blue.jpg'),\n\t\t\tredTurn: new CGFtexture(this.scene, '../scenes/images/turn_red.jpg'),\n\t\t\tblueTurn: new CGFtexture(this.scene, '../scenes/images/turn_blue.jpg'),\n\t\t\tnumbers: [],\n\t\t\tpieceShader: new CGFshader(this.scene.gl, '../shaders/connection.vert', '../shaders/connection.frag'),\n\t\t\tglowTexture: new CGFtexture(Game.getInstance().scene, '../scenes/images/yellow_marble.jpg'),\n\t\t\tnumberShader: new CGFshader(this.scene.gl, '../shaders/number.vert', '../shaders/number.frag'),\n\t\t};\n\t\tfor (let i = 0; i < 10; i++) {\n this.visuals.numbers.push(new CGFtexture(this.scene, `/scenes/images/numbers/${i}.png`));\n }\n\n\t\tthis.visuals.tileTexture.loadTexture('scenes/images/tile.jpg'),\n\t\tthis.visuals.lightWood.loadTexture('scenes/images/light_wood.jpg')\n\t}", "title": "" }, { "docid": "d7db342905bb1ded4f4ed6ef272f4774", "score": "0.5185497", "text": "function initializeLists() {\n var k;\n // first make a list of reserved names\n // we assume full integrity of the x3D source file\n // therefore we assume, that all given DEFs are unique\n\n // materials ++\n for ( k = 0; k < matFields.length; k++ )\n getDEFines( matFields[k] );\n // geometries ++\n for ( k = 0; k < geoFields.length; k++ )\n getDEFines( geoFields[k] );\n // mesh\n getDEFines( 'Shape' );\n // groups ++\n for ( k = 0; k < grpFields.length; k++ )\n getDEFines( grpFields[k] );\n\n // now give a name to every unnamed field node\n\n // materials ++\n for ( k = 0; k< matFields.length; k++ )\n setDefines( matFields[k] );\n // geometries ++\n for ( k = 0; k < geoFields.length; k++ )\n setDefines( geoFields[k] );\n // mesh\n setDefines( 'Shape' );\n // groups ++\n setDefinesTransform();\n setDefines( \"Group\" );\n setDefines( \"Scene\" );\n\n setDefaultMaterial() ; // set the standard for void material\n\n if( options.verbose ) console.log( \"defines listing:\" + DEFines );\n }", "title": "" }, { "docid": "297e2a08f87297ed87b823380a186afa", "score": "0.51848686", "text": "function init() {\n\t\n\tsetupScene();\n}", "title": "" }, { "docid": "34c32e14279b3588c7d8dd3565f19664", "score": "0.5164463", "text": "function init(nodes) {\n\n nodes\n .attr(\"x\",0)\n .attr(\"y\",0)\n .attr(\"width\",0)\n .attr(\"height\",0)\n\n }", "title": "" }, { "docid": "34c32e14279b3588c7d8dd3565f19664", "score": "0.5164463", "text": "function init(nodes) {\n\n nodes\n .attr(\"x\",0)\n .attr(\"y\",0)\n .attr(\"width\",0)\n .attr(\"height\",0)\n\n }", "title": "" }, { "docid": "d9114447d289183719d62c5129200958", "score": "0.51626337", "text": "function refreshLightPositions(){\n lightPositions = [\n vec4(0, 0, 0, 0),\n vec4(0, 0, 0, 0),\n vec4(0, 0, 0, 0),\n vec4(0, 0, 0, 0)\n ];\n}", "title": "" }, { "docid": "17b9c251247b4e4a22a9d7c49d87aba9", "score": "0.5160538", "text": "passInitialValuesToThree() {\n this.three.color = this.color\n this.three.intensity = this.intensity\n }", "title": "" }, { "docid": "a0182315204a1c561e8194b8fedc6f2f", "score": "0.51554507", "text": "function init(nodes) {\n\n nodes\n .attr(\"x\",0)\n .attr(\"y\",0)\n .attr(\"width\",0)\n .attr(\"height\",0);\n\n }", "title": "" }, { "docid": "a0182315204a1c561e8194b8fedc6f2f", "score": "0.51554507", "text": "function init(nodes) {\n\n nodes\n .attr(\"x\",0)\n .attr(\"y\",0)\n .attr(\"width\",0)\n .attr(\"height\",0);\n\n }", "title": "" }, { "docid": "0e4c4ea4b91fece0598fb393729b6af9", "score": "0.51549757", "text": "function loadSceneFinished(scene) {\n var addPointLight = function addLightFn(lightName, lightMaterial, position, color) {\n var light = Light.create({\n name: lightName,\n color: mathDevice.v3Build(color[0], color[1], color[2]),\n point: true,\n shadows: true,\n halfExtents: v3Build.call(mathDevice, 40, 40, 40),\n origin: v3Build.call(mathDevice, 0, 10, 0),\n material: lightMaterial\n });\n\n scene.addLight(light);\n\n var lightMatrix = mathDevice.m43BuildTranslation(v3Build.apply(mathDevice, position));\n\n var lightNode = SceneNode.create({\n name: lightName + \"-node\",\n local: lightMatrix\n });\n\n lightNode.addLightInstance(LightInstance.create(light));\n scene.addRootNode(lightNode);\n };\n\n var lightMaterialData = {\n effect: \"lambert\",\n parameters: {\n lightfalloff: \"textures/default_light.png\",\n lightprojection: \"textures/default_light.png\"\n }\n };\n\n scene.loadMaterial(graphicsDevice, textureManager, effectManager, \"defaultLightMaterial\", lightMaterialData);\n var lightMaterial = scene.getMaterial(\"defaultLightMaterial\");\n\n // Add some lights into the scene\n addPointLight(\"globalLight\", lightMaterial, [-3.5, 15, -0.5], [1, 1, 1]);\n\n scene.addLight(Light.create({\n name: \"ambient\",\n ambient: true,\n color: [0.1, 0.1, 0.1]\n }));\n\n if (buttonsAvailable) {\n buttonLoadDuck.disabled = false;\n buttonLoadCube.disabled = false;\n buttonLoadSphere.disabled = false;\n }\n }", "title": "" }, { "docid": "b42ceda2d6fd299158255218a4b0a06a", "score": "0.5150951", "text": "initScene() {\n\t\tthis.scene = new BABYLON.Scene(this.engine);\n\t\tconst camera = this.setCamera();\n\t\tconst sphere = BABYLON.MeshBuilder.CreateSphere('', { diameter: .0001 }, this.scene);\n\n\t\t// Enable Physics (gravity)\n\t\tthis.scene.enablePhysics(null, new BABYLON.OimoJSPlugin());\n\n\t\t// Adding light\n\t\tvar light = new BABYLON.PointLight(\"dir01\", new BABYLON.Vector3(0, 5, 5), this.scene);\n\t\tlight.diffuse = new BABYLON.Color3(1, 1, 1);\n\t\tlight.specular = new BABYLON.Color3(0, 0, 0);\n\t\tthis.scene.ambientColor = new BABYLON.Color3(0.3, 0.3, 0.3);\n\n\t\t// Added Ground\n\t\tvar ground = BABYLON.Mesh.CreateGround(\"ground\", 1000, 1000, 1, this.scene, false);\n\t\tvar groundMaterial = new BABYLON.StandardMaterial(\"ground\", this.scene);\n\t\tgroundMaterial.diffuseColor = new BABYLON.Color3(0.2, 0.2, 0.2);\n\t\tgroundMaterial.specularColor = new BABYLON.Color3(0, 0, 0);\n\t\tground.material = groundMaterial;\n\t\tground.receiveShadows = true;\n\t\tground.checkCollisions = true;\n\t\tground.physicsImpostor = new BABYLON.PhysicsImpostor(ground, BABYLON.PhysicsImpostor.BoxImpostor, { mass: 0, friction: 0.5, restitution: 0.7 }, this.scene);\n\n\t\tBABYLON.SceneLoader.ImportMesh(\"\", `/${\"dist\"}/Scenes/Dude/`, modelName, this.scene, (newMeshes, particleSystems, skeletons) => {\n\t\t\tconst mesh = newMeshes[0];\n\t\t\tconst skeleton = skeletons[0];\n\t\t\tvar head_bone;\n\t\t\tvar right_shoulder_bone, right_arm_bone, right_hip_bone, right_knee_bone;\n\t\t\tvar left_shoulder_bone, left_arm_bone, left_hip_bone, left_knee_bone;\n\n\t\t\t// Enable gravity on mesh\n\t\t\tmesh.physicsImpostor = new BABYLON.PhysicsImpostor(mesh, BABYLON.PhysicsImpostor.BoxImpostor, { mass: 0 }, this.scene);\n\t\t\tmesh.applyGravity = true;\n\t\t\tmesh.checkCollisions = true;\n\n\t\t\tif (modelName == \"Dude.babylon\") {\n\t\t\t\tmesh.scaling = new BABYLON.Vector3(0.1, 0.1, 0.1);\n\t\t\t\tmesh.position = new BABYLON.Vector3(0, 0, 0);\n\n\t\t\t\t/* Bone setup for Dude model */\n\t\t\t\t// Head\n\t\t\t\thead_bone = skeleton.bones[7];\n\n\t\t\t\t// Right Arm\n\t\t\t\tright_shoulder_bone = skeleton.bones[13];\n\t\t\t\tright_arm_bone = skeleton.bones[14];\n\n\t\t\t\t// Right Leg\n\t\t\t\tright_hip_bone = skeleton.bones[50];\n\t\t\t\tright_knee_bone = skeleton.bones[51];\n\n\t\t\t\t// Left Arm\n\t\t\t\tleft_shoulder_bone = skeleton.bones[32];\n\t\t\t\tleft_arm_bone = skeleton.bones[33];\n\n\t\t\t\t// Left Leg\n\t\t\t\tleft_hip_bone = skeleton.bones[54];\n\t\t\t\tleft_knee_bone = skeleton.bones[55];\n\t\t\t} else {\n\t\t\t\tmesh.scaling = new BABYLON.Vector3(4, 4, 4);\n\t\t\t\tmesh.position = new BABYLON.Vector3(0, 0, 0);\n\n\t\t\t\t/* Bone setup for Blue Humanoid Model */\n\t\t\t\t// Head\n\t\t\t\thead_bone = skeleton.bones[4];\n\n\t\t\t\t// Right Arm\n\t\t\t\tright_shoulder_bone = skeleton.bones[34]; // RightArm\n\t\t\t\tright_arm_bone = skeleton.bones[35]; // RightForeArm\n\n\t\t\t\t// Right Leg\n\t\t\t\tright_hip_bone = skeleton.bones[57]; // RightUpLeg\n\t\t\t\tright_knee_bone = skeleton.bones[58]; // RightLeg\n\n\t\t\t\t// Left Arm\n\t\t\t\tleft_shoulder_bone = skeleton.bones[10]; // LeftArm\n\t\t\t\tleft_arm_bone = skeleton.bones[11]; // LeftForeArm\n\n\t\t\t\t// Left Leg\n\t\t\t\tleft_hip_bone = skeleton.bones[62]; // LeftUpLeg\n\t\t\t\tleft_knee_bone = skeleton.bones[63]; // LeftLeg\n\t\t\t}\n\n\t\t\tconst lookAtCtl = new BABYLON.BoneLookController(mesh, head_bone, sphere.position, { adjustYaw: Math.PI * .5, adjustRoll: Math.PI * .5 });\n\n\t\t\tthis.scene.registerBeforeRender(() => {\n\n\t\t\t\tconst { data } = this.joints;\n\n\t\t\t\tif (modelName == \"Dude.babylon\") {\n\t\t\t\t\tsphere.position.x = 0 + data.head.x;\n\t\t\t\t\tsphere.position.y = 6 + data.head.y;\n\t\t\t\t\tsphere.position.z = 5;\n\n\t\t\t\t\tlookAtCtl.update();\n\n\t\t\t\t\t// Right Arm\n\t\t\t\t\tright_shoulder_bone.rotation = new BABYLON.Vector3(0, data.rightShoulder, 0); // Changed by Sid from 1.5 to 1\n\t\t\t\t\tright_arm_bone.rotation = new BABYLON.Vector3(0, data.rightElbow, 0);\n\n\t\t\t\t\t// Right Leg\n\t\t\t\t\tright_hip_bone.rotation = new BABYLON.Vector3(0, data.rightHip, 0);\n\t\t\t\t\tright_knee_bone.rotation = new BABYLON.Vector3(0, data.rightKnee, 0);\n\n\t\t\t\t\t// Left Arm\n\t\t\t\t\tleft_shoulder_bone.rotation = new BABYLON.Vector3(0, data.leftShoulder, 0); // Changed by Sid from -1.5 to -1\n\t\t\t\t\tleft_arm_bone.rotation = new BABYLON.Vector3(0, data.leftElbow, 0);\n\n\t\t\t\t\t// Left Leg\n\t\t\t\t\tleft_hip_bone.rotation = new BABYLON.Vector3(0, data.leftHip, 0);\n\t\t\t\t\tleft_knee_bone.rotation = new BABYLON.Vector3(0, data.leftKnee, 0);\n\t\t\t\t} else {\n\t\t\t\t\tsphere.position.x = 0 + data.head.x;\n\t\t\t\t\tsphere.position.y = 20 + data.head.y;\n\t\t\t\t\tsphere.position.z = 0;\n\n\t\t\t\t\tlookAtCtl.update();\n\n\t\t\t\t\t// Right Arm\n\t\t\t\t\tright_shoulder_bone.rotation = new BABYLON.Vector3(0, 0, -data.rightShoulder); // Changed by Sid from 1.5 to 1\n\t\t\t\t\tright_arm_bone.rotation = new BABYLON.Vector3(0, data.rightElbow, 0);\n\n\t\t\t\t\t// Right Leg\n\t\t\t\t\tright_hip_bone.rotation = new BABYLON.Vector3(0, 0, data.rightHip - Math.PI);\n\t\t\t\t\tright_knee_bone.rotation = new BABYLON.Vector3(0, 0, data.rightKnee);\n\n\t\t\t\t\t// Left Arm\n\t\t\t\t\tleft_shoulder_bone.rotation = new BABYLON.Vector3(0, 0, -data.leftShoulder); // Changed by Sid from -1.5 to -1\n\t\t\t\t\tleft_arm_bone.rotation = new BABYLON.Vector3(0, data.leftElbow, 0);\n\n\t\t\t\t\t// Left Leg\n\t\t\t\t\tleft_hip_bone.rotation = new BABYLON.Vector3(0, 0, data.leftHip - Math.PI);\n\t\t\t\t\tleft_knee_bone.rotation = new BABYLON.Vector3(0, 0, data.leftKnee);\n\t\t\t\t}\n\n\t\t\t\t// Check if user has followed current pose\n\t\t\t\tif (!this.isPerson && this.reactApp.posesDone < 2) {\n\t\t\t\t\t//Check if pose matched!\n\t\t\t\t\tif (this.checkIfPoseMatched()) {\n\t\t\t\t\t\talert(\"Great! You completed pose index: \" + this.reactApp.posesDone + \"\\nNamed: \" + this.joints.data['asanaName']);\n\t\t\t\t\t\tthis.reactApp.posesDone = this.reactApp.posesDone + 1;\n\t\t\t\t\t\tthis.reactApp.show_recorded_pose_having_index(this.reactApp.posesDone);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "302760b402e6829a4016d3593203b4e1", "score": "0.5147567", "text": "setLight() {\n this.pointLight = new THREE.PointLight(0xffffff, 1, 100)\n this.pointLight.position.set(2, 5, 5)\n this.scene.add(this.pointLight)\n }", "title": "" }, { "docid": "58deb3e92a1402037a872711195c7a77", "score": "0.5146038", "text": "function initTHREE() {\n\n\t// renderer\n\trenderer = new THREE.WebGLRenderer( { antialias: true, logarithmicDepthBuffer: true } );\n\trenderer.setSize( window.innerWidth, window.innerHeight );\n\tdocument.getElementById( 'three' ).appendChild( renderer.domElement );\n\n\t// lights!\n\tscene.add( new THREE.AmbientLight( 'rgb(255,255,200)', 0.3 ) );\n\n\tscene.add( new THREE.HemisphereLight( 'deeppink', 'purple', 0.3 ) );\n\n\tfor ( let i = 0; i < 3; i ++ ) {\n\n\t\tlet a = i * ( Math.PI / 1.5 );\n\t\tlet x = - 100000 * Math.cos( a );\n\t\tlet z = 100000 * Math.sin( a );\n\n\t\tlet dLight = new THREE.DirectionalLight( 'white', 0.35 );\n\t\tdLight.position.set( x, 100000, z );\n\n\t\tscene.add( dLight );\n\n\t}\n\n}", "title": "" }, { "docid": "231c1c995c8affa29d03cf574eb74b5b", "score": "0.51441866", "text": "function initLight(scene, renderer) {\n // add hemi lights\n //This will create a hemilight. A hemli light is used for a realistic sun\n var hemiLight = new THREE.HemisphereLight(0xffffff, 0xffffff, 0.05);\n hemiLight.color.setHSL(0.6, 1, 0.6);\n hemiLight.groundColor.setHSL(0.095, 1, 0.75);\n hemiLight.position.set(0, 500, 0);\n scene.add(hemiLight);\n\n // this is the Sun\n dirLight = new THREE.DirectionalLight(0xffffff, 1);\n dirLight.color.setHSL(0.1, 1, 0.95);\n dirLight.position.set(-1, 0.75, 1);\n scene.add(dirLight);\n // dirLight.shadowCameraVisible = true;\n dirLight.castShadow = true;\n dirLight.shadowMapWidth = dirLight.shadowMapHeight = 1024 * 2;\n var d = 30;\n dirLight.shadowCameraLeft = -d;\n dirLight.shadowCameraRight = d;\n dirLight.shadowCameraTop = d;\n dirLight.shadowCameraBottom = -d;\n\n // the magic is here - this needs to be tweaked if you change dimensions\n dirLight.shadowCameraFar = 3500;\n dirLight.shadowBias = -0.000001;\n dirLight.shadowDarkness = 0.35;\n scene.add(dirLight);\n scene.fog = new THREE.Fog(0x222233, 0, 20000);\n renderer.setClearColor(scene.fog.color, 1);\n\n var vertexShader = document.getElementById('vertexShader').textContent;\n var fragmentShader = document.getElementById('fragmentShader').textContent;\n var uniforms = {\n topColor: {type: \"c\", value: new THREE.Color(0x0077ff)},\n bottomColor: {type: \"c\", value: new THREE.Color(0xffffff)},\n offset: {type: \"f\", value: 33},\n exponent: {type: \"f\", value: 0.6}\n };\n\n //This will create the sky. It will be blue when the sun is up and black when its night\n uniforms.topColor.value.copy(hemiLight.color);\n scene.fog.color.copy(uniforms.bottomColor.value);\n var skyGeometry = new THREE.CubeGeometry(5000, 5000, 5000);\n var skyMat = new THREE.ShaderMaterial({\n vertexShader: vertexShader,\n fragmentShader: fragmentShader,\n uniforms: uniforms,\n side: THREE.BackSide\n });\n sky = new THREE.Mesh(skyGeometry, skyMat);\n scene.add(sky);\n\n }", "title": "" }, { "docid": "f4ee0858065e832a9dda2b584350852e", "score": "0.5122296", "text": "function init() {\n canvas = $('#canvas')[0];\n context = canvas.getContext(\"2d\");\n imageBuffer = context.createImageData(canvas.width, canvas.height); //buffer for pixels\n\n loadSceneFile(\"assets/SphereTest.json\");\n}", "title": "" }, { "docid": "d850183fd37b01bc6feda1895ff8afb1", "score": "0.5119216", "text": "startMaterials() {\r\n this.redAppearence = new CGFappearance(this.scene);\r\n this.redAppearence.setAmbient(0.3, 0.3, 0.3, 1);\r\n this.redAppearence.setDiffuse(0.9, 0.9, 0.9, 1);\r\n this.redAppearence.setSpecular(0.1, 0.1, 0.1, 1);\r\n this.redAppearence.setShininess(10);\r\n this.redAppearence.loadTexture(\"scenes/images/red.jpg\");\r\n\r\n this.greyAppearence = new CGFappearance(this.scene);\r\n this.greyAppearence.setAmbient(0.3, 0.3, 0.3, 1);\r\n this.greyAppearence.setDiffuse(0.9, 0.9, 0.9, 1);\r\n this.greyAppearence.setSpecular(0.1, 0.1, 0.1, 1);\r\n this.greyAppearence.setShininess(10);\r\n this.greyAppearence.loadTexture(\"scenes/images/dark-grey.jpg\");\r\n }", "title": "" }, { "docid": "5c9b8e638b3034efd8d6198a4b457e70", "score": "0.5115835", "text": "function XMLscene(interface)\n{\n CGFscene.call(this);\n\n this.interface = interface;\n\n this.lightValues = {};\n\n let d = new Date();\n\n this.time = d.getTime();\n\n this.elapsedTime = 0;\n\n this.cameras = [];\n\n this.camerasID = [];\n\n this.file = null;\n\n //holds normal dice and rotated dice\n this.dicesMatrix = [];\n\n this.activeCameraIndex = 0;\n\n this.selectables = [];\n\n this.toShade = [];\n\n this.shaders = [];\n\n this.resetingPieces = [];\n\n this.resetTime = 0;\n\n this.pickID = 0;\n\n this.height = 0;\n\n this.lookAtDicesTime = 1.5;\n\n this.cameraTransitionsSpeed = null;\n\n this.pieceAnimationSpeed = null;\n\n this.rotatedOnce = [false, false, false, false];\n\n this.dicesResult = [true, true, true, true];\n\n this.diceToIndex =\n {\n 'Dice-1': 0,\n 'Dice-2': 1,\n 'Dice-3': 2,\n 'Dice-4': 3\n };\n\n this.numberOfSteps = 0;\n\n this.cameraTransition = null;\n\n this.game = new GameLogic();\n\n this.nFrames = 0;\n}", "title": "" }, { "docid": "ed7169ba6f780fc60db9eff82d75d245", "score": "0.5100413", "text": "initLedMatrix() {\n this.matrix = new LedMatrix(this.config.ledMatrix.rows, this.config.ledMatrix.columns, this.config.ledMatrix.chainedDisplays, this.config.ledMatrix.parallelDisplays, this.config.ledMatrix.brightness, this.config.ledMatrix.hardwareMapping);\n }", "title": "" }, { "docid": "f90d6bec90e85b1cf8133b736c93c5d1", "score": "0.50986147", "text": "function fillScene() {\n\tscene = new THREE.Scene();\n\n\tvar light = new THREE.DirectionalLight( 0xffffff, 0.7 );\n\tlight.position.set( 200, 200, 200 );\n\tscene.add( light );\n\tlight = new THREE.DirectionalLight( 0xffffff, 0.7 );\n\tlight.position.set(-200,200,-200);\n\tscene.add(light);\n\n\tgridXZ = new THREE.GridHelper(2000, 100, new THREE.Color(0xCCCCCC), new THREE.Color(0x888888));\n\tscene.add(gridXZ);\n\n\tvar shaderResolution, color, fieldNum, position;\n\tfor(j=0; j<5; j++){\n\t\tfor(i=0; i<5; i++){\n\t\t\tshaderResolution = new THREE.Vector2(50,50);\n\t\t\tcolor = new THREE.Vector3(Math.random(),Math.random(),Math.random());\n\t\t\tfieldNum = random(0,7);\n\t\t\tposition = new THREE.Vector3(40*(2-j),0,40*(i-2));\n\t\t\tcreateShaderObject(shaderResolution, color, fieldNum, position);\n\t\t}\n\t}\n\n\n\n}", "title": "" }, { "docid": "3d0405df88a85c05399a5ad4d65f9b8d", "score": "0.50928134", "text": "function Scene() {\n\t// initialization\n\tvar _camera = new Camera(\"MyCamera\");\n\tvar _sun = null;\n\tvar _entities = new ObjectManager();\n\tvar _lights = new ObjectManager();\n\t\n\tvar sceneReadyEvent = new CustomEvent(\"scene-ready\");\n\t\n\t// prepare entities\n\tvar loader = new OBJLoader();\n\tvar meshes = loader.load(\"\", \"spartan\", null);\n\tvar material = new Material(\"entityMaterial\");\t\n\t\t\n\t// prepare lights\n\tvar sun = new Light(\n\t\tnew Vector3f(1000, 5000, 1000), \n\t\tnew Vector3f(1.3, 1.3, 1.3)\n\t);\n\t\n\t_lights.add(sun);\n\t\n\t// prepare entities\n\tvar entityTexture = new Texture(\"spartanTexture\", \"spartan.png\");\n\tmaterial.setDiffuseMap(entityTexture);\n\tvar model = new Model(\"entityModel\", meshes, material);\n\tvar entity = new Entity(\"entity\", model, new Vector3f(0, 0, 0));\n\t\n\t_entities.add(entity);\n\t\n\t// methods\n\tthis.getCamera = function() {\n\t\treturn _camera;\n\t}\n\t\n\tthis.getEntities = function() {\n\t\treturn _entities;\n\t}\n\t\n\tthis.getLights = function() {\n\t\treturn _lights;\n\t}\n\t\n\tthis.getSun = function() {\n\t\treturn _sun;\n\t}\n}", "title": "" }, { "docid": "eb593039f634027adc840e53e6653113", "score": "0.5091056", "text": "function initSliderColors(){\n sliderFill(red);\n sliderFill(green);\n sliderFill(blue);\n}", "title": "" }, { "docid": "4064a982a53e09a12a99570deb795387", "score": "0.50872284", "text": "function initGL() {\n var prog = createProgram(gl, \"vshader-source\", \"fshader-source\");\n gl.useProgram(prog);\n gl.enable(gl.DEPTH_TEST);\n\n /* Get attribute and uniform locations */\n\n a_coords_loc = gl.getAttribLocation(prog, \"a_coords\");\n a_normal_loc = gl.getAttribLocation(prog, \"a_normal\");\n gl.enableVertexAttribArray(a_coords_loc);\n gl.enableVertexAttribArray(a_normal_loc);\n\n u_modelview = gl.getUniformLocation(prog, \"modelview\");\n u_projection = gl.getUniformLocation(prog, \"projection\");\n u_normalMatrix = gl.getUniformLocation(prog, \"normalMatrix\");\n u_material = {\n diffuseColor: gl.getUniformLocation(prog, \"material.diffuseColor\"),\n specularColor: gl.getUniformLocation(prog, \"material.specularColor\"),\n emissiveColor: gl.getUniformLocation(prog, \"material.emissiveColor\"),\n specularExponent: gl.getUniformLocation(prog,\n \"material.specularExponent\")\n };\n u_lights = new Array(6);\n for (var i = 0; i < 6; i++) {\n u_lights[i] = {\n enabled: gl.getUniformLocation(prog, \"lights[\" + i + \"].enabled\"),\n position: gl.getUniformLocation(prog, \"lights[\" + i + \"].position\"),\n color: gl.getUniformLocation(prog, \"lights[\" + i + \"].color\"),\n spotDirection: gl.getUniformLocation(prog, \"lights[\" + i +\n \"].spotDirection\"),\n spotCosineCutoff: gl.getUniformLocation(prog, \"lights[\" + i +\n \"].spotCosineCutoff\"),\n spotExponent: gl.getUniformLocation(prog, \"lights[\" + i +\n \"].spotExponent\"),\n attenuation: gl.getUniformLocation(prog, \"lights[\" + i +\n \"].attenuation\")\n };\n }\n\n gl.uniform3f(u_material.specularColor, 0.1, 0.1, 0.1); // specular properties don't change\n gl.uniform1f(u_material.specularExponent, 16);\n gl.uniform3f(u_material.emissiveColor, 0, 0, 0); // default, will be changed temporarily for some objects\n\n\n for (var i = 1; i < 6; i++) { // set defaults for lights\n gl.uniform1i(u_lights[i].enabled, 0);\n gl.uniform4f(u_lights[i].position, 0, 0, 1, 0);\n gl.uniform1f(u_lights[i].spotCosineCutoff, 0); // not a spotlight\n gl.uniform3f(u_lights[i].spotDirection, 0, 0, -1);\n gl.uniform1f(u_lights[i].spotExponent, 5);\n gl.uniform1f(u_lights[i].attenuation, 0); // no attenuation\n gl.uniform3f(u_lights[i].color, 1, 1, 1);\n }\n\n gl.uniform1i(u_lights[0].enabled, 1); // viewpoint light\n gl.uniform4f(u_lights[0].position, 0, 0, 0, 1); // positional, at viewpoint\n gl.uniform3f(u_lights[0].color, 0.2, 0.2, 0.2); // dim\n\n gl.uniform1i(u_lights[1].enabled, 1); // the sun during the day, the lamp at night\n\n gl.uniform1f(u_lights[2].spotCosineCutoff, Math.cos(Math.PI / 8)); // lights 2 and 3 are headlights,\n gl.uniform1f(u_lights[3].spotCosineCutoff, Math.cos(Math.PI / 8)); // which are spotlights\n gl.uniform3f(u_lights[2].color, 0.5, 0.5, 0.4);\n gl.uniform3f(u_lights[3].color, 0.5, 0.5, 0.4);\n\n gl.uniform1f(u_lights[4].spotCosineCutoff, Math.cos(Math.PI / 8)); // lights 2 and 3 are headlights,\n gl.uniform1f(u_lights[5].spotCosineCutoff, Math.cos(Math.PI / 8)); // which are spotlights\n gl.uniform3f(u_lights[4].color, 0.5, 0.5, 0.4);\n gl.uniform3f(u_lights[5].color, 0.5, 0.5, 0.4);\n\n // Note: position and spot direction for lights 1 to 4 are managed by modeling transforms.\n\n} // end initGL()", "title": "" }, { "docid": "bc8290e79a8d686a2daee499a27008e3", "score": "0.50871456", "text": "function init() {\n camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 5000);\n camera.position.y = -800;\n camera.position.z = 550;\n scene = new THREE.Scene();\n var ambientLight = new THREE.AmbientLight(0x0000ff, 0.8);\n scene.add(ambientLight);\n var pointLight = new THREE.PointLight(0xff0000, 0.8);\n camera.add(pointLight);\n scene.add(camera);\n renderer = new THREE.WebGLRenderer({\n antialias: true\n });\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.setSize(window.innerWidth/1.2, window.innerHeight/1.2);\n $(\"#scene-holder\").append(renderer.domElement);\n window.addEventListener('resize', onWindowResize, false);\n}", "title": "" } ]
02d543fa223ef66dcd6628516e19d370
sourceName: name of the Source type: pre or post src: source as string
[ { "docid": "3c75d0d14aac57af5fffa2da4051c2bc", "score": "0.0", "text": "function loadFeedHook(sourceName, type, src) {\n const m;\n try {\n m = requireFromString(src);\n } catch(e) {\n debug(\"Error loading feed hook: \" + e);\n return null;\n }\n moduleCache[sourceName + ':' + type] = m;\n return m;\n}", "title": "" } ]
[ { "docid": "13b5f2bf03a1017f99db85c1302e742d", "score": "0.7204237", "text": "function source_fn() {\n setVisibility(\"src\");\n inputType = \"Source\";\n}", "title": "" }, { "docid": "324d492d2ef298ffc9eae0529204275c", "score": "0.7022953", "text": "get source() {\n return this.getStringAttribute('source');\n }", "title": "" }, { "docid": "aad761af16d5a177dd5239f4760ad7f8", "score": "0.69499874", "text": "get name () { return Metadata.getClassMetaValue(Object.getPrototypeOf(this), 'source', 'name'); }", "title": "" }, { "docid": "b84292092d3a0c417e6f149f7f451131", "score": "0.68649423", "text": "setSource(source){\n \n if(source === undefined)\n return;\n \n this.source = source;\n \n }", "title": "" }, { "docid": "9d94c3404c6ae61e3caa75efb6f9cdb0", "score": "0.6485564", "text": "get source () {\n\t\treturn this._source;\n\t}", "title": "" }, { "docid": "9d94c3404c6ae61e3caa75efb6f9cdb0", "score": "0.6485564", "text": "get source () {\n\t\treturn this._source;\n\t}", "title": "" }, { "docid": "0c6b65b47bbfcf089b4bed0428757b9c", "score": "0.64774716", "text": "get source() {\n\t\treturn this._source;\n\t}", "title": "" }, { "docid": "e4f51c4ca3c3558f59ae3c1464408d76", "score": "0.64188445", "text": "addSource(source) {\n this._data.source = source;\n }", "title": "" }, { "docid": "64f24c2308a3ae659d726298dbc200af", "score": "0.63895077", "text": "get source() {\n\t\treturn this.__source;\n\t}", "title": "" }, { "docid": "64f24c2308a3ae659d726298dbc200af", "score": "0.63895077", "text": "get source() {\n\t\treturn this.__source;\n\t}", "title": "" }, { "docid": "64f24c2308a3ae659d726298dbc200af", "score": "0.63895077", "text": "get source() {\n\t\treturn this.__source;\n\t}", "title": "" }, { "docid": "ce4e65cfdd1545e6e9781ad5cff15347", "score": "0.6360035", "text": "set source(source) {\n this._source = source;\n this._shortsrc = Lua_1.Lua.oChunkid(source);\n }", "title": "" }, { "docid": "eea8ad3f44d9874de8cacc148a96d8e6", "score": "0.6286834", "text": "updateSource(source) {\n this.set('source', source);\n }", "title": "" }, { "docid": "1d404f57d7946e469d877ffb27ec7383", "score": "0.62734264", "text": "static get properties(){return{source:{name:\"source\",type:\"String\",reflectToAttributes:!0,observer:\"_sourceChanged\"},caption:{name:\"caption\",type:\"String\",reflectToAttributes:!0}}}", "title": "" }, { "docid": "0ce95af1174eaf645ac50837531c93fd", "score": "0.6246067", "text": "function getSource(name) {\r\n var sources = localStorage.getObject('sources');\r\n var selected_name = name.split('::');\r\n var category = selected_name[0], source_name = selected_name[1];\r\n\r\n for (var i in sources) {\r\n if (i == category) {\r\n for (var j in sources[i]) {\r\n if (j == source_name) {\r\n sources[i][j].category = i;\r\n sources[i][j].name = j;\r\n return sources[i][j];\r\n }\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n}", "title": "" }, { "docid": "ab5859fddba74728eb75aed234be5c0b", "score": "0.62045264", "text": "changeSource(source) {\n\t\tthis.info.source = source\n\t\tthis.config.source = source\n\t}", "title": "" }, { "docid": "84c6e3e575e0e0e950dbacc7ecc1f731", "score": "0.61099994", "text": "function newSource(source) {\n return {\n type: constants.ADD_SOURCE,\n source: source\n };\n}", "title": "" }, { "docid": "a70d493a9055d3f8e681f2e568801afc", "score": "0.608925", "text": "onChangeSource(newSourceName) {\n\t\tvar sources = this.props.sources;\n\n\t\tfor(let source in sources) {\n\n\t\t\tlet sourceName = sources[source].sourceName;\n\n\t\t\tif(sourceName === newSourceName) {\n\n\t\t\t\tthis.setState({\n\t\t\t\t\tcurrentSource: sources[source],\n\t\t\t\t\tcurrentCategory: sources[source].categories[0]\n\t\t\t\t});\n\n\t\t\t}\n\n\t\t}\n\t}", "title": "" }, { "docid": "80d5b555093fa363bfd4632c64d9466c", "score": "0.6082754", "text": "function setSource(newSource) {\n\n source = newSource;\n\n // TODO: fix lazy loading!\n //if (isRendered) {\n // renderSource();\n //}\n renderSource();\n\n }", "title": "" }, { "docid": "b3492099a4f03d25b550cef3628cb79b", "score": "0.60570747", "text": "function changeSource() {\n if (event) {\n\t if (event.target.innerText==\"Feedr\") {\n\t \tsourceName = sourceNames[0];\n\t } else {\n\t \tsourceName = event.target.innerText;\n\t }\n }\n document.getElementById(\"sourceName\").innerHTML = sourceName;\n if (dataCache[sourceName]) {\n \tfor (var i=0; i<sourceNames.length; i++) {\n \t\tif (sourceName!=sourceNames[i]) {\n \t\t\tfor (var j=0; j<dataCache[sourceNames[i]].length; j++) {\n \t\t\t\thideArticle(sourceNames[i],j);\t\n \t\t\t}\n \t\t} else {\n \t\t\tfor (var j=0; j<dataCache[sourceNames[i]].length; j++) {\n \t\t\t\tshowArticle(sourceNames[i],j);\t\n \t\t\t}\n \t\t}\n \t}\n }\n}", "title": "" }, { "docid": "4a456365eb44d11fac732e74660cfa5d", "score": "0.60474515", "text": "function src() {\n prev = -1;\n type = 1; //For source type is equal to one\n flag1 = 1;\n}", "title": "" }, { "docid": "a23728bd0c11ef0e05857e1feceba260", "score": "0.60163856", "text": "function getSource()/*:Object*/ {\n return this._source$aqE4;\n }", "title": "" }, { "docid": "51d7ea0c28a936138eba91819ddc7f7a", "score": "0.59850156", "text": "onChangeSource(e) {\n\t\tthis.props.onChangeSource(e.target.value);\n\t}", "title": "" }, { "docid": "67b92feafef6bea768701aea5d39469d", "score": "0.59550667", "text": "constructor(source)\n\t{\n\t}", "title": "" }, { "docid": "7b0a42afc7a91afc8b06d6411075a069", "score": "0.59069043", "text": "set source(value) {\n this.imageSource = value;\n this.isDirt = true;\n }", "title": "" }, { "docid": "22ecf120e6a9d00e449146bb90544077", "score": "0.588744", "text": "function handleSourceChange(sourceCode, sourceName) {\n basicMsg(\"Loading...\");\n $(\"#countriesList\").prop('selectedIndex', 0);\n $(\"#sourcesList\").val(sourceCode);\n\n if (sourceCode === 'All') {\n displayFilterValues('ALL', '');\n showAllNews();\n return;\n }\n\n displayFilterValues('SOURCE -', sourceName)\n\n const url = 'news/bySource/' + sourceCode + '?socketId=' + getSocketId();\n displayNewsInfo(url, sourceCode);\n}", "title": "" }, { "docid": "5f843820a2f9d4a4422c38bb2dc7da1c", "score": "0.5847883", "text": "function onShowSource() {\n resetPageState();\n\n document.querySelector('.source_con > .source').value = generateClickimageSource(true);\n document.querySelector('.page').classList.add('source');\n }", "title": "" }, { "docid": "deec291a2f56a1ddad17eb902d8be90b", "score": "0.58393157", "text": "sourcePropertyName (propertyName) {\n return propertyName;\n }", "title": "" }, { "docid": "76a679575dc4a6dfcd205b3f2b48a08d", "score": "0.58327854", "text": "function setSource(newSource) {\n\t\t\tsource = newSource;\n\n\t\t\t// TODO: fix lazy loading!\n\t\t\tif (isRendered) {\n\t\t\t\trenderSource();\n\t\t\t}\n\t\t\t// renderSource();\n\t\t}", "title": "" }, { "docid": "e5725d7758952254ef3ba0c161c7b4c5", "score": "0.5801544", "text": "source() {\n return internal(this).source;\n }", "title": "" }, { "docid": "8976a5e8f2baed783a48d4a3068ebec6", "score": "0.57974666", "text": "getSource() {\n const child = this.oneChild();\n if (child) {\n return child.getSource();\n }\n return this._source;\n }", "title": "" }, { "docid": "11c86e8890640d05ce87fdc04277a82a", "score": "0.5792933", "text": "get source() {\n return this.imageSource;\n }", "title": "" }, { "docid": "4c2ead37505c857633b8126f26ad85ba", "score": "0.5792131", "text": "static get properties(){return{source:{name:\"source\",type:\"String\"},hasSource:{name:\"hasSource\",type:\"Boolean\",computed:\"_calculateHasSource(source)\"},markdown:{name:\"markdown\",type:\"String\"}}}", "title": "" }, { "docid": "582923ccdd8a7b5418d9cfca02ce788e", "score": "0.5763595", "text": "function getSource(v, record) {\n if (record.geonet_info && record.geonet_info.source) {\n return record.geonet_info.source[0].value;\n } else {\n return '';\n }\n }", "title": "" }, { "docid": "b8061cf4af94de0626c85f926af6528e", "score": "0.5760634", "text": "function matchesSource(request) {\n console.log(\"matchesSource\")\n return (request.source === SOURCE);\n }", "title": "" }, { "docid": "b94985732620f795b2b8bf3ab5d72808", "score": "0.57426864", "text": "get source() {\r\n if (this.text.includes(\"live\") || this.text.includes(\"now\")) {\r\n return \"live_event\";\r\n }\r\n else if (this.text.includes(\"goal\") || this.text.includes(\"achieve\")) {\r\n return \"achievement\";\r\n }\r\n else if (this.text.includes(\"completed\") || this.text.includes(\"posted\")) {\r\n return \"completed_event\";\r\n }\r\n return \"miscellaneous\";\r\n }", "title": "" }, { "docid": "7bbbecb159f7419a50992b0a0253acc9", "score": "0.5718814", "text": "function resolve_src(src) {\n var stream;\n let subind, i;\n // Source() literal reference\n if (jt.instance_of(src, '$Collection.$Timestep.Source')) { // if source stream reference\n stream = this.resolve_src(src.inputs[0]);\n return stream;\n // Import() to pull sources from other timesteps\n } else if (jt.instance_of(src, '$Collection.$Timestep.Import')) {\n subind = this.create_indicator(src);\n stream = subind.output_stream;\n return stream;\n // Ind() nested indicator\n } else if (jt.instance_of(src, '$Collection.$Timestep.Ind')) {\n subind = this.create_indicator(src);\n stream = subind.output_stream;\n if (src.options.sub) stream = (_.isArray(src.options.sub) ? src.options.sub : [src.options.sub]).reduce((str, key) => str.substream(key), stream);\n return stream;\n // Stream-typed src is already a stream\n } else if (src instanceof Stream || _.isObject(src) && _.isFunction(src.get)) {\n return src;\n // named source to look up in collection.sources\n } else if (_.isString(src)) {\n let full_path = src.split('.');\n let src_path, sub_path, target;\n for (i = 0; i <= full_path.length - 1; i++) {\n src_path = full_path.slice(0, i + 1);\n sub_path = full_path.slice(i + 1);\n // check if src is a collection input source\n target = _.get(coll.config.inputs, src_path.join('.'));\n if (target && jt.instance_of(target, '$Collection.$Timestep.Input')) {\n if (!target.stream) throw new Error('A stream has not be defined for input: ' + src_path.join('.'));\n stream = target.stream;\n break;\n }\n // check if src is a source already created\n target = _.get(coll.sources, src_path.join('.'));\n if (target && target.root instanceof Stream) {\n stream = target;\n break;\n }\n // check if src is a source that is defined but not yet created\n target = _.get(coll.config.indicators, src_path.join('.'));\n if (target && jt.instance_of(target, '$Collection.$Timestep.SrcType')) {\n stream = Deferred({\n src_path: src_path,\n src_sub_path: sub_path\n });\n break;\n }\n }\n if (!stream) throw Error('Unrecognized stream source: ' + src);\n // follow substream path if applicable\n if (!(stream instanceof Deferred) && sub_path.length > 0) {\n stream = sub_path.reduce((str, key) => str.substream(key), stream);\n }\n return stream;\n } else if (src instanceof Deferred) {\n return src;\n } else {\n throw new Error('Unexpected source defined for indicator: ' + JSON.stringify(src));\n }\n }", "title": "" }, { "docid": "048f58b70941735534612b1bdcd664e3", "score": "0.57037365", "text": "function source(re) {\n return (re && re.source) || re;\n }", "title": "" }, { "docid": "981abc89e5c94e72a0cb0587c3863423", "score": "0.5697982", "text": "function sourcesText(sources) {\n if (sources == 1) {\n sources = \"1 source\";\n }\n else if (sources < 20) {\n sources = sources + \" sources\";\n }\n else {\n sources = \"20+ sources\";\n }\n return sources;\n}", "title": "" }, { "docid": "c9b553a3eabddfe0c48b96ab50c99eac", "score": "0.56902355", "text": "function isSource(source) {\n return Object(_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(source, Source);\n}", "title": "" }, { "docid": "a6d21879b552cf6fe3f1d7b7af9768fa", "score": "0.56886894", "text": "function isSource(source) {\n return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_3__.default)(source, Source);\n}", "title": "" }, { "docid": "a6d21879b552cf6fe3f1d7b7af9768fa", "score": "0.56886894", "text": "function isSource(source) {\n return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_3__.default)(source, Source);\n}", "title": "" }, { "docid": "9c2e8c3746d2d36819bae4fdec4b9ba7", "score": "0.568098", "text": "function source(re) {\n return (re && re.source) || re\n }", "title": "" }, { "docid": "e0a93131891267c5cf80de557e412dd3", "score": "0.5679438", "text": "function getSource(options) {\n return String(options.model.data.get(options.mimeType));\n }", "title": "" }, { "docid": "043ae79bcf6dbf59ba80143f7fad6b46", "score": "0.5663298", "text": "function setSource(aSrc) {\n\n\tdocument.getElementById('frmFacturation').hdnSource.value = aSrc;\n\tdocument.getElementById('frmFacturation').submit();\n\n}", "title": "" }, { "docid": "7ca2a1247228cbd8c3a2ecef19de2a7e", "score": "0.56420153", "text": "function readSource(source) {\n\t\tthis.sourceList = [];\n var tempSource = source.split(\"\\n\");\n\t\ttry {\n for(i=0; i<tempSource.length; i++){\n sourceList.push(tempSource[i]);\n }\n\t\t} catch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t\treturn;\n\t}", "title": "" }, { "docid": "8798806b26eb727e60ab740990180bbf", "score": "0.5639595", "text": "function isSource(source) {\n return instanceOf(source, Source);\n}", "title": "" }, { "docid": "ae84a05028a557316704260c58e957a5", "score": "0.5598809", "text": "get sourceButton() {\n return { type: \"rich-text-editor-source-code\" };\n }", "title": "" }, { "docid": "c2c5a72f0fed822850ee34a62f1b11ea", "score": "0.5567421", "text": "function generateDynamicSourceBindings(sourceName)\r\n{\r\n var retVal = new Array();\r\n\r\n var siteURL = dw.getSiteRoot();\r\n\r\n //For localized object name\r\n if (sourceName != \"URL\")\r\n {\r\n sourceName = \"URL\";\r\n }\r\n\r\n if (siteURL.length)\r\n {\r\n var bindingsArray = dwscripts.getListValuesFromNote(siteURL, sourceName);\r\n retVal = getDataSourceBindingList(bindingsArray, \r\n DATASOURCELEAF_FILENAME,\r\n true,\r\n \"URL.htm\");\r\n }\r\n\r\n return retVal;\r\n}", "title": "" }, { "docid": "55e32eca40953a53017343775af8247f", "score": "0.55528677", "text": "get sourceId() {\n\t\treturn this.__sourceId;\n\t}", "title": "" }, { "docid": "2d1216801e3715e7e320cbfe7afbb6ae", "score": "0.5551094", "text": "addSource(details){\n //if the source already exists then delete it\n if (this.map.getSource(details.id)) this.removeSource(details.id);\n this.map.addSource(details.id, details.source);\n }", "title": "" }, { "docid": "b46b4a797b6235f6ed1bf8858a554cd0", "score": "0.5550438", "text": "function source() {\n return {\n url: '',\n url2: '',\n urlBypass: false,\n articleBypass: false,\n callback: ''\n };\n}", "title": "" }, { "docid": "b6adf1f46933fe05c7de133f57f30015", "score": "0.5545457", "text": "function setPlayerSource(source) {\n playerSource = source;\n }", "title": "" }, { "docid": "df5c1f147842ad6547455a3f4d86af3b", "score": "0.5545253", "text": "_calculateHasSource(source){if(source&&\"\"!=source){return!0}this.source=null;return!1}", "title": "" }, { "docid": "c68e9c344112956cfb0195103fd07ac1", "score": "0.5543795", "text": "function addSource(data) {\n return fetch({\n url: 'source/create',\n method: 'POST',\n data\n });\n}", "title": "" }, { "docid": "5331663697958183f3783ed3922dbe85", "score": "0.5538643", "text": "function addSourceInfo(src) {\n const parent = findSourceInfo();\n if (parent === null) { return; }\n addSourceInfoContents(parent, src, true);\n }", "title": "" }, { "docid": "a8e05dc9867d6e5ccc8673b478d29152", "score": "0.5495588", "text": "function setSrc(node) {\n wss.sendEvent(srcMessage, {\n id: node.id,\n type: node.type\n });\n flash.flash('Source node: ' + node.id);\n }", "title": "" }, { "docid": "4b1d167a3737c5a344b981b6c2490639", "score": "0.54773986", "text": "function Source() {\n _classCallCheck(this, Source);\n\n Source.initialize(this);\n }", "title": "" }, { "docid": "338439c03967857530a36f4e94947bd2", "score": "0.54740685", "text": "function process_file_source(response){\n var filename = response['filename'];\n filename = filename.replace(/\\\\/g, '/');\n var source = response['text'];\n var revision = response['Revision'];\n $('#source').attr('value', filename);\n $('#source').html('<pre class=\"brush:python;\">' + source + '</pre>');\n $('#source-name').text(filename);\n $('#source-name').attr('title', filename);\n $('#source-revision').text(revision);\n $('#txt-diff-version').prop('value', '');\n $('#diff-cov').text('');\n $('#chk-show-diff').prop('checked', false);\n SyntaxHighlighter.highlight();\n}", "title": "" }, { "docid": "45de2ede15a49df3f726240ca5dd8f66", "score": "0.54516906", "text": "function DescrToSource() {\n if (!IsObject(this) || !ObjectIsTypeDescr(this))\n ThrowTypeError(JSMSG_INCOMPATIBLE_PROTO, \"Type\", \"toSource\", \"value\");\n\n return DESCR_STRING_REPR(this);\n}", "title": "" }, { "docid": "65c67cd808bec2c94a62a4b0a639cb07", "score": "0.54447687", "text": "function setSrc(node, type) {\n if (type == 'single') {\n wss.sendEvent(srcMessage, {\n id: node.id\n });\n\n flash.flash('Source node: ' + node.id);\n\n } else {\n node.forEach( function (val, idx) {\n wss.sendEvent(srcMessage, {\n id: val\n });\n\n flash.flash('Source node: ' + val);\n } );\n }\n }", "title": "" }, { "docid": "1d7364b7d87f91a74790a0edd235b9e6", "score": "0.5437736", "text": "get source(){\n return this.orderInfo.source.name;\n }", "title": "" }, { "docid": "7c803c52f4ed9fd09a127f219a4a93f5", "score": "0.54363436", "text": "function selectSource() {\n fileSource = document.getElementById(\"cksource\").files[0]; \n\n selectFile(\"cksource\",function (text) {\n\tsource = cleanLatexStress(text);\n });\n}", "title": "" }, { "docid": "567fcaaeb55f3cdd0d43622b35c4171d", "score": "0.53893703", "text": "writeSourceToEditor(source) {\n if (source === null)\n source = ''\n\n this.writeProgramToEditor(source)\n }", "title": "" }, { "docid": "98263d81410b04f5b9e2307234a8239f", "score": "0.5387574", "text": "function postToSource() {\n // clear unnecessary tags when editor view empty\n var sourceStrings = editor.text() == \"\" && editor.html().length < 12 ? \"\" : editor.html();\n var value = extractToText(sourceStrings);\n thisElement.val(value);\n }", "title": "" }, { "docid": "7972647f71200d4cfe787b840a142ed1", "score": "0.53815985", "text": "function xmpGetSource () {\n//console.log(\"xmpGetSource filePath\",filePath);\n execute (\"xmpget source \" + filePath).then (result => {\n notesDia (namepic, filePath, \"Anteckningar till \", result, \"Spara\", \"Spara och stäng\", \"Stäng\");\n hideKeyboard ();\n });\n }", "title": "" }, { "docid": "1fafb238f7d63c7bde8dd2d2428fa821", "score": "0.5376226", "text": "function addSendSourcePropertiesName(active, parent, src) {\n const clientListId = 'export-clientlist-sourcename';\n const mtype = 'table.load.votable';\n\n // What is being exported?\n //\n const whatEl = document.createElement('span');\n addText(whatEl, 'All master-source properties');\n\n // What information is tracked?\n //\n const selected = {target: wwtsamp.TARGET_CLIPBOARD};\n\n const els = createSAMPExport(active, mtype, 'export-samp-sourcename',\n\t\t\t\t clientListId, whatEl, selected);\n\n if (active) {\n els.button.addEventListener('click', (event) => {\n\twwt.trace(`Chosen target: ${selected.target}`);\n\twwtsamp.sendSourcePropertiesName(event, selected.target, src.name);\n }, false);\n }\n\n parent.appendChild(els.container);\n }", "title": "" }, { "docid": "850a8d35d637ccb6da56d7b7a6f57e2e", "score": "0.5376051", "text": "setSourceOwner(aSourceOwner) {\n this.source_owner = aSourceOwner;\n }", "title": "" }, { "docid": "dc7bcb1798943f135fa938e79cdcb8fd", "score": "0.5366562", "text": "addSources(contents) {}", "title": "" }, { "docid": "ebec8fbcea69aabe3f8ea92f54b61a62", "score": "0.53536254", "text": "function handleApiSource(source) {\n setApiSource(allApi[source])\n }", "title": "" }, { "docid": "dd6ac66665eb2a44262dd5ec7cf37e46", "score": "0.5351757", "text": "function createSource(targetData){\n\t//define chart constants\n\tlet svg = d3.select(\".chart\");\n\n\tlet source = svg.append(\"g\")\n\t\t.attr(\"class\", \"source\");\n\tsource.append(\"text\")\n\t\t.attr(\"x\", 10)\n\t\t.attr(\"y\", 310)\n\t\t.attr(\"text-anchor\", \"left\")\n\t\t.style(\"font\", \"10px monospace\")\n\t\t.text(\"Source: \" + targetData.source);\n}", "title": "" }, { "docid": "38c88377ade3cf0c7862c9ab9180c65c", "score": "0.5350583", "text": "setSourceContent(source, sourceContent) {\n\t\t\tthis.assertUnlocked();\n\n\t\t\tif (this.sourceRoot !== undefined) {\n\t\t\t\tsource = ___R$project$rome$$internal$codec$source$map$util_ts$toRelativeUrl(\n\t\t\t\t\tthis.sourceRoot,\n\t\t\t\t\tsource,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (sourceContent !== undefined) {\n\t\t\t\t// Add the source content to the _sourcesContents map.\n\t\t\t\tthis.sourcesContents.set(source, sourceContent);\n\t\t\t} else {\n\t\t\t\t// Remove the source file from the _sourcesContents map.\n\t\t\t\tthis.sourcesContents.delete(source);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "258333f379fcc98904e04a6a6c313659", "score": "0.53490037", "text": "function _getSource() {\n var application = 'axe', version = '', src;\n if (typeof axe !== 'undefined' && axe._audit && !axe._audit.application) {\n application = axe._audit.application;\n }\n if (typeof axe !== 'undefined') {\n version = axe.version;\n }\n src = application + '.' + version;\n return src;\n }", "title": "" }, { "docid": "2feda352a7a1cf269d09cf6bbb4057f5", "score": "0.5334", "text": "function normalizeSource(source) {\n if (source.className) {\n if (typeof source.className == 'string') {\n source.className = source.className.split(/\\s+/);\n }\n }else{\n source.className = [];\n }\n var normalizers = fc.sourceNormalizers;\n for (var i=0; i<normalizers.length; i++) {\n normalizers[i](source);\n }\n }", "title": "" }, { "docid": "ae9126b25ee15358e8ab9e341d0e393f", "score": "0.53212005", "text": "get sourceTags() { return []; }", "title": "" }, { "docid": "e378278568594c6d84115ef010006cd6", "score": "0.5315844", "text": "function SourceNode(aLine,aColumn,aSource,aChunks,aName){this.children=[];this.sourceContents={};this.line=aLine==null?null:aLine;this.column=aColumn==null?null:aColumn;this.source=aSource==null?null:aSource;this.name=aName==null?null:aName;this[isSourceNode]=true;if(aChunks!=null)this.add(aChunks);}", "title": "" }, { "docid": "a61b454784945632340c54c03445b0ac", "score": "0.53049535", "text": "function addSource(_, args, context, info) {\n if( !context.user )\n throw new Error(\"Authentication is required.\");\n\n const { user_payment } = context.user;\n\n\n return stripe.customers.createSource( user_payment, {\n source: args.source\n }, function( err, customer ) {\n if( err ) throw err;\n });\n}", "title": "" }, { "docid": "2c72aa7132e28cbd201c2fd2fac79d8e", "score": "0.5297135", "text": "function onSourceLoad() {\n var con = document.createElement('div');\n con.innerHTML = document.querySelector('.source_con .source').value;\n\n // reset pins\n resetImageState();\n removeAllPins();\n\n try {\n var img = con.querySelector('img');\n\n var coords = [];\n // from data-pins (clickimage.js parsing method)\n if(img.dataset.pins != undefined) coords = parsePinCoordinates(img.dataset.pins); //eslint-disable-line\n // from onload (own method)\n else if(img.getAttribute('onload') != undefined) coords = parsePinCoordinatesFromOnLoad(img);\n\n createPinsFromCoordinates(coords);\n loadPinInfos(con.querySelector('.pininfo').children);\n // get actual src string, without any domain addition (like img.src)\n document.querySelector('.general_edit .image_src').value = img.getAttribute(\"src\");\n document.querySelector('.general_edit .image_invert_colors').checked =\n con.querySelector('.imagebox').classList.contains('invert');\n } catch(e) {\n //TODO display some error\n }\n\n resetPageState();\n }", "title": "" }, { "docid": "1041684f8c71d1809a137f8e2659f748", "score": "0.5291776", "text": "function compileSource(type, source) {\n\t\t\tvar shader = gl.createShader(type);\n\t\t\tgl.shaderSource(shader, source);\n\t\t\tgl.compileShader(shader);\n\t\t\tif(!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\t\t\tthrow 'compile error: ' + gl.getShaderInfoLog(shader);\n\t\t\t}\n\t\t\treturn shader;\n\t\t}", "title": "" }, { "docid": "7e89d98c6dcd6b27fcdf503eaffa52e3", "score": "0.5286586", "text": "lookupDataSource(name) {\n const node = this.component.data.outputNodes[name];\n if (!node) {\n // Name not found in map so let's just return what we got.\n // This can happen if we already have the correct name.\n return name;\n }\n return node.getSource();\n }", "title": "" }, { "docid": "9616ba751645f283d6877bd19c3f1bca", "score": "0.5283177", "text": "function SourceFileRenamer(context)\n{\n this.renamedSourceFiles = [];\n this.context = context;\n this.bps = [];\n}", "title": "" }, { "docid": "3eaa026f84d670ec5459f0f6bb1c50ea", "score": "0.52762467", "text": "dumpSource(filename) {\n const config = this.getConfigFor(filename);\n const resolved = config.resolve();\n const sources = resolved.transformFilename(filename);\n return sources.reduce((result, source) => {\n result.push(`Source ${source.filename}@${source.line}:${source.column} (offset: ${source.offset})`);\n if (source.transformedBy) {\n result.push(\"Transformed by:\");\n result = result.concat(source.transformedBy.reverse().map((name) => ` - ${name}`));\n }\n if (source.hooks && Object.keys(source.hooks).length > 0) {\n result.push(\"Hooks\");\n for (const [key, present] of Object.entries(source.hooks)) {\n if (present) {\n result.push(` - ${key}`);\n }\n }\n }\n result.push(\"---\");\n result = result.concat(source.data.split(\"\\n\"));\n result.push(\"---\");\n return result;\n }, []);\n }", "title": "" }, { "docid": "3d327a37521340223e97442e2142ec0b", "score": "0.5270302", "text": "setSource(source) {\n if (this.source !== source) {\n this.source = source;\n this.drawRegionList();\n }\n }", "title": "" }, { "docid": "06b5be35163b972fc5533368880575cf", "score": "0.52683806", "text": "function getModuleSource(moduleName, type) {\n var shaderModule = Object(__WEBPACK_IMPORTED_MODULE_0__shader_modules__[\"a\" /* getShaderModule */])(moduleName);\n var moduleSource = void 0;\n switch (type) {\n case VERTEX_SHADER:\n moduleSource = shaderModule.vs || shaderModule.vertexShader;\n break;\n case FRAGMENT_SHADER:\n moduleSource = shaderModule.fs || shaderModule.fragmentShader;\n break;\n default:\n __WEBPACK_IMPORTED_MODULE_3_assert___default()(false);\n }\n\n if (typeof moduleSource !== 'string') {\n return '';\n }\n\n return '#define MODULE_' + moduleName.toUpperCase() + '\\n' + moduleSource + '// END MODULE_' + moduleName + '\\n\\n';\n}", "title": "" }, { "docid": "add25775759e3b40fb614d0624a94a93", "score": "0.5258896", "text": "function createSource(...args) {\n return new Source(...args)\n}", "title": "" }, { "docid": "99a4353a8b3fa86927a03cd5aed60d81", "score": "0.5257652", "text": "function loadSource() {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4) {\n if (this.status == 200) {\n loadSrc.innerHTML = this.responseText;\n readSource();\n }\n if (this.status == 404) {\n sourceStatus = failure;\n finishSourceProcessing();\n }\n }\n }\n const proxyurl = \"https://obscure-tor-89730.herokuapp.com/\";\n xhttp.open(\"GET\", proxyurl + urlString, true);\n xhttp.send();\n setStatus(loading);\n}", "title": "" }, { "docid": "1819246a1222cff06cf649bdcc38e778", "score": "0.52447563", "text": "formatSource(source) {\r\n const charDict = this.cache.characterDictionary;\r\n \r\n const formattedSource = source.split(\"\")\r\n .map(char => `(?:${char}${\r\n /\\w/.test(char) && charDict.has(char)\r\n ? `|${charDict.get(char).join(\"|\")}`\r\n : \"\"\r\n })+`)\r\n .join(CENSOR_BYPASS);\r\n \r\n return formattedSource;\r\n }", "title": "" }, { "docid": "facb0f91be2086d60f96ae392a006000", "score": "0.523474", "text": "function getSource() {\n\t var node = this.node;\n\t if (node.end) {\n\t return this.hub.file.code.slice(node.start, node.end);\n\t } else {\n\t return \"\";\n\t }\n\t}", "title": "" }, { "docid": "facb0f91be2086d60f96ae392a006000", "score": "0.523474", "text": "function getSource() {\n\t var node = this.node;\n\t if (node.end) {\n\t return this.hub.file.code.slice(node.start, node.end);\n\t } else {\n\t return \"\";\n\t }\n\t}", "title": "" }, { "docid": "facb0f91be2086d60f96ae392a006000", "score": "0.523474", "text": "function getSource() {\n\t var node = this.node;\n\t if (node.end) {\n\t return this.hub.file.code.slice(node.start, node.end);\n\t } else {\n\t return \"\";\n\t }\n\t}", "title": "" }, { "docid": "facb0f91be2086d60f96ae392a006000", "score": "0.523474", "text": "function getSource() {\n\t var node = this.node;\n\t if (node.end) {\n\t return this.hub.file.code.slice(node.start, node.end);\n\t } else {\n\t return \"\";\n\t }\n\t}", "title": "" }, { "docid": "facb0f91be2086d60f96ae392a006000", "score": "0.523474", "text": "function getSource() {\n\t var node = this.node;\n\t if (node.end) {\n\t return this.hub.file.code.slice(node.start, node.end);\n\t } else {\n\t return \"\";\n\t }\n\t}", "title": "" }, { "docid": "c5031e6c3725b66032ec09fbc19ac158", "score": "0.52263033", "text": "function testGetSource() {\r\n\tvar testStencilSet = new ORYX.Core.StencilSet.StencilSet(\"TestStencilSet\")\r\n\tassertEquals('Stencil set source should be \"TestStencilSet\".', testStencilSet.source(), \"TestStencilSet\")\r\n}", "title": "" }, { "docid": "c248fca5b3fc8b0106d3e1bd1147e30b", "score": "0.5214046", "text": "function addSource(source) {\n $('select').append($('<option>', {\n value: source.id.replace(\":\", \"\"),\n text: source.name\n }));\n $('select option[value=\"' + source.id.replace(\":\", \"\") + '\"]').attr('data-img-src', source.thumbnail.toDataURL());\n refresh();\n }", "title": "" }, { "docid": "4dcc2c188b2f4e063a3e026d158a1c68", "score": "0.5208147", "text": "function SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n }", "title": "" }, { "docid": "92935bf2f1fa81903f1bda36fc3d27cb", "score": "0.5204447", "text": "function VideoPlayer_UpdateSource(theObject)\n{\n\t//only handle this if we arent in screenshots nor in designer\n\tif (!__SCREENSHOTS_ON && !__DESIGNER_CONTROLLER)\n\t{\n\t\t//get our video player\n\t\tvar theHTML = theObject.HTML;\n\t\t//set our src\n\t\ttheHTML.src = String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_VIDEO_SRC]) ? \"\" : __HOST_LESSON_RESOURCES + theObject.Properties[__NEMESIS_PROPERTY_VIDEO_SRC];\n\t\t//are we auto play?\n\t\tif (Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_VIDEO_AUTOPLAY], true))\n\t\t{\n\t\t\t//start playing\n\t\t\ttheHTML.play();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "90265ef2618333974fcb951081a3840f", "score": "0.5202916", "text": "function readName(source, start, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var position = start + 1;\n var code = 0;\n\n while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++position;\n }\n\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_0__.Token(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));\n} // _ A-Z a-z", "title": "" }, { "docid": "90265ef2618333974fcb951081a3840f", "score": "0.5202916", "text": "function readName(source, start, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var position = start + 1;\n var code = 0;\n\n while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++position;\n }\n\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_0__.Token(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));\n} // _ A-Z a-z", "title": "" }, { "docid": "db796c2e70f634f78b75b299b83759c6", "score": "0.52020514", "text": "hasSourceName(sourceName) {\n\n\t\treturn !!this.sourceIds[sourceName];\n\n\t}", "title": "" }, { "docid": "19b7388b805e04fd799568dbc292b1ed", "score": "0.5194434", "text": "function fetchSource(){\n\t\t\t\n\t\t\ttry {\n\n\t\t\t\txhrSrc.open(\"GET\", \"http://localhost:8080/user/booking/sources\", true);\n\t\t\t\txhrSrc.onreadystatechange = processResponseSource;\n\t\t\t\t//\t\t\txhrSrc.setRequestHeader(\"Authorization\", jwtToken);\n\t\t\t\txhrSrc.send(null);\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\talert(e.message);\n\t\t\t\tjsExceptionHandling(e);\n\t\t\t}\n\n }", "title": "" }, { "docid": "b8cb3c0ff9dad7c21de277abeb5ffa3b", "score": "0.5193187", "text": "function getFilename(source, rawSourceURL = getRawSourceURL(source.url)) {\n const {\n id\n } = source;\n\n if (!rawSourceURL) {\n return getFormattedSourceId(id);\n }\n\n const {\n filename\n } = (0, _sourcesTree.getURL)(source);\n return getRawSourceURL(filename);\n}", "title": "" } ]
11e78a098a48344cfb89fbfc3477817c
checks the hiddenWord array for correct letter, to be called during the hide letter function.
[ { "docid": "5abe3c4ac751a0f56df654a6eeb0a2ff", "score": "0.7389905", "text": "function checkLetter(e) {\n if (hiddenWordAsArray.includes(e.target.innerHTML)) {\n for (i=0; i<hiddenWordAsArray.length; i++) {\n if (hiddenWordAsArray[i] === e.target.innerHTML) {\n wordContainer.children[i].innerHTML = e.target.innerHTML\n }\n }\n } else {\n remainingGuesses -= 1;\n drawHangman();\n }\n}", "title": "" } ]
[ { "docid": "629f3e008b14631afc86061033345c3b", "score": "0.7116494", "text": "function makeHidden() {\n\n for (var i = 0; i < wordArr.length; i++) {\n displayedLetters.push(\"_\");\n }\n \n \n}", "title": "" }, { "docid": "248dde76ff526ceb169effa7de6f8510", "score": "0.7061306", "text": "function guessLetter() {\n for (var i = 0; i < hiddenWordArray.length; i++) {\n if (guessMatches(wordArray[i])) {\n hiddenWordArray[i] = userGuess;\n addUsedLetter(userGuess);\n } else {\n addWrongLetter(userGuess);\n }\n }\n hiddenWord = hiddenWordArray.join('');\n return hiddenWord;\n}", "title": "" }, { "docid": "74af6d47d2ff7c402e25bf3b33508ba4", "score": "0.6985896", "text": "function hideWord(secretWord) {\n // var lengthOfWord = secretWord.length;\n // var numberOfGuesses = blank.length;\n for (i = 0; i < secretWord.length; i++) {\n if (secretWord.charAt(i) === \" \" || secretWord.charAt(i) === \".\" || secretWord.charAt(i) === \"-\" || secretWord.charAt(i) === \"'\") {\n hangman[i] = secretWord.charAt(i);\n }\n else {\n hangman[i] = \"_\";\n }\n }\n updateHiddenWord();\n}", "title": "" }, { "docid": "e34d92b2b841b0f9ac7fd2a28ad57645", "score": "0.6977299", "text": "function hideAnswer (callback) {\n let word = document.querySelectorAll('.hiddenAnswerWord')\n let normal = /[a-zA-Z]/\n theAnswerArray.forEach(function (letter) {\n if (letter.match(normal)) {\n let div = document.createElement('div')\n div.textContent = letter\n div.classList.add('hiddenAnswer')\n word[currentWord].appendChild(div)\n winNumber++\n } else if (letter === ' ') {\n currentWord++\n } else {\n let div = document.createElement('div')\n div.textContent = letter\n div.classList.add('unhiddenAnswer')\n div.style.borderBottom = 'none'\n word[currentWord].appendChild(div)\n }\n })\n checkWin() //if string doesn't have anything to guess\n callback()\n}", "title": "" }, { "docid": "7ce2f0ece91ab065e79f5605f48b2a69", "score": "0.69689804", "text": "function revealLetter(input) {\n if (wordArr.indexOf(input) > -1) {\n for (var i = 0; i < wordArr.length; i++) {\n if (wordArr[i] == input) {\n displayedLetters[i] = input;\n console.log(\"arr: \" + wordArr);\n \n }\n }\n }\n}", "title": "" }, { "docid": "24c0258e2761374b679e9714ebced245", "score": "0.67972475", "text": "hidden(){\n if (this._status === Hangman.LOSE) return this._word.split(\"\")\n return \n }", "title": "" }, { "docid": "c91ddfa0bc1f785da03702917269f47b", "score": "0.6796775", "text": "function checkLetter(){\n \n var toCheck = kaiju[kaijuIndex];\n\n for(var i = 0; i < toCheck.length; i++){\n if(toCheck.charAt(i) == letter){\n hidden[i] = letter;\n updateWord();\n guessTest = true;\n //counter ++;\n }\n }\n \n // loop through lettersCheck set to true if letter has been guessed\n for(var k =0; k < lettersChecked.length; k++){\n if(lettersChecked.charAt(k) == letter){\n testing = true;\n }\n }\n // updates checked letters if false\n if(testing == false){\n \n lettersChecked += letter + \" \"\n document.getElementById(\"checked\").textContent = lettersChecked;\n }\n \n //deincrements guesses on false\n if(guessTest == false){\n guessesRemaining --;\n remaining();\n\n }\n \n // checks if word is solved\n for(var z = 0; z < hidden.length; z++){\n //m = hidden[z];\n if(hidden[z] == \"_\"){\n winTest ++;\n }\n \n \n }\n \n \n //checks for win and reinitializes\n if(winTest == 0){\n document.getElementById(\"title\").textContent = hidden.join(\"\");\n wins ++;\n win();\n hidden =[];\n selectWord();\n displayHiddenWord();\n lettersChecked=\"\";\n document.getElementById(\"checked\").textContent = lettersChecked;\n toCheck = kaiju[kaijuIndex];\n counter = 0;\n \n\n }\n //checks for loss and reinitilizes\n if(guessesRemaining == 0){\n hidden =[];\n selectWord();\n displayHiddenWord();\n lettersChecked=\"\";\n document.getElementById(\"checked\").textContent = lettersChecked;\n toCheck = kaiju[kaijuIndex];\n counter = 0;\n guessesRemaining = 15;\n remaining();\n\n }\n\n //set testing back to false\n testing= false;\n guessTest = false;\n winTest = 0;\n\n}", "title": "" }, { "docid": "69438f587286398e9ddbe6983a42843c", "score": "0.6773165", "text": "function hiddenMessage(word){\r\n let message=\"\"; //assign an empty string\r\n wordArray = word.split(\"\"); //split the word into an array\r\n for (let letter of wordArray){\r\n message = message + showCode[letter] //loop each letter in the array to match the number key from the Hash \r\n };\r\n return message;\r\n}", "title": "" }, { "docid": "8914e42d42fbe1f62576e677ff78941d", "score": "0.67323405", "text": "function checkForWin(){\n for (i = 0; i < displayWord.length; i++){\n if (displayWord[i] === \"_ \"){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "86eac87ee9962162d857cb6c7176a237", "score": "0.66946477", "text": "function checkIncorrect(letter){\n if(pickedWordPlaceholderArr.indexOf(letter.toLowerCase()) === -1 && pickedWordPlaceholderArr.indexOf(letter.toUpperCase()) === -1){\n \n guessesLeft--;\n incorrectLetterBank.push(letter);\n guessedLetters.textContent =incorrectLetterBank;\n incorrectLetterBank.join(' ');\n guessesLeft.textContent = guessesLeft;\n }\n checkLoss();\n}", "title": "" }, { "docid": "09b39c82a41e90cbfb14fb76b0e2f0ca", "score": "0.6688795", "text": "checkLetter(letter) {\r\n return this.phraseArray.indexOf(letter) !== -1;\r\n }", "title": "" }, { "docid": "6fb64b5fb1d6fb4b9deb2ab3152cbc4a", "score": "0.66735667", "text": "function checkWord() {\n\ttry {\n\t\tvar check = $.txtLetter.value;\n\t\tvar bigword = check.toUpperCase();\n\t\tvar checkword = bigword.split(\" \", 1);\n\n\t\tvar alertDialog = Ti.UI.createAlertDialog();\n\t\t\n\t\tif(language == 'svenska'){\n\t\t\talertDialog.buttonNames = ['Stäng'];\n\t\t\talertDialog.title = \"Fel ord\";\n\t\t} else {\n\t\t\talertDialog.buttonNames = ['Close'];\n\t\t\talertDialog.title = \"Wrong word\";\n\t\t}\n\n\t\tif (checkword == word) {\n\t\t\tremoveClueZones();\n\n\t\t\t$.sendWord.hide();\n\t\t\t$.sendWord.height = 0;\n\t\t\t$.txtLetter.hide();\n\t\t\t$.txtLetter.height = 0;\n\t\t\t$.wordClue.hide();\n\t\t\t$.wordClue.height = 0;\n\t\t\t$.wordClueLbl.hide();\n\t\t\t$.wordClueLbl.height = 0;\n\n\t\t\tif(language == 'svenska'){\n\t\t\t\t$.lblCollectedLetters.text = 'Bra jobbat! Du hittade det rätta ordet!';\n\t\t\t} else {\n\t\t\t\t$.lblCollectedLetters.text = 'Good job! You found the right word!';\n\t\t\t}\n\n\t\t\t$.lblCollectedLetters.fontFamily = 'Raleway-Medium';\n\t\t\t$.lblCollectedLetters.fontSize = '16dp';\n\n\t\t\tAlloy.Globals.stopGame();\n\t\t\tstartOver();\n\t\t} else {\n\t\t\tif(language == 'svenska'){\n\t\t\t\talertDialog.message = \"Försök igen! Du har snart klurat ut det!\";\n\t\t\t} else {\n\t\t\t\talertDialog.message = \"Try again! You will soon figure it out!\";\n\t\t\t}\n\t\t\t\n\t\t\talertDialog.show();\n\t\t}\n\t} catch(e) {\n\t\tnewError(\"Något gick fel när sidan skulle laddas, prova igen!\", \"Bokstavsjakten\");\n\t}\n}", "title": "" }, { "docid": "06d62a99ac3fb287ccd3b3a68c89cb02", "score": "0.66636306", "text": "function checkLetter(ltr) {\n // update displayed letters\n updatedKeyedLetters(ltr);\n //this will store all the indices that match \n // what the user has guessed \n var matching_index = [];\n\n for (var i = 0; i < current_word.length; i++) {\n // if the user's letter matches any index of the current word\n // store this index inside of the matching_index array\n if (ltr == current_word[i]) {\n matching_index.push(i);\n }\n }\n\n\n // display any matching letters \n if (matching_index.length > 0) {\n // underscores is a string so in order to apply some methods \n // that can be applied only to an array converted it into an array using split() method\n underscores = underscores.split(\" \");\n\n for (var x = 0; x < matching_index.length; x++) {\n // this holds the value of which index needs to display to the user\n var changing_index = matching_index[x];\n\n // this will assign the index needed to be displayed with the letter\n // the user has keyed\n underscores[changing_index] = ltr;\n }\n\n // if there aren't any underscores remaining in the word displayed \n // to the user then increase wins by 1 ✅\n // and go to next word\n if (underscores.indexOf(\"_\") === -1) {\n wins++;\n $('#wins').text('Wins: ' + wins);\n\n // Let the user know they have guessed correctly\n $('#game-alert').show();\n updateAlert('#game-alert', 'alert-warning', 'alert-success', '#game-alert-message', `You've guessed the word correctly. \\nThe word was: ${current_word}`);\n\n nextWord();\n\n\n } else {\n underscores = underscores.join(\" \");\n $('#word').text(underscores);\n }\n\n } else {\n // no matching letters were found\n // decrease tries by 1 if decereasing_tries is true\n\n decereasing_tries ? tries-- : null;\n\n // displays remaining tries left\n $('#tries').text('Tries: ' + tries);\n\n // when tries are equal to 0 increase losses by 1 ✅\n if (tries === 0) {\n // $(\"#game-alert\").show();\n\n // Increases total number of losses\n losses++;\n\n // show an alert message for what the word was\n // Let the user know they have guessed correctly\n $('#game-alert').show();\n updateAlert('#game-alert', 'alert-warning', 'alert-danger', '#game-alert-message', `The word was: ${current_word}`);\n\n updateAlert('#game-alert', 'alert-success', 'alert-danger', '#game-alert-message', `The word was: ${current_word}`);\n\n // displays the updated losses\n $(\"span#losses\").text('Losses: ' + losses);\n\n // Go to next word and display it to the user\n nextWord();\n\n // resets the number of tries back to 10\n tries = 10;\n $('#tries').text('Tries: ' + tries);\n }\n }\n }", "title": "" }, { "docid": "d0cd48ebd0d1c19e0d24803cb0a12743", "score": "0.6639098", "text": "function checkLetters (word) {\n\n //get event from keyboard\n document.onkeypress = function(event) {\n\n //check only if guesses are remaining\n if (guessesRemaining > 0) {\n\n //get code of key\n var charCode = event.which || event.keyCode;\n //convert code to character\n var charStr = String.fromCharCode(charCode).toLowerCase();\n \n //if not a-z alert the user\n if (/[^a-z]/i.test(charStr)) {\n alert(\"please use only letters\");\n }\n\n //checks that chosen letter has been used and alerts the user\n else if ((lettersGuessedArray.length > 0 && lettersGuessedArray.indexOf(charStr) != -1) || \n (lettersNotInWordArray.length > 0 && lettersNotInWordArray.indexOf(charStr) != -1)) {\n alert (\"Letter already used. Pick another one!\");\n }\n\n //if letter not previously chosen checks if its in the word\n else {\n\n var indexOfLetters = [];\n\n //loop through word to check if character is in it, get index and save it\n for (var i = 0; i < word.length; i++) {\n \n if (charStr == word[i])\n indexOfLetters[indexOfLetters.length] = i;\n }\n\n //if greater than 0 it means that character was found in word\n if (indexOfLetters.length > 0) {\n\n //add character to guessed letters array and string for display\n lettersGuessed = lettersGuessed + \" \" + charStr.toUpperCase();\n lettersGuessedArray[lettersGuessedArray.length] = charStr;\n\n //replaces letter in correct position of masked word\n for (var i = 0; i < indexOfLetters.length; i++) {\n maskedWord = replaceAt(indexOfLetters[i], charStr);\n }\n }\n\n //letter not found in word\n else {\n\n lettersNotInWord = lettersNotInWord + \" \" + charStr.toUpperCase();\n lettersNotInWordArray[lettersNotInWordArray.length] = charStr;\n guessesRemaining--;\n }\n\n //checks if masked word is equal to word to win the game\n checkWordComplete(word);\n }\n }\n\n //ran out of guesses so game over\n else {\n \n gameOver = true;\n playAgain = true;\n }\n \n //updates html content with updated variables to track progress\n updateHtml ();\n }\n}", "title": "" }, { "docid": "5b4ba6cdddb309384ccbf194c19a9997", "score": "0.66268617", "text": "function setWord(word) {\n var wordHide = '';\n // hides the word with _ and ' '\n for (var i = 0; i < word.length; i++) {\n wordLetters.push(word[i]);\n wordHide = wordHide.concat('_');\n wordHide = wordHide.concat(' ');\n }\n\n hiddenWord = wordHide;\n}", "title": "" }, { "docid": "cfe24e55a11e46b31fc6f7ad6a0ac872", "score": "0.66110265", "text": "function updateHiddenWord(word, blankWord, letter) {\n var newBlankWord = '';\n for (var i = 0; i < word.length; i++) {\n if (word[i] === letter) {\n newBlankWord += letter;\n }\n else {\n newBlankWord += blankWord[i];\n }\n }\n return newBlankWord;\n}", "title": "" }, { "docid": "5584013046dff05cb72484a946cd81ad", "score": "0.66099536", "text": "function displayWord(arr) {\n // Dec variable to build string for display\n var newWord = '';\n // ForEach el in array, display \" \", \"__\", or letter (if any in array)\n arr.forEach(element => {\n if (element === \" \") {\n newWord += \"\\r\\n\";\n }\n else if (element === \"__\") {\n newWord += \"__ \";\n }\n // This will not run if we're displaying blanks (only when letters are guessed)\n else if (arr.indexOf(element) !== -1 && arr.indexOf(element) !== \" \"){\n newWord += element + \"\\xa0\";\n }\n // For error check\n else\n console.log(\"Something went wrong\");\n });\n // make puzzle answer equal newWord\n answer.textContent = newWord;\n checkForWin();\n }", "title": "" }, { "docid": "10e317e4b662f128769afbddc69ada05", "score": "0.6596441", "text": "function displayWord(){\r\n wordEl.innerHTML = `\r\n ${selectedWords\r\n .split('')\r\n .map(letter => `<span class=\"letter\">${correctWords.includes(letter) ? letter: ''}</span>`)\r\n .join('')\r\n}\r\n `\r\n const innerWord = wordEl.innerText.replace(/\\n/g, '');\r\n if(innerWord === selectedWords){\r\n popup.style.display = 'block';\r\n }\r\n}", "title": "" }, { "docid": "bef567398a8de91989dfc1245f11b65b", "score": "0.65899515", "text": "function displayLetter(letter) {\n\t// for each char in wordAsDashes, if matches currentWord then --> display\n\tfor (i = 0; i < currentWord.length; i++) {\n\t\tif (letter == wordAsArr[i]) {\n\t\t\tdashesArray[i * 2] = letter;\n\t\t\tconsole.log(dashesArray); // testing to make sure i can see the new word\n\t\t}\n\t}\n\tdocument.getElementById(\"currentWord\").innerHTML = dashesArray.join(\"\");\n\tcheckForWin();\n}", "title": "" }, { "docid": "983e022cfee3175ba14d7a8320cc8578", "score": "0.65887284", "text": "function checkLetter(clicked) {\n const guess = clicked.textContent;\n let correctLetter = null;\n for (let i = 0; i < letters.length; i += 1) {\n if (letters[i].textContent.toLowerCase() === guess) {\n letters[i].classList.add('show');\n correctLetter = letters[i].textContent;\n }\n}\nreturn correctLetter;\n}", "title": "" }, { "docid": "be9b59cb885f5d09f5de09987963fe72", "score": "0.6588583", "text": "checkForWin(){\n const hidden = document.getElementsByClassName(\"hide\");\n // if any of the phrase letters are still hidden, return true or false\n if (hidden.length === 0) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "23d4852cd89fd36ea72be1b8fda3bbad", "score": "0.65724546", "text": "isWinner(flippedLetters) {\n let visibleWord = \"\"\n flippedLetters.each((i, element) => {\n if (element.classList.contains(\"flipped\")) {\n visibleWord += element.dataset.letter\n } else if (element.classList.contains(\"letter-space\")) {\n visibleWord += `\\u0020`\n }\n })\n return visibleWord === this.hiddenWord ? true : false\n }", "title": "" }, { "docid": "6d62a76f15c1744023284f92bb7026a3", "score": "0.65657306", "text": "function checkUserLetter(letter){\n let letterInWord= false;\n for (let i = 0; i < underscore; i++){\n if(currentWord[i] === letter){\n letterInWord = true;\n }\n }\n if(letterInWord){\n for(let j =0; j < underscore; j++){\n if(currentWord[j] === letter){\n underscoreArray[j] = letter;\n }\n }\n }else{\n guessCount--;\n wrongGuessed.push(letter);\n }\n}", "title": "" }, { "docid": "461deca92685674c52aa77fd5d3aff48", "score": "0.65596306", "text": "showMatchedLetter(letter) {\r\n const letters = document.querySelectorAll('.hide');\r\n if (this.checkLetter(letter)) {\r\n for (let i = 0; i < letters.length; i++) {\r\n if (letters[i].textContent === letter) {\r\n letters[i].className = `show letter ${letter}`;\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "6ae01257209e6b7abb7bc1a686b0828f", "score": "0.65508145", "text": "function checkLetter (b) { //arg is clicked button, '<button class/atr>letter</button>'// all li children now an array (the phrase)\r\n // let li = document.getElementsByClassName('letter'); // array of phrase letters only (no spaces)\r\n for (let i=0; i<li.length; i++) { //iterate through length of this new array to find b if in there\r\n if (b.textContent === li[i].textContent) { // if button letter same as list array letter\r\n li[i].className = 'letter show'; // add this class to the phrase letter to make visible\r\n ret = true;\r\n checkWin();\r\n } else {\r\n continue;\r\n }\r\n } if (ret === false) {return null;}\r\n ret = false;\r\n}", "title": "" }, { "docid": "fea3f183a72ad31b71f2f3f2e981dee4", "score": "0.6550135", "text": "usesAvailableLetters(input, drawnLetters) {\n const word = input.toUpperCase().split('');\n const hand = drawnLetters;\n\n for (let letter in word) {\n const index = hand.indexOf(word[letter]);\n if (index < 0) {\n return false;\n } else {\n delete hand[index];\n };\n };\n return true;\n }", "title": "" }, { "docid": "d0434ca802c0c2450eef51fc1429e038", "score": "0.6548965", "text": "function checkLetters(letter) {\n\n //If the letter is in failArray, indexOf will return something\n //other than -1\n if (failArray.indexOf(letter) != -1){\n return; //Exit the function\n }\n\n\n var letterInWord = false;\n // Check if a letter exists inside the array at all. (by looping thru the word as an array)\n for (var i = 0; i < numBlanks; i++) {\n if (letter === chosenWordArray[i]) {\n // If the letter exists then toggle this boolean to true. This will be used in the next step.\n letterInWord = true;\n }\n }\n\n // If `letterInWord`, then figure out exactly where (which indices).\n if (letterInWord === true) {\n // Loop through the word, one letter at a time\n // Populate the blanksAndSuccesses with every instance of the letter.\n for (var i = 0; i < chosenWordArray.length; i++){\n // if chosenWord letter is the same as letter\n if (chosenWordArray[i] === letter) {\n // Here we set the specific space in blanks and letter equal to the letter when there is a match.\n blanksAndSuccessesArray[i] = letter;\n\n }\n }\n\n } else {// If the letter doesn't exist at all...\n // ..then we add the letter to the list of wrong letters, and we subtract one of the guesses.\n failArray.push(letter);\n guesses++;\n }\n}", "title": "" }, { "docid": "ea1c1263684c8d84d880691bd82a3d80", "score": "0.6540016", "text": "checkWinState() {\n // this.printAllLetterArray();\n let a = this.letterArray.length;//-1\n for (let count = 0; count < a; count++) {\n if (this.letterArray[count].hidden == true) {\n return false;\n }\n }\n this.wins++;\n this.cutinput = true;\n alert(\"you win!\")\n return true;\n }", "title": "" }, { "docid": "43b3b1a2c5f6bd06a4c6708c8089119f", "score": "0.6521878", "text": "function hideWord() {\n wordArray = word.split('');\n for (var i = 0; i < wordArray.length; i++) {\n hiddenWord += '-';\n }\n hiddenWordArray = hiddenWord.split('');\n return hiddenWord;\n}", "title": "" }, { "docid": "0586ec6d55e6d240064ca737256b32a5", "score": "0.65155435", "text": "function checkWord() {\n\t// check if length of word selected is valid\n\tif (word == \"\") {\n\t\talert(\"Please select a valid word\");\n\t\treturn;\n\t}\n\tif (word.length <= 1) {\n \t\talert(\"Selected word must be larger than a length of one\");\n \t\tword = \"\";\n \t\twordCoords = [];\n \t\tclearWord();\n\t return;\n\t}\n\n\t// check if all letters of selected word is preowned or not\n\tvar oldColor;\n\tvar turnColor;\n\tif (turn == 1) {\n\t\toldColor = \"blue\";\n\t} else if (turn == 2) {\n\t\toldColor = \"red\";\n\t}\n\tfor (var i = 0; i < wordCoords.length; i++) {\n\t\tvar coords = wordCoords[i].split(\" \");\n\t\tif (!(grid[coords[0]][coords[1]].setColor === oldColor)) {\n\t\t\tbreak;\n\t\t}\n\t\tif (i == wordCoords.length - 1) {\n\t\t\t// all letters selected for word are already owned\n\t\t\talert(\"Make sure your word does not consist completely of previously owned letters\");\n\t\t\tword = \"\";\n \t\t\twordCoords = [];\n \t\t\tclearWord();\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// TODO: change checking: check if word is valid\n\tisValid(word);\n}", "title": "" }, { "docid": "b543d8bb9c677a36484baacdb476bca0", "score": "0.6515102", "text": "static usesAvailableLetters(word, hand) {\n const wordArray = word.split('');\n let available = true\n wordArray.forEach(function(letter) {\n if (hand.includes(letter)) {\n hand.splice(hand.indexOf(letter), 1);\n } else {\n available = false\n }\n });\n return available;\n }", "title": "" }, { "docid": "fd0a78232e322c342f5d8f7e98ac3e95", "score": "0.65139496", "text": "function checkLetterMatch(y) {\n\tlet foundInArray = 0;\n\tlet gameWon = false; \n\tfor (let i = 0; i < currentWord.length; i++) {\n\t\tif (y === currentWord.charAt(i)) {\n\t\t\twordDisplay[i] = y;\n\t\t\tfoundInArray++;\n\t\t\tgameWon = winCondition();\n\t\t\tif (gameWon == true) {\n\t\t\t\treturn;\n\t\t\t} \n\t\t} \n\t}\n\tif (foundInArray == 0) {\n\t\tif (letterUsed.length == 0) {\n\t\t\tletterUsed.push(y);\n\t\t\tdocument.querySelector('#letterUsed').innerHTML = letterUsed;\n\t\t\tloseCondition();\n\t\t} else {\n\t\t\tlet x = checkIfUsedLetter(y);\n\t\t\tif (x == false) {\n\t\t\t\tletterUsed.push(y);\n\t\t\t\tdocument.querySelector('#letterUsed').innerHTML = letterUsed;\n\t\t\t\tloseCondition();\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "55bf2ee2f15b4a9bdef06e98c2243df5", "score": "0.65028197", "text": "showMatchedLetter(letter) {\n const letters = document.querySelectorAll(`.${letter}`);\n // Update class to show correct guesses\n this.checkLetter(letter) ? (letters.forEach( letter => letter.classList.replace(`hide`, `show`) )) : null;\n }", "title": "" }, { "docid": "304fb99e66edb009e7218c46d5cf2d25", "score": "0.6498758", "text": "function checkLetter(event) {\r\n\r\n for (i = 0; i < buttonsAlphabet.length; i++) {\r\n\r\n // DETECT WHAT BUTTON WAS CHECKED\r\n if (buttonsAlphabet[i].checked == true && buttonsAlphabet[i].disabled == false && arrayOfLettersChecked.includes(buttonsAlphabet[i].value) == false) {\r\n\r\n // CORRECT CHECK: IF THE BUTTON VALUE ITS INCLUDED IN THE HIDDEN WORD\r\n if (arrayOfLetterOfTheHiddenWord.includes(buttonsAlphabet[i].value)) {\r\n\r\n buttonsAlphabet[i].disabled = true;\r\n alphabetLabelButton[i].style.backgroundColor = \"green\";\r\n arrayOfLettersChecked.push(buttonsAlphabet[i].value);\r\n letterChecked = buttonsAlphabet[i].value;\r\n\r\n // SET DISPLAY NONE WORD TO FLEX\r\n for (i = 0; i < hiddenWord.length; i++) {\r\n\r\n // PREVENT ACCENTS\r\n replacementLetter = hiddenWord[i].textContent;\r\n letterOfTheHiddenWord = hiddenWord[i].textContent\r\n checkAccents(letterOfTheHiddenWord);\r\n\r\n // SET THE CORRECT LETTER\r\n if (letterOfTheHiddenWord == letterChecked) {\r\n hiddenWord[i].style.display = \"flex\";\r\n hiddenWord[i].style.backgroundColor = \"rgb(128, 223, 136)\";\r\n correctCount++\r\n };\r\n if (hiddenWord.length == correctCount) {\r\n for (i = 0; i < hiddenWord.length; i++) {\r\n hiddenWord[i].style.backgroundColor = \"rgb(61, 216, 69)\";\r\n };\r\n for (i = 0; i < buttonsAlphabet.length; i++) {\r\n buttonsAlphabet[i].disabled = true;\r\n };\r\n };\r\n };\r\n\r\n\r\n // CHECKED THE WRONG LETTER: DISABLE BUTTON AND SET IT RED\r\n } else if (arrayOfLetterOfTheHiddenWord.includes(buttonsAlphabet[i].value) == false) {\r\n\r\n buttonsAlphabet[i].disabled = true;\r\n alphabetLabelButton[i].style.backgroundColor = \"red\";\r\n arrayOfLettersChecked.push(buttonsAlphabet[i].value);\r\n errorCount++\r\n\r\n // LIMIT THE POSSIBILITIES\r\n if (errorCount == 6) {\r\n for (i = 0; i < buttonsAlphabet.length; i++) {\r\n buttonsAlphabet[i].disabled = true;\r\n };\r\n for (i = 0; i < hiddenWord.length; i++) {\r\n if (hiddenWord[i].style.display == \"none\") {\r\n letterCase[i].style.backgroundColor = \"red\";\r\n hiddenWord[i].style.display = \"flex\";\r\n } else {\r\n letterSpace[i].style.backgroundColor = \"rgb(250, 96, 96)\";\r\n };\r\n };\r\n };\r\n };\r\n };\r\n };\r\n}", "title": "" }, { "docid": "5ebb7a0253bf1220f9a0b0aacfc919f5", "score": "0.64974236", "text": "function display_word_output() {\n\n\tfor(var i=1;i <= letters.length;i++)\n\t{\n\t\tif (letters[i - 1] == guess.toLowerCase()) \n\t\t{\n\t\t\tword_output[i] = guess;\n\t\t}\n\t}\n\t$('#word').html(word_output.join(\" \"));\n}", "title": "" }, { "docid": "7c213faedb03d6d6bcc8c8db2106b330", "score": "0.6494436", "text": "checkForWin() {\n const letters = document.querySelectorAll(\"#phrase li\");\n // create variable to keep track of letters revealed\n let numOfLettersRevealed = 0;\n\n //loop through all li elements increment counter everytime a letter is revealed\n letters.forEach(function(letter) {\n if (!letter.className.includes(\"hide\")) {\n numOfLettersRevealed++;\n }\n });\n\n // check if the revealed letter counter is equal to the number of characters in the phrase\n if (numOfLettersRevealed === this.activePhrase.phrase.length) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "1a1efa5554110a68d3b785e4d2f168d1", "score": "0.6490529", "text": "function displayWord() {\n word.innerHTML = `${selectedWord\n .split('')\n .map((letter) => {\n return `<span class=\"letter\">${\n correctLetters.includes(letter) ? letter : ''\n }</span>`;\n })\n .join('')} `;\n}", "title": "" }, { "docid": "b4ca6f8b24e1b0945cb8589110597a9c", "score": "0.6486573", "text": "checkForWin() {\r\n let $missingChars = $('#phrase ul .hide');\r\n return ($missingChars.length === 0); // Returns false if there are still hidden letters, returns true if there are none\r\n }", "title": "" }, { "docid": "89e157cfef326e06c04bb61fb5d2089a", "score": "0.6483474", "text": "function displayHiddenWord(){\n for(var j = 0; j < kaiju[kaijuIndex].length; j++){\n hidden[j] = \"_\";\n}\n document.getElementById(\"display\").textContent = hidden.join(\" \");\n // console.log(hidden);\n win();\n remaining();\n}", "title": "" }, { "docid": "875a7c31aab228ec43d1456883b9fa4e", "score": "0.6453126", "text": "function Word(word){\n this.isWon = false;\n this.word = word;\n this.lastLetterGuessedCorrectly = false;\n this.letterArry = this.word.split(\"\").map(function(letter) {\n return new Letter(letter);\n })\n //display letter in array\n this.displayWord = function() {\n return this.letterArry\n .map(function(letter) {\n return letter.display(); \n })\n .join(\"\");\n }\n //display letter if guessed\n this.checkWord = function(letterGuessed) {\n var letterGuessedCorrectly = false;\n this.letterArry.map(function(letter) {\n \n if (letterGuessed.toLowerCase() === letter.letter.toLowerCase() || letter.letter === \" \" && letterGuessed === letter.letter) {\n letter.isDiplayed = true;\n letterGuessedCorrectly = true;\n\n }\n return letter;\n })\n this.lastLetterGuessedCorrectly = letterGuessedCorrectly;\n }\n \n this.haveWon = function() {\n var haveWon = true;\n for (var i = 0; i < this.letterArry.length; i++) {\n var letter = this.letterArry[i];\n if (!letter.isDiplayed) {\n haveWon = false;\n }\n \n }\n \n this.isWon = haveWon;\n}\n}", "title": "" }, { "docid": "0a4c18d3a18137bb190eee5f408d4dad", "score": "0.64513326", "text": "function displayLetters (userGuess) {\n\tvar wordToDisplayArr = wordToDisplay.split(\"\")\n\tconsole.log(\"wordToDisplay\");\n\tconsole.log(wordToDisplay);\n\tfor (var i = 0; i < chosenWord.length; i++) {\n\t\tif(userGuess === chosenWord[i]) {\n\t\t\t// wordToDisplay += userGuess;\n\t\t\twordToDisplayArr[i] = userGuess;\n\t\t}\n\t}\n\tconsole.log(\"---wordToDisplayArr---\");\n\tconsole.log(wordToDisplayArr);\n\twordToDisplay = wordToDisplayArr.join(\"\");\n\treturn wordToDisplay;\n\n\n\tfor (var i = 0; i < wordToDisplayArr.length; i++) {\n\t\tif(wordToDisplay[i] != \"_\") {\n\t\t\talert(\"You win!\");\n\t\t\twins++;\n\t\t}\n\t}\n\n\t\n}", "title": "" }, { "docid": "acabd31a7b65f4dffa364173a7f2509d", "score": "0.6446887", "text": "function hideLetter(){\n // display underscores\n let resultArray=[];\n for(i=0; i < answerArray.length; i++){\n resultArray.push(\" _ \");\n }\n return resultArray;\n}", "title": "" }, { "docid": "a9d741024dd00c59df28ed133b722091", "score": "0.64454055", "text": "function displayLetter(letter) {\n // for each char in wordAsDashes, if matches currentWord --> display\n for (i = 0; i < currentWord.length; i++) {\n if (letter == wordAsArr[i]) {\n dashesArray[i * 2] = letter;\n console.log(dashesArray);\n }\n }\n document.getElementById(\"currentWord\").innerHTML = dashesArray.join(\"\");\n checkForWin();\n}", "title": "" }, { "docid": "5719739e9c490e3710549e619e5d12b5", "score": "0.64418864", "text": "showIncorrect(){\n const incorrectLetterList = this.getWord()\n .split('')\n .filter(letter => !this.state.correctGuesses.includes(letter));\n this.setState({\n incorrectLetters: incorrectLetterList.join(''),\n });\n }", "title": "" }, { "docid": "9bd88fc19520c48443b82e51607ec822", "score": "0.64416575", "text": "checkLetter(selectedLetter) {\r\n // Start with the state that the letter is not found\r\n let letterInPhrase = false;\r\n\r\n // Create an array 'phrase' of eache letter\r\n let phrase = this.phrase.split('');\r\n\r\n phrase.filter(letters => {\r\n // Check if a letter match\r\n if (letters === selectedLetter) {\r\n // Show the found letter\r\n this.showMatchedLetter(selectedLetter);\r\n letterInPhrase = true;\r\n }\r\n });\r\n return letterInPhrase;\r\n }", "title": "" }, { "docid": "9565c7c63ac18b89bfe043b74360e56f", "score": "0.64354455", "text": "function Word (wordChoice) {\n var self = this\n var lett = [];\n var wordArray = wordChoice.split(\"\");\n console.log(wordArray);\n self.show = false;\n self.guessesLeft = 15;\n//self for loop will push letters into the lett array equal the length of the word.\n wordArray.forEach(function(letters){\n lett.push(new Letter(letters));\n // console.log(lett)\n });\n\n self.renderWord = function() {\n var wordString = \"\";\n lett.forEach(function(currentLetter){\n wordString += currentLetter.renderLetter(); \n });\n console.log(\" \" + wordString + \" Guesses Left: \" + self.guessesLeft);\n }\n \n self.validateLetter = function(userGuess) {\n self.guessesLeft --;\n //wordChoice.show will equal true when all the letters are guessed.\n self.show = lett.every(function(currentLetter) {\n if(userGuess === currentLetter.letters){\n currentLetter.show = true;\n }\n return currentLetter.show;\n });\n }\n}", "title": "" }, { "docid": "e00903d1fa1e11ba02ba823658e0ad06", "score": "0.6434054", "text": "function showCorrectLetters () {\n\n correctLetters = \"\"\n\n curWord = current.currentWord.userLetters;\n\n for ( let i = 0; i < curWord.length; i++) {\n\n if (curWord[i].show) {\n correctLetters += \" \" + curWord[i].character + \" \";\n\n } else {\n correctLetters += \" _ \";\n }\n\n }\n\n console.log(\"\\n\" + \"\\n\" + correctLetters);\n }", "title": "" }, { "docid": "a94b78ea95ddb91c80e5fb530a7dee2b", "score": "0.6408689", "text": "function checkGuess(letter) {\n // Array to store positions (index) of correct letter guesses\n var positions = [];\n\n // Loop through word finding any instances of guessed letter, store the index in positions array\n for (var i = 0; i < words[currentWordIndex].length; i++) {\n if (words[currentWordIndex][i] === letter) {\n positions.push(i);\n\n }\n }\n //console.log(positions);\n // if there are no indicies of the letter in word being guuessed (<= 0)\n // remove a guess and update the \n if (positions.length <= 0) {\n // decrement remaining guesses \n guessesLeft = guessesLeft - 1;\n\n } else { //letter is in the word being guessed\n // Loop through answerArray indicies and replace the '_' with the correct letter\n for (var i = 0; i < positions.length; i++) {\n answerArray[positions[i]] = letter;\n answerArrayDisplay = answerArray.join(\" \");\n //console.log(answerArrayDisplay);\n }\n }\n}", "title": "" }, { "docid": "7378b4f4ef2c32a275d1172c861b3b71", "score": "0.6402964", "text": "checkForWin() {\n let matchedLetters = document.querySelectorAll('.hide.letter');\n if (matchedLetters.length === 0) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "69e7702ea4b5b0726861cb68ce364b8e", "score": "0.6368361", "text": "function checkConditions(letter, obj) {\n let array = [];\n for (let index = 0; index < obj.computerGuess.length; index++) {\n if (letter === obj.computerGuess[index]) {\n array.push(letter);\n } else if (letter != obj.computerGuess[index] && obj.wordArray[index] === '_') {\n array.push('_');\n } else {\n array.push(obj.computerGuess[index]);\n }\n }\n obj.wordArray = [...array];\n}", "title": "" }, { "docid": "f3036d5495bd88f40032d6eccf0aaa82", "score": "0.63473874", "text": "function inWord(){\n\tif (isInWord()== true){\n\t\tfor (var i; i<longueurMot;i++){\n\t\t\tmotADeviner[i].style = \"visibility : visible\"; //est-ce que ça marche ??\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f79a67d5cc02b8e97444bd48849424a8", "score": "0.63473636", "text": "function checkLetter(buttonClicked){\n\n const letters = document.getElementsByClassName('letter'); //Get all letters in phrase\n const guessedLetter = buttonClicked.innerHTML.toLowerCase(); //Guessed letter\n let match = false;\n\n //Loop through letters in phrase to search for a match\n for (let i = 0; i < letters.length; i++){\n const letter = letters[i].innerHTML.toLowerCase(); //Letter in Phrase\n\n if (letter === guessedLetter){\n letters[i].style.transition = '.7s';\n letters[i].classList.add('show');\n match = true;\n }\n }\n\n if (match){\n return guessedLetter;\n }\n else {\n return null;\n }\n\n}", "title": "" }, { "docid": "db9219c8dab761bde6639841051143b3", "score": "0.63455665", "text": "function checkLetter(btn) {\n let check = false;\n for (let i = 0; i < letters.length; i += 1) {\n if (btn.textContent === letters[i].textContent.toLowerCase()) {\n letters[i].classList.add('show');\n\t check = true;\n } \n }\n return check;\n}", "title": "" }, { "docid": "acc41cbdd2aea577466885312da44ce8", "score": "0.63455313", "text": "showMatchedLetter(letter) {\n const phraseLI = document.querySelectorAll('.letter');\n if (this.checkLetter(letter) === true) {\n for (let i = 0; i < phraseLI.length; i++) {\n if (phraseLI[i].textContent === letter) {\n phraseLI[i].classList.remove('hide');\n phraseLI[i].classList.add('show');\n }\n }\n }\n }", "title": "" }, { "docid": "6708c8a4c94beb37000981beec04b659", "score": "0.63410556", "text": "function letterCheck (userGuess) {\n\n // looping through the array and if the letter IS found\n if (randomWord.indexOf(userGuess) > -1) {\n for( var k = 0; k < splitWord.length; k++) {\n if (splitWord[k] === userGuess){\n underScores[k] = userGuess;\n hangmanWord.innerHTML = underScores.join(''); \n }\n }\n } // if word is NOT in array then do this\n else if (randomWord.indexOf(userGuess) === -1) {\n guesses--;\n wrongLetter.push(userGuess);\n lettersUsed.innerHTML = \"Letters used: \" + wrongLetter.join('');\n numberOfGuesses.innerHTML = \"Guesses remaining: \" + guesses;\n console.log(wrongLetter);\n }\n}", "title": "" }, { "docid": "a71bbd93c1068f0ceb7251190ae1fd0b", "score": "0.6340961", "text": "function checkletter(letter)\n{ \nvar letterinword = false;\nvar wrongGuessFound = false;\n//check if letter pressed is in choosesword\nif(choosenword.indexOf(letter) > -1)\n{\n \n for (i=0;i<numblanks; i++){\n \n if(choosenword[i] === letter){\n blankandsucesses[i] = letter ;\n letterinword =true;\n }\n }\n} \n else {\n \n if(wrongguess.indexOf(letter) == -1 )\n {\n wrongguess.push(letter);\n console.log('wrongguess', wrongguess);\n numguesses--;\n console.log(numguesses);\n } \n else {\n alert(letter + ' already pressed!!');\n }\n }\n document.getElementById('word-blanks').innerHTML = blankandsucesses.join(\" \");\n document.getElementById('Wrong-guess').innerHTML = wrongguess.join(\" \");\n}", "title": "" }, { "docid": "d7c56e47ded67b77afdf95358e7824e2", "score": "0.63402563", "text": "checkGuessHelper(key) {\n const letter = item => {\n return item === key;\n };\n\n // Also checks the hidden word\n if (this.hiddenWord.search(key) !== -1) {\n return true;\n }\n\n // Return a boolean indicating whether letter is a repeat in wrongLetters array\n return this.wrongLetters.find(letter) ? true : false;\n }", "title": "" }, { "docid": "bbb215e379cd9a3963468c0640dc290d", "score": "0.6339716", "text": "function checkIncorrect (letter) {\n if (computerWordPlaceHolder.indexOf(letter.toLowerCase()) === -1) { //if the user letter to lower case does not exist within the array created to hold the computerWord (aka doesn't match the computerWord) then...\n guessesLeft--;// reduce the amount of guesses left \n incorrectGuesses.push(letter);//push the incorrect letter to the incorrectGuesses array and...\n guessedLettersText.textContent = incorrectGuesses.join(' '); //display both incorrect letters and...\n guessesLeftText.textContent = guessesLeft; // new amount of guesses left on the DOM\n }\ncheckLoss(); //check if loss happened\n}", "title": "" }, { "docid": "eb434d79f86733127a3b0f3c0bf1a224", "score": "0.6336283", "text": "function displayWord() {\n wordEl.innerHTML = `\n ${selectedWord\n .split('')\n .map(letter => `\n <span class = \"letter\">\n ${correctLetters.includes(letter) ? letter : ''}\n </span>\n `).join('')}\n `;\n const innerWord = wordEl.innerText.replace(/\\n/g, '');\n\n //console.log(wordEl.innerText, innerWord);\n if(innerWord === selectedWord) {\n finalMessage.innerText = 'Great! You won! 😀';\n popup.style.display = 'flex';\n }\n}", "title": "" }, { "docid": "8fdc25b573495b40ad19d513b4b613d3", "score": "0.63271105", "text": "showMatchedLetter(letter) {\n //phraseLetters as advised by @Emma W\n const phraseLetters = document.getElementsByClassName(letter);\n\n for(let i = 0; i < phraseLetters.length; i++){\n\n if(letter === phraseLetters){\n phraseLetters[i].classList.remove(\"hide\");\n //console.log(\"working\");\n } else {\n phraseLetters[i].classList.replace(\"hide\", \"show\");\n //console.log(\"try again\");\n }\n }\n }", "title": "" }, { "docid": "971b35ffd2343c451745b0e63db8102d", "score": "0.63227284", "text": "function updateWord() {\n for (let i=0; i < singleCurrentArray.length; i++) {\n if (singleCurrentArray[i] === userChoice) {\n let item = document.querySelectorAll('.is-hidden')[i];\n item.classList.add('show-guess');\n }\n }\n }", "title": "" }, { "docid": "59fcd0ae95323bee6add18148f36b04e", "score": "0.632206", "text": "function updateWord() {\n for (let i = 0; i < singleCurrentArray.length; i++) {\n if (singleCurrentArray[i] === userChoice) {\n let item = document.querySelectorAll('.is-hidden')[i];\n item.classList.add('show-guess');\n }\n }\n }", "title": "" }, { "docid": "29c6c4c109771a5e0a771f37e528b5d1", "score": "0.6304443", "text": "function clickedLetter() {\n\t\t\tlet letters = document.querySelectorAll('.alphabet-button');\n\t\t\tconsole.log(selectedWord);\n\n\t\t\tlet clickedLetters = letters.forEach((letter) => {\n\t\t\t\tletter.addEventListener('click', (e) => {\n\t\t\t\t\tlet clickedLetter = e.target.innerText;\n\t\t\t\t\te.target.classList.add('clicked');\n\t\t\t\t\tconst innerWord = wordEl.innerText.replace(/\\n/g, '');\n\n\t\t\t\t\tif (selectedWord.includes(clickedLetter)) {\n\t\t\t\t\t\tif (!correctLetters.includes(clickedLetter)) {\n\t\t\t\t\t\t\tcorrectLetters.push(clickedLetter);\n\n\t\t\t\t\t\t\tdisplayWord();\n\t\t\t\t\t\t} else if (innerWord != selectedWord) {\n\t\t\t\t\t\t\tnotification.innerText = `word already contains letter ${clickedLetter.toUpperCase()}`;\n\t\t\t\t\t\t\tshowNotification();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!wrongLetters.includes(clickedLetter)) {\n\t\t\t\t\t\t\twrongLetters.push(clickedLetter);\n\n\t\t\t\t\t\t\tdrawFigure();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnotification.innerText = `word does not contain letter ${clickedLetter.toUpperCase()} plus you already clicked it DUMBASS`;\n\t\t\t\t\t\t\tshowNotification();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn clickedLetters;\n\t\t}", "title": "" }, { "docid": "e3e9ae83d815345f2cac51824bf97e61", "score": "0.6304269", "text": "function displayWord() {\n\tvar result = \"\";\n\tvar win = true;\n\tfor (var i = 0; i < chosenWord.length; i++) {\n\t\tif (lettersTried.indexOf(chosenWord[i]) !== -1) {\n\t\t\tresult += chosenWord[i];\n\t\t} else {\n\t\t\tresult += \"_\";\n\t\t\twin = false;\n\t\t}\n\t}\n\twinHappened = win;\n\treturn result;\n}", "title": "" }, { "docid": "a07826a58161b76cbe442ea245f980f5", "score": "0.6303109", "text": "checkForWin() {\r\n const LIsLettersRemaining = document.querySelectorAll('#phrase li.letter.hide');\r\n return LIsLettersRemaining.length === 0;\r\n }", "title": "" }, { "docid": "68981f1560433f634c9fbce065f3942f", "score": "0.6297617", "text": "function Word(){\n this.letters = [], //array of letter objects\n this.cleared = false, //whether the word has been fully guessed\n \n //METHOD to LOAD WORD takes a string\n this.load = function(word){\n //make a letter object for each letter in the string\n for (var i = 0; i < word.length; i++){\n this.letters.push(new Letter(word[i]));//push to the array\n };\n },\n \n //METHOD to SHOW WORD as underscores/letters\n this.update = function(){\n var display = \"\";//clear display\n //Call the show method of each letter\n for (var i = 0; i < this.letters.length; i ++){\n display += this.letters[i].show() + \" \";\n }\n //if the display word no longer has underscores, user cleared the word\n if(display.indexOf(\"_\") === -1){\n this.cleared = true;\n }\n console.log(display);\n return display;\n },\n \n //METHOD to CHECK GUESS takes single str character\n this.check = function(char){\n var correct = false;\n for (var i = 0; i < this.letters.length; i ++){\n var guessCheck = this.letters[i].check(char); //save the returned value as a variable\n if(guessCheck){\n correct = true;\n }\n }\n return correct; //return so main game logic can see\n \n };\n}", "title": "" }, { "docid": "1a2135a15d968db4db8d12a40595357e", "score": "0.6294009", "text": "function wonGame() {\n return hiddenWord === word;\n}", "title": "" }, { "docid": "f6db6415b0400b1128e38cc0047aa9ba", "score": "0.62898564", "text": "showMatchedLetter(letter) {\n const phraseChars = game.activePhrase;\n for(let i = 0; i < phraseChars.length; i++){\n let phraseChar = phraseChars[i];\n //let liClassList = charLi.classList[0];\n if(phraseChar === letter) {\n let charLi = document.getElementsByClassName(`hide letter ${phraseChar}`);\n while (charLi.length > 0) {\n charLi.item(0).classList.add('show');\n charLi[0].classList.remove('hide');\n }\n }\n }\n }", "title": "" }, { "docid": "c95afbdda5116cf087c25b24d33c7b5d", "score": "0.6285956", "text": "function checkLetter(letter) {\n\t\t\tvar wrongGuess = true;\n\t\t\tfor (var j = 0; j < wordLength; j++) {\n\t\t\t\tif (wordtoGuess.charAt(j) === letter.toLowerCase()) {\n\t\t\t\t\twordPad['word_' + j].tf.text = letter.toUpperCase();\n\t\t\t\t\twrongGuess = false;\n\t\t\t\t\tcorrectGuess++;\n\t\t\t\t\tif (correctGuess == wordLength) {\n\t\t\t\t\t\tremoveAll();\n\t\t\t\t\t\troot.gotoAndStop(23);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\tif (wrongGuess) {\n\t\t\t\tbadGuess++;\n\t\t\t\tdrawHangman();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "614b540f850b1de18bcf438be313b4ec", "score": "0.62833464", "text": "showMatchedLetter(letter) {\nlet matchedLetter = document.querySelectorAll(`.letter`);\nfor (let i = 0; i < matchedLetter.length; i++)\nif (matchedLetter[i].innerHTML === letter) {\n matchedLetter[i].removeAttribute(\"class\", \"hide\");\n matchedLetter[i].setAttribute(\"class\", \"show\");\n }\n}", "title": "" }, { "docid": "583831fbd2447074bd7746196afcb185", "score": "0.6281887", "text": "function LetterCheck(letters) {\n var letterInWord = false;\n \n for (var i = 0; i < blanks; i++) {\n if (random[i] == letters) {\n letterInWord = true;\n }\n }\n\n if (letterInWord) {\n //Broken?\n for (var i = 0; i < blanks; i++) {\n if (random[i] == letters) {\n blanksCorrect[i] = letters;\n }\n }\n }else {\n wrongGuess.push(letters);\n guessesRemaining--;\n }\n\n}", "title": "" }, { "docid": "0b8f5c869b8ea079b0f01878496899ca", "score": "0.62814987", "text": "function checkIncorrect(letter) {\n if (pickedTeamPlaceHolderArr.indexOf(letter.toLowerCase()) === -1 && pickedTeamPlaceHolderArr.indexOf(letter.toUpperCase()) === -1) {\n guessesLeft--;\n incorrectLetterBank.push(letter);\n $guessedLetters.textContent = incorrectLetterBank.join(' ');\n $guessesLeft.textContent = guessesLeft;\n }\n checkLoss();\n}", "title": "" }, { "docid": "86e5769d9052d838ce7c8f02d43e9814", "score": "0.6280543", "text": "showMatchedLetter(letter) {\n document.querySelectorAll(\".letter\").forEach((keyboard) => {\n if (keyboard.textContent === letter) {\n keyboard.classList.replace(\"hide\", \"show\")\n }\n });\n }", "title": "" }, { "docid": "f0de1b67697cfc377f343e63b5ab7051", "score": "0.6279334", "text": "showMatchedLetter(input) {\n const getCorrectLetter = document.getElementsByClassName(input);\n for (let h = 0; h < getCorrectLetter.length; h++) {\n getCorrectLetter[h].classList.remove(\"hide\");\n getCorrectLetter[h].classList.add(\"show\");\n }\n }", "title": "" }, { "docid": "6f57babb27bbb7562c1b38258116d334", "score": "0.62782377", "text": "checkLetter(letter) {\n const clickedkeyTextcontent = letter.textContent;\n if (this.phrase.includes(clickedkeyTextcontent)) {\n return true;\n }\n else {\n return false;\n\n }\n }", "title": "" }, { "docid": "ae0b22d13e517e901144b9fbcc8e725c", "score": "0.62767875", "text": "function checkLetter(button) {\n let letterFound = false;\n for (let i = 0; i < phraseLetters.length; i += 1) {\n if (phraseLetters[i].textContent == button.textContent) {\n // add the show class for the letter to display\n phraseLetters[i].classList.add('show');\n // animation added when the letter displays\n phraseLetters[i].classList.add('tada');\n letterFound = null;\n } else {\n button.setAttribute('disabled', true);\n }\n }\n return letterFound;\n }", "title": "" }, { "docid": "244135e80062d440c54e1fab82edc522", "score": "0.62753195", "text": "function displayWord() {\n wordEl.innerHTML = `\n ${selectedWord\n .split('')\n .map(\n letter => `\n <span class=\"letter\">\n ${correctLetter.includes(letter) ? letter : ''}\n </span>\n `\n )\n .join('')}\n ` \n\n const innerWord = wordEl.innerText.replace(/\\n/g,'')\n \n // Mensagem de vitória\n if(innerWord === selectedWord) {\n finalMessage.innerText = 'Parabéns, você ganhou ✨';\n popup.style.display = 'flex'\n }\n}", "title": "" }, { "docid": "44b5e6fc37358c7a1661439602c9f1e4", "score": "0.62660986", "text": "checkGuess(key, currentWord) {\n // Convert the hiddenWord string to an array\n let hiddenWordArray = this.hiddenWord.split('');\n\n // if the guessed letter is in currentWord inject it into the hidden word array\n for (let i = 0; i < currentWord.length; i++) {\n if (key === currentWord[i]) {\n hiddenWordArray[i] = key;\n }\n }\n\n let repeatLetter = this.checkGuessHelper(key);\n\n // Push a letter into the wrongLetters array if it doesn't match anything\n if (this.hiddenWord === hiddenWordArray.join('') && !repeatLetter) {\n this.wrongLetters.push(key);\n\n // Takes away a \"try\" (because it's an incorrect guess and those are the rules, man!)\n this.tries -= 1;\n } else if (repeatLetter) {\n return;\n }\n\n // Convert hidden word array back into a string and save to object\n this.hiddenWord = hiddenWordArray.join('');\n }", "title": "" }, { "docid": "02cd13bd84a764b0b3518ee0f41d4038", "score": "0.6265843", "text": "function checkLetter(secretWord, checkLetter){\n indexes = [];\n secretWord.split('').forEach(function(letter, index){\n if(letter == checkLetter){\n indexes.push(index);\n }\n });\n return indexes.length > 0 ? indexes : false;\n}", "title": "" }, { "docid": "cc12ce34d6121e3ed22424ed14e3bbf3", "score": "0.6265473", "text": "showMatchedLetter(letter) {\n\t\tif(this.checkLetter(letter)) {\n\t\t\tconst getLetter = document.querySelectorAll(\"#phrase .\" + letter);\n\t\t\tfor(let i = 0; i < getLetter.length; i++) {\n\t\t\t\tgetLetter[i].classList.remove(\"hide\");\n\t\t\t\tgetLetter[i].classList.add(\"show\");\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "d73df5668b516d638c428466f66d9943", "score": "0.6264019", "text": "function wrongcheck() {\nvar wrongcount = word.length;\n\nfor (var w = 0; w < word.length; w++) {\n if (word[w] !== userGuess) {\n wrongcount--;\n }\n}\nif ( wrongcount === 0) {\nwrongLetters.push(userGuess);\n}\n}", "title": "" }, { "docid": "7ca4fd56f20c86e3d97f74b01640be7d", "score": "0.6257057", "text": "function displaySelectedWord(){\n word.innerHTML=`\n ${selectedWord.split('').map(\n letter =>` <span class=\"letter\">\n ${correctLetters.includes(letter) ? letter: ''}\n </span>\n `\n ).join('')\n}\n \n `;\n const wordText=word.innerText.replace(/\\n/g,'');\n if( wordText === selectedWord ){\n message.innerText='You Won!';\n popup.style.display='flex';\n\n }\n}", "title": "" }, { "docid": "b7c9cb2ba5e070c174c4c7e601c2eceb", "score": "0.6256781", "text": "function Word(value) {\n this.value = value;\n this.letterChar = [];\n this.found = false;\n\n for (var i = 0; i < this.value.length; i++) {\n this.letterChar.push(new Letter(this.value[i]));\n }\n\n // this function will show all the correct letter found\n this.findword = function() {\n this.found = this.letterChar.every(function(curLet) {\n return curLet.show;\n })\n return this.found;\n }\n\n // this function will check the letter found if \n // it is in the randomIndex of the chosen word\n this.checkLetterFound = function(guessedLetter) {\n\n var lowerLetter = guessedLetter.toLowerCase();\n var result;\n\n for (var i = 0; i < this.letterChar.length; i++) {\n // check the correct letter in each indeces of the \n // temporary letterChar array\n var found = this.letterChar[i].checkLetterFound(lowerLetter)\n\n // checks if the letter/result is found or not\n if (!result) {\n result = found;\n }\n }\n // checks if result is not found in the indeces of our chosen word\n // will return 'INCORRECT'\n return result ? result : 'INCORRECT!';\n }\n\n // this function will render the word \n // and console log the correct word \n this.wordRender = function() {\n var output = '';\n\n for (var i = 0; i < this.letterChar.length; i++) {\n output += this.letterChar[i].letterRender() + ' ';\n }\n console.log();\n console.log(output);\n return output;\n }\n}", "title": "" }, { "docid": "17dce68b424c69eb7d98fa67c349192d", "score": "0.62534666", "text": "function wordGuessed(){\n var word = currentWord.wordArray;\n // Loops through the word and checks if any of the letter has NOT been guessed\n for(var i = 0; i < word.length; i++){\n if(!word[i].guessed && word[i] !== \" \"){\n return false;\n }\n }\n // If all the letters have been guessed, then return true\n return true;\n}", "title": "" }, { "docid": "a30f7ba89a3c8d3dc6a22cc3d85db8f0", "score": "0.6252506", "text": "showMatchedLetter(letter) {\n //Here I convert the collection of li elements with the proper hidden letter into an array\n const hideArray = [...document.getElementsByClassName(`hide letter ${letter}`)]\n //I then iterate over the array and change the class name of each element to 'show'\n hideArray.forEach(element => element.className = 'show')\n }", "title": "" }, { "docid": "89e870bf9ee70d0ef8cbf9377f6f0e89", "score": "0.62522346", "text": "function showLetterOrDash(){\n let displayWord = ' '\n for(let i = 0; i< currentWord.length; i++){\n if(lettersGuessed.includes(currentWord[i])){\n displayWord = displayWord + currentWord[i] + ' '\n } else {\n displayWord = displayWord + '_' + ' '\n }\n }\n document.getElementById('current-word').textContent = displayWord\n}", "title": "" }, { "docid": "aa1258db3fff2e72596d5522e8d3c3da", "score": "0.6250429", "text": "function displaySelectedWord() {\n word.innerHTML = `\n ${selectedWord.split('').map(\n letter => `<span class=\"letter\"> ${correctLetters.includes(letter) ? letter: '' } </span>`\n ).join('')\n }\n `;\n\n const wordText = word.innerText.replace(/\\n/g , '');\n \n if(wordText === selectedWord) {\n message.innerText = 'You Won!';\n popup.style.display = 'flex';\n\n }\n}", "title": "" }, { "docid": "c3b87bde1c4c022d17c14de9e4803ae5", "score": "0.6246495", "text": "function checkword(e){\n\tvar letter = String.fromCharCode(e.keyCode);\n\tfor (var i = 0; i < word.length; i++) {\n\t\tif(letter == word.charAt(i)) {\n\t\t\t//alert(\"you guessed correctly \" + letter)\n\t\t\tcorrectletters = correctletters + letter;\n\t\t}\n\t\telse{\n\t\t\tcorrectletters = correctletters + \"-\";\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "61a62e6b11e93d8ed91eaf0f7743e9d3", "score": "0.6242236", "text": "checkLetter(target) {\n let letters = [].slice.call(document.querySelectorAll(\".letter\"))\n for (let x = 0; x < letters.length; x++) {\n if (letters[x].textContent === target) {\n this.showMatchedLetter(target)\n return true;\n }\n }\n }", "title": "" }, { "docid": "8c42b742653b7b85d3ebd05fab546b84", "score": "0.6239885", "text": "showMatchedLetter(letter){\n if (this.checkLetter(letter) === true){\n const letters = document.getElementsByClassName(letter);\n Array.from(letters).forEach(letter => {\n letter.classList.remove('hide');\n letter.classList.add('show');\n \n })\n }\n }", "title": "" }, { "docid": "aa726145c1ad73932166e9b628bc4850", "score": "0.62376124", "text": "function checkCharacter() {\n var a = document.blank; //check .rateformular - what's it's function\n var b = a.elements[\"newCharacter\"];\n var character = b.value; // the letter provided by the user\n character = character.toUpperCase();\n for (var i = 0; i < wordChooser.length; i++) {\n if (wordChooser[i] === character) {\n newWord[i] = character + \" \";\n var goal = true;\n }\n b.value = \"\";\n }\n //deletes the guessField and replaces guessField with new term\n var guessField = document.getElementById(\"guessField\");\n guessField.innerHTML = \"\";\n showNewWord();\n if (!goal) {\n var guessedLetter = document.getElementById(\"guessedLetter\");\n var letter = document.createTextNode(character + \" \");\n guessedLetter.appendChild(letter);\n error++;\n var hangman = document.getElementById(\"hangman\");\n hangman.src = \"hangmanpics/hangman\" + error + \".png\";\n }\n //checks if all letters have been found\n var end = true;\n for (var i = 0; i < newWord.length; i++) {\n if (newWord[i] === \"_ \") {\n end = false;\n }\n }\n if (end) {\n window.alert(\"You win!\");\n }\n //once you got six wrong letters, you lose\n if (error === 11) {\n window.alert(\"You lose :( .\");\n }\n}", "title": "" }, { "docid": "cf536335a2303ff078eff9a7beac2da9", "score": "0.6234359", "text": "function letterCheck(letter) {\n // Check if letter exists in code \n\n var isLetterInWord = false;\n\n for (var i = 0; i < numBlanks; i++) {\n if (selectedWord[i] == letter) {\n isLetterInWord = true;\n }\n }\n\n if (isLetterInWord) {\n for (var i = 0; i < numBlanks; i++) {\n if (selectedWord[i] == letter) {\n blanksAndSuccesses[i] = letter;\n }\n }\n }\n\n else {\n wrongLetters.push(letter);\n guessesRem--;\n }\n // Testing\n console.log(blanksAndSuccesses);\n}", "title": "" }, { "docid": "328db715bd4450db5832a4c2883c1dc6", "score": "0.62327176", "text": "function checkLetters(letter) {\n let letterInWord = false;\n //if the generated randomword is equal to the letter entered then the variable is true\n for (let i = 0; i < blanks; i++) {\n if (randomWord[i] === letter) {\n letterInWord = true;\n }\n }\n //if letterInWord (false)\n if (letterInWord) {\n for (let i = 0; i < blanks; i++) {\n if (randomWord[i] === letter) {\n blanksAndCorrect[i] = letter;\n }\n }\n }\n //push incorrect guess in the wrong guess section and reduce number of guesses\n else {\n wrongGuess.push(letter);\n guessesRemaning--;\n }\n}", "title": "" }, { "docid": "be2eec482bc129a4a35844f77556250c", "score": "0.6227509", "text": "showMatchedLetter(letter) {\n const activePhrasesHTML = document.querySelectorAll('ul li');\n for (let i = 0; i < activePhrasesHTML.length; i++) {\n let classList = [];\n let phraseClassList = activePhrasesHTML[i].classList;\n for (let j = 0; j < phraseClassList.length; j++) {\n classList.push(phraseClassList[j]);\n }\n for (let x = 0; x < classList.length; x++) {\n if (classList[x] === letter) {\n activePhrasesHTML[i].classList.remove('hide');\n activePhrasesHTML[i].className = 'show';\n }\n }\n }\n }", "title": "" }, { "docid": "230146be88130c18ba20dee586cbaf56", "score": "0.6223002", "text": "function checkLetter() {\n\tletter.match = false;\n\tfor(var i = 0; i<word.array.length; i++){\n\t\tif(letter.input.input === word.array[i]){\n\t\t\tletter.match = true;//stops wrong count\n\t\t\tword.blanks[i] = letter.input.input;//change display of matched letter\n\t\t}\n\t}\n\n\t//if letter doesn't match any letters in word, run this\n\tif(letter.match == false){\n\t\tconsole.log(\"Wrong, go again\");\n\t\tletter.wrong++;//increments missed counter\n\t\tconsole.log(letter.wrong);\n\t\t//letter.wrong.push(letter.input)//push incorrect letter to array\n\n\t\tif(letter.wrong>4){//loss condition\n\t\t\tconsole.log(\"You lose, try again...\");\n\t\t\treturn;\n\t\t}\n\t}\n\tconsole.log(word.blanks);//dispalys blanks after updating user\n\n\tif(!done && ){\n\t\tconsole.log(\"You got one!! Go again!\");\n\t\tgetLetter();//recursive function call to keep prompt running\n\t}\n\n}", "title": "" }, { "docid": "516ea129c7403735ec6dd9f823b47842", "score": "0.6217253", "text": "isLegalSecretWord(word){\n for (var i = 0; i < word.length; i++)\n for (var j = i + 1; j < word.length; j++)\n if (word[i] == word[j])\n return false;\n return true;\n }", "title": "" }, { "docid": "8ed808dfdde72a4868929b20f1b7afc4", "score": "0.62164754", "text": "function checkLetters(letterGuessed) {\n var lettersinWord = false; // default is that letter doesnt exist \n\n for (var i = 0; i < numBlanks; i++) {\n if (selectedWord[i] == letterGuessed) {\n lettersinWord = true;\n\n }\n }\n //check location of letter and populate the array with that letter if letter is found \n if (lettersinWord) {\n for (i = 0; i < numBlanks; i++) {\n if (selectedWord[i] == letterGuessed) {\n blanksAndSuccesses[i] = letterGuessed;\n\n }\n }\n }\n // if the letter wasn't found push it to the letterGuessed array and subtract the guessesRemaining by 1\n else {\n wrongLetters.push(letterGuessed);\n guessesRemaining--; \n }\n \n}", "title": "" }, { "docid": "68a43977265b7dfbdcbcb5d0106e1baf", "score": "0.6209243", "text": "function checkArray(letter) {\n\t\t return letter == userGuess;\n\t\t}", "title": "" }, { "docid": "0f0232627907a206e1ccb5d8916f4033", "score": "0.6206436", "text": "function guessedWord() {\r\n wordStatus = answer.split('').map(letter => (guessed.indexOf(letter) >= 0 ? letter : \" _ \")).join('');\r\n\r\n document.getElementById('words').innerHTML = wordStatus;\r\n}", "title": "" }, { "docid": "bb05418c5ceb3b8b652ca17d31e004a4", "score": "0.62048805", "text": "function hideLetter(e) {\n if (e.target.className === 'letter') {\n e.target.className = 'letter hide';\n e.target.style.transition = '0s';\n checkLetter(e);\n checkGame();\n }\n}", "title": "" } ]
89ff7ce18cdc946d92f7d0cb3d4e9023
Method to detect if the fly has collided with the wall
[ { "docid": "8277e839b9ae3e50c0e9f6965b6a528a", "score": "0.60038733", "text": "hitWall(flyX, flyY){\n // Check if the flies position is within the bounds of the wall\n if(flyX > this.pos.x - this.w/2 && flyX < this.pos.x + this.w/2 && flyY > this.pos.y - this.h/2 && flyY < this.pos.y + this.h/2){\n // If so we have hit the wall\n return true;\n }else{\n // Otherwise we haven't\n return false;\n }\n }", "title": "" } ]
[ { "docid": "30c452dad5f28e7b4b0c47e517aeafad", "score": "0.6962767", "text": "isCollided(ax, ay) {\n\t\t// Collision with walls\n\t\tlet widthLine = this.snake.stage.width / this.snake.stage.config.cw;\n\t\tlet heightLine = this.snake.stage.height / this.snake.stage.config.cw;\n\n\t\t// Self collision\n\t\tlet selfCollision = false;\n\n\t\tfor (let i = 1; i < this.snake.stage.blocks.length; i++) {\n\t\t\tvar x = this.snake.stage.blocks[i].x;\n\t\t\tvar y = this.snake.stage.blocks[i].y;\n\t\t\tif (x == ax && x > 3 && y == ay) selfCollision = true;\n\t\t}\n\n\t\tif (~[-1, widthLine].indexOf(ax) || ~[-1, heightLine].indexOf(ay) || selfCollision) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "dd4450275570930368f5a998a4e40d79", "score": "0.6844646", "text": "function check_collide(){\n\tif (frogYPos > 277){\t\t// if on lower part of board ['highway']\n\t\tcheck_cars();\t\t\t// check if collided with cars\n\t}\n\telse {\n\t\tcheck_water();\t\t\t// otherwise, check water\n\t}\n}", "title": "" }, { "docid": "7266498770e5b8e054e0d2682b490710", "score": "0.68266517", "text": "function isCollide(snake){ \r\n // If you bump into yourself \r\n for (let i = 1; i < snakeArray.length; i++) {\r\n if(snake[i].x === snake[0].x && snake[i].y === snake[0].y){\r\n return true;\r\n }\r\n }\r\n // If you bump into the wall\r\n if(snake[0].x >= 25 || snake[0].x <=0 || snake[0].y >= 25|| snake[0].y <=0){\r\n return true;\r\n }\r\n return false ;\r\n}", "title": "" }, { "docid": "5238d5e3c88d984f7fb5b8ba3cdba331", "score": "0.6802754", "text": "checkOwnCollision(){\n var snake = this.snake;\n for(var i=snake.bodyLength-1;i>0;i--){\n if ( snake.headX == snake.bodyX[i] && snake.headY == snake.bodyY[i] ){\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "04cb0fad86742397922ae3afcd3d517c", "score": "0.67669654", "text": "collision(){\n var direction = this.image_state.split(\"-\")[0];\n\n //boundary detection with walls\n if(this.boundary_detection(boundaries[direction])) {\n ctx.clearRect(this.x,this.y - 5,this.w,this.h + 10);\n this.image_state = direction + \"-running-8\";\n this.draw();\n return true;\n }\n\n //boundary detection with the lake\n if(this.boundary_detection(boundaries['lake'])) {\n this.fall();\n return true;\n }\n\n if(this.boundary_detection(boundaries[direction + '_lake'])) {\n ctx.clearRect(this.x,this.y - 5,this.w,this.h + 10);\n this.image_state = direction + \"-running-8\";\n this.draw();\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "473c4ebd2bfe971680e2882badeae195", "score": "0.6700488", "text": "checkWallCollision(){\n var snake = this.snake;\n if(snake.headX==this.width-1||snake.headX==0||snake.headY==0||snake.headY==this.height-1)\n return true;\n \n else\n return false;\n }", "title": "" }, { "docid": "55655332221d03ccae929e51829f4090", "score": "0.6667663", "text": "checkCollisions() {\n // with top pipe\n if (this.pipes1.collided(this)) {\n pauseBecauseDead = true;\n this.dead = true;\n this.flap();\n\n }\n\n // with bottom pipe\n if (this.pipes2.collided(this)) {\n pauseBecauseDead = true;\n this.dead = true;\n this.flap();\n }\n\n // with ground\n if (this.ground.collided(this)) {\n pauseBecauseDead = true;\n this.dead = true;\n this.flap();\n }\n }", "title": "" }, { "docid": "8b06909305d2cde372777cb06dc6476c", "score": "0.66666114", "text": "hasCollidedWithRival() {\n const headTip = this.getHeadTip();\n return isPointInBody(this.rivalBody, headTip);\n }", "title": "" }, { "docid": "a534339243a65ef49a5c842601bdcc81", "score": "0.6639155", "text": "collide() {\n for (let wall of this.game.things) {\n if (!(wall instanceof Wall)) continue;\n \n if (\n this.x + this.width > wall.x &&\n this.x < wall.x + wall.width\n ) {\n if (!(\n this.y > wall.gapY &&\n this.y + this.height < wall.gapY + wall.gapHeight\n )) {\n if (!this.dead) {\n this.onDead();\n }\n this.dead = true;\n } else {\n wall.playerInside = true;\n }\n } else {\n wall.playerInside = false;\n }\n }\n }", "title": "" }, { "docid": "3bdc62ee248a2149c8d7e48dd9aeb244", "score": "0.66102195", "text": "function collessionDetection() {\n if (that.y > (parentElement.boxHeight - circleHeight)) {\n flag1 = false;\n }\n if (that.y === 0) {\n flag1 = true;\n }\n\n if (that.x > (parentElement.boxWidth - circleWidth)) {\n flag2 = false;\n }\n if (that.x === 0) {\n flag2 = true;\n }\n }", "title": "" }, { "docid": "130fa0b3068f89b5a46ca349a6cc7d02", "score": "0.66097766", "text": "function collisionDetectedWall() {\r\n\r\n counter = 0;\r\n while (counter < wallArray.length) {\r\n if (humanXPosition + PLAYER_WIDTH >= wallArray[counter].XPOSITION &&\r\n humanYPosition + PLAYER_HEIGHT >= wallArray[counter].YPOSITION &&\r\n humanXPosition <= wallArray[counter].XPOSITION + WALL_WIDTH &&\r\n humanYPosition <= wallArray[counter].YPOSITION + WALL_HEIGHT) {\r\n return (true)\r\n } //End of the if\r\n\r\n counter++\r\n } //End of the while\r\n\r\n return (false)\r\n}", "title": "" }, { "docid": "0e1f362e18bf98d3ff24586c0cdd0b7b", "score": "0.6592749", "text": "function checkColliision() {\n // if the snake hits any of its joints the game is over\n for (let z = dots; z > 0; z--) {\n if ((z > 4) && (x[0] === x[z]) && (y[0] === y[z])) {\n inGame = false;\n };\n }\n // if the snake hits the bottom of the canvas the game is finished\n if (y[0] >= C_HEIGHT) {\n inGame = false;\n }\n\n if (y[0] < 0) {\n inGame = false;\n }\n // if the snake hits the side of the canvas the game is finished\n if (x[0] >= C_WIDTH) {\n inGame = false;\n }\n\n if (x[0] < 0) {\n inGame = false;\n }\n}", "title": "" }, { "docid": "290e9d8a67d557ab3e60db1f4ec8ff4b", "score": "0.6548854", "text": "function hasCollided() {\n var error = null;\n for(var i=0, len=blocks.length; i<len; i++) {\n error = blocks[i];\n if (collides(error.x, error.y, error.x + error.width, error.y + error.height,\n hero.x, hero.y, hero.x + hero.width, hero.y + hero.height)) {\n blocks.splice(i, 1);\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "c882d76c9ac1374b31a8fc47aee1c970", "score": "0.6542567", "text": "hasCollidedWithItself() {\n if (this.bodyCoordinates.length > this.length - 1) {\n const headTip = this.getHeadTip();\n return isPointInBody(this.bodyCoordinates, headTip);\n }\n return false;\n }", "title": "" }, { "docid": "2610087458db335e510faa9ee06a92f4", "score": "0.65214324", "text": "function isSelfcolliding(currentBlock) {\n while (currentBlock.blockBehind != undefined) {\n if (\n shnake.snake.firstBlock.x +\n shnake.snake.firstBlock.vx * shnake.snake.firstBlock.blockSize ===\n currentBlock.x &&\n shnake.snake.firstBlock.y +\n shnake.snake.firstBlock.vy * shnake.snake.firstBlock.blockSize ===\n currentBlock.y\n ) {\n return true;\n }\n\n currentBlock = currentBlock.blockBehind;\n }\n return false;\n}", "title": "" }, { "docid": "b4abfffa93a4eec69184a705d0241f48", "score": "0.64990103", "text": "checkCollision() {\n if (this._door) {\n if (this.destinationName)\n this.destinationName.lookAt(game.camera.get().position)\n\n const col = detectCollisionCubes(this._door, game.player.getBody())\n if (col) {\n game.loadStage(this.destination)\n }\n }\n }", "title": "" }, { "docid": "6c3d04e9dd56f18ac75f7a617e5e831a", "score": "0.6490861", "text": "function collision() {\n // check if conga hits the borders\n if (snakeX + snakeWidth > canvas.width) {\n gameOver = true;\n };\n if (snakeX < 0) {\n gameOver = true;\n };\n if (snakeY + snakeWidth > canvas.height) {\n gameOver = true;\n };\n if (snakeY < 0) {\n gameOver = true;\n };\n // check if conga hits itself\n for (let i = 0; i < tail.length-1;i++) {\n if (snakeX == tail[i].x && snakeY == tail[i].y) {\n gameOver = true;\n };\n };\n}", "title": "" }, { "docid": "7af2d5bb92ba0d7827d92031e1f967aa", "score": "0.6478933", "text": "function hasCollided(object1, object2) {\n return !(\n ((object1.y + object1.height) < (object2.y)) ||\n (object1.y > (object2.y + object2.height)) ||\n ((object1.x + object1.width) < object2.x) ||\n (object1.x > (object2.x + object2.width))\n );\n}", "title": "" }, { "docid": "ab7a95ad2512d19c94e633559c4ff33b", "score": "0.6477654", "text": "function checkCollision() {\n if (justCollided === false) // checks there hasnt just been a collision\n {\n // check the players coordinates are within a range around the enemy coordinate\n if (linky > enemyy - 50 && linky < enemyy + 50 && linkx > enemyx - 50 && linkx < enemyx + 50) {\n \n if(blocking === false) {\n loseHeart();\n } else {\n enemyLoseHeart(sword_dmg);\n }\n\n justCollided = true;\n // toggle justCollided in 2 seconds to allow another collision\n setTimeout(toggleJustCollided, 2000);\n }\n }\n}", "title": "" }, { "docid": "14db3cdd94f384c069e057729cf1dcde", "score": "0.6444599", "text": "function collisionDetectedFinish() {\r\n\r\n //The collisions for the Human and the finish line\r\n if (humanXPosition + PLAYER_WIDTH >= FINISH_X_POSITION &&\r\n humanYPosition + PLAYER_HEIGHT >= FINISH_Y_POSITION) {\r\n return (true)\r\n } else {\r\n return (false)\r\n\r\n }\r\n}", "title": "" }, { "docid": "2fb858257cd8d7e9a9d9d2eef8ddfcf7", "score": "0.6430359", "text": "function checkCollition (){\n pipes.forEach(function(pipe){\n if(flappy.isTouching(pipe)) gameOver();\n });\n}", "title": "" }, { "docid": "d3dff12f0907a2bcce36881c9987a855", "score": "0.6414134", "text": "function collisionDetected() {\r\n\r\n //The collisions for the Human and the ghost\r\n if (humanXPosition >= ghostXPosition - PLAYER_WIDTH &&\r\n humanYPosition >= ghostYPosition - PLAYER_HEIGHT &&\r\n humanXPosition <= ghostXPosition + PLAYER_WIDTH &&\r\n humanYPosition <= ghostYPosition + PLAYER_HEIGHT) {\r\n return (true)\r\n } else {\r\n return (false)\r\n }\r\n}", "title": "" }, { "docid": "c4b33ebb034342444b56122e873998ef", "score": "0.6413392", "text": "function didGameEnd() {\n // Tests if snake hit itself\n // Uses 4 because first 3 cant hit, and didCollide would be true at index 0\n for(let i = 4; i < snake.length; i++) {\n const didCollide = snake[i].x === snake[0].x && snake[i].y === snake[0].y;\n\n if (didCollide) {\n return true;\n }\n }\n\n const hitLeftWall = snake[0].x < 0;\n const hitRightWall = snake[0].x > gameCanvas.width - 10;\n const hitTopWall = snake[0].y < 0;\n const hitBottomWall = snake[0].y > gameCanvas.height - 10;\n\n return hitLeftWall ||\n hitRightWall ||\n hitTopWall ||\n hitBottomWall;\n }", "title": "" }, { "docid": "5abaf006276bd54f78397eb09bbf13b8", "score": "0.63911635", "text": "isColliding(){\n if(this.loc.x>paddle.loc.x &&\n this.loc.x<paddle.loc.x + paddle.w &&\n this.loc.y>paddle.loc.y &&\n this.loc.y<paddle.loc.y + paddle.h){\n return true;\n }else{\n return false;\n }\n\n }", "title": "" }, { "docid": "e5394855ec50b9f1c6373f0d6d0cacc6", "score": "0.63720554", "text": "function checkDeath () {\n\n\t\t// Check boundary\n\t\tif (tx < 0 || ty < 0 || tx > WIDTH/15 || ty > HEIGHT/15) {\n\t\t\tisAlive = false;\n\t\t\treturn;\n\t\t}\n\t\t// Check for collision with self\n\t\tfor (var i = 0; i < snakeCells.length; i++) {\n\t\t\tif (snakeCells[i].x == tx && snakeCells[i].y == ty){\n\t\t\t\tisAlive = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "9cd01f7e4b3340547bbdbc34f44c32d5", "score": "0.6370063", "text": "function onCollission(snake) {\r\n // body collide\r\n // for(let i of snakeArr) \r\n for (let i = 1; i < snakeArr.length; i++) {\r\n if (snake[i].x === snake[0].x && snake[i].y === snake[0].y) {\r\n return true;\r\n }\r\n }\r\n // // margin collide\r\n if (snake[0].x >= 18 || snake[0].x <= 0 || snake[0].y >= 18 || snake[0].y <= 0) {\r\n return true;\r\n\r\n }\r\n // return false;\r\n}", "title": "" }, { "docid": "5ddb71e1a4292a65ad14414b0534d93f", "score": "0.636289", "text": "collisionDetection() {\n let hasCollided = false\n this.shapeArray.nestedForEach((cell, i, j) => {\n if (!(!cell || this.y + i < 0) && (cell === true && (this.y + i === 19 || cells[this.x + j][this.y + i + 1].hasTetromino))) {\n hasCollided = true \n gameData.hardFall = false\n }\n })\n if (hasCollided) {\n elements.collision.play()\n if (this.y < 0) {\n gameOver()\n } else {\n updateScore(18)\n }\n this.shapeArray.nestedForEach((cell, i, j) => {\n if (cell) cells[this.x + j][this.y + i].hasTetromino = true\n })\n }\n return hasCollided\n }", "title": "" }, { "docid": "e89c864758b329be17a065c02f82fde4", "score": "0.63469005", "text": "checkGoalWallCollision() {\n // Check for collisions with top or bottom...\n if (this.x < 0 || this.y < 0 || this.x > width || this.y > height) {\n // It hit so reverse velocity\n this.x -= this.vx;\n this.y -= this.vy;\n // Update time properties\n this.ty = random(0, 100);\n this.tx = random(0, 100);\n }\n }", "title": "" }, { "docid": "1b4696cf36393f0ccc60b1862cb1c6a3", "score": "0.6328592", "text": "function checkCollisions(){\n return (Math.abs(list[0].current.x - list[1].current.x) <= 20\n &&\n Math.abs(list[0].current.y - list[1].current.y) <= 20);\n}", "title": "" }, { "docid": "b596a35fc22c95b2cf36fa821a7e7a94", "score": "0.63246125", "text": "detectCollisions() {\n if (this._playerState === PL_STATE_PLAY) {\n // Check for a win condition (player has reached bottom row\n if (this._gridPos.y === PLAYER_WIN_ROW) {\n gameModel.score.addScore(gameModel.star.claimAt(this._gridPos.x) ? STAR_SCORE : WIN_SCORE);\n this._playerState = PL_STATE_ANIM;\n this._playerAnim = PL_END_ANIM;\n } else {\n this._travelling = false;\n // Cycle through all enemy rows\n for (let enemy = 0; enemy < gameModel.allEnemies.length; enemy++) {\n let theEnemy = gameModel.allEnemies[enemy];\n /// Check if the current row has an enemy overlapping the player sprite\n if (theEnemy && theEnemy.hasEnemyAt(this._playerPos.x + HALF_SPRITE_WIDTH, this._playerPos.y + PLAYER_Y_OFFSET + PLAYER_HEIGHT / 2,\n PLAYER_WIDTH, PLAYER_HEIGHT)) {\n // If a collision is found, check if it's with a lilypad\n if (theEnemy.getType() === LILYPAD_SPRITE) {\n // If so, indicate player is now travelling on a lilypad\n this._travelling = true;\n } else {\n // Otherwise, it's a bug, so kill the player\n gameModel.lives.loseLife();\n this._playerState = PL_STATE_ANIM;\n this._playerAnim = PL_DEATH_ANIM;\n break;\n }\n }\n }\n }\n // Check if the player is in a water row when not travelling on a lilypad\n if (this._playerState === PL_STATE_PLAY && LEVELS[gameModel.level].rows[this._targetPos.y] === BLOCK_WATER && !this._travelling) {\n // Player has drowned\n gameModel.lives.loseLife();\n this._playerState = PL_STATE_ANIM;\n this._playerAnim = PL_DEATH_ANIM;\n }\n }\n }", "title": "" }, { "docid": "0f792f3a4adcc91cde3a1b4d2df691e4", "score": "0.6315612", "text": "get hard_collision() // For world geometry where players can walk\n\t{ return ( !this.driver_of ); }", "title": "" }, { "docid": "dec51a7d63bb086df749f8941a9807db", "score": "0.6314188", "text": "wallCollision() {\n\t\tconst leftWall = this.walls.leftWall;\n\t\tconst rightWall = this.walls.rightWall;\n\n\t\t// if the player does not currently have the invinsibility power\n\t\tif (!this.player.isInvinsible) {\t\n\t\t\t\n\t\t\t// if player collides with the left wall -> return true\n\t\t\tif (this.player.x - this.player.radius < leftWall.x + leftWall.width && \n\t\t\t\tthis.player.x + this.player.radius > leftWall.x &&\n\t\t\t\tthis.player.y - this.player.radius < leftWall.y + leftWall.height &&\n\t\t\t\tthis.player.y + this.player.radius > leftWall.y) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// if player collides with the right wall -> return true\n\t\t\tif (this.player.x - this.player.radius < rightWall.x + rightWall.width &&\n\t\t\t\tthis.player.x + this.player.radius > rightWall.x &&\n\t\t\t\tthis.player.y - this.player.radius < rightWall.y + rightWall.height &&\n\t\t\t\tthis.player.y + this.player.radius > rightWall.y) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t// if there is not collision -> return false\n\t\treturn false;\n\t}", "title": "" }, { "docid": "683d2d8a10044eda1a6d977cdace83e7", "score": "0.63084", "text": "function wallCollision() {\n if (ball.xPosition + ball.radius > canvas.width || ball.xPosition - ball\n .radius < 0) {\n ball.dx = -ball.dx;\n }\n\n if (ball.yPosition - ball.radius < 0) {\n ball.dy = -ball.dy;\n }\n\n if (ball.yPosition + ball.radius > canvas.height) {\n lives -= 1;\n scoreUnit -= 1;\n resetBall();\n }\n\n if (lives === 0) {\n isGameOver();\n }\n}", "title": "" }, { "docid": "0f812e3eff1e167e10178be38335f8bd", "score": "0.6292903", "text": "isAlive() {\r\n const head = this.body[this.body.length - 1];\r\n const { width, height } = this.playground;\r\n if (head.coord.x > width - 1\r\n || head.coord.x < 0\r\n || head.coord.y > height - 1\r\n || head.coord.y < 0) {\r\n this.alive = false;\r\n }\r\n for (let i = 0; i < this.body.length - 1; i += 1) {\r\n const curBone = this.body[i];\r\n if (head.coord.x === curBone.coord.x && head.coord.y === curBone.coord.y) {\r\n this.alive = false;\r\n break;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "ff1bccd0a556fc013103c9a1486db3b9", "score": "0.6281384", "text": "checkCollisions() {\n if (!super.checkCollisions()) return false;\n\n // Also check if it is ABOUT TO hit an interactable.\n const nextRowCol = this.board.getRowColInFront(this.direction, this.row, this.col);\n\n const boardTileInFront = this.board.grid[nextRowCol.row][nextRowCol.col];\n\n // Check if it is about to hit something that blocks high things.\n if (boardTileInFront.isHighBlocked() === true) {\n this.handleCollision(boardTileInFront.static);\n }\n\n return this.shouldContinueCheckCollisionsChain();\n }", "title": "" }, { "docid": "78dbc244d25e7d089ea7fc3c5c6ee117", "score": "0.62811834", "text": "appearOnBody(){\n for(var i = snake.body.length -1; i > 0; i--){\n if(this.loc.x === snake.body[i].x &&\n this.loc.y === snake.body[i].y){\n return true;\n }else{\n return false;\n }\n }\n }", "title": "" }, { "docid": "fff755b230a0e88627e3bd893090b063", "score": "0.627743", "text": "function collision() {\n if (cells[currentIndex].classList.contains('car') ||\n (cells[currentIndex].classList.contains('water') && !cells[currentIndex].classList.contains('log'))) {\n lives--\n livesLeft.textContent = lives\n endGame()\n cells[currentIndex].classList.remove('frog')\n currentIndex = 59\n cells[currentIndex].classList.add('frog')\n }\n }", "title": "" }, { "docid": "b4246eb2500867e78dce50c290f12e64", "score": "0.626904", "text": "function checkWallCollisions(snakeHeadX, snakeHeadY) {\n if (snakeHeadX * snakeSize >= screenWidth || snakeHeadX * snakeSize < 0 || snakeHeadY * snakeSize >= screenHeight || snakeHeadY * snakeSize < 0) {\n\n\n setState(\"GAME OVER\");\n }\n//this allows my line of code to have wall collisions\n}", "title": "" }, { "docid": "fa738a898ea2839baf1c1b9bc707b3da", "score": "0.6265472", "text": "function checkCollisionNoStop(testBlockstyleure, keyPress) {\n var xNow = currentBlock.centerPoint[0];\n var yNow = currentBlock.centerPoint[1];\n var testMainPoints = testBlockstyleure.squareMainPoints;\n // 1. collide with side blocks or walls when change\n if (keyPress == \"Enter\") {\n for (var i in testMainPoints) {\n var xNext = xNow + testMainPoints[i][0];\n var yNext = yNow + testMainPoints[i][1];\n if (backGround[xNext][yNext] == undefined || backGround[xNext][yNext].occupied == true) {\n return true;\n }\n }\n }\n // 2. collide the wall\n else {\n var xMove = 0;\n if (keyPress == \"a\") {\n xMove = -1;\n } else if (keyPress == \"d\") {\n xMove = 1;\n }\n for (var i = 0; i < 4; i++) {\n var nextX = testMainPoints[i][0] + xNow + xMove;\n var nextY = testMainPoints[i][1] + yNow;\n if (nextX < 0 ||\n nextX >= colNum ||\n backGround[nextX][nextY] != undefined && backGround[nextX][nextY].occupied) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "e8f712d6acedee071b76519e72e5ad4b", "score": "0.6258814", "text": "reachedGhostHouse() {\n if (this.currentPosition.x == this.startingPosition.x) {\n if (this.currentPosition.y == this.startingPosition.y) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "a567c01f15e31b68783b97fa6616d4a7", "score": "0.62548935", "text": "function checkCollisions(){\n if(pacman.x === inky.x && pacman.y === inky.y){\n console.log(\"You're dead\");\n pacmanCanMove = false;\n }\n if(pacman.x === pinky.x && pacman.y === pinky.y){\n console.log(\"You're dead\");\n pacmanCanMove = false;\n }\n if(pacman.x === clyde.x && pacman.y === clyde.y){\n console.log(\"You're dead\");\n pacmanCanMove = false;\n }\n if(pacman.x === blinky.x && pacman.y === blinky.y){\n console.log(\"You're dead\");\n pacmanCanMove = false;\n }\n}", "title": "" }, { "docid": "2a7dc67f0e15561b4d2097d7628d031d", "score": "0.6238119", "text": "snakeBodyCollision() {\n for (let i = 0; i < this.snake.body.length; i++) {\n if (\n this.snake.body[i][0] == this.nextStep[0] &&\n this.snake.body[i][1] == this.nextStep[1]\n ) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "250a2664bab492f6c77144d2a9e5b767", "score": "0.6236502", "text": "function wallIsCollide(points, wall, radius){\n return (checkIsWithin(points[0], [wall[0], wall[2]]) && checkIsWithin(points[1], [wall[1], wall[3]]));\n}", "title": "" }, { "docid": "c151085858f5619a62b03c0b0b1695c6", "score": "0.62318903", "text": "function checkCollisions() {\n var collided = false;\n allEnemies.forEach(function(enemy) {\n if (enemy.row == player.row) {\n if(enemy.x + 83 > player.y && enemy.x < player.x + 83){\n collided = true;\n };\n };\n });\n return collided;\n}", "title": "" }, { "docid": "4aff10fb3f411cbe73ce6dcf6baf6578", "score": "0.6231796", "text": "checkCollision() {\n let head = this.snake.body[0]\n if (head.x < 0 || head.x > this.width - 1) {\n return true\n } else if (head.y < 0 || head.y > this.height - 1) {\n return true\n }\n for (let i = 1; i < this.snake.body.length; i++) {\n let item = this.snake.body[i]\n if (head.x === item.x && head.y === item.y) {\n return true\n }\n }\n return false\n }", "title": "" }, { "docid": "3ee97206a9917ee95bc7866fbd9531cf", "score": "0.6223198", "text": "detectCollision(){\n\t\t\tlet left = this.x;\n\t\t\tlet right = this.x + this.w;\n\t\t\tlet top = this.y;\n\t\t\tlet bottom = this.y + this.h;\n\t\t\tlet playerLeft = player.x;\n\t\t\tlet playerRight = player.x + player.r; \n\t\t\tlet playerTop = player.y;\n\t\t\tlet playerBottom = player.y + player.r; \n\t\t\t//If any one of these are true , returns true, meaning not colliding.!(True), meaning colliding.\n\t\t\treturn !(left >= playerRight || right <= playerLeft || top >= playerBottom || bottom <= playerTop)\n\n\t\t}", "title": "" }, { "docid": "de7c9f6091cac591678f169fba2bfcce", "score": "0.6222565", "text": "checkCollision() {\n // check if we hit coin\n if (this.segments[0].x == this.coin.x \n && this.segments[0].y == this.coin.y) {\n this.setCoin(); // place new coin\n this.grow = true; // flag the snake to grow on next move cycle\n return false; // the coin point is known safe\n }\n\n // check wall collisions\n if (this.segments[0].x < 0 || this.segments[0].x >= this.width\n || this.segments[0].y < 0 || this.segments[0].y >= this.height)\n return true;\n\n // check collisions with other segments\n for (let i = 1; i < this.segments.length; i++)\n if (this.segments[0].x == this.segments[i].x\n && this.segments[0].y == this.segments[i].y)\n return true;\n }", "title": "" }, { "docid": "11f1c4a91bde7e4f298042e9694a381e", "score": "0.62119645", "text": "checkCollisions() {\n /* Detect if image of player and image of current enemy overlap.\n * x/y delta lower than width/height of player image,\n * in order to avoid fake collisions with transparent part of image, player's crown, etc.\n */\n if (Math.abs(player.x - this.x) < 70 && Math.abs(player.y - this.y) < 30) {\n player.meetEnemy();\n }\n }", "title": "" }, { "docid": "d5f5d63d94cfdd91765f5a9d2d5be20f", "score": "0.62016994", "text": "isWallConnected(wall) {\n\t\tlet i;\n\t\tfor (i = 0; i < this.wallStarts.length; i++) {\n\t\t\tif (this.wallStarts[i] == wall) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < this.wallEnds.length; i++) {\n\t\t\tif (this.wallEnds[i] == wall) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "3dadd873dfa7e95c5c66532213725044", "score": "0.6196524", "text": "function checkCollision(newHead){\n\t\tfor (var i=0; i < snake.body.length; i++) {\n\t\t if ((snake.body[i].x == newHead.x) && snake.body[i].y == newHead.y){\n\t\t \tconsole.log('collision with self');\n\t\t \treturn true;\n\t\t }\n\t\t};\n\t\treturn false;\n\t}", "title": "" }, { "docid": "fc8f9db6d5d894bb5d30f0df76e707e9", "score": "0.61938584", "text": "function collisionDetection () {\n if ($bird.position().left < poleTop.position().left + poleTop.width() && $bird.position().left + $bird.width() > poleTop.position().left && $bird.position().top < poleTop.position().top + poleTop.height() && $bird.height() + $bird.position().top > poleTop.position().top) {\n gameEnd()\n }\n if ($bird.position().left < poleBottom.position().left + poleBottom.width() && $bird.position().left + $bird.width() > poleBottom.position().left && $bird.position().top < poleBottom.position().top + poleBottom.height() && $bird.height() + $bird.position().top > poleBottom.position().top) {\n gameEnd()\n }\n }", "title": "" }, { "docid": "c0107cd1e27e70424b2cf62192a73ad6", "score": "0.6177614", "text": "checkCollisions() {\n if (this.row === player.row &&\n ((this.x >= player.x && this.x <= player.x + player.width) ||\n (this.x + this.width >= player.x && this.x + this.width <= player.x + player.width))\n ) {\n console.log(\"Collision!!\");\n reset();\n }\n }", "title": "" }, { "docid": "964ff89089690e042ec5e7f2cb84e873", "score": "0.61714494", "text": "checkCollision(bot) {\n if (game.input.mousePointer.x < bot.x + bot.width && \n game.input.mousePointer.x > bot.x && \n game.input.mousePointer.y < bot.y + bot.height &&\n game.input.mousePointer.y > bot.y) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "ea813c49c7dcb16de938fe30d6dc3f8e", "score": "0.6169415", "text": "checkWallCollisions() {\n // series of if statements for bounces of walls\n if(this.cannon.position.x <= 0){\n this.collision(90);\n }\n if(this.cannon.position.x >= w){\n this.collision(270);\n }\n if(this.cannon.position.y <= 0){\n this.collision(360);\n }\n // if home screen ball bounces off bottom\n if(this.cannon.position.y >= h && this.home) {\n\t\t\tthis.collision(180);\n }\n }", "title": "" }, { "docid": "127e63d4b66f4adb923992da68c6aed6", "score": "0.6164999", "text": "function checkCollision(){\n var head = snakeBits[0];\n \n if(head.x < 0 || head.x >= MAX_X || \n head.y < 0 || head.y >= MAX_Y ||\n inSnake(head.x, head.y, false)\n )\n {\n gameOver()\n }\n }", "title": "" }, { "docid": "369e596444423f4d3677c9aada48da4d", "score": "0.6163554", "text": "headStandingCheck() {\n this.scene.matterCollision.addOnCollideStart({\n objectA: this.sensors.bottom,\n objectB: this.getAnotherPlayer().sensors.top,\n callback: this.isOnHead,\n context: this,\n });\n this.scene.matterCollision.addOnCollideEnd({\n objectA: this.sensors.bottom,\n objectB: this.getAnotherPlayer().sensors.top,\n callback: this.isNotOnHead,\n context: this,\n });\n }", "title": "" }, { "docid": "ac33b04e10470ee9a28ab52fb140ea72", "score": "0.61627626", "text": "isColliding (point) {\n return false; // Placeholder\n }", "title": "" }, { "docid": "ba538b877fdc1e76688b8f8699ba8e8c", "score": "0.6157049", "text": "function isCollidedWithEarth(strawberry) {\n if (!strawberry.isCollidedWithTheEarth()) { return; }\n\n strawberryCounter.increment();\n removeOneStrawberry(strawberry);\n\n if (shownstrawberryHasLandedOnEarthMessage) {\n addStrawberries();\n } else {\n physics.state.paused = true;\n shownstrawberryHasLandedOnEarthMessage = true;\n\n gameoverMessage.showWithContinueButton(\"A giant strawberry-shaped object safely landed on the Earth. Its landing site became a thriving tourist attraction, where one can sip on a strawberry smoothie from a strawberry-shaped disposable cup, while perusing a vast selection of strawberry-shaped key chains, baseball caps and spaceship fresheners.\", didTapContinueButtonAfterCollisionWithEarth);\n }\n }", "title": "" }, { "docid": "440dcc9da5cfb43488120998d99c323d", "score": "0.615026", "text": "function checkForCollision() {\n\n setInterval(function () {\n checkForHenCollision();\n checkForChickenCollission();\n checkForBossCollision();\n checkForAlternatingHenCollision();\n checkForBottleCollection();\n checkForCoinCollection();\n checkIfBottleHitBoss();\n }, 100);\n}", "title": "" }, { "docid": "cd773f890339191bbd81a1be68bccadf", "score": "0.61301494", "text": "detectCollisions() {\n var self = this;\n self.collidables.forEach(function(d1) {\n self.collidables.forEach(function(d2) {\n if(((d1.x + d1.width >= d2.x) && (d1.x <= d2.x + d2.width))\n && ((d1.y + d1.height >= d2.y) && (d1.y <= d2.y + d2.height)) && !(d1 === d2)) {\n self.notifyCollilsion(d1, d2); //eventaully need to raise a method that notifies its args of the collision (observer)\n }\n //no contact and in contact remove d2 from d1's contact list\n else {\n //if they are in contact remove from contact\n var indexOfContactedItem = d1.contactList.indexOf(d2);\n if(indexOfContactedItem > -1)\n d1.onContactLost(d2, indexOfContactedItem); //pass it the index so we don't have to find it again\n }\n });\n })\n }", "title": "" }, { "docid": "c5286be2b94799543e082920b1fb5219", "score": "0.61299956", "text": "wallsPassed() {\n\t\t// if the walls are off the screen\n\t\tif (this.walls.leftWall.y >= canvas.height) {\n\t\t\tthis.walls.leftWall.hasPassed = true;\n\t\t\tthis.updateScore();\n\t\t}\n\t}", "title": "" }, { "docid": "9681acf0f54ef9c8495a299581ced06d", "score": "0.61122954", "text": "checkHole(){\n if(this.done === false && this.utterCompletion === false && this.x > this.holeX - 22 && this.x < this.holeX + 22 && this.y > this.holeY - 22 && this.y < this.holeY + 22){\n this.dx = 0;\n this.dy = 0;\n this.done = true;\n score++;\n return true;\n }\n }", "title": "" }, { "docid": "2ed3df3a15fbc1fa5da8739ed93b2273", "score": "0.61098045", "text": "function HittingTheWall(){\n for(let i = 0; i < curTetromino.length; i++){\n let newX = curTetromino[i][0] + startX;\n if(newX <= 0 && direction === DIRECTION.LEFT){\n return true;\n } else if(newX >= 11 && direction === DIRECTION.RIGHT){\n return true;\n } \n }\n return false;\n}", "title": "" }, { "docid": "c5b533352c5f755073655caa04db8ae2", "score": "0.61098003", "text": "checkCollisions() {\n /* Detect if image of player and image of current gem overlap.\n * y delta lower than width/height of player image,\n * in order to avoid fake collisions with transparent part of image, player's crown, etc.\n */\n if (player.x === this.x && Math.abs(player.y - this.y) < 50) {\n player.collectGem(this.sprite);\n this.reset();\n }\n }", "title": "" }, { "docid": "533e5e5f07135e7522c72f7dcd98682d", "score": "0.61056495", "text": "checkCollisions() {\n const playerPosition = player.getPosition();\n const xDist = Math.abs(playerPosition.x - this.x);\n const yDist = Math.abs(playerPosition.y - this.y);\n // Horizontal collision distance = 40% of the column width\n if (xDist < COL_WIDTH * 0.4 && yDist === 0) {\n // Move the player back to their initial square\n player.reset();\n }\n }", "title": "" }, { "docid": "f8533405bf84d430e9556c708273d4fe", "score": "0.6105423", "text": "function isCollidingLeft() {\n return humans.some((elem) => {\n return elem % width === 0\n })\n\n }", "title": "" }, { "docid": "2908b373132ff456b1d8f0755cd2882b", "score": "0.60999125", "text": "collide(x, y) { return this.x === x && this.y === y }", "title": "" }, { "docid": "3ac35df0a9c37141fc91821014b8b350", "score": "0.609667", "text": "checkCollisions () {\n let xDistace = this.x - player.x\n let yDistace = this.y - player.y\n let xyDistance = Math.sqrt(xDistace * xDistace + yDistace * yDistace)\n if (xyDistance < this.radious + player.radious) {\n // a collision was deteced so the player wil start again from one of the initial points\n player.y = config.player.initial_Y\n player.x = config.player.playerInitX[Math.floor((Math.random() * 3))]\n }\n }", "title": "" }, { "docid": "9616e6dec1eff9cfc26409a036b624ed", "score": "0.608478", "text": "function collision_down() {\n return collision(piece.lower_face());\n}", "title": "" }, { "docid": "0663a04f3d43d89c579a92ca2bcf67bd", "score": "0.6080467", "text": "function checkDeath() {\n gameOver = outsideGrid(getSnakeHead()) || snakeIntersection()\n}", "title": "" }, { "docid": "05e5eee23377e664d65b6cb30b572c56", "score": "0.6075546", "text": "function detectColision(){\n var colision = false;\n if(snake.body[0].x > NB_HORIZONTAL_CELL-1){\n colision = true;\n }\n else if(snake.body[0].x < 0){\n colision = true;\n }\n else if(snake.body[0].y >= NB_VERTICAL_CELL){\n colision = true;\n }\n else if(snake.body[0].y < 0){\n colision = true;\n }\n \n //if the snake hits one of its segments, it dies:\n for(var i = 1; i < snake.body.length; ++i){\n if(snake.body[0].x == snake.body[i].x && snake.body[0].y == snake.body[i].y){\n colision = true;\n break;\n }\n }\n if(colision == true){\n snake_accident_sound.currentTime = 0.5;\n snake_accident_sound.play();\n snake.die();\n show_message(\"Ouch!\",{size: \"2em\"}, can.width/2, can.height/3);\n game_over();\n }\n if(snake.body[0].x == food.x && snake.body[0].y == food.y){\n food_eaten_sound.play();\n snake.eat(food);\n score += food.value;\n\n $score.innerHTML = score;\n if((FOOD_EATEN + SNAKE_DEFAULT_SIZE) == (NB_VERTICAL_CELL * NB_HORIZONTAL_CELL)-1){\n game_finished();\n }\n else\n food.generateNew(snake.body);\n if(FOOD_EATEN < REQUIRED_FOOD-1)\n FOOD_EATEN++;\n else{\n level_up_sound.play();\n FOOD_EATEN = 0;\n LEVEL++;\n $level.innerHTML = LEVEL;\n if(LEVEL < MAX_LEVEL) //At the last level, snakes speed is limited.\n snake.speed = DEFAULT_PERIOD - (PERIOD_DIFFRENCE*LEVEL);\n }\n }\n}", "title": "" }, { "docid": "e2d6935321dd42c5f280eb0bec561644", "score": "0.6067937", "text": "isCollidedWith(obj) {\n return (Math.abs(this.x - obj.x) <= this.width && Math.abs(this.x - obj.x - 32) >= this.width) && \n (Math.abs(this.y - obj.y) <= this.height && Math.abs(this.y - obj.y - 32) >= this.width);\n }", "title": "" }, { "docid": "ce96329a06c7c009df888bf243d91cbd", "score": "0.6066507", "text": "function collisionCheck(){\n\n}", "title": "" }, { "docid": "4b8a8f493e7fc79f97244ced6ab30753", "score": "0.6059301", "text": "checkCollisions() {\n for ( var index=0; index < allEnemies.length; index++) {\n if ( allEnemies[index].x < this.x + 50 && allEnemies[index].x > this.x - 50 ){\n if ( allEnemies[index].y < this.y + 45 && allEnemies[index].y > this.y - 45 ){\n this.x = 200;\n this.y = 400;\n this.lives--;\n if( this.lives === 0 ){\n this.score = 0;\n lost = true;\n }\n };\n };\n }\n }", "title": "" }, { "docid": "c80360c75642a398acff4c4bc9687578", "score": "0.60557586", "text": "collisionDetection() {\n // if it passes the catcher, take it out of the array and its now 'dead' but still rendering\n if (this.y > catcherYpos - this.radius) {\n const keydown = catcherR.keydown;\n this.alive = false;\n // logic to determine score/life count\n // if this objects color matches the catcher + keydown, point++ and it bounces\n if (keydown && this.color == catcherR.color) {\n this.caught = true;\n this.speedY = 0.5 * this.speedY;\n plusScore.play();\n score++;\n }\n // if not matching + keydown OR if matching and no keydown, life--\n if (\n (!keydown && this.color == catcherR.color) ||\n (keydown && this.color !== catcherR.color)\n ) {\n minusLife.play();\n lives--;\n }\n }\n }", "title": "" }, { "docid": "2a57b4ac8197555e8f3523081063b068", "score": "0.6055617", "text": "collisionCheck() {\n if (this.posY >= height - birdRadius) {\n birdAlive = false;\n restartScreen();\n }\n\n if((tubes.posX + (birdRadius * 6) > tubeWidth) && (tubes.posX - (birdRadius * 6) < tubeWidth)) { \n if ((this.posY + (birdRadius) > bottomTube) || (this.posY - birdRadius < topTube)) {\n birdAlive = false;\n restartScreen();\n }\n }\n\n if((tubes.posX2 + (birdRadius * 6) > tubeWidth) && (tubes.posX2 - (birdRadius * 6) < tubeWidth)) { \n if ((this.posY + (birdRadius) > bottomTube2) || (this.posY - birdRadius < topTube2)) {\n birdAlive = false;\n restartScreen();\n }\n }\n }", "title": "" }, { "docid": "a253b30cbcf09fb6de58ee647d530302", "score": "0.6044953", "text": "colliding(snake, width, height) {\n let isCollision = false;\n // if snake's head is off the screen then collision\n if (this.x < 0 || this.x >= (width / tileSize) ||\n this.y < 0 || this.y >= (height / tileSize)) {\n isCollision = true;\n }\n // if head collides with any other part of the tail then collision\n for (let i = 0; i < snake.tail.length; i++) {\n if (this.equals(snake.tail[i].location)) {\n isCollision = true;\n break;\n }\n }\n return isCollision;\n }", "title": "" }, { "docid": "289c43f1cf48e0887a1cd78711e4c07d", "score": "0.6036262", "text": "isHole() {\n return this.field[this.currentY][this.currentX] === hole;\n }", "title": "" }, { "docid": "78925425c2bae43caa05a1cb0e07288e", "score": "0.60362375", "text": "checkAdjacentCollision(object) {\r\n return game.player.i - 50 === object.i;\r\n }", "title": "" }, { "docid": "48027582ec3181db2389a364e63789a8", "score": "0.60352933", "text": "function checkColl(params) {\n\tvar blueHead = blueSnack[0];\n\tvar redHead = redSnack[0];\n\t// check eat in normal situation\n\tif (blueSnack.length != 1 && redSnack.length != 1) {\n\t\tfor (var i = 0; i < redSnack.length; i++) {\n\t\t\tif (blueHead.x == redSnack[i].x && blueHead.y == redSnack[i].y && blueHead != redHead) {\n\t\t\t\tblueEat = true;\n\t\t\t}\n\t\t}\n\n\t\tfor (var i = 0; i < blueSnack.length; i++) {\n\t\t\tif (redHead.x == blueSnack[i].x && redHead.y == blueSnack[i].y && redHead != blueHead) {\n\t\t\t\tredEat = true;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//check eat while one is to die\n\telse{\n\t\tfor (var i = 0; i < redSnack.length; i++) {\n\t\t\tif (blueHead.x == redSnack[i].x && blueHead.y == redSnack[i].y) {\n\t\t\t\tblueEat = true;\n\t\t\t}\n\t\t}\n\n\t\tfor (var i = 0; i < blueSnack.length; i++) {\n\t\t\tif (redHead.x == blueSnack[i].x && redHead.y == blueSnack[i].y) {\n\t\t\t\tredEat = true;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\t//check blue wall\n\tif (blueHead.x == 0){\n\t\tif (blueDrt == direction.Left){\n\t\t\tredEat = true;\n\t\t}\n\t}\n\tif (blueHead.x == width - 1){\n\t\tif (blueDrt == direction.Right){\n\t\t\tredEat = true;\n\t\t}\n\t}\n\tif (blueHead.y == 0){\n\t\tif (blueDrt == direction.Up){\n\t\t\tredEat = true;\n\t\t}\n\t}\n\tif (blueHead.y == height - 1){\n\t\tif (blueDrt == direction.Down){\n\t\t\tredEat = true;\n\t\t}\n\t}\n\t//check red wall\n\tif (redHead.x == 0){\n\t\tif (redDrt == direction.Left){\n\t\t\tblueEat = true;\n\t\t}\n\t}\n\tif (redHead.x == width - 1){\n\t\tif (redDrt == direction.Right){\n\t\t\tblueEat = true;\n\t\t}\n\t}\n\tif (redHead.y == 0){\n\t\tif (redDrt == direction.Up){\n\t\t\tblueEat = true;\n\t\t}\n\t}\n\tif (redHead.y == height - 1){\n\t\tif (redDrt == direction.Down){\n\t\t\tblueEat = true;\n\t\t}\n\t}\n\t\n\t//check if they crash in heads\n\tif (blueHead == redHead){\n\t\treset = true;\n\t}\n}", "title": "" }, { "docid": "5849a8dbcb9c783b7e6e2d56ca815356", "score": "0.60310185", "text": "checkCollision() {\n if (birb.x < this.x + this.w && birb.x + birb.w > this.x) {\n if (birb.y < this.y + this.h && birb.y + birb.h > this.y) {\n this.c = \"red\";\n }\n }\n else {\n this.c = \"green\";\n }\n }", "title": "" }, { "docid": "dc530a4c7f6e4ccaae206ca1731bfc37", "score": "0.60238534", "text": "function detectCollision(l,m)\r\n{\r\n var distance=dist(l.body.position.x, l.body.position.y, m.body.position.x, m.body.position.y)\r\n if(distance<=l.width/2+m.width/2||distance<l.height/2+m.width/2)\r\n {\r\n Matter.Body.setStatic(m.body,false)\r\n }\r\n}", "title": "" }, { "docid": "2f3e1c9d8832f74f40e6c8fecd7b83d4", "score": "0.6020003", "text": "function didGameEnd() {\n for (let i = 4; i < snake.length; i++) {\n if (snake[i].x === snake[0].x && snake[i].y === snake[0].y)\n return true\n }\n\n const hitLeftWall = snake[0].x < 0;\n const hitRightWall = snake[0].x > gameCanvas.width - 10;\n const hitTopWall = snake[0].y < 0;\n const hitBottomWall = snake[0].y > gameCanvas.height - 10;\n\n return hitLeftWall || hitRightWall || hitTopWall || hitBottomWall\n}", "title": "" }, { "docid": "a712f0abdd9930fffeb1e3bf423e5154", "score": "0.60174435", "text": "function OnCollisionEnter(theCollision : Collision)\n{\n\tif(theCollision.gameObject.name == \"Wall\")\n\t{\n\t\tDebug.Log(\"Ouch!\");\n\t}\n}", "title": "" }, { "docid": "5e418d89ffe3987cd3a7b17b33b6ef47", "score": "0.60166276", "text": "function checkForCollusion(playerX, playerY, playerWidth, playerHeight, tileX, tileY, tileWidth, tileHeight) {\n if (playerX < tileX + tileWidth && playerX + playerWidth > tileX &&\n playerY < tileY + tileHeight && playerY + playerHeight > tileY) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "6d711d051837935acb862032eab360ac", "score": "0.6006821", "text": "function detectCollision(){\n\tvar characterXPos = $('#stick-figure').position().left;\n\tvar characterYPos = $('#stick-figure').position().top;\n\tvar characterHeight = $('#stick-figure').height();\n\tvar characterWidth = $('#stick-figure').width();\n\tvar blockXPos = $('.block').position().left;\n\tvar blockYPos = $('.block').position().top;\n\tvar blockHeight = $('.block').height();\n\tvar blockWidth = $('.block').width();\n\n\t// only checks once block is in range of touching character div\n\tif(characterXPos + characterWidth >= blockXPos){\n\t\t/*\n\t\t\tThis is what checks for the actual collisions.\n\t\t*/\t\n\t\tif(characterXPos < blockXPos + blockWidth &&\n\t\t\tcharacterXPos + characterWidth > blockXPos &&\n\t\t\tcharacterYPos < blockYPos + blockHeight &&\n\t\t\tcharacterHeight + characterYPos > blockYPos){\n\t\t\t//there has been a collision! Loser!\n\t\t\tendGame();\n\t\t// Gives a single point as long as block is still in range of stick-figure div\n\t\t}else if(!(characterXPos > blockXPos + blockWidth)){\n\t\t\tclearInterval(collisionInterval);\n\t\t\tscore++;\n\t\t\t// in view.js\n\t\t\tchangeScoreText(score);\n\n\t\t\t// Every 5 points, make a new round\n\t\t\tif(score % 5 == 0){\n\t\t\t\taddRound();\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e975d40aea4a8515bcdea1eda6306523", "score": "0.6004264", "text": "function detectCollisionVertical() {\r\n var collision = false;\r\n if (direction === \"down\") {\r\n if (nextLocations.some(location => location[0] > gBoard.length - 1)) {\r\n return (collision = true);\r\n }\r\n if (\r\n nextLocations.some(location => gBoard[location[0]][location[1]].isLocked)\r\n ) {\r\n collision = true;\r\n }\r\n }\r\n return collision;\r\n}", "title": "" }, { "docid": "8af2b629d4468f4644a04cd9d2ffac87", "score": "0.6003312", "text": "wallCollision() {\n const hitLeft = this.x - this.radius <= 0;\n const hitRight = this.x + this.radius >= this.boardWidth;\n const hitTop = this.y - this.radius <= 0;\n const hitBottom = this.y + this.radius >= this.boardHeight;\n\n if (hitLeft || hitRight) {\n this.vx = -this.vx;\n } else if (hitTop || hitBottom) {\n this.vy = -this.vy;\n }\n }", "title": "" }, { "docid": "505a8fac6fe48f32e4417cd4ef7daeab", "score": "0.5990172", "text": "function isColliding(activity, actIndex, listFull) {\n\t var timeInit = activity.timeInit;\n\n\t if(concurs(listFull, timeInit, actIndex)) {\n\t activity.collision = true;\n\t }\n\t}", "title": "" }, { "docid": "3af6254bf7b14f01e2d77c718f2b2dc8", "score": "0.5988213", "text": "checkCollision (snake_x, snake_y) {\n if ((this.x == snake_x) & (this.y == snake_y)) {\n this.times_eaten += 1;\n return true\n }\n }", "title": "" }, { "docid": "93be6b260fc4b8fee1b013ab6857fa23", "score": "0.59852195", "text": "function is_ended(){\n transpose_grid=transpose(grid_player);\n for (var i=0;i<nb_column;i++)\n {\n for (var j=0;j<nb_lines-3;j++)\n {\n if(four_piece_aligned(grid_player[i].slice(j,j+4)) ||\n four_piece_aligned(transpose_grid[i].slice(j,j+4)))\n {\n won();\n }\n }\n }\n if (check_diagonale(grid_player) || check_diagonale(tranpose_vertically(grid_player)))\n {\n won();\n }\n is_full=true;\n for (var i=0;i<grid_player.length;i++)\n {\n for (var j=0;j<grid_player[i].length;j++)\n {\n if (grid_player[i][j]==0){is_full=false;}\n }\n }\n if (is_full){won(true);}\n}", "title": "" }, { "docid": "ee9193f90fb7dfb95f8c77a1ee1252ca", "score": "0.5983616", "text": "triggersCollisionEvent() { return this.hasCollisionEvent; }", "title": "" }, { "docid": "0f43bbc69bf9c02883263a39eda06df5", "score": "0.59823936", "text": "function collision() {\n console.log(\"Another rover encountered. Cannot move forward. Go around.\");\n}", "title": "" }, { "docid": "1b11f2fa17a03bfa1abb19341417b795", "score": "0.59820443", "text": "function ballWallCollision(){\n if(ball.x + ball.radius > cvs.width || ball.x - ball.radius < 0){\n ball.dx = - ball.dx;\n WALL_HIT.play();\n }\n \n if(ball.y - ball.radius < 0){\n ball.dy = -ball.dy;\n WALL_HIT.play();\n }\n \n if(ball.y + ball.radius > cvs.height){\n LIFE--; // LOSE LIFE\n LIFE_LOST.play();\n resetBall();\n }\n}", "title": "" }, { "docid": "ad54d9c4d1cdce6fb858ea7b2bea8b31", "score": "0.59819543", "text": "collide () {\n if (!this.isCollision()) return\n\n const dt = this.getNearestContactTime()\n this.moveBallsByTime(dt)\n this._collide()\n this.moveBallsByTime(-dt)\n }", "title": "" }, { "docid": "609d446b3e27e5b29bfc58f00cd136d1", "score": "0.59775126", "text": "function isCollide(pFish, trash) {\r\n return pFish.x < trash.x + trash.trashImage.width &&\r\n pFish.x + pFish.image.width > trash.x &&\r\n pFish.y < trash.y + trash.trashImage.height + 5 &&\r\n pFish.y + pFish.image.height > trash.y + 5;\r\n}", "title": "" }, { "docid": "a6d9163f2e3d32f2a190d02ca38d3d26", "score": "0.5976702", "text": "checkCollision(_y, _x, width) {\n width = Math.min(width, Math.min(this.tileHeight, this.tileWidth));\n\n let x = _x - (this.layerData.properties.offsetX || 0);\n let y = _y - (this.layerData.properties.offsetY || 0);\n\n\n return !(this.checkPointInBlockedCell(x - width / 2, y - width / 2)\n || this.checkPointInBlockedCell(x - width / 2, y + width / 2)\n || this.checkPointInBlockedCell(x + width / 2, y - width / 2)\n || this.checkPointInBlockedCell(x + width / 2, y + width / 2)\n );\n }", "title": "" }, { "docid": "f93fdaa23e4a16df0b2c3c3d6a292c60", "score": "0.5975204", "text": "function check_duo_collision(){\n console.log(snake_array)\n console.log(snake_array.length)\n // Edge Case someone purposely tries it. Don't.\n if (snake_array.length > 6){\n for (var j = 0; j < snake_array.length; j++) {\n if (c1 != undefined){\n //console.log(c.x,c1.x);\n for (var i = 0; i < c1.length; i++) {\n if (snake_array[j].x == c1[i].x && snake_array[j].y == c1[i].y){\n return true;\n }\n };\n }\n };\n }\n }", "title": "" }, { "docid": "91a1a8ef0c618d8cc35b3a4eced47905", "score": "0.5974416", "text": "function collisionDetection() {\r\n for (col = 0; col < blockColumnCount; col += 1) {\r\n for (row = 0; row < blockRowCount; row += 1) {\r\n let b = blocks[col][row];\r\n if (b.status == 1) {\r\n if (xAxis > b.xAxis && xAxis < b.xAxis + blockWidth && yAxis > b.yAxis && yAxis < b.yAxis + blockHeight) {\r\n dy = -dy;\r\n b.status = 0;\r\n score += 1;\r\n if (score == blockRowCount * blockColumnCount) {\r\n let myVar = setTimeout(alertWin, 100);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "2718c2d9191f77d64242f0b96000af91", "score": "0.59713846", "text": "collisionCheck() {\n this.loserCheck();\n }", "title": "" } ]
019aca1215ada5708f9b99af41effa6b
Makes the actual counting
[ { "docid": "b006343e78fbfd721f15be3720212681", "score": "0.0", "text": "function count() {\n\t\tif (LogoutTimer.getInstance().secondsRemaining > 0) {\n\t\t\tLogoutTimer.getInstance().secondsRemaining--;\n\t\t\t//the timer will appear at 120 seconds\n\t\t\tif (LogoutTimer.getInstance().secondsRemaining === 120) {\n\t\t\t\t$(\"#top-menu .soon\").removeClass(\"transparent hidden\");\n\t\t\t}\n\t\t\t//since its no visible, we must format it and display it\n\t\t\tif (LogoutTimer.getInstance().secondsRemaining <= 120) {\n\t\t\t\tvar minutes = parseInt(LogoutTimer.getInstance().secondsRemaining / 60, 10);\n\t\t\t\tvar seconds = LogoutTimer.getInstance().secondsRemaining - minutes * 60;\n\t\t\t\tif (minutes < 10) {\n\t\t\t\t\tminutes = \"0\" + minutes;\n\t\t\t\t}\n\t\t\t\tif (seconds < 10) {\n\t\t\t\t\tseconds = \"0\" + seconds;\n\t\t\t\t}\n\n\t\t\t\tvar temp = $(\"#top-menu .soon\").text().split(\" \");\n\n\t\t\t\t$(\"#top-menu .soon\").text(minutes + \":\" + seconds + \" \" + temp[1]);\n\t\t\t\tif (LogoutTimer.getInstance().secondsRemaining === 0) {\n\t\t\t\t\tclearTimeout(setIntervalTimer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "4c678064adadaf0a806edd52af564f60", "score": "0.768005", "text": "function count() {\n return cnt;\n }", "title": "" }, { "docid": "a119076b54aabbd118355ff9bdf1c173", "score": "0.73225385", "text": "function addCount() {\n // TODO: set the count to whatever it was before + 1\n\n }", "title": "" }, { "docid": "5d65ec20882171f587251eec507a72f9", "score": "0.7303364", "text": "async totalCount() { }", "title": "" }, { "docid": "e530e62bcf30a276a5f6c10450de9535", "score": "0.72317284", "text": "function count(){\n counter++;\n return counter;\n }", "title": "" }, { "docid": "93cfd63513fe0b7258798c1e5f452ec4", "score": "0.7151518", "text": "set Count(value) {}", "title": "" }, { "docid": "ff168d4668cb869bdff3705dbe55687d", "score": "0.705145", "text": "function counter() {\n return counter.count++;\n }", "title": "" }, { "docid": "ff168d4668cb869bdff3705dbe55687d", "score": "0.705145", "text": "function counter() {\n return counter.count++;\n }", "title": "" }, { "docid": "ff168d4668cb869bdff3705dbe55687d", "score": "0.705145", "text": "function counter() {\n return counter.count++;\n }", "title": "" }, { "docid": "561814a0d538f812a0dd3f403ece86e3", "score": "0.7013091", "text": "count(n, o, f) {\n return n.count * 10;\n }", "title": "" }, { "docid": "3547706f50b8030c7549900c2ae1db8e", "score": "0.6967814", "text": "get Count() {}", "title": "" }, { "docid": "e1ddfc8e9d76706c84037c667a27892c", "score": "0.69669133", "text": "count() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "0525a0a5419c3aae29a91e81c4898ae4", "score": "0.69445616", "text": "narrativeCount (){}", "title": "" }, { "docid": "59b840641d3a923bbc7c6607bfa547a7", "score": "0.68754953", "text": "function counter() {\n\t\treturn counter.count++;\n\t}", "title": "" }, { "docid": "44f06743f997c77f6c9dda5ac7bf4d8a", "score": "0.681538", "text": "function increaseCount() {\n return ++count;\n }", "title": "" }, { "docid": "45b5bf6f9846da57e5fd49c5bbdb63e0", "score": "0.6810372", "text": "function countIncremented() {\n setCount(count + 1);\n }", "title": "" }, { "docid": "96640baa6189a3e21ecedcb5ce62c02b", "score": "0.66599953", "text": "function reduceCount() {\n return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);\n }", "title": "" }, { "docid": "96640baa6189a3e21ecedcb5ce62c02b", "score": "0.66599953", "text": "function reduceCount() {\n return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);\n }", "title": "" }, { "docid": "5b15ed1f846872d4925209d4e66eef5c", "score": "0.6638712", "text": "function apply_count(counter) { counter++; setTimeout(function(){ uncount(counter); }, interval*1000); }", "title": "" }, { "docid": "5b15ed1f846872d4925209d4e66eef5c", "score": "0.6638712", "text": "function apply_count(counter) { counter++; setTimeout(function(){ uncount(counter); }, interval*1000); }", "title": "" }, { "docid": "ccdd4799795e871c8308d8458c39ddd5", "score": "0.66268265", "text": "function updateCount() {\n var $items = $('li[class!=complete]').length;\n $('#counter').text($items);\n }", "title": "" }, { "docid": "d4fa657ed506c10e66c57554b96ae829", "score": "0.66235626", "text": "function reduceCount() {\n return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);\n }", "title": "" }, { "docid": "d4fa657ed506c10e66c57554b96ae829", "score": "0.66235626", "text": "function reduceCount() {\n return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);\n }", "title": "" }, { "docid": "45ab6b341bf4decdaea6ad95f3d53c82", "score": "0.6605403", "text": "count(reporter) {\n return this.reduce((prev, o) => prev + (reporter(o) ? 1 : 0), 0)\n }", "title": "" }, { "docid": "04edce8804dc5b8c782a3f006588e98d", "score": "0.6598158", "text": "function incrementCount() {\n\t\t//function to increase base variable above\n\t\tsetNumber(number + 1); //using destructured function to set the variable to increment by one\n\t}", "title": "" }, { "docid": "d9e0aa10ed99458ecc0a70a25fe4639b", "score": "0.6567381", "text": "function addCount(i) { \n return i.set('count', i.select(0).mask().reduceRegion(ee.Reducer.sum(), aoi, 60).values().get(0)) \n}", "title": "" }, { "docid": "c0f5370d39c89554fb67053db1df40d5", "score": "0.6563957", "text": "function updateCounts() {\n const counts = knnClassifier.getCountByLabel();\n\n for (let i = 0; i<myClassNames.length; i++) {\n myClasses[i].exampleCount.html(myClasses[i].name + \" examples: \" + counts[myClasses[i].name] || 0);\n } \n}", "title": "" }, { "docid": "7289cfa3efdb61b48d5aa358a4b537be", "score": "0.6555473", "text": "function updateCounter() {\n var counter = 0;\n deck.matchedCards.forEach(card => {\n counter++\n })\n matchCounter.innerHTML = counter;\n}", "title": "" }, { "docid": "ca4a1f3ee637e3dc86c64c0612f28d45", "score": "0.65472", "text": "function count($this) {\n var current = parseInt($this.html(), 10);\n current = current + 50; /* Where 50 is increment */\n $this.html(++current);\n if (current > $this.data('count')) {\n $this.html($this.data('count'));\n } else {\n setTimeout(function() {\n count($this)\n }, 30);\n }\n }", "title": "" }, { "docid": "fdf66c50818a7aebb6941605fdbe5867", "score": "0.6543705", "text": "async count() {\n return await this.map((_) => 1).sum();\n }", "title": "" }, { "docid": "6e12ec728b7909f012111dd322139799", "score": "0.65235275", "text": "count() {\n let n = 0;\n for (const group of this.groups) {\n n += group[1].elements.length;\n }\n return n;\n }", "title": "" }, { "docid": "6e12ec728b7909f012111dd322139799", "score": "0.65235275", "text": "count() {\n let n = 0;\n for (const group of this.groups) {\n n += group[1].elements.length;\n }\n return n;\n }", "title": "" }, { "docid": "fec0796738d5fb5b1f6d12735f4dd619", "score": "0.65205437", "text": "function counterUpdate(){\n var syntaxTotal = 0, // total syntax counter\n tagTotal = 0, // total tags counter\n exampleTotal = 0; // total example counter\n\n // Loops through allWords and tallies up the counters\n _.each(allWords,function( val ){\n if( val.syntax ){ syntaxTotal++; }\n if( val.example ){ exampleTotal++ }\n if( val.tag ){ tagTotal++ }\n });\n\n // Adding Stats to DOM\n $('#word_count').text(allWords.length); // If there is a word there is a def. There are absolutes.\n $('#def_count').text(allWords.length);\n $('#syn_count').text(syntaxTotal);\n $('#ex_count').text(exampleTotal);\n $('#tag_count').text(tagTotal);\n }", "title": "" }, { "docid": "5356827be998544214d4a76f52e312f7", "score": "0.650898", "text": "counter(state) {\n return state.count\n }", "title": "" }, { "docid": "db2ae9d254d59ab318d5fec5513180ca", "score": "0.6508259", "text": "function counter(count) {\r\n // ...\r\n}", "title": "" }, { "docid": "ea61cf444a8a1c38718a060a17ce7fe2", "score": "0.65032315", "text": "function reduceCount() {\n return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);\n }", "title": "" }, { "docid": "ea61cf444a8a1c38718a060a17ce7fe2", "score": "0.65032315", "text": "function reduceCount() {\n return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);\n }", "title": "" }, { "docid": "120abb46d93ef717a4aaf7c1e8cb63b0", "score": "0.64977586", "text": "function CommitCounts() {\n}", "title": "" }, { "docid": "20e75d8b34abcb5d517340ff68b77284", "score": "0.6489989", "text": "function count() { //This function will add 1 to the starting point which is given the value of 1 \n var starting_point = 1;\n function plus_one () {starting_point += 1;}\n plus_one();\n return starting_point;\n }", "title": "" }, { "docid": "4b10b36f2096bc801449bdebf3ee6507", "score": "0.64875305", "text": "function count() {\n let total = 0\n function addOne() {\n total++\n return total\n }\n function minusOne() {\n total--\n return total\n }\n function reset() {\n total = 0\n return total\n }\n return {\n addOne: addOne(),\n minusOne: minusOne(),\n reset: reset()\n }\n}", "title": "" }, { "docid": "1b877af7b3fcff8e2948a7cb6601e5e7", "score": "0.6485703", "text": "function counter() { this.sumNodeSize = 0; }", "title": "" }, { "docid": "dbcc11d90747da1d78303c83ece98f62", "score": "0.6485307", "text": "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "dbcc11d90747da1d78303c83ece98f62", "score": "0.6485307", "text": "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "dbcc11d90747da1d78303c83ece98f62", "score": "0.6485307", "text": "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "dbcc11d90747da1d78303c83ece98f62", "score": "0.6485307", "text": "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "a2db72d91aa04c747ac047018c17948c", "score": "0.64850205", "text": "function reduceCount() {\n return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);\n }", "title": "" }, { "docid": "a2db72d91aa04c747ac047018c17948c", "score": "0.64850205", "text": "function reduceCount() {\n return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);\n }", "title": "" }, { "docid": "24d1355ae9edab0e9e5c5a2cced5d3c8", "score": "0.64798373", "text": "function count ($this) {\n var current = parseInt($this.html(), 10)\n current = current + 10\n $this.html(++current)\n if (current > $this.data('count')) {\n $this.html($this.data('count'))\n } else {\n setTimeout(function () {\n count($this)\n }, 10)\n }\n }", "title": "" }, { "docid": "edb1b1b1f42b890632cf591d4a0ca182", "score": "0.6472455", "text": "reduceCount() {\n return this.reduce((p, v) => p + 1, (p, v) => p - 1, () => 0);\n }", "title": "" }, { "docid": "7487ebea2e374d8f420a89e64fa52f6f", "score": "0.6457699", "text": "function updateCounts() {\n const counts = knnClassifier.getCountByLabel();\n\n select('#exampleA').html(counts['A'] || 0);\n select('#exampleB').html(counts['B'] || 0);\n}", "title": "" }, { "docid": "64a7353b0df51c6e425e53197f483eca", "score": "0.64570063", "text": "function countHits() {\n\n\t\tplayHitSound();\n\t\tif(hits != 8){\n\t\t\thits++;\n\t\t\t$('.hits').text(hits);\n\t\t} else if ('.hits' == 8) {\n\t\t\t//do nothing\n\t\t} else {\n\t\t\t$('.hits').text('you win!');\n\t\t\t$('.hits').css({'color':'#88D509','top':'-242px','right':'563px','font-size':'50px','width':'260px','height':'134px'});\n\t\t}\n\t}", "title": "" }, { "docid": "e72a4c455e03ef182bf877c484e85332", "score": "0.64274025", "text": "count () {\n return this.size\n }", "title": "" }, { "docid": "49f6c444ee0260567c52039ec5a4517e", "score": "0.64228165", "text": "function counter() {\n var counter = 0;\n function getCount() {\n return counter++;\n }\n return getCount;\n}", "title": "" }, { "docid": "ab96c5c668d2d3d88d9813348b0e0db5", "score": "0.6421801", "text": "function count (args, done) {\n return processCount.count(seneca, act, options, args, done)\n }", "title": "" }, { "docid": "991c88f51eca9776907eae3d771e3a4b", "score": "0.6416217", "text": "function counts(value) {\n var count = counter + value;\n document.getElementById(\"counter\").innerHTML = count;\n}", "title": "" }, { "docid": "0930203434c0ac038e3a4cd5b946ee69", "score": "0.64146525", "text": "function countObjects(e) {\n var counts = {};\n\n $(\"use\").each(function(index) {\n var id = $(this).attr('href').substring(1);\n\n if (!counts[id]) {\n counts[id] = 1;\n } else {\n counts[id] += 1;\n }\n });\n\n var entries = [];\n for (var id in counts) {\n if (!spriteNames[id]) entries.push({name: createSpriteName(id), count: counts[id]});\n else entries.push({name: spriteNames[id], count: counts[id]});\n }\n\n // Sort first by number, and then alphanumerically\n entries.sort(function(a, b) {\n if (a.count === b.count) {\n return a.name.localeCompare(b.name);\n }\n return b.count - a.count;\n });\n\n var str = '';\n entries.forEach(function(thing) {\n str += '<div class=\"count-report-row\"><div class=\"count-report-name\">' + thing.name + ': </div><div class=\"count-report-count\">' + thing.count + '</div></div>';\n });\n\n $('.count-report-notification .content').html(str);\n }", "title": "" }, { "docid": "abd7be48c10501ccf58f0933069dc62f", "score": "0.64096624", "text": "function captionCount() {\n var $counter = $(\"#counter\");\n $counter.text($allCaptions.length);\n }", "title": "" }, { "docid": "7e3ccf8324324941bf18273313120958", "score": "0.64024377", "text": "function updateCount(status) {\n var allCount = parseInt($(\"#all-bdg\").html());\n var count = parseInt($(\"#\" + status + \"-bdg\").html());\n allCount++;\n count++;\n $(\"#all-bdg\").html(allCount);\n $(\"#\" + status + \"-bdg\").html(count);\n}", "title": "" }, { "docid": "9f05a8aa9c199bbeb2514f4479f535bf", "score": "0.6390473", "text": "function updateCount() {\n\t\t\t\t\tresults.innerHTML = \"Red: \" + redSeats + \"<br> Orange:\" + orangeSeats + \"<br> Blue:\" + blueSeats;\n\t\t\t\t}", "title": "" }, { "docid": "689ae137d7d619fda42fa21037b48bde", "score": "0.6382189", "text": "function updateCount() {\n count = memoryArr.length;\n countDOM.innerText = count;\n}", "title": "" }, { "docid": "24e7195f9972950a13f9d3550a5405f0", "score": "0.6379657", "text": "function incrementCounts(totalCount, unreadCount)\n{\n//console.log(\"incrementCounts(\"+totalCount+\", \"+unreadCount+\")\");\n sTotalArticleCount = sTotalArticleCount + totalCount;\n sUnreadCount = sUnreadCount + unreadCount;\n redisplayCounts();\n}", "title": "" }, { "docid": "1247e240f07f7ce44a5c7a9891a22fdb", "score": "0.6371556", "text": "function counter(count) {\n // ...\n}", "title": "" }, { "docid": "9c2ace5821dd94bc4e0e45487e649b5b", "score": "0.6364463", "text": "function incrementCounter() {\n for (var i = innerLen-1; i >= innerLen-4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "9c2ace5821dd94bc4e0e45487e649b5b", "score": "0.6364463", "text": "function incrementCounter() {\n for (var i = innerLen-1; i >= innerLen-4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "b3d8f1f6685bd5f477d6fa9e766f0eef", "score": "0.635144", "text": "function count(acc,val) {\n acc[val] = (acc[val] || 0) + 1;\n return acc;\n }", "title": "" }, { "docid": "e1d03d41f48a3d56f5337b48064ca9aa", "score": "0.6343131", "text": "function count() {\n\tlet number = 0;\n\tfor (let key in this.dataStore) {\n\t\tnumber++;\n\t}\n\treturn number;\n}", "title": "" }, { "docid": "a30cc3702e71ecea8569366bd4d2b24b", "score": "0.6342698", "text": "getAllCount(state){\n var c = 0\n state.car.forEach(item=>{\n c += parseInt(item.count)\n })\n // 渲染页面需要return值\n return c\n }", "title": "" }, { "docid": "d963254de4bf1d79a4f2d77327079b28", "score": "0.63399935", "text": "function count() {\n var n = 0;\n return this.each().progress( function(item) { n ++ } ).then( function() { return n } )\n}", "title": "" }, { "docid": "323790be9adc8d7a1de5aaf84897a6c1", "score": "0.6339131", "text": "getTotalObjects() {\n let count = 0;\n Object.keys(this.totalObjects).forEach(roomId => {\n count += this.totalObjects[roomId].count;\n });\n return count;\n }", "title": "" }, { "docid": "c034265446e38e6b3bfb96d467f21128", "score": "0.632516", "text": "function reduceCount() {\n return reduce(xfilterReduce.reduceIncrement, xfilterReduce.reduceDecrement, crossfilter_zero);\n }", "title": "" }, { "docid": "ccc645c1601db625c61cb6da88e7b170", "score": "0.6324584", "text": "function reduceCount() {\n return reduce(xfilterReduce.reduceIncrement, xfilterReduce.reduceDecrement, crossfilter_zero);\n }", "title": "" }, { "docid": "8748617ca903474f175deb70be2e7ecb", "score": "0.6324288", "text": "function updateItemCounts(){\n updateItemCount()\n updateUncheckedCount()\n }", "title": "" }, { "docid": "be0ef9db1ba6cb8c65c6481e02c3c914", "score": "0.6324068", "text": "function incrementCounter() {\n for (var i = innerLen-1; i >= innerLen-4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "6fff2be174fd8f519d5e628fb8cb7e10", "score": "0.6322797", "text": "beforeCount(params) {\n console.log(\"Hereeeeeeeeeee 9\");\n }", "title": "" }, { "docid": "cc36f5fc089dc238f5754960f0a08ef6", "score": "0.63195264", "text": "function makeCounter() {\n\tvar count = 0;\n\n\tfunction counter() {\n\t\tcount = count + 1;\n\t\treturn count;\n\t}\n\treturn counter;\n}", "title": "" }, { "docid": "d672e0255aa487bdb53e1feb0564f069", "score": "0.6318778", "text": "function setAccIdCounts() {\n\t\t\tconsole.log(\"setAccIdCounts()\");\n\n vm.accIdCounts = {};\n\n\t\t\tfor(var i=0;i<vm.apiDomain.otherAccIds.length; i++) {\n if (vm.apiDomain.otherAccIds[i].accID == \"\") {\n continue;\n }\n var key = vm.apiDomain.otherAccIds[i].logicaldbKey;\n if (vm.accIdCounts[key]) {\n\t\t vm.accIdCounts[key] += 1;\n }\n else {\n\t\t vm.accIdCounts[key] = 1;\n }\n }\n console.log(vm.accIdCounts);\n }", "title": "" }, { "docid": "7cc4c910b8b984479f97ea05442c5cf4", "score": "0.63119614", "text": "countIt() {\n //console.log(this); // counter object scope this\n this.count++;\n this.p.html(this.count);\n }", "title": "" }, { "docid": "f1aecddd5652ee77b63751edf1e70a81", "score": "0.63116264", "text": "get currentCount() {\n const s = this.s;\n const w = this.w;\n return this.stories.reduce(function(count, story, idx) {\n if (s == idx) {\n return count + w;\n }\n else if (s > idx) {\n return count + story.Waypoints.length;\n }\n else {\n return count;\n }\n }, 1);\n }", "title": "" }, { "docid": "f1aecddd5652ee77b63751edf1e70a81", "score": "0.63116264", "text": "get currentCount() {\n const s = this.s;\n const w = this.w;\n return this.stories.reduce(function(count, story, idx) {\n if (s == idx) {\n return count + w;\n }\n else if (s > idx) {\n return count + story.Waypoints.length;\n }\n else {\n return count;\n }\n }, 1);\n }", "title": "" }, { "docid": "52490c24fad28b78d6738227861e35ca", "score": "0.6307062", "text": "function count($this){\n var current = parseInt($this.html(), 10);\n current = current + 1; /* Where 50 is increment */ \n $this.html(++current);\n if(current > $this.data('count')){\n $this.html($this.data('count'));\n } else { \n setTimeout(function(){count($this)}, 50);\n }\n }", "title": "" }, { "docid": "e002986e42c56d415321f12ec06277e4", "score": "0.6299452", "text": "function increment (){\n setCount(count+1)\n }", "title": "" }, { "docid": "bcd174234492e970b49b265afae44185", "score": "0.62994033", "text": "function countDivs () {\n\t'use strict';\n\n\t// I don't use div's\n\tdocument.getElementById('cd-output').innerHTML = '&lt;span&gt; - ' + document.getElementsByTagName('span').length;\n}", "title": "" }, { "docid": "9700d6c7bae29ccfa59b5c16e6b49638", "score": "0.6297657", "text": "function counter() {\r\n \t return counter.count++; // The count is now stored in the function directly, not in its outer Lexical Environment.\r\n \t }", "title": "" }, { "docid": "2aebecca945f85e7a51faf3ad5d8892e", "score": "0.62962234", "text": "function update_hit_counts() {\n \n dojo.forEach(latest_policy, function(rule) { \n if(rule.rule_id == null) \n return; // don't query for non-existent rules\n\n nox.apps.coreui.coreui.getUpdateMgr().xhrGet({\n url: \"/ws.v1/policy/\" + policyid + \"/rule/\" + rule.rule_id + \"/stats\",\n load: function (response, ioArgs) {\n var elem = dojo.byId(\"hit-count-\" + rule.rule_id);\n if(elem != null) // some rules are not displayed on the page \n elem.innerHTML = response.count + \" matches\"; \n },\n timeout: 30000,\n handleAs: \"json\", \n error: function(response, ioArgs) { /* do nothing*/ } \n });\n }\n ); \n}", "title": "" }, { "docid": "88f4cf710a8cb80e0044f15a742ee60a", "score": "0.6289289", "text": "function SetCountCalculator() {\n\t var _obj = {};\n\t var _count = 0;\n\t\n\t _obj.visitPre = function (n) {\n\t if (!isOperatorNode(n)) {\n\t _count++;\n\t }\n\t };\n\t\n\t _obj.visitPost = function (n) {};\n\t\n\t _obj.count = function () {\n\t return _count;\n\t };\n\t\n\t _obj.reset = function () {\n\t _count = 0;\n\t };\n\t\n\t return _obj;\n\t}", "title": "" }, { "docid": "7866f66cdaa35086c90a489914a47e70", "score": "0.6286211", "text": "function authorCounter(callback){\n Author.count(callback);\n}", "title": "" }, { "docid": "1a46fbeb92052dcd597927481ef91023", "score": "0.6281523", "text": "function count() {\n var counter = 0;\n\n function increment() {\n return ++counter;\n }\n return increment();\n}", "title": "" }, { "docid": "d189ca1c2ff5abf33834ee4373194d7d", "score": "0.62806016", "text": "function add_to_counter(valueToAdd) { counter += valueToAdd; }", "title": "" }, { "docid": "3a10e29da9de967f4e1e99c70cde9efd", "score": "0.62798965", "text": "get numberOfVampiresFromOriginal() {\n let checkVampire = this;\n let counter = 0;\n while(checkVampire.creator){\n checkVampire = checkVampire.creator\n counter += 1\n }\n return counter\n }", "title": "" }, { "docid": "26c8aafc8773ce914d4dadfc6376034b", "score": "0.6268849", "text": "function resetCount() {\n refToCount = null;\n hees = 0;\n updateView();\n}", "title": "" }, { "docid": "a5cc4f0f7ed9a7c17c1b4c949b9f50ba", "score": "0.6262941", "text": "function count(){\r\nfor (i = 0; i < 10; i++) {\r\n console.count();\r\n }\r\n}", "title": "" }, { "docid": "8f5a4e265ac1ab1f8bfdbdac4f1e7194", "score": "0.6261157", "text": "function initializeCounts(totalCount, unreadCount)\n{\n//console.log(\"initializeCounts(\"+totalCount+\", \"+unreadCount+\")\");\n sTotalArticleCount = totalCount;\n sUnreadCount = unreadCount;\n redisplayCounts();\n}", "title": "" }, { "docid": "714a5ec11904ec21544b5e82087bbace", "score": "0.6260753", "text": "countTests() {\n var counter = 0;\n for (let testType in this.tests) {\n if (this.tests.hasOwnProperty(testType)) {\n let subTests = this.tests[testType];\n for (let testName in subTests) {\n if (subTests.hasOwnProperty(testName)) {\n counter++;\n }\n }\n }\n }\n return counter;\n }", "title": "" }, { "docid": "3e9560096ed75fd97f882fbb97610e6b", "score": "0.6248326", "text": "function charactersOccurencesCount() {\n \n}", "title": "" }, { "docid": "3e9560096ed75fd97f882fbb97610e6b", "score": "0.6248326", "text": "function charactersOccurencesCount() {\n \n}", "title": "" }, { "docid": "3e9560096ed75fd97f882fbb97610e6b", "score": "0.6248326", "text": "function charactersOccurencesCount() {\n \n}", "title": "" }, { "docid": "3e9560096ed75fd97f882fbb97610e6b", "score": "0.6248326", "text": "function charactersOccurencesCount() {\n \n}", "title": "" }, { "docid": "3e9560096ed75fd97f882fbb97610e6b", "score": "0.6248326", "text": "function charactersOccurencesCount() {\n \n}", "title": "" }, { "docid": "3e9560096ed75fd97f882fbb97610e6b", "score": "0.6248326", "text": "function charactersOccurencesCount() {\n \n}", "title": "" }, { "docid": "3e9560096ed75fd97f882fbb97610e6b", "score": "0.6248326", "text": "function charactersOccurencesCount() {\n \n}", "title": "" }, { "docid": "9e034789641fe878675a0ad21dc671bb", "score": "0.6244777", "text": "function getcount(){\n\toutlet(1, 'count', textureSet.length);\n}", "title": "" }, { "docid": "d6bd9973106c12cf8550d3174a1e9994", "score": "0.62315226", "text": "function count() {\n ++i > prizes.length && (i = 1, encircle--)\n\n for (var p = 0; p < prizes.length; p++) {\n prizes[p].state = \"no\"\n prizes[i - 1].state = \"yes\"\n }\n _this.setData({\n prizes: prizes\n })\n\n if (encircle <= 0 && i == (id < buffer ? prizes.length + (id - buffer) : id - buffer)) isIn = true\n if (encircle < 0) isIn = true\n\n if (isIn) {\n speed += rise\n if (i == id && speed > rise * 3) {\n setTimeout(callback, 500)\n return false\n }\n }\n setTimeout(count, speed)\n }", "title": "" } ]
0f8bfebab95509301135b1d8cadc7571
Merges all query parameters from a controller with those from a route, returning a new object and avoiding any mutations to the existing objects.
[ { "docid": "e3f1e8faa7c747c50b16d278e325722a", "score": "0.6260945", "text": "function mergeEachQueryParams(controllerQP, routeQP) {\n let qps = {};\n let keysAlreadyMergedOrSkippable = {\n defaultValue: true,\n type: true,\n scope: true,\n as: true,\n };\n\n // first loop over all controller qps, merging them with any matching route qps\n // into a new empty object to avoid mutating.\n for (let cqpName in controllerQP) {\n if (!controllerQP.hasOwnProperty(cqpName)) {\n continue;\n }\n\n let newControllerParameterConfiguration = {};\n assign(newControllerParameterConfiguration, controllerQP[cqpName], routeQP[cqpName]);\n\n qps[cqpName] = newControllerParameterConfiguration;\n\n // allows us to skip this QP when we check route QPs.\n keysAlreadyMergedOrSkippable[cqpName] = true;\n }\n\n // loop over all route qps, skipping those that were merged in the first pass\n // because they also appear in controller qps\n for (let rqpName in routeQP) {\n if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) {\n continue;\n }\n\n let newRouteParameterConfiguration = {};\n assign(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]);\n qps[rqpName] = newRouteParameterConfiguration;\n }\n\n return qps;\n}", "title": "" } ]
[ { "docid": "58606640435f6ba63ef7a437db5ca729", "score": "0.62427634", "text": "function mergeEachQueryParams(controllerQP, routeQP) {\n var qps = {};\n var keysAlreadyMergedOrSkippable = {\n defaultValue: true,\n type: true,\n scope: true,\n as: true\n };\n\n // first loop over all controller qps, merging them with any matching route qps\n // into a new empty object to avoid mutating.\n for (var cqpName in controllerQP) {\n if (!controllerQP.hasOwnProperty(cqpName)) {\n continue;\n }\n\n var newControllerParameterConfiguration = {};\n (0, _emberUtils.assign)(newControllerParameterConfiguration, controllerQP[cqpName], routeQP[cqpName]);\n\n qps[cqpName] = newControllerParameterConfiguration;\n\n // allows us to skip this QP when we check route QPs.\n keysAlreadyMergedOrSkippable[cqpName] = true;\n }\n\n // loop over all route qps, skipping those that were merged in the first pass\n // because they also appear in controller qps\n for (var rqpName in routeQP) {\n if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) {\n continue;\n }\n\n var newRouteParameterConfiguration = {};\n (0, _emberUtils.assign)(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]);\n qps[rqpName] = newRouteParameterConfiguration;\n }\n\n return qps;\n }", "title": "" }, { "docid": "58606640435f6ba63ef7a437db5ca729", "score": "0.62427634", "text": "function mergeEachQueryParams(controllerQP, routeQP) {\n var qps = {};\n var keysAlreadyMergedOrSkippable = {\n defaultValue: true,\n type: true,\n scope: true,\n as: true\n };\n\n // first loop over all controller qps, merging them with any matching route qps\n // into a new empty object to avoid mutating.\n for (var cqpName in controllerQP) {\n if (!controllerQP.hasOwnProperty(cqpName)) {\n continue;\n }\n\n var newControllerParameterConfiguration = {};\n (0, _emberUtils.assign)(newControllerParameterConfiguration, controllerQP[cqpName], routeQP[cqpName]);\n\n qps[cqpName] = newControllerParameterConfiguration;\n\n // allows us to skip this QP when we check route QPs.\n keysAlreadyMergedOrSkippable[cqpName] = true;\n }\n\n // loop over all route qps, skipping those that were merged in the first pass\n // because they also appear in controller qps\n for (var rqpName in routeQP) {\n if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) {\n continue;\n }\n\n var newRouteParameterConfiguration = {};\n (0, _emberUtils.assign)(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]);\n qps[rqpName] = newRouteParameterConfiguration;\n }\n\n return qps;\n }", "title": "" }, { "docid": "58606640435f6ba63ef7a437db5ca729", "score": "0.62427634", "text": "function mergeEachQueryParams(controllerQP, routeQP) {\n var qps = {};\n var keysAlreadyMergedOrSkippable = {\n defaultValue: true,\n type: true,\n scope: true,\n as: true\n };\n\n // first loop over all controller qps, merging them with any matching route qps\n // into a new empty object to avoid mutating.\n for (var cqpName in controllerQP) {\n if (!controllerQP.hasOwnProperty(cqpName)) {\n continue;\n }\n\n var newControllerParameterConfiguration = {};\n (0, _emberUtils.assign)(newControllerParameterConfiguration, controllerQP[cqpName], routeQP[cqpName]);\n\n qps[cqpName] = newControllerParameterConfiguration;\n\n // allows us to skip this QP when we check route QPs.\n keysAlreadyMergedOrSkippable[cqpName] = true;\n }\n\n // loop over all route qps, skipping those that were merged in the first pass\n // because they also appear in controller qps\n for (var rqpName in routeQP) {\n if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) {\n continue;\n }\n\n var newRouteParameterConfiguration = {};\n (0, _emberUtils.assign)(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]);\n qps[rqpName] = newRouteParameterConfiguration;\n }\n\n return qps;\n }", "title": "" }, { "docid": "b02129d4ee2a4f0695ede2072668a03e", "score": "0.62214416", "text": "function mergeEachQueryParams(controllerQP, routeQP) {\n var keysAlreadyMergedOrSkippable;\n var qps = {};\n\n keysAlreadyMergedOrSkippable = {\n defaultValue: true,\n type: true,\n scope: true,\n as: true\n };\n\n // first loop over all controller qps, merging them with any matching route qps\n // into a new empty object to avoid mutating.\n for (var cqpName in controllerQP) {\n if (!controllerQP.hasOwnProperty(cqpName)) {\n continue;\n }\n\n var newControllerParameterConfiguration = {};\n _emberMetalMerge.default(newControllerParameterConfiguration, controllerQP[cqpName]);\n _emberMetalMerge.default(newControllerParameterConfiguration, routeQP[cqpName]);\n\n qps[cqpName] = newControllerParameterConfiguration;\n\n // allows us to skip this QP when we check route QPs.\n keysAlreadyMergedOrSkippable[cqpName] = true;\n }\n\n // loop over all route qps, skipping those that were merged in the first pass\n // because they also appear in controller qps\n for (var rqpName in routeQP) {\n if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) {\n continue;\n }\n\n var newRouteParameterConfiguration = {};\n _emberMetalMerge.default(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]);\n qps[rqpName] = newRouteParameterConfiguration;\n }\n\n return qps;\n }", "title": "" }, { "docid": "1e5c7e527d1609c19dedfce5b472f9c5", "score": "0.58046883", "text": "function mergeParams (req, res, next) {\n\n req.resource = req.resource || {};\n req.resource.params = {};\n req.body = req.body || {};\n\n //\n // Iterate through all the querystring and request.body values and\n // merge them into a single \"data\" argument\n //\n if (typeof req.params === 'object') {\n Object.keys(req.params).forEach(function (p) {\n req.resource.params[p] = req.param(p);\n });\n }\n\n if (typeof req.query === 'object') {\n Object.keys(req.query).forEach(function (p) {\n req.resource.params[p] = req.query[p];\n });\n }\n\n Object.keys(req.body).forEach(function (p) {\n req.resource.params[p] = req.body[p];\n });\n\n next();\n}", "title": "" }, { "docid": "a92fad8b873f047761b150f981010f81", "score": "0.5726275", "text": "_cloneQueryParams() {\n var extend = function (object) {\n const scratch = {};\n Object.keys(object).forEach((key) => {\n const value = object[key];\n if (Array.isArray(value)) {\n scratch[key] = value.splice(0);\n } else if (typeof value === 'object') {\n scratch[key] = extend(value);\n } else {\n scratch[key] = value;\n }\n }, this);\n return scratch;\n };\n return extend(this.queryParams);\n }", "title": "" }, { "docid": "edb4a90fe3bba1ee7c9ce435acece41a", "score": "0.554532", "text": "getQueryParameters(queryParameters, routeParams) {\n const urlSearchParams = new URLSearchParams(queryParameters);\n const dictParams = Object.fromEntries(urlSearchParams.entries());\n Object.keys(dictParams).forEach(key => {\n routeParams[key] = dictParams[key];\n });\n }", "title": "" }, { "docid": "edb4a90fe3bba1ee7c9ce435acece41a", "score": "0.554532", "text": "getQueryParameters(queryParameters, routeParams) {\n const urlSearchParams = new URLSearchParams(queryParameters);\n const dictParams = Object.fromEntries(urlSearchParams.entries());\n Object.keys(dictParams).forEach(key => {\n routeParams[key] = dictParams[key];\n });\n }", "title": "" }, { "docid": "7f0b043fcfac75123ecc20b1aac16b6d", "score": "0.5426938", "text": "function AdvanceSearchController($scope, $rootScope, $http, $location, $routeParams, $cookies, $cookieStore, $window) {\n $scope.title = \"Advance Search\";\n var getQueryString = {\n DistrictId: null,\n ThanaId: null,\n PoliceStationId: null,\n VillageId: null,\n }\n $scope.querystringProfessionId = getAllUrlParams().professionid;\n $scope.querystringSearchType = getAllUrlParams().searchtype;\n getQueryString = {\n DistrictId: getAllUrlParams().districtid,\n ThanaId: getAllUrlParams().thanaid,\n PoliceStationId: getAllUrlParams().policestationid,\n VillageId: getAllUrlParams().villageid,\n }\n function getAllUrlParams(url) {\n // get query string from url (optional) or window\n var queryString = url ? url.split('?')[1] : window.location.search.slice(1);\n\n // we'll store the parameters here\n var obj = {};\n\n // if query string exists\n if (queryString) {\n // stuff after # is not part of query string, so get rid of it\n queryString = queryString.split('#')[0];\n\n // split our query string into its component parts\n var arr = queryString.split('&');\n\n for (var i = 0; i < arr.length; i++) {\n // separate the keys and the values\n var a = arr[i].split('=');\n\n // in case params look like: list[]=thing1&list[]=thing2\n var paramNum = undefined;\n var paramName = a[0].replace(/\\[\\d*\\]/, function (v) {\n paramNum = v.slice(1, -1);\n return '';\n });\n\n // set parameter value (use 'true' if empty)\n var paramValue = typeof (a[1]) === 'undefined' ? true : a[1];\n\n // (optional) keep case consistent\n paramName = paramName.toLowerCase();\n paramValue = paramValue.toLowerCase();\n\n // if parameter name already exists\n if (obj[paramName]) {\n // convert value to array (if still string)\n if (typeof obj[paramName] === 'string') {\n obj[paramName] = [obj[paramName]];\n }\n // if no array index number specified...\n if (typeof paramNum === 'undefined') {\n // put the value on the end of the array\n obj[paramName].push(paramValue);\n }\n // if array index number specified...\n else {\n // put the value at that index number\n obj[paramName][paramNum] = paramValue;\n }\n }\n // if param name doesn't exist yet, set it\n else {\n obj[paramName] = paramValue;\n }\n }\n }\n\n return obj;\n }\n $scope.addvertiseSearchParameters = {\n PageSize: 10,\n Total_Count: 0,\n CurrentPage: 1,\n PageNo: 1\n }\n $scope.addvertiseList = [];\n $scope.getAddvertiseList = function () {\n $http({\n method: 'GET',\n url: '/AdvanceSearch/GetAddVertiseListWithAmmount?categoryId=' + 1 + '&pageNo=' + $scope.addvertiseSearchParameters.PageNo + '&pageSize=' + $scope.addvertiseSearchParameters.PageSize\n }).then(function successCallback(response) {\n if (response.data.Items.length > 0) {\n angular.forEach(response.data.Items, function (item) {\n item.TempSrc = getFileUrl(item.FileId, item.FileName);\n });\n $scope.addvertiseList = response.data.Items;\n }\n })\n }\n $scope.getAddvertiseList();\n function getFileUrl(fileId, fileName) {\n var str = fileName;\n var extention = str.substr(str.indexOf('.'));\n return '/UploadFiles/AdvertisePhoto/' + fileId + extention;\n }\n $scope.getAddInfo = function (data) {\n $scope.addTitle = data.Title;\n $scope.addDescription = data.Description;\n angular.element(document.querySelector('#addModal')).modal('show');\n }\n $scope.UserByAdvanceSearchParameters = {\n PageSize: 10,\n Total_Count: 0,\n CurrentPage: 1,\n PageNo: 1\n }\n $scope.advanceSearchUserList = [];\n $scope.getUserByAdvanceSearch = function () {\n $cookieStore.remove(\"professionId\");\n $cookieStore.remove(\"csearchType\");\n $scope.querystringProfessionId = null;\n $scope.pageChangeHandler = function (num) {\n $scope.UserByAdvanceSearchParameters.PageNo = num != undefined ? num : 1;\n $http({\n method: 'GET',\n url: '/AdvanceSearch/AdvanceSearchData?pageNo=' + $scope.UserByAdvanceSearchParameters.PageNo + '&pageSize=' + $scope.UserByAdvanceSearchParameters.PageSize + '&districtId=' + getQueryString.DistrictId + '&thanaId=' + getQueryString.ThanaId + '&policeStationId=' + getQueryString.PoliceStationId + '&villageId=' + getQueryString.VillageId\n }).then(function successCallback(response) {\n $scope.advanceSearchUserList = response.data.Items;\n $scope.UserByAdvanceSearchParameters.Total_Count = response.data.Pager.TotalItems;\n })\n };\n $scope.pageChangeHandler();\n }\n if ($scope.querystringSearchType === \"location\")\n $scope.getUserByAdvanceSearch();\n $scope.getUserByProfession = function () {\n var getQueryString = {\n DistrictId: null,\n ThanaId: null,\n PoliceStationId: null,\n VillageId: null,\n }\n $scope.pageChangeHandler = function (num) {\n $scope.UserByAdvanceSearchParameters.PageNo = num != undefined ? num : 1;\n $http({\n method: 'GET',\n url: '/AdvanceSearch/GetUserByProfession?pageNo=' + $scope.UserByAdvanceSearchParameters.PageNo + '&pageSize=' + $scope.UserByAdvanceSearchParameters.PageSize + '&professionId=' + $scope.querystringProfessionId\n }).then(function successCallback(response) {\n $scope.advanceSearchUserList = response.data.Items;\n $scope.UserByAdvanceSearchParameters.Total_Count = response.data.Pager.TotalItems;\n if (response.data === \"\") {\n $scope.userFoundByProfession = null;\n $scope.noProfessionResultFound = true;\n } else {\n $scope.noProfessionResultFound = false;\n }\n console.log($scope.userFoundByPhone)\n })\n }\n $scope.pageChangeHandler();\n }\n if ($scope.querystringSearchType === \"profession\")\n $scope.getUserByProfession();\n //**************AdvanceSearch****************/\n $scope.advanceSearchData = {\n DistrictId: null,\n ThanaId: null,\n PoliceStationId: null,\n VillageId: null,\n ProfessionId: null\n }\n $scope.districtList = [];\n $scope.getDistrict = function () {\n $http({\n method: 'GET',\n url: '/Home/GetDistrict'\n }).then(function successCallback(response) {\n $scope.districtList = response.data;\n })\n }\n $scope.getDistrict();\n $scope.thanaList = [];\n $scope.getThana = function () {\n if ($scope.advanceSearchData.DistrictId != null) {\n $http({\n method: 'GET',\n url: '/Home/GetThana?districtId=' + $scope.advanceSearchData.DistrictId\n }).then(function successCallback(response) {\n $scope.thanaList = response.data;\n })\n }\n else {\n $scope.thanaList = [];\n }\n }\n $scope.policeStationList = [];\n $scope.getPoliceStation = function () {\n if ($scope.advanceSearchData.DistrictId != null || $scope.advanceSearchData.ThanaId != null) {\n $http({\n method: 'GET',\n url: '/Home/GetPoliceStation?thanaId=' + $scope.advanceSearchData.ThanaId + '&districtId=' + $scope.advanceSearchData.DistrictId\n }).then(function successCallback(response) {\n $scope.policeStationList = response.data;\n })\n }\n }\n $scope.villageList = [];\n $scope.getVillage = function () {\n $http({\n method: 'GET',\n url: '/Home/GetVillage?policeStationId=' + $scope.advanceSearchData.PoliceStationId + '&thanaId=' + $scope.advanceSearchData.ThanaId + '&districtId=' + $scope.advanceSearchData.DistrictId\n }).then(function successCallback(response) {\n $scope.villageList = response.data;\n })\n }\n $scope.getUserByAdvanceSearchForThis = function () {\n $scope.pageChangeHandler = function (num) {\n if ($scope.advanceSearchData.DistrictId != null || $scope.advanceSearchData.ThanaId != null || $scope.advanceSearchData.PoliceStationId != null || $scope.advanceSearchData.VillageId != null) {\n $scope.UserByAdvanceSearchParameters.PageNo = num != undefined ? num : 1;\n $http({\n method: 'GET',\n url: '/AdvanceSearch/AdvanceSearchData?pageNo=' + $scope.UserByAdvanceSearchParameters.PageNo + '&pageSize=' + $scope.UserByAdvanceSearchParameters.PageSize + '&districtId=' + $scope.advanceSearchData.DistrictId + '&thanaId=' + $scope.advanceSearchData.ThanaId + '&policeStationId=' + $scope.advanceSearchData.PoliceStationId + '&villageId=' + $scope.advanceSearchData.VillageId\n }).then(function successCallback(response) {\n $scope.advanceSearchUserList = response.data.Items;\n $scope.UserByAdvanceSearchParameters.Total_Count = response.data.Pager.TotalItems;\n if ($scope.advanceSearchUserList.length < 1) {\n $scope.resultFound = false;\n } else {\n $scope.resultFound = true;\n }\n })\n }\n }\n $scope.pageChangeHandler();\n }\n $scope.professionTypeList = [];\n $scope.getProfessionType = function () {\n $http({\n method: 'GET',\n url: '/Home/GetProfessionTypeCbo'\n }).then(function successCallback(response) {\n $scope.professionTypeList = response.data;\n })\n }\n $scope.getProfessionType();\n $scope.getUserByProfessionForThis = function () {\n $cookies.remove(\"professionId\");\n $scope.querystringProfessionId = null;\n $scope.pageChangeHandler = function (num) {\n $scope.UserByAdvanceSearchParameters.PageNo = num != undefined ? num : 1;\n $http({\n method: 'GET',\n url: '/AdvanceSearch/GetUserByProfession?pageNo=' + $scope.UserByAdvanceSearchParameters.PageNo + '&pageSize=' + $scope.UserByAdvanceSearchParameters.PageSize + '&professionId=' + $scope.advanceSearchData.ProfessionId\n }).then(function successCallback(response) {\n $scope.advanceSearchUserList = response.data.Items;\n $scope.UserByAdvanceSearchParameters.Total_Count = response.data.Pager.TotalItems;\n if (response.data === \"\") {\n $scope.userFoundByProfession = null;\n $scope.noProfessionResultFound = true;\n } else {\n $scope.noProfessionResultFound = false;\n }\n })\n }\n $scope.pageChangeHandler();\n }\n $scope.getUserByProfessionAndLocation = function () {\n $cookieStore.remove(\"professionId\");\n $scope.querystringProfessionId = null;\n $scope.pageChangeHandler = function (num) {\n $scope.UserByAdvanceSearchParameters.PageNo = num != undefined ? num : 1;\n $http({\n method: 'GET',\n url: '/AdvanceSearch/GetUserByProfessionAndLocation?pageNo=' + $scope.UserByAdvanceSearchParameters.PageNo + '&pageSize=' + $scope.UserByAdvanceSearchParameters.PageSize + '&professionId=' + $scope.advanceSearchData.ProfessionId + '&districtId=' + $scope.advanceSearchData.DistrictId + '&thanaId=' + $scope.advanceSearchData.ThanaId + '&policeStationId=' + $scope.advanceSearchData.PoliceStationId + '&villageId=' + $scope.advanceSearchData.VillageId\n }).then(function successCallback(response) {\n $scope.advanceSearchUserList = response.data.Items;\n $scope.UserByAdvanceSearchParameters.Total_Count = response.data.Pager.TotalItems;\n if (response.data === \"\") {\n $scope.userFoundByProfession = null;\n $scope.noProfessionResultFound = true;\n } else {\n $scope.noProfessionResultFound = false;\n }\n })\n }\n $scope.pageChangeHandler();\n }\n}", "title": "" }, { "docid": "8709e91a3881118dd7f495f214cb96ba", "score": "0.51985496", "text": "function applyToParams(retainedNode, idx) {\n var cloned = PathNode.clone(retainedNode);\n cloned.paramValues = toPath[idx].paramValues;\n return cloned;\n }", "title": "" }, { "docid": "8709e91a3881118dd7f495f214cb96ba", "score": "0.51985496", "text": "function applyToParams(retainedNode, idx) {\n var cloned = PathNode.clone(retainedNode);\n cloned.paramValues = toPath[idx].paramValues;\n return cloned;\n }", "title": "" }, { "docid": "b288eed4cb26ae75ef010d6bf71c2f71", "score": "0.5099035", "text": "function applyToParams(retainedNode, idx) {\n var cloned = pathNode_1.PathNode.clone(retainedNode);\n cloned.paramValues = toPath[idx].paramValues;\n return cloned;\n }", "title": "" }, { "docid": "b288eed4cb26ae75ef010d6bf71c2f71", "score": "0.5099035", "text": "function applyToParams(retainedNode, idx) {\n var cloned = pathNode_1.PathNode.clone(retainedNode);\n cloned.paramValues = toPath[idx].paramValues;\n return cloned;\n }", "title": "" }, { "docid": "d5595f8c887d222f997ae51dbde36ef3", "score": "0.5086377", "text": "parseParams(location){\n let route = this; \n var keys=[],params={};\n var tokens = this.getMatch(location.pathname);\n if (tokens && tokens.keys.length!=0){\n var i = 1;\n var keys = tokens.keys;\n keys.forEach((e) => params[e.name] = tokens.token[i++] );\n }\n this.params = params;\n return params;\n }", "title": "" }, { "docid": "90468981fa8dd374c58a584f0da7208c", "score": "0.5062586", "text": "getGeneralParameters() {\n\t\t\tconst params = {};\n\t\t\tObject.keys(this.$route.query).forEach((key) => {\n\t\t\t\tif (!(key in this.filters)) {\n\t\t\t\t\tparams[key] = this.$route.query[key];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn params;\n\t\t}", "title": "" }, { "docid": "4337d2eadbf942fe8136ff0e753edf2e", "score": "0.50618887", "text": "function toCrossroadsParams(state, abyssaParams) {\n var params = {},\n allQueryParams = state.allQueryParams();\n\n for (var key in abyssaParams) {\n if (allQueryParams[key]) {\n params.query = params.query || {};\n params.query[key] = abyssaParams[key];\n }\n else {\n params[key] = abyssaParams[key];\n }\n }\n\n return params;\n }", "title": "" }, { "docid": "4d04bc132cb9a691ac601c940715ecaf", "score": "0.5058797", "text": "function applyToParams(retainedNode, idx) {\n\t var cloned = pathNode_1.PathNode.clone(retainedNode);\n\t cloned.paramValues = toPath[idx].paramValues;\n\t return cloned;\n\t }", "title": "" }, { "docid": "8dd5e8c21f5602a9432922d0bc02e184", "score": "0.5051536", "text": "toParams() {\n // The query params\n let data = this.build();\n\n // Transform it to params\n return Store.toParam(data);\n }", "title": "" }, { "docid": "c8afa1a06789c59c6d8480eadea3a42e", "score": "0.5041994", "text": "storeParams(payloadData) {\n this.params = _.merge(this.params, payloadData)\n }", "title": "" }, { "docid": "baa165fad50fd5e8d4140c77c83520e8", "score": "0.49937218", "text": "function applyToParams(retainedNode, idx) {\n\t var cloned = node_1.PathNode.clone(retainedNode);\n\t cloned.paramValues = toPath[idx].paramValues;\n\t return cloned;\n\t }", "title": "" }, { "docid": "1f480b070c649a8332a94b38ae0eb41a", "score": "0.49926564", "text": "function getRouteHelper(obj){\r\n var tmpRoute;\r\n if(typeof(obj)==\"string\"){\r\n tmpRoute = {action: obj, controller: currentControllerName};\r\n }\r\n else{\r\n tmpRoute = obj;\r\n }\r\n tmpRoute.getParams = $.extend({},tmpRoute.params);\r\n return $.extend({}, defaultRoute, tmpRoute);\r\n }", "title": "" }, { "docid": "892ca05ec972dd2909ed2b88ea4b5f2e", "score": "0.4970053", "text": "function queryParams() {\n const params = {};\n urlBase.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n return params;\n }", "title": "" }, { "docid": "bd1a1bd93e6e755ef980cb654f985da9", "score": "0.49561498", "text": "function applyToParams(retainedNode, idx) {\n var cloned = retainedNode.clone();\n cloned.paramValues = toPath[idx].paramValues;\n return cloned;\n }", "title": "" }, { "docid": "b4b03c67bb19ae6a884f2123861bddfc", "score": "0.495598", "text": "function insertParameters(route, obj) {\n var str = route.src;\n\n Object.keys(route.keys).forEach(function(key) {\n var k = key.substr(1);\n var value = (obj[k] !== undefined) ? obj[k] : '';\n\n if (Array.isArray(value)) {\n value = value.map(encodeURIComponent).join('/');\n } else {\n value = encodeURIComponent(value);\n }\n\n str = str.replace(route.keys[key], value + '$1');\n });\n\n // massage optional parameter\n return str\n .replace(/\\(\\/\\)/g, '')\n .replace(/[)(]/g, '');\n}", "title": "" }, { "docid": "4e2d9f3dbe420d4220f86cf73df9e65a", "score": "0.49544573", "text": "function queryParams() {\n const params = {};\n urlBase.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n return params;\n }", "title": "" }, { "docid": "c137434ab58d59705d3d586d2753e65b", "score": "0.49267104", "text": "function createParams(routePattern, fragment, queryString) {\n\t var params = routePattern.exec(fragment).slice(1);\n\t\n\t for (var i = 0; i < params.length; i++) {\n\t var current = params[i];\n\t params[i] = current ? decodeURIComponent(current) : null;\n\t }\n\t\n\t var queryParams = router.parseQueryString(queryString);\n\t if (queryParams) {\n\t params.push(queryParams);\n\t }\n\t\n\t return {\n\t params:params,\n\t queryParams:queryParams\n\t };\n\t }", "title": "" }, { "docid": "7dae3a9cdb35fbd34e5ef298c386e294", "score": "0.49210608", "text": "setFilters ({ state }, filters) {\n const mergedQuery = {\n ...state.route.query, // merge with search term and location\n ...filters\n }\n const query = removeEmptyKeys(mergedQuery)\n router.replace({ query })\n }", "title": "" }, { "docid": "09caff68d038b3803cbe55717f97facb", "score": "0.49177137", "text": "clearQueryParams() {\n this.queryParams = {};\n }", "title": "" }, { "docid": "dfbbec594aa2e047ebd5adee974fe39f", "score": "0.49094075", "text": "getParamsByMethodType(context) {\n\t\t/** If set config mergeParam = true at setting routes */\n\t\tif (context.params && !context.params.query && !context.params.body && !context.params.params) {\n\t\t\treturn context.params;\n\t\t}\n\t\t/** Else will check and get params via method type */\n\t\tlet params = {};\n\t\tif (context.meta.method) {\n\t\t\tswitch (context.meta.method) {\n\t\t\t\tcase \"GET\": {\n\t\t\t\t\tparams = {...context.params.query, ...context.params.params};\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"POST\" || \"PUT\" || \"DELETE\" || \"OPTIONS\": {\n\t\t\t\t\tparams = context.params.body;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (params && !_.isEmpty(params)) {\n\t\t\treturn params;\n\t\t}\n\t\t/** Try for get params if case method type is not set, merge all to a object params */\n\t\tparams = {...context.params.query, ...context.params.body, ...context.params.params};\n\t\treturn params;\n\t}", "title": "" }, { "docid": "69ab189e72f6ebbad784c1af88c6e042", "score": "0.4875339", "text": "function getActiveRoutes(params) {\n var activeRoutes = {},\n availableRoutes =\n { 'index': 'GET /'\n , 'create': 'POST /'\n , 'new': 'GET /new'\n , 'edit': 'GET /:id/edit'\n , 'destroy': 'DELETE /:id'\n , 'update': 'PUT /:id'\n , 'show': 'GET /:id'\n },\n availableRoutesSingleton = \n { 'show': 'GET /'\n , 'create': 'POST /'\n , 'new': 'GET /new'\n , 'edit': 'GET /edit'\n , 'destroy': 'DELETE /'\n , 'update': 'PUT /'\n };\n\n if (params.singleton) {\n availableRoutes = availableRoutesSingleton;\n }\n\n var action;\n // 1. only\n if (params.only) {\n if (typeof params.only == 'string') {\n params.only = [params.only];\n }\n for (action in availableRoutes) {\n if (params.only.indexOf(action) !== -1) {\n activeRoutes[action] = availableRoutes[action];\n }\n }\n }\n // 2. except\n else if (params.except) {\n if (typeof params.except == 'string') {\n params.except = [params.except];\n }\n for (action in availableRoutes) {\n if (params.except.indexOf(action) == -1) {\n activeRoutes[action] = availableRoutes[action];\n }\n }\n }\n // 3. all\n else {\n for (action in availableRoutes) {\n activeRoutes[action] = availableRoutes[action];\n }\n }\n return activeRoutes;\n }", "title": "" }, { "docid": "1ae5988f1236c286dda40e1c64f2428b", "score": "0.48472977", "text": "appendAll(params) {\n const updates = [];\n Object.keys(params).forEach(param => {\n const value = params[param];\n if (Array.isArray(value)) {\n value.forEach(_value => {\n updates.push({\n param,\n value: _value,\n op: 'a'\n });\n });\n } else {\n updates.push({\n param,\n value: value,\n op: 'a'\n });\n }\n });\n return this.clone(updates);\n }", "title": "" }, { "docid": "0e470b720f5120afa60bf131318126c4", "score": "0.48374993", "text": "function populateGet() {\r\n\tvar obj = {}, params = location.search.slice(1).split('&');\r\n\tfor(var i=0,len=params.length;i<len;i++) {\r\n\t\tvar keyVal = params[i].split('=');\r\n\t\tobj[decodeURIComponent(keyVal[0])] = decodeURIComponent(keyVal[1]);\r\n\t}\r\n\treturn obj;\r\n}", "title": "" }, { "docid": "be0522a23f5c3631dee8823912d90800", "score": "0.48321813", "text": "function mergeInQueryOrForm() {\n var req = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _req$url = req.url,\n url = _req$url === void 0 ? '' : _req$url,\n query = req.query,\n form = req.form;\n\n var joinSearch = function joinSearch() {\n for (var _len = arguments.length, strs = new Array(_len), _key = 0; _key < _len; _key++) {\n strs[_key] = arguments[_key];\n }\n\n var search = _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_13___default()(strs).call(strs, function (a) {\n return a;\n }).join('&'); // Only truthy value\n\n\n return search ? \"?\".concat(search) : ''; // Only add '?' if there is a str\n };\n\n if (form) {\n var hasFile = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(form).some(function (key) {\n var value = form[key].value;\n return isFile(value) || isArrayOfFile(value);\n });\n\n var contentType = req.headers['content-type'] || req.headers['Content-Type'];\n\n if (hasFile || /multipart\\/form-data/i.test(contentType)) {\n req.body = buildFormData(req.form);\n } else {\n req.body = encodeFormOrQuery(form);\n }\n\n delete req.form;\n }\n\n if (query) {\n var _url$split = url.split('?'),\n _url$split2 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.default)(_url$split, 2),\n baseUrl = _url$split2[0],\n oriSearch = _url$split2[1];\n\n var newStr = '';\n\n if (oriSearch) {\n var oriQuery = qs__WEBPACK_IMPORTED_MODULE_15___default().parse(oriSearch);\n\n var keysToRemove = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(query);\n\n keysToRemove.forEach(function (key) {\n return delete oriQuery[key];\n });\n newStr = qs__WEBPACK_IMPORTED_MODULE_15___default().stringify(oriQuery, {\n encode: true\n });\n }\n\n var finalStr = joinSearch(newStr, encodeFormOrQuery(query));\n req.url = baseUrl + finalStr;\n delete req.query;\n }\n\n return req;\n} // Wrap a http function ( there are otherways to do this, consider this deprecated )", "title": "" }, { "docid": "895505dfdf4fb673075fc9c2befcd9b3", "score": "0.48218644", "text": "function useQueryParams () {\n return new URLSearchParams(useLocation().search);\n}", "title": "" }, { "docid": "260767b9def47d285107575da474c372", "score": "0.48053202", "text": "function queryObj() {\n var result = {}, keyValuePairs = location.search.slice(1).split('&');\n\n keyValuePairs.forEach(function(keyValuePair) {\n keyValuePair = keyValuePair.split('=');\n result[keyValuePair[0]] = keyValuePair[1] || '';\n });\n\n return result;\n}", "title": "" }, { "docid": "9983941199abcef24257c7cf74cd1bc0", "score": "0.47840565", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t var paramNames = _PatternUtils.getParamNames(route.path);\n\n\t for (var p in params) {\n\t if (Object.prototype.hasOwnProperty.call(params, p) && paramNames.indexOf(p) !== -1) {\n\t routeParams[p] = params[p];\n\t }\n\t }\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "c583df55e115c09d84341e804db2af30", "score": "0.47827324", "text": "appendAll(params) {\n const updates = [];\n Object.keys(params).forEach(param => {\n const value = params[param];\n if (Array.isArray(value)) {\n value.forEach(_value => {\n updates.push({ param, value: _value, op: 'a' });\n });\n }\n else {\n updates.push({ param, value, op: 'a' });\n }\n });\n return this.clone(updates);\n }", "title": "" }, { "docid": "c583df55e115c09d84341e804db2af30", "score": "0.47827324", "text": "appendAll(params) {\n const updates = [];\n Object.keys(params).forEach(param => {\n const value = params[param];\n if (Array.isArray(value)) {\n value.forEach(_value => {\n updates.push({ param, value: _value, op: 'a' });\n });\n }\n else {\n updates.push({ param, value, op: 'a' });\n }\n });\n return this.clone(updates);\n }", "title": "" }, { "docid": "c583df55e115c09d84341e804db2af30", "score": "0.47827324", "text": "appendAll(params) {\n const updates = [];\n Object.keys(params).forEach(param => {\n const value = params[param];\n if (Array.isArray(value)) {\n value.forEach(_value => {\n updates.push({ param, value: _value, op: 'a' });\n });\n }\n else {\n updates.push({ param, value, op: 'a' });\n }\n });\n return this.clone(updates);\n }", "title": "" }, { "docid": "c583df55e115c09d84341e804db2af30", "score": "0.47827324", "text": "appendAll(params) {\n const updates = [];\n Object.keys(params).forEach(param => {\n const value = params[param];\n if (Array.isArray(value)) {\n value.forEach(_value => {\n updates.push({ param, value: _value, op: 'a' });\n });\n }\n else {\n updates.push({ param, value, op: 'a' });\n }\n });\n return this.clone(updates);\n }", "title": "" }, { "docid": "f043031182e06f0268deaffc9ea1abd4", "score": "0.47765884", "text": "function toParams(state, crossroadsArgs) {\n var args = Array.prototype.slice.apply(crossroadsArgs),\n query = args.pop(),\n params = {},\n pathName;\n\n state.fullPath().replace(/\\{\\w*\\}/g, function(match) {\n pathName = match.slice(1, -1);\n params[pathName] = args.shift();\n return '';\n });\n\n if (query) mergeObjects(params, query);\n\n return params;\n }", "title": "" }, { "docid": "b4a9e4dec05aa790e0b20368ecd79865", "score": "0.47680902", "text": "function reconstructParameters(params) {\n const res = {};\n const keys = Object.keys(params);\n keys.forEach(k => {\n _.set(res, k, params[k]);\n });\n return res;\n}", "title": "" }, { "docid": "5b8d529c9910c72d5ab2896895721837", "score": "0.47617874", "text": "function getRouteParams(route,params){var routeParams={};if(!route.path)return routeParams;var paramNames=(0,_PatternUtils.getParamNames)(route.path);for(var p in params){if(Object.prototype.hasOwnProperty.call(params,p)&&paramNames.indexOf(p)!==-1){routeParams[p]=params[p];}}return routeParams;}", "title": "" }, { "docid": "5b8d529c9910c72d5ab2896895721837", "score": "0.47617874", "text": "function getRouteParams(route,params){var routeParams={};if(!route.path)return routeParams;var paramNames=(0,_PatternUtils.getParamNames)(route.path);for(var p in params){if(Object.prototype.hasOwnProperty.call(params,p)&&paramNames.indexOf(p)!==-1){routeParams[p]=params[p];}}return routeParams;}", "title": "" }, { "docid": "5b8d529c9910c72d5ab2896895721837", "score": "0.47617874", "text": "function getRouteParams(route,params){var routeParams={};if(!route.path)return routeParams;var paramNames=(0,_PatternUtils.getParamNames)(route.path);for(var p in params){if(Object.prototype.hasOwnProperty.call(params,p)&&paramNames.indexOf(p)!==-1){routeParams[p]=params[p];}}return routeParams;}", "title": "" }, { "docid": "6afaaa82f9e317191538a8e7eed5a6dc", "score": "0.47586703", "text": "function getParams() {\n return util.copyObject(currentState.params);\n }", "title": "" }, { "docid": "98dee76a9e0bdbe405326c1c269511f9", "score": "0.4750416", "text": "function updateParamsToUrl(paramKey, paramValue) {\n\n paramValue = window.btoa(JSON.stringify(paramValue));\n\n var nextUrl = window.location.origin + window.location.pathname;\n\n var params = getUrlVars(); //Get all the query params as an ARRAY\n\n var size = Object.keys(params).length;\n var i = 0;\n if (size == 0) {\n window.location.href = window.location.href + \"?\" + paramKey + \"=\" + paramValue;\n } else {\n\n nextUrl += '?'; // ? for started to attach the query string to url\n\n params[paramKey] = paramValue;\n\n // This is for search,selection by any one of ways => BRAND or SEARCH Keyword\n if (paramKey == 'search' && params['brand'] != undefined) {\n params['brand'] = '';\n }\n if (paramKey == 'brand' && params['search'] != undefined) {\n params['search'] = '';\n }\n\n if (paramKey == 'brand') {\n params['width'] = '';\n params['diameter'] = '';\n }\n\n // Attach the query params to the nextURL \n $.each(params, function(key, value) {\n if (value != '') {\n if (i == size) {\n nextUrl += key + '=' + value;\n } else {\n nextUrl += key + '=' + value + '&';\n }\n }\n\n i++;\n });\n\n\n window.location.href = nextUrl;\n }\n}", "title": "" }, { "docid": "de96edf2a2d4c2f388ac94f71793b99b", "score": "0.4735495", "text": "function useQuery() {\n return new URLSearchParams(useLocation().search);\n }", "title": "" }, { "docid": "de96edf2a2d4c2f388ac94f71793b99b", "score": "0.4735495", "text": "function useQuery() {\n return new URLSearchParams(useLocation().search);\n }", "title": "" }, { "docid": "b56a070dbc6ae6f4c33a62db6df8538b", "score": "0.4734165", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t var paramNames = (0, _PatternUtils.getParamNames)(route.path);\n\n\t for (var p in params) {\n\t if (Object.prototype.hasOwnProperty.call(params, p) && paramNames.indexOf(p) !== -1) {\n\t routeParams[p] = params[p];\n\t }\n\t }\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "b56a070dbc6ae6f4c33a62db6df8538b", "score": "0.4734165", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t var paramNames = (0, _PatternUtils.getParamNames)(route.path);\n\n\t for (var p in params) {\n\t if (Object.prototype.hasOwnProperty.call(params, p) && paramNames.indexOf(p) !== -1) {\n\t routeParams[p] = params[p];\n\t }\n\t }\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "901559e289ead7416a463f7101ef8a23", "score": "0.47319835", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t var paramNames = (0, _PatternUtils.getParamNames)(route.path);\n\t\n\t for (var p in params) {\n\t if (Object.prototype.hasOwnProperty.call(params, p) && paramNames.indexOf(p) !== -1) {\n\t routeParams[p] = params[p];\n\t }\n\t }\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "901559e289ead7416a463f7101ef8a23", "score": "0.47319835", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t var paramNames = (0, _PatternUtils.getParamNames)(route.path);\n\t\n\t for (var p in params) {\n\t if (Object.prototype.hasOwnProperty.call(params, p) && paramNames.indexOf(p) !== -1) {\n\t routeParams[p] = params[p];\n\t }\n\t }\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "0d71830ec570e2fa77089f655e2bffa8", "score": "0.47295928", "text": "clearInitialSearch() {\n const params = this.params();\n delete params.q;\n\n m.route(app.route(this.searchRoute, params));\n }", "title": "" }, { "docid": "70e99e8980ef33168c1891c09408ff5e", "score": "0.47282982", "text": "parseParams(){\n\t\tthis.app.use(\n\t\t\t(req, res, next) => {\n\t\t\t\treq.parsedParams = {};\n\n\t\t\t\tconst records = req.body;\n\t\t\t\tthis.log.debug({records}, 'parseParams() getting records');\n\t\t\t\tif(records || records === '' || records === 0){\n\t\t\t\t\treq.parsedParams = {\n\t\t\t\t\t\t...req.parsedParms,\n\t\t\t\t\t\trecords\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst rangeMatch = ( req.get('Range') || '' ).match(/=(\\d*)[-–](\\d*)$/);\n\t\t\t\tif(Array.isArray(rangeMatch) && typeof rangeMatch[1] == 'string' && typeof rangeMatch[2] == 'string'){\n\t\t\t\t\tlet end = parseInt(rangeMatch[2], 10);\n\t\t\t\t\tend = isNaN(end) ? undefined : end;\n\t\t\t\t\treq.parsedParams = {\n\t\t\t\t\t\t...req.parsedParams,\n\t\t\t\t\t\tstart: parseInt(rangeMatch[1], 10),\n\t\t\t\t\t\tend\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst idMatch = req.originalUrl.match(/\\/(?<id>\\d+)\\/*$/);\n\t\t\t\tif(Array.isArray(idMatch) && typeof idMatch[1] == 'string'){\n\t\t\t\t\treq.parsedParams = {\n\t\t\t\t\t\t...req.parsedParams,\n\t\t\t\t\t\tstart: parseInt(idMatch[1], 10), // yes, let this start override the range start above\n\t\t\t\t\t\tid: parseInt(idMatch[1], 10)\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tnext();\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "27a5a5ca17252bec5019050cb4d81db0", "score": "0.47272986", "text": "function queryParams(params) {\n // params.advFilter = \"projectID\";\n params.hostID = id;\n params.sortName='levelRisk';\n params.sortOrder='desc';\n return(params);\n // return {advFilter: 'projectID', advFilterValue: id};\n}", "title": "" }, { "docid": "5feb6a1044c93eeb8ff4d457f53c6f7c", "score": "0.47212973", "text": "function mergeInQueryOrForm() {\n var req = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _req$url = req.url,\n url = _req$url === void 0 ? '' : _req$url,\n query = req.query,\n form = req.form;\n\n var joinSearch = function joinSearch() {\n for (var _len = arguments.length, strs = new Array(_len), _key = 0; _key < _len; _key++) {\n strs[_key] = arguments[_key];\n }\n\n var search = _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_13___default()(strs).call(strs, function (a) {\n return a;\n }).join('&'); // Only truthy value\n\n\n return search ? \"?\".concat(search) : ''; // Only add '?' if there is a str\n };\n\n if (form) {\n var hasFile = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(form).some(function (key) {\n var value = form[key].value;\n return isFile(value) || isArrayOfFile(value);\n });\n\n var contentType = req.headers['content-type'] || req.headers['Content-Type'];\n\n if (hasFile || /multipart\\/form-data/i.test(contentType)) {\n var formdata = buildFormData(req.form);\n Object(_fold_formdata_to_request_node__WEBPACK_IMPORTED_MODULE_22__[\"default\"])(formdata, req);\n } else {\n req.body = encodeFormOrQuery(form);\n }\n\n delete req.form;\n }\n\n if (query) {\n var _url$split = url.split('?'),\n _url$split2 = _babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_url$split, 2),\n baseUrl = _url$split2[0],\n oriSearch = _url$split2[1];\n\n var newStr = '';\n\n if (oriSearch) {\n var oriQuery = qs__WEBPACK_IMPORTED_MODULE_15___default.a.parse(oriSearch);\n\n var keysToRemove = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(query);\n\n keysToRemove.forEach(function (key) {\n return delete oriQuery[key];\n });\n newStr = qs__WEBPACK_IMPORTED_MODULE_15___default.a.stringify(oriQuery, {\n encode: true\n });\n }\n\n var finalStr = joinSearch(newStr, encodeFormOrQuery(query));\n req.url = baseUrl + finalStr;\n delete req.query;\n }\n\n return req;\n} // Wrap a http function ( there are otherways to do this, consider this deprecated )", "title": "" }, { "docid": "9c415c7d8d483a90457950affe721b55", "score": "0.47133258", "text": "function rewriteURIForGET(chosenURI, body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(key + \"=\" + encodeURIComponent(value));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = Object(apollo_link_http_common__WEBPACK_IMPORTED_MODULE_1__[\"serializeFetchParameter\"])(body.variables, 'Variables map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = Object(apollo_link_http_common__WEBPACK_IMPORTED_MODULE_1__[\"serializeFetchParameter\"])(body.extensions, 'Extensions map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n var fragment = '', preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}", "title": "" }, { "docid": "488b76d35e9fb8573cb12c5900903a9b", "score": "0.47091588", "text": "function rewriteURIForGET(chosenURI, body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(key + \"=\" + encodeURIComponent(value));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = serializeFetchParameter(body.variables, 'Variables map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = serializeFetchParameter(body.extensions, 'Extensions map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n var fragment = '', preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}", "title": "" }, { "docid": "ef94b47c5e9f496cef768747894a427f", "score": "0.4705727", "text": "function rewriteURIForGET(chosenURI, body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(key + \"=\" + encodeURIComponent(value));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = (0, _apolloLinkHttpCommon.serializeFetchParameter)(body.variables, 'Variables map');\n } catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = (0, _apolloLinkHttpCommon.serializeFetchParameter)(body.extensions, 'Extensions map');\n } catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n var fragment = '',\n preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}", "title": "" }, { "docid": "ef94b47c5e9f496cef768747894a427f", "score": "0.4705727", "text": "function rewriteURIForGET(chosenURI, body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(key + \"=\" + encodeURIComponent(value));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = (0, _apolloLinkHttpCommon.serializeFetchParameter)(body.variables, 'Variables map');\n } catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = (0, _apolloLinkHttpCommon.serializeFetchParameter)(body.extensions, 'Extensions map');\n } catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n var fragment = '',\n preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}", "title": "" }, { "docid": "06111e8bb9d675e05031c8f7e731363d", "score": "0.4704455", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t var paramNames = (0, _URLUtils.getParamNames)(route.path);\n\n\t for (var p in params) if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p];\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "afb4f444e11db3a58480fd60c137baad", "score": "0.4700429", "text": "function getRouteParams(route, params) { // 11\n var routeParams = {}; // 12\n // 13\n if (!route.path) return routeParams; // 14\n // 15\n var paramNames = _PatternUtils.getParamNames(route.path); // 16\n // 17\n for (var p in params) { // 18\n if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p];\n }return routeParams; // 20\n} // 21", "title": "" }, { "docid": "81c674beb966419da0c5e97db0ee621d", "score": "0.46937197", "text": "function rewriteURIForGET(chosenURI, body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(key + \"=\" + encodeURIComponent(value));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = Object(__WEBPACK_IMPORTED_MODULE_1_apollo_link_http_common__[\"g\" /* serializeFetchParameter */])(body.variables, 'Variables map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = Object(__WEBPACK_IMPORTED_MODULE_1_apollo_link_http_common__[\"g\" /* serializeFetchParameter */])(body.extensions, 'Extensions map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n var fragment = '', preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}", "title": "" }, { "docid": "81c674beb966419da0c5e97db0ee621d", "score": "0.46937197", "text": "function rewriteURIForGET(chosenURI, body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(key + \"=\" + encodeURIComponent(value));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = Object(__WEBPACK_IMPORTED_MODULE_1_apollo_link_http_common__[\"g\" /* serializeFetchParameter */])(body.variables, 'Variables map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = Object(__WEBPACK_IMPORTED_MODULE_1_apollo_link_http_common__[\"g\" /* serializeFetchParameter */])(body.extensions, 'Extensions map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n var fragment = '', preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}", "title": "" }, { "docid": "9d2b3e5f8a06bb5f13f44e4c621e8175", "score": "0.4686893", "text": "loadQueryParams() {\n queryParamsToFormStore(\n this.args.queryParams,\n this.formStore,\n this.sourceNode\n );\n }", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "aab0f836b9f6748ab1ec076e4d1aa94d", "score": "0.46866855", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\t\n\t return routeParams;\n\t}", "title": "" }, { "docid": "1837bec80b119c40957b9300b3abd840", "score": "0.46852598", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t var paramNames = _PatternUtils.getParamNames(route.path);\n\t\n\t for (var p in params) {\n\t if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p];\n\t }return routeParams;\n\t}", "title": "" }, { "docid": "1837bec80b119c40957b9300b3abd840", "score": "0.46852598", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t var paramNames = _PatternUtils.getParamNames(route.path);\n\t\n\t for (var p in params) {\n\t if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p];\n\t }return routeParams;\n\t}", "title": "" }, { "docid": "1837bec80b119c40957b9300b3abd840", "score": "0.46852598", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t var paramNames = _PatternUtils.getParamNames(route.path);\n\t\n\t for (var p in params) {\n\t if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p];\n\t }return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "87fbb35d64d690b2cea999328fb25d75", "score": "0.46810856", "text": "function getRouteParams(route, params) {\n\t var routeParams = {};\n\n\t if (!route.path) return routeParams;\n\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\n\t routeParams[p] = params[p];\n\t }\n\t });\n\n\t return routeParams;\n\t}", "title": "" }, { "docid": "42e803f4cf0c761b8d012f5bcd2b123e", "score": "0.4678451", "text": "function getRouteParams(route, params) {\r\n\t var routeParams = {};\r\n\t\r\n\t if (!route.path) return routeParams;\r\n\t\r\n\t (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {\r\n\t if (Object.prototype.hasOwnProperty.call(params, p)) {\r\n\t routeParams[p] = params[p];\r\n\t }\r\n\t });\r\n\t\r\n\t return routeParams;\r\n\t}", "title": "" }, { "docid": "be3842b29005399343d83b600feb61be", "score": "0.46727824", "text": "function useQuery() {\n return new URLSearchParams(useLocation().search);\n}", "title": "" }, { "docid": "be3842b29005399343d83b600feb61be", "score": "0.46727824", "text": "function useQuery() {\n return new URLSearchParams(useLocation().search);\n}", "title": "" } ]
8e5f5601c26940b874fc0061ef109a6e
determines when to refresh activity list
[ { "docid": "da50eb555826f847dfc037dade82edfa", "score": "0.0", "text": "function timesheet_select(mode) {\r\n var idate = gkey.neosysfield('*', 2)\r\n if (!idate)\r\n return false\r\n var offset = (mode == 'next') ? 1 : -1\r\n var nextkey = gkey.neosysfieldstore('*', 2, 1, Number(idate) + offset)\r\n window.setTimeout('opendoc(' + neosysquote(nextkey) + ')', 10)\r\n}", "title": "" } ]
[ { "docid": "3424e595369299526bea1e6fc0a5ea8a", "score": "0.650857", "text": "function activity(){\n //reset the secondsSinceLastActivity variable\n //back to 0\n secondsSinceLastActivity = 0;\n }", "title": "" }, { "docid": "e3ec58ea1779ca49dd09e2caa321a2c9", "score": "0.6491841", "text": "function refreshList() {\n refreshListTitle();\n refreshListTabs();\n refreshItems();\n}", "title": "" }, { "docid": "101efedeea6fe15a353b04da8965cd21", "score": "0.6416223", "text": "_onInterval () {\n const props = this._props\n\n if (props.hadActivity) {\n props.lastActivity = Date.now()\n props.hadActivity = false\n }\n }", "title": "" }, { "docid": "ec3efbacc74585938760130ed575b150", "score": "0.6318057", "text": "function refresh(){\n updateAttendeeList();\n}", "title": "" }, { "docid": "f7ff079d9407a3bcde79d368b2840bbe", "score": "0.62607706", "text": "function refresh() {\n if (lastEvent === 'getAll')\n getAll();\n else if (lastEvent === 'getSearch')\n getSearch();\n }", "title": "" }, { "docid": "95e480473ac17c6109fc9bf97c11a4eb", "score": "0.6171249", "text": "refresh() {\n this.get('objectlistviewEventsService').refreshListTrigger(this.get('componentName'));\n }", "title": "" }, { "docid": "c28210d356652065b7607834f554c43f", "score": "0.60996395", "text": "refresh_list() {\n // clear up\n this.running_list.innerHTML = this.pendning_list.innerHTML = this.finished_list.innerHTML = '';\n // Add Pending\n window.user_data.task_list_data.filter(e => !is_running(e) && !is_finished(e)).forEach(e => this.pendning_list.appendChild(this.create_task_element(e)))\n\n // Add Running\n window.user_data.task_list_data.filter(e => is_running(e)).forEach(e => this.running_list.appendChild(this.create_task_element(e)))\n\n // Add Finished\n window.user_data.task_list_data.filter(e => !is_running(e) && is_finished(e)).forEach(e => this.finished_list.appendChild(this.create_task_element(e)))\n }", "title": "" }, { "docid": "e1ed490a51fd2fd95bccf5353d87a850", "score": "0.6002639", "text": "refresh() {\n this.timetableList.refresh();\n }", "title": "" }, { "docid": "8c2a4804a117d80de2224ec248014e14", "score": "0.5995186", "text": "function onRefresh() {\r\n getPosts();\r\n}", "title": "" }, { "docid": "a5ad09fdd74cb1cf0232cc82b885d29a", "score": "0.59911525", "text": "function toggleRefresh(state) {\n if (state) {\n $scope.refresh = $interval(function () {\n $http.get('rest/checklists/' + $location.search().id)\n .success(function (data, status, headers, config) {\n console.log(\"Data loaded\");\n $scope.data = data;\n repositionToLastUpdatedStep();\n }).error(function (data, status, headers, config) {\n console.log('Error getting rest/checklist/get');\n });\n }, 5000);\n } else {\n $interval.cancel($scope.refresh);\n }\n $scope.refreshState = state;\n }", "title": "" }, { "docid": "087a6fa06ac9a26aa4299ddcafade72d", "score": "0.59778047", "text": "updateTaskLists() {\n\n }", "title": "" }, { "docid": "6c1bcea6fa85876c233aa70327eea79e", "score": "0.5960994", "text": "function setRefresh(){\n\t\t\tservices[atual].cache.refresh = true;\n\t\t}", "title": "" }, { "docid": "aaf67e23811ce3f219bffaa7a5525594", "score": "0.595851", "text": "function intermissionCodeForceRefresh() {\n\tupdateUpcomingRuns(); // update info on request\n}", "title": "" }, { "docid": "2946174b142e0bff3fd42c374e96c50e", "score": "0.59356666", "text": "function refreshData() {\n\tvar now = new Date();\n\tif (lastUpdate < now) {\n\t\t//clearAll();\n\t\t$('#text_updated').css({'opacity' : 0}).css({'opacity' : '0 !important'});\n\t\t$('#button_settings, #button_refresh').show().css({'opacity' : '1 !important'});\n\t\t$('#button_refresh').addClass('active');\n\t\tgetAccountData(widget.preferenceForKey(uid + \"-google_profile\"));\n\t}\n}", "title": "" }, { "docid": "cd3d863a32feee14b9a53cb5a92f13c5", "score": "0.5924962", "text": "onRefresh() {\n\t\t\tthis._oList.getBinding('items').refresh();\n\t\t}", "title": "" }, { "docid": "52feec9b81478634477a470e2a4fbc91", "score": "0.59245586", "text": "onRefresh() {\n //Clear old data of the list\n this.setState({ posts: [] });\n //Call the Service to get the latest data\n this.getAllPosts();\n }", "title": "" }, { "docid": "c265e282a12f6e22fee26a48d18ebb2b", "score": "0.58946675", "text": "refresh() {\n this.refreshTrigger.next();\n }", "title": "" }, { "docid": "622209a0b71551775286b997a72126e7", "score": "0.5886856", "text": "function refreshData() {\n $( \"#history\" ).on( \"pagebeforeshow\", function( event ) {\n $('#list').listview('refresh');\n }); \n}", "title": "" }, { "docid": "5ce504e2ae1f2e0c01bc008f2f1bbe94", "score": "0.5881262", "text": "function reiterate(){\n\n\t\tsocket.on('callList', function (data){\n\t\t\tvar reVamp = data.listRevamp;\n\n\t\t\tconsole.log(reVamp);\n\n\t\t\tif(reVamp == '1'){\n\t\t\t\ttimeline();\n\t\t\t}\n\n\t\t});\n\t}", "title": "" }, { "docid": "cdb59a2c3e7ed632363a4eacef377cb1", "score": "0.5880945", "text": "function setRefresh() {\n console.log(`Refreshing event status display: ${new Date(Date.now()).toLocaleString()}`);\n\n if (refreshTimer == null) {\n console.log(\"Create refresh interval.\");\n refreshTimer = setInterval(async () => await refreshEvents(), 10000);\n }\n }", "title": "" }, { "docid": "e2af1539f4c43dab313eace39554ff69", "score": "0.58588123", "text": "isRefresh() {\n return this.props.action === \"refresh\";\n }", "title": "" }, { "docid": "b0b416686c8039c71512e29b9d2e7dd1", "score": "0.5842514", "text": "@observes(\"refreshOnChange\")\n changed() {\n if (this.get(\"listLoading\")) {\n return;\n }\n\n // force adComponents to be recomputed\n this.notifyPropertyChange(\"needsUpdate\");\n }", "title": "" }, { "docid": "0c8c9ada9082c0d02709dedc9aca4730", "score": "0.58364874", "text": "refreshData() {\n\n // First, get the data for this module. Then, create a new object from it where\n // the keys are normalized (without time component) dates and store the object on\n // the module class instance.\n const dataItems = wxPIM.getModuleData(\"Appointments\");\n wxPIM.modules.Appointments.currentData = { };\n for (const key in dataItems) {\n if (dataItems.hasOwnProperty(key)) {\n const item = dataItems[key];\n wxPIM.modules.Appointments.currentData[new Date(item.when).setHours(0, 0, 0, 0)] =\n item;\n }\n }\n\n // Now, have the summary calendar refresh itself using the new data object.\n $$(\"moduleAppointments-items\").refresh();\n\n }", "title": "" }, { "docid": "07e42bf1810a07ba53ffa86883ed0e3e", "score": "0.5811939", "text": "function refetchEvents() {}", "title": "" }, { "docid": "ee8bf550e8a5b98104e3550600866d2f", "score": "0.5810424", "text": "function refresh() {\n $http.get('/firearmsList').then(function (response) {\n console.log(\"I got the data I requested\");\n $scope.firearmsList = response.data;\n $scope.deselect();\n }, function (response) {\n console.error(response.data);\n });\n }", "title": "" }, { "docid": "21d516725455bdc875a6db1acad4a3ce", "score": "0.5805812", "text": "function refreshListings() {\n RealtyService.getListings().then(function(response) {\n vm.listings = response.data;\n });\n }", "title": "" }, { "docid": "f5a8898ac33c1f9720df7e69f29032c3", "score": "0.5805314", "text": "function refresh() {\n that.setData({\n loading: true,\n })\n getUpComingEvent();\n}", "title": "" }, { "docid": "66f57cd8ccf0447c78c15735db1f5215", "score": "0.57880586", "text": "function refresh() {\n\t\tif( active ) {\n\t\t\trequestAnimFrame( refresh );\n\t\t\t\n\t\t\tfor( var i = 0, len = lists.length; i < len; i++ ) {\n\t\t\t\tlists[i].update();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "cc42a9c90834f087e7092068549c0bae", "score": "0.5785521", "text": "function refreshActive(){\n serverApi.emit_GetActiveAdsFromServer();\n console.log(\"The server succeeded to retrieve all of the active ads\");\n }", "title": "" }, { "docid": "53270746aada739fd962b2334bb08484", "score": "0.57834667", "text": "function refresh() {\n refreshOverview();\n}", "title": "" }, { "docid": "3e8425caa9e99224e7575559e7d0b845", "score": "0.5783283", "text": "function changeList() {\n\tif (!over_activity) {\n\t\t$('div.right div.latest_ ul li:first div').removeClass('first');\n\t\t$('div.right div.latest_ ul li:eq(4) div').animate({opacity: 0}, 700);\n\t\tvar last_li = $('div.right div.latest_ ul li:last').html();\n\t\t$('div.right div.latest_ ul li:last').remove();\n\t\t$('div.right div.latest_ ul').prepend('<li style=\"height:0;\"></li>');\n\t\t$('div.right div.latest_ ul li:first').animate({\n\t\t height: 67\n\t\t }, 700, function() {\n\t\t $('div.right div.latest_ ul li:first').html(last_li);\n\t\t\t\t$('div.right div.latest_ ul li:first div').css('opacity','0');\n\t\t\t\t$('div.right div.latest_ ul li:first div').addClass('first');\n\t\t\t\t$('div.right div.latest_ ul li:first div').animate({opacity: 1}, 700);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "620ee9b617e4c0655da546e07093f7c8", "score": "0.5776895", "text": "doRefresh () {\n this.initViewRefreshData()\n if (!this.isFromRun) {\n this.$emit('edit-updated', this.edt.isUpdated, this.routeKey)\n }\n }", "title": "" }, { "docid": "72c3f68939d0cd2b049e357ae44859b2", "score": "0.57497895", "text": "refresh()\n {\n this.lastAccessed = Date.now();\n }", "title": "" }, { "docid": "da7c29df5cd1548559c28a24d50363cd", "score": "0.57496816", "text": "onRefreshServer(){\n\t\tAttendanceClockAction.refreshServer();\n\t}", "title": "" }, { "docid": "944249d485a4af04491a07356af5cd6b", "score": "0.5741083", "text": "refreshData() {}", "title": "" }, { "docid": "e1b1dad5783c92bfe40ed20507f0bad5", "score": "0.573906", "text": "function refreshStoryList(){\n statusApp.showPleaseWait();\n var filters = {};\n $('button[data-sorttype]').each(function(){\n if($(this).hasClass(\"active\")){\n filters[$(this).data('sorttype')] = $(this).data('sortorder');\n }\n });\n $.post('/storylist', {filters: filters}, function(data){\n $('#story_list').html(data);\n }).done(function(){\n loadListUtilities();\n loadImageAssetUtilities();\n loadAudioAssetUtilities();\n loadStoryTagAssetUtilities();\n loadVideoAssetUtilities();\n statusApp.hidePleaseWait();\n });\n}", "title": "" }, { "docid": "388253b890b576b7f0f407e0556df16a", "score": "0.57236946", "text": "refresh() {\n this.refreshTrigger.next(1);\n }", "title": "" }, { "docid": "388253b890b576b7f0f407e0556df16a", "score": "0.57236946", "text": "refresh() {\n this.refreshTrigger.next(1);\n }", "title": "" }, { "docid": "139fa3a30ea16313bbe3aedc0cf46294", "score": "0.57230395", "text": "onRefresh() {\n this.setState({\n isRefresh: true\n }, () => { \n fetch(settings.ipAddress+`/api/menus`)\n .then(response => response.json())\n .then(responseJson => {\n this.setState({\n dataSource: responseJson\n });\n })\n });\n\n setTimeout(() => {\n this.setState({ isRefresh: false })\n }, 1000)\n }", "title": "" }, { "docid": "1eaa89bede9c7db776a0ea3bd904a847", "score": "0.5710193", "text": "refresh() {\n\n\n\n }", "title": "" }, { "docid": "a96641d8fd245ddb1aeae40862dff508", "score": "0.5707024", "text": "function refreshDisplay() {\n /*updateSummaryMessage('Loading Data from Azure');\n\n if (useOfflineSync) {\n syncLocalTable().then(displayItems);\n } else {\n displayItems();\n }*/ \n }", "title": "" }, { "docid": "098ca2601808cec5bf7b7a6bf2973a98", "score": "0.57015353", "text": "massUpdate() {\n // Get selected rows\n const selected = this.getSelectedRows();\n // Find relevant inventories\n const rows = this.displayData.activity.filter(row => selected.indexOf(row._id) > -1);\n this.showDetails(rows);\n }", "title": "" }, { "docid": "fc2b66836aeb637a758ea75d72db1f24", "score": "0.56916606", "text": "function refreshList(theList){\n\n $(\"#\" + theList).listview(\"refresh\");\n \n }", "title": "" }, { "docid": "fc2b66836aeb637a758ea75d72db1f24", "score": "0.56916606", "text": "function refreshList(theList){\n\n $(\"#\" + theList).listview(\"refresh\");\n \n }", "title": "" }, { "docid": "8e3328734b211e6410a23a4654593d79", "score": "0.5690547", "text": "function startRefreshing() {\n stopRefreshing();\n const refreshInterval = document.getElementById(\"refreshInterval\");\n const duration = parseInt(refreshInterval.value);\n if (duration > 0) {\n const intervalId = setInterval(refreshFeedsContent, duration * 1000);\n setIntervalId(intervalId);\n }\n}", "title": "" }, { "docid": "547ce9107a6282f885acc4c9960ac180", "score": "0.56893533", "text": "onReload() { }", "title": "" }, { "docid": "391b5e571d38e79d5988b8a2cc123261", "score": "0.56875736", "text": "refresh() {}", "title": "" }, { "docid": "5a3c2431d6647cfbe78305bbfede23e5", "score": "0.5674674", "text": "function teleUpdateMobile(){ \r\n $('#refreshIconMobile').addClass('fa-spin');\r\n $('#refreshIconMobileLandscape').addClass('fa-spin');\r\n $(\"#mainListTitle\").css(\"pointer-events\", \"none\");\r\n $(\"#refreshIconMobileLandscape\").css(\"pointer-events\", \"none\");\r\n\r\n \r\n teleUpdate().then(function(){\r\n \r\n if($('#mainList').attr('currList') == 'latest'){\r\n fillMainList($('#mainListTitle').text(), 'latest',mLatestVideoList.slice(0, 25));\r\n }else if($('#mainList').attr('currList') == 'live'){\r\n fillMainList($('#mainListTitle').text(), 'live', mCategoryDict['live'].slice(0, 25));\r\n }else{\r\n fillMainList($('#mainListTitle').text(), $('#mainList').attr('currList'), mVideoDict[$('#mainList').attr('currList')]);\r\n }\r\n \r\n fillNavigation();\r\n $('#refreshIconMobile').removeClass('fa-spin');\r\n $('#refreshIconMobileLandscape').removeClass('fa-spin');\r\n $(\"#mainListTitle\").css(\"pointer-events\", \"auto\");\r\n $(\"#refreshIconMobileLandscape\").css(\"pointer-events\", \"auto\");\r\n\r\n // load colors\r\n \r\n \r\n returnToTop();\r\n\r\n });\r\n}", "title": "" }, { "docid": "13f301150b247d5f2b5232f7c37e61ec", "score": "0.56608236", "text": "function UpdateWatcherList()\n{\n\tLoadWatcherList();\n\tvar gwr = GrabWatchers();\n\tDebugObject(gwr);\n\n\tif (gwr.deviantNb > 0)\t// More deviants\n\t{\n\t\t// Add the newer deviants to the start\n\t\tg_newWatcherNb = gwr.deviantNb;\n\t\tg_watcherList = gwr.deviantList + g_watcherList;\n\t\tSaveWatcherList();\n\t}\n\tShowResult();\n}", "title": "" }, { "docid": "780fe9d00b73b6c2f2aff63a23c02b42", "score": "0.5657661", "text": "onRefresh(){\r\n\t\tthis.setState({ isFetching: true }, function() { this.getChitData() });\r\n\t}", "title": "" }, { "docid": "f49c08da74c43105a0825bad73c5773b", "score": "0.56540626", "text": "refreshApp() {\n Loading.show({\n message: this.$t('Common.UpdateProcessOnGoing.Text'),\n messageColor: 'primary text-h6',\n spinnerSize: 80, // in pixels\n spinnerColor: 'primary-darkened',\n backgroundColor: 'white',\n })\n this.updateExists = false\n clearInterval(this.interval)\n localStorage.removeItem(APP_UPDATED_TIMESTAMP)\n // Make sure we only send a 'skip waiting' message if the SW is waiting\n if (!this.registration || !this.registration.waiting) return\n // send message to SW to skip the waiting and activate the new SW\n this.registration.waiting.postMessage({ type: 'SKIP_WAITING' })\n }", "title": "" }, { "docid": "f9a055b8db0fd13ad2c986b77a4c3f94", "score": "0.5639779", "text": "function refreshListPageView() {\n if ($(\"#list > ul\").hasClass(\"ui-listview\")) {\n $(\"#list > ul\").listview('refresh');\n }\n}", "title": "" }, { "docid": "08f67a4b97e003967b5132e45f6602e3", "score": "0.56382513", "text": "updateList(i) {\n // ******* TODO: PART IV *******\n\n //Only update list for aggregate clicks, not game clicks\n\n }", "title": "" }, { "docid": "c56193ecc29819a6ba2eeabafb2bd575", "score": "0.5629094", "text": "function reloadEvents() {\n\n }", "title": "" }, { "docid": "189d6d57e8a8c04ab260e46b11c58fa8", "score": "0.5625431", "text": "decideIfTimeToFeedAnemone() {}", "title": "" }, { "docid": "5deece31a92f7e655a3f81585901004e", "score": "0.5613543", "text": "function watchRefresh() {\n $('.refresh').click(function(event) {\n gameDeets = [];\n getStats();\n\n });\n\n}", "title": "" }, { "docid": "e810aeedffd9d2022235a395b2646094", "score": "0.5612576", "text": "function updateEventsScreen() {\n\n $.each(data.events, function (i, event) {\n var li = $(\"<li/>\");\n li.addClass(event.location);\n var a = $(\"<a/>\").attr(\"href\", \"javascript:selectEvent('\" + event.id + \"');\");\n a.append($(\"<h2/>\").append(event.name));\n a.append($(\"<p/>\").append(event.location + \", \" + event.date));\n li.append(a);\n $(\"#eventList\").append(li);\n });\n if ($(\"#eventList\").attr(\"class\").indexOf(\"ui-listview\") < 0) {\n $(\"#eventList\").listview();\n } else {\n $(\"#eventList\").listview('refresh');\n }\n}", "title": "" }, { "docid": "1b19e820caf22be95bdbe811801a8870", "score": "0.56091136", "text": "function refreshnflSchedules() {\n var query = nflScheduleTable.where({ complete: false });\n\n query.read().then(function(nflSchedules) {\n var listItems = $.map(nflSchedules, function(item) {\n return $('<li>')\n .attr('data-nflSchedule-id', item.id)\n .append($('<button class=\"item-delete\">Delete</button>'))\n .append($('<input type=\"checkbox\" class=\"item-complete\">').prop('checked', item.complete))\n .append($('<div>').append($('<input class=\"item-team\">').val(item.team)));\n });\n\n $('#todo-items').empty().append(listItems).toggle(listItems.length > 0);\n $('#summary').html('<strong>' + nflSchedules.length + '</strong> item(s)');\n }, handleError);\n }", "title": "" }, { "docid": "e9ba74d7f8d08dd7c71cd0a9011e3e2d", "score": "0.56089854", "text": "reloadList () {\n\t\tLoadLogListCommand.execute(AppModel.getValue(\"connection\")).then((logs) => {\n\t\t\tAppModel.setData({\n\t\t\t\tlogs: logs,\n\t\t\t\tloadLogListError: false\n\t\t\t})\n\t\t}).catch((error) => {\n\t\t\tLog.error(error)\n\t\t\tAppModel.setData({\n\t\t\t\tconnection: connection,\n\t\t\t\tloadLogListError: \"\" + error,\n\t\t\t\tlogs: null\n\t\t\t})\n\t\t})\n\t}", "title": "" }, { "docid": "59632f62b23195e95b89deda541f316d", "score": "0.5604287", "text": "function doRefresh() {\n status.errors.removeAll();\n angular.element(document.getElementById('logarea')).html(\"\");\n //console.log(\"refreshing...\");\n $scope.isRefreshing = true;\n $scope.$broadcast(\"refreshStarting\");\n timelineWidget.reinit();\n\n // callback functions for refresh sequence\n var fns = {\n gotGeneralInfo: gotGeneralInfo,\n gotDefaultPeriodId: gotDefaultPeriodId,\n refreshComplete: refreshComplete,\n refreshError: refreshError\n };\n\n platforms.getAllPlatforms(fns, function(fns) {\n periods.refreshPeriods(fns, function(fns) {\n platforms.getSelectedPlatforms(fns, function(selectedPlatforms, fns) {\n var spr = getSelectedPeriodRange();\n tokens.refreshTokens(selectedPlatforms, spr, fns, function(fns) {\n periods.getHolidays(fns, function(fns) {\n tokens.getGeneralInfo(fns, function(fns) {\n refreshComplete();\n });\n });\n });\n });\n });\n });\n }", "title": "" }, { "docid": "c5a6d6d6303f4fd4122ee6f21cb54f7a", "score": "0.5594319", "text": "autoLoadNewEntries() {\n if (!this.autoLoadsNewEntries) {\n this.autoLoadsNewEntries = true;\n localStorage.autoLoadsNewEntries = 1;\n } else {\n this.autoLoadsNewEntries = false;\n localStorage.autoLoadsNewEntries = 0;\n }\n }", "title": "" }, { "docid": "509ebb1be98e678a87e261ee3e3b93b0", "score": "0.5579929", "text": "refresh()\n\t{\n\t}", "title": "" }, { "docid": "2033e9bcb5cc9173a5bfd6488b1cfef2", "score": "0.5574467", "text": "function refreshFullAds(){\n serverApi.emit_GetAllAdsFromServer();\n }", "title": "" }, { "docid": "44a7ee2147b2b9d6f2293759b1e858bc", "score": "0.556967", "text": "firstLoadComplete() {\n this.lastVisit = Date.now()\n this.prevMaxCommentId = this.maxCommentId\n this.isFirstVisit = false\n this.onCommentsChanged({type: 'first_load_complete'})\n }", "title": "" }, { "docid": "cd856f4eb904d137546a84fd87ca548b", "score": "0.5564433", "text": "function refreshTasks() {\n databaseMagic('GET', '/refresh');\n}", "title": "" }, { "docid": "c44f81f6478146b5089c1d43aa96ffe4", "score": "0.55551773", "text": "handleRefresh() {\n this.setState(\n {\n refreshing: true\n },\n () => this.fetchNews()\n );\n }", "title": "" }, { "docid": "fcac2e0c8dfda1ac09bd642f6a619128", "score": "0.55542856", "text": "function setHostAutorefresh() {\n setInterval(function(){\n var checked = $('input.check_item:checked',dataTable_hosts);\n var filter = $(\"#datatable_hosts_filter input\",dataTable_hosts.parents('#datatable_hosts_wrapper')).attr('value');\n if (!checked.length && !filter.length){\n Sunstone.runAction(\"Host.autorefresh\");\n }\n },INTERVAL+someTime());\n}", "title": "" }, { "docid": "ab450694341957ec1e0c82accd4531ed", "score": "0.55530035", "text": "function refreshAction(param1) {\n $scope.message = 'I am being refreshed at ' + moment().format('YYYY-MM-DD hh:mm:ss') + ' with parameter ' + param1;\n getDate();\n }", "title": "" }, { "docid": "199aca1a5eb726b40f2dde3bfaff8ff1", "score": "0.555227", "text": "refetchEvents() {\n this._calendar.fullCalendar('refetchEvents');\n }", "title": "" }, { "docid": "42750daa15eebe1d8cfba96a6cb9b33c", "score": "0.5545933", "text": "function initialiseListEvenementen() {\n// Load the groups from the back-end.\nvar request = new XMLHttpRequest();\n$(\"#eventList\").empty();\n\nrequest.open(\"GET\", BASE_URL + \"evenements\");\nrequest.onload = function() {\n if (request.status === 200) {\n events = JSON.parse(request.responseText);\n for (var i = 0; i < events.length; i++) {\n $(\"#eventList\").append(createListElementForEvent(i));\n }\n if (events.length > 0) {\n\n $(\"#eventList\").listview('refresh');\n //console.log(\"EvenementenookGelukt\");\n } else {\n console.log(\"Error\");\n }\n } else {\n console.log(\"Error loading groups: \" + request.status + \" - \" + request.statusText);\n }\n};\nrequest.send(null);\n}", "title": "" }, { "docid": "ec76874bf381a2e902e9acc0a6d8ef5c", "score": "0.55371815", "text": "_refreshFeed() {\n this.props.laranotti.checkForNewLessons().done(Laranotti => {\n this.setState({lessons: this.props.laranotti.lessons});\n });\n }", "title": "" }, { "docid": "b99b494fe664b3519b3d8f2a916d2ec4", "score": "0.55283374", "text": "onRefresh() {\n let mounted = true;\n if (mounted) {\n console.log('refreshing')\n this.setState({ isFetching: true, }, () => { this.getOffers(); });\n }\n return () => mounted = false;\n }", "title": "" }, { "docid": "24468d0f41c029ba00ca0657245dc635", "score": "0.5521038", "text": "function addEvents(activity) {\n var index = $scope.activities.indexOf(activity);\n\n activity.widget.bind(SC.Widget.Events.FINISH, function(){\n setTimeout(function(){\n // play next track\n $scope.nextTrack();\n\n // reload activity to remove \"recommended tracks\"\n activity.widget.load(activity.origin.uri);\n }, 500);\n });\n\n // save active widget for controllers (play/pause, next and prev)\n activity.widget.bind(SC.Widget.Events.PLAY, function(){\n $scope.active_activity = activity;\n });\n }", "title": "" }, { "docid": "b02bc004fff3c85ca96fc3e0edd32a15", "score": "0.551457", "text": "function show()\n{\n // Restart any timers that were stopped on hide\n\tvar now = new Date();\n\tif ((lastUpdate.getTime() + 1000 * 10 * 10) < now)\n\t\trefreshData();\n}", "title": "" }, { "docid": "de35b84784e5ec63f43973ccd339b686", "score": "0.5509751", "text": "function setHostAutorefresh() {\n setInterval(function(){\n\t\tvar checked = $('input:checked',dataTable_hosts.fnGetNodes());\n var filter = $(\"#datatable_hosts_filter input\").attr(\"value\");\n\t\tif (!checked.length && !filter.length){\n\t\t\tSunstone.runAction(\"Host.autorefresh\");\n\t\t}\n\t},INTERVAL+someTime());\n}", "title": "" }, { "docid": "f6b970f4904fd19b24559f852e4f23a6", "score": "0.5506531", "text": "async firstUpdated() {\n await this.fetchTodoList();\n }", "title": "" }, { "docid": "ab8e76df1b9be50ff7e0f35ef5b82cc4", "score": "0.5498099", "text": "function refreshAllLasts(refreshTimer, perform) {\n try {\n if (perform == undefined || perform == true) {\n console.log(\"Refreshing chapters at \" + new Date());\n localStorage[\"lastChaptersUpdate\"] = new Date().getTime();\n var nbToRef = 0;\n for (var i = 0; i < mangaList.length; i++) {\n if (getMangaMirror(mangaList[i].mirror) != null)\n nbToRef++\n }\n var waiter = new WaitForAllLists(nbToRef, function () {\n saveList();\n }, getParameters().refreshspin);\n\n var pos = 0;\n // Not forced bandwidth safe first\n for (var i = 0; i < mangaList.length; i++) {\n if (getMangaMirror(mangaList[i].mirror) != null) {\n if (getMangaMirror(mangaList[i].mirror).savebandwidth == undefined || !getMangaMirror(mangaList[i].mirror).savebandwidth) {\n //console.log(\"Launch refresh for \" + mangaList[i].url + \" pos \" + pos);\n refreshManga(mangaList[i], waiter, pos);\n pos++;\n }\n }\n }\n // Forced bandwidth safe\n for (var i = 0; i < mangaList.length; i++) {\n if (getMangaMirror(mangaList[i].mirror) != null) {\n if (getMangaMirror(mangaList[i].mirror).savebandwidth != undefined && getMangaMirror(mangaList[i].mirror).savebandwidth) {\n //console.log(\"Launch refresh for \" + mangaList[i].url + \" pos \" + pos);\n refreshManga(mangaList[i], waiter, pos);\n pos++;\n }\n }\n }\n waiter.wait();\n }\n } catch (e) {\n //\n }\n var nextTime = getParameters().updatechap;\n if (refreshTimer) {\n clearTimeout(timeoutChap);\n //Change nextTime calcultate it...\n nextTime = - (new Date().getTime() - localStorage[\"lastChaptersUpdate\"] - nextTime);\n }\n console.log(\"Next time to refresh chapters list : \" + nextTime);\n timeoutChap = setTimeout(function () {\n refreshAllLasts();\n }, nextTime);\n}", "title": "" }, { "docid": "9a85b066696e99b989bb4d4c1e3213e0", "score": "0.54924065", "text": "@api\n refreshRecommends(){\n this.captureGetRecommendTrailEntries(this.recordId);\n }", "title": "" }, { "docid": "c31295fd88d05f4e4c04b25cb039a36e", "score": "0.5478917", "text": "onPullDownRefresh() {\n\n }", "title": "" }, { "docid": "6f4f63b7d32ac0d7c8d03a7c48f0330a", "score": "0.54699767", "text": "collectionActivity(){\n let items = this.model.getAll();\n let percent = this.model.getPercentOfDone();\n this.showCollection(items, percent, index => {\n this.model.setDone(index)\n this.collectionActivity();\n });\n }", "title": "" }, { "docid": "c4c7dd56fa9443343c83ae76e69d66b5", "score": "0.5468557", "text": "function refreshlist()\n {\n doAPICall(\"products\" + getQueryParams(),null,\"GET\", refreshtable, generalerror); \n }", "title": "" }, { "docid": "9043d16cda489df466907c3980ac5dd0", "score": "0.54666275", "text": "function refreshUI() {\n renderTodos();\n renderLists();\n }", "title": "" }, { "docid": "259fd3af60de8afebba508ac099caff6", "score": "0.5462217", "text": "refresh() {\n return this.schedule({\n cancel: ({ phase }) => phase === 'refreshed',\n interval: Poll.IMMEDIATE,\n phase: 'refreshed'\n });\n }", "title": "" }, { "docid": "259fd3af60de8afebba508ac099caff6", "score": "0.5462217", "text": "refresh() {\n return this.schedule({\n cancel: ({ phase }) => phase === 'refreshed',\n interval: Poll.IMMEDIATE,\n phase: 'refreshed'\n });\n }", "title": "" }, { "docid": "626c53e436c47b75da4c87f3b2eff66e", "score": "0.5460889", "text": "refreshFeed() {\n\t\tthis.props.dispatch(fetchAll);\n\t}", "title": "" }, { "docid": "6ed0ba9b4a1794309a056e4e40c4de9e", "score": "0.54534394", "text": "function refreshAfterDelay(){\n getProjects(userID);\n }", "title": "" }, { "docid": "2ff5d7ff5f685aac8893c665bd326130", "score": "0.5449784", "text": "function reload() {\n // we always refresh the state from the backend after we made a change.\n // this has advantages:\n // - limits the risk that our copy gets corrupted\n // - we see changes made by other users faster\n taskMetaData.changed('task');\n\n // list of tasks must be reloaded as well:\n // changed properties on this task may cause the list to change\n taskMetaData.changed('taskList');\n }", "title": "" }, { "docid": "11d9750ec860858798478124f47ff3da", "score": "0.54457194", "text": "refresh() { return this.tellModule(\"refresh\") }", "title": "" }, { "docid": "0020873528dc3c9d34235b1eff3340d9", "score": "0.54436266", "text": "async refreshRunning() {\n await this._pollModels.refresh();\n await this._pollModels.tick;\n }", "title": "" }, { "docid": "0020873528dc3c9d34235b1eff3340d9", "score": "0.54436266", "text": "async refreshRunning() {\n await this._pollModels.refresh();\n await this._pollModels.tick;\n }", "title": "" }, { "docid": "0020873528dc3c9d34235b1eff3340d9", "score": "0.54436266", "text": "async refreshRunning() {\n await this._pollModels.refresh();\n await this._pollModels.tick;\n }", "title": "" }, { "docid": "0020873528dc3c9d34235b1eff3340d9", "score": "0.54436266", "text": "async refreshRunning() {\n await this._pollModels.refresh();\n await this._pollModels.tick;\n }", "title": "" }, { "docid": "dee7f682b94f988335a956e2f804f229", "score": "0.5442681", "text": "function refreshListHistory(){\n //build obj for http -- this is for the history call\n var listDat = {\n token:auth.isAuthenticated(),\n type:'list',\n listID:$stateParams.groupObj._id\n }\n\n $http.post('/history', listDat).then((res)=>{\n if(res){\n var arr = res.data.data;\n //build set for user IDs\n var users = new Set();\n for(var i=0;i<arr.length;i++){\n //cycle through the array and capture all the actors and acted upons\n if(arr[i].actor!=undefined&&arr[i].actor!=null)\n {\n users.add(arr[i].actor)\n };\n if(arr[i].actedUpon!=undefined&&arr[i].actedUpon!=null){\n users.add(arr[i].actedUpon);\n }\n\n }\n //build obj for http call for users!\n var userDat = {\n token:auth.isAuthenticated(),\n payload:Array.from(users) //cast set to array\n };\n $http.post('/userIDQuery',userDat).then((res)=>{\n var returnedUsers = res.data.data;\n //loop through the array and the returned users, if _ids match enter user friendly name\n for(var x = 0; x<returnedUsers.length; x++){\n for(var i=0;i<arr.length;i++){\n if(arr[i].actor==returnedUsers[x]._id){\n arr[i].actor=returnedUsers[x].userName;\n }\n if(arr[i].actedUpon==returnedUsers[x]._id){\n arr[i].actedUpon=returnedUsers[x].userName;\n }\n }\n }\n $scope.listHist = arr;\n },(res)=>{})\n }\n },(res)=>{}\n\n )\n}", "title": "" }, { "docid": "1907f4d4b246693038c5bf23648a240f", "score": "0.54405165", "text": "UPDATE_ACTIVITY (state, data) {\n //\n }", "title": "" }, { "docid": "215c88f5a8e32a24b8074bbc989475a0", "score": "0.5436367", "text": "function refreshTaskUi()\n{\n\t// clear all scrumboards\n\t$(\".scrumBoardTasks ul\").html(\"\");\n\n\t// now send the tasks to their appropriate scrumboard.\n\tfor (var task_key in currentTasks)\n\t{\n\t\tvar task = currentTasks[task_key];\n\t\tif (worksOnTask( member_id, task))\n\t\t{\n\t\t\taddTaskToList(task, \"#myTasks\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar list = '#' + task.status + 'List';\n\t\t\taddTaskToList(task, list);\n\t\t}\n\t}\n\n\t// set up drag-n-drop between the tasklists.\n\t$(\".taskList\").sortable({'connectWith':'.taskList', receive: noteReceived});\n\tsetAdvancedUIBehaviour();\n}", "title": "" }, { "docid": "08459fcd922aab8affe66d312a40c11d", "score": "0.5435245", "text": "function timerFaceUnlike() {\r\n refreshAllViews();\r\n setInterval(function () { timerFaceUnlike() }, 5000);\r\n}", "title": "" }, { "docid": "7f66c18ddf37caa6cac3becd232818e2", "score": "0.5433933", "text": "refresh() {\n\t\t\tthis.set(\"page\", 1);\n\t\t\tlet self = this;\n\t\t\tthis.fetchMySites(function(data) {\n\t\t\t\tself.filter.userKey = self.userWebsites[0].userKey;\n\t\t\t\tself.refreshList(1, self.limit, self.filter, self.sort);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "25ad9a7863b6137f7adde8978deb5a70", "score": "0.5428485", "text": "function updateSummaryList() {\n updateReportSummary(function(message) {\n\n // update the session storage item with the current timestamp if the update function ran successfully\n if (message === 'updated' || message === 'current')\n widget.preferences.lastSummaryUpdate = (new Date()).valueOf();\n });\n}", "title": "" }, { "docid": "acfe1fc14c9c8058aac36ec1709aab7f", "score": "0.5425502", "text": "logRefreshStats() {\n if (keys(this.refreshAdapterEvents).length > 0) {\n interaction(REFRESH_PAYLOAD_TARGET, REFRESH_PAYLOAD_SCOPE, this.refreshAdapterEvents, REFRESH_EVENTSOURCE, REFRESH_EVENTTYPE, this.refreshApiCallEventStats);\n this.resetRefreshStats();\n }\n }", "title": "" }, { "docid": "fa068ed16683e0e86ef2f180d62d7754", "score": "0.54236376", "text": "function updateActivities(portrait) {\n invalidateActivities();\n validateActivities();\n var timings = getDates();\n var activities = JSON.parse(localStorage.activities).activities;\n var activitiesHTML = \"\";\n for (var activity of activities) {\n var animes = JSON.parse(sessionStorage.activities).activities;\n var anime = \"\";\n for (var animeData of animes) {\n if (animeData.activity === activity.activity && animeData.status === null) {\n anime = \"expand\";\n animeData.status = \"animated\";\n sessionStorage.activities = JSON.stringify({\n activities: animes\n });\n }\n }\n\n\n /*\n The checkbox should still be checkable if the activity is invalid as the user may have completed it before\n it got invalidated.\n */\n var checkboxData = activity.status === \"complete\" ? \"checked\" : \"\";\n\n var activityStatus = \"\";\n var ifOld = \"\";\n if (activity.status === \"invalid\") {\n activityStatus = \"You don't have enough time for this!\";\n } else if (timings !== null && activity.completed !== null && new Date(activity.completed) < timings.start) {\n activityStatus = \"Previous day's activity\";\n ifOld = \"oldActivity\";\n }\n activityStatus = `<div class=\"${portrait ? \"floatLeft\" : \"floatRight\"} statusTxt\">${activityStatus}</div>`;\n var forPortrait = portrait ? activityStatus : \"\";\n var forLandscape = portrait ? \"\" : activityStatus;\n activitiesHTML += `\n <div class=\"activity clearFloat ${activity.status}Activity ${anime} ${ifOld}\" title=\"${activity.activity}\">\n ${forPortrait}\n <input class=\"activityTxt floatLeft\" placeholder=\"Activity\" type=\"text\" value=\"${activity.activity}\">\n <input class=\"activityDuration durationInput floatLeft\" max=\"60\" min=\"1\" placeholder=\"Duration\"\n type=\"number\" value=\"${activity.duration}\">\n <input class=\"activityCheckbox floatRight\" type=\"checkbox\" ${checkboxData}>\n <input class=\"delActivity floatRight\" type=\"button\" value=\"X\">\n ${forLandscape}\n </div>\n `;\n }\n document.getElementById(\"activities\").innerHTML = activitiesHTML;\n addEventListeners();\n}", "title": "" }, { "docid": "f045eaefdd9aea1cba2ee6dff34ddfb3", "score": "0.5422877", "text": "onRowStoreRefresh({\n action\n }) {\n switch (action) {\n case 'sort':\n case 'filter':\n this.scheduleDraw();\n }\n }", "title": "" } ]
2e3e8275f8fced60b152e208f8b572ad
Production trace always returns the first arg and ignores everything else. The test version of trace will logic to handle/store other args.
[ { "docid": "f014bb582be775c8733bd5212fe8326a", "score": "0.72339094", "text": "function trace(arg1){\n return arg1;\n}", "title": "" } ]
[ { "docid": "7fce239065cc17c797ced350f92f3c50", "score": "0.67090195", "text": "TraceOnly(...args) { this.doLog(\"TRACE\", args, false, false); }", "title": "" }, { "docid": "cf7434d1fdb26266d4aacf01ea0e1425", "score": "0.6498974", "text": "Trace(...args) { this.doLog(\"TRACE\", args, true, false); }", "title": "" }, { "docid": "c7768bc13678758b655fe213c2a9b691", "score": "0.64929277", "text": "function traceResult() {\r\n console.log(arguments.join(\", \"))\r\n }", "title": "" }, { "docid": "c6a2a7ae29932a85a690e9bd145d5282", "score": "0.6311362", "text": "TraceOnlyOnce(...args) { this.doLog(\"TRACE\", args, false, true); }", "title": "" }, { "docid": "8f706b8546e14bf62ede3cae1032cf65", "score": "0.6145189", "text": "TraceOnce(...args) { this.doLog(\"TRACE\", args, true, true); }", "title": "" }, { "docid": "2860fff8090efe22b09a57b51fc42d69", "score": "0.6117084", "text": "function trace(arg) {\n var now = (window.performance.now() / 1000).toFixed(3);\n console.log(now + ': ', arg);\n}", "title": "" }, { "docid": "9e09620dd0b1e593fc2d48f5d120911b", "score": "0.5938144", "text": "function processComplicatedArguments(args) {\n console.log(y(\"Nothing here for now\"));\n}", "title": "" }, { "docid": "9a39168e69c21665c6913d858b8653da", "score": "0.5930476", "text": "function snippet_trace(arg, expected) { \n\n\tconst trace = [];\n\n\ttrace.push( {input: arg} );\n\n\tconst step_1 = String(arg);\n\ttrace.push( \"Step 1: String(arg) -> str\" );\n\ttrace.push( step_1 );\n\n\tconst step_2 = step_1.replace(\"12\", \"\");\n\ttrace.push( \"Step 2: step_1.replace(\\/\\'12\\', \\'\\') -> str\" );\n\ttrace.push( step_2 );\n\n\tconst step_3 = Number(step_2);\n\ttrace.push( \"Step 3: Number(step_2) -> #\" );\n\ttrace.push( {actual: step_3} );\n\n\ttrace.push( {expected} );\n\n\treturn trace;\n\n}", "title": "" }, { "docid": "8fe3b46de43c660edf7d563272fb25b4", "score": "0.5769292", "text": "function second(__trace) {\n return (0, _core.access)(a => a, __trace);\n}", "title": "" }, { "docid": "c9292e84f4d989e327c55e7d7b25e7e0", "score": "0.5656548", "text": "function logArray1(arg) {\n console.log(arg);\n return arg;\n}", "title": "" }, { "docid": "92a64341e00d1125669b2d270e3b17c5", "score": "0.55848765", "text": "function record(args) {\n console.log(args);\n}", "title": "" }, { "docid": "d38fdacde1fb51941fbcdad3b4123c14", "score": "0.5545092", "text": "trace(correlationId, message, ...args) { }", "title": "" }, { "docid": "edce19346b6bac7ecaeca2ff976f6835", "score": "0.55215234", "text": "function profilerMarkArgs(arg0, arg1, arg2) {\r\n if (arg2 !== undefined) {\r\n return \"(\" + arg0 + \";\" + arg1 + \";\" + arg2 + \")\";\r\n } else if (arg1 !== undefined) {\r\n return \"(\" + arg0 + \";\" + arg1 + \")\";\r\n } else if (arg0 !== undefined) {\r\n return \"(\" + arg0 + \")\";\r\n } else {\r\n return \"\";\r\n }\r\n }", "title": "" }, { "docid": "dc84f7e176553687ce09de6a2cd7cb9a", "score": "0.5506175", "text": "function Debug()\n{\n\tconsole.log(...arguments);\n}", "title": "" }, { "docid": "e5be08cec446f89eb669e742f2328020", "score": "0.54979455", "text": "function profilerMarkArgs(arg0, arg1, arg2) {\n if (arg2 !== undefined) {\n return \"(\" + arg0 + \";\" + arg1 + \";\" + arg2 + \")\";\n } else if (arg1 !== undefined) {\n return \"(\" + arg0 + \";\" + arg1 + \")\";\n } else if (arg0 !== undefined) {\n return \"(\" + arg0 + \")\";\n } else {\n return \"\";\n }\n }", "title": "" }, { "docid": "f75b9fcdc9f0c32fdc2a67d35e059e7b", "score": "0.54804254", "text": "debug(message, ...args) { }", "title": "" }, { "docid": "5f1951a45fe18d5a1e6ed1b7bcecef1c", "score": "0.54569215", "text": "function logArray2(arg) {\n console.log(arg);\n return arg;\n}", "title": "" }, { "docid": "193db2ff02ebb42cec4c3cc0dfde39e8", "score": "0.54391146", "text": "function test_args() {\n return [];\n}", "title": "" }, { "docid": "86a4e9e24deab8b77b5e07a73d8a7729", "score": "0.54269004", "text": "function l () {\n const args = [...arguments];\n console.log(args);\n}", "title": "" }, { "docid": "07b747a64b03f37ba54bc55b71bee800", "score": "0.54010594", "text": "function lotsOfArgs(mainVar, ...theRest){\n console.log('this is mainVar', mainVar);\n console.log('this is rest', theRest);\n}", "title": "" }, { "docid": "bb4a79dc57c93f66a6c15a5d7432bae1", "score": "0.53564733", "text": "function tDebug(args,msg) {\n debug(\"IN:\"+args.callee.name+\" FROM:\"+args.callee.caller.name+\" - \"+msg);\n}", "title": "" }, { "docid": "fb2de4bff53dbbb66e5c0c2e1bfdbe94", "score": "0.5353514", "text": "function a() {\n console.log(arguments[0]);\n console.log(arguments[1]);\n console.log(arguments[2]);\n console.log('-----------');\n console.log();\n}", "title": "" }, { "docid": "32ef765eb54aa00184a774d468d19e40", "score": "0.53111666", "text": "function traceShow(x, y){\n console.log(show(x))\n return y\n}", "title": "" }, { "docid": "b9638f78b0f7c66c9cf7d6bcafdc2d73", "score": "0.53035915", "text": "function dump_trace() {\r\n return dump_stmt_list(trace_buffer, false);\r\n}", "title": "" }, { "docid": "7a4029815493fd240dde4d8ddcf367be", "score": "0.5298274", "text": "trace(...args) {\n this.bunyan.trace(this.applyFilters(LoggerLevel.TRACE, ...args));\n return this;\n }", "title": "" }, { "docid": "a36460d1774ebf7702aa621bb0071930", "score": "0.5294527", "text": "trace(msg, ...params) {\n log.trace(format.apply(null, arguments));\n }", "title": "" }, { "docid": "6d337687a1b5afeb49e695cc54a7da2b", "score": "0.5275315", "text": "function TraceFormatter () {\n}", "title": "" }, { "docid": "37adf0da070165c5a791691e5af5df2f", "score": "0.5249867", "text": "function TraceAPI() {}", "title": "" }, { "docid": "abc4f6b639664eed15040aea4f50ca6b", "score": "0.5234025", "text": "function logArgsRest(...args){\n for (let arg of args){\n console.log(arg);\n }\n}", "title": "" }, { "docid": "f1d1d7e4145b566bd0c12db11acd38de", "score": "0.52263004", "text": "function testArgs(a, b, c) {\n console.log(a, b, c, this.name);\n}", "title": "" }, { "docid": "d0cdf385e6ad993405c01caf78d7b6d8", "score": "0.5206897", "text": "function func1(a, b, ...args) {\n\tconsole.log('a', a);\n\tconsole.log('b', b);\n\tconsole.log('...args', args);\n}", "title": "" }, { "docid": "cabdd742307b7cba29cfd04f7de0c279", "score": "0.52024215", "text": "function ds_debug(a, b) {\n return;\n console.log(a, (typeof(b) != 'undefined') ? b : '');\n}", "title": "" }, { "docid": "0cb918eb3d27365e2e99372793d1c82d", "score": "0.519263", "text": "function parseArgs(args) {\n return args.map(function (val) {\n if (val != null && val.inspect) {\n return val.inspect();\n } else {\n try {\n return (/*istanbul ignore next*/(0, _stringify2.default)(val) || val + \"\"\n );\n } catch (e) {\n return util.inspect(val);\n }\n }\n });\n}", "title": "" }, { "docid": "6563bf22ee9950dc0e1fa357c9ca737e", "score": "0.5189375", "text": "success(...args) {\n\t\tconst parameters = args.map((param) => {\n\t\t\treturn colors.green(param);\n\t\t});\n\t\tparameters.unshift(now());\n\t\tconsole.log.apply(console, parameters);\n\t}", "title": "" }, { "docid": "3a6ae429544e7cf88fe12dd6d6a2417c", "score": "0.51759934", "text": "function argsExpectDetail(argDetail) {\n if (argDetail) {\n if (argDetail.charAt(0) !== '-') {\n return argDetail;\n }\n else { console.log(\"failed at firstChar:\" + argDetail.charAt(0) + \";\"); return undefined; }\n }\n else { console.log('failed at arg:' + argDetail + \";\"); return undefined; }\n}", "title": "" }, { "docid": "c106ca8e000c22728c4f514727f27080", "score": "0.5153298", "text": "function log(){let a=arguments;console.log(...a)}", "title": "" }, { "docid": "67f676940576707504f668cea55a21b7", "score": "0.51510656", "text": "function rest(...args){\n return args;\n}", "title": "" }, { "docid": "50f962d408d877b4d68b74d41664e045", "score": "0.5139546", "text": "exit() {\n const {\n path,\n // state,\n // yieldContextIdVar,\n Traces\n } = this;\n\n const [argumentNode] = this.getChildNodes();\n argumentNode?.addDefaultTrace();\n\n const realContextIdVar = this.getRealContextIdVar();\n const staticResumeContextId = this.addResumeContext();\n\n const argumentVar = Traces.generateDeclaredUidIdentifier('arg');\n const resultVar = Traces.generateDeclaredUidIdentifier('res');\n const genStaticContextIdVar = this.StaticContext.getGeneratorStaticContextIdVar();\n const argumentPath = argumentNode.path;\n\n // pre trace\n Traces.addTrace({\n path: argumentPath,\n staticTraceData: {\n type: TraceType.Yield\n },\n data: {\n argumentVar,\n genStaticContextIdVar,\n staticResumeContextId\n },\n meta: {\n build: buildWrapYield\n }\n });\n\n // trace self\n Traces.addTrace({\n path,\n node: this,\n staticTraceData: {\n type: TraceType.ResumeGen\n },\n data: {\n argumentVar,\n resultVar,\n realContextIdVar,\n staticResumeContextId\n },\n meta: {\n build: buildPostYield\n }\n });\n }", "title": "" }, { "docid": "2bcb40101a4ecef952b1ce779f976fef", "score": "0.5136606", "text": "function printArgsDec(oldFunc) {\n function newFunc(...arg) {\n console.log('argument is', arg);\n return oldFunc(...arg); \n }\n return newFunc;\n}", "title": "" }, { "docid": "0aa62d2a40664fc992820a479c28cd02", "score": "0.5132806", "text": "function foo() { console.log(\"TRACER 1\") }", "title": "" }, { "docid": "41d356645a6c452d4aae6d1f91425651", "score": "0.5116798", "text": "function captureCall(name, args, depth) {\n args = Array.prototype.slice.call(args); // Convert to array.\n depth = depth || 0;\n return {\n depth: depth,\n name: name,\n args: args.map(function(arg) { return \"\" + arg; }),\n toString: function() {\n var msg = this.name + \"(\" + this.args.join(\",\") + \")\";\n return msg;\n },\n equals: function(call) {\n return this.toString() == call.toString();\n }\n }; \n }", "title": "" }, { "docid": "38d96c5ffb270fdcddd35fdac4a2feae", "score": "0.51050526", "text": "function foo1(...args) {\n console.log(args); \n}", "title": "" }, { "docid": "04b95e67de19ee0c7137dd52103fd0ac", "score": "0.51047367", "text": "function rest(...args) {\n console.log(`rest operator: ${args}`);\n}", "title": "" }, { "docid": "b162704356293ef217d3be28ca32f0da", "score": "0.5093421", "text": "function foo(x, y) {\n var rest = [].slice.call(arguments, 2);\n console.log(x,y,rest);\n}", "title": "" }, { "docid": "ebc9d9988f022223342fe273288cbce3", "score": "0.507715", "text": "traceCall(...args) {\n AppUtil.debug(`${args}`, `${Constants.MODULE}: call`);\n // args atleast should have length 1 (topic)\n if (args.length <= 0) {\n AppUtil.debug('Invalid args passed', null);\n return null;\n }\n return new Promise((resolve, reject) => {\n let cb = args[args.length - 1];\n // if callback not supplied, add it\n if (typeof cb !== 'function') {\n cb = (err, res) => {\n AppUtil.debug(`Req: ${args[0]}, Err: ${err}, Res: ${JSON.stringify(res)}`, `${Constants.MODULE}: result`);\n if (err) reject(err);\n resolve(res);\n };\n args.push(cb);\n }\n // make a call\n Meteor.call.apply(null, args);\n });\n }", "title": "" }, { "docid": "f65e6775b5dd038c2bb296947184ee5c", "score": "0.50681466", "text": "function formatLogArguments (args) {\n const requestInstance = getNamespace('main').get('reqId')\n const strInstance = (requestInstance) ? ' INST:' + requestInstance : ''\n\n args = Array.prototype.slice.call(args)\n let stackInfo = getStackInfo(1)\n if (stackInfo) {\n // get file path relative to project root\n let calleeStr = '(' + stackInfo.relativePath + ':' + stackInfo.line + ')' + strInstance\n\n if (typeof (args[0]) === 'string') {\n args[0] = calleeStr + ' ' + args[0]\n } else {\n args.unshift(calleeStr)\n }\n }\n return args\n}", "title": "" }, { "docid": "70ab0bdf53873461527df12cdda52f83", "score": "0.5068104", "text": "function listArguments2(...args) {\n console.log(args);\n somethingElse(...args);\n}", "title": "" }, { "docid": "dd28264799609eaa3409cca4586122ce", "score": "0.5065721", "text": "function test5()\n{\n console.log(arguments);\n}", "title": "" }, { "docid": "f08672700b3850b1e8227403a3fa3337", "score": "0.50625294", "text": "function newRestFunction(a, b, ...args) {\n console.log(\"first arg:\", a)\n console.log(\"second arg:\", b)\n console.log(\"the rest:\", args)\n}", "title": "" }, { "docid": "67d2b6dd5638c3c0691dc7aa54d987c6", "score": "0.50565696", "text": "function rest(...args){\n for(arg of args){\n console.log(arg);\n }\n}", "title": "" }, { "docid": "bf3be86e042bb9a19d8c5d5545305b88", "score": "0.5039536", "text": "function profile2(...args) {\n return `I am ${args[0]} I am ${args[1]}. I am a ${args[2]}.`;\n}", "title": "" }, { "docid": "5bb9cd62bb3f76161deda149acdccfe5", "score": "0.5039207", "text": "function foo(x, y, ...rest) {\n console.log(x,y,rest);\n}", "title": "" }, { "docid": "00eadb549d55d9ac06214e231264b4e4", "score": "0.5034", "text": "function myTag1(string , ...args){\n console.log(string);\n console.log(args);\n \n \n}", "title": "" }, { "docid": "8a4ff2ee81fd2420522da1540df364a7", "score": "0.50285584", "text": "function caller(){\n console.log(a);\n}", "title": "" }, { "docid": "1556e43222bf6dd021662667693be165", "score": "0.5022899", "text": "logTrace(...params) {\n this.getParent().logTrace(this.id + ':', ...params);\n }", "title": "" }, { "docid": "8e03cb6d608bceb5e3cc45ea7405ca8a", "score": "0.50151056", "text": "function L(...args) { if (Formatter.DEBUG) Vex.L('Vex.Flow.Formatter', args); }", "title": "" }, { "docid": "4943bf9394e7c95801ea313f9f2f0bcb", "score": "0.5014502", "text": "debug(correlationId, message, ...args) { }", "title": "" }, { "docid": "d137d13192d837746181e3f5c753749a", "score": "0.49982712", "text": "function TraceAPI() {\n }", "title": "" }, { "docid": "ed2a7bbac15f09abc73a8d3eb3d2c0e3", "score": "0.49942958", "text": "function trace(str){\n\t\n\tif(typeof console != \"undefined\")\n\t\tconsole.log(str);\n\n}", "title": "" }, { "docid": "37f37971faddb41b5f55f7a957ffa586", "score": "0.49875855", "text": "function c() {\n console.log(...arguments);\n}", "title": "" }, { "docid": "3d2ce678b1944717fe3ee8b50d63b132", "score": "0.49869418", "text": "function getArgumentFromLastCall() {\n if (renderOutput.mock.calls.length === 0) {\n return undefined;\n }\n const lastCallArgs =\n renderOutput.mock.calls[renderOutput.mock.calls.length - 1];\n if (lastCallArgs.length === 0) {\n return undefined;\n }\n return lastCallArgs[0];\n}", "title": "" }, { "docid": "1eb132b3ef068ec8dd09c14ab6aa6ab0", "score": "0.4986356", "text": "function ourFunctionWithArgs(a, b) {\n console.log(a + b);\n}", "title": "" }, { "docid": "a24e91ad059e8d4662d9a8f56e159e4e", "score": "0.4984558", "text": "missArgument(x = 1, y = 2, z = 3)\t{\n\t \tconsole.log(x, y, z); // Output \"1 7 9\"\n\t}", "title": "" }, { "docid": "11b076fa3060721d1744c3825bb31c5d", "score": "0.49841386", "text": "function rest(...paras) {\n console.log(paras);\n}", "title": "" }, { "docid": "2743eb4d00b06a81ec5dcc1be56512c6", "score": "0.49751672", "text": "function test() {\n\t var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\t //if someone does not enter a value when the function is called, 0 will be used for a.\n\t console.log(a + 10);\n\t}", "title": "" }, { "docid": "1cbd588b4c67695bbaa0e6ac7fd91b29", "score": "0.49718228", "text": "trace(msg, object = '') {\n if (this.active && this.level >= 0) {\n console.log(this.generateMessage(msg), object);\n }\n }", "title": "" }, { "docid": "6df47ada6e2306694ccb769523ea5505", "score": "0.49679413", "text": "newTrace(trace) {\n invariant(typeof trace === 'string', 'firebase.perf().newTrace() requires a string value');\n return new Trace(this.nativeModule, trace);\n }", "title": "" }, { "docid": "70690b35f569cae4e0489a871344c4dd", "score": "0.49627843", "text": "function Trace() {\n\n // object containing all functions to trace, including before and afters\n this.Tracers = {};\n\n // set up traces for all passed in funcitons\n for (var i = 0; i < arguments.length; i++) {\n var fName = _getName(arguments[i]);\n this.createTrace(fName, arguments[i]);\n }\n\n this.indent = 0;\n this._replaceCompile();\n}", "title": "" }, { "docid": "ffdc228fdc6eaeda1ff04c614aefb58a", "score": "0.49593827", "text": "function getArgs(oArgs) {\n\n var args = slice.call(oArgs),\n len = args.length;\n\n if (old) {\n // prefix\n args[1] = 'on' + args[1];\n if (len > 3) {\n // no capture\n args.pop();\n }\n } else if (len === 3) {\n args.push(false);\n }\n\n return args;\n\n }", "title": "" }, { "docid": "a627eb0760cc5a26e2227049698a38ac", "score": "0.49487367", "text": "function getArgs(oArgs) {\r\n\r\n var args = slice.call(oArgs),\r\n len = args.length;\r\n\r\n if (old) {\r\n // prefix\r\n args[1] = 'on' + args[1];\r\n if (len > 3) {\r\n // no capture\r\n args.pop();\r\n }\r\n } else if (len === 3) {\r\n args.push(false);\r\n }\r\n\r\n return args;\r\n\r\n }", "title": "" }, { "docid": "a627eb0760cc5a26e2227049698a38ac", "score": "0.49487367", "text": "function getArgs(oArgs) {\r\n\r\n var args = slice.call(oArgs),\r\n len = args.length;\r\n\r\n if (old) {\r\n // prefix\r\n args[1] = 'on' + args[1];\r\n if (len > 3) {\r\n // no capture\r\n args.pop();\r\n }\r\n } else if (len === 3) {\r\n args.push(false);\r\n }\r\n\r\n return args;\r\n\r\n }", "title": "" }, { "docid": "a627eb0760cc5a26e2227049698a38ac", "score": "0.49487367", "text": "function getArgs(oArgs) {\r\n\r\n var args = slice.call(oArgs),\r\n len = args.length;\r\n\r\n if (old) {\r\n // prefix\r\n args[1] = 'on' + args[1];\r\n if (len > 3) {\r\n // no capture\r\n args.pop();\r\n }\r\n } else if (len === 3) {\r\n args.push(false);\r\n }\r\n\r\n return args;\r\n\r\n }", "title": "" }, { "docid": "0625c86cfede4e29218d9d04becca4de", "score": "0.49478853", "text": "function doSomething () {\n var args = Array.prototype.slice.call(arguments);\n console.log(args);\n}", "title": "" }, { "docid": "3ab216370a85ccc1c9c9f8841aa3f13f", "score": "0.49430048", "text": "function defaultArgs() {\n console.log(arguments);\n}", "title": "" }, { "docid": "3ab216370a85ccc1c9c9f8841aa3f13f", "score": "0.49430048", "text": "function defaultArgs() {\n console.log(arguments);\n}", "title": "" }, { "docid": "ae296317b89c2f657be65d1185572e47", "score": "0.4938882", "text": "function log(...args) {\n if (devMode) {\n console.log('nude:', ...args);\n }\n}", "title": "" }, { "docid": "f957721160d2cd13548e9e8d61e997da", "score": "0.49338692", "text": "function parseArgs(args) {\n return args.map(function (val) {\n if (val != null && val.inspect) {\n return val.inspect();\n } else {\n try {\n return JSON.stringify(val) || val + \"\";\n } catch (e) {\n return util.inspect(val);\n }\n }\n });\n}", "title": "" }, { "docid": "fc2520047aaf4acb522cf4833238890e", "score": "0.49325016", "text": "function debug() {\n//\treturn; // comment out to enabled debugging\n\t\n\tvar s = arguments[0] + '(';\n\tfor (var i = 1; i < arguments.length; i++) {\n\t\tif (i > 1) s += ', ';\n\t\tvar arg = arguments[i];\n\t\tif (typeof arg === 'string') {\n\t\t\t\n\t\t}\n\t\telse if (typeof arg === 'number') {\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\targ = JSON.stringify(arg);\n\t\t}\n\t\t\n\t\ts += arg;\n\t}\n\ts += ')';\n\timplant.print(s);\t\n}", "title": "" }, { "docid": "f4c71c9a2199364b6a49e6190d9a5146", "score": "0.49297652", "text": "function variadic() {\n console.log(arguments);\n}", "title": "" }, { "docid": "b17f89e1fa0eef937f26e378b12f20b5", "score": "0.49296498", "text": "function testFunc( a = 1, b = 2) {\n console.log( arguments );\n}", "title": "" }, { "docid": "fd2e570fe060c1ffd7413f3c4103effb", "score": "0.4928003", "text": "function foo(...rest) {\n console.log(rest);\n}", "title": "" }, { "docid": "ad05a86c527d6718a986dddcda671e21", "score": "0.49276647", "text": "function f1(arg) {\n console.log(\"f1\", arg);\n return arg;\n}", "title": "" }, { "docid": "4a9965186fdbdf55177e752d90780fda", "score": "0.49261943", "text": "function entry(data) {\n\tvar toLog = \"Entering \";\n\tvar first = false;\n\tfor (var i = 0; i < arguments.length; i++) {\n\t\tif (first === false) {\n\t\t\tfirst = true;\n\t\t\ttoLog += objectToString(arguments[i]);\n\t\t} else {\n\t\t\ttoLog += \", \" + objectToString(arguments[i]);\n\t\t}\n\t}\n\tdebug(toLog);\n}", "title": "" }, { "docid": "0fd448bff082a4c1b1d0710587827363", "score": "0.4924765", "text": "function call(lookup, dangling, entry, signature, body) {\n const args = [];\n let ret = \"\";\n\n for (let arg of Array.from(signature)) {\n let id, shadow;\n const { name } = arg;\n\n let copy = (id = lookup(name));\n let other = null;\n let meta = null;\n let omit = false;\n\n const isReturn = name === RETURN_ARG;\n\n // Shadowed inout: input side\n if ((shadow = arg.meta != null ? arg.meta.shadowed : undefined)) {\n other = lookup(shadow);\n if (other) {\n body.vars[other] = \" \" + arg.param(other);\n body.calls.push(` ${other} = ${id}`);\n\n if (!dangling(shadow)) {\n arg = arg.split();\n } else {\n meta = { shadowed: other };\n }\n }\n }\n\n // Shadowed inout: output side\n if ((shadow = arg.meta != null ? arg.meta.shadow : undefined)) {\n other = lookup(shadow);\n if (other) {\n if (!dangling(shadow)) {\n arg = arg.split();\n omit = true;\n } else {\n meta = { shadow: other };\n continue;\n }\n }\n }\n\n if (isReturn) {\n // Capture return value\n ret = id;\n } else if (!omit) {\n // Pass all non return, non shadow args in\n args.push(other != null ? other : id);\n }\n\n // Export argument if unconnected\n if (dangling(name)) {\n let op = \"push\";\n if (isReturn) {\n if (body.return === \"\") {\n op = \"unshift\";\n // Preserve 'return' arg name\n copy = name;\n body.type = arg.spec;\n body.return = ` return ${id}`;\n body.vars[id] = \" \" + arg.param(id);\n } else {\n body.vars[id] = \" \" + arg.param(id);\n body.params.push(arg.param(id, true));\n }\n } else {\n body.params.push(arg.param(id, true));\n }\n\n // Copy argument into new signature\n arg = arg.copy(copy, meta);\n body.signature[op](arg);\n } else {\n body.vars[id] = \" \" + arg.param(id);\n }\n }\n\n return body.calls.push(invoke(ret, entry, args));\n}", "title": "" }, { "docid": "6047719e18def1b39ae4278c24f9aa90", "score": "0.49233365", "text": "function noisy(f){\n return (...args) => {\n console.log(\"calling with \", args, typeof(args), typeof(args[4]),typeof(args[1]));\n let result = f(...args);\n console.log(\"called with \", args, \", returned\", result);\n return result;\n }\n}", "title": "" }, { "docid": "50f2696b129522e5c2dfa905ea4ea729", "score": "0.49194252", "text": "function foo() {\n var rest = [].slice.call(arguments);\n console.log(rest);\n}", "title": "" }, { "docid": "bdd9d1efdd933723b495ed24fbf0b034", "score": "0.49141145", "text": "function inspectProgram(emitted) {\n if (!emitted.exit) {\n return;\n }\n\n Object.keys(namedParameterCalls).forEach(name => {\n if (structs[name]) {\n return;\n }\n\n context.report({\n node: namedParameterCalls[name],\n message: \"Avoid using named parameters.\"\n });\n });\n }", "title": "" }, { "docid": "6496da32d9e14ac3d2a60e0fec246f08", "score": "0.4906219", "text": "newTrace(trace) {\n if (typeof trace !== 'string') {\n throw new Error('firebase.perf().newTrace() requires a string value');\n }\n\n return new Trace(this, trace);\n }", "title": "" }, { "docid": "69826f17de9c1f772ad8be38f6cbb4f4", "score": "0.49010813", "text": "function functionWithArgs(a, b){\n console.log(a + b);\n}", "title": "" }, { "docid": "5b60b613fa3721def01791d0d44ddd16", "score": "0.48927274", "text": "function record(funName, fun) {\n const args = _.rest(arguments, 2);\n console.log(\"\\n\",'RECORD: Begin', funName,'with', args);\n console.log('RESULT:', fun.apply(null, args),\"\\n\");\n}", "title": "" }, { "docid": "cb11214267b89a19990015e3a02d478a", "score": "0.4887895", "text": "function debug(b) {\n\tvar i, leni; for(i = 0, s = [], leni = arguments.length; i < leni; i += 1) {\n\t\ts.push('' + arguments[i]);\n\t}\n\tconsole.log(s.join(' '));\n\treturn 1;\n}", "title": "" }, { "docid": "4dc06c2899c7b9c230cf3c418924021e", "score": "0.48861277", "text": "function visitFunctionCallArguments(traverse,node,path,state){utils.catchup(node.callee.range[0],state);traverse(node.callee,[node].concat(path),state);var args=node['arguments'];for(var index=0;index<args.length;++index){utils.catchup(args[index].range[0],state);traverse(args[index],[node].concat(path),state);utils.catchup(args[index].range[1],state);}// delete first comma between the last argument and the closing parenthesis\nutils.catchup(node.range[1],state,function(value){return value.replace(\",\",'');});return false;}", "title": "" }, { "docid": "f11efb2ae5ea6ac32600ed7c54af9337", "score": "0.4884676", "text": "function __trace (object) {\n\treturn Array.from(object.trace);\n}", "title": "" }, { "docid": "24e26d6365738839007b14e5b66bbf6c", "score": "0.4882434", "text": "function myFun(a, b, ...manyMoreArgs) {\n console.log(\"a\", a)\n console.log(\"b\", b)\n console.log(\"manyMoreArgs\", manyMoreArgs)\n}", "title": "" }, { "docid": "7f32e8eed9361da67e1400198417bb8c", "score": "0.48814678", "text": "function dummy(a) {\n console.log(\"a=\"+a);\n console.log(\"I am dummy\");\n for(i=0;i<arguments.length;i++)\n console.log(arguments[i]);\n}", "title": "" }, { "docid": "1737784a3bd99cc25e8a49cb238182aa", "score": "0.48765308", "text": "function functionWithArgs(a, b) {\n console.log(a + b);\n}", "title": "" }, { "docid": "a6f0a81f93d2e00e96a560814e44489e", "score": "0.4872152", "text": "function next(args) {\n return args;\n }", "title": "" }, { "docid": "e0718b9e2f28f5d636d71202823a8bcc", "score": "0.48713154", "text": "function argumentCollector(...args){\n return args;\n}", "title": "" }, { "docid": "b34c764945818520fdf6c44155d1084c", "score": "0.4866226", "text": "function variableArgs(a, b, ...args) {\n console.log(`Arg a: [${a}]`);\n console.log(`Arg b: [${b}]`);\n console.log(`Arg args(${typeof args} ${Array.isArray(args) ? 'is' : 'is not'} Array): [${args}]`);\n console.log(`Sorted args: [${args.sort()}]`);\n}", "title": "" }, { "docid": "e65586904e296ccfbfcd7f6cfa3648e6", "score": "0.4860189", "text": "getArgs() {\n return this.currentFrame.args;\n }", "title": "" } ]
dc2f457f4bb791a5cfb41bbfd6244596
4)instead of h2 we use in return 5) in return section turn div into Fragmenet => 6) to CartIcon 9) set which is a difault Html5 element. => 10) to Card.js
[ { "docid": "6da1d1c0ff49af92068c9456d5c8564a", "score": "0.0", "text": "function App() { //31 make useState\n const [cartIsShown, setCartIsShown] = useState(false);\n//31*) call setCartIsShown inside it & make hideCarHandler then need to \n//use cartIsShown state & this 2 func are called\nconst showCartHandler = () => {\n setCartIsShown(true);\n};\n\nconst hideCartHandler =() => {\n setCartIsShown(false);\n};\n\n//46)so can replace Fragment by CartProvider and can remove Fragment in import up =>47) to HeaderCartButton\n//33)button Header must be called,so can point showCartHandler in Header =>34)to Header.js\n return ( //30) add Cart \n <CartProvider>\n {cartIsShown && <Cart onClose={hideCartHandler}/>} \n <Header onShowCart={showCartHandler} />\n <main>\n <Meals />\n </main>\n </CartProvider>\n );\n}", "title": "" } ]
[ { "docid": "b8637046545877ed5774fbf598d0b453", "score": "0.67732936", "text": "createCard() {\n //create the main card\n this.card.id = this.cardName + \"-card\"\n this.card.classList = 'card'\n\n let content = document.createElement('div')\n content.id = this.cardName + \"-content\"\n content.classList = \"card-content\"\n\n let text = document.createElement('p')\n text.id = this.cardName + '-text'\n text.textContent = this.cardName\n\n let title = document.createElement('span')\n title.id = this.cardName + \"-title\"\n if (\"truncateTitle\" in this.extras) {\n title.classList = \"card-title truncate\"\n } else {\n title.classList = \"card-title\"\n }\n title.textContent = this.cardName\n\n let imageContainer, image, imageLink\n\n if (this.extras.image) {\n imageContainer = document.createElement('div')\n imageContainer.classList = 'card-image'\n imageLink = document.createElement('a')\n imageLink.id = this.cardName + '-image-link'\n imageLink.href = '#'\n image = document.createElement('img')\n image.id = this.cardName + '-image'\n image.src = this.cardImage\n imageLink.appendChild(image)\n imageContainer.appendChild(imageLink)\n this.card.appendChild(imageContainer)\n }\n\n this.card.appendChild(content)\n\n if (this.extras.button) {\n let action = document.createElement('div')\n action.classList = 'card-action'\n let link = document.createElement('a')\n link.id = this.cardName + '-link'\n link.href = '#'\n link.textContent = 'Link'\n action.appendChild(link)\n this.card.appendChild(action)\n }\n\n\n content.appendChild(title)\n\n\n if (this.extras.text) {\n content.appendChild(text)\n }\n\n\n }", "title": "" }, { "docid": "894e05523e3a4751e76fd7164aa222ed", "score": "0.67171276", "text": "function generateCard(card) {\n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n }", "title": "" }, { "docid": "974e305de2ac95750b5d6e06a456b33e", "score": "0.66586465", "text": "function generateCard(card) {\n \treturn `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n }", "title": "" }, { "docid": "06d51d9535ddc854b8b65ece2cf51fc9", "score": "0.66364384", "text": "function addCard(card) {\n //create a new card div\n let newCard = document.createElement('div');\n newCard.id = card.code;\n newCard.className = 'card';\n\n //create nested card-face div with card image inside\n let cardFace = document.createElement('div');\n let img = document.createElement('img');\n img.src = card.image;\n cardFace.appendChild(img);\n //cardFace.id = card.code;\n cardFace.className = 'card-face';\n\n //create nested card-back div with image of card back inside\n let cardBack = document.createElement('div');\n let backImg = document.createElement('img');\n backImg.src = \"//cdn.shopify.com/s/files/1/0200/7616/products/playing-cards-bicycle-rider-back-1_1024x1024.png?v=1535755695\";\n cardBack.appendChild(backImg);\n cardBack.className = 'card-back';\n\n //append cardFace and cardBack divs to card div\n newCard.append(cardFace);\n newCard.append(cardBack);\n\n //append the entire card to the pile\n document.getElementById(\"pile\").append(newCard);\n }", "title": "" }, { "docid": "f630ce32aca7bce28e6321c263c8eb46", "score": "0.66338867", "text": "function generateCard(icon){\n\tconst {name,prefix,family, type} = icon;\n containerHTML.innerHTML += `\n <div class=\"icon-card\">\n <div class=\"icon-card-inner\">\n <div class=\"icon ${type}\">\n <i class=\"${family} ${prefix}${name}\"></i>\n <br>\n </div>\n <div class=\"name\">\n ${name}\n </div>\n </div>\n </div>\n `;\n}", "title": "" }, { "docid": "5bf0b57243fea9794786edbea79d3ab1", "score": "0.6601556", "text": "function generateCard(card) {\n\treturn `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`; \n}", "title": "" }, { "docid": "9a8663c3442b5aa700236bdaa0056375", "score": "0.6599234", "text": "function generating_cards(card) {\n return `<li class=\"card\" data-card=\"${card}\"> <i class=\"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "def6bc38576c729547893f73508e3544", "score": "0.65946746", "text": "function generateCard(card){\n\treturn`<li class=\"card\" data-card=\"${card}\"> <i class=\"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "7c5e03bc09ae6df896bc08e7dc5971c8", "score": "0.65895045", "text": "function generateCard(card) {\n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n }", "title": "" }, { "docid": "6026ef85553896640d7c7ccfc1300b24", "score": "0.65563685", "text": "function generateCard(card){\n\treturn `<li class=\"card\" data-card=\"${card}\">\n <i class=\"fa ${card}\"></i>\n </li>`\n}", "title": "" }, { "docid": "623d983fb5135208fe47581fd57625e6", "score": "0.65412796", "text": "function changeCard(cardType, productId){\n switch(cardType){\n case \"proc\":\n var card = document.querySelector('#container > div > div > div > div.column.is-two-thirds.components > div.card.processor > div');\n break;\n case \"ram\":\n var card = document.querySelector('#container > div > div > div > div.column.is-two-thirds.components > div.card.ram > div');\n break;\n case \"graphic-card\":\n var card = document.querySelector('#container > div > div > div > div.column.is-two-thirds.components > div.card.graphic-card > div');\n break;\n case \"storage\":\n var card = document.querySelector('#container > div > div > div > div.column.is-two-thirds.components > div.card.storage > div');\n break;\n }\n while (card.firstChild) {\n card.removeChild(card.lastChild);\n }\n\n var product = getProductById(productId);\n\n var divContent = document.createElement('div');\n divContent.setAttribute('class', 'content');\n\n var columns = document.createElement('div');\n columns.setAttribute('class', 'columns');\n\n //IMG\n var column1 = document.createElement('div');\n column1.setAttribute('class', 'column');\n\n var img = document.createElement('img');\n img.setAttribute('src', product.img);\n img.setAttribute('width', '100px');\n img.setAttribute('height', '100px');\n\n //TITLE & DESC\n var column2 = document.createElement('div');\n column2.setAttribute('class', 'column is-two-thirds');\n\n var title = document.createElement('h1');\n var titleText = document.createTextNode(product.title);\n title.appendChild(titleText);\n\n var desc = document.createElement('p');\n var descText = document.createTextNode(product.desc);\n desc.appendChild(descText);\n\n //PRICE\n var column3 = document.createElement('div');\n column3.setAttribute('class', 'column');\n\n var price = document.createElement('p');\n var priceText = document.createTextNode(product.price);\n price.appendChild(priceText);\n updatePage(product);\n\n\n column1.appendChild(img);\n column2.appendChild(title);\n column2.appendChild(desc);\n column3.appendChild(price);\n columns.appendChild(column1);\n columns.appendChild(column2);\n columns.appendChild(column3);\n card.appendChild(divContent);\n divContent.appendChild(columns);\n}", "title": "" }, { "docid": "cb9b7f123bba950afba5ddcb10f8a46e", "score": "0.6527983", "text": "function cardView(card) {\n return `\n <div class=\"icard ${card.getSuit()}\">\n <div class=\"top-card suit\">${card.getKey()}<br></div>\n <div class=\"content-card suit\"></div>\n <div class=\"bottom-card suit\">${card.getKey()}<br></div>\n </div>\n `\n}", "title": "" }, { "docid": "15b98939d4fed00cd4b55a6ffb101144", "score": "0.6525531", "text": "function generateCard(card) {\n\treturn `<li class=\"card grow\"><i class=\"fa ${card}\"></i></li>` ;\n}", "title": "" }, { "docid": "d471da0de2b94ebdab10efbb70e2dbc1", "score": "0.64969826", "text": "function showRecipe(element) {\n const { name, iconUrl } = element;\n var result = \"\";\n result += `\n <div class=\"col-4\"></div>\n <div class=\"col-4 mt-5\">\n </div>\n\n <div class=\"col-4 card\" style=\"right:15%;\">\n\n <div class=\"card-header\">\n <h4>${name}</h4>\n </div>\n \n <div class=\"card-body\" >\n <img src=\"${iconUrl}\" style=\"width:310px; height:250px;left:100%;\">\n </div>\n <div class=\"card-footer\">\n \n </div>\n\n </div>\n <div class=\"col-2\">\n \n </div>\n\n `;\n $('#nameOffood').html(result);\n\n}", "title": "" }, { "docid": "5a8dd9c783287313295e46dae3c6a8a1", "score": "0.6496255", "text": "function displayCards(data){ \r\n let cardsString=\"\"; \r\n //in data for each card\r\n data.forEach(function(card,index){\r\n cardsString+=`\r\n \r\n <div class=\"card\" style=\"background-image:url('${card.image}')\">\r\n <div class=\"overlay ${card.status}\" onclick=\"openCard(${index})\" ></div> \r\n </div> \r\n\r\n\r\n `; \r\n // line 122 is inline-html(div) and in-line css(style)\r\n /* wkt cards is a array and every card inside cards is object.here we assumed(line 115)any one card which contains image,value and status property but we want only\r\n image property.so we mentioned (line 118) card.image.likewise */ \r\n // line 123,overlay is just a random name. and using status of every card as class of div (which is inside card div and card div is inside cards div).\r\n});\r\n\r\ndocument.getElementById('cards').innerHTML=cardsString; //innerHTML includes cardString inside the div whose Id=cards.\r\n\r\n}", "title": "" }, { "docid": "545de6f19d946946a9ab2d36b35f6e0b", "score": "0.64950585", "text": "function componentCartCard(product) {\n return `<div class=\"card id=\"cart-${product.id}\" mb-3\">\n <div class=\"card-header text-end\">\n <button type=\"button\" value=\"${product.id}\" class=\"btn btnremove btn-outline-danger btn-sm\">\n <i class=\"bi bi-x-square\"></i>\n Remove\n </button>\n \n </div>\n <div class=\"row g-0 align-items-center\">\n <div class=\"col-md-4\" >\n <img src=\"${product.image}\" class=\"img-fluid img-thumbnail rounded-start\" alt=\"...\">\n </div>\n <div class=\"col-md-8\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${product.name}</h5>\n <h6 class=\"card-text\">Price: €${product.price}</h6>\n <h6 class=\"card-text\">Quantity: ${product.quantity}</h6> \n \n </div>\n </div>\n </div>\n </div>`;\n}", "title": "" }, { "docid": "3c3a2fdfd5ca4c17b45c5553e780c297", "score": "0.6489593", "text": "RenderCard()\n {\n let productCard = \n `<div class=\"col-12 col-md-6 mt-4\" id=\"${this.key}\">\n <article class=\"card cardHeight cardZoom bg-light\">\n <img src=\"Images/${this.img}\" alt=\"${this.name}\" class=\"card-img-top\">\n <div class=\"card-body m-3 p-2 bg-white border rounded\">\n <h5 class=\"card-title\">${this.name}</h5>\n <p class=\"card-text pHeight\">${this.description}</p>\n <p class=\"d-flex justify-content-between m-0\"><a class=\"btn btn-outline-dark \" onclick=\"ProductCard.ClickHandler('${this.key}')\">Bestil</a><span>${this.price}kr.</span></p>\n </div>\n </article>\n </div>`\n\n return productCard;\n }", "title": "" }, { "docid": "3bcc04cd050cfe3386ab05904b202796", "score": "0.64873916", "text": "function createCard(card) {\n console.log(card);\n if (card.includes(\"fa-\")) {\n $(\"#deck\").append(`<li class=\"card\"><i class=\"fa ${card}\"></i></li>`);\n }\n else {\n $(\"#deck\").append(`<li class=\"card\"><i class=\"${card}\"></i><img src=\"${card}\"</li>`);\n }\n }", "title": "" }, { "docid": "bf9b3cac6aa2533839f140456fcee537", "score": "0.64691585", "text": "function generateCard(card) {\n\treturn `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`; // Adds class to card\n}", "title": "" }, { "docid": "d35a9d4ea8d2af619f29e5888a572a0a", "score": "0.6455982", "text": "generateCard(obj) {\n const article = this.createElements(\"article\", [\"card\"]);\n article.innerHTML += `<div class=\"drink-detais\"><h2 class=\"drink-title\">${obj.name}</h2>\n <h3 class=\"drink-type\"><span class=\"drink-span\">Type:</span> ${obj.brewery_type}</h3>\n <p class=\"drink-street\"><span class=\"drink-span\">Street:</span> ${obj.street}</p>\n <p class=\"drink-city\"><span class=\"drink-span\">Place:</span> ${obj.city}, ${obj.state}</p>\n <p class=\"drink-contact\" id=\"contact-${obj.id}\"></p>\n </div>\n <div class=\"contacts\">\n <button class=\"btn icon phone\" data-id=\"${obj.id}\"><i class=\"fas fa-phone\"></i></button>\n <button class=\"btn icon website\" data-id=\"${obj.id}\"\"><i class=\"fas fa-link\"></i></button>\n </div>\n </article>`;\n\n return article;\n }", "title": "" }, { "docid": "5112219791b11ada0c17bd664c0cbc9e", "score": "0.6442967", "text": "function generateCard(card){\n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "fcb938ff3c55e37ab8f2a2b084353c76", "score": "0.6430693", "text": "function carta($val, $id) {\n // console.log($val);\n var trechoHtml = \n '<div class=\"card\" id=\"carta-'+$id+'\">'+\n '<div class=\"backCard\"></div>'+\n '<div class=\"frontCard\" >'+\n '<h2 class=\"nome\">'+$val.nome+'</h2>'+\n //'<span class=\"imagem\" style=\"background-image: url('+imgSrc+$val.imagem+');\"></span>'+\n '<span class=\"imagem\" ></span>'+\n '<span class=\"cont-stats\">'+\n '<span class=\"forca\"><img src=\"'+imgSrc+'forca.svg\" alt=\"Força\" /><span class=\"valor\">'+$val.forca+'</span></span>'+\n '<span class=\"habilidade\"><img src=\"'+imgSrc+'habilidade.svg\" alt=\"Força\" /><span class=\"valor\">'+$val.habilidade+'</span></span>'+\n '<span class=\"resistencia\"><img src=\"'+imgSrc+'resistencia.svg\" alt=\"Força\" /><span class=\"valor\">'+$val.resistencia+'</span></span>'+\n '<span class=\"armadura\"><img src=\"'+imgSrc+'armadura.svg\" alt=\"Força\" /><span class=\"valor\">'+$val.armadura+'</span></span>'+\n '<span class=\"poderDeFogo\"><img src=\"'+imgSrc+'poderDeFogo.svg\" alt=\"Força\" /><span class=\"valor\">'+$val.poderDeFogo+'</span></span>'+\n '</span>'+\n '<p class=\"descricao\">'+$val.descricao+'</p>'+\n '</div>'+\n \n '</div>';\n return trechoHtml;\n}", "title": "" }, { "docid": "de9eb541395416b3d446d61304946067", "score": "0.6427094", "text": "function makeCards(card){\n\treturn `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "f7a9b5d3bd41609f2c24dc3813b9ae5d", "score": "0.6419273", "text": "createCartCard(cartItem){\n let cartCard = document.createElement('article')\n cartCard.classList.add(\"card\", \"mb-3\") \n cartCard.dataset.id = cartItem.id\n cartCard.dataset.size = cartItem.size\n cartCard.dataset.color = cartItem.color\n cartCard.style.border = \"0\"\n let cartRow = document.createElement('div')\n cartRow.classList.add('row','justify-content-center','no-gutters','m-2')\n cartCard.appendChild(cartRow)\n // card img\n let cartImgCol = document.createElement('div')\n cartImgCol.classList.add('col-2')\n cartRow.appendChild(cartImgCol)\n let cartImg = document.createElement('img')\n cartImg.classList.add('card-img-top')\n cartImg.src = cartItem.media[0]\n cartImg.alt = cartItem.title\n cartImgCol.appendChild(cartImg)\n // card body\n let cartBodyCol = document.createElement('div')\n cartBodyCol.classList.add('col-8','card-body','p-0','pl-3')\n cartRow.appendChild(cartBodyCol)\n // product title and price\n let cartTitlePrice = document.createElement('div')\n cartTitlePrice.classList.add('d-flex','justify-content-between')\n cartBodyCol.appendChild(cartTitlePrice)\n \n let cartTitle = document.createElement('h6')\n cartTitle.classList.add('card-title')\n cartTitle.textContent = cartItem.title\n cartTitlePrice.appendChild(cartTitle)\n \n let cartPrice = document.createElement('span')\n let price = getFormatedPrice(cartItem.price)\n cartPrice.textContent = price\n cartTitlePrice.appendChild(cartPrice)\n // product description\n let cartDesc = document.createElement('p')\n cartDesc.classList.add('card-text')\n cartDesc.textContent = cartItem.desc\n cartBodyCol.appendChild(cartDesc)\n // product options \n let cartOptions = document.createElement('p')\n cartOptions.classList.add('card-text')\n cartBodyCol.appendChild(cartOptions)\n\n let cartSize = document.createElement('span')\n cartSize.classList.add('border-right', 'pr-2')\n cartSize.textContent = `Size: ${cartItem.size}`\n cartOptions.appendChild(cartSize)\n\n let cartColor = document.createElement('span')\n cartColor.classList.add('pl-2')\n cartColor.textContent = `Color: ${cartItem.color}`\n cartOptions.appendChild(cartColor)\n // remove from cart button\n let cartRemove = document.createElement('span')\n cartRemove.classList.add('pl-md-5')\n cartOptions.appendChild(cartRemove)\n\n let removeButton = document.createElement('button')\n removeButton.classList.add('btn', 'btn-link', 'cart-list-rmv')\n removeButton.textContent = \"Remove\"\n removeButton.dataset.id = cartItem.id\n removeButton.dataset.size = cartItem.size\n removeButton.dataset.color = cartItem.color\n cartOptions.appendChild(removeButton)\n \n return cartCard;\n }", "title": "" }, { "docid": "677bca7e17ccbf0dc8e5a180a182f8d4", "score": "0.6405493", "text": "function renderCard(card) { //ADDED TO COREGAME.JS\n var el = document.createElement('div');\n document.body.appendChild(el);\n el.classList.add('card');\n el.innerHTML = \"<div class='upper-left'>\" +\n card.rank + card.suit +\n \"</div>\" +\n \"<div class='lower-right'>\" +\n card.rank + card.suit +\n \"</div>\";\n}", "title": "" }, { "docid": "d4e8faab64e9b1926597623658ba417d", "score": "0.6374036", "text": "function cartaDinamica() {\n cuadernos.forEach(producto => {\n\n templateCard.querySelector(\"h4\").textContent = producto.marca\n templateCard.querySelector(\"img\").setAttribute(\"src\", producto.imagenurl)\n templateCard.querySelector(\"h6\").textContent = producto.precio\n templateCard.querySelector(\".btn-dark\").dataset.id = producto.id\n\n\n const clone = templateCard.cloneNode(true)\n fragment.appendChild(clone)\n\n })\n card.appendChild(fragment)\n}", "title": "" }, { "docid": "adb560776517392eaefed2efedbec998", "score": "0.6362452", "text": "function cardMaker(icon) {\n return `\n <div class=\"col\">\n <div class=\"card align-items-center pt-4 rounded\">\n <i class=\"${icon.family} ${icon.prefix}${icon.name} fs-1 ${icon.type}\"></i>\n <div class=\"icon_name py-2\">\n <p>${icon.name}</p>\n </div>\n </div>\n </div> \n `\n}", "title": "" }, { "docid": "e64f4a02597071a445655888cf08f595", "score": "0.6349092", "text": "function cardGen(){\n\t\t card = $(\"<div class='card float-left'>\");\n\t\t cardImage = $(\"<img class='card-img-top'>\");\n\t\t cardBody = $(\"<div class='card-body'>\");\n\t }", "title": "" }, { "docid": "302e01265b74dd02bb79f729fcc3440b", "score": "0.6344005", "text": "static receiptCard(card) {\n return { contentType: CardStyler.contentTypes.receiptCard, content: card };\n }", "title": "" }, { "docid": "809eeb5c1d96cca87b4d57e56dfcbbac", "score": "0.634399", "text": "function createCard(card) {\n $('#card-deck').append(`<li class=\"card animated\"><i class=\"fa ${card}\"></i></li>`);\n}", "title": "" }, { "docid": "5b838867f2d27f9cf6608f6e3cddefda", "score": "0.63421345", "text": "function renderIcon(idCard, title, idLibrary, idLanguage) {\n\t$(\"#ajaxCardTranslation\").append(\n\t\t\"<div class='col-xs-12'>\" +\n\t\t\t\"<div class='panel panel-default'>\" +\n\t\t\t\t\"<div class='panel-body'>\" +\n\t\t\t\t\t\"<p><strong>\"+title+\"</strong></p>\" +\n\t\t\t\t\t\"<div id='ajaxCardIcon'>\" +\n\t\t\t\t\t\t\"<img id='cardIcon' src='2324' onerror=\\x22getCardIcon('\"+idCard+\"', '\"+idLibrary+\"', '\"+idLanguage+\"')\\x22 class='center-block img-responsive' alt='Loading'>\" +\n\t\t\t\t\t\"</div>\" +\n\t\t\t\t\t\"<div id='ajaxcardIconError505' class='alert alert-danger' role='alert' style='display:none;'>\" +\n\t\t\t\t\t\t\"<p class='text-center alert-link'>Internal error</p>\" +\n\t\t\t\t\t\t\"<button onclick=\\x22getCardIcon('\"+idCard+\"', '\"+idLibrary+\"', '\"+idLanguage+\"')\\x22class='btn btn-default'>Try Again</button>\" +\n\t\t\t\t\t\"</div>\" +\n\t\t\t\t\t\"<div id='ajaxError400' class='alert alert-danger' role='alert' style='display:none;'>\" +\n\t\t\t\t\t\t\"<p class='text-center alert-link'>Internal error</p>\" +\n\t\t\t\t\t\"</div>\" +\n\t\t\t\t\"</div>\" +\n\t\t\t\"</div>\" +\n\t\t\"</div>\"\n\t);\n}", "title": "" }, { "docid": "9c89cd66f488806b12e515396a3bf365", "score": "0.63357246", "text": "function addCard(product){\r\n let str = \"\";\r\n str += \"<div class='col-sm-4'>\";\r\n str += \"<a class='linkProduct' href='product.html?_id=<?=\"+product._id.$oid+\"'>\";\r\n str += \"<div class='card text-center' href='product.html?id=\"+product._id.$oid+\"'>\";\r\n str += \"<img class='card-img-top' src='\"+product.image_url+\"' alt='\"+product.brand + \" \" + product.model+\"'>\";\r\n str += \"<div class='card-body'>\";\r\n str += \"<h4>\" + product.brand + \" \" + product.model + \"</h4>\";\r\n str += \"<p>Price: &euro; \" + product.price + \"</p>\";\r\n str += \"<a class='btn btn-purchase btn-buynow btn-md' href='#'>Buy now</a>\";\r\n str += \"<a class='btn btn-purchase btn-addtocart btn-md' href='#'>Add to cart</a>\";\r\n str += \"</div>\";\r\n str += \"</div>\";\r\n str += \"</a>\";\r\n str += \"</div>\";\r\n return str;\r\n}", "title": "" }, { "docid": "9d1ddfa1147afd12df7d4e928dc7a864", "score": "0.6335045", "text": "displayCard(list) {\n let str = \"\";\n list.forEach((element, index) => {\n str += `<div class=\"col-sm\"><div class=\"card\" >\n <img src=https://www.themoviedb.org/t/p/w600_and_h900_bestv2${element.img\n } class=\"card-img-top\" alt=\"...\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${element.title}\n <button id=\"preferedIcon${index}\" class=\"trasparent\" style=\"float:right;\">\n </button>\n </h5>\n <p class=\"card-text\">${element.reduceChracter()}</p>\n <div class=\"btn-holder\">\n <button id=\"detailsBtn${index}\" class=\"btn btn-primary\" value=\"${element.id\n }\">Details</button>\n </div>\n </div>\n </div></div>`;\n });\n document.getElementById(\"list\").innerHTML = str;\n this.setPreferedClass(list);\n this.addActionListener();\n }", "title": "" }, { "docid": "69819d207a2d59b126e5e16b5870b50e", "score": "0.63332385", "text": "function createCard() {\n $(\"#cardbody\").text(\"\");\n $(\"#cardbody\").append(`<h1>${cityname} <h4>${date}</h4> <img src=\"https://openweathermap.org/img/wn/${weathericon}@2x.png\"></img> </h1>`);\n $(\"#cardbody\").append(`<p>Temperature: ${citytemp} &#8457;</p>`);\n $(\"#cardbody\").append(`<p>Humidity: ${cityhumidity}%</p>`);\n $(\"#cardbody\").append(`<p>Wind Speed: ${windspeed} MPH</p>`)\n }", "title": "" }, { "docid": "c3d4f5a34e3d6b1180ca1810ce905911", "score": "0.63203704", "text": "function cardTemplate(card) {\n\n return `\n\n <div class=\"col-sm-4\">\n <div class=\"card\" style=\"background-image: url('${card.photo}');\">\n <div class=\"card-content\">\n <h3 class=\"card-title\">${card.name}</h3>\n <p class=\"card-brief\">${card.brief}</p>\n <p class=\"card-body\">${card.tags}</p>\n <a class=\"button\" onclick=\"openPage(this.id)\" id=\"${card.id}\" >Open</a>\n </div>\n </div>\n </div>\n\n\n`\n\n}", "title": "" }, { "docid": "dd940947d260d14608d9ba460f73f30c", "score": "0.63142574", "text": "function createItemCard(id, preview, name, brand, price) {\r\n //Create a DIV element with class CARD\r\n var cardElement = document.createElement(\"div\");\r\n cardElement.setAttribute(\"class\", \"card\");\r\n cardElement.setAttribute(\"id\", id);\r\n\r\n //Create a ANCHOR element with HREF\r\n var cardLink = document.createElement(\"a\");\r\n cardLink.href = \"product.html?product_id=\" + id;\r\n\r\n //Create a IMG-CONTAINER element with class IMG\r\n var imgContainer = document.createElement(\"div\");\r\n imgContainer.setAttribute(\"class\", \"img\");\r\n\r\n //Create a IMG element with SRC\r\n var newImgElement = document.createElement(\"img\");\r\n newImgElement.src = preview;\r\n\r\n // Append IMG into IMG-CONTAINER\r\n imgContainer.appendChild(newImgElement);\r\n\r\n //Create a DIV element with class DETAILS\r\n var deatils = document.createElement(\"div\");\r\n deatils.setAttribute(\"class\", \"details\");\r\n\r\n //Create a H3 element with TEXT-NODE NAME\r\n var newTitleElement = document.createElement(\"h3\");\r\n var newName = document.createTextNode(name);\r\n\r\n // Append NAME into H3\r\n newTitleElement.appendChild(newName);\r\n deatils.appendChild(newTitleElement);\r\n\r\n //Create a H4 element with TEXT-NODE BRAND\r\n var newBrandElement = document.createElement(\"h4\");\r\n var newBrand = document.createTextNode(brand);\r\n\r\n // Append BRAND into H4\r\n newBrandElement.appendChild(newBrand);\r\n deatils.appendChild(newBrandElement);\r\n\r\n //Create a H5 element with TEXT-NODE PRICE\r\n var newPriceElement = document.createElement(\"h5\");\r\n var newPriceText = document.createTextNode(\"Rs \");\r\n var newPrice = document.createTextNode(price);\r\n newPriceElement.appendChild(newPriceText);\r\n\r\n // Append PRICE into H5\r\n newPriceElement.appendChild(newPrice);\r\n deatils.appendChild(newPriceElement);\r\n\r\n // Append IMG-CONATINER into CARD-LINK\r\n cardLink.appendChild(imgContainer);\r\n cardLink.appendChild(deatils);\r\n\r\n // Append CARD-LINK into CARD-ELEMENT\r\n cardElement.appendChild(cardLink);\r\n\r\n // Returning CARD-ELEMENT\r\n return cardElement;\r\n}", "title": "" }, { "docid": "3e768a62914293b60ab1d7f3e0b40db5", "score": "0.6295439", "text": "function generateCard(card) {\n return `<li class=\"card\"><i class=\"fa ${card}\"></i></li>`\n}", "title": "" }, { "docid": "cab636e977a339cda01f3094b88e0a1d", "score": "0.6290572", "text": "function cardstype(){\n\tif($('.largecard').attr('src') === '../Images/Recipe-Card-3x5_1.png'){\n\t\t$('.card > div').css('padding', '10px');\n\t\tif ($('.card').css('font-family') === 'Mightype'){\n\t\t\t$('.editable').css('font-size', '14px');\n\t\t\t$('.titlecontiner').css('line-height', '17px');\n\t\t\t$('.title').css({'font-size': '24px', 'color': 'black'});\n\t\t\t$('.servingcontiner').css({'margin': '0px'});\n\t\t\t$('.servheader').css('font-size', '14px');\n\t\t\t$('.itemheader').css({'font-size': '18px', 'color': 'black', 'display': 'inline-block', 'margin-bottom': '0px'});\n\t\t\t$('.ingredientcontiner').css({'line-height': '19px', 'width': '100%', 'float': 'none', 'height': 'auto', 'max-height': 'auto'});\n\t\t\t$('.directioncontiner').css({'float': 'none', 'width': '100%'});\n\t\t}\n\t\telse{\n\t\t\t$('.editable').css('font-size', '12px');\n\t\t\t$('.titlecontiner').css('line-height', '22px');\n\t\t\t$('.title').css({'font-size': '18px', 'color': 'black'});\n\t\t\t$('.servingcontiner').css({'margin': '0px'});\n\t\t\t$('.servheader').css('font-size', '12px');\n\t\t\t$('.itemheader').css({'font-size': '14px', 'color': 'black', 'display': 'inline-block', 'margin-bottom': '0px'});\n\t\t\t$('.ingredientcontiner').css({'line-height': '21px', 'width': '100%', 'float': 'none', 'height': 'auto', 'max-height': 'auto'});\n\t\t\t$('.directioncontiner').css({'float': 'none', 'width': '100%'});\n\t\t}\n\t}\n\telse if($('.largecard').attr('src') === '../Images/Recipe-Card-3x5_2.png'){\n\t\t$('.card > div').css('padding', '13px 18px');\n\t\tif ($('.card').css('font-family') === 'Mightype'){\n\t\t\t$('.editable').css('font-size', '14px');\n\t\t\t$('.titlecontiner').css('line-height', '17px');\n\t\t\t$('.title').css({'font-size': '20px', 'color': 'black'});\n\t\t\t$('.servingcontiner').css({'margin': '0px'});\n\t\t\t$('.servheader').css('font-size', '14px');\n\t\t\t$('.itemheader').css({'font-size': '18px', 'display': 'block', 'margin-bottom': '6px', 'color': 'black'});\n\t\t\t$('.ingredientcontiner').css({'line-height': '15px', 'width': '83px', 'float': 'left'});\n\t\t\t$('.directioncontiner').css({'line-height': '15px', 'float': 'right', 'width': '227px'});\n\t\t}\n\t\telse{\n\t\t\t$('.editable').css('font-size', '12px');\n\t\t\t$('.titlecontiner').css('line-height', '24px');\n\t\t\t$('.title').css({'font-size': '16px', 'color': 'black'});\n\t\t\t$('.servingcontiner').css({'margin': '0px'});\n\t\t\t$('.servheader').css('font-size', '12px');\n\t\t\t$('.itemheader').css({'font-size': '14px', 'display': 'block', 'margin-bottom': '6px', 'color': 'black'});\n\t\t\t$('.ingredientcontiner').css({'line-height': '20px', 'width': '83px', 'float': 'left'});\n\t\t\t$('.directioncontiner').css({'line-height': '20px', 'float': 'right', 'width': '227px'});\n\t\t}\n\t}\n\telse{\n\t\t$('.card > div').css('padding', '29px 26px 26px 35px');\n\t\tif ($('.card').css('font-family') === 'Mightype'){\n\t\t\t$('.editable').css('font-size', '14px');\n\t\t\t$('.titlecontiner').css('line-height', '12px');\n\t\t\t$('.title').css({'font-size': '24px', 'color': 'orange'});\n\t\t\t$('.servingcontiner').css({'margin-top': '-36px', 'margin-bottom': '20px'});\n\t\t\t$('.servheader').css('font-size', '14px');\n\t\t\t$('.itemheader').css({'font-size': '16px', 'color': 'brown', 'display': 'inline-block', 'margin-bottom': '0px'});\n\t\t\t$('.ingredientcontiner').css({'line-height': '15px', 'width': '100%', 'height': '33px', 'max-height': '33px', 'float': 'none'});\n\t\t\t$('.directioncontiner').css({'line-height': '15px', 'width': '100%', 'float': 'none'});\n\t\t}\n\t\telse{\n\t\t\t$('.editable').css('font-size', '12px');\n\t\t\t$('.titlecontiner').css('line-height', '20px');\n\t\t\t$('.title').css({'font-size': '18px', 'color': 'orange'});\n\t\t\t$('.servingcontiner').css({'margin-top': '-36px', 'margin-bottom': '20px'});\n\t\t\t$('.servheader').css('font-size', '12px');\n\t\t\t$('.itemheader').css({'font-size': '14px', 'color': 'brown', 'display': 'inline-block', 'margin-bottom': '0px'});\n\t\t\t$('.ingredientcontiner').css({'line-height': '13px', 'width': '100%', 'height': '30px', 'max-height': '30px', 'float': 'none'});\n\t\t\t$('.directioncontiner').css({'line-height': '17px', 'width': '100%', 'float': 'none'});\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "a546a1aa85ab5571a9d776ec20fb6303", "score": "0.6280884", "text": "createCard() {\n let groupNames = document.querySelectorAll('.group-name')\n let cards = document.querySelectorAll('.tiles'),\n card = document.createElement('article'),\n title = document.createElement('h3'),\n descriptionContainer = document.createElement('pre'),\n description = document.createElement('code'),\n link = document.createElement('a'),\n linkIcon = document.createElement('svg'),\n editIcon = document.createElement('a'),\n line = document.createElement('HR');\n\n card.setAttribute('id', 'c-' + this.id)\n card.classList.add('tile')\n title.textContent = this.title\n\n // only add the code snippet to the card if there is any user input\n if (this.description.length > 0) {\n description.textContent = this.description\n descriptionContainer.appendChild(description)\n }\n\n // fix links to support validity\n if (this.link.includes('https://') || this.link.includes('http://')) {\n link.textContent = this.link\n link.setAttribute('href', this.link)\n } else {\n link.textContent = 'https://' + this.link\n link.setAttribute('href', 'https://' + this.link)\n }\n\n // set attribute for 'open in new tab' functionality\n link.classList.add('external-link')\n link.setAttribute('target', '_blank')\n link.appendChild(linkIcon)\n\n // add icons\n linkIcon.innerHTML = `<svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M1.9 5.00003C1.9 3.29003 3.29 1.90003 5 1.90003H9V3.05176e-05H5C2.24 3.05176e-05 0 2.24003 0 5.00003C0 7.76003 2.24 10 5 10H9V8.10003H5C3.29 8.10003 1.9 6.71003 1.9 5.00003ZM6 6.00003H14V4.00003H6V6.00003ZM15 3.05176e-05H11V1.90003H15C16.71 1.90003 18.1 3.29003 18.1 5.00003C18.1 6.71003 16.71 8.10003 15 8.10003H11V10H15C17.76 10 20 7.76003 20 5.00003C20 2.24003 17.76 3.05176e-05 15 3.05176e-05Z\" fill=\"#909090\"/>\n </svg>`\n editIcon.classList.add('edit-content')\n editIcon.innerHTML = `<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M0 12.6672V16H3.33287L13.1626 6.17028L9.82975 2.83741L0 12.6672ZM15.74 3.59286C16.0867 3.24625 16.0867 2.68632 15.74 2.33971L13.6603 0.259994C13.3137 -0.0866241 12.7538 -0.0866241 12.4072 0.259994L10.7807 1.88644L14.1136 5.21931L15.74 3.59286Z\" fill=\"#909090\"/>\n </svg>`\n\n // append elements to the card\n card.appendChild(title)\n card.appendChild(descriptionContainer)\n card.appendChild(line)\n card.appendChild(link)\n card.appendChild(editIcon)\n\n // add card to relevant group, or to 'Ungrouped' as the default\n let currentGroup = this.group\n if (this.group == 'None') {\n cards[0].appendChild(card)\n } else {\n groupNames.forEach(function setGroup(object, index) {\n if (object.value == currentGroup) {\n cards[index].appendChild(card)\n }\n })\n }\n hljs.highlightAll();\n }", "title": "" }, { "docid": "f2ee84802cb19e37d210710067ea9159", "score": "0.6275285", "text": "function generateCard(card, index)\n {\n return `<li class=\"card\" id=\"card${index.toString()}\"><i class=\"fa ${card}\"></i></li>`;\n }", "title": "" }, { "docid": "077485a2011ce3e0b6e83674c2b3af47", "score": "0.6268007", "text": "function makeCard(result){\n $('section').append(result.html);\n }", "title": "" }, { "docid": "f5108091bcbe37505fe1a69d6cca3da7", "score": "0.62678325", "text": "function showCard(card) {\n const cardDiv = document.createElement(\"div\");\n const name = document.createElement(\"h2\");\n const cardImage = document.createElement(\"img\");\n const likeIcon = document.createElement(\"i\");\n\n //muniplate\n cardDiv.className = \"card\";\n name.textContent = card.name;\n name.className = \"pokemon\";\n likeIcon.className = \"far fa-heart\";\n likeIcon.id = \"btn\";\n likeIcon.tagName = \"btn\";\n likeIcon.onclick = function () {\n if (likeIcon.classList.contains(\"far\")) {\n likeIcon.classList.remove(\"far\");\n likeIcon.classList.add(\"fas\");\n } else {\n likeIcon.className.remove(\"fas\");\n likeIcon.className.add(\"far\");\n }\n };\n cardImage.src = card.imageURLHiRes;\n cardImage.id = \"image\";\n\n //append\n main.append(cardDiv);\n cardDiv.appendChild(likeIcon);\n cardDiv.append(name, cardImage);\n}", "title": "" }, { "docid": "eb9a90135ead87cb67939f735ee009c8", "score": "0.62639415", "text": "_createCard_header () {\n let card_header_node = document.createElement(\"div\");\n let header_text_node = document.createElement(\"div\");\n let header_symbol_node = document.createElement(\"span\"); // 缺了icon图片定义\n let title_html = `<div class=\"header-text-title\">${vns_method_to_btn_name(this.parameters[\"card_title\"])}</div>`;\n let class_html = `<div class=\"header-text-class\">${vns_method_to_btn_name(this.parameters[\"EL_tag\"])}</div>`;\n\n card_header_node.classList.add(\"card-header\");\n header_text_node.classList.add(\"header-text\");\n header_symbol_node.classList.add(\"header-symbol\");\n\n header_text_node.innerHTML = title_html + class_html;\n [header_text_node, header_symbol_node].forEach((node, i, nodeList) => card_header_node.appendChild(node));\n return card_header_node;\n }", "title": "" }, { "docid": "25f718f87630155d7c0af77fe4effc50", "score": "0.6263428", "text": "function demoCardSubDivs(){\n\n}", "title": "" }, { "docid": "2fdb705af0374c90e89b962da585aa18", "score": "0.6263325", "text": "function generateCard(element, cardSymbol) {\n element.insertAdjacentHTML('afterbegin', `<li class='card back'><i class='fas ${cardSymbol} fa-2x'></i></li>`);\n}", "title": "" }, { "docid": "7fe5751ead86883b51a35a258fcd705a", "score": "0.6259076", "text": "function generateCard(card){\n return `<li class=\"card\"><i class = \"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "718b0fc7ec7a447ca2163c0b50ac0e63", "score": "0.6248662", "text": "function generateCompHandHTML(CardNr) {\r\n if (!CompKarteSichtbar) { // Falls die Karten verdeckt sind\r\n let cardDiv = document.createElement(\"div\");\r\n cardDiv.setAttribute(\"id\", \"compCard\" + (CardNr + 1));\r\n cardDiv.setAttribute(\"class\", \"hiddenCard\");\r\n document.getElementById(\"compHand\").appendChild(cardDiv);\r\n }\r\n else { // Falls die Karten sichtbar sind\r\n let cardDiv = document.createElement(\"div\"); // Eventlistener erstellt Karten Div \r\n cardDiv.setAttribute(\"id\", \"compCard\" + (CardNr + 1));\r\n cardDiv.setAttribute(\"class\", \"card\");\r\n document.getElementById(\"compHand\").appendChild(cardDiv);\r\n let tempkartenwert = CompKarteArray[CardNr].kartenwert + \"\"; // Inhalt der Karte wird erstellt\r\n switch (CompKarteArray[CardNr].spezialfunktion) {\r\n case \"Plus 2\":\r\n tempkartenwert = \"+2\";\r\n break;\r\n case \"Plus 4\":\r\n tempkartenwert = \"+4\";\r\n break;\r\n }\r\n let kartenwertP1 = document.createElement(\"p\"); // Erstellen der <p>-Tags mit dem Inhalt in gewollter Farbe \r\n kartenwertP1.innerHTML = tempkartenwert + \"\";\r\n kartenwertP1.setAttribute(\"class\", CompKarteArray[CardNr].KartenFarbe);\r\n cardDiv.appendChild(kartenwertP1);\r\n let kartenwertP2 = document.createElement(\"p\");\r\n kartenwertP2.innerHTML = tempkartenwert + \"\";\r\n kartenwertP2.setAttribute(\"class\", CompKarteArray[CardNr].KartenFarbe);\r\n cardDiv.appendChild(kartenwertP2);\r\n }\r\n}", "title": "" }, { "docid": "6caf6bdf498e6f856090918cc7414364", "score": "0.6247248", "text": "function showCard(item) {\n return `<div class=\"package__card\">\n <div class=\"package__wrapper\">\n <div class=\"package__content\">\n <h3 class=\"package__name\">${item.package}</h3>\n <img class=\"package__image\" src=\"./assets/illustrations/data-visualization.svg\" alt=\"\">\n <div class=\"package__price\">\n <h4>Rp ${item.price}</h4>\n <p>Perbulan</p>\n </div>\n <div class=\"package__description\">\n <ul>\n <li><b>${item.storage}</b> Space</li>\n <li><b>${item.cpu}</b> CPU</li>\n <li><b>${item.memory}</b> RAM</li>\n <li><b>${item.bandwidth}</b> Bandwidth</li>\n <li><b>${item.website}</b> Website</li>\n <li><b>${item.email}</b> Email</li>\n <li class=\".some-element\">Domain ${item.domain}!</li>\n <li class=\".some-element\">Akses ${item.access}</li>\n </ul>\n </div>\n </div>\n <div class=\"package__order\">\n <button class=\"button button--secondary\">\n Pesan\n </button>\n </div>\n </div>\n </div>`\n }", "title": "" }, { "docid": "3ad00b34b6b348b4c363572ccb4397c7", "score": "0.62469125", "text": "function make_card_div(data) {\n\n let template = document.createElement('div');\n template.className = \"pokemon-card\";\n\n switch (data.cardType) {\n case \"pokemon\":\n template.innerHTML = `\n <div style='display: flex; justify-content: center;'>\n <h4 style='padding: 0 0.5em 0 0;'>ID: ${data.pokemonID}</h4>\n <h3 style='padding: 0 0 0.5em;'>${data.name[0].toUpperCase() + data.name.slice(1)}</h3>\n </div>\n \n <div class='flex-break'></div>\n <img src='https://pokeres.bastionbot.org/images/pokemon/${data.pokemonID}.png' style='width: 50%; padding: 1em 0 2em 0;'>\n <div class='flex-break'></div>\n \n <table>\n <tr>\n <td>Types</td>\n <td>${data.pokemonTypes}</td>\n </tr>\n <tr>\n <td>Weight</td>\n <td>${(data.weight).toFixed(2)} kg</td>\n </tr>\n <tr>\n <td>Height</td>\n <td>${data.height} cm</td>\n </tr>\n <tr>\n <td>Base experience</td>\n <td>${data.baseExperience}</td>\n </tr>\n </table>\n <div class='flex-break'></div>\n <button class=\\\"remove-item\\\">remove</button>\n `;\n break;\n default:\n template.innerHTML = `\n <div style='display: flex; justify-content: center; flex-wrap: wrap;'>\n <h3 style='padding: 0 0 0.5em;'>${data.name[0].toUpperCase() + data.name.substring(1)}</h3>\n <div class='flex-break'></div>\n <h5>Type: ${data.cardType[0].toUpperCase() + data.cardType.substring(1)}</h5>\n </div>\n <div class='flex-break'></div>\n <p>${data.details}</p>\n <div class='flex-break'></div>\n <button class=\\\"remove-item\\\">remove</button>\n `;\n break;\n }\n\n return template;\n\n}", "title": "" }, { "docid": "414aada492765547260ebc9a1525e4fa", "score": "0.6243971", "text": "function createCard(jsonItem){\n\n myCard = document.createElement(\"div.col\")\n\n myCard.innerHTML = `<div class=\"card shadow-sm\" id=\"myCard${jsonItem.product.id}\" data-product_id= ${jsonItem.product.id}>\n\n <div class=\"card-header text-center d-flex justify-content-between\">\n <div>\n <h6>Category: ${jsonItem.product.product_category}</h6>\n </div>\n <div>\n <h6>Vendor: ${jsonItem.product.product_vendor.vendor_company_name.split(\" \",1)}</h6>\n </div>\n </div>\n\n <img src=\"${jsonItem.product.product_img_link}\" class=\"bd-placeholder-img card-img-top\" width=\"100%\" height=\"225\"\n alt=\"product image\">\n\n <div class=\"card-body\">\n\n <div class=\"d-flex justify-content-between\">\n <div>\n <h6 class=\"card-title d-inline-flex px-2 text-muted\">PN: ${jsonItem.product.product_part_number}</h6>\n </div>\n <div>\n <h6 class=\"card-subtitle d-inline-flex px-2 mb-2 text-muted\">Price: $ ${jsonItem.product.product_unit_price} USD</h6>\n </div>\n </div>\n <hr>\n <div>\n <div>\n <p class=\"card-text text-center card_descrip\">${jsonItem.product.product_description}</p>\n </div>\n <div class=\"text-center pt-3\">\n <small class=\"text-muted\">Stock: <strong>${jsonItem.product_stock_qty}</strong> piece(s) left, Hurry Up !!</small>\n </div>\n </div>\n\n </div>\n\n <div class=\"card-footer\">\n\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 fs-3\" data-btntype=\"plusBtn\" data-product_id= ${jsonItem.product.id}>+</button>\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary fs-3\" data-btntype=\"minusBtn\" data-product_id= ${jsonItem.product.id}>-</button>\n <small class=\"text-muted ms-3 pt-2\">I want: <strong class=\"storeQty\">0</strong> piece(s)</small>\n </div>\n <div>\n <a href=\"#\" class=\"btn btn-primary\" data-btntype=\"addToCart\" data-product_id= ${jsonItem.product.id}>Add to Cart</a>\n </div>\n </div>\n\n </div>\n\n </div>`\n\n return myCard\n\n}", "title": "" }, { "docid": "4cedf1ba33795af398274d86ab7d8b41", "score": "0.62085944", "text": "function buildCard(productObject) {\n\tvar htmlString = '';\n\n\thtmlString += '<article class=\"productCard\">';\n\n\thtmlString += '<section class=\"productHeader\">';\n\thtmlString += '<h2>' + productObject.name + '<br>' + productObject.brand + '</h2>';\n\thtmlString += '</section>';\n\n\thtmlString += '<section class=\"productImg\">';\n\thtmlString += '<img src=../images/' + productObject.fileName + '/>';\n\thtmlString += '</section>';\n\n\thtmlString += '<section class=\"productInfo\">';\n\thtmlString += '<p>' + productObject.price + ' ' + '<span class=\"rating\">' + productObject.rating + '</span></p>';\n\thtmlString += '<p>' + productObject.description + '</p>';\n\thtmlString += '</section>';\n\n\thtmlString += '</article>';\n\n return htmlString;\n}", "title": "" }, { "docid": "57689b8e94b8a11c75c3c35db8f7998b", "score": "0.6208239", "text": "function showCard(item) {\n return `<div class=\"package__card\">\n <div class=\"package__wrapper\">\n <div class=\"package__content\">\n <h3 class=\"package__name\">${item.package}</h3>\n <img class=\"package__image\" src=\"./assets/illustrations/data-visualization.svg\" alt=\"\">\n <div class=\"package__price\">\n <h4>Rp ${item.price}</h4>\n <p>Perbulan</p>\n </div>\n <div class=\"package__description\">\n <ul>\n <li><b>${item.storage}</b> Space</li>\n <li><b>${item.bandwidth}</b> Bandwidth</li>\n <li><b>${item.website}</b> Website</li>\n <li><b>${item.email}</b> Email</li>\n <li id=\"hide-domain-element\">Domain ${item.domain}!</li>\n <li id=\"hide-access-element\">Akses ${item.access}</li>\n </ul>\n </div>\n </div>\n <div class=\"package__order\">\n <button class=\"button button--secondary\">\n Pesan\n </button>\n </div>\n </div>\n </div>`\n }", "title": "" }, { "docid": "f88568c9b33a69cc2bb16b9fd9101b76", "score": "0.6197114", "text": "getContent(){\n\t\tlet content = $(\"<div/>\");\n\t\tlet heading = \"Your Card\";\n\t\tcontent.append($(\"<h1/>\").html(\"\").attr(\"id\", \"cardHeading\"));\n\t\tcontent.append($(\"<div/>\").attr(\"id\", \"cardDisplay\"));\n\t\treturn content;\n\t}", "title": "" }, { "docid": "3dcdc399aa8848efa2c4404cdff30dea", "score": "0.6184715", "text": "function Card2({ icon, title, children }) {\n\n // This returns a card \n return (\n <div className=\"card mt-4\">\n <div className=\"card-header\">\n <h3>\n <strong>\n <i className={`fa fa-${icon}`} aria-hidden=\"true\" /> {title}\n </strong>\n </h3>\n </div>\n <div className=\"card-body\">{children}</div>\n </div>\n );\n}", "title": "" }, { "docid": "a7fbc07e4f6ed075ba92ac29a1b89600", "score": "0.6183859", "text": "function generateCardHTML(tempCard, id, parentID, isShopCard, cardType, cssClass, callback = '', orderNum = '4'){\n\tvar div = initNewUIElement('div', new Map().set('id', id + id_div), parentID, ['container', 'margin_left_1', 'position_relative']);\n\tdiv.style.order = orderNum;\n\tvar centerWidth = getWidthCard(cardType);\n\tvar centeredTextCSSClass = getCssFontSize(tempCard, centerWidth, true); \n\tvar normalTextCSSClass = getCssFontSize(tempCard, centerWidth, false);\n\n\t// Img element\n\tvar properties = new Map();\n\tproperties.set('id', id);\n\tproperties.set('src', getCorrectImage(tempCard));\n\tvar img = initNewUIElement('img', properties, id + id_div, cssClass);\n\tmodifyCSSEl('add', img, [cardType, 'position_relative', 'noclick']);\n\t\n\t// Name\n\tvar name = initNewUIElement('div', new Map().set('id', id + id_name_post), id + id_div, [getCssAlign('centered_top', centerWidth), 'text_shadow', 'noclick', normalTextCSSClass]);\n\tname.innerHTML = tempCard.name;\n\t//name.style.width = centerWidth;\n\t// Center text\n\tvar center = initNewUIElement('div', new Map().set('id', id + id_centeredText), id + id_div, ['centered', 'noclick', centeredTextCSSClass]);\n\tcenter.style.width = centerWidth;\n\tvar stringActions = String(tempCard.getValue());\n\tvar splitted = stringActions.split('\\n');\n\tif(splitted.length > 0){\n\t\tfor(var i = 0; i < splitted.length; i++){\n\t\t\tvar el = initNewUIElement('div', new Map().set('id', id + id_centeredText + '_' + i), id + id_centeredText, ['noclick', 'text_shadow', centeredTextCSSClass]);\n\t\t\tel.innerHTML = splitted[i];\n\t\t}\t\t\n\t} else {\n\t\tcenter.innerHTML = stringActions;\n\t}\n\t// Bottom texts\n\tif(isShopCard){ // Only shop cards have to show cost and capacity\n\t\tvar bottomLeft = initNewUIElement('div', new Map().set('id', id + id_bottomLeft), id + id_div, [getCssAlign('bottom_left', centerWidth), 'noclick', 'text_shadow', normalTextCSSClass]);\n\t\tvar bottomRight = initNewUIElement('div', new Map().set('id', id + id_bottomRight), id + id_div, [getCssAlign('bottom_right', centerWidth), 'noclick', 'text_shadow', normalTextCSSClass]);\n\t\tbottomLeft.innerHTML = tempCard.getCost();\n\t\tbottomRight.innerHTML = getCapacityString(tempCard);\n\t}\n\t// Event\n\tif(callback != ''){\n\t\tdiv.addEventListener('click', function(res){\n\t\t\tvar card_HTMLid = res.target.id;\n\t\t\tcallback(card_HTMLid);\n\t\t});\t\t\n\t}\n}", "title": "" }, { "docid": "759bbe489b8f6e5989e4cda5fb1e40df", "score": "0.6176957", "text": "function cardInjection(possession,view){\n\tlet card_image = document.getElementById(\"card_image\");\n\tlet card_title = document.getElementById(\"card_title\");\n\tlet card_text = document.getElementById(\"card_text\");\n\tlet button0 = document.getElementById(\"card_button\").querySelectorAll(\"button\");\n\tlet button1 = document.getElementById(\"card_footer\").querySelectorAll(\"button\");\n\tlet cash_flow_button =document.getElementById(\"cash_flow_button\");\n\tcard_image.firstElementChild.src=possession.image;\n\tcard_title.innerHTML = possession.name;\n\tif(view == \"initial\"){\n\t\tcard_title.innerHTML = \"ROLL DICE\";\n\t\tcard_text.innerHTML = \"Before you start you turn, review you financial statement. You may also use this time to repay liabilities or repay money\";\n\t\tbutton0[0].style.display = 'block';\n\t\tbutton0[1].style.display = 'block';\n\t\tbutton1[0].style.display = 'block';\n\t\tbutton1[1].style.display = 'none';\n\t\tbutton0[0].innerHTML = 'Repay';\n\t\tbutton0[1].innerHTML = 'Borrow';\n\t\tbutton1[0].innerHTML = 'ROLL DICE';\n\t\tcash_flow_button.style.display = 'none';\n\t}\n\telse if(view == \"initial2\"){\n\t\tcard_title.innerHTML = \"ROLL DICE\";\n\t\tcard_text.innerHTML = \"Before you start you turn, review you financial statement. You may also use this time to repay liabilities or repay money\";\n\t\tbutton0[0].style.display = 'block';\n\t\tbutton0[1].style.display = 'block';\n\t\tbutton1[0].style.display = 'block';\n\t\tbutton1[1].style.display = 'block';\n\t\tbutton0[0].innerHTML = 'Repay';\n\t\tbutton0[1].innerHTML = 'Borrow';\n\t\tbutton1[0].innerHTML = 'ROLL DICE';\n\t\tbutton1[1].innerHTML = 'ROLL 2 DICE';\n\t\tcash_flow_button.style.display = 'none';\n\t}\n\telse if(view == \"congratulation\"){\n\t\tcard_title.innerHTML = \"CONGRATULATION\";\n\t\tcard_text.innerHTML = \"congratulation you won you got out of the rat race\";\n\t\tbutton0[0].innerHTML = 'done';\n\t\tbutton0[1].style.display = 'none';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\n\telse if(view == \"game_over\"){\n\t\tcard_title.innerHTML = \"GAME OVER\";\n\t\tcard_text.innerHTML = \"traped and died pathetically onto the rat race! What a random life\";\n\t\tbutton0[0].innerHTML = 'done';\n\t\tbutton0[1].style.display = 'none';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\t\n\telse if(view == \"sale\"){\n\t\tcard_title.innerHTML = possession.name;\n\t\tcard_text.innerHTML = \"sale it at 1/2 of the downpay : \"+possession.down_pay+\" per month\";\n\t\tbutton0[0].style.display = 'none';\n\t\tbutton0[1].style.display = 'none';\n\t\tbutton1[0].style.display = 'block';\n\t\tbutton1[0].innerHTML = 'SALE';\n\t\tbutton1[1].style.display = 'none';\n\t}\t\n\telse if(view == \"baby\"){\n\t\tcard_title.innerHTML = \"NEW BABY\";\n\t\tcard_text.innerHTML = \"you have landed on baby square so you have a new baby he will cost you : \"+possession.cash_flow+\" per month\";\n\t\tbutton0[0].innerHTML = 'done';\n\t\tbutton0[1].style.display = 'none';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\t\n\telse if(view == \"baby_cant\"){\n\t\tcard_title.innerHTML = \"NEW BABY\";\n\t\tcard_text.innerHTML = \"you have already too much baby\";\n\t\tbutton0[0].style.display = 'none';\n\t\tbutton0[1].innerHTML = 'done';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\t\n\telse if(view == \"downsized\"){\n\t\tcard_title.innerHTML = \"DOWNSIZED!\";\n\t\tcard_text.innerHTML = \"you have pathetically landed on downsized square so you lost 2 turn and pay the total amount of your expenses\";\n\t\tbutton0[0].innerHTML = 'DONE';\n\t\tbutton0[1].style.display = 'none';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\n\telse if(view == \"charity\"){\n\t\tcard_title.innerHTML = \"CHARITY!\";\n\t\tcard_text.innerHTML = \"Give 10% of your Total Income to Charity. and gain the possibility to use two dice on each of your three next turn\";\n\t\tbutton0[0].innerHTML = 'ACCEPT';\n\t\tbutton0[1].innerHTML = 'PASS';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\n\telse if(view == 'repay'){\n\t\tcard_title.innerHTML = \"REPAY DEBTS\";\n\t\tcard_text.innerHTML = \"Select an item to repay\";\n\t\tbutton0[0].style.display = 'none';\n\t\tbutton0[1].innerHTML = \"CANCEL\";\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\n\telse if(view == 'repay_can'){\n\t\tcard_title.innerHTML = \"REPAY DEBTS\";\n\t\tcard_text.innerHTML = \"Select an item to repay<br><br>pay the whole debt of: \"+possession.name+\"<input hidden id=\\\"loan\\\" value = \\\"0\\\"/>\";\n\t\tbutton0[0].style.display = 'block';\n\t\tbutton0[0].innerHTML = 'REPAY';\n\t\tbutton0[1].innerHTML = 'CANCEL';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\n\telse if(view == 'repay_canot'){\n\t\tcard_title.innerHTML = \"REPAY DEBTS\";\n\t\tcard_text.innerHTML = \"Select an item to repay<br><br>NOT ENOUGH CASH TO PAY THE WHOLE DEBT OF: \"+possession.name;\n\t\tbutton0[0].style.display = 'none';\n\t\tbutton0[1].innerHTML = 'CANCEL';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\n\telse if(view == 'repay_loan'){\n\t\talert(current_player.cash);\n\t\tcard_title.innerHTML = \"REPAY DEBTS\";\n\t\tcard_text.innerHTML = card_text.innerHTML = \"which amount would you wan to repay <br><br><div>Amount: <input id = \\\"loan\\\" min = \\\"-1\\\" max = \\\"\"+possession+\"\\\" value = \\\"0\\\" type=\\\"number\\\"/></div>\";\n\t\tbutton0[0].style.display = 'block';\n\t\tbutton0[0].innerHTML = 'REPAY';\n\t\tbutton0[1].innerHTML = 'CANCEL';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\n\telse if(view == 'paycheck_success'){\n\t\tcard_title.innerHTML = \"PAYDAY\";\n\t\tcard_text.innerHTML = \"Chehk your dashboard cahflow paid! despite the negative cashflow\";\n\t\tbutton0[0].style.display = 'none';\n\t\tbutton0[1].style.display = 'none';\n\t\tbutton1[0].style.display = 'block';\n\t\tbutton1[0].innerHTML = \"OK\";\n\t\tbutton1[1].style.display = 'none';\n\t}\n\telse if(view == 'paycheck_positive'){\n\t\tcard_text.innerHTML = \"your paycheck is availabe as it is the end of the month\";\n\t\tbutton0[0].style.display = 'none';\n\t\tbutton0[1].style.display = 'none';\n\t\tbutton1[0].style.display = 'block';\n\t\tbutton1[0].innerHTML = \"OK\";\n\t\tbutton1[1].style.display = 'none';\n\t}\n\telse if(view == \"paycheck_fail\"){\n\t\tcard_title.innerHTML = 'PAYDAY';\n\t\tcard_text.innerHTML = \"You don't have enough money try to sale some asset to pay your monthly cashflow!\";\n\t\tbutton0[0].style.display = 'none'; //another complicated things are going to get done here!\n\t\tbutton0[1].style.display = 'none';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\n\telse if(view == \"ending_turn\"){\n\t\tcard_image.firstElementChild.src=\"image source\";\n\t\tcard_title.innerHTML = \"FINISH YOUR TURN\";\n\t\tcard_text.innerHTML = \"Before you end you turn, review you financial statement. You may also use this time to repay liabilities or repay money\";\n\t\tbutton0[0].innerHTML = \"Repay\";\n\t\tbutton0[1].innerHTML = \"Borrow\";\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].innerHTML = \"END\";\n\t}\t\n\telse if(view == \"big_or_smal_deal\"){\n\t\tcard_image.firstElementChild.src=\"image source\";\n\t\tcard_title.innerHTML = \"DEAL OPPORTUNITY\";\n\t\tcard_text.innerHTML = \"Which deal type do you want small deal cost 5000 or less and big deal cost 6000 or more\";\n\t\tbutton0[0].innerHTML = \"SMALL\";\n\t\tbutton0[1].innerHTML = \"BIG\";\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\t\n\telse if(view == \"deal_not_enough\"){\n\t\tlet to_borrow = possession.toBorrow();\n\t\tcard_image.firstElementChild.src=\"image source\";\n\t\tcard_title.innerHTML = \"DEAL NOT ENOUGH\";\n\t\tcard_text.innerHTML = \"You don't have enough money to enjoy this bid.<br><br>Would you want to borrow: \"+to_borrow+\n\t\t\"at\"+to_borrow/10+\" interest per month?\";\n\t\tbutton0[0].innerHTML = \"BORROW\";\n\t\tbutton0[1].innerHTML = \"CANCEL\";\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\t\n\telse if(view == \"doodad_not_enough\"){\n\t\tlet to_borrow = possession.toBorrow();\n\t\tcard_image.firstElementChild.src=\"image source\";\n\t\tcard_title.innerHTML = possession.name;\n\t\tcard_text.innerHTML = possession.description+\" : \"+possession.cost+\"<br>You don't have enough money as you must pay doodad's bill borrowing is your unique choice.<br>amount: \"+to_borrow+\n\t\t\" at \"+to_borrow/10+\" interest per month\";\n\t\tbutton0[0].innerHTML = \"BORROW\";\n\t\tbutton0[1].style.display = 'none';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\t\n\telse if(view == \"downsized_not_enough\"){\n\t\tlet to_borrow = possession.cost;\n\t\tcard_image.firstElementChild.src=\"image source\";\n\t\tcard_title.innerHTML = possession.name;\n\t\tcard_text.innerHTML = possession.description + \"<br>You don't have enough money to pay your total expenses borrowing is your unique choice.<br>amount: \"+to_borrow+\n\t\t\" at \"+to_borrow/10+\" interest per month\";\n\t\tbutton0[0].innerHTML = \"BORROW\";\n\t\tbutton0[1].style.display = 'none';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\n\telse if(view == \"pay_loan\" || view == \"cant_pay_loan\"){\n\t\tcard_image.firstElementChild.src=\"image source\";\n\t\tcard_title.innerHTML = \"PAY OFF LOAN\";\n\t\tcard_image.firstElementChild.src=possession.image;\n\t\tcard_title.innerHTML = possession.name;\n\t\tcard_text.innerHTML = \"Loan amount \"+possession.to_pay+\"<br>pay of you loan\";\n\t\tbutton0[0].innerHTML=\"PAY\";\n\t\tbutton0[1].innerHTML = \"CANCEL\";\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t\tif(view == \"cant_pay_loan\"){\n\t\t\tbutton0[0].style.display = 'none';\n\t\t\tcard_text.innerHTML = \"Loan amount \"+possession.to_pay+\"<br>You don't have enough cash to pay off this loan\";\n\t\t}\n\t}\n\telse if(view == \"loan\"){\n\t\tcard_image.firstElementChild.src=\"image source\";\n\t\tcard_title.innerHTML = \"TAKE OUT A LOAN\";\n\t\tcard_text.innerHTML = \"Loan must be in mutiple of 1000 at 10% interest per month<br><br><div>Amount: <input id = \\\"loan\\\" value = \\\"1000\\\" type=\\\"number\\\"/></div>\";\n\t\tbutton0[0].innerHTML = \"BORROW\";\n\t\tbutton0[1].innerHTML = \"CANCEL\";\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\t\n\telse if(view == \"market_dont_have\"){\n\t\tcard_image.firstElementChild.src=possession.image;\n\t\tcard_title.innerHTML = possession.name;\n\t\tcard_text.innerHTML = \"Acceptez-vous une nouvelle\"+possession.description+\"<br> You have no assets that match this market card\";\n\t\tbutton0[0].style.display = 'none';\n\t\tbutton0[1].innerHTML = \"DONE\";\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\n\telse if(possession.type == \"deal\" || possession.type == \"market\"){\n\t\tcard_image.firstElementChild.src=possession.image;\n\t\tcard_title.innerHTML = possession.type;\n\t\tcard_text.innerHTML = possession.name+\"<br>Acceptez-vous une nouvelle\"+possession.description+\"<br>\"+\"cost: \"+possession.cost+\"<br>\"+\"cash flow: \"+possession.cash_flow\n\t\t+\"<br>\"+\"down pay\"+possession.down_pay;\n\t\tbutton0[0].innerHTML = \"BUY\";\n\t\tbutton0[1].innerHTML = \"PASS\";\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t\tif(possession.type == \"market\"){button0[0].innerHTML = \"SALE\";}\n\n\t}\n\telse if(possession.type == \"doodad\"){\n\t\tcard_image.firstElementChild.src=possession.image;\n\t\tcard_title.innerHTML = possession.name;\n\t\tcard_text.innerHTML = \"Achetez\"+possession.description+\" et cela vas vous coutez: \"+possession.cost;\n\t\tbutton0[0].innerHTML = \"ACCEPT\";\n\t\tbutton0[1].style.display = 'none';\n\t\tbutton1[0].style.display = 'none';\n\t\tbutton1[1].style.display = 'none';\n\t}\n}", "title": "" }, { "docid": "78934e48381a29af3059d762a25c5852", "score": "0.6163646", "text": "addComp(data) {\n const cardContainer = document.createElement(\"div\");\n const cardContainerContent = document.createElement(\"div\");\n const itemElement = document.createElement(\"div\");\n const roundBlack = document.createElement(\"div\");\n const roundBlue = document.createElement(\"div\");\n const title = document.createElement(\"h3\");\n const content = document.createElement(\"p\");\n const btn = document.createElement(\"button\");\n const star = document.createElement(\"img\");\n\n cardContainer.setAttribute(\"class\", \"card-column card-container\");\n cardContainerContent.setAttribute(\"class\", \"card-container__content\");\n itemElement.setAttribute(\"class\", \"item-column\");\n roundBlack.setAttribute(\"class\", \"round-black\");\n roundBlue.setAttribute(\"class\", \"round-blue\");\n star.setAttribute(\"src\", \"images/Stars.svg\");\n btn.setAttribute(\"class\", \"card-btn\");\n btn.textContent = \"Read More\";\n itemElement.setAttribute(\"id\", `${data.id}`);\n // title.setAttribute(\"class\", \"subtitle\");\n title.setAttribute(\"class\", \"subtitle item-title\");\n content.setAttribute(\"class\", \"item-content\");\n\n itemElement.value = data.id;\n title.textContent = data.title;\n content.textContent = data.content;\n\n cardContainerContent.append(title, star);\n\n cardContainer.append(roundBlack, cardContainerContent, roundBlue);\n itemElement.append(cardContainer, content, btn);\n\n commentElement.appendChild(itemElement);\n }", "title": "" }, { "docid": "b48180d3e6db2ff210db1a563cecbc20", "score": "0.6160907", "text": "function getCardImageHTML(obj) {\n \n var html = '<li class=\"card-image image-item\" data-imageid=\"' + obj.CardStyleId + '\" data-url=\"' + obj.ImageUrl + '\" data-thumb-url=\"' + obj.ThumbnailUrl + '\" data-filename=\"' + obj.ImageName + '\" data-basename=\"' + obj.BaseName + '\" data-extension=\"' + obj.FileExtension + '\">';\n html += '<div class=\"tools-panel\">';\n html += '<a href=\"javascript:void(0);\" class=\"delete\">Delete</a>';\n html += '</div>';\n html += '<div class=\"thumbnail\" style=\"background-image:url(' + obj.ThumbnailUrl + ')\">';\n html += '<input type=\"hidden\" name=\"CardImageIds\" value=\"' + obj.CardStyleId + '\" />';\n html += '<input type=\"hidden\" name=\"ImageNames\" value=\"' + obj.ImageName + '\" />';\n html += '<input type=\"hidden\" name=\"BaseNames\" value=\"' + obj.BaseName + '\" />';\n html += '<input type=\"hidden\" name=\"FileExtensions\" value=\"' + obj.FileExtension + '\" />';\n html += '</div>';\n html += '</li>';\n return html;\n}", "title": "" }, { "docid": "f1e84fe44c29f5779736e89712dbb011", "score": "0.615874", "text": "function crearCard(producto){\n const instrumentoDiv = document.createElement('div');\n instrumentoDiv.setAttribute('class', 'instrumento');\n instrumentoDiv.innerHTML = `<img src=${producto.img} class=\"img-galeria\">\n <h2>${producto.producto}</h2>\n <h2>$${new Intl.NumberFormat('es-ar').format(producto.valor)}</h2>\n <button onclick='agregarInstrumento(${instrumentos.indexOf(producto)})'>Agregar al carrito</button>`;\n \n contenedorInstrumentos.appendChild(instrumentoDiv);\n}", "title": "" }, { "docid": "1a0b9656554412d497f7357dfa36ffa9", "score": "0.6141463", "text": "htmlToCard(card) {\n const strArray = card.dataset.value.split(' ');\n return new Card(strArray[1], strArray[0]);\n }", "title": "" }, { "docid": "387eb932aa22ec956d5eeceb21341002", "score": "0.61253756", "text": "function itemCard_Builder(productId, elName, elDescription, elCost, elImagesrc){\n //section div\n var sectionWrapper = document.createElement('section');\n //image div\n var imageWrapper = document.createElement('div');\n var image = document.createElement('img');\n \n //description div\n var descritionWrapper = document.createElement('div');\n var itemName = document.createElement('h4');\n var itemDescription = document.createElement('p');\n var cartBtn = document.createElement('button');\n var addToCart = document.createElement('p');\n var itemSpan = document.createElement('span');\n var productIdDiv = document.createElement('p');\n var itemFadeOutImg = document.createElement('div');\n var quickviewoverlay = document.createElement('p');\n var itemCost = document.createElement('p');\n quickviewoverlay.innerHTML = \"Quick-view\";\n\n //ADD CLASSES\n sectionWrapper.classList.add('item-wrapper');\n imageWrapper.classList.add('item-image-wrapper');\n image.classList.add('image-src');\n descritionWrapper.classList.add('item-description-wrapper');\n itemName.classList.add('item-name');\n itemDescription.classList.add('item-description');\n cartBtn.classList.add('btn-add-cart');\n itemCost.classList.add('item-cost');\n itemFadeOutImg.classList.add('item-fade');\n productIdDiv.classList.add('productId');\n\n //APPEND\n //create button\n cartBtn.appendChild(addToCart);\n addToCart.innerHTML = 'Add to Cart';\n itemSpan.innerHTML='$';\n itemSpan.appendChild(itemCost);\n cartBtn.appendChild(itemSpan);\n\n //create description wrapper\n descritionWrapper.appendChild(itemName);\n descritionWrapper.appendChild(productIdDiv);\n descritionWrapper.appendChild(itemDescription);\n descritionWrapper.appendChild(cartBtn);\n //create image wrapper\n itemFadeOutImg.appendChild(quickviewoverlay);\n imageWrapper.appendChild(itemFadeOutImg);\n imageWrapper.appendChild(image);\n //Append to section\n sectionWrapper.appendChild(imageWrapper);\n sectionWrapper.appendChild(descritionWrapper);\n\n //console.log(sectionWrapper);\n image.src = elImagesrc;\n itemName.innerHTML = elName;\n itemDescription.innerHTML = elDescription;\n itemCost.innerHTML = elCost;\n productIdDiv.innerHTML = productId;\n\n //Append product card to DOM\n sectionsContainer.appendChild(sectionWrapper);\n}", "title": "" }, { "docid": "8d20d76c09f64b5503b7f2dde79af3f3", "score": "0.6123456", "text": "displayCards() {\n // Shuffle the list of cards\n this.cardList = this.shuffle(this.cardList);\n\n // Create a fragment to reduce reflow and repaint\n const fragment = document.createDocumentFragment();\n\n // Create an empty array to hold the card elements\n this.cardElems = [];\n\n // Loop through each card and create its HTML\n for (const card of this.cardList) {\n // Create a list item element for each card\n const cardElem = document.createElement('li');\n cardElem.classList.add('card');\n\n // Create a string variable containing each card's HTML text\n const cardHTML = `<i class=\"fa fa-${card}\"></i>`;\n\n /*\n Parse each card's text as HTML and insert it into the\n card element.\n */\n cardElem.insertAdjacentHTML('beforeend', cardHTML);\n\n // Append each card element to the document fragment\n fragment.appendChild(cardElem);\n\n // Add each card element to the cardElems array\n this.cardElems.push(cardElem);\n }\n\n // Select the deck element\n const deckElem = document.querySelector('.deck');\n\n // Append the document fragment to the deck element\n deckElem.appendChild(fragment);\n }", "title": "" }, { "docid": "6e511774e7a8701d43841863dadd7095", "score": "0.61167026", "text": "function addCardHere(content_array) {\n \"use strict\";\n var parent = document.getElementById(exec_img_id).parentElement,\n img_link = content_array[0],\n img_alt = content_array[1],\n type = content_array[2],\n array_next = 3,\n cell = document.createElement('div'),\n card = document.createElement('div'),\n img = document.createElement('img');\n cell.className = 'mdl-cell mdl-cell--4-col';\n card.className = 'mdl-card mdl-shadow--2dp img-tile';\n img.src = img_link;\n img.alt = img_alt;\n card.appendChild(img);\n switch (type) {\n case 'image'://custom -> title, link\n var title = content_array[array_next++],\n link = content_array[array_next++],\n a = document.createElement('a');\n a.href = link;\n a.appendChild(card);\n cell.appendChild(a);\n //TODO:wip\n /* in card:\n <div class=\"mdl-card__title mdl-card--expand\"></div>\n <div class=\"mdl-card__actions\">\n <span class=\"demo-card-image__filename\">Image.jpg</span>\n </div>\n */\n break;\n case 'info'://custom -> supporting_text, [action_name, action_link]...\n var supporting_text = content_array[array_next++],\n supporting_div = document.createElement('div'),\n supporting_p = document.createElement('p');\n supporting_div.className = 'mdl-card__supporting-text';\n supporting_p.style.margin = '0';\n supporting_p.style.fontSize = '13px';\n supporting_p.style.lineHeight = '18px';\n supporting_p.innerHTML = supporting_text;\n resize_elements = resize_elements.concat(cell);\n img.addEventListener(\"load\", function () {\n expandToWindow();\n }, false);\n cell.addEventListener(\"unresize\", function () {\n supporting_p.style.removeProperty('height');\n }, false);\n cell.addEventListener(\"doresize\", function () {\n var cell_height = cell.offsetHeight,\n card_height = card.offsetHeight,\n support_height = supporting_p.offsetHeight;\n supporting_p.style.height = (support_height + cell_height - card_height) + \"px\";\n }, false);\n supporting_div.appendChild(supporting_p);\n card.appendChild(supporting_div);\n case 'actions'://custom -> [action_name, action_link]...\n var action = content_array.slice(array_next++),\n action_div = document.createElement('div');\n action_div.className = 'mdl-card__actions mdl-card--border';\n for (var i = 0; i < action.length; i++) {\n var action_a = document.createElement('a');\n action_a.className = 'mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect';\n action_a.innerHTML = action[i][0];\n action_a.href = action[i][1];\n action_div.appendChild(action_a);\n }\n card.appendChild(action_div);\n cell.appendChild(card);\n break;\n default:\n console.error('unknown type ' + type);\n }\n parent.appendChild(cell);\n componentHandler.upgradeDom();\n expandToWindow();\n}", "title": "" }, { "docid": "67051a0192d9a27a77e2cd873f1171d9", "score": "0.6116301", "text": "showProductDetails(product) {\n let output = `\n <div class=\"card mb-5\" id=\"details-show-banner\" style=\"max-width: 100%\">\n <div class=\"row g-0\">\n <div class=\"col-md-4\">\n <img\n src=\"${product.image}\"\n class=\"img-fluid rounded-start\"\n alt=\"...\"\n />\n </div>\n\n <div class=\"col-md-8\">\n <div class=\"card-body\" id=\"product-details\">\n <div>\n <h5 class=\"card-title title-style\">${product.title}</h5>\n <p class=\"card-text\">\n <small class=\"text-muted\">${product.author}</small>\n </p>\n <h4 class=\"card-title\">€ ${product.price}</h4>\n\n <hr />\n\n <h6 class=\"card-title\">Overview</h6>\n <p class=\"card-text\" id=\"card-description\">${product.description}</p>\n\n <hr />\n </div>\n\n <div id=\"details-add-to-cart\">\n <button type=\"button\" class=\"btn btn-outline-dark\" id=\"add-to-cart-btn\">\n <i class=\"fas fa-shopping-cart\"></i\n > ADD TO CART\n </button>\n\n <p class=\"card-text\">\n <small class=\"text-muted\">Stock: ${product.stock} pcs.</small>\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>`;\n this.detailsContainer.innerHTML = output;\n }", "title": "" }, { "docid": "ebb94be0768e12edd351c3bf54ea511a", "score": "0.611264", "text": "function cardSetup(card, data){\n\t$(card).html(data);\n\t\n\t// Hide text sections that are accessible by clicking \"read more\":\n\t//$(card).find(\".buttonShowMore\").closest(\"p\").nextAll().addClass( \"hidden\" );\n\t//cardShowLess(card);\n\tvar divMore = $(card).find(\"div.more\");\n\tdivMore.hide();\n\t\n\t// Attach \"show more\" function to \"show more\" button:\n\t$(card).find(\".buttonShowMore\").click(function(){cardShowMore(card)});\n\t\n\t// Attach \"show less\" function to \"show less\" button:\n\t$(card).find(\".buttonShowLess\").click(function(){cardShowLess(card)});\n\t\n\t// Add style to standard body text (i.e. <p>'s with no class):\n\t$(card).find('p:not([class])').addClass(\"bodyText\");\n\t\n\t// Add links to emails:\n\t$(card).find(\".personEmail\").each(function() {\n\t\t$(this).wrap('<a href=\"mailto:' + $(this).text() + '\"></a>');\n\t})\n}", "title": "" }, { "docid": "e9117252c3a867ae7f6b786462518b46", "score": "0.61124086", "text": "function cardReplace(cb, ct) {\n cb = ct;\n Bottom = ct;\n let cardImg = document.createElement(\"img\");\n cardImg.setAttribute(\"id\", cb);\n cardImg.src = `images/PNG/${cb}.png`;\n let imagesDiv = document.createElement(\"div\");\n imagesDiv.setAttribute(\"class\", \"playing-card\");\n document.querySelector(\"#starting-card\").appendChild(imagesDiv);\n imagesDiv.appendChild(cardImg);\n}", "title": "" }, { "docid": "06741d431b1009c6617303d8830d81cc", "score": "0.6104387", "text": "function generateCard(card) {\n let cardTemplate = `<li class=\"card\" data-card=\"${card}\">\n <i class=\"fa ${card}\"></i>\n </li>`;\n // console.log(cardTemplate);\n return cardTemplate;\n}", "title": "" }, { "docid": "7e7d561ab4f4165fc11f47c47f2e978b", "score": "0.60985184", "text": "function cardify(food, food_id) {\n\n // create a card for each food item\n var htmlString = '<div class=\"col-md-4 mt-2 mb-2\" id =\"' + food_id + '\"\">\\\n <div class=\"card\">\\\n <div class=\"card-body\">\\\n <h5 class=\"card-title\">' + food.food_name + '</h5>\\\n <h6 class=\"card-subtitle mb-2 text-muted\">Serving Size: ' + food.food_info.serving_size + '</h6>\\\n <h6 class=\"card-subtitle mb-2 text-muted\">Calories: ' + food.food_info.calories + '</h6>\\\n <div class=\"barchart\" id=\"' + food_id + '-barchart\"></div>\\\n </div>\\\n </div>\\\n </div>';\n\n\nreturn htmlString;\n}", "title": "" }, { "docid": "a9357ec1b55e709b6e826c65ffb9ffb2", "score": "0.6098386", "text": "cardBody(){\n\t\t\t return <Card.Body>\n\t\t\t <h2>{this.props.data.number} | {this.props.data.instructor}<Button ref={this.buttonRef} style = {{\"float\": \"right\", backgroundColor: \"#6fa8dc\", \"fontFamily\": \"sans-serif\"}} onClick = {(event) =>this.toggleCart(event)}>{this.buttonText()}</Button></h2>\n\t\t\t <h4>{this.props.data.location}</h4>\n\t\t\t <h5>{this.getTimes()}</h5>\n\t\t\t <Card.Text></Card.Text>\n\t\t\t</Card.Body>\n\t\t }", "title": "" }, { "docid": "7b22a94706d26827949c108106451b21", "score": "0.60965717", "text": "function createCardElement(cardClass) {\n $(\"ul.deck\").append(`<li class=\"card\"><i class=\"fa ${cardClass}\"></i></li>`);\n}", "title": "" }, { "docid": "5db8b08d228b79211fcd84342157f699", "score": "0.60924965", "text": "displayCart(){\n cartSection.classList.add('transparentBcg');\n cartCard.classList.add('showCart');\n }", "title": "" }, { "docid": "c45b3f42d1808b1c9c385b9f59af46ff", "score": "0.60911894", "text": "displayitemFullOrCard(viewOprion){\n switch (viewOprion) {\n case \"ViewFull\":\n this.shadowRoot.querySelector(\"#WebProduct\").style.width=\"100%\";\n this.shadowRoot.querySelector(\"#WebProduct\").style.minHeight=\"50px\";\n\n this.shadowRoot.querySelector(\"#ProductImageInfo\").className=\"ViewFull\"\n break;\n case \"ViewCard\":\n\n this.shadowRoot.querySelector(\"#ProductImageInfo\").className=\"ViewCard\"\n\n break;\n default:\n\n }\n\n }", "title": "" }, { "docid": "b0d3617731d297e0a00c274b28b175f2", "score": "0.6090087", "text": "function generateCard(name, flag) {\n console.log('in generate card')\n const container = document.getElementById('container');\n var cardContainer = document.createElement('div');\n var cName = document.createElement('h3');\n var image = document.createElement('img');\n\n cName.innerHTML = name;\n image.src = flag;\n\n cardContainer.classList.add('card');\n cardContainer.appendChild(cName);\n cardContainer.appendChild(image);\n\n container.appendChild(cardContainer);\n\n}", "title": "" }, { "docid": "290eef8182a9e4b99ca342862b4e69c9", "score": "0.6086537", "text": "renderCardChunk(cards) {\n cards.forEach((card, index) => {\n let oldChild = this.$items[this.$items.length - (index + 1)];\n let newChild = htmlToElement(this.cardHtml(card));\n oldChild.parentNode.replaceChild(newChild, oldChild);\n })\n this.updateElementsAndWidths();\n }", "title": "" }, { "docid": "e71238a910634c33f5d55c287457a830", "score": "0.6084799", "text": "function createCard(c) {\n return `<li class='card'><i class='fa ${c}'></i></li>`;\n}", "title": "" }, { "docid": "64ea38582c4138692cb2053a89541e7b", "score": "0.60828394", "text": "function guest_card_element() {\n return (`\n <div class='card item-card'>\n <div class='item-card card-body'>\n <h4 class='item-name'>${currentItem.itemName}</h4>\n <p class='card-text item-count public-item' data-itemid='${currentItem.barcode}'>${currentItem.count}</p>\n </div>\n </div>\n `)\n}", "title": "" }, { "docid": "3049a9098d19abc00e5a0160591af6a0", "score": "0.60819364", "text": "function makeCard(id, firstName, lastName, email) {\r\n var card = '';\r\n card += \"<div id='\" + id + \"' class='card'>\" +\r\n \"<div class='card-header card-header-info toggle view-contact px-0'>\" +\r\n \"<div class='row no-gutters'>\" +\r\n \"<i class='arrow-person material-icons col-auto medium my-auto mx-3'>account_circle</i>\" +\r\n \"<h3 class='col my-auto ml-3'>\" + firstName + \" \" + lastName + \"</h3>\" +\r\n \"<i class='arrow-person material-icons col-auto medium my-auto ml-auto pr-3'>keyboard_arrow_down</i>\" +\r\n \"</div>\" +\r\n \"</div>\" +\r\n \"<ul class='list-group list-group-flush'>\" +\r\n \"<a href='mailto:\" + email + \"'>\" +\r\n \"<li class='list-group-item px-0'>\" +\r\n \"<div class='row no-gutters'>\" +\r\n \"<i class='material-icons col-auto medium my-auto mx-4 py-3 text-warning'>email</i>\" +\r\n \"<div class='email col my-auto pr-5 text-dark'>\" + email + \"</div>\" +\r\n \"</div>\" +\r\n \"</li>\" +\r\n \"</a>\" +\r\n \"<ul class='list-group listgroup-flush'>\" +\r\n \"<li class='info list-group-item px-0'>\" +\r\n \"<div class='row no-gutters'>\" +\r\n \"<i class='material-icons col-auto medium my-auto mx-4 py-3 text-dark'>info_outline</i>\" +\r\n \"<div class='col my-auto pr-5'>Are you sure you want to delete this entry?</div>\" +\r\n \"</div>\" +\r\n \"</li>\" +\r\n \"<li class='cancel list-group-item px-0'>\" +\r\n \"<div class='row no-gutters'>\" +\r\n \"<i class='material-icons col-auto medium my-auto mx-4 text-primary'>highlight_off</i>\" +\r\n \"<div class='col my-auto pr-3 text-primary'>Cancel</div>\" +\r\n \"</div>\" +\r\n \"</li>\" +\r\n \"</ul>\" +\r\n \"<li class='delete list-group-item px-0' data-id='\" + id + \"'>\" +\r\n \"<div class='row no-gutters'>\" +\r\n \"<i id='delete-icon' class='material-icons col-auto medium my-auto mx-4 text-danger'>delete</i>\" +\r\n \"<div class='col my-auto text-danger'>Delete contact</div>\" +\r\n \"</div>\" +\r\n \"</li>\" +\r\n \"</ul>\" +\r\n \"</div>\";\r\n return card\r\n }", "title": "" }, { "docid": "20b1386cbff8d670b418c6c5f8b04055", "score": "0.6079659", "text": "function buildCardHTML () {\n var container = document.createElement('div'),\n cardHeader = document.createElement('header'),\n cardTools = document.createElement('div'),\n editCard = document.createElement('span'),\n deleteCard = document.createElement('span'),\n animalName = document.createElement('h2'),\n cardBody = document.createElement('div'),\n imageContainer = document.createElement('picture'),\n animalImage = document.createElement('img'),\n cardAnimalText = document.createElement('div'),\n animialFacts = document.createElement('ul'),\n animalDetails = document.createElement('div');\n \n \n //set classes \n container.className = 'completedCard';\n cardHeader.className = 'cardHeader';\n cardTools.className = 'cardTools';\n animalImage.className = 'cardImage';\n cardAnimalText.className = 'cardAnimalText';\n animialFacts.className = 'animialFacts';\n animalDetails.className = 'animalDetails';\n \n //set text\n animalName.textContent = 'Aniaml name'\n editCard.textContent = 'mode_edit';\n deleteCard.textContent = 'delete';\n \n //set image attributes\n animalImage.src = 'http://www.dimakroma.com/nophoto.gif';\n animalImage.alt = 'animal-image';\n \n cardTools.appendChild(editCard);\n cardTools.appendChild(deleteCard);\n cardHeader.appendChild(animalName);\n cardHeader.appendChild(cardTools);\n container.appendChild(cardHeader);\n imageContainer.appendChild(animalImage);\n container.appendChild(imageContainer);\n cardBody.appendChild(imageContainer);\n cardAnimalText.appendChild(animialFacts);\n cardAnimalText.appendChild(animalDetails);\n cardBody.appendChild(cardAnimalText);\n \n container.appendChild(cardBody);\n \n return {\n container : container,\n animialFacts : animialFacts,\n animalDetails : animalDetails,\n animalName : animalName,\n animalImage : animalImage,\n editCard : editCard,\n deleteCard : deleteCard\n };\n}", "title": "" }, { "docid": "fa8868a4356a7744759b6a9f71ca5688", "score": "0.60757107", "text": "render(){\n\n\t\tconst { cards, position } = this.props\n\t\tconst qtd_cartas = this.props.cards.length\n\n\t\treturn(\n\t\t\t<div className={'hand ' + position}>\n\t\t\t\t{cards && cards.map((card, i) => (\n\t\t\t\t\t<Card \n\t\t\t\t\t\tcarta={card}\n\t\t\t\t\t\tkey={card.id} \n\t\t\t\t\t\tangulo={this.calcularAngulos(qtd_cartas, this.angulo_geral, i)}\n\t\t\t\t\t\tmargem={this.calcularMargem(qtd_cartas, this.margem_geral, i)}\n\t\t\t\t\t\tacoes={{\n\t\t\t\t\t\t\tenviar: () => this.enviarCarta(card),\n\t\t\t\t\t\t\tdescartar: () => this.props.descartar('mao', card.id)\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t)\n\t}", "title": "" }, { "docid": "7b5e27f71f3d8993ebf8158d4ef0e59a", "score": "0.6074557", "text": "function displayAccessoryGlobal(accessories) {\n\n // creating the frist div with the class name accessory col-sm-4\n let parentProduct = document.querySelector('#products');\n let newItem = document.createElement('div');\n newItem.className = 'accessory col-sm-4 ' + accessories.color;\n parentProduct.appendChild(newItem);\n\n // creating the second div within the div accessory col-sm-4 with class name card my-3\n let divs = document.getElementsByClassName(\"accessory col-sm-4\");\n parentProduct = divs[divs.length - 1];\n newItem = document.createElement('div');\n newItem.className = 'acard my-3';\n parentProduct.appendChild(newItem);\n\n // creating the third div within the div card my-3 with the class name currency btn btn-light disabled\n divs = document.getElementsByClassName(\"acard my-3\");\n parentProduct = divs[divs.length - 1];\n newItem = document.createElement('div');\n newItem.className = 'currency btn btn-light disabled';\n newItem.textContent = accessories.price;\n parentProduct.appendChild(newItem);\n\n // creating the img within the div card my-3\n divs = document.getElementsByClassName(\"acard my-3\");\n parentProduct = divs[divs.length - 1];\n newItem = document.createElement('img');\n newItem.className = 'card-img-top';\n newItem.src = accessories.imageHref;\n newItem.alt = \"Image of \" + accessories.name;\n parentProduct.appendChild(newItem);\n\n // creating the the forth div within the div card my-3\n divs = document.getElementsByClassName(\"acard my-3\");\n parentProduct = divs[divs.length - 1];\n newItem = document.createElement('div');\n newItem.className = 'card-body text-center';\n parentProduct.appendChild(newItem);\n\n // creating the h5 title\n divs = document.getElementsByClassName(\"card-body text-center\");\n parentProduct = divs[divs.length - 1];\n newItem = document.createElement('h5');\n newItem.className = 'card-title';\n newItem.textContent = accessories.name;\n parentProduct.appendChild(newItem);\n\n // creating the color paragraph\n divs = document.getElementsByClassName(\"card-body text-center\");\n parentProduct = divs[divs.length - 1];\n newItem = document.createElement('p');\n newItem.className = 'card-tex';\n let firstText = document.createTextNode('Color: ');\n let em = document.createElement('em');\n em.textContent = accessories.color;\n newItem.appendChild(firstText);\n newItem.appendChild(em);\n parentProduct.appendChild(newItem);\n\n}", "title": "" }, { "docid": "8d6c1592eeee0cd15f84a9add6769f9b", "score": "0.6073858", "text": "function addCardElement(type, part, title) {\n if (type == \"card\") {\n // create new card with header (text being 'title'), and append to 'part'\n var newCard = $(\"<div>\").addClass(\"card\").attr('id', title.toLowerCase() + \"-card\");\n var cardHeader = $(\"<div>\").addClass(\"card-header\").text(title);\n newCard.append(cardHeader);\n part.append(newCard);\n } else if (type == \"body\") {\n // create new card body \n var newBody = $(\"<div>\").addClass(\"card-body\").attr('id', title.toLowerCase() + \"-body\");\n // make header of Bio card be the artist name, otherwise have the header be the name of the div\n if (title == \"Bio\") var headerText = result.name;\n else var headerText = title;\n // create header, append to the new Body\n var bodyTitle = $(\"<h2>\").addClass(\"card-title\").text(headerText);\n newBody.append(bodyTitle);\n\n // append new Body to 'part'\n part.append(newBody);\n }\n }", "title": "" }, { "docid": "3c1f49b9ee939c77412e3ff0919e33b7", "score": "0.607385", "text": "__CreateCards() {\n //Clear the existing cards in the html\n let existing = document.querySelectorAll('[data-servercard=\"true\"]');\n existing.forEach(m => {\n m.parentElement.removeChild(m);\n })\n\n let element = document.getElementById(__appglobals.views_sideNavHeaderId);\n let cards = { card: new Array() };\n\n configurationcontroller.__config_list.forEach((c) => {\n cards.card.push(c)\n })\n\n let rendedCards = configurationcontroller.GetViewAsHtml(\"sidebar/server-card\", cards);\n element.insertAdjacentHTML('afterend', rendedCards);\n }", "title": "" }, { "docid": "29e277f696404ed37fbe611f15c680cc", "score": "0.60735875", "text": "function placeCard() {}", "title": "" }, { "docid": "51f6e98fe56f67439237079836a73445", "score": "0.6073063", "text": "function renderCompCard(card) {\n var compCard = document.createElement('div');\n document.body.appendChild(compCard);\n compCard.classList.add('compCard')\n compCard.innerHTML = \"<div class='upper-left'>\" +\n card.rank + card.suit +\n \"</div>\" +\n \"<div class='lower-right'>\" +\n card.rank + card.suit +\n \"</div>\";\n}", "title": "" }, { "docid": "6578992604d24a8da8b748737eeaddd2", "score": "0.6068695", "text": "function createCard(product) {\n let div = $(`<div class=\"card\"></div>`);\n let img = $(`<img class=\"card-img-top\" src=${product.image_url} alt=\"Card image cap\"></img>`);\n let cardBody = $(`<div class=\"card-body\"></div>`);\n let cardDetails = $(`<h6 class=\"card-title\">${product.name}</h6>\n <p class=\"card-text\">Price: <b>₹ ${product.price}</p>\n `);\n\n let addtoCartButton = $(`<button type = \"button\" id = \"${product._id}\" class=\"btn btn-primary\"> Add to Cart</button>`);\n\n cardBody.append(cardDetails);\n div.append(img);\n div.append(cardBody);\n div.append(addtoCartButton);\n\n addtoCartButton.click((event) => {\n event.preventDefault();\n\n $.ajax({\n url: \"http://localhost:5555/user/cart/\" + product._id,\n method: 'POST',\n }).done(() => window.location.replace(\"http://localhost:5555/user/cart\"));\n });\n\n return div;\n }", "title": "" }, { "docid": "37aeacfa0655275fdb9eeaa1bb7e4852", "score": "0.60673666", "text": "function addCard(card) {\n $('.deck').append(`<li class=\"card animated\"><i class=\"fa ${card}\"></i></li>`);\n}", "title": "" }, { "docid": "f5a22b10e9cfba2fbdf5f919e5e95b5b", "score": "0.60636455", "text": "function createCard(card) {\n let createdCard = `<div class=\"project-card\" techStack=${card.techStack} >\n <img src=\"${card.imgURL}\" alt=\"${card.imgALT}\">\n <h4>${card.title}</h4>\n <h6>${card.techStack}</h6>\n <p>${card.description}</p>\n <a href=\"${card.githubURL}\">Github</a>\n <a href=\"${card.liveProjectURL}\">Live</a>\n </div>\n `;\n return createdCard;\n }", "title": "" }, { "docid": "82f568d7b4adc45abe2afdc6317b7d7c", "score": "0.6060651", "text": "function getUIOfCurrentWeather(currentWeather) {\n currWeathContainer.textContent = \"\";\n var cardDiv = document.createElement(\"div\");\n cardDiv.classList.add(\"card\");\n var cardBodyDiv = document.createElement(\"div\");\n cardBodyDiv.classList.add(\"card-body\");\n var cardTitle = document.createElement(\"h5\");\n cardTitle.classList.add(\"card-title\");\n var icon = document.createElement(\"img\");\n var iconUrl = currentWeather.iconUrl;\n icon.setAttribute(\"src\", iconUrl);\n cardTitle.textContent = currentWeather.city + \" \" + currentWeather.date + \" \";\n var carSubTitleTemp = document.createElement(\"h6\");\n carSubTitleTemp.classList.add(\"card-subtitle\");\n carSubTitleTemp.classList.add(\"mb-2\");\n carSubTitleTemp.classList.add(\"text-muted\");\n var carSubTitleWind = document.createElement(\"h6\");\n carSubTitleWind.classList.add(\"card-subtitle\");\n carSubTitleWind.classList.add(\"mb-2\");\n carSubTitleWind.classList.add(\"text-muted\");\n var carSubTitleHum = document.createElement(\"h6\");\n carSubTitleHum.classList.add(\"card-subtitle\");\n carSubTitleHum.classList.add(\"mb-2\");\n carSubTitleHum.classList.add(\"text-muted\");\n var carSubTitleUv = document.createElement(\"h6\");\n carSubTitleUv.classList.add(\"card-subtitle\");\n carSubTitleUv.classList.add(\"mb-2\");\n carSubTitleUv.classList.add(\"text-muted\");\n carSubTitleTemp.innerHTML = \"Temp: \" + currentWeather.temp + \"<br/><br/>\";\n carSubTitleWind.innerHTML = \"Wind: \" + currentWeather.wind + \"<br/><br/>\";\n carSubTitleHum.innerHTML =\n \"Humidity: \" + currentWeather.humidity + \"<br/><br/>\";\n if (currentWeather.uvi <= 2.5) {\n carSubTitleUv.innerHTML =\n \"UV Index: \" +\n \"<span class='uvInd' style='background-color:green;width:10px'>\" +\n currentWeather.uvi +\n \"</span>\" +\n \"<br/><br/>\";\n } else if (currentWeather.uvi > 2.5 && currentWeather.uvi <= 5.5) {\n carSubTitleUv.innerHTML =\n \"UV Index: \" +\n \"<span class='uvInd' style='background-color:yellow''>\" +\n currentWeather.uvi +\n \"</span>\" +\n \"<br/><br/>\";\n } else {\n carSubTitleUv.innerHTML =\n \"UV Index: \" +\n \"<span class='uvInd' style='background-color:red''>\" +\n currentWeather.uvi +\n \"<span>\";\n }\n\n cardTitle.appendChild(icon);\n cardBodyDiv.appendChild(cardTitle);\n cardBodyDiv.appendChild(carSubTitleTemp);\n cardBodyDiv.appendChild(carSubTitleWind);\n cardBodyDiv.appendChild(carSubTitleHum);\n cardBodyDiv.appendChild(carSubTitleUv);\n cardDiv.appendChild(cardBodyDiv);\n currWeathContainer.appendChild(cardDiv);\n}", "title": "" }, { "docid": "e59feea9c6394b645cc93f7181ec57fd", "score": "0.60586894", "text": "function buildElement(notificationObj, type, subheading, cardColor, content, index) {\n var typeContent = document.getElementById(type + \"-content\");\n\n // Only builds elements that are not already present\n if (!(document.getElementById(\"tab-content\").contains(typeContent))) {\n createContent(\"tab-content\", \"div\", type + \"-content\", \"tab-section-content col-12\");\n createHeader(type + \"-content\", \"h3\", headerCap(type), \"col-11 inner-header\");\n createSubheader(type + \"-content\", \"h6\", subheading, \"col-11 inner-subheader\");\n createContent(type + \"-content\", \"div\", \"notif-\" + type + \"-data\", \"col-11 tab-section-data row\");\n }\n\n\n //create card \n var cardID = type + \"-card-\" + index;\n createContent(\"notif-\" + type + \"-data\", \"div\", cardID, \"card-panel col-md \" + cardColor + \"-card\");\n var x = $(\"<span id='card-close-btn\" + index + \"' style='float: right; font-size: 30pt z-index: 2' class='fas fa-times ui-button-custom'></span>\");\n var span = $(\"<span>\" + content + \"</span>\");\n $(\"#\" + cardID).append(x);\n $(\"#\" + cardID).append(span);\n $(\"#\" + cardID).css({ \"z-index\": 1 });\n //close notification action\n $(document).on(\"click\", \"#card-close-btn\" + index, (e) => {\n deleteNotification(notificationObj._id, index, cardID);\n\n })\n\n //notification card action\n $(document).on(\"click\", \"#\" + cardID, (e) => {\n //request card and paid card go to charger dashboard\n if (e.target.id == \"card-close-btn\" + index) {\n //do nothing\n }\n else if (cardID[0] == \"r\" || cardID[0] == \"p\")\n location.replace('/charger_dashboard');\n //accepted card go to user dashboard\n else if (cardID[0] == \"a\")\n location.replace('/user_bookings');\n })\n}", "title": "" }, { "docid": "7e4388013deb53c35ee90f033c0ad938", "score": "0.6053465", "text": "function parseCartContent(element, i) {\n\tvar htmlElement = \"\";\n\n\thtmlElement += \"<div class=\\\"eltCart\\\"><div class=\\\"eltCartBlur\\\" style=\\\"background-image: url('\"+element.image_url+\"');\\\"></div>\";\n\thtmlElement += \"<div class=\\\"eltCartContent\\\">\";\n\thtmlElement += \"<div class=\\\"eltCartNumber\\\">\" + (i+1) +\"</div>\";\n\thtmlElement += \"<div>\"+element.name.charAt(0).toUpperCase() + element.name.substring(1).toLowerCase() + \"<br/>\";\n\n\tif(element.type_name != null)\n\t{\n\t\thtmlElement += \"<i>\" + element.type_name.charAt(0).toUpperCase() + element.type_name.substring(1).toLowerCase() + \"</i><br/>\";\n\t}\n\telse\n\t\thtmlElement += \"<br/>\";\n\n\tif(element.sitelink != null)\n\t{\n\t\thtmlElement += \"<a target=\\\"_blank\\\" href=\" + element.sitelink + \">\" + _MAP_POI_LINK + \"</a>\";\n\t}\n\n\thtmlElement += \"<br/><span class=\\\"POI_CART_icons\\\"><span class=\\\"glyphicon glyphicon-chevron-up\\\" onclick=\\\" invertPOI(\"+ i +\",'up'); \\\"></span> <span class=\\\"glyphicon glyphicon-chevron-down\\\" onclick=\\\" invertPOI(\"+ i +\",'down'); \\\"></span> <span class=\\\"glyphicon glyphicon-remove\\\" onclick=\\\" deletePOI( \" + i + \"); \\\"></span></div>\";\n\thtmlElement += \"</div></div>\";\n\treturn htmlElement;\n}", "title": "" }, { "docid": "15fbcee38868c537a43e92532f7c67d9", "score": "0.6052812", "text": "_createCard_frontBody () {\n let card_body_node = document.createElement(\"div\");\n let card_frontBody_titleHtml = \"\";\n let card_frontBody_textHtml = \"\";\n let card_body_front_textArray = [\n this.parameters[\"how\"], this.parameters[\"why\"], this.parameters[\"AVT_tag\"]\n ];\n\n card_body_node.classList.add(\"card-body\");\n\n Homepage_Card.card_body_front_titleArray.forEach((title, i, titleList) => {\n if(card_body_front_textArray[i] === \"\") {\n return ;\n }\n\n card_frontBody_titleHtml = `<div class=\"card-body-subtitle\">${title}</div>`;\n card_frontBody_textHtml = `<p class=\"card-body-text\">${card_body_front_textArray[i]}</p>`;\n card_body_node.innerHTML += (card_frontBody_titleHtml + card_frontBody_textHtml); \n });\n \n return card_body_node;\n }", "title": "" }, { "docid": "6c685dd66fc05bc01e39bad2cb305344", "score": "0.60516065", "text": "function createSavedRecipeCards(recipeInfo){\n\n console.log(recipeInfo);\n\n var img = \"http://lorempixel.com/100/190/nature/6\";\n\n var html = \"<div class='col s12 m6 l6'>\";\n\n html += \"<div class='card horizontal' id='savedCard'>\";\n html += \"<div class='card-image'>\";\n html += \"<img src='\" + recipeInfo.imgURL + \"' class = 'circle responsive-img'></div>\";\n html += \"<div class='card-stacked'>\";\n html += \"<div class='card-content' id = 'savedCard-panel'>\";\n html += \"<h5><a href='\" + recipeInfo.recURL + \"' target='_blank' class ='black-text'>\" + recipeInfo.recTitle + \"</a></h5></div>\";\n html += \"</div></div></div>\";\n\n console.log(html);\n\nreturn html;\n\n}", "title": "" }, { "docid": "3fe92003cfe1dc32489fa59b5bd20f13", "score": "0.6045957", "text": "render() {\n return (h(\"div\", { class: \"contenitore\" }, h(\"prima-carta\", null), h(\"seconda-carta\", null), h(\"terza-carta\", null), h(\"quarta-carta\", null)));\n }", "title": "" }, { "docid": "59cc1a2fb18627781ede541066e05583", "score": "0.6044076", "text": "_createCard_backBody () {\n let card_body_node = document.createElement(\"div\");\n let card_body_subtitle_html = `<h6 class=\"card-body-subtitle\">${this.parameters[\"eg_title\"]}</h6>`;\n let card_body_caption_node = document.createElement(\"div\");\n let caption_item_html = \"\";\n let caption_valueArr = [\n this.parameters[\"eg_source\"], this.parameters[\"eg_year\"], \n this.parameters[\"eg_category\"], this.parameters[\"eg_subcategory\"]\n ];\n\n card_body_node.classList.add(\"card-body\");\n card_body_caption_node.classList.add(\"card-body-caption\");\n \n Homepage_Card.caption_keyArr.forEach((key, i, keyList) => {\n if(caption_valueArr[i] === \"\") {\n return ;\n }\n\n caption_item_html = `<div><span>${key}: </span>${caption_valueArr[i]}</div>`;\n card_body_caption_node.innerHTML += caption_item_html;\n });\n card_body_node.innerHTML = card_body_subtitle_html;\n card_body_node.appendChild(card_body_caption_node);\n return card_body_node;\n }", "title": "" }, { "docid": "c4b61337ea4495e56a2679218a49b27d", "score": "0.60398895", "text": "createRecipeCards() {\n\n // Creation of all the variables\n var container = document.querySelector('#containerRecipe');\n var linkRecipe = document.createElement(\"a\");\n var cardRecipe = document.createElement(\"div\");\n var title = document.createElement(\"p\");\n var icon = document.createElement(\"img\");\n var titleText = document.createTextNode(this.name);\n var pictureDiv = document.createElement(\"div\");\n\n // Add the image paths\n pictureDiv.style[\"background-image\"] = \"url(assets/pictures/\" + this.url + \")\";\n icon.src = \"assets/pictures/icon-foreign.png\";\n\n // Add the id of each card\n linkRecipe.id = this.recipeId;\n\n // Add the http of each card\n linkRecipe.href = this.http;\n\n // Add style in the various div\n container.className = \"relative m-auto flex flex-row flex-wrap justify-center items-center\";\n cardRecipe.className += \"cardRecipe relative flex flex-col border-solid border-2 border-black border-opacity-50 text-center content-center bg-white z-50 items-center justify-around m-6\";\n pictureDiv.className += \"pictureDiv border-solid border-2 border-black border-opacity-50 w-10/12 h-3/4\";\n\n // Add nodes in the various HTML elements\n container.prepend(linkRecipe);\n linkRecipe.prepend(cardRecipe);\n cardRecipe.appendChild(title);\n title.appendChild(titleText);\n cardRecipe.appendChild(pictureDiv);\n cardRecipe.appendChild(icon);\n\n }", "title": "" }, { "docid": "2fe6c662d855f31d224d20d9bc6da8f6", "score": "0.60396945", "text": "renderSmallDesc(ShortDescription, isCarrousel = false) {\n \n\n return (\n <div className = 'xpl-cardDescription'>\n <p> {this.setDescriptionWidth(ShortDescription, isCarrousel)} </p>\n </div>\n )\n\n\n \n \n }", "title": "" }, { "docid": "ada968386bf3f7fe689e4121db2ddd1c", "score": "0.6032634", "text": "function create_card(title, content, link, linktitle, email){\n card = \"<div class='card white darken-1 black-text'> \\\n <div class='card-content'> \\\n <span class='card-title'>\"+title+\"</span> \\\n <p>\"+content+\"</p> \\\n </div> \\\n <div class='card-action blue lighten-4'> \\\n <a href='\"+link+\"'>\"+linktitle+\"</a> \\\n \"+email+\" \\\n </div> \\\n </div> \\\n \";\n $(views[0]).append(card);\n}", "title": "" }, { "docid": "da5d9e48a01ba17bf3a0901ab6bdecc1", "score": "0.6025992", "text": "function card(data,dropdown,filters,idea,tab) { \"use strict\";\n\tvar node = document.createElement(\"article\");\n\tnode.setAttribute(\"class\", \"card-\"+tab+\"-\"+idea);\n\tvar aside = document.createElement(\"aside\"); // Hashtags\n\taside.setAttribute(\"class\", \"hashtags\");\n\tvar year = data[DATE].substring(0,4);\n\tif (tab===\"media\" && !filters.includes(idea)) { \n\t\tfilters[filters.length] = idea; }\n\tswitch(tab) {\n\t\tcase \"media\": var topic = topics[idea].toLowerCase();\n\t\t\taside.textContent = \"#\"+topic+\" #\"+year;\n\t\t\tbreak;\n\t\tcase \"playlist\": aside.textContent = \"#\"+year;\n\t\t\tbreak;\n\t\tcase \"user\": var tag = \"\";\n\t\t\tif (idea>0) { tag = \"#\"+kinds[idea].toLowerCase()+\" \"; } \n\t\t\taside.textContent = tag+\"#\"+year;\n\t\t\tbreak; }\n\tvar main = document.createElement(\"div\");\n\tmain.setAttribute(\"class\", \"card-main\"); \n\tvar frame = document.createElement(\"div\");\t\t \n\tvar thumbnail = document.createElement(\"img\");\n\tthumbnail.alt = \"Thumbnail\";\t\t\t \n\tthumbnail.setAttribute(\"class\",\"small\");\n\tthumbnail.id = tab+\"-icon-\"+data[_KEY];\n\tswitch(tab) {\n\t\tcase \"media\": frame.setAttribute(\"class\",\"frame media\");\n\t\t\tthumbnail.src = data[ICON];\n\t\t\tbreak;\n\t\tcase \"playlist\": frame.setAttribute(\"class\",\"frame playlist\");\n\t\t\tthumbnail.src = \"draw/\" + moods[data[ICON]] + \".svg\";\n\t\t\tbreak;\n\t\tcase \"user\": frame.setAttribute(\"class\",\"frame user\");\n\t\t\tif (parseInt(data[ICON])>=0 && parseInt(data[ICON])<10) {\n\t\t\tif (data[_KEY]===uUid) { drawable = parseInt(data[ICON]); }\n\t\t\t\tthumbnail.src = \"draw/av_face_\"+data[ICON]+\".svg\"; }\n\t\t\telse { thumbnail.src = data[ICON]; }\n\t\t\tbreak; }\n\t/* START: Card's text content */ \n\tvar content = document.createElement(\"div\");\n\tcontent.setAttribute(\"class\", \"content\"); \n\tvar link;\n\tswitch(tab) {\n\t\tcase \"media\":\n\t\t\tlink = document.createElement(\"a\");\n\t\t\tlink.href = \"javascript:mixing('\"+data[_KEY]+\"');\"; // jshint ignore:line\n\t\t\tbreak;\n\t\tcase \"playlist\":\n\t\t\tlink = document.createElement(\"div\");\n\t\t\tlink.onmouseover = link.style.cursor = \"pointer\";\n\t\t\tlink.onclick = function() { filters2 = [];\n\t\t\t\tvar items = document.getElementById(\"items3\");\n\t\t\t\tfor (var i=0; i<data[SEED].length; i++) {\n\t\t\t\t\tfilters2[filters2.length] = data[SEED][i]; }\n\t\t\t\tdocument.getElementById(\"tab3\").checked = true;\n\t\t\t\twake(pages[2]); \n\t\t\t\titems.insertBefore(nail(data[CALL],2),items.childNodes[0]); };\n\t\t\tbreak;\n\t\tcase \"user\": \n\t\t\tlink = document.createElement(\"div\");\n\t\t\tlink.onmouseover = link.style.cursor = \"pointer\";\n\t\t\tlink.onclick = function() { filters1 = [];\n\t\t\t\tvar items = document.getElementById(\"items2\");\n\t\t\t\tfor (var i=0; i<data[SEED].length; i++) {\n\t\t\t\t\tfilters1[filters1.length] = data[SEED][i]; }\n\t\t\t\tif (filters1.length>0) {\n\t\t\t\t\tdocument.getElementById(\"tab2\").checked = true;\n\t\t\t\t\twake(pages[1]); \n\t\t\t\t\titems.insertBefore(nail(data[CALL],1),items.childNodes[0]);\n\t\t\t\t} else { alert(\"User does not have any playlist\"); } };\n\t\t\tbreak; }\n\tlink.setAttribute(\"class\",\"card-link\");\n\tvar title = document.createElement(\"h3\");\n\ttitle.textContent = data[CALL];\n\tvar subtitle = document.createElement(\"h4\");\n\tvar sub = \"\", version = \"\";\n\tvar map, gradient;\n\tswitch(tab) {\n\t\tcase \"media\":\n\t\t\tif (data[AUTH]!==undefined) { sub += data[AUTH]; }\n\t\t\tif (data[FEAT]!==undefined) { sub += \" ft \" + data[FEAT]; }\n\t\t\tif (data[EDIT]!==undefined) { version += data[EDIT]; }\n\t\t\tif (data[JOCK]!==undefined) { \n\t\t\t\tif (version!==\"\") { version += \" \"; }\n\t\t\t\tversion += from[lang]+\" \"+data[JOCK]; }\n\t\t\tif (data[HOME]!==undefined) {\n\t\t\t\tif (version!==\"\") { version += \" \"; }\n\t\t\t\tversion += \"(\"+data[HOME]+\")\"; }\n\t\t\tif (data[GEEK]!==undefined) {\n\t \t\t\tif (version!==\"\") { version += \"; \"; }\n\t\t\t\tversion+=post[lang]+\" \"+data[GEEK]; }\n\t\t\tbreak;\n\t\tcase \"playlist\":\n\t\t\tif (data[AUTH]!==undefined) { sub += \"By \" + data[AUTH]; }\n\t\t\tbreak;\n\t\tcase \"user\":\n\t\t\tif (data[HOME]!==undefined) {\n\t\t\t\tsub += \"From \" + data[HOME]; }\n\t\t\t/* START: backgroundmap */\n\t\t\tif (data[HOME]!==undefined && data[HOME]!==\"\") {\n\t\t\t\tmap = document.createElement(\"div\");\n\t\t\t\tgradient = document.createElement(\"div\");\n\t\t\t\tmap.setAttribute(\"class\",\"map\");\n\t\t\t\tgradient.setAttribute(\"class\",\"linear-opacity\");\n\t\t\t\tarea(data[HOME],map,items3.clientWidth); // jshint ignore:line\n\t\t\t\tcontent.appendChild(map);\n\t\t\t\tcontent.appendChild(gradient);\n\t\t\t} /* END: backgroundmap */\n\t\t\tversion = data[PLUG];\n\t\t\tbreak; }\n\tsubtitle.textContent = sub;\n\t/* END: Card's text content */\n\tvar menu = document.createElement(\"aside\");\n\tmenu.setAttribute(\"class\",\"options\");\n\tvar pen = document.createElement(\"embed\");\n\tpen.alt = \"Editing icon\";\n\tpen.src = \"draw/ic_pen.svg\";\n\tpen.type = \"image/svg+xml\";\n\tvar editing = document.createElement(\"div\");\n\tediting.setAttribute(\"class\",\"editing\");\n\tpen.onload = function() { edit(editing, pen, undefined, tab); };\n\tpen.setAttribute(\"class\",\"icon\");\n\tvar play, next;\n\tvar inserting = document.createElement(\"div\");\n\tvar insert = document.createElement(\"embed\");\t\t\t\t \n\tif (tab!==\"user\") {\n\t\tnext = document.createElement(\"embed\");\n\t\tnext.alt = \"Play next icon\";\n\t\tnext.src = \"draw/ic_queue.svg\"; }\t \n\tswitch(tab) {\n\t\tcase \"media\":\n\t\t\tplay = document.createElement(\"embed\");\n\t\t\tplay.alt = \"Play icon\";\n\t\t\tplay.src = \"draw/ic_play.svg\";\n\t\t\tplay.type = \"image/svg+xml\";\n\t\t\tplay.onload = function() { over(play).onclick = function() {\n\t\t\t\tmixing(data[_KEY]); }; }; // jshint ignore:line\n\t\t\tif (!admin && !pro) { pen.style.height = \"0\"; }\n\t\t\tif (wired) { bill(inserting, insert, data[_KEY], tab); }\n\t\t\tnext.onload = function() { over(next,false).onclick = function() {\n\t\t\t\tplaylst[playlst.length] = data[_KEY]; // jshint ignore:line\n\t\t\t\tjoin(); }; };\n\t\t\tmenu.appendChild(play);\t\n\t\t\tmenu.appendChild(next);\t\n\t\t\tbreak;\n\t\tcase \"playlist\": \n\t\t\tif (!admin && data[_KEY].substring(0,data[_KEY].indexOf(\"-\"))!==uUid) {\n\t\t\t\tpen.style.height = \"0\";\t}\n\t\t\tif (wired) { bill(inserting, insert, data[_KEY], tab); }\n\t\t\tnext.onload = function() { over(next,false).onclick = function() {\n\t\t\t\tdata[SEED].forEach( function(item) {\n\t\t\t\t\tplaylst[playlst.length] = item; }); // jshint ignore:line\n\t\t\t\tjoin(); }; };\n\t\t\tmenu.appendChild(next);\n\t\t\tbreak;\n\t\tcase \"user\": if (uUid!==data[_KEY] && !admin) { pen.style.height = \"0\"; }\n\t\t\tbreak; }\n\tnode.appendChild(main);\n\t/**/ main.appendChild(frame);\n\t/*--*/ frame.appendChild(thumbnail);\t\t\t \n\t/**/ main.appendChild(content);\n\t/*--*/ content.appendChild(link);\n\t/*----*/ link.appendChild(title);\n\t/*----*/ link.appendChild(subtitle);\n\t/*----*/ link.appendChild(document.createTextNode(version));\t\t\t\t\t \n\tnode.appendChild(aside);\n\t/**/ main.appendChild(menu);\n\t/*--*/ menu.appendChild(pen);\n\t/*--*/ menu.appendChild(insert); \n\tnode.appendChild(inserting);\n\tnode.appendChild(editing);\n\treturn node;\n}", "title": "" }, { "docid": "ac2f4be25089d9e3d8339d4bc72bd10c", "score": "0.6024249", "text": "function cartElement(item) {\n return `<div class=\"item\">\n <div class=\"remove-buttons\">\n <span class=\"delete-btn\" data-name=${item.title}></span>\n </div>\n \n <div class=\"image\">\n <img class=\"image\" src=\"${item.cover}\" alt=\"\" />\n </div>\n \n <div class=\"description\">\n <span>${item.title}</span>\n <span>${item.artist}</span>\n <span>${item.genre}</span>\n </div>\n <div class=\"total-price\">$${item.price}</div>\n </div>`\n}", "title": "" }, { "docid": "ab5b40b5d850e35d56b3de0ad931c237", "score": "0.601857", "text": "function admin_create_card(book_list){\n var card_contents = \"\";\n card_contents += '<div id=' + book_list[0] + '>'\n card_contents += \"<span class='card_txt'> \" + book_list[1] + book_list[6] + ' - ' + book_list[2] + \" </span><br>\"\n card_contents += '<span> ' + book_list[3] + ' </span><br>'\n card_contents += '<span> ' + (Number(book_list[4]) - Number(book_list[5])).toString() + ' / ' + book_list[4] + ' </span><br>'\n card_contents += '<span><button type=\"button\" class=\"btn btn-outline-info edit\" style=\"margin-right:0.2vw\">修改</button></span>'\n card_contents += '<span><button type=\"button\" class=\"btn btn-outline-danger remove\">移除</button></span>'\n card_contents +='</div>'\n return card_contents\n}", "title": "" }, { "docid": "0fa565213fde91d6c9bcfc4c9b12cab9", "score": "0.601826", "text": "function addCards() {\n for (let i=0; i<16; i++) {\n var newDiv = document.createElement('div');\n newDiv.classList.add('card');\n var newContent = document.createTextNode('Hello');\n newDiv.appendChild(newContent);\n newDiv.id = 'card'.concat(i+1);\n newDiv.innerHTML = \"<i class=\\\"fas fa-\"+array1[i][0]+\"\\\"></i>\";\n newDiv.style.color= array1[i][1];\n var parentDiv = document.getElementById(\"deck\");\n parentDiv.insertBefore(newDiv, null);\n }\n}", "title": "" } ]
f7074f7798be31849b141f6b2732232c
Given a component and a configuration object, add the route to this registry
[ { "docid": "b0594ee502a3f4dd81caf3b3e53d248b", "score": "0.59766316", "text": "config(parentComponent, config) {\r\n config = normalizeRouteConfig(config, this);\r\n // this is here because Dart type guard reasons\r\n if (config instanceof Route) {\r\n assertComponentExists(config.component, config.path);\r\n }\r\n else if (config instanceof AuxRoute) {\r\n assertComponentExists(config.component, config.path);\r\n }\r\n var recognizer = this._rules.get(parentComponent);\r\n if (isBlank(recognizer)) {\r\n recognizer = new ComponentRecognizer();\r\n this._rules.set(parentComponent, recognizer);\r\n }\r\n var terminal = recognizer.config(config);\r\n if (config instanceof Route) {\r\n if (terminal) {\r\n assertTerminalComponent(config.component, config.path);\r\n }\r\n else {\r\n this.configFromComponent(config.component);\r\n }\r\n }\r\n }", "title": "" } ]
[ { "docid": "2c37382318efd8b96522a4ac4f0d8342", "score": "0.6491577", "text": "_register(config, routes, parentRoute) {\n routes = routes ? routes : this._routes;\n for (let i = 0; i < config.length; i++) {\n let { onEnter, onExit, path, outlet, children, defaultRoute = false, defaultParams = {} } = config[i];\n let [parsedPath, queryParamString] = path.split('?');\n let queryParams = [];\n parsedPath = this._stripLeadingSlash(parsedPath);\n const segments = parsedPath.split('/');\n const route = {\n params: [],\n outlet,\n path: parsedPath,\n segments,\n defaultParams: parentRoute ? Object.assign({}, parentRoute.defaultParams, defaultParams) : defaultParams,\n children: [],\n fullPath: parentRoute ? `${parentRoute.fullPath}/${parsedPath}` : parsedPath,\n fullParams: [],\n fullQueryParams: [],\n onEnter,\n onExit\n };\n if (defaultRoute) {\n this._defaultOutlet = outlet;\n }\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n if (typeof segment === 'string' && segment[0] === '{') {\n route.params.push(segment.replace('{', '').replace('}', ''));\n segments[i] = PARAM;\n }\n }\n if (queryParamString) {\n queryParams = queryParamString.split('$').map((queryParam) => {\n return queryParam.replace('{', '').replace('}', '');\n });\n }\n route.fullQueryParams = parentRoute ? [...parentRoute.fullQueryParams, ...queryParams] : queryParams;\n route.fullParams = parentRoute ? [...parentRoute.fullParams, ...route.params] : route.params;\n if (children && children.length > 0) {\n this._register(children, route.children, route);\n }\n this._outletMap[outlet] = route;\n routes.push(route);\n }\n }", "title": "" }, { "docid": "5e050251618baa06fcaec19cc72c4e2e", "score": "0.612301", "text": "registerRoute(route) {\n this.routeSlot.register(route);\n return this;\n }", "title": "" }, { "docid": "eed78ce1e7850b744edba7261b844943", "score": "0.6050261", "text": "addRoute(method, route, handler) {\n this.routes.add({\n method,\n route,\n handler,\n });\n }", "title": "" }, { "docid": "625ba76a56169a2e36b3044a5ea7bf29", "score": "0.5960645", "text": "addRoute(endpoint, token) {\n if (this.injector.hasProvider(token)) {\n const provider = this.injector.getProvider(token);\n const route = provider.getEndpointUrl(endpoint);\n if (!provider.hasParent()) {\n this._routes.push({\n route,\n provider\n });\n this.expressApplication.use(route, provider.router);\n }\n }\n return this;\n }", "title": "" }, { "docid": "126ab5d835becb428d476c4853d0a87a", "score": "0.5938185", "text": "function addRoute(path, templateId, controller) {\n routes[path] = { templateId:templateId, controller:controller };\n}", "title": "" }, { "docid": "b514acce8ef4c2ef2c50c63b67bddf6a", "score": "0.5907995", "text": "addRoute(route, callback) {\n this.routes[route] = callback;\n }", "title": "" }, { "docid": "376ff041d048fc5427eea51d939ffd24", "score": "0.5847678", "text": "static addRoute(handler, route) {\n let list;\n if (!(list = this.routes.get(handler))) {\n this.routes.set(handler, (list = []));\n }\n list.push(route);\n }", "title": "" }, { "docid": "dd3b049be88314d4f5d89d0539bf7eca", "score": "0.5684285", "text": "makeRoute (route, options) {\n\t\troute = Object.assign({}, route); // we don't want to alter the defined constants, so make a copy\n\t\tif (options.want.includes(route.id)) {\n\t\t\t// module wants this route\n\t\t\troute.requestClass = options.requestClasses[route.id] || route.requestClass;\n\t\t\troute.path = route.path.replace('$BASE', options.baseRouteName);\t// baseRouteName provided by the derived class\n\t\t\tthis.routes.push(route);\n\t\t}\n\t}", "title": "" }, { "docid": "20920dc6a07ef65679eefdb731d6b37f", "score": "0.5680914", "text": "function _add_handler( params ) {\n var route = params.route;\n\n // simple string matching\n if ( typeof route === 'string' )\n params.route = function( url ) {\n return (url+'').toLowerCase() == route;\n };\n\n // using a regular expression\n else if ( route instanceof RegExp )\n params.route = function( url ) {\n return (url+'').toLowerCase().match( route );\n };\n\n // save the location\n if ( params.resources ) $resources = params;\n else $handlers.push( params );\n}", "title": "" }, { "docid": "5eea713380a863341f791344b3d2ff94", "score": "0.5676877", "text": "buildCustomRoutes (config, footprintRoutes) {\n return lib.Transformer.mergeCustomRoutes(config.routes, footprintRoutes)\n }", "title": "" }, { "docid": "0bb3d8b43dcd263211cfc5ff2ec25b80", "score": "0.5626492", "text": "addRoute(method, route, ...handlers) {\n this.routes.add({\n method,\n route,\n handlers\n });\n }", "title": "" }, { "docid": "a04a40a2e444358b3587bb80041eeea6", "score": "0.5599141", "text": "configFromComponent(component) {\r\n if (!isType(component)) {\r\n return;\r\n }\r\n // Don't read the annotations from a type more than once –\r\n // this prevents an infinite loop if a component routes recursively.\r\n if (this._rules.has(component)) {\r\n return;\r\n }\r\n var annotations = reflector.annotations(component);\r\n if (isPresent(annotations)) {\r\n for (var i = 0; i < annotations.length; i++) {\r\n var annotation = annotations[i];\r\n if (annotation instanceof RouteConfig) {\r\n let routeCfgs = annotation.configs;\r\n routeCfgs.forEach(config => this.config(component, config));\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "1dd031fe2db0d61cbaad500a25089d47", "score": "0.558839", "text": "route() {\n for (const routeConfig of this.getRouteConfigsFromManifest()) {\n if (\n // Only listen for browser cached routes:\n (routeConfig.maxAgeSeconds && routeConfig.maxAgeSeconds > 0) ||\n // or for routes that return an x-0-upstream-requests header:\n routeConfig.prefetchUpstreamRequests) {\n this.createRoute(routeConfig);\n }\n else if (routeConfig.returnsResponse) {\n // register routes that return responses to force a network call and prevent\n // a later route from matching and caching non-cacheable routes:\n workbox_routing_1.registerRoute(this.shouldIntercept(new RegExp(routeConfig.pattern, 'i'), routeConfig.isPartialPathRoute), new workbox_strategies_1.NetworkOnly({\n plugins: [this.createDevtoolsPlugin(routeConfig)],\n }));\n }\n }\n return this;\n }", "title": "" }, { "docid": "a01d662bbccd592269337a4fed01544e", "score": "0.55821127", "text": "function registerRoute(method,route){\n \"use strict\";\n objectFactory.discoveryService.registerFixedRoute(method,route);\n}", "title": "" }, { "docid": "e417bdb13a9198603ab519451ff6550c", "score": "0.55659467", "text": "add(...routes) {\n for (const route of routes) {\n const entry = this.insertEntries(this.splitPath(route.path), route.constraint || {});\n const event = { environment: route.environment, callback: route.onMatch };\n if (route.exact) {\n entry.exact.push(event);\n }\n else {\n entry.partial.push(event);\n }\n }\n return this;\n }", "title": "" }, { "docid": "f244d6c87bb80941c327f746fcccb52c", "score": "0.5551879", "text": "function addSiteRoute ({content,url}) {\n processPage(content).then(contents => {\n\n // construct the new route object\n let new_route = {\n path: url, \n meta: {\n initial_path: url,\n ...contents.meta\n },\n query: {},\n component: {\n template: contents.template\n }\n };\n\n // Add to global route object\n window.addToRouteObject(new_route);\n\n // Add the new route data\n if (window.sambar.vue && window.sambar.vue.$router)\n window.sambar.vue.$router.addRoutes([new_route]);\n else window.sambar.routes_to_add.push(new_route);\n\n });\n}", "title": "" }, { "docid": "f80a91c14031b15a8c06f40487ae947e", "score": "0.55327135", "text": "function add_endpoint(url, route1, route2, route3, route4){\n routes = [route1,route2,route3,route4].filter(function(d){return d != undefined;});\n all_routes[url] = routes[routes.length-1];\n}", "title": "" }, { "docid": "c52e48eaabb0b7f99cd9b716f04a949c", "score": "0.5497409", "text": "addRoute (resourceIndex, routeObj = this.emptyRoute) {\n let newRoute = Object.assign({}, this.emptyRoute, routeObj)\n this.setState(prev => {\n return {\n ...prev,\n template: {\n ...prev.template,\n template_object: {\n ...prev.template.template_object,\n resources: prev.template.template_object.resources.map((resource, index) => {\n if (index === resourceIndex) return { ...resource, routes: [...resource.routes, newRoute] }\n return resource\n })\n }\n }\n }\n })\n }", "title": "" }, { "docid": "480a16138078ac1c0a22754babe39d1d", "score": "0.54915684", "text": "function router() {\n\n var path = location.hash;\n\n var ele;\n var pathObj = parsePath(path);\n if (!routes[pathObj.pathPrefix]) { // the pathPrefix of the URL was never registered in the routing table\n\n ele = document.createElement(\"div\");\n ele.innerHTML = \"<p>Error: unknown link '\" + pathObj.pathPrefix\n + \"' was never added to the routing table.</p>\";\n\n } else if (pathObj.param.length > 0) { // if this URL has a parameter after the last /\n\n // Invoke the function that's stored in the routing table, passing in the parameter. \n ele = routes[pathObj.pathPrefix](pathObj.param);\n\n } else { // This is a \"regular\" URL with no parameters, so dont pass any parameters into \n // the single use component.\n var ele = routes[pathObj.pathPrefix](); // returns DOM element from the function stored in the routes associative array\n }\n\n inject(ele);\n } // router", "title": "" }, { "docid": "20fd4c1088c1f98ab2eb75ab134ec0e7", "score": "0.5439499", "text": "add(routes, navigate = this.isRoot && this.isConnected) {\n // Add the routes to the array\n this._routes.push(...routes);\n // Register that the path has changed so the correct route can be loaded.\n if (navigate) {\n this.render().then();\n }\n }", "title": "" }, { "docid": "e6afd3870124d0cc36b2cb1a6dccfab7", "score": "0.5430376", "text": "add(path, ...steps) {\n const route = new Route(this.basePath, path, steps);\n this.routes.push(route);\n return route;\n }", "title": "" }, { "docid": "e9f74059e14c79ed29f3e044cebff523", "score": "0.538195", "text": "_configureRoute(route, path) {\n let menuPath = path || route.path || '#';\n\n //check to see if route is public and, if not, check if user is logged in before resolving\n if(route.public !== true) {\n this._onEnterCheckAuth(route);\n }\n\n //create menu config object and add to array that we'll use to generate menu.\n if (route.nav) {\n var menuConfigObj = {};\n menuConfigObj.nav = route.nav;\n menuConfigObj.name = route.name ? route.name : 'name' + this._mainMenuItems.length++;\n menuConfigObj.url = menuPath;\n menuConfigObj.children = [];\n\n this._mainMenuItems.push(menuConfigObj);\n }\n\n if (route.indexRoute) {\n this._configureRoute(route.indexRoute, route.path);\n }\n\n if (route.childRoutes) {\n route.childRoutes.forEach(function(childRoute) {\n this._configureRoute(childRoute);\n }, this);\n }\n }", "title": "" }, { "docid": "cf16e7d0da9d533767080c71ef4c86eb", "score": "0.5352547", "text": "on(path, rules = {}, action) {\n this._routes.push(new OWebRoute(path, rules, action));\n return this;\n }", "title": "" }, { "docid": "6a1277e85ef7c836562bc6d320d6fba7", "score": "0.532007", "text": "attach(ref, activatedRoute) {\n this.activated = ref;\n this._activatedRoute = activatedRoute;\n this.location.insert(ref.hostView);\n }", "title": "" }, { "docid": "6a1277e85ef7c836562bc6d320d6fba7", "score": "0.532007", "text": "attach(ref, activatedRoute) {\n this.activated = ref;\n this._activatedRoute = activatedRoute;\n this.location.insert(ref.hostView);\n }", "title": "" }, { "docid": "6a1277e85ef7c836562bc6d320d6fba7", "score": "0.532007", "text": "attach(ref, activatedRoute) {\n this.activated = ref;\n this._activatedRoute = activatedRoute;\n this.location.insert(ref.hostView);\n }", "title": "" }, { "docid": "6a1277e85ef7c836562bc6d320d6fba7", "score": "0.532007", "text": "attach(ref, activatedRoute) {\n this.activated = ref;\n this._activatedRoute = activatedRoute;\n this.location.insert(ref.hostView);\n }", "title": "" }, { "docid": "6a1277e85ef7c836562bc6d320d6fba7", "score": "0.532007", "text": "attach(ref, activatedRoute) {\n this.activated = ref;\n this._activatedRoute = activatedRoute;\n this.location.insert(ref.hostView);\n }", "title": "" }, { "docid": "1dc478b1d3528daa5fb1ad74309043ba", "score": "0.53153485", "text": "function addToRegister(data) {\n if (data.middleware) {\n data.middleware.forEach(function (middleware) {\n router[data.method](data.path, middleware);\n })\n }\n if (!register[data.path]) register[data.path] = {};\n var path = register[data.path];\n path[data.method] = data.fn;\n}", "title": "" }, { "docid": "300055dc8a48787c5d68cd8cc05a3e03", "score": "0.5296232", "text": "function addRoute(route, callback, scope){\n\t\t\n\t\t//create a consistant signature that \n\t\t//we can rely on later\n\t\tvar routeObj = {\n\t\t\troute: route,\n\t\t\tcallback: callback,\n\t\t\tscope: scope\n\t\t};\n\t\t\n\t\troutes.push(routeObj);\n\t}", "title": "" }, { "docid": "60a838c11c8098afae20f0a2634f5fd9", "score": "0.5290871", "text": "addRoute(method, path, ...handlers) {\n this.routes.push({\n method: method,\n path: path,\n handlers: handlers\n });\n }", "title": "" }, { "docid": "d44a0cd2f5d17b8e8039d3872d844e12", "score": "0.52889264", "text": "addRoute(id, props) {\n const route = new route_1.Route(this, id, {\n ...props,\n routeName: id,\n mesh: this.mesh,\n virtualRouter: this,\n });\n return route;\n }", "title": "" }, { "docid": "8cf9ecfcc1fd51e66d091df210917d44", "score": "0.5281012", "text": "registerRouteContext(context){\n\t\tBackbone__default.history.route(context.route, context.callbackWrapper, context);\n\t}", "title": "" }, { "docid": "59de162e15300129a9fa7982de362aa9", "score": "0.52714735", "text": "$registerRouter() {\n this.$container.singleton('Adonis/Core/Route', () => {\n return this.$container.use('Adonis/Core/Server').router;\n });\n }", "title": "" }, { "docid": "776cd2423082dc0f637b7d12656cb46d", "score": "0.52659446", "text": "addRoutes(router) {\n this._addRoute(router.get, this.get);\n this._addRoute(router.post, this.post);\n this._addRoute(router.delete, this.delete);\n }", "title": "" }, { "docid": "733886f41a71379a397364ea44ffdc17", "score": "0.5252429", "text": "includeRoutes(){\n new routes(this.app).routesConfig();\n new socketEvents(this.socket).socketConfig();\n }", "title": "" }, { "docid": "a7e48beafd4ec5e6f70de0b50c4e87c9", "score": "0.52500165", "text": "function setupEmbedApi (routeName, component) {\n const listener = async (event) => {\n const router = Router.get()\n let route = router.currentRoute.value\n const data = event.data\n let result, component, interval\n // If event received but the current route does not match the new route is pushed first\n if (route.name !== routeName) {\n // Need to wait until route has really changed, component has been initialized, etc.\n await new Promise((resolve, reject) => router.push({ name: routeName, query: Object.assign({}, route.query) }, resolve))\n await new Promise((resolve, reject) => {\n interval = setInterval(() => {\n route = router.currentRoute\n component = getEmbedComponent(route)\n if (component) resolve()\n }, 100)\n })\n clearInterval(interval)\n }\n // If no payload this was just a route change\n if (data) {\n result = (data.command ? await callEmbedMethod(route, data) : getEmbedProperty(route, data))\n }\n return result\n }\n // Listen to an event named according to current route name\n postRobot.on(routeName, listener)\n // This is for backward compatibility because at some point we have changed route naming\n // in order to make activities configurable (see https://github.com/kalisio/kano/issues/154)\n // eg 'map' => 'map-activity'\n if (routeName.endsWith('-activity')) postRobot.on(routeName.replace('-activity', ''), listener)\n}", "title": "" }, { "docid": "9b892caff937a8fd455f9ce8e714c464", "score": "0.5183969", "text": "includeRoutes() {\n new router(this.app).routesConfig();\n new socketEvents(this.socket).socketConfig();\n }", "title": "" }, { "docid": "575dc454938866976d500105fed77e5c", "score": "0.51831007", "text": "_addRoute(from, to) {\n Object.values(from._patternEvents).forEach((f, i) => {\n if (typeof f !== 'function') return;\n\n let pattern = Object.keys(from._patternEvents)[i];\n let reg = pattern.substr(1, pattern.length - 2);\n\n to.on(new RegExp(reg), f);\n });\n }", "title": "" }, { "docid": "95279fd1dce0ad2afdaf8509026410be", "score": "0.518018", "text": "configureRoutes() {\n this.configureIndexBackups();\n this.configureBackupParamChecker();\n this.configureCreateBackup();\n this.configureGetBackup();\n this.configureDeleteBackup();\n this.configureDownloadBackup();\n this.configureUpload();\n }", "title": "" }, { "docid": "fb593822d6578f08166fa295f7b1e78b", "score": "0.51599085", "text": "function registerRoute(name, path) {\n\n path = mountpath + path;\n if (path.length > 1 && path.slice(-1) === \"/\") {\n path = path.slice(0, -1);\n }\n\n assert(!namedRoutes.hasOwnProperty(name), \"A route already exists for the name '\" + name + \"'\");\n debug(\"registering name %s for %s\", name, path);\n\n namedRoutes[name] = path;\n }", "title": "" }, { "docid": "56ddcdc08ce471dacce2f4a796c6a450", "score": "0.5159084", "text": "registerRoute(route) {\n if (!this.asset.route) {\n this.asset.route = route;\n this._emitChange('route');\n if (+this.asset.route.snapshot.params.id) {\n if (!this.asset.core.entity || +this.asset.core.entity.id !== +this.asset.route.snapshot.params.id) {\n this.resetTab(true);\n // this.refreshEntity( this.asset.route.snapshot.params.id, this.asset.dom, null, `${this.name}:registerRoute:conflict` ).then( () => this.resetTab() );\n }\n }\n }\n }", "title": "" }, { "docid": "3a75b2915d4c409bf43fb386988e8d8f", "score": "0.5146538", "text": "function getRouteFor(component, basePaths, __baseDir, logger) {\n //first we try to give back the common plugin/modules\n return function (req, res) {\n res.sendFile(path.join(__baseDir, req.path), function (err) {\n if (err && err.code !== 'ECONNRESET') {\n //this means that it is probably plugin/pluginName or plugin/pluginName/relativePath format\n // so we try to look for those in our config\n //first we check if we have the plugin registered in our config\n var urlArray = req.url.split('/'),\n pluginName = urlArray[2] || null,\n basePath,\n relPath;\n\n urlArray.shift();\n urlArray.shift();\n relPath = urlArray.join('/');\n if (!path.extname(relPath)) { // js file by default\n relPath += '.js';\n }\n basePath = getBasePathByName(pluginName, basePaths);\n\n if (typeof basePath === 'string' && typeof relPath === 'string') {\n expressFileSending(res, path.resolve(path.join(basePath, relPath)), logger);\n } else {\n res.sendStatus(404);\n }\n }\n });\n };\n}", "title": "" }, { "docid": "21be853562069a4191ae37df57404148", "score": "0.51351297", "text": "addRoute(route, name, callback, opts = {}){\n\t\tif(opts.isRouteChaining == null)\n\t\t\topts.isRouteChaining = this.getOption('isRouteChaining');\n\n\t\tlet context = this.route(route, name, callback, opts);\n\t\treturn context;\n\t}", "title": "" }, { "docid": "2938d78a695963fef380a5352adfe4ba", "score": "0.5129782", "text": "createDevtoolsRoute(routeConfig) {\n let method, routeMatcher;\n if (routeConfig) {\n const { pattern, isPartialPathRoute } = routeConfig;\n const patternRegexp = new RegExp(pattern, 'i');\n routeMatcher = this.shouldIntercept(patternRegexp, isPartialPathRoute, { skipAssets: true });\n method = (routeConfig.method || 'get').toUpperCase();\n }\n else {\n routeMatcher = this.shouldIntercept(/^.*$/, true, { skipAssets: true });\n method = 'GET';\n }\n workbox_routing_1.registerRoute(routeMatcher, new workbox_strategies_1.NetworkOnly({\n plugins: [this.createDevtoolsPlugin(routeConfig)],\n }), \n // @ts-ignore\n method);\n }", "title": "" }, { "docid": "51716a79b01409666d7491174687980e", "score": "0.5105697", "text": "function addRoutes(api) {\n api.post('/config.json', getConfig);\n api.get('/validate', validate);\n}", "title": "" }, { "docid": "5c8b51bccbc455cceb7bdac4941c996a", "score": "0.5104562", "text": "function registerRoute(path, method, handlerObject) {\n parseHandlerObjectFunctions(handlerObject);\n var handler = createHandler(handlerObject, path);\n //Check if this route requires authentication.\n //If so, create an additional authenticationHandler.\n //Authroutes can have the following formats:\n // - /some/path (authenticates all methods)\n // - GET:/some/path (authenticates only GET requests)\n var authRouteInfo =\n authRoutes[method.toUpperCase() + ':' + path] ||\n authRoutes[path];\n if (authRouteInfo) {\n var authHandler = createAuthHandler(authRouteInfo);\n //When passed an array of handlers, restify will call them in order.\n handler = [authHandler, handler];\n virgilio.log.info('registering authenticated http endpoint: %s %s',\n method.toUpperCase(), path);\n }\n else {\n virgilio.log.info('registering http endpoint: %s %s',\n method.toUpperCase(), path);\n }\n //Register this route with the restify server.\n server[method](path, handler);\n //Inform the application of the new route.\n virgilio.publish('http.newRoute', path, method);\n }", "title": "" }, { "docid": "f5af26f8f8035d78502f7ec5a22405af", "score": "0.5103415", "text": "function normalizeRouteConfig(config, registry) {\r\n\t if (config instanceof route_config_decorator_1.AsyncRoute) {\r\n\t var wrappedLoader = wrapLoaderToReconfigureRegistry(config.loader, registry);\r\n\t return new route_config_decorator_1.AsyncRoute({\r\n\t path: config.path,\r\n\t loader: wrappedLoader,\r\n\t name: config.name,\r\n\t data: config.data,\r\n\t useAsDefault: config.useAsDefault\r\n\t });\r\n\t }\r\n\t if (config instanceof route_config_decorator_1.Route || config instanceof route_config_decorator_1.Redirect || config instanceof route_config_decorator_1.AuxRoute) {\r\n\t return config;\r\n\t }\r\n\t if ((+!!config.component) + (+!!config.redirectTo) + (+!!config.loader) != 1) {\r\n\t throw new exceptions_1.BaseException(\"Route config should contain exactly one \\\"component\\\", \\\"loader\\\", or \\\"redirectTo\\\" property.\");\r\n\t }\r\n\t if (config.as && config.name) {\r\n\t throw new exceptions_1.BaseException(\"Route config should contain exactly one \\\"as\\\" or \\\"name\\\" property.\");\r\n\t }\r\n\t if (config.as) {\r\n\t config.name = config.as;\r\n\t }\r\n\t if (config.loader) {\r\n\t var wrappedLoader = wrapLoaderToReconfigureRegistry(config.loader, registry);\r\n\t return new route_config_decorator_1.AsyncRoute({\r\n\t path: config.path,\r\n\t loader: wrappedLoader,\r\n\t name: config.name,\r\n\t useAsDefault: config.useAsDefault\r\n\t });\r\n\t }\r\n\t if (config.aux) {\r\n\t return new route_config_decorator_1.AuxRoute({ path: config.aux, component: config.component, name: config.name });\r\n\t }\r\n\t if (config.component) {\r\n\t if (typeof config.component == 'object') {\r\n\t var componentDefinitionObject = config.component;\r\n\t if (componentDefinitionObject.type == 'constructor') {\r\n\t return new route_config_decorator_1.Route({\r\n\t path: config.path,\r\n\t component: componentDefinitionObject.constructor,\r\n\t name: config.name,\r\n\t data: config.data,\r\n\t useAsDefault: config.useAsDefault\r\n\t });\r\n\t }\r\n\t else if (componentDefinitionObject.type == 'loader') {\r\n\t return new route_config_decorator_1.AsyncRoute({\r\n\t path: config.path,\r\n\t loader: componentDefinitionObject.loader,\r\n\t name: config.name,\r\n\t useAsDefault: config.useAsDefault\r\n\t });\r\n\t }\r\n\t else {\r\n\t throw new exceptions_1.BaseException(\"Invalid component type \\\"\" + componentDefinitionObject.type + \"\\\". Valid types are \\\"constructor\\\" and \\\"loader\\\".\");\r\n\t }\r\n\t }\r\n\t return new route_config_decorator_1.Route(config);\r\n\t }\r\n\t if (config.redirectTo) {\r\n\t return new route_config_decorator_1.Redirect({ path: config.path, redirectTo: config.redirectTo });\r\n\t }\r\n\t return config;\r\n\t}", "title": "" }, { "docid": "9688a192a77d58b01d554c393f68bfde", "score": "0.5099574", "text": "function addRoute() {\n routes.addRoute(vm.formInfo, user.getUser().username)\n .then(function() {\n // clear form data\n vm.formInfo.methodKeys.length = 0;\n vm.formInfo.methods = {};\n vm.formInfo.route = '';\n vm.formInfo.persistence = false;\n });\n }", "title": "" }, { "docid": "b027494629f67dab2834ab4be9f48ad2", "score": "0.50820327", "text": "configureRouter(config, router){\r\n config.map([\r\n \r\n //hotlinks for \r\n // popular => likes, options to view by date - by date 1 month, 3 months, 1 year, all time ? recently popular, all time popular popular = likes\r\n // trending = views, w/ likes, only recent from past 1 week\r\n // newest = (newest)\r\n // these are different native search and order by thingies\r\n // recomended = ones you havent played yet that are well liked\r\n // \r\n // browse options: popular, trending, newest, reccomended\r\n // \r\n // my options: completed, favorites, play later\r\n //\r\n // search\r\n { route: ['','browse'], name: 'browse', moduleId: './browse/router', nav: true, title:'Browse' } // popular?\r\n // ,{ route: 'recent', name: 'recent', moduleId: './recent', nav: true, title:'recent' } //newest?\r\n ,{ route: 'completed', name: 'completed', moduleId: './completed', nav: true, title:'Completed' } \r\n ,{ route: 'favorites', name: 'favorites', moduleId: './favorites', nav: true, title:'Favorites' }\r\n ,{ route: 'search', name: 'search', moduleId: './search/basic', nav: true, title:'Search' } \r\n ,{ route: 'search-adv', name: 'search-adv', moduleId: './search/detailed', nav: false, title:'Advanced Search' } \r\n\r\n ]); \r\n\r\n this.router = router;\r\n }", "title": "" }, { "docid": "fb79b7622cbda08cdca4eb02bbc89172", "score": "0.50609", "text": "function _deploySingleRoute(router,configurationService,routeName){\r\n configurationService.getPropertiesJsonByRoot(ROUTE_PREFIX + routeName,\r\n function onGet(error,routeConf) {\r\n console.log(MODULE_NAME + ' deploying route: ' + routeName + '[' + JSON.stringify(routeConf) + ']');\r\n\r\n // instantiate the module for the route management\r\n var moduleRoute = routeConf.module || OPERATION_ROUTE;\r\n var Worker = require(_getFileService().getPath(moduleRoute));\r\n var invoke = null;\r\n\r\n // eventually skip\r\n if(routeConf.skip=='enabled') {\r\n console.log(MODULE_NAME + ': %s skipped by conf', routeConf.pattern);\r\n \r\n }else{\r\n\r\n // apply protection\r\n if (routeConf.protected) {\r\n if (!process.env.DISABLEJWT) {\r\n router.use(routeConf.pattern, _getSecurityMiddleware());\r\n }\r\n }\r\n\r\n // apply special middlewares\r\n if (routeConf.middleware) {\r\n var middlewareList = routeConf.middleware.split(',');\r\n for (var i = 0; i < middlewareList.length; i++) {\r\n var Middleware = require(_getFileService().getPath(middlewareList[i]));\r\n router.use(routeConf.pattern, Middleware);\r\n }\r\n }\r\n\r\n // frequent error\r\n if (routeConf.patter) {\r\n console.error('WARNING: RIGHT USE IS PATTERN, NOT PATTER')\r\n }\r\n\r\n // if needed, allocate a new instance of the worker\r\n //if(routeConf.newinstance){\r\n try {\r\n var instance = new Worker(routeConf);\r\n invoke = instance.invoke;\r\n } catch (legacyCodeError) {\r\n if (legacyCodeError.message === 'object is not a function' || legacyCodeError.message === 'Worker is not a function') {\r\n invoke = Worker.invoke;\r\n } else {\r\n throw legacyCodeError;\r\n }\r\n }\r\n\r\n if (routeConf.method === 'GET') {\r\n router.get(routeConf.pattern, invoke);\r\n } else if (routeConf.method === 'POST') {\r\n router.post(routeConf.pattern, invoke);\r\n } else if (routeConf.method === 'DELETE') {\r\n router.delete(routeConf.pattern, invoke);\r\n } else if (routeConf.method === 'PUT') {\r\n router.put(routeConf.pattern, invoke);\r\n }\r\n\r\n require('../objectFactory/ObjectFactory').discoveryService.registerDynamicRoute(routeConf.method, routeConf.pattern);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "b5d8e3751bc6135bbbdaeeb7de46ae8c", "score": "0.50568986", "text": "function withRouter(Com) {\n var C = function (props) {\n var wrappedComponentRef = props.wrappedComponentRef;\n var rest = objectWithoutProperties$3(props, [\"wrappedComponentRef\"]);\n var remainingProps = rest;\n return Object(__WEBPACK_IMPORTED_MODULE_0_inferno__[\"b\" /* createComponentVNode */])(4\n /* ComponentClass */\n , Route, {\n render: function render(routeComponentProps) {\n return Object(__WEBPACK_IMPORTED_MODULE_0_inferno__[\"b\" /* createComponentVNode */])(2\n /* ComponentUnknown */\n , Com, combineFrom(remainingProps, routeComponentProps), null, wrappedComponentRef);\n }\n });\n };\n\n C.displayName = \"withRouter(\" + (Com.displayName || Com.name) + \")\";\n C.WrappedComponent = Com;\n return __WEBPACK_IMPORTED_MODULE_3_hoist_non_inferno_statics___default()(C, Com);\n}", "title": "" }, { "docid": "1da581b5c5c567649dd9836f1ed55875", "score": "0.50449616", "text": "set routes(routes){\n for(let route of routes){\n customElements.define(route.selector,route.component);\n this.#Routes.push({\n path:route.path,\n selector:route.selector\n })\n }\n }", "title": "" }, { "docid": "7b3da56d37d716ea14e07646e1b32f94", "score": "0.5036813", "text": "addPutRoute(route, handler) {\n this.addRoute('put', route, handler);\n }", "title": "" }, { "docid": "770552775acf7d74b3c82bb1277920dd", "score": "0.5033329", "text": "addGatewayRoute(id, props) {\n return new gateway_route_1.GatewayRoute(this, id, {\n ...props,\n virtualGateway: this,\n });\n }", "title": "" }, { "docid": "a79ce7c78944701393ae7b2407ef99d6", "score": "0.502077", "text": "function DefineRouteWrapper(route) {\n const fun = function () {}\n fun.value = route\n return fun\n}", "title": "" }, { "docid": "2e1aa653c8215a9ac3c768d2d6467583", "score": "0.5015831", "text": "add(thing, ...path) {\n if (!thing || typeof thing !== \"object\") {\n throw new TypeError(\"registry.add(\"+thing+\",\",path,\"): thing to add must be an object\");\n }\n if (!path.length || !path.every(step => (typeof step === \"string\" || typeof step === \"number\"))) {\n throw new TypeError(\"registry.add(\"+thing+\",\",path,\"): path must be strings!\");\n }\n return (this.__REGISTRY__[path.join(\"/\")] = thing);\n }", "title": "" }, { "docid": "4827982a2d91179cf827cb5934c01cc5", "score": "0.50107497", "text": "function normalizeRouteConfig(config, registry) {\n if (config instanceof route_config_decorator_1.AsyncRoute) {\n var wrappedLoader = wrapLoaderToReconfigureRegistry(config.loader, registry);\n return new route_config_decorator_1.AsyncRoute({\n path: config.path,\n loader: wrappedLoader,\n name: config.name,\n data: config.data,\n useAsDefault: config.useAsDefault\n });\n }\n if (config instanceof route_config_decorator_1.Route || config instanceof route_config_decorator_1.Redirect || config instanceof route_config_decorator_1.AuxRoute) {\n return config;\n }\n if ((+!!config.component) + (+!!config.redirectTo) + (+!!config.loader) != 1) {\n throw new BaseException(\"Route config should contain exactly one \\\"component\\\", \\\"loader\\\", or \\\"redirectTo\\\" property.\");\n }\n if (config.as && config.name) {\n throw new BaseException(\"Route config should contain exactly one \\\"as\\\" or \\\"name\\\" property.\");\n }\n if (config.as) {\n config.name = config.as;\n }\n if (config.loader) {\n var wrappedLoader = wrapLoaderToReconfigureRegistry(config.loader, registry);\n return new route_config_decorator_1.AsyncRoute({\n path: config.path,\n loader: wrappedLoader,\n name: config.name,\n data: config.data,\n useAsDefault: config.useAsDefault\n });\n }\n if (config.aux) {\n return new route_config_decorator_1.AuxRoute({ path: config.aux, component: config.component, name: config.name });\n }\n if (config.component) {\n if (typeof config.component == 'object') {\n var componentDefinitionObject = config.component;\n if (componentDefinitionObject.type == 'constructor') {\n return new route_config_decorator_1.Route({\n path: config.path,\n component: componentDefinitionObject.constructor,\n name: config.name,\n data: config.data,\n useAsDefault: config.useAsDefault\n });\n }\n else if (componentDefinitionObject.type == 'loader') {\n return new route_config_decorator_1.AsyncRoute({\n path: config.path,\n loader: componentDefinitionObject.loader,\n name: config.name,\n data: config.data,\n useAsDefault: config.useAsDefault\n });\n }\n else {\n throw new BaseException(\"Invalid component type \\\"\" + componentDefinitionObject.type + \"\\\". Valid types are \\\"constructor\\\" and \\\"loader\\\".\");\n }\n }\n return new route_config_decorator_1.Route(config);\n }\n if (config.redirectTo) {\n return new route_config_decorator_1.Redirect({ path: config.path, redirectTo: config.redirectTo });\n }\n return config;\n}", "title": "" }, { "docid": "8021e26a6b1dd9a6c2c8462701bb0456", "score": "0.5002649", "text": "function addRoutes(app) {\r\n util.callAll(routeDir, 'init', app)\r\n util.callAll(routeDir, 'addRoutes', app)\r\n}", "title": "" }, { "docid": "e40719a4d05b3edf7085738d23552856", "score": "0.49797514", "text": "addPatchRoute(route, handler) {\n this.addRoute('patch', route, handler);\n }", "title": "" }, { "docid": "7c7dce5783a40249b2db4197a6518102", "score": "0.49770752", "text": "function buildRoutes (config) {\n function buildRoutesRecursively (config, routes, parentRoute) {\n _.forOwn(config, (value, key) => {\n // The key is always the path for the route\n const route = {\n path: key,\n name: key,\n // \"Inherit\" meta data on nested routes\n meta: (parentRoute ? Object.assign({}, parentRoute.meta) : {})\n }\n // If value is a simple string this is a shortcut:\n // - name = path\n // - component = value\n // Otherwise we have an object similar to what expect vue-router,\n // we simply return the async component loading function with the given component value\n if (typeof value === 'string') {\n route.component = () => import(`@components/${value}.vue`)\n } else {\n // Take care that path can be empty so we cannot just check with a if\n if (_.has(value, 'path')) {\n route.path = value.path\n }\n // Take care that name can be empty so we cannot just check with a if\n if (_.has(value, 'name')) {\n route.name = value.name\n }\n if (_.has(value, 'component')) {\n route.component = () => import(`@components/${value.component}.vue`)\n if (_.has(value, 'embedApi')) {\n setupEmbedApi(route.name)\n }\n }\n if (_.has(value, 'props')) {\n route.props = value.props\n }\n if (_.has(value, 'meta')) {\n // Override parent meta if child meta given\n Object.assign(route.meta, value.meta)\n }\n if (_.has(value, 'redirect')) {\n _.set(route, 'redirect', value.redirect)\n }\n }\n\n // Check for any children to recurse\n if (value.children) {\n route.children = []\n buildRoutesRecursively(value.children, route.children, route)\n }\n routes.push(route)\n })\n }\n\n const routes = []\n buildRoutesRecursively(config, routes)\n return routes\n}", "title": "" }, { "docid": "70e74c07e95a22f3782f2c9512629989", "score": "0.4964645", "text": "function _addRoutes(router) {\n\n var initialMap = function () {\n // _navigateToPage('map', 'initial');\n router.setRoute('/rock-climbing');\n };\n\n var rockClimbing = function (areaId, sectionId) {\n _navigateToPage('map', 'rock-climbing', arguments);\n };\n\n var mountaineering = function () {\n _navigateToPage('map', 'mountaineering', arguments);\n };\n\n var trekking = function () {\n _navigateToPage('map', 'trekking', arguments);\n };\n\n var userHandler = function () {\n _navigateToPage('user');\n };\n\n var communityHandler = function () {\n _navigateToPage('community');\n };\n\n var appHandler = function () {\n _navigateToPage('app');\n };\n\n var errorHandler = function () {\n _navigateToPage('error');\n };\n\n\n // home page (default)\n router.on('/', home);\n\n // locations list\n router.on('/mountaineering', locationsListHandler);\n\n // locations map\n router.on('/locations-map/', locationsMapHandler);\n\n // user profile page\n router.on('/profile', profileHandler);\n\n // not found page\n router.on('/not-found', notFoundHandler);\n\n // error page\n router.on('/error', errorHandler);\n\n }", "title": "" }, { "docid": "3a9e97fb860c24a98b3546d5e3d4734f", "score": "0.49578515", "text": "function addLocation()\r\n{\r\n let newWaypoint = currentRoute.routeMarker.getPosition();\r\n currentRoute.waypoints.push(newWaypoint);\r\n currentRoute.displayPath();\r\n}", "title": "" }, { "docid": "311dc7e5fca0081ad0f891fc9914d575", "score": "0.49420658", "text": "function useRoute() {\r\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.inject)(routeLocationKey);\r\n}", "title": "" }, { "docid": "d21a9d1a67d5e0407063074f5811fae5", "score": "0.4919869", "text": "registerComponent(component) {\n this.requireValidComponent(component);\n if (component.term.termType !== 'NamedNode') {\n this.logger.warn(`Registered a component that is identified by a ${component.term.termType} (${component.value}) instead of an IRI identifier.`);\n }\n this.componentResources[component.value] = component;\n }", "title": "" }, { "docid": "f3543cce240efbf05efc2860b1ee5f3f", "score": "0.49072266", "text": "route(path, handler, options = {}) {\n var pathString = this.pathToString(path);\n var prefixedPath = this.buildPathWithPrefix(pathString);\n\n this.routes[prefixedPath] = {\n route: prefixedPath,\n handler: handler,\n options: options\n };\n }", "title": "" }, { "docid": "14069e51cbcf222803a52ced3e631179", "score": "0.4906324", "text": "function addRoute(start, end, distance) {\n\n\t\t// Route already exists, don't add it\n\t\tif (graph.routes[start] && graph.routes[start][end]) {\n\t\t\talert('Route already exists.');\n\t\t\treturn false;\n\n\t\t// New route, add to the graph and display all current routes\n\t\t} else {\n\t\t\tgraph.addRoute(start + end + distance);\n\t\t\trenderRoutes();\n\t\t\treturn true;\n\t\t}\n\n\t}", "title": "" }, { "docid": "c7242aa6d12148fdf6e90e696fa9062b", "score": "0.48828033", "text": "mountRoutes() {}", "title": "" }, { "docid": "81443163830869954a3868394ee30c24", "score": "0.4882259", "text": "function useRoute() {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.inject)(routeLocationKey);\n}", "title": "" }, { "docid": "81443163830869954a3868394ee30c24", "score": "0.4882259", "text": "function useRoute() {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.inject)(routeLocationKey);\n}", "title": "" }, { "docid": "729a2a1c5619093863130eba3eca116a", "score": "0.48749384", "text": "addLinkComponent(link, component) {\n 'use strict';\n\n let newLink = link;\n let componentString = component;\n\n if (component === undefined || !component) {\n return newLink;\n }\n if (typeof newLink !== 'string') {\n newLink = link.toString();\n }\n\n if (typeof component !== 'string') {\n componentString = component.toString();\n }\n if (newLink.charAt(newLink.length - 1) !== '/' && componentString.charAt(0) !== '/') {\n newLink += '/';\n } else if (newLink.charAt(newLink.length - 1) === '/' && componentString.charAt(0) === '/') {\n componentString = componentString.substring(1);\n }\n newLink += componentString;\n return newLink;\n }", "title": "" }, { "docid": "ca79772e8f3d68cc2ad61f3f175320f7", "score": "0.4871746", "text": "childRoute(Component, name = '', pathProps) {\n // get props needed for each route\n // 'name' should correspond with the plugin name for each route\n const routeProps = getRouteProps(name, this.props);\n\n return <Component {...routeProps} {...pathProps} />;\n }", "title": "" }, { "docid": "98461485abf32dca98a92294282d61ba", "score": "0.48665038", "text": "addRouterSpecification (route, name, spec) {\n debug (`building router ${name} at ${route}`);\n\n // The first step is to apply the policy in the specification, if exists. This\n // is because we need to determine if the current request can even access the\n // router path before we attempt to process it.\n if (spec.policy) {\n let middleware = this._makePolicyMiddleware (spec.policy);\n\n if (middleware.length)\n this.activeRouter.use (route, middleware);\n }\n\n // Next, we process any \"use\" methods.\n if (spec.use)\n this.activeRouter.use (path, spec.use);\n\n // Next, we start with the head verb since it must be defined before the get\n // verb. Otherwise, express will use the get verb over the head verb.\n if (spec.head)\n this._processToken (route, 'head', spec.head);\n\n forOwn (spec, (value, key) => {\n if (['head', 'use', 'policy'].includes (key))\n return;\n\n switch (key[0])\n {\n case '/':\n this.addRoute (route, key, value);\n break;\n\n case ':':\n this.addParameter (key, value);\n break;\n\n default:\n this._processToken (route, key, value);\n }\n });\n }", "title": "" }, { "docid": "ed95ee7fb71e0dad8a08fe195c565264", "score": "0.48607507", "text": "addRoute (path, input, _middleware = []) {\n\n const middleware = this.prepareMiddlewareArray(_middleware);\n let fullFilename;\n let module;\n\n // Attempt to load in the module if a filename is given.\n if (typeof input === 'string') {\n try {\n fullFilename = pathify(this.baseDir, input);\n module = require(fullFilename);\n } catch (err) {\n throw new Error(`Unable to load module \"${fullFilename}\" (${err.code || err.name}).`);\n }\n\n // Otherwise assume the input is an object.\n } else {\n module = input;\n }\n\n // Check each of the middleware methods.\n const { mResult, mIndex, mType } = this.checkMiddlewareMethods(middleware);\n\n if (!mResult) {\n throw new Error(`Middleware for path \"${path}\" at index ${mIndex} should be a function and not \"${mType}\"!`);\n }\n\n // Apply the module's handler functions that are present for any of the supported HTTP methods.\n for (let v = 0, vlen = httpMethods.length; v < vlen; v++) {\n const httpMethod = httpMethods[v];\n const handler = module[httpMethod];\n\n // Handler is not a function.\n if (typeof handler !== 'function') { continue; }\n\n // Check if we already have a handler mounted on this path and HTTP method.\n if (this.routes[path] && this.routes[path][httpMethod]) {\n throw new Error(`A ${httpMethod.toUpperCase()} route already exists for the path \"${path}\".`);\n }\n\n // Mount route with middleware.\n if (middleware && middleware.length) {\n this.app[httpMethod](path, middleware, handler);\n\n // Mount route without middleware.\n } else {\n this.app[httpMethod](path, handler);\n }\n\n // Remember that we've mounted on this path and HTTP method to prevent double mounting.\n if (!this.routes[path]) { this.routes[path] = {}; }\n this.routes[path][httpMethod] = true;\n }\n\n return this;\n\n }", "title": "" }, { "docid": "0637ae1de962e274c895aad00a3bce47", "score": "0.48584706", "text": "function withRouter(Component) {\n var C = function C(props) {\n var wrappedComponentRef = props.wrappedComponentRef,\n remainingProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(props, [\"wrappedComponentRef\"]);\n\n return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Route, {\n children: function children(routeComponentProps) {\n return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_8__[\"default\"])({}, remainingProps, routeComponentProps, {\n ref: wrappedComponentRef\n }));\n }\n });\n };\n\n C.displayName = \"withRouter(\" + (Component.displayName || Component.name) + \")\";\n C.WrappedComponent = Component;\n\n if (true) {\n C.propTypes = {\n wrappedComponentRef: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func\n };\n }\n\n return hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_11___default()(C, Component);\n}", "title": "" }, { "docid": "612a5edf07f8d1b6dc3c00ae1349b1d9", "score": "0.48408985", "text": "addPostRoute(route, handler) {\n this.addRoute('post', route, handler);\n }", "title": "" }, { "docid": "d37957cd5bbf87692c1f4038073df0b2", "score": "0.48380888", "text": "function router() { // private function\n\n var path = location.hash;\n // prints something like /home\n\n // Use the url like an index (JS associative array notation) to find the desired\n // component (function) to run. The component will place content in the content\n // area. If a link is clicked for which a route was never set, give error message.\n if (!routes[path]) {\n var ele = document.createElement(\"div\");\n ele.innerHTML = \"<p>Error: unknown link '\" + path + \"' never added to the routing table.</p>\";\n inject(ele);\n } else {\n var ele = routes[path](); // returns DOM element from the function stored in the routes associative array\n inject (ele); \n }\n }", "title": "" }, { "docid": "a1f9b5d217dbf56fe17e76c51ac40110", "score": "0.48347375", "text": "constructor(route = {})\n {\n valid(route, 'object')\n\n /** @type object */\n this._route = route\n }", "title": "" }, { "docid": "5f2037d35738f75b8b418e6b525638ac", "score": "0.48240745", "text": "registerComponent(component) {\n if (this.vues[component.name] === undefined) {\n this.vues[component.name] = component;\n } else {\n this.vues[component.name].apps.push(...component.apps);\n }\n }", "title": "" }, { "docid": "82aa5d296ca007b5cc2b61d42f09f8a6", "score": "0.4821514", "text": "function Router(config) {\n this.currentRoute = ko.observable({});\n\n // Configure Crossroads route handlers\n ko.utils.arrayForEach(config.routes, (route) => {\n crossroads.addRoute(route.url, (requestParams) => {\n this.currentRoute(ko.utils.extend(requestParams, route.params));\n });\n });\n\n // Activate Crossroads\n crossroads.normalizeFn = crossroads.NORM_AS_OBJECT;\n hasher.initialized.add(function(hash) {\n crossroads.parse(hash)\n });\n hasher.changed.add(function(hash) {\n crossroads.parse(hash)\n });\n hasher.init();\n }", "title": "" }, { "docid": "e6c452fe865527d205a9e05026249278", "score": "0.48163304", "text": "requestRoute (route) {\n app.requestRoute(route, this.context)\n }", "title": "" }, { "docid": "c7953a96031e64ab0202d046d7559f04", "score": "0.48141876", "text": "merge(router) {\n for (var route of router.routes) {\n this.routes.push(route);\n }\n }", "title": "" }, { "docid": "359e46fdcae5bcf2c9c1f7daa618658d", "score": "0.48129612", "text": "function RouteWithSubRoutes(route) {\n return (\n <Route\n path={route.path}\n render={props => <route.component {...props} routes={route.routes} />}\n />\n );\n}", "title": "" }, { "docid": "a4e711737fb5c795acff00752d1c66cb", "score": "0.4811333", "text": "registerRoutes() {\n this.get(`/`, `version`);\n\n this.post(`/info`, `info`);\n\n this.post(`/insert`, `insert-list`);\n this.get(`/lists`, 'lists/index');\n\n this.get(`/lists/:id`, `lists/show`);\n\n this.delete(`/lists/:id`, `lists/destroy`);\n\n this.post(`/lists`, `lists/create`);\n\n this.patch(`/lists/:id`, `lists/update`);\n this.put(`/lists/:id`, `lists/update`);\n\n this.post(`/reminders`, `reminders/create`);\n\n this.get(`/reminders`, 'reminders/index');\n this.post(`/reminders`, 'reminders/create');\n this.get(`/reminders/:id`, 'reminders/show');\n this.patch(`/reminders/:id`, 'reminders/update');\n this.delete(`/reminders/:id`, 'reminders/destroy');\n }", "title": "" }, { "docid": "81b4e77537fbb428dda950be39b25f6a", "score": "0.48083726", "text": "function Routing(route) {\n return(\n <Route \n path={route.path}\n exact={route.exact}\n key={route.key}\n component={route.component}\n />\n )\n}", "title": "" }, { "docid": "32d73f40e14e5a16ca131bc374fcdf70", "score": "0.48004812", "text": "add(identifier = Random.id(), order, config) {\n\t\tif (this.roomTypes[identifier] != null) {\n\t\t\treturn false;\n\t\t}\n\t\tif (order == null) {\n\t\t\torder = this.mainOrder + 10;\n\t\t\tthis.mainOrder += 10;\n\t\t}\n\t\tthis.roomTypesOrder.push({\n\t\t\tidentifier,\n\t\t\torder\n\t\t});\n\t\tthis.roomTypes[identifier] = {...config, identifier};\n\t\tif (config.route && config.route.path && config.route.name && config.route.action) {\n\t\t\tconst routeConfig = {\n\t\t\t\tname: config.route.name,\n\t\t\t\taction: config.route.action\n\t\t\t};\n\t\t\tif (Meteor.isClient) {\n\t\t\t\trouteConfig.triggersExit = [roomExit];\n\t\t\t}\n\t\t\treturn FlowRouter.route(config.route.path, routeConfig);\n\t\t}\n\t}", "title": "" }, { "docid": "addf684ee83e9090ac33dc6317176a7c", "score": "0.47943065", "text": "constructor() {\n //this.containerConfig.containerRegistration(this.container);\n //this.containerConfig.containerResolver(this.container);\n console.log(\"route starts................\");\n }", "title": "" }, { "docid": "94b2d8adbdd32a44d0874b3053dda47c", "score": "0.47925717", "text": "constructor() {\n this._routes = {};\n\n }", "title": "" }, { "docid": "f94aa8a43a1f52fd37a6d993dc142ad8", "score": "0.4774831", "text": "createRoute(routeConfig) {\n const { pattern, method: optMethod, maxAgeSeconds, isPartialPathRoute, key, convertToGet, } = routeConfig;\n const method = (optMethod || 'get').toLowerCase();\n log_1.default(`[route] ${method} ${pattern}, maxAgeSeconds: ${maxAgeSeconds}`);\n const patternRegexp = new RegExp(pattern, 'i');\n // all routes must have a GET route registered, so Workbox can properly look\n // it up when running workbox-routing/Router#findMatchingRoute:\n if (method !== 'get') {\n this.createRoute({ ...routeConfig, method: 'get' });\n }\n const prefetchPlugin = new PrefetchPlugin_1.default({\n incrementRead: this.incrementRead.bind(this),\n incrementWrite: this.incrementWrite.bind(this),\n cacheHost: this.cacheHost,\n prefetchUpstreamRequests: routeConfig.prefetchUpstreamRequests,\n });\n const plugins = [\n this.cacheableResponsePlugin,\n new workbox_expiration_1.ExpirationPlugin({\n maxAgeSeconds,\n }),\n // DevtoolPlugin needs to be injected before PrefetchPlugin as this later\n // changes request url to normalise the cache key\n this.createDevtoolsPlugin(routeConfig),\n prefetchPlugin,\n ...(this.config.plugins || []),\n ];\n if (key) {\n plugins.push(new CustomCacheKeyPlugin_1.default(patternRegexp, key));\n }\n if (convertToGet) {\n // ChangeMethodPlugin must come before PrefetchPlugin so body is retained:\n plugins.splice(plugins.indexOf(prefetchPlugin), 0, new ChangeMethodPlugin_1.default([patternRegexp]));\n }\n workbox_routing_1.registerRoute(this.shouldIntercept(patternRegexp, isPartialPathRoute), new workbox_strategies_1.CacheFirst({\n cacheName: constants_1.CACHE_NAME,\n matchOptions: {\n ignoreVary: true,\n },\n plugins,\n }), \n // @ts-ignore\n method.toUpperCase() // HTTPMethods map directly from @layer0/core lowercase => @workbox uppercase\n );\n }", "title": "" }, { "docid": "b69244e11e8b6a5de01b154f7b532c6c", "score": "0.4768885", "text": "addRouteCallback(routeCallback) {\n this.routeCallbacks.push(routeCallback);\n }", "title": "" }, { "docid": "d7b98b0b4f95ab6281d6c08dabb7e3fe", "score": "0.47674087", "text": "register() {\n this.loadAndPublishConfig(this.app.formatPath(__dirname, 'config'));\n this.bindDateHelper();\n this.bindFileHelper();\n this.bindPathHelper();\n this.bindStringHelper();\n this.bindDumperService();\n this.bindFakerService();\n this.bindIdeLinkEnum();\n }", "title": "" }, { "docid": "cf61e965528d8ed423bbffeb30cbbcc2", "score": "0.47671378", "text": "function addRoute (method, path, ...handlers) {\n handlers.forEach(handler => {\n routes.push({\n method,\n path: new RegExp(`^${path}$`),\n handler\n })\n })\n}", "title": "" }, { "docid": "78c4e38f8cbc07bab227bc261ff986c7", "score": "0.47657344", "text": "registerRoutes() {\n this.get(`/`, `version`);\n\n this.post(`/info`, `info`);\n\n this.post(`/insert`, `insert-list`);\n this.get(`/lists`, 'lists/index');\n\n this.get(`/lists/:id`, `lists/show`);\n\n this.delete(`/lists/:id`, `lists/destroy`);\n\n this.post(`/lists`, `lists/create`);\n\n this.patch(`/lists/:id`, `lists/update`);\n this.put(`/lists/:id`, `lists/update`);\n\n this.post(`/reminders`, `reminders/create`);\n }", "title": "" }, { "docid": "3522019b2b0ed76a6c4c55e942037f17", "score": "0.47547096", "text": "function registerModule(resolver, compDef, wire) {\n let routes = compDef.options.routes;\n\n // define module routes\n \n\n // define module permissions\n\n\n resolver.resolve(target);\n}", "title": "" }, { "docid": "a868ee7fccd28e9edde06068bf7719ea", "score": "0.47520727", "text": "link(outlet, params = {}) {\n const { _outletMap, _currentParams, _currentQueryParams } = this;\n let route = _outletMap[outlet];\n if (route === undefined) {\n return;\n }\n let linkPath = route.fullPath;\n if (route.fullQueryParams.length > 0) {\n let queryString = route.fullQueryParams.reduce((queryParamString, param, index) => {\n if (index > 0) {\n return `${queryParamString}&${param}={${param}}`;\n }\n return `?${param}={${param}}`;\n }, '');\n linkPath = `${linkPath}${queryString}`;\n }\n params = Object.assign({}, route.defaultParams, _currentQueryParams, _currentParams, params);\n if (Object.keys(params).length === 0 && route.fullParams.length > 0) {\n return undefined;\n }\n const fullParams = [...route.fullParams, ...route.fullQueryParams];\n for (let i = 0; i < fullParams.length; i++) {\n const param = fullParams[i];\n if (params[param]) {\n linkPath = linkPath.replace(`{${param}}`, params[param]);\n }\n else {\n return undefined;\n }\n }\n return linkPath;\n }", "title": "" }, { "docid": "618864508f86199a98b2f5715c710b25", "score": "0.47481462", "text": "routingHandler(event) {\r\n this.base.routingEventListener(event);\r\n }", "title": "" }, { "docid": "618864508f86199a98b2f5715c710b25", "score": "0.47481462", "text": "routingHandler(event) {\r\n this.base.routingEventListener(event);\r\n }", "title": "" }, { "docid": "618864508f86199a98b2f5715c710b25", "score": "0.47481462", "text": "routingHandler(event) {\r\n this.base.routingEventListener(event);\r\n }", "title": "" }, { "docid": "618864508f86199a98b2f5715c710b25", "score": "0.47481462", "text": "routingHandler(event) {\r\n this.base.routingEventListener(event);\r\n }", "title": "" }, { "docid": "618864508f86199a98b2f5715c710b25", "score": "0.47481462", "text": "routingHandler(event) {\r\n this.base.routingEventListener(event);\r\n }", "title": "" } ]
3ad3b2b9dd85f4bc2b7d75ae5cc85862
FUNCION QUE POSICIONA EL CARRO DEPENDIENDO LA RUTA
[ { "docid": "3605346c5dfb3595023e320b75c565b6", "score": "0.0", "text": "function posicionarCarro(){\n carro.style.display = \"block\";\n carro.style.top = rutas[posicionRuta].posicion_Y[0] + \"px\";\n carro.style.right = rutas[posicionRuta].posicion_X[0] + \"px\";\n}", "title": "" } ]
[ { "docid": "fae775cbbe61c4a6bb0009aa04cedb63", "score": "0.59920084", "text": "function comer() {\n if (manzana === posicion) {\n arraySerpiente.push(posicion);\n manzana = null;\n velocidad = velocidad * 0.98;\n }\n}", "title": "" }, { "docid": "42462dbdf775955944222ba1c044d9e6", "score": "0.59413016", "text": "function Barreiras(altura, largura, abertura, espaco, notificarponto){\n this.pares = [\n new ParDeBarreiras(altura, abertura, largura),\n new ParDeBarreiras(altura, abertura, largura + espaco),\n new ParDeBarreiras(altura, abertura, largura + espaco*2),\n new ParDeBarreiras(altura, abertura, largura + espaco*3)\n ]\n\n const deslocamento = 3;\n\n this.animar = () => {\n this.pares.forEach(par => {\n par.setX(par.getx() - deslocamento)\n\n if(par.getX() < -par.getLargura()){\n par.setX(par.getX() + espaco * this.pares.length)\n par.sortearAbertura()\n }\n const meio = largura/2\n const cruzouOMeio = par.getX() + deslocamento >= meio\n && par.getX() < meio\n if (cruzouOMeio) notificarponto()\n })\n } \n\n}", "title": "" }, { "docid": "7f65ffc4460eaa211b5a472972d45b90", "score": "0.59253883", "text": "function sumaPremio(slot) {\r\n\t//premio = premio > 0 ? premio * (slot.premio > 0 ? slot.premio : 1) : premio + slot.premio;\r\n\tbanco.setPremio(banco.getPremio() > 0 ? banco.getPremio() * slot.premio : banco.getPremio() + slot.premio);\r\n\t//alert(slot.premio + \"|\" + banco.getPremio());\r\n\treturn banco.getPremio();\r\n}", "title": "" }, { "docid": "4ed7fcc5f21aa0d03271f00b01049474", "score": "0.59224784", "text": "function CriarParBarreira(altura, abertura, x) {\n this.elemento = criarElemento('div', 'par-de-barreiras')\n\n this.superior = new CriarBarreira(true)\n this.inferior = new CriarBarreira(false)\n\n this.elemento.appendChild(this.superior.elemento)\n this.elemento.appendChild(this.inferior.elemento)\n\n this.sortearAbertura = () => {\n const altSuperior = Math.random() * (altura - abertura)\n const altInferior = altura - altSuperior - abertura\n this.superior.setAltura(altSuperior)\n this.inferior.setAltura(altInferior)\n }\n\n this.getX = () => parseInt(this.elemento.style.left.split('px')[0])\n this.setX = x => this.elemento.style.left = `${x}px`\n this.getLargura = () => this.elemento.clientWidth\n\n this.sortearAbertura()\n this.setX(x)\n}", "title": "" }, { "docid": "9c2824dfd109a533ea3d8ea4cff235c8", "score": "0.59190506", "text": "function InverteP (DescPalavra, TamanhoPalavra) {\r\n// AQUI TEREMOS UM NOVO VETOR PARA ARMAZANAR A PALAVRA INVERTIDA:\r\n let NewP = '';\r\n\r\n// VERSAO 2!\r\n//PASSO 3: VAMOS PERCORRER A PALAVRA, LETRA A LETRA, USANDO O INDICE DO VETOR\r\n for (var i = 0; i < TamanhoPalavra; ++i) {\r\n// PRINTS DE CONTROLE\r\n //console.log('o vetor *p* esta na posicao: ' + i);\r\n //console.log('a palavra invertida esta na posicao: ' + (TamanhoPalavra - (i+1)));\r\n // o TamanhoPalavra - (i+1) CRIA A POSICAO NO NOVO VETOR NewP:\r\n //AQUI ESTAMOS ATRIBUINDO A ULTIMA LETRA DO VETOR p AO NOVO VETOR NewP:\r\n NewP = NewP + p[(TamanhoPalavra - (i+1))];\r\n //console.log('NewP = ' + NewP);\r\n //console.log('=================================== ');\r\n }\r\n console.log('A nova palavra é = ' + NewP);\r\n}", "title": "" }, { "docid": "a994dc4c851810c3e9001adfa69448ef", "score": "0.5899782", "text": "function rabiaBueno(){\n\t\t\t\tif ( cantRabia > contadorRabia){\n\t\t\t\t\trabiaHeroe.style.background = \"green\";\n\t\t\t\t\trabiaHeroe.style.border = \"solid 1px green\";\n\t\t\t\t\tcontadorRabia ++;\n\t\t\t\t\tdatos[4] = datos[4] - datos[1];\n\t\t\t\t}else{\n\t\t\t\t\tdañoRabia = datos[1] * 2;\n\n\t\t\t\t\talert(\"¡Ataque especial de tu personaje! \" + datos[3] + \" daño: \" + dañoRabia);\n\t\t\t\t\tcontadorRabia = 0;\n\t\t\t\t\tdatos[4] = datos[4] - dañoRabia;\n\n\t\t\t\t\tfor (var i = 0; i < cantRabia; i++) {\n\t\t\t\t\t\tvar rabiaRoja = document.getElementsByClassName(heroeRabia)[i];\n\t\t\t\t\t\trabiaRoja.style.background = \"#f44336\";\n\t\t\t\t\t\trabiaRoja.style.border = \"solid 1px #ef5350\";\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tvidaMalo.innerHTML = \"Vida: \" + datos[4];\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "38a20bbb773ae743fae727e3406596d2", "score": "0.5876654", "text": "calculaPerimetro(){\n return 2*this.ladoA + 2*this.ladoB;\n }", "title": "" }, { "docid": "563dbd2be79a44b50585e1531f51b732", "score": "0.5876205", "text": "function perimetroCuadrado(ladoCuadrado) {\n return ladoCuadrado*4;\n}", "title": "" }, { "docid": "a86baffba2cc93ef752f238360e4ca52", "score": "0.5867399", "text": "function Barreiras(altura, largura, abertura, espaco, ponto) {\n this.pares = [\n new CriarParBarreira(altura, abertura, largura),\n new CriarParBarreira(altura, abertura, largura + espaco),\n new CriarParBarreira(altura, abertura, largura + espaco * 2),\n new CriarParBarreira(altura, abertura, largura + espaco * 3)\n ]\n const deslocamento = 5\n this.animar = () => {\n\n this.pares.forEach(par => {\n par.setX(par.getX() - deslocamento)\n\n if (par.getX() < -par.getLargura()) {\n par.setX(par.getX() + espaco * this.pares.length)\n par.sortearAbertura()\n }\n\n const meio = largura / 2\n const cruzouMeio = par.getX() + deslocamento >= meio && par.getX() < meio\n \n if (cruzouMeio) ponto()\n\n })\n }\n\n}", "title": "" }, { "docid": "8986341b1d1113d72bb4e9c8676a9b27", "score": "0.5776985", "text": "function Recupera_Vida(cura : float){\n\tvida_atual += cura;\n}", "title": "" }, { "docid": "bdf3edb273336d594e704c9bf6620f89", "score": "0.5750552", "text": "function ajustar_punto(punto,piso,grafo,posiciones)\r\n{\r\nvar sub_grafo=grafo;//guardar en subgrafo el grafo correspondiente despues\r\nvar posiciones_radio=posiciones;//guardar en posiciones_radio el posiciones correspondiente a los puntos de camino que corresponda\r\n\r\nvar coord=new Array();\r\nvar coord_minimo=new Array();\r\nvar distancia_minima=999999;\r\nvar distancia;\r\nvar rectas=new Array();\r\nrectas=generar_rectas(sub_grafo,posiciones);\r\nvar tam_rectas=rectas.length;\r\nvar tam_posiciones=posiciones_radio.length;\r\n\t//console.log(rectas);\r\n\t//comparamos la distancia del punto a cada recta del plano\r\n\tfor(var i=0;i<tam_rectas;i++)\r\n\t{\r\n\tcoord=proyeccion_punto_recta(punto,rectas[i]);//guardamos la proyeccion del punto sobre la recta\r\n\t//console.log(\"si \"+coord[0]+\">=\"+rectas[i][2][0]+\" && \"+coord[0]+\"<=\"+rectas[i][3][0]);\r\n\tif(coord[0]>=rectas[i][2][0] && coord[0]<=rectas[i][3][0])//vemos si la proyeccion esta dentro de los limites de la recta\r\n\t\t{\r\n\t\t////console.log(\"ENTRE IF coordenadas!!!\");\r\n\t\tdistancia=distancia_punto_punto(punto,coord);//guardamos la distancia entre el punto y la proyeccion\r\n\t\t\tif(distancia_minima>distancia)//si la distancia al punto es menor que la distancia minima anterior reemplaza la distancia minima y guarda la proyeccion\r\n\t\t\t{\r\n\t\t\t////console.log(\"ENTRE IF DISTANCIA!!!\");\r\n\t\t\tdistancia_minima=distancia;\r\n\t\t\tcoord_minimo[0]=coord[0];\r\n\t\t\tcoord_minimo[1]=coord[1];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//comparamos cada radio\r\n\tfor(var i=0;i<tam_posiciones;i++)\r\n\t{\r\n\t\tif(pertenece_radio(punto,posiciones_radio[i][1],1))//Aqui modificamos el radio, que por ahora es fijo\r\n\t\t{\r\n\t\tcoord_minimo[0]=posiciones_radio[i][1][0];\r\n\t\tcoord_minimo[1]=posiciones_radio[i][1][1];\r\n\t\t}\r\n\t}\r\n\treturn coord_minimo;\r\n}", "title": "" }, { "docid": "96c46abe7aef67ce533abee0b82f2d51", "score": "0.57401735", "text": "function recuperarDatosRecorrido(){\n // recuperamos los datos del recorrido\n COORD_RECORRIDO.forEach(crearDatoRecorrido);\n nuevoRecorrido = {\n \"color\": COLOR_RECORRIDO,\n \"puntos\": puntosRecorridoCreate,\n \"nombreUnidadTransporte\": vm.nombreUnidadSeleccionada\n }\n }", "title": "" }, { "docid": "979358d5755cfb5ab42f9a41047edd53", "score": "0.5736764", "text": "placer(joueur, x, y, value) {\n if (this.peut_placer_ses_pions(joueur, x, y)) {//regarde si on a le droit de le placer\n this.modif_grid_placer(joueur, x, y, value);//placer le pion\n\n this.io.to(this.token).emit('affichePion', this.getCaseState(x, y).type, x, y, joueur, value, this.getCaseState(x, y).visible);\n\n //implemente la case du tableau correspondant au pion\n let somme = 0;\n if (joueur.color === this.joueur_rouge.color) {\n this.joueur_rouge.pions_en_jeu[value - 1] += 1;\n this.joueur_rouge.pions_en_jeu.forEach(element => somme += element);\n } else {\n this.joueur_bleu.pions_en_jeu[value - 1] += 1;\n this.joueur_bleu.pions_en_jeu.forEach(element => somme += element);\n }\n\n if (!(this.joueur_bleu.pret && this.joueur_rouge.pret)) this.io.to(this.token).emit('modifNbPret', joueur, somme);\n }\n }", "title": "" }, { "docid": "2429829717b51c540d23274bdfb52fdf", "score": "0.5729148", "text": "function rutaNorte(origen,destino,color,prueba){\n\n //obtenemos las letras y numeros de las posiciones por separado\n\n const letrao = origen.charAt(0);\n const numeroo = Number(origen.charAt(1));\n const letrad = destino.charAt(0);\n const numerod = Number(destino.charAt(1));\n\n if(letrao != letrad){\n\n return false;\n\n }else{\n\n //Revisamos cada casilla\n\n let indice = numeroo;\n\n while(indice < numerod){\n\n indice++;\n\n //si la casilla a revisar no esta vacia\n\n if(!estaVacio(letrao+indice)){\n\n switch(indice){\n\n //si la casilla coincide con la casilla de destino, se pasa a comerla de ser posible\n //en caso de que encuentre en el camino a su destino una pieza atravesada, no podra hacer el movimiento\n case numerod:\n\n return sePuedeComer(color,destino,prueba);\n\n break;\n\n default:\n\n if(prueba === true){\n\n if(color === \"blanca\" && document.getElementsByClassName(letrao+indice)[0].firstChild.classList[1] != \"reynegro\"){\n\n return false;\n }else if(color === \"negra\" && document.getElementsByClassName(letrao+indice)[0].firstChild.classList[1] != \"reyblanco\"){\n\n return false;\n }\n \n\n }else{\n return false;\n }\n\n\n }\n }else{\n //si se llega al destino sin obstaculos y no hay que comer ninguna pieza\n if(indice === numerod){\n\n return true;\n\n }\n }\n }\n }\n}", "title": "" }, { "docid": "b6ebd0e4cfd12be873cd14b2c3ea819a", "score": "0.5728693", "text": "function gerar_nova_cor(tempo_bola) {\n if (frameCount % tempo_bola == 0) {\n // penalizacao de nao ter respondido\n if (tentativa == true) {\n score = score - 1;\n }\n // gera a cor aleataria \n cor = random(cores);\n // gera a posicao em que a bola ira aparecer de forma randomica\n p_x = round(random(200, width - 200));\n p_y = round(random(380, height - 380));\n tamanho_bola = random(50, 140);\n // tentativa ok\n tentativa = true;\n // tempo de apareceimento de um nova bola\n tempo_bola = random([120, 150, 180, 210]);\n // console.log(tempo_bola);\n // tempo que a bola apareceu\n tempo1 = millis();\n }\n // define a cor da bola\n fill(cor);\n // desenha a bola\n circle(p_x, p_y, tamanho_bola)\n}", "title": "" }, { "docid": "b86106363db027e5ee377fe0c28e9426", "score": "0.5713559", "text": "function perimetroCuadrado(lado){\n return lado*4;\n}", "title": "" }, { "docid": "e330e229e066e826b0044b3e83f3da36", "score": "0.5703765", "text": "function perimetroCuadrado(lado) { \n return lado * 4;\n }", "title": "" }, { "docid": "01f653c4550eb9b2427e8b7e489ccd41", "score": "0.56859815", "text": "function altaReceta(unId, unAutor, unTitulo, unTiempo, unaResenia, contadorMeGusta, contadorNoMeGusta, unaImagen, unEscritor) {\n\n let nuevaReceta = new Receta(unId, unAutor, unTitulo, unTiempo, unaResenia, contadorMeGusta, contadorNoMeGusta, unaImagen, unEscritor);\n recetas.push(nuevaReceta);\n ultimoIdReceta++\n sumarReceta(unEscritor);\n return nuevaReceta;\n\n\n}", "title": "" }, { "docid": "3b24c5769568c0f0ddbb86b4c5b39ef4", "score": "0.56668746", "text": "cargarPulsacion(x, y) {\r\n juego.tableroOpciones[x][y] = \"p\";\r\n }", "title": "" }, { "docid": "f40d4d6b85e26ef04ff2d89d109b1cfc", "score": "0.5665429", "text": "function ImprimirPreguntas(tx, results) {\n\n \t\t\t\n \t\t\t\n\t\t \tvar len = results.rows.length;\n\t\t\tvar al = Math.floor(Math.random()*len);\n\t\t\t\n\t\t\t//$(\"#vi\").html('<button class=\"ui-btn\">'+ \"Preg. # \" +(1)+' de '+len+'</button>');\n \t\t\tvar arreglo = [results.rows.item(al).Pregunta, results.rows.item(al).R1, results.rows.item(al).R2, results.rows.item(al).R3, results.rows.item(al).R4, results.rows.item(al).correctas ];\n \t\t\t\n\t\t\t\t var zoo = [1,2,3,4];\n\t\t\t\tvar cantidad = 4;\n\t\t\t \n\t\t\t\tseleccionar(cantidad, zoo);\n\n\t\t\t \tfunction seleccionar(cantidad, zoo) {\n\t\t\t\t\tthis.cantidad = cantidad;\n\t\t\t\t\tthis.zoo = zoo;\n\t\t\t \n\t\t\t\t\tvar tamano = zoo.length;\n\t\t\t\t\tvar lote = new Array();\n\t\t\t \n\t\t\t\t\tvar indice = 0;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tvar aleatorio = zoo[parseInt(Math.random()* tamano)];\n\t\t\t\t\t\tif(lote.indexOf(aleatorio)!=-1){\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}else{\n\t\t\t \t\t lote[indice]=aleatorio;\n\t\t\t\t\t indice++;\n\t\t\t \t\t }\n\t\t\t\t\t} while(lote.length < cantidad);\n\t\t\t \n\t\t\t\t\tale1 = lote[0];\n\t\t\t\t\tale2 = lote[1];\n\t\t\t\t\tale3 = lote[2];\n\t\t\t\t\tale4 = lote[3];\n\t\t\t\t\t\n\t\t\t\t}\n \t\t\n \t\t\t$(\".preguntaP\").html(arreglo[0]);\n\t\t\t$(\".r1\").html('1) ' + arreglo[ale1]);\n\t\t\t$(\".r2\").html('2) ' + arreglo[ale2]);\n\t\t\t$(\".r3\").html('3) ' + arreglo[ale3]);\n\t\t\t$(\".r4\").html('4) ' + arreglo[ale4]);\n\t\t\n\n\t\t\t$('#r1').click(function(){\n \t\t\t\tacS = ale1;\n\t\t\t\tacC = arreglo[5];\n\t\t\t\t$('#prue').html(acC+'--'+acS);\n\t\t\t});\n\t\n\t\t\t$('#r2').click(function(){\n\t\t\t\tacS = ale2;\n\t\t\t\tacC = arreglo[5];\n\t\t\t\t$('#prue').html(acC+'--'+acS);\n\n\t\t\t});\n\t\t\t$('#r3').click(function(){\n\t\t\t\tacS = ale3;\n\t\t\t\tacC = arreglo[5];\n\t\t\t\t$('#prue').html(acC+'--'+acS);\n\n\t\t\t});\n\t\t\t$('#r4').click(function(){\n\t\t\t\tacS = ale4;\n\t\t\t\tacC = arreglo[5];\n\t\t\t\t$('#prue').html(acC+'--'+acS);\n\t\t\t});\n\n\n\t\t\tif(acS > 0){\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tif( acC==acS ){\n\t\t\t\tacC = 0;\n\t\t\t\tacS = 0;\n\t\t\t\tacp++;\n \t\t\t\t$(\"#correctas\").html(\"Correctas: \" + acp);\n \t\t\t\t$('input').attr(\"checked\",false).checkboxradio(\"refresh\"); \n\t\t\t\t}else{\n\t\t\t\tacC = 0;\n\t\t\t\tacS = 0;\n\t\t\t\t\taci++;\n\t\t\t\t\t$(\"#incorrectas\").html(\"Incorrectas: \" + aci);\n\t\t\t\t\t$('input').attr(\"checked\",false).checkboxradio(\"refresh\");\n\n\t\t\t\t}\n\t\t\n\t\t\t}\n\n\n\t\tif(ac <= (len+1)){\n\t\t\tvar punto = 10 / len;\n\t\t\tvar resultado = punto * (acp);\n\t\t\t$(\"#promedio\").html(\"Nota: \" + resultado );\n\t\t\tac++;\n\t\t\t$(\"#vi\").html('<button class=\"ui-btn\">'+ \"Preg. # \" +(ac)+' de '+len+'</button>');\n\t\t\tif((ac+1) > len ){\n\t\t\t\t$(\"#vi\").html('<button class=\"ui-btn\">'+ \"Preg. # \" +len+' de '+len+'</button>');\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\n\n\n\n\t\tif(ac == (len+1)){\n\t\t\t\t if(acp >= 9 && acp <= 10){\n\t\t\t\t \t$(\".preguntaP\").html('<h1 align=\"center\">Felicidades!!! Promedio Excelente: '+acp+'</h1>');\n\t\t\t\t }else if(acp >= 7 && acp <= 8){\n\t\t\t\t \t$(\".preguntaP\").html('<h1 align=\"center\">Feliciades!!! Promedio Muy bueno:'+acp+'</h1>');\n\t\t\t\t }else if(acp > 5 && acp <= 6){\n\t\t\t\t \t$(\".preguntaP\").html('<h1 align=\"center\">Feliciades!!! Promedio Bueno:'+acp+'</h1>');\n\t\t\t\t }else if(acp <= 5 ){\n\t\t\t\t \t$(\".preguntaP\").html('<h1 align=\"center\">Necesita mejorar :-( Reprobaste: '+acp+'</h1>');\n\t\t\t\t }\n\n\t\t\t\t\n\t\t\t\t\t$('.r1').replaceWith('');\n\t\t\t\t\t$('.r2').replaceWith('');\n\t\t\t\t\t$('.r3').replaceWith('');\n\t\t\t\t\t$('.r4').replaceWith('');\n\t\t\t\t\t$('#r1').replaceWith('');\n\t\t\t\t\t$('#r2').replaceWith('');\n\t\t\t\t\t$('#r3').replaceWith('');\n\t\t\t\t\t$('#r4').replaceWith('');\n\t\t\t\t\t$('#sig').replaceWith('<a href=\"principal.html\" class=\"ui-btn ui-icon-arrow-r ui-btn-icon-top\" id=\"finalizar\">Finalizar</a>');\n\t\t}\n\n\n\n\t\t\t\n\t\t\n\t\t\t\t\n\n\t\t\t\n\n\n \t/*\t\n \t\n \tvar sele = $(\"input:checked\").val();\n \tvar len = results.rows.length;\n\tvar al = Math.floor(Math.random()*len);\n \tvar arreglo = [results.rows.item(al).Pregunta, results.rows.item(al).R1, results.rows.item(al).R2, results.rows.item(al).R3, results.rows.item(al).R4, results.rows.item(al).correctas ];\n \t\t\t\n\n \tvar ar = (arreglo.length)\n\n\n \tif(sele !== undefined){\n \t\t\tac=ac+1;\n \t\t\tif(ac < len && ac > 0){\n \t\t\t\t\t\n \t\t\t\t$('#prue').html('<ul><li>'+arreglo[5]+'</li></ul>');\n\n \t\t\t$(\"#vi\").html('<button class=\"ui-btn\">'+ \"Preg. # \" +(ac+1)+' de '+len+'</button>');\n\t \t\t$(\".preguntaP\").html(arreglo[0]);\n\t\t\t$(\".r1\").html('1) ' + arreglo[1]);\n\t\t\t$(\".r2\").html('2) ' + arreglo[2]);\n\t\t\t$(\".r3\").html('3) ' + arreglo[3]);\n\t\t\t$(\".r4\").html('4) ' + arreglo[4]);\n\t\t}\n\n\t\n\tif(ac <= len && ac > 0){\n\n\t\tvar seleccionada = $(\"input:checked\").val();\n \t\t\t//var correcta = results.rows.item(ar).correctas;\n \t\t\t//alert('correcta es: ' + correcta + ' selecionada es: ' + seleccionada);\n\n \t\t\tif(seleccionada !== undefined){\n \t\t\t\tvar arre = arreglo[5];\n \t\t\t\talert(arre);\n \t\t\t\t\tif(seleccionada == arreglo[5]){\n \t\t\t\t\tacp = acp + 1;\n \t\t\t\t\t$(\"#correctas\").html(\"Correctas: \" + acp);\n \t\t\t\t\t$('input').attr(\"checked\",false).checkboxradio(\"refresh\"); \n \t\t\t\t}else{\n \t\t\t\t\taci = aci + 1;\n\t\t\t\t\t$(\"#incorrectas\").html(\"Incorrectas: \" + aci);\n\t\t\t\t\t$('input').attr(\"checked\",false).checkboxradio(\"refresh\");\n \t\t\t\t}\n\n \t\t\t}\n\t\t}\n\n\tif(ac === len){\n\t\tvar punto = 10 / len;\n\t\tvar resultado = punto * (acp);\n\n\t\t$(\"#promedio\").html(\"Nota: \" + resultado );\n\t\t$('#sig').replaceWith('<a href=\"#\" class=\"ui-btn ui-icon-arrow-r ui-btn-icon-top\" id=\"finalizar\">Finalizar</a>');\n\n\t}\n}else{\n\n\t\t\tif(ac === 0){\t\n\t\t\t$(\"#vi\").html('<button class=\"ui-btn\">Preg. # 1'+' de ' + len + '</button>');\n\t \t\t$(\".preguntaP\").html(results.rows.item(ar).Pregunta);\n\t\t\t$(\".r1\").html('1) ' + results.rows.item(ar).R1);\n\t\t\t$(\".r2\").html('2) ' + results.rows.item(ar).R2);\n\t\t\t$(\".r3\").html('3) ' + results.rows.item(ar).R3);\n\t\t\t$(\".r4\").html('4) ' + results.rows.item(ar).R4);\n\t\t\t}else{\n\t\t\t\talert(\"Seleciona una pregunta!!!\");\n\t\t\t //$(\"#Mensaje\").html('<p>Selecciona una pregunta!!!</p>');\n\t\t\t\n\t\t\t}\n\n}\n*/\n\n}", "title": "" }, { "docid": "e24e3513ac0974320078c0a40f097c66", "score": "0.5664809", "text": "function construirRutina(){\n let sRutinaCliente = this.dataset.cedula;\n setcliente(sRutinaCliente);\n construirRutinaCliente();\n\n}", "title": "" }, { "docid": "33e49fd2ce2a444e573492ac262884dd", "score": "0.56625026", "text": "function funcPedra() {\n let maquina = escolhaAleatoria();\n if(maquina == 'pedra') {\n resul = 0;\n } else if(maquina == 'papel') {\n resul = 1;\n } else {\n resul = 2;\n }\n\n mostraResultado(resul, maquina);\n}", "title": "" }, { "docid": "764ecbaf565bcf01bd7464593b656ab4", "score": "0.5658806", "text": "function perimetroCuadrado(lado){\r\n return lado * 4;\r\n}", "title": "" }, { "docid": "b3a64146ab9f7dd07fdc5e5dcc5546da", "score": "0.56581116", "text": "function pala(a,b) {\n this.x_ini = a\n this.y_ini = b\n this.x = 0\n this.y = 0\n this.height = 40\n this.width = 10\n this.ctx = null\n this.vy = 5\n this.direction = null\n this.points = 0\n\n //inicializar el contexto de las raquetas\n this.initial = function(ctx){\n this.ctx = ctx;\n this.reset();\n }\n\n //restear la posicion de las raquetas\n this.reset = function(){\n this.x = this.x_ini;\n this.y = this.y_ini;\n }\n\n //dibujar las raquetas\n this.draw = function(){\n this.ctx.fillStyle = 'MediumSeaGreen';\n this.ctx.fillRect(this.x,this.y,this.width,this.height);\n }\n\n //actualizar la posicion de las raquetas segun su movimiento\n this.update = function(){\n if(this.direction == \"up\"){\n this.y = this.y - this.vy;\n }else if(this.direction == \"down\"){\n this.y += this.vy;\n }\n }\n }", "title": "" }, { "docid": "5ca7b94a8819443ecc7095928df565a7", "score": "0.56575346", "text": "function IniciaPersonagem() {\n // entradas padroes para armas, armaduras e escudos.\n gPersonagem.armas.push(ConverteArma({\n chave: 'desarmado',\n nome_gerado: 'desarmado',\n texto_nome: Traduz('desarmado'),\n obra_prima: false,\n bonus: 0\n }));\n}", "title": "" }, { "docid": "f5a7d2f9c790d15f8f9f6a1758f2067b", "score": "0.5652083", "text": "function PART_PORTE () {\n\tif(keyDown(' ')){ //SI ON APPUIE SUR LA BARRE D'ESPACE\n\t\tfor (var i = 0; i < obj.length; i++) { // ON REGARDE TOUS LES OBJET\n\t\t\tif(obj[i].type=='porte'){ // PARTICULIÈREMENT CEUX QUI SONT DES PORTES\n\t\t\t\tif (man.position.x-20/2 >= obj[i].x && man.position.x+20 <= obj[i].x+obj[i].w) { //SI LE PERSO EST DANS L'UNE D'ELLES\n\t\t\t\t\tentreDansLaPorte = i; // ON IDENTIFIE LA PORTE\n\t\t\t\t\testEnTrainDePasserLaPorte = true; // ON NOTE CE QU'IL SE PASSE\n\t\t\t\t\tif(man.position.x > obj[i].x + obj[i].w/2){ //ON VOIS DE QUEL CÔTÉ IL PASSE LA PORTE\n\t\t\t\t\t\tpasseDansLaPorteParLaGauche = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpasseDansLaPorteParLaGauche = false;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (estEnTrainDePasserLaPorte) { // S'IL PASSE UNE PORTE\n\t\tobj[entreDansLaPorte].cachePorte(); //ON MET LE CACHE\n\n\t\t//S'IL REPASSE PAR LE MILIEU ON ANNULE\n\t\tif ((!passeDansLaPorteParLaGauche && man.position.x > obj[entreDansLaPorte].x + obj[entreDansLaPorte].w/2) ||\n\t\t\t(passeDansLaPorteParLaGauche && man.position.x < obj[entreDansLaPorte].x + obj[entreDansLaPorte].w/2)) {\n\t\t\testEnTrainDePasserLaPorte = false;\n\t\t\tentreDansLaPorte = null;\n\t\t//S'IL SORS, C'EST PARTI\n\t\t} else if(man.position.x <= obj[entreDansLaPorte].x -50 || man.position.x >= obj[entreDansLaPorte].x+obj[entreDansLaPorte].w+50) {\n\t\t\testEnTrainDePasserLaPorte = false;\n\t\t\tinstallerLaSalle(obj[entreDansLaPorte].nom);\n\t\t}\n\t}\n\n\t\n\tif (keyDown(ENTER)) { // ENTRER\n\t\tvar p = prompt(musee.extra.alert.entrer);\n\t\tif(p !== null && p !== \"\"){\n\t\t\tif(p==\"mur\") {\n\t\t\t\tcouleurMur = color(random(200,255),random(155,200),random(155,200));\n\t\t\t} else if(p==\"bolt\") {\n\t\t\t\tspeedCourse = speedCourse == 15 ? 60 : 15;\n\t\t\t} else {\n\t\t\t\tinstallerLaSalle(p);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e18b1434a6832e855c70630b9f9b4ed0", "score": "0.56491655", "text": "function ordenInicial() {\n pisoActual=pisoIni;\n recorrido=[...arrayPisos];\n}", "title": "" }, { "docid": "b4b140f1a604857bb763a0acc9d44f0c", "score": "0.56443787", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "9cbf25619adb746849d09ad037bbb452", "score": "0.56381893", "text": "_agregarYOrdenar(articuloRecivido) {\n \n let articulo = articuloRecivido;\n let articuloAux = this._primerArticulo;\n\n\n if (articulo.codigo < this._primerArticulo.codigo) {\n articulo.siguiente = this._primerArticulo;\n this._primerArticulo.anterior = articulo;\n this._primerArticulo = articulo;\n }else if(this._ultimoArticulo.codigo < articulo.codigo){\n articulo.anterior = this._ultimoArticulo;\n this._ultimoArticulo.siguiente = articulo;\n this._ultimoArticulo = articulo;\n } else {\n \n var insertado=false;\n while (articuloAux != null && !insertado) {\n \n if (articuloAux.codigo > articulo.codigo) {\n insertado=true;\n articulo.siguiente = articuloAux;\n articulo.anterior = articuloAux.anterior;\n\n articuloAux.anterior.siguiente = articulo;\n articuloAux.anterior = articulo;\n }\n\n articuloAux = articuloAux.siguiente;\n }\n console.log(this._primerArticulo)\n \n }\n\n \n }", "title": "" }, { "docid": "3aca827c3745866096c8831ee0f3d291", "score": "0.5634655", "text": "function valutaParola (parolaDaValutare){\n//creo ciclo per leggere la parola che inserisce l utente da sinistra a destra\nfor (var i = 0; i < parolaUtente.length; i++){\n var parolaDritta = parolaUtente[i];\n console.log(parolaDritta);\n}\n//creo ciclo per leggere la parola che inserisce l utente da destra a sinistra\nfor (var i = parolaUtente.length; i >= 0; i--){\n var parolaContraria = parolaUtente[i];\n console.log(parolaContraria);\n}\n var risultato;\n\n//se la parola letta dritta o al contrario è uguale è palindroma se no no\nif(parolaDritta == parolaContraria){\n risultato = 'parola palindroma';\n} else {\n risultato = 'parola non palindroma';\n}\nreturn risultato;\n}", "title": "" }, { "docid": "d4b7bca2b08c7694cc6f070a7e9597f8", "score": "0.56280065", "text": "function actualizar() {\r\n\tscore = longitudSerpiente * 10;\r\n\tcabeza = serpiente[0];\r\n\tif (izquierda) {\r\n\t\tcabeza.img = img_body_left;\r\n\t}\r\n\tif (arriba) {\r\n\t\tcabeza.img = img_body_up;\r\n\t}\r\n\tif (derecha) {\r\n\t\tcabeza.img = img_body_right;\r\n\t}\r\n\tif (abajo) {\r\n\t\tcabeza.img = img_body_down;\r\n\t}\r\n\t\r\n\tcolisiones();\r\n\r\n\t// VOY ELIMINANDO LOS ULTIMOS CUADRADOS, PARA QUE LA SERPIENTE NO SEA INFINITA.\r\n\tif (serpiente.length > longitudSerpiente) {\r\n\t\tserpiente.pop();\r\n\t}\r\n\t\r\n\t\r\n\t// CAMBIO LAS COOREDENADAS DE SERPIENTE SEGUN IZQUIERDA,DERECHA,ARRIBA O ABAJO SEAN TRUE O FALSE\r\n\tif (izquierda) { \r\n\t\tvar x = cabeza.x - cabeza.ancho;\r\n\t\tvar nuevaParte = new Cuadrado(x, cabeza.y, cabeza.ancho, cabeza.alto, img_cuadrado);\r\n\t\tserpiente.unshift(nuevaParte); // Como el push, pero al inicio del array (0) y no al final.\r\n\t}\r\n\t\r\n\tif (arriba) {\r\n\t\tvar y = cabeza.y - cabeza.alto;\r\n\t\tvar nuevaParte = new Cuadrado(cabeza.x, y, cabeza.ancho, cabeza.alto, img_cuadrado);\r\n\t\tserpiente.unshift(nuevaParte);\r\n\t}\r\n\t\r\n\tif (derecha) {\r\n\t\tvar x = cabeza.x + cabeza.ancho;\r\n\t\tvar nuevaParte = new Cuadrado(x, cabeza.y, cabeza.ancho, cabeza.alto, img_cuadrado);\r\n\t\tserpiente.unshift(nuevaParte);\r\n\t}\r\n\t\r\n\tif (abajo) {\r\n\t\tvar y = cabeza.y + cabeza.alto;\r\n\t\tvar nuevaParte = new Cuadrado(cabeza.x, y, cabeza.ancho, cabeza.alto, img_cuadrado);\r\n\t\tserpiente.unshift(nuevaParte);\r\n\t}\r\n}", "title": "" }, { "docid": "f8a2d503500c75879b0cfd51747ee736", "score": "0.5626224", "text": "function perimetroCuadrado(lado){\n return lado * 4;\n}", "title": "" }, { "docid": "0fae59c7646853e278653d354b9cc47d", "score": "0.56218576", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "0fae59c7646853e278653d354b9cc47d", "score": "0.56218576", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "6b1b81d53d66e68c9ad3574a4453fb02", "score": "0.5621845", "text": "function CargarOrden(CodPac){\r\n\t\r\n\t\r\n}", "title": "" }, { "docid": "38e68d79afc20b9b94951b5a665a8312", "score": "0.5616854", "text": "function buscarValorBaseDoProjeto(){\n var valorCusteio = textToFloat($('#vlrPiCusteio').val());\n var valorCapital = textToFloat($('#vlrPiCapital').val());\n var valorBaseDoProjeto = valorCusteio + valorCapital;\n\n return valorBaseDoProjeto;\n }", "title": "" }, { "docid": "7a965060bd0642413fe1e718e53efa98", "score": "0.56155604", "text": "function comer() {\r\n\tif (cabeza.x == comida.x && cabeza.y == comida.y) {\r\n\t\tlongitudSerpiente += 1;\r\n\t\texiste_comida = false;\r\n\t}\r\n}", "title": "" }, { "docid": "5e326b7b5f6cca2ba19efe41d6537736", "score": "0.5609911", "text": "function IncDecPrefijo_CAAS(x,y,Linea) {\n this.Linea = Linea;\n this.Tipo = x;\n this.Nombre = y; \n this.Errores = new Errores3D();\n this.AgregarError = function(descripcion){\n this.Errores.Agregar('semantico',descripcion,'Incremento o decremento prefijo',this.Linea);\n };\n this.RecuperarErrores = function(ErroresPadre){\n ErroresPadre.AgregarErrores(this.Errores);\n };\n this.Ejecutar = function(EntornoPadre){\n if(this.Nombre.type()!='variable'&&this.Nombre.type()!='variablearreglo'){\n this.AgregarError('Debe ser una variable para poder hacer incremento')\n }\n let Asignacion =null;\n if(this.Tipo=='++'){\n if(this.Nombre.type()=='variable'){\n Asignacion = new AsignacionVariable_CAAS(this.Nombre.Nombre ,new Suma_CAAS(this.Nombre,new Valor_CAAS('entero',1,this.Linea),'+',this.Linea),this.Linea);\n }else{\n Asignacion = new AsignacionVariableArreglo_CAAS(this.Nombre.Nombre ,this.Nombre.Dimensiones,new Suma_CAAS(this.Nombre,new Valor_CAAS('entero',1,this.Linea),'+',this.Linea),this.Linea);\n }\n }else{\n if(this.Nombre.type()=='variable'){\n Asignacion = new AsignacionVariable_CAAS(this.Nombre.Nombre ,new Resta_CAAS(this.Nombre,new Valor_CAAS('entero',1,this.Linea),'-',this.Linea),this.Linea);\n }else{\n Asignacion = new AsignacionVariableArreglo_CAAS(this.Nombre.Nombre ,this.Nombre.Dimensiones,new Resta_CAAS(this.Nombre,new Valor_CAAS('entero',1,this.Linea),'-',this.Linea),this.Linea);\n }\n }\n //Primero incremento o decremento y luego retorno el valor\n let Texto = Asignacion.Ejecutar(EntornoPadre);\n let ValValor = this.Nombre.Ejecutar(EntornoPadre);\n if(ValValor ==null||ValValor == undefined||Texto==null||Texto==undefined){\n this.AgregarError('Error en el valor a asignar');\n return;\n }\n this.Nombre.RecuperarErrores(this.Errores);\n Asignacion.RecuperarErrores(this.Errores);\n ValValor.Texto = Texto + ValValor.Texto;\n return ValValor;\n };\n this.type = function(){\n return 'incdecprefijo';\n };\n}", "title": "" }, { "docid": "fb4eee22215033bc6018c6d444d95802", "score": "0.56095874", "text": "function soltaClique(){\n\tif(estadoAtual == estados.jogando){\n\t\tif(personagem.move == 0){\n\t\t\tplataforma.cria = 0;\n\t\t\tplataforma.rotaciona = 1;\t\n\t\t}\n\t}\n\telse{\n\t\testadoAtual = estados.jogando;\n\t\tpersonagem.reset();\n\t\tplataforma.reset();\n\t\tplataforma.limpa();\n\t\tobstaculos.limpa();\n\t\tposicao = 0;\n\t\tnovoRecord = 0;\n\t}\n}", "title": "" }, { "docid": "fba7089e1dec8bbbf9478d877a969738", "score": "0.5607807", "text": "function _prepararReserva() {\n if(_cliente.nombre && _cliente.apellido && _cliente.dni && _cliente.telefono){\n let nombre = _cliente.nombre[0].toUpperCase() + _cliente.nombre.slice(1).toLowerCase();\n let apellido = _cliente.apellido[0].toUpperCase() + _cliente.apellido.slice(1).toLowerCase();\n\n _turnoGuardar.id = Math.floor(Math.random()*2000);\n _turnoGuardar.nombreCliente = `${nombre} ${apellido}`;\n _turnoGuardar.dniCliente = _cliente.dni;\n _turnoGuardar.telefonoCliente = _cliente.telefono;\n _turnoGuardar.actividadSeleccionada = _actividadSeleccionada.nombre[0].toUpperCase() + _actividadSeleccionada.nombre.slice(1);\n _turnoGuardar.horarioSeleccionado = _horarioSeleccionado;\n\n TurnoGuardadoDb.push(_turnoGuardar)\n\n _confirmarReserva();\n }\n}", "title": "" }, { "docid": "273f13ce294faa3272220b46579132af", "score": "0.5602325", "text": "function PrecoArmaArmaduraEscudo(tipo, tabela, chave, material, obra_prima, bonus, invertido) {\n var entrada_tabela = tabela[chave];\n if (entrada_tabela == null || entrada_tabela.preco == null) {\n return null;\n }\n // Nao pode usar invertido aqui, pq la embaixo inverte tudo.\n var preco = LePreco(entrada_tabela.preco);\n var preco_adicional = { platina: 0, ouro: 0, prata: 0, cobre: 0 };\n if (bonus && bonus > 0) {\n switch (bonus) {\n case 1: preco.ouro += tipo == 'arma' ? 2000 : 1000; break; \n case 2: preco.ouro += tipo == 'arma' ? 8000 : 4000; break; \n case 3: preco.ouro += tipo == 'arma' ? 18000 : 9000; break; \n case 4: preco.ouro += tipo == 'arma' ? 32000 : 16000; break; \n case 5: preco.ouro += tipo == 'arma' ? 50000 : 25000; break; \n default:\n return null;\n }\n }\n if (obra_prima) {\n // Armas op custam 300 a mais, armaduras e escudos, 150.\n preco_adicional.ouro += tipo == 'arma' ? 300 : 150; \n }\n // Modificadores de materiais.\n if (material != 'nenhum') {\n var preco_material = null;\n var tabela_material = tabelas_materiais_especiais[material];\n if (tabela_material.custo_por_tipo) {\n var custo = tabela_material.custo_por_tipo[tipo];\n if (custo.por_subtipo) {\n // TODO\n } else {\n preco_material = LePreco(custo);\n }\n } else if (tabela_material.custo_por_kg) {\n var peso_kg = LePeso(entrada_tabela.peso);\n preco_material = LePreco(tabela_material.custo_por_kg);\n for (var tipo_moeda in preco_material) {\n preco_material[tipo_moeda] *= peso_kg;\n }\n } else if (material == 'couro_dragao') {\n // Preco da armadura mais obra prima.\n preco_material = SomaPrecos(LePreco(entrada_tabela.preco), { ouro: 150 });\n } else if (material == 'ferro_frio') {\n // Preço da arma normal e cada bonus custa 2000 PO a mais.\n preco_material = LePreco(entrada_tabela.preco);\n preco_material['ouro'] += bonus * 2000;\n } else if (material == 'mitral') {\n // Preco tabelado de acordo com tipo da armadura ou escudo (excluidindo custo de obra prima).\n var custo = 0; // escudo ou leve.\n if (tipo == 'escudo') {\n custo = 850;\n } else {\n var talento_relacionado = entrada_tabela.talento_relacionado;\n if (talento_relacionado == 'usar_armaduras_leves') {\n custo = 850;\n } else if (talento_relacionado == 'usar_armaduras_medias') {\n custo = 3850;\n } else if (talento_relacionado == 'usar_armaduras_pesadas') {\n custo = 8850;\n }\n }\n preco_material = { ouro: custo };\n } else if (material == 'prata_alquimica') {\n var categorias = entrada_tabela.categorias;\n var custo = 0;\n if ('cac_leve' in categorias) {\n custo = 20;\n } else if ('cac' in categorias) {\n custo = 90;\n } else if ('cac_duas_maos' in categorias) {\n custo = 180;\n }\n preco_material = { ouro: custo };\n }\n // Adiciona preco do material.\n preco_adicional = SomaPrecos(preco_adicional, preco_material);\n }\n\n // Soma e se necessario, inverte.\n preco = SomaPrecos(preco, preco_adicional);\n if (invertido) {\n for (var tipo_moeda in preco) {\n preco[tipo_moeda] = -preco[tipo_moeda];\n }\n }\n return preco;\n}", "title": "" }, { "docid": "519d4e366bca98799a5bc428ec342a6d", "score": "0.5600756", "text": "function IncDecPostfijo_CAAS(x,y,Linea) {\n this.Linea = Linea;\n this.Tipo = x;\n this.Nombre = y; \n this.Errores = new Errores3D();\n this.AgregarError = function(descripcion){\n this.Errores.Agregar('semantico',descripcion,'Incremento o decremento postfijo',this.Linea);\n };\n this.RecuperarErrores = function(ErroresPadre){\n ErroresPadre.AgregarErrores(this.Errores);\n };\n this.Ejecutar = function(EntornoPadre){\n if(this.Nombre.type()!='variable'&&this.Nombre.type()!='variablearreglo'){\n this.AgregarError('Debe ser una variable para poder hacer incremento');\n return;\n }\n let Asignacion =null;\n if(this.Tipo=='++'){\n if(this.Nombre.type()=='variable'){\n Asignacion = new AsignacionVariable_CAAS(this.Nombre.Nombre ,new Suma_CAAS(this.Nombre,new Valor_CAAS('entero',1,this.Linea),'+',this.Linea),this.Linea);\n }else{\n Asignacion = new AsignacionVariableArreglo_CAAS(this.Nombre.Nombre ,this.Nombre.Dimensiones,new Suma_CAAS(this.Nombre,new Valor_CAAS('entero',1,this.Linea),'+',this.Linea),this.Linea);\n }\n }else{\n if(this.Nombre.type()=='variable'){\n Asignacion = new AsignacionVariable_CAAS(this.Nombre.Nombre ,new Resta_CAAS(this.Nombre,new Valor_CAAS('entero',1,this.Linea),'-',this.Linea),this.Linea);\n }else{\n Asignacion = new AsignacionVariableArreglo_CAAS(this.Nombre.Nombre ,this.Nombre.Dimensiones,new Resta_CAAS(this.Nombre,new Valor_CAAS('entero',1,this.Linea),'-',this.Linea),this.Linea);\n }\n }\n //Primero obtengo el valor y luego hago la asignacion\n let ValValor = this.Nombre.Ejecutar(EntornoPadre);\n let Texto = Asignacion.Ejecutar(EntornoPadre);\n if(ValValor ==null||ValValor == undefined||Texto==null||Texto==undefined){\n this.AgregarError('Error en el valor a asignar');\n return;\n }\n this.Nombre.RecuperarErrores(this.Errores);\n Asignacion.RecuperarErrores(this.Errores);\n ValValor.Texto = ValValor.Texto +Texto;\n return ValValor; \n };\n this.type = function(){\n return 'incdecpostfijo';\n };\n}", "title": "" }, { "docid": "c504cd40ebb8513c36df2dc666484242", "score": "0.559522", "text": "function clique(){\n\tif(estadoAtual == estados.jogando){\t\n\t\tif(personagem.move == 0){\t\n\t\t\tplataforma.cria = 1;\n\t\t\tplataforma.rotaciona = 0;\n\t\t}\t\n\t}\t\n}", "title": "" }, { "docid": "53c0bb2ac05f9cd82ee54433258c2359", "score": "0.5594309", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "53c0bb2ac05f9cd82ee54433258c2359", "score": "0.5594309", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "53c0bb2ac05f9cd82ee54433258c2359", "score": "0.5594309", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "53c0bb2ac05f9cd82ee54433258c2359", "score": "0.5594309", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "53c0bb2ac05f9cd82ee54433258c2359", "score": "0.5594309", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "53c0bb2ac05f9cd82ee54433258c2359", "score": "0.5594309", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "d49d60affeea7f1ac801898459c6229d", "score": "0.55921996", "text": "function ruotaValori(){\n for(let c = 0; c<val.length; c++){\n let a = val[c][2];\n for(let i = 2; i<6; i++){ // si ignorano gli elementi in posizione zero ed uno\n val[c][i] = val[c][i+1];\n }\n val[c][6] = a;\n }\n ruotaNomi();\n}", "title": "" }, { "docid": "8d13f7958883fc0682b9660c2ec7bd9e", "score": "0.55909735", "text": "function crearDatoRecorrido(value, index, ar){\n var nuevoPuntoRecorrido = {\n \"lat\": value[1],\n \"lon\": value[0],\n \"descripcion\": \"algoDesc\",\n \"tipoPunto\": 1\n }\n \n puntosRecorridoCreate.push(nuevoPuntoRecorrido);\n }", "title": "" }, { "docid": "42a163f53f6f5dd33dac4b85cfaa0043", "score": "0.5588438", "text": "function rutaEste(origen,destino,color,prueba){\n\n //obtenemos las letras y numeros de las posiciones por separado\n\n const letrao = origen.charAt(0);\n const numeroo = Number(origen.charAt(1));\n const letrad = destino.charAt(0);\n const numerod = Number(destino.charAt(1));\n\n if(numeroo != numerod){\n\n return false;\n\n }else{\n\n let indice = equivale(letrao);\n\n //Revisamos cada casilla\n\n while(indice < equivale(letrad)){\n\n indice++;\n\n //si la casilla a revisar no esta vacia\n if(!estaVacio(equivale(indice)+numeroo)){\n\n switch(indice){\n\n //si la casilla coincide con la casilla de destino, se pasa a comerla de ser posible\n //en caso de que encuentre en el camino a su destino una pieza atravesada, no podra hacer el movimiento\n case equivale(letrad):\n\n return sePuedeComer(color,destino,prueba);\n\n break;\n\n default:\n\n return false;\n\n }\n }else{\n //si se llega al destino sin obstaculos y no hay que comer ninguna pieza\n if(indice === equivale(letrad)){\n\n return true;\n\n }\n }\n }\n }\n}", "title": "" }, { "docid": "44730794ab7c78b65691eb43c072ee0e", "score": "0.55874026", "text": "function riservaRimasta(riserva, consumo) {\n var riserva;\n var consumo;\n return riserva/consumo;\n}", "title": "" }, { "docid": "9967ae8417067cefccc8f05b304b2810", "score": "0.5586298", "text": "function ajustaPainel(opcao){\n\n\t\t//verifica e fecha outras visualizações abertas\n\t\tfechaVisualizacoes();\n\n\t\tcriaBotaoSairGrafico(opcao);\n\n\t\tmontaLegenda(opcao);\n\n\t\tmontaDetalhe(opcao);\n\n}", "title": "" }, { "docid": "b422ca124fb940f969fedafbb020b32e", "score": "0.5582881", "text": "function aplicaDescuento () {\n let valorPorcentaje = $(\"#editarPorcentaje\").val();\n let productos = $(\".precioProducto\");\n let cantidad = $(\".cantidadProducto\");\n \n if (productos.length > 0) {\n for (let i = 0; i < productos.length; i++) {\n let precioProducto = Number($(productos[i]).attr(\"precioReal\")) * Number($(cantidad[i]).val());\n // let precioProducto = $(productos[i]).val();\n let porcentaje = Number(precioProducto) - Number((precioProducto * Number(valorPorcentaje)) / 100);\n \n $(productos[i]).val(porcentaje);\n sumarTotalPrecios();\n listarProductos();\n }\n }\n }", "title": "" }, { "docid": "2e026a532e2c90c08dd43e9db7a45aaa", "score": "0.55793345", "text": "function dibujarCorchea(aumento,mano,rotar,redoblar){\n //Se dibuja la corchea\n var c_container = new PIXI.Container();\n var corchea = new PIXI.Graphics()\n .lineStyle(GROSOR_DE_LINEA, 0x000000, 1)\n .moveTo(11,0)\n .lineTo(11,50)\n .moveTo(11,0)\n .bezierCurveTo(10,25,35,15,25,35);\n c_container.addChild(corchea);\n var _ellipse = ellipse(1);\n _ellipse.x=13;\n _ellipse.y=55;\n _ellipse.rotation=2.8;\n c_container.addChild(_ellipse);\n\n if(mano === 1){\n //se posiciona la corchea en el pentagrama adecuado\n c_container.x = posicion;\n c_container.y = Y_FIRST_SPACE_1;\n if (redoblar === 1){\n var redoble = dibujarRedoble();\n redoble.x = posicion;\n redoble.y = Y_FIRST_SPACE_1;\n }\n posicion=posicion+aumento;//se avanza en la posicion del pentagrama adecuado el tiempo que dura la nota\n notas.push(c_container);//Se añade la nota al vector de notas\n }\n else if (mano === 2){\n //se posiciona la c_container en el pentagrama adecuado\n var c_container = corcheaRotada();\n c_container.x=posicion2;\n c_container.y=Y_FIRST_SPACE_2;\n if (redoblar === 1){\n var redoble = dibujarRedoble();\n redoble.x = posicion2;\n redoble.y = Y_FIRST_SPACE_2;\n }\n posicion2=posicion2+aumento;//se avanza en la posicion del pentagrama adecuado el tiempo que dura la nota\n\n notas2.push(c_container);//Se añade la nota al vector de notas\n }\n if (redoblar === 1){\n añadiduras.push(redoble); //En caso de que se indique que la nota lleva redoble, se agrega el redoble al vector de añadiduras\n stage.addChild(redoble);\n }\n\n\n stage.addChild(c_container); //Se agrega la corchea a la parte visual\n}", "title": "" }, { "docid": "1bff28be88f37a08f185530489d084aa", "score": "0.5573071", "text": "function js_ponerDeudores() {\n var tapa = 0; // Total apartamentos.\n var tpor = 0; // Porcentaje total de deuda.\n var sumt = 0; // Suma total de deudores.\n \n // Recorre los portales.\n for(var p=1; p<=gNumPort; p++) {\n var aps = js_apartPortal(p); // Apartamento inicial y final del portal.\n var apa = parseInt($('#pap'+p).html()); // Numero de apartamentos en el portal.\n var deu = 0; // Numero de deudores en el portal.\n \n // Recorre los apartamentos del portal.\n for(var i=aps[0]; i<=aps[1]; i++) {\n var nom1 = \"or\" + i; // Nombre deuda ordinaria.\n var nom2 = \"ex\" + i; // Nombre deuda extraordinaria.\n deu += (js_aFloat($('#'+nom1).val()) > 0 || js_aFloat($('#'+nom2).val()) > 0) ? 1 : 0;\n }\n var por = deu * 100 / apa; // Porcentaje de deudores del portal.\n $('#pde'+p).html(deu); // Numero de deudores del portal.\n $('#ppo'+p).html(\"(\" + por.toFixed(2) + \" %)\"); // Porcentaje de deudores del protal.\n sumt += deu; // Numero de deudores total.\n }\n tapa = parseInt($('#tap').html()); // Total apartamentos.\n tpor = sumt * 100 / tapa; // Porcentaje total de deudores.\n $('#tde').html(sumt); // Total deudores.\n $('#tdapar').html(sumt); // Total deudores en la cabecera.\n $('#tpo').html(\"(\" + tpor.toFixed(2) + \" %)\"); // Porcentaje total de deudores al final.\n $('#tdporc').html(tpor.toFixed(2) + \" %\"); // Porcentaje total de deudores en la cabecera.\n}", "title": "" }, { "docid": "bc09c3e6e20b351aad684effca22c3d7", "score": "0.55714506", "text": "function perimetroCuadrado (lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "7e55c7082398f4d35a11e93aef69df77", "score": "0.5569579", "text": "function solucionAristas() {\n pAristas = true;\n var pieza = a;\n var buf1 = \"white\"; //El color del buffer siempre sera blanco\n var buf2 = \"green\"; //El color de la pareja1 del buffer siempre sera verde\n var revisados = []; //Lista de piezas revisadas\n var haciaColor;\n var pareja1;\n var haciaColor2;\n var posible;\n var flag = false;\n var listaAristas = []; //lista de aristas que faltan por revisar\n\n pAristas = true;\n\n /**\n * loop principal. se repetira hasta que no existan piezas en el arreglo\n * de aristas por revisar\n */\n memoAristas: while (true) {\n /**loop que representa cada ciclo de memorizacion*/\n cicloMemoA: do {\n /**Bloque buffer, se saltara este bloque cada que el loop\n * de memorizacion tenga condicion verdadera\n */\n bufferA: {\n if (flag) {\n flag = false\n break bufferA;\n }\n haciaColor = hacia(pieza);\n pareja1 = perteneciente(pieza);\n haciaColor2 = hacia(pareja1);\n\n revisados.push(pieza); //Se agrega pieza y pareja a la lista de revisados\n revisados.push(pareja1);\n\n if ((haciaColor == buf1 && haciaColor2 == buf2)\n || (haciaColor == buf2 && haciaColor2 == buf1)) {\n break cicloMemoA; //rompe ciclo de memorizacion\n }\n }\n\n\n /**Checa cada pieza del arreglo posibles hasta encontrar la pieza correcta */\n for (var posible in posibles(haciaColor)) {\n var parejaTemp1 = perteneciente(posibles(haciaColor)[posible]);\n var haciaColorTemp2 = centro(parejaTemp1);\n\n if (haciaColorTemp2 == haciaColor2) {\n aristasMemo.push(posibles(haciaColor)[posible]);\n pieza = posibles(haciaColor)[posible];\n break; //rompe el for una vez que encontro la pieza\n }\n }\n\n } while (true);\n\n listaAristas = [a, b, c, d, e, f, g, h, \"i\", j, k, l, m, n, o, p, q, r, s, t, u, v, w, x];\n\n for (var pza in revisados) {\n listaAristas.remove(revisados[pza]); //Mmmmm aunque se revisaron todas, el arreglo queda en length 1.\n }\n if (listaAristas.length == 0) {\n break memoAristas; //rompe el loop principal en caso de que el arreglo ya no tenga piezas por revisar\n }\n var rnd = randomInt(0, listaAristas.length - 1);\n pieza = listaAristas[rnd];\n pareja1 = perteneciente(pieza);\n buf1 = hacia(pieza);\n buf2 = hacia(pareja1);\n haciaColor = buf1;\n haciaColor2 = buf2;\n\n aristasMemo.push(pieza);\n revisados.push(pieza);\n revisados.push(pareja1);\n flag = true;\n }\n var aristasRepetidas = [];\n for (var i in aristasMemo) {\n var aristaRepetida;\n if (aristasMemo[i] == aristasMemo[i - 1]) {\n aristaRepetida = aristasMemo[i];\n aristasRepetidas.push(aristaRepetida);\n }\n }\n for (var i in aristasRepetidas) {\n aristasMemo.remove(aristasRepetidas[i]);\n aristasMemo.remove(aristasRepetidas[i]);\n }\n\n if ((aristasMemo.length != 0) && ((aristasMemo.length % 2) != 0)){\n aristasMemo.push(z);}\n}", "title": "" }, { "docid": "3410a6cf9ba49ec70180f7b9fd25d006", "score": "0.55657375", "text": "rellenarbombo() {\n for (let i = 1; i < 91; i++) {\n this.restantes.push(i);\n }\n }", "title": "" }, { "docid": "2ae1bbe178d72910767f5b7a05ac9457", "score": "0.5564958", "text": "function actualizarCarrito() {\r\n contadorCarrito.innerText= carrito.length\r\n precioTotal.innerText= carrito.reduce((acc,el) => acc + el.obtenerTotal(), 0)\r\n}", "title": "" }, { "docid": "7aa71bf332a0c0c31430df44887f63f3", "score": "0.556209", "text": "function buscarValorDoProjeto(){\n var valorCusteio = textToFloat($('#picvalorcusteio').val());\n var valorCapital = textToFloat($('#picvalorcapital').val());\n var valorDoProjeto = valorCusteio + valorCapital;\n\n return valorDoProjeto;\n }", "title": "" }, { "docid": "b94553264272f2c39d916eecf8e163ae", "score": "0.5558801", "text": "montarCompra() {\n const vm = this;\n // Deletando as propriedades não necessários para o request\n delete vm.usuario.id_usuario;\n delete vm.usuario.data_nascimento;\n delete vm.usuario.data_token;\n delete vm.usuario.data_registro;\n delete vm.usuario.compras;\n delete vm.usuario.bool_verificado;\n delete vm.usuario.str_token_verificacao;\n delete vm.usuario.str_senha;\n \n // Monta objeto de retorno\n vm.compra = {\n usuario : vm.usuario,\n date_consulta : vm.data.toISOLocal(), \n str_matricula_prestador : vm.associado.prestador,\n str_matricula_credenciado : vm.associado.credenciado,\n str_especialidade : vm.filtro.especialidade.id,\n str_associado_endereco : vm.associado.associadoEnderecoHorario,\n dec_valor_consulta : parseFloat(vm.precoConsulta),\n ordemDeChegada : vm.associado.ordemdeChegada\n };\n }", "title": "" }, { "docid": "950a10fac09f6662748755a1a8601935", "score": "0.555615", "text": "function comenzarTrazo() {\n banderaDibujo = true;\n}", "title": "" }, { "docid": "f5447041ee6460dc08ce5d1d068743a9", "score": "0.5552703", "text": "function repararAuto(auto,mecanico){\n\n\n let danios = auto.danios\n let reparaciones = mecanico.reparaciones\n let daniosQueSePuedenArreglar = []\n\n// Aqui lo que ocurre es que itero dos veces, como danios y reparciones son arrays de 3 objetos, se itera un total de 9 veces, cuando en una de esas 9 iteraciones se alinean \n// los resultados de los danios del auto y las reparaciones del mecanico se activa el if que los agrupa el resultado comun en un array\n for (var i = 0; i < reparaciones.length; i++){\n for (var j = 0; j < danios.length; j++){\n if (reparaciones[i]===danios[j]){\n daniosQueSePuedenArreglar.push(reparaciones[i]) \n }\n \n }\n \n }\n// Aca hice un destructuring porque cualquier uso de un ciclo hacia que pudiera sacar una pero no las dos reparaciones pendientes, excedi el numero de variables en el \n// destructuring tanto como en el filter ya que no afecta el resultado (no da error), tengo la limitacion de que no pueda ser introducido un auto que tenga mas \n// de 5 danios junto con un mecanico que no sepa arregalar ninguna de las 5. Siempre puedo aumentar mas este numero aunque de todas maneras falla en ser perfectamente generica.\n// MENSAJE AL CORRECTOR : probe filter pero no podia filtrar al mismo tiempo todo sin dejar de ser generico, usando un ciclo podia sacar uno en cada iteracion pero no de forma\n// acumulativa, despues de probar varios metodos de array e incluso usando .join algunos de strings me quede con el destructuring porque en ultima instancia podria hacer que el\n// tamaño del array usado en el destructuring [alfa, beta, charlie, delta, epsilon] dependa del .length del array de danios y reparaciones comunes. Si bien no se como hacer eso\n// suena logica que se pueda crear algun tipo de array aleatorio con tan solo poner su length. \n \n let [alfa, beta, charlie, delta, epsilon] = daniosQueSePuedenArreglar\n postReparaciones = danios.filter(function(danio){\n return danio != alfa && danio != beta && danio != charlie && danio != delta && danio != epsilon\n })\n \n auto.danios = postReparaciones\n\n}", "title": "" }, { "docid": "a68fbf734ac46b7f8e739cbbde5b72e7", "score": "0.55521566", "text": "function actualizaOro (){\r\n\t\tvar nuevoOroActual = parseInt (oroCiudadActual.textContent);\r\n\t\t\r\n\t\tif (oroTotal < 0){\r\n\t\t\toroCiudadActual.style.color = \"#FF0000\";\r\n\t\t\toroCiudadActual.style.fontWeight = \"bold\";\r\n\t\t}else{\r\n\t\t\toroCiudadActual.style.color = \"#612D04\";\r\n\t\t\toroCiudadActual.style.fontWeight = \"normal\";\r\n\t\t}\r\n\r\n\t\tdocument.getElementById (\"oroTotal\").textContent = transformaCifra (oroTotal + nuevoOroActual - oroActual);\r\n\t}", "title": "" }, { "docid": "23bd9c1c69a62820c86128db846f808a", "score": "0.55501026", "text": "presupuestoRestante (cantidad = o) {\n return this.restante -= Number(cantidad);\n }", "title": "" }, { "docid": "2431255a73fba8233a26e6a0d54dcf38", "score": "0.55499434", "text": "function reativarRechamar(){\n ativar('bt_chamar_voz, bt_rechamar, bt_iniciar_atendimento, bt_cancelar');\n reativaRechamar();\n}", "title": "" }, { "docid": "52a4705e8c02060864d7795a4c5b4ff4", "score": "0.55489045", "text": "function setDetallesComercioCarrito(idcomercio, valordomicilio, idciudad, idagencia, nombreComercio)\n{\n var car = getCarrito();\n if (car.productos.length === 0)\n {\n car.idComercio = idcomercio;\n car.valorDomicilio = valordomicilio;\n car.idCiudad = idciudad;\n car.idAgencia = idagencia;\n setVariable(\"nombreComercio\", nombreComercio);\n }\n\n setVariable(\"carrito\", car.toString());\n}", "title": "" }, { "docid": "7e950ea4cc3b3630272f44a32b0c1397", "score": "0.5542276", "text": "function movCaballo(origen, destino, color,prueba){\n\n //obtenemos las letras y numeros de las posiciones por separado\n\n const letrao = origen.charAt(0);\n const numeroo = Number(origen.charAt(1));\n const letrad = destino.charAt(0);\n const numerod = Number(destino.charAt(1));\n\n //Calculamos el valor absoluto de la distancia en Y y en X\n\n let difY = numerod - numeroo;\n if(difY<0){ difY=difY*-1}\n\n let difX = equivale(letrad) - equivale(letrao);\n if(difX<0){ difX=difX*-1}\n\n let suma = difX + difY;\n\n if(suma === 3 && difX != 0 && difX != 3){\n\n if(estaVacio(destino)){\n\n return true;\n\n } else{\n\n return sePuedeComer(color,destino,prueba);\n\n }\n \n }else{\n\n return false;\n\n }\n\n}", "title": "" }, { "docid": "0395f539665a1680039099c15850e446", "score": "0.55391544", "text": "function dibujarClick(cantidad_figuras) {\n var opcion = parseInt(texto_figuras.value);\n var cantidad_figuras = parseInt(texto_cantidad.value);\n if (cantidad_figuras > 0 && cantidad_figuras < 401) {\n papel.clearRect(origenX, origenY, anchoCanvas, altoCanvas);\n console.log(\"El valor de la varia opcion es: \" + opcion);\n if (opcion == 1) {\n cuadrados();\n function cuadrados() {\n var colorTrazo = \"red\";\n var xi, yi, ancho, largo, contador, indicadorCuadradito;\n var cuadraditos, indicadorxi;\n xi = 2.5;\n yi = 0;\n ancho = 10;\n largo = ancho;\n cuadraditos = 0;\n indicadorCuadradito = true;\n indicadorxi = true;\n indicadorxi = true;\n for (contador = 0; contador < cantidad_figuras*2; contador++) {\n if (xi > 299) {\n indicadorxi = false;\n console.log(\"El valor del indicadorXi es: \" + indicadorxi);\n xi = 2.5;\n yi = yi + 15;\n indicadorCuadradito = true;\n indicadorxi = true;\n console.log(\"El valor de yi: \" + yi);\n }\n if (indicadorCuadradito == true && indicadorxi == true) {\n indicadorCuadradito = false;\n dibujoCanvasCuadraditos(colorTrazo, xi, yi, ancho, largo);\n cuadraditos++;\n console.log(\"Número de cuadradito: \" + cuadraditos);\n } \n else if (indicadorxi == true) {\n xi = xi + 15;\n indicadorCuadradito = true;\n console.log(\"El valor de xi: \" + xi);\n }\n }\n }\n function dibujoCanvasCuadraditos(colorLinea, xinicial, yinicial, anchoCuadrado, altoCuadrado) {\n papel.beginPath();\n papel.strokeStyle = colorLinea;\n papel.strokeRect(xinicial, yinicial, anchoCuadrado, altoCuadrado);\n papel.closePath();\n }\n } else\n if (opcion == 2) {\n triangulos();\n function triangulos() {\n var xi, yi, xf, yf, cl, ct, ict;\n var indicadorEjeX;\n ict = 0;\n for (ct = 1; ct <= cantidad_figuras; ct++) {\n indicadorEjeX = false;\n ict++;\n if (ct == 21 || ct == 41 || ct == 61 || ct == 81 || ct == 101 || ct == 121 || ct == 141 || ct == 161 || ct == 181 || ct == 201 || ct == 221 || ct == 241 || ct == 261 || ct == 281 || ct == 301 || ct == 321 || ct == 341 || ct == 361 || ct == 381) {\n indicadorEjeX = true;\n }\n if (indicadorEjeX == true) {\n ict = 1;\n indicadorEjeX = false;\n }\n for (cl = 0; cl <= 2; cl++) {\n if (ict == 1) {\n xi = 5 * cl;\n xf = 5 * (cl + 1);\n } else {\n xi = 5 * cl + 15 * (ict - 1);\n xf = 5 * (cl + 1) + 15 * (ict - 1);\n }\n \n if (ct <= 20) {\n yi = 10;\n yf = 0;\n } else \n if (ct > 20 && ct < 41) {\n yi = 25;\n yf = 15;\n } else \n if (ct > 40 && ct < 61) {\n yi = 40;\n yf = 30;\n } else \n if (ct > 60 && ct < 81) {\n yi = 55;\n yf = 45;\n } else \n if (ct > 80 && ct < 101) {\n yi = 70;\n yf = 60;\n } else \n if (ct > 80 && ct < 101) {\n yi = 70;\n yf = 60;\n } else \n if (ct > 100 && ct < 121) {\n yi = 85;\n yf = 75;\n } else\n if (ct > 120 && ct < 141) {\n yi = 100;\n yf = 90;\n } else\n if (ct > 140 && ct < 161) {\n yi = 115;\n yf = 105;\n } else\n if (ct > 160 && ct < 181) {\n yi = 130;\n yf = 120;\n } else\n if (ct > 180 && ct < 201) {\n yi = 145;\n yf = 135;\n } else\n if (ct > 180 && ct < 201) {\n yi = 145;\n yf = 135;\n } else \n if (ct > 200 && ct < 221) {\n yi = 160;\n yf = 150;\n } else \n if (ct > 220 && ct < 241) {\n yi = 175;\n yf = 165;\n } else \n if (ct > 240 && ct < 261) {\n yi = 190;\n yf = 180;\n } else \n if (ct > 260 && ct < 281) {\n yi = 205;\n yf = 195;\n } else \n if (ct > 280 && ct < 301) {\n yi = 220;\n yf = 210;\n } else \n if (ct > 300 && ct < 321) {\n yi = 235;\n yf = 225;\n } else \n if (ct > 320 && ct < 341) {\n yi = 250;\n yf = 240;\n } else \n if (ct > 340 && ct < 361) {\n yi = 265;\n yf = 255;\n } else \n if (ct > 360 && ct < 381) {\n yi = 280;\n yf = 270;\n } else \n if (ct > 380 && ct <= 400) {\n yi = 295;\n yf = 285;\n }\n if (cl == 0) {\n dibujoCanvasTriangulito(colorTrazo, xi, yi, xf, yf);\n } else \n if (cl == 1) {\n if (ct < 21) {\n yi = yf;\n yf = 10;\n } else \n if (ct > 20 && ct < 41) {\n yi = yf;\n yf = 25;\n } else \n if (ct > 40 && ct < 61) {\n yi= yf;\n yf = 40;\n } else \n if (ct > 60 && ct < 81) {\n yi= yf;\n yf = 55;\n } else \n if (ct > 80 && ct < 101) {\n yi = yf;\n yf = 70;\n } else \n if (ct > 100 && ct < 121) {\n yi = yf;\n yf = 85;\n } else\n if (ct > 120 && ct < 141) {\n yi = yf;\n yf = 100;\n } else\n if (ct > 140 && ct < 161) {\n yi = yf;\n yf = 115;\n } else\n if (ct > 160 && ct < 181) {\n yi = yf;\n yf = 130;\n } else\n if (ct > 180 && ct < 201) {\n yi = yf;\n yf = 145;\n } else \n if (ct > 200 && ct < 221) {\n yi = yf;\n yf = 160;\n } else \n if (ct > 220 && ct < 241) {\n yi = yf;\n yf = 175;\n } else \n if (ct > 240 && ct < 261) {\n yi = yf;\n yf = 190;\n } else \n if (ct > 260 && ct < 281) {\n yi = yf;\n yf = 205;\n } else \n if (ct > 280 && ct < 301) {\n yi = yf;\n yf = 220;\n } else \n if (ct > 300 && ct < 321) {\n yi = yf;\n yf = 235;\n } else \n if (ct > 320 && ct < 341) {\n yi = yf;\n yf = 250;\n } else \n if (ct > 340 && ct < 361) {\n yi = yf;\n yf = 265;\n } else \n if (ct > 360 && ct < 381) {\n yi = yf;\n yf = 280;\n } else \n if (ct > 380 && ct <= 400) {\n yi = yf;\n yf = 295;\n }\n dibujoCanvasTriangulito(colorTrazo, xi, yi, xf, yf);\n } else { \n if (ct < 21) {\n yf = 10;\n } else \n if (ct > 20 && ct < 41) {\n yi = 25;\n yf = yi;\n } else \n if (ct > 40 && ct < 61) {\n yi= 40;\n yf = yi;\n } else \n if (ct > 60 && ct < 81) {\n yi = 55;\n yf = yi;\n } else \n if (ct > 80 && ct < 101) {\n yi = 70;\n yf = yi;\n } else \n if (ct > 100 && ct < 121) {\n yi = 85;\n yf = yi;\n } else\n if (ct > 120 && ct < 141) {\n yi = 100;\n yf = yi;\n } else\n if (ct > 140 && ct < 161) {\n yi = 115;\n yf = yi;\n } else\n if (ct > 160 && ct < 181) {\n yi = 130;\n yf = yi;\n } else \n if (ct > 180 && ct < 201) {\n yi = 145;\n yf = yi;\n } else \n if (ct > 200 && ct < 221) {\n yi = 160;\n yf = yi;\n } else \n if (ct > 220 && ct < 241) {\n yi = 175;\n yf = yi;\n } else \n if (ct > 240 && ct < 261) {\n yi = 190;\n yf = yi;\n } else \n if (ct > 260 && ct < 281) {\n yi = 205;\n yf = yi;\n } else \n if (ct > 280 && ct < 301) {\n yi = 220;\n yf = yi;\n } else \n if (ct > 300 && ct < 321) {\n yi = 235;\n yf = yi;\n } else \n if (ct > 320 && ct < 341) {\n yi = 250;\n yf = yi;\n } else \n if (ct > 340 && ct < 361) {\n yi = 265;\n yf = yi;\n } else \n if (ct > 360 && ct < 381) {\n yi = 280;\n yf = yi;\n } else \n if (ct > 380 && ct <= 400) {\n yi = 295;\n yf = yi;\n }\n xf = xf - 15;\n dibujoCanvasTriangulito(colorTrazo, xi, yi, xf,yf);\n }\n }\n }\n }\n \n function dibujoCanvasTriangulito(colorLinea, xinicial, yinicial, xfinal, yfinal) {\n papel.beginPath();\n papel.strokeStyle = colorLinea;\n papel.moveTo(xinicial, yinicial);\n papel.lineTo(xfinal, yfinal);\n papel.stroke();\n papel.closePath();\n }\n } else \n if (opcion == 3) {\n Circunferencia();\n function Circunferencia() {\n var x, y, radio, anguloPartida,anguloFinal, contadorCirculos;\n var indicadorDeCirculos;\n x = 6;\n y = 6;\n radio = 5;\n anguloPartida = 0;\n anguloFinal = 2 * Math.PI;\n indicadorDeCirculos = false;\n for (contadorCirculos = 1; contadorCirculos <= cantidad_figuras*2; contadorCirculos++) {\n if (x > 299) {\n x = 6;\n y = y + 15; \n }\n if (indicadorDeCirculos == true) {\n x = x + 15;\n indicadorDeCirculos = false;\n } else {\n dibujoCanvasCirculo(colorTrazo, x, y, radio, anguloPartida, anguloFinal);\n indicadorDeCirculos = true;\n }\n }\n function dibujoCanvasCirculo (colorLinea, x, y, radio, anguloPartida, anguloFinal) {\n papel.beginPath();\n papel.strokeStyle = colorLinea;\n papel.arc(x ,y , radio, anguloPartida, anguloFinal);\n papel.stroke(); \n papel.closePath();\n }\n }\n } else {\n alert(\"Hay un error. Verifique los datos.\");\n }\n } else {\n alert(\"Hay un error. Verifique los datos.\");\n }\n}", "title": "" }, { "docid": "890f4d7f1b909470c30f9901e8b98c80", "score": "0.5535787", "text": "agregarPelicula() {\n this.peliculas.unshift({\n titulo: this.nuevaPelicula,\n nominada: false,\n director: 'Jhon Doe',\n año: 3000\n });\n this.nuevaPelicula = null;\n }", "title": "" }, { "docid": "2948f13cdd2244aef88532127217c9f0", "score": "0.5535289", "text": "function Compra(producto, cantidad){\r\n this.producto = producto;\r\n this.cantidad = cantidad;\r\n this.precioTotal = producto.precio*cantidad;\r\n\r\n this.agregarAlCarrito = function(carritoDeCompras){carritoDeCompras.agregarCompra(this)}\r\n}", "title": "" }, { "docid": "a58488e3ec870caa3ebd0f157ddb7119", "score": "0.55257237", "text": "function ActualizarParametrosRecibidor(Parametros,ParametrosTresHoras,flgPrimeraVez)\n{\n\tconsole.log(\"ActualizarParametrosRecibidor\\n\");\n\t//ActualizarFooter(Parametros);\n\tvar objeto;\n\tfor (x=0;x<tabla_objetos.length;x++)\n\t{\n\t\tobjeto=tabla_objetos[x];\n\t\tobjeto.ProcesaDatos(Parametros,ParametrosTresHoras,flgPrimeraVez);\n\t\t\n\t}\n}", "title": "" }, { "docid": "7c17486068b7abdd62798d8f2beb6dd6", "score": "0.5515977", "text": "presupuestoRestante(cantidad) {\n const restante = document.getElementById('restante');\n\n const presupuestoRestanteUsuario = cantidadPresupuesto.presupuestoRestante(cantidad);\n\n restante.innerHTML = `${presupuestoRestanteUsuario}`;\n\n this.comprobarPresupuesto()\n }", "title": "" }, { "docid": "94feb642921579ccfe088dfe90fe09a9", "score": "0.5511839", "text": "function generaPorcentaje({idEtapa },valorMinimo,nuevoStado,variables,datos,subindicador) {\n let formula;\n variables.map(variable => {\n let idVariable = variable.id - 1,\n etapa; \n if(subindicador){\n etapa = parseInt(\n nuevoStado.subindicadores[0].variables[idVariable].etapas[idEtapa].valor\n );\n }else{\n etapa= parseInt(\n nuevoStado.variables[idVariable].etapas[idEtapa].valor\n ); \n }\n let ideEtapa = idEtapa;\n let variables = []\n if(subindicador){\n variables = nuevoStado.subindicadores[0].variables[0]\n }else{\n variables =nuevoStado.variables[0]\n }\n variables.etapas.map(etapaEstadoUno => {\n if (ideEtapa === etapaEstadoUno.idEtapa - 1) {\n if(datos.datos.formaDeIndicador === undefined || datos.datos.formaDeIndicador.length === 0){\n datos.datos.formaDeIndicador = \"incremento\";\n }\n formula = seleccionDeTipoDeIndicador(datos.datos.formaDeIndicador,etapaEstadoUno,valorMinimo,etapa);\n }\n return true;\n });\n if(idVariable === 0){\n formula = 100;\n }\n if(subindicador){\n nuevoStado.subindicadores[0].variables[idVariable].etapas[\n idEtapa\n ].porcentaje = formula;\n }else{\n nuevoStado.variables[idVariable].etapas[\n idEtapa\n ].porcentaje = formula;\n }\n return true;\n });\n}", "title": "" }, { "docid": "f82837d16b62f66db73f315c40ef2b45", "score": "0.5511313", "text": "trasladarDerecha(){\n //Comprueba si la posicion sumando tres es menor que el total de paquetes de monedas a comprar\n //Es decir si hay más sprites\n if((this.monedasPosicion+this.monedasButton.length)<monedas.length){\n //Incrementa la posicion\n this.monedasPosicion++;\n //Cambia los sprites de los botones\n var i;\n for (i = 0; i < this.monedasButton.length; i++) {\n if(espanol){\n this.monedasButton[i].setTexture(monedas[this.monedasPosicion+i].sprite);\n }else{\n this.monedasButton[i].setTexture(monedas[this.monedasPosicion+i].spritei);\n }\n }\n }\n \n }", "title": "" }, { "docid": "dbf1d9be022ddd78f19d837cefec8856", "score": "0.5502199", "text": "pokreni () {\n for (let i = 0; i < this.broj_pokusaja; i++) {\n // pokupi rezultat ove igre\n let rezultat = this.igra();\n\n // vidi koja je kategorija vracena, promenjen izbor ili ne\n if (rezultat.promenjen_izbor) {\n // popuni promenu izbora\n this.rezultat.promenio.izbor++;\n if (rezultat.pogodak) {\n this.rezultat.promenio.pogodaka++;\n } else {\n this.rezultat.promenio.promasaja++;\n }\n } else {\n // popuni kad nije promena izbora\n this.rezultat.nije_promenio.izbor++;\n if (rezultat.pogodak) {\n this.rezultat.nije_promenio.pogodaka++;\n } else {\n this.rezultat.nije_promenio.promasaja++;\n }\n }\n }\n }", "title": "" }, { "docid": "5d38fe4d250dffa1e4ca0a4bfd830641", "score": "0.5501037", "text": "function cor_resposta(res) {\n if (res == \"ACERTO\") {\n return fill(verde);\n } else {\n return fill(vermelho);\n }\n}", "title": "" }, { "docid": "7ce405de33b93a13d883d8cf8105567f", "score": "0.55000323", "text": "function limpiarPoligonos()\n{\n\n}", "title": "" }, { "docid": "c4b80bcd9221fa53e3fae4f022faa83f", "score": "0.54988444", "text": "function pararDibujar() {\n pintarLinea = false;\n}", "title": "" }, { "docid": "86df037fc2473ffaecf3daa67f61316f", "score": "0.54961634", "text": "function rutaSur(origen,destino,color,prueba){\n\n //obtenemos las letras y numeros de las posiciones por separado\n\n const letrao = origen.charAt(0);\n const numeroo = Number(origen.charAt(1));\n const letrad = destino.charAt(0);\n const numerod = Number(destino.charAt(1));\n\n if(letrao != letrad){\n\n return false;\n\n }else{\n\n //Revisamos cada casilla\n\n let indice = numeroo;\n\n while(indice > numerod){\n\n indice--;\n\n //si la casilla a revisar no esta vacia\n\n if(!estaVacio(letrao+indice)){\n\n switch(indice){\n\n //si la casilla coincide con la casilla de destino, se pasa a comerla de ser posible\n //en caso de que encuentre en el camino a su destino una pieza atravesada, no podra hacer el movimiento\n case numerod:\n\n return sePuedeComer(color,destino,prueba);\n\n break;\n\n default:\n\n return false;\n\n }\n }else{\n //si se llega al destino sin obstaculos y no hay que comer ninguna pieza\n if(indice === numerod){\n\n return true;\n\n }\n }\n }\n }\n}", "title": "" }, { "docid": "6f367e158a098af159646a7c183edf4a", "score": "0.5493905", "text": "function pedido (metro){\n\tvar pulgadas = metro*39.37;\n\n\tconsole.log (pulgadas);\n}", "title": "" }, { "docid": "03d13e5fc6b78c4a64fa9e94cd9157eb", "score": "0.5492093", "text": "function movimento(){\r\n\tpalla.x +=palla.velx;\r\n\tpalla.y +=palla.vely;\r\n\t//controllo il movimento della barra del pc\r\n\t\r\n\t//controllo collisione y;\r\n\tif(palla.y + palla.raggio > canvas.height || palla.y - palla.raggio < 0){\r\n\t\tpalla.vely = -palla.vely; \r\n\t}\r\n\tvar player = (palla.x < canvas.width/2)? user:pc;\t\t//se true player=user else player=pc;\r\n\t//se la palla colpisce una delle due barre\r\n\tif(collisione(palla,player)){\r\n\t\t\r\n\tvar puntoCollisione = (palla.y - (player.y + player.height/2));\t\t//calcolo del punto di collisione, se è 0 la palla ha colpito il centro della barra, se -1 l'angolo alto, se 1 l'angolo basso\r\n\tpuntoCollisione = puntoCollisione/(player.height/2);\t\t//per avere range da -1 a 1\r\n\t//calcolo angolo in radianti\r\n\tvar angolo = puntoCollisione * (Math.PI/4);\t\t//se colpisce gli angoli della barra la palla deve avere un angolo di +-45 gradi\r\n\tvar direzione = (palla.x < canvas.width/2) ? 1 : -1;\t\t//per cambiare direzione della palla in base a quale barra colpisce\r\n\t//cambio velociyà e direzione in base al punto della barra colpito\r\n\tpalla.velx = direzione*\tpalla.vel * Math.cos(angolo);\r\n\tpalla.vely = direzione*\tpalla.vel * Math.sin(angolo);\r\n\t\r\n\tif (player==user)\r\n\t {colorepalla=\"RED\";}\r\n\telse\r\n\t{colorepalla=\"BLUE\";}\t\t\r\n\r\n\tpalla.vel += 1;\t\t//per incrementare la difficoltà\r\n\tif(player==user){\r\n\t\thighsound();\r\n\t}\r\n\telse{\r\n\t\tlowsound();\r\n\t}\r\n\t}\r\n\t//se viene fatto punto\r\n\tif(palla.x - palla.raggio < 0){\r\n\t\tpc.score++;\t\r\n\t\tlosesound();\r\n\t\tresetPalla();\r\n\t}else if(palla.x + palla.raggio > canvas.width){\r\n\t\tuser.score++;\r\n\t\twinsound();\r\n\t\tresetPalla();\r\n\t}\t\t\r\n\t\r\n}", "title": "" }, { "docid": "abe6770ea5f3adff956f3efd843b755c", "score": "0.54901516", "text": "function reloj(){\n\tm = pad_left(m); \n\ts = pad_left(s);\n document.getElementById('displayReloj').innerHTML = m+\":\"+s;\n\tdocument.getElementById('titulo').innerHTML = m+\":\"+s+\" || POMODORO\";\n}", "title": "" }, { "docid": "244dfd16b9d238aad663df5350e3024a", "score": "0.5487713", "text": "function vaciarCarrito() {\n // Limpiamos los productos guardados\n carrito = [];\n // Renderizamos los cambios\n renderizarCarrito();\n calcularTotal();\n }", "title": "" }, { "docid": "244dfd16b9d238aad663df5350e3024a", "score": "0.5487713", "text": "function vaciarCarrito() {\n // Limpiamos los productos guardados\n carrito = [];\n // Renderizamos los cambios\n renderizarCarrito();\n calcularTotal();\n }", "title": "" }, { "docid": "3480eda8a061e2a640385135b7b449e9", "score": "0.54802775", "text": "function posicaoPapinha() {\n comeu = true;\n while (xPapinha % tamanho != 0 || comeu == true) {\n xPapinha = Math.floor(Math.random() * (canvas.width - tamanho) + tamanho);\n comeu = false;\n }\n\n comeu = true;\n\n while (yPapinha % tamanho != 0 || comeu == true) {\n yPapinha = Math.floor(Math.random() * (canvas.height - tamanho) + tamanho);\n comeu = false;\n }\n\n //VERIFICA SE A NOVA POSICAO DA PAPINHA NAO COINCIDE COM A POSICAO DA CAUDA\n var cont = 0;\n\n for (var i = 0; i < caudaArray.length; i++) {\n if (caudaArray[i].x == xPapinha && caudaArray[i].y == yPapinha) {\n cont++;\n }\n }\n\n //ATRIBUI AS NOVAS POSICOES À PAPINHA\n if (cont == 0) {\n papinha.x = xPapinha;\n papinha.y = yPapinha;\n numerorandom = Math.floor(Math.random() * papinharandom.length);\n }\n else {\n posicaoPapinha();\n }\n\n}", "title": "" }, { "docid": "dcf2757968af9537041f453ec459297b", "score": "0.5473559", "text": "function envido(manoGenerica){\n if ((manoGenerica[0].genero == manoGenerica[1].genero )&&(manoGenerica[0].genero == manoGenerica[2].genero)){ // si sale flor pero no se juega con flor se suman los puntos de las dos mas altas\n auxMasAlta= [];\n\n for(j=0; j < manoGenerica.length; j++){\n if(manoGenerica[j].tipo == \"blancas\"){\n auxMasAlta[j] = manoGenerica[j].numero;\n }\n }\n auxMasAlta.forEach(element => {\n valormasaltode3 += element;\n });\n //ordenar el array para separar las dos valores de las cartas mas altas y asi resolver el envido.\n auxMasAlta.sort();\n valormasaltode2 = auxMasAlta[1] + auxMasAlta[2]\n\n if(sejuegoconFlor == true){\n valormasaltode3 += 20;\n return valormasaltode3\n }else{\n valormasaltode2 += 20;\n return valormasaltode2\n }\n }\n\n if (manoGenerica[0].genero == manoGenerica[1].genero){ // compara si hay envido y devuelve el resultado\n return siContieneNegras(manoGenerica[0],manoGenerica[1]);\n }else if (manoGenerica[2].genero == manoGenerica[1].genero){\n return siContieneNegras(manoGenerica[2],manoGenerica[1]);\n }else if (manoGenerica[0].genero == manoGenerica[2].genero){\n return siContieneNegras(manoGenerica[0],manoGenerica[2]);\n }else if((manoGenerica[0].genero != manoGenerica[2].genero) && (manoGenerica[0].genero != manoGenerica[1].genero)){ // en el caso de no formar envido devuelve la carta de 1 a 7 mas alta, en caso de tener todas negras devolvera 0 como tantos\n return cartaMasAltaEnLaMano(manoGenerica);\n }\n}", "title": "" }, { "docid": "7f7d2c1398d0fd7f007e24661da63294", "score": "0.5472283", "text": "function darVida(cantHabitantes){\n for (let index = 0; index < cantHabitantes; index++) {\n poblacion.unshift(35);\n }\n\n}", "title": "" }, { "docid": "b1367591b70a6b055d2a29aa212b4a3d", "score": "0.5454339", "text": "function repartirCarta(jugador) {\n do{ //Reparto una carta y la muestro en pantalla\n let numeroAzar;\n let cartaJuego;\n do{\n numeroAzar = Math.trunc(Math.random() * 51);\n cartaJuego = mazo[numeroAzar];\n }while(cartaJuego == 0);\n mazo[numeroAzar] = 0; //Asigno 0 para no repetir las cartas durante la mano\n if(cartaJuego.valorCarta == 1){\n jugador.cantidadCartasA += 1;\n sumarCartaA(jugador);\n }else{\n jugador.puntajeMaximo += cartaJuego.valorCarta;\n jugador.puntajeMinimo += cartaJuego.valorCarta;\n }\n cargarPuntaje(jugador);\n\n if(jugador.nombre == \"croupier\"){\n mostrarCartas(jugador.nombre, cartaJuego);\n }else{\n mostrarCartas(\"jugador\", cartaJuego);\n }\n\n mostrarPuntaje(jugador);\n cantidadCartas += 1;\n }while(jugador.puntaje == 0);\n}", "title": "" }, { "docid": "3e120d57923ad3cf300d037eddc4016d", "score": "0.5448217", "text": "function conFlorPuntos(manoGenerica){\n if (manoGenerica[0].genero == manoGenerica[1].genero == manoGenerica[1].genero){ \n auxcontador= 0;\n for(p=0; p< manoGenerica.length ; p++ ){\n if( manoGenerica[p].numero < 9){\n auxcontador = auxcontador + manoGenerica[p].numero;\n }\n }\n return auxcontador + 20\n }\n}", "title": "" }, { "docid": "62a6ccc5cd3f5da1dd2b3ee390826315", "score": "0.5448215", "text": "actualizarTransmitanciaSuperficie(estructura){\n let habitacion;\n if(estructura.userData.tipo === Morfologia.tipos.PISO || estructura.userData.tipo === Morfologia.tipos.TECHO){\n habitacion = estructura.parent;\n }else if(estructura.userData.tipo === Morfologia.tipos.VENTANA || estructura.userData.tipo === Morfologia.tipos.PUERTA){\n habitacion = estructura.parent.parent.parent;\n }else{\n habitacion = estructura.parent.parent;\n }\n\n let transmitanciaSuperficies = habitacion.userData.transmitanciaSuperficies;\n\n\n transmitanciaSuperficies -= estructura.userData.transSup;\n BalanceEnergetico.transmitanciaSuperficie(estructura,this.zona);\n transmitanciaSuperficies += estructura.userData.transSup;\n if(estructura.userData.tipo === Morfologia.tipos.PISO){\n BalanceEnergetico.puenteTermico(estructura);\n habitacion.userData.puenteTermico = estructura.userData.puenteTermico;\n }\n let perdidaPorConduccion = BalanceEnergetico.perdidasConduccion(transmitanciaSuperficies, this.gradoDias, habitacion.userData.puenteTermico);\n\n\n this.casa.userData.transmitanciaSuperficies -= habitacion.userData.transmitanciaSuperficies;\n this.casa.userData.perdidaPorConduccion -= habitacion.userData.perdidaPorConduccion;\n\n habitacion.userData.transmitanciaSuperficies = transmitanciaSuperficies;\n habitacion.userData.perdidaPorConduccion = perdidaPorConduccion;\n\n this.casa.userData.transmitanciaSuperficies += transmitanciaSuperficies;\n this.casa.userData.perdidaPorConduccion += habitacion.userData.perdidaPorConduccion;\n\n //console.log(\"estructura \"+Morfologia.tipos_texto[estructura.userData.tipo],estructura.userData.transSup);\n }", "title": "" }, { "docid": "e0788831f5645edab6f14ad46aaa7ae1", "score": "0.54477143", "text": "function movimentacaoCarro() {\r\n keyboard.update();\r\n //rotaciona as rodas\r\n if (keyboard.pressed(\"left\") && anguloX > anguloEsquerdoMaximo) {\r\n\r\n rodaDianteiraDireita.matrix.multiply(mat4.makeRotationZ(degreesToRadians(anguloPadrao)));\r\n rodaDianteiraEsquerda.matrix.multiply(mat4.makeRotationZ(degreesToRadians(anguloPadrao)));\r\n anguloX = rodaDianteiraDireita.matrix.elements[0] + 0.1;\r\n\t\t\tflagVirandoparaEsquerda = 1;\r\n\t\t\tflagVirandoparaDireita = 0;\r\n }\r\n if (keyboard.pressed(\"right\") && anguloX < anguloDireitoMaximo) {\r\n\r\n rodaDianteiraDireita.matrix.multiply(mat4.makeRotationZ(degreesToRadians(-anguloPadrao)));\r\n rodaDianteiraEsquerda.matrix.multiply(mat4.makeRotationZ(degreesToRadians(-anguloPadrao)));\r\n anguloX = rodaDianteiraDireita.matrix.elements[0] - 0.1;\r\n\t\t\tflagVirandoparaDireita = 1;\r\n\t\t\tflagVirandoparaEsquerda = 0;\r\n }\r\n\t\t\r\n\t\tif(!keyboard.pressed(\"left\") && flagVirandoparaEsquerda == 1 && anguloX <= 0)\r\n\t\t{\r\n\t\t\t\r\n\t\t\trodaDianteiraDireita.matrix.multiply(mat4.makeRotationZ(degreesToRadians(-anguloPadrao)));\r\n rodaDianteiraEsquerda.matrix.multiply(mat4.makeRotationZ(degreesToRadians(-anguloPadrao)));\r\n\t\t\tanguloX = rodaDianteiraDireita.matrix.elements[0] - 0.1;\r\n\t\t}\r\n\t\t\r\n\t\tif(!keyboard.pressed(\"right\") && flagVirandoparaDireita == 1 && anguloX >= 0)\r\n\t\t{\t\t\r\n\t\t\trodaDianteiraDireita.matrix.multiply(mat4.makeRotationZ(degreesToRadians(anguloPadrao)));\r\n rodaDianteiraEsquerda.matrix.multiply(mat4.makeRotationZ(degreesToRadians(anguloPadrao)));\r\n anguloX = rodaDianteiraDireita.matrix.elements[0] + 0.1;\r\n\t\t}\r\n\r\n //altera o modo da câmera \r\n if (keyboard.down(\"space\")) changeCameraMode();\r\n\r\n //impede a movimentação do carro no modo inspeção. \r\n if (inspect === false) {\r\n\t\t\t//console.log(\"1\");\r\n\t\t\t\r\n var position = new THREE.Vector3();\r\n var quaternion = new THREE.Quaternion();\r\n var scale = new THREE.Vector3();\r\n camera.matrixAutoUpdate = true;\r\n var rotX = Math.cos(anguloX);\r\n var rotZ = Math.sin(anguloX);\r\n var distance = 26.925824;\r\n chassi.matrixWorld.decompose(position, quaternion, scale);\r\n\t\t\twindow.addEventListener('wheel', onMouseWheel, true);\r\n // o carro move para direcao do angulo em relacao a X\r\n if (keyboard.pressed(\"up\")) {\r\n\t\t\t\t\r\n flagDesaceleracaoAutomatica = 1;\r\n if (speed > 0 && flagDesaceleracaoManual == 2) {\r\n chassi.matrix.multiply(mat4.makeTranslation(degreesToRadians(-anguloX), -speed, 0));\r\n chassi.matrix.multiply(mat4.makeRotationZ(degreesToRadians(anguloX*3)));\r\n speed = speed - 0.01;\r\n }\r\n\r\n if (speed <= 0.1) {\r\n flagDesaceleracaoManual = 1;\r\n }\r\n\r\n if (flagDesaceleracaoManual == 1 && !keyboard.pressed(\"down\")) {\r\n chassi.matrix.multiply(mat4.makeTranslation(degreesToRadians(anguloX), speed, 0));\r\n chassi.matrix.multiply(mat4.makeRotationZ(degreesToRadians(-anguloX*3)));\r\n if (speed <= 2) {\r\n speed = speed + 0.01;\r\n }\r\n }\r\n }\r\n if (keyboard.pressed(\"down\")) {\r\n\t\t\t\t\r\n flagDesaceleracaoAutomatica = 2;\r\n if (speed > 0 && flagDesaceleracaoManual == 1) {\r\n chassi.matrix.multiply(mat4.makeTranslation(degreesToRadians(anguloX), speed, 0));\r\n chassi.matrix.multiply(mat4.makeRotationZ(degreesToRadians(-anguloX*3)));\r\n speed = speed - 0.01;\r\n }\r\n\r\n if (speed <= 0.1) {\r\n flagDesaceleracaoManual = 2;\r\n }\r\n\r\n if (flagDesaceleracaoManual == 2 && !keyboard.pressed(\"up\")) {\r\n chassi.matrix.multiply(mat4.makeTranslation(degreesToRadians(-anguloX), -speed, 0));\r\n chassi.matrix.multiply(mat4.makeRotationZ(degreesToRadians(anguloX*3)));\r\n if (speed <= 2) {\r\n speed = speed + 0.01;\r\n }\r\n }\r\n }\r\n\r\n //Desacelera o carro quando não estiver apertando o acelerador\r\n if (!keyboard.pressed(\"up\") && !keyboard.pressed(\"down\")) {\r\n if (speed >= 0.1 && flagDesaceleracaoAutomatica == 1) {\r\n chassi.matrix.multiply(mat4.makeTranslation(degreesToRadians(anguloX), speed, 0));\r\n chassi.matrix.multiply(mat4.makeRotationZ(degreesToRadians(-anguloX*3)));\r\n speed = speed - 0.007;\r\n }\r\n\r\n if (speed >= 0.1 && flagDesaceleracaoAutomatica == 2) {\r\n chassi.matrix.multiply(mat4.makeTranslation(degreesToRadians(-anguloX), -speed, 0));\r\n chassi.matrix.multiply(mat4.makeRotationZ(degreesToRadians(anguloX*3)));\r\n speed = speed - 0.007;\r\n }\r\n\r\n }\r\n\t\t\t\t\r\n\t\t\tif(modoCamera === 2 )\r\n\t\t\t{\r\n\t\t\t\tconsole.log(\"cvp\");\r\n\t\t\t\tconsole.log(modoCamera);\r\n\t\t\t\tcamera.lookAt(position);\t\r\n\t\t\t}\r\n //camera.lookAt(position);\r\n\t\t\tMatrixGlobal.copy(chassi.matrix);\r\n\t\t\t\r\n }\r\n }", "title": "" }, { "docid": "513dffc6463d3e7ba6b76856ef5a1d43", "score": "0.5439367", "text": "constructor(r, polozaj) {\n this.oblik = 'krug'\n this.r = r\n this.centar = polozaj\n this.dubina = 10\n }", "title": "" }, { "docid": "eebd1dc1bee7a277dcdd2f75922e6643", "score": "0.5434586", "text": "function colisaoRaquete(x,y){\n colidiu = collideRectCircle(x ,y, raqueteComprimento, raqueteAltura, xBolinha, yBolinha, raio);\n if (colidiu){\n velocidadeX *= -1;\n }\n }", "title": "" }, { "docid": "3e1f6f883158933ac2d6d6b8d133b974", "score": "0.5433544", "text": "function carrito(precio) {\n return (total += precio);\n}", "title": "" }, { "docid": "32ec0a9ccc48a6612a6b680a10ef3ace", "score": "0.54290825", "text": "function victoriaDerrota(){\n\n\n\t\t\tif (datos[0] <= \"0\") {\n\t\t\t\tdiv.innerHTML = \"<h2 class='resultado'>¡Perdiste, idiota!</h2>\";\n\t\t\t}\n\t\t\tif (datos[4] <= \"0\" && contadorMalos <= 2) {\n\t\t\t\tdiv.innerHTML = \"<h2 class='resultado'>¡Enemigo derrotado!</h2><button id='continuar' class='continuar'>Continuar con la masacre</button>\";\n\t\t \t\tcontadorMalos ++;\n\n\t\t \t\t\n\t\t\t\tvar continuar = document.getElementById(\"continuar\");\n\t\t\t\tcontinuar.onclick = function(){\n\t\t\t\tcontadorRabia = 0;\n\t\t \t\tcontadorRabiaMala = 0;\n\t\t\t\tdiv.innerHTML = \"\";\n\t\t\t\tdatos = [];\n\t\t\t\theroeElegido.combate();\n\t\t\t\tseleccionMalo();\n\t\t\t\tataque();\n\t\t\t\t} \n\t\t\tif (datos[4] <= \"0\" && contadorMalos == 3){\n\t\t\t\tdiv.innerHTML = \"<h1 class='puto'>Sos el puto amo</h1>\";\n\t\t\t\t}\n\n\t\t\t};\n\t}", "title": "" }, { "docid": "6ff4b4bcd36efc3087a83548f2582145", "score": "0.5427827", "text": "function margemBruta(receitaLiquidaDeVendas, custoDosProdutosVendidos){\n lucroBruto = receitaLiquidaDeVendas - custoDosProdutosVendidos\n return (lucroBruto / receitaLiquidaDeVendas) * 100\n}", "title": "" }, { "docid": "f4cbfbd53050077def1604ff17e557c7", "score": "0.54263663", "text": "function cargarfondo(){\r\n fondo.cargaOK=true;\r\n drawpantallacarga();\r\n}", "title": "" }, { "docid": "367b699afeb5373406917eea4aeb6eb1", "score": "0.5425068", "text": "function llenarPorPartido(){\n statistics.porPartido.forEach(objeto => {\n objeto.conjunto = miembrosCongreso.filter(miembro => miembro.party == objeto.partido)\n objeto.conjunto.forEach(miembro => {\n objeto.promVCP = objeto.promVCP + miembro.votes_with_party_pct\n })\n objeto.promVCP = (objeto.promVCP/objeto.conjunto.length).toFixed(2) \n })\n pintarTablaChica()\n }", "title": "" } ]
fc936df6fd615356e7648916c8a13b3a
Returns a callback func that should be applied on all data from the 'other' sensor in future to normalize that data
[ { "docid": "680e51922c567f632cc8693df4ceb2e8", "score": "0.5251894", "text": "function calibratePosition(refPosition, otherPosition) {\n // User-level overall position is only reported\n // if the middleware believes it is valid\n // (beware of nulls!)\n var hyp = distanceBetweenSensors(refPosition, otherPosition);\n \n return function (otherPos) {\n return convertPositionValue(hyp, otherPos);\n };\n}", "title": "" } ]
[ { "docid": "5d7a872a063a274563338e6cbf849b27", "score": "0.5407214", "text": "makePostData (callback) {\n\t\tif (!this.otherStream) { return callback(); }\n\t\tsuper.makePostData(() => {\n\t\t\t// inject the other stream ID\n\t\t\tlet toAddress = this.data.to[0].address;\n\t\t\tconst atSplit = toAddress.split('@');\n\t\t\tconst dotSplit = atSplit[0].split('.');\n\t\t\tdotSplit[1] = this.otherStream.id;\n\t\t\tthis.data.to[0].address = `${dotSplit.join('.')}@${atSplit[1]}`;\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "a18b95f0daf4e1d02c99c527730cf351", "score": "0.5391102", "text": "onData(func) {\n this.onDataCallback = func;\n }", "title": "" }, { "docid": "5924f25c0504535b3c1f78f447bc078c", "score": "0.52495986", "text": "getCurrentRelativeHumidity (callback) {\n\n this.getSensorData(\n (function (that) {\n return function (error, sensorData) {\n\n if (error) {\n callback(error, null);\n } else {\n console.log('Humidity for '+that.deviceId+' is: '+sensorData.humidity+' %');\n callback(null, sensorData.humidity);\n }\n\n };\n })(this)\n );\n\n }", "title": "" }, { "docid": "283a7655c14ed93c4bf64ed6b35eccc2", "score": "0.52400506", "text": "getCurrentTemperature (callback) {\n\n this.getSensorData(\n (function (that) {\n return function (error, sensorData) {\n\n if (error) {\n callback(error, null);\n } else {\n console.log('Temperature for '+that.deviceId+' is: '+sensorData.temperature+' °C');\n callback(null, sensorData.temperature);\n }\n\n };\n })(this)\n );\n\n }", "title": "" }, { "docid": "0fbe88c45faf0b2e0bc223a9fc081fba", "score": "0.51525736", "text": "update() {\n\n if (this.irSensor) {\n this.irSensor.update();\n const prev = Math.round(this.irSensor.previousValue);\n const curr = Math.round(this.irSensor.proximity);\n if (prev !== curr) {\n this.eventEmitter.emit('infraredSensorChange', this.irSensor.ev3devSensor.address, curr);\n }\n }\n\n if (this.touchSensorProxy && this.touchSensorProxy.sensor.connected) {\n let currentValue = this.touchSensorProxy.sensor.isPressed;\n if (currentValue != this.touchSensorProxy.previousValue) {\n this.touchSensorProxy.previousValue = currentValue;\n this.eventEmitter.emit('touchSensorChange', this.touchSensorProxy.sensor.address, currentValue);\n }\n }\n\n if (this.colorSensorProxy && this.colorSensorProxy.sensor.connected) {\n let currentValue = this.colorSensorProxy.sensor.color;\n\n if (currentValue != this.colorSensorProxy.previousValue) {\n this.colorSensorProxy.previousValue = currentValue;\n this.eventEmitter.emit('colorSensorChange', this.colorSensorProxy.sensor.address, currentValue);\n }\n }\n\n\n if (this.ulrasonicSensorProxy && this.ulrasonicSensorProxy.sensor.connected) {\n let currentValue = this.ulrasonicSensorProxy.sensor.distanceCentimeters;\n\n if (currentValue != this.ulrasonicSensorProxy.previousValue) {\n this.ulrasonicSensorProxy.previousValue = currentValue;\n this.eventEmitter.emit('ultrasonicSensorChange', this.ulrasonicSensorProxy.sensor.address, currentValue);\n }\n }\n\n }", "title": "" }, { "docid": "2a3a845b12277b04c313b888254f2368", "score": "0.5114194", "text": "static conduct(a, b, callback, on) {\r\n callback(a, b)\r\n\r\n }", "title": "" }, { "docid": "233c290b5db29c26e499cfc0fcd75eca", "score": "0.51006097", "text": "function renderOther() {\n sliders.forEach(slider => {\n\t document.getElementById(slider.text).innerText = slider.v;\n\t if (slider.callback != undefined) {\n\t\t(slider.callback)(slider.v);\n\t }\n });\n}", "title": "" }, { "docid": "f394ace4b731b14995b14969ca84edf2", "score": "0.50718206", "text": "onPotentiometer_6(callback)\n {\n this.emitter.addListener(\"A5\", callback);\n }", "title": "" }, { "docid": "48ff170b9691d43a597904676a03b2c1", "score": "0.5040544", "text": "function handleCallback(data) {\n setTempPoint(data);\n }", "title": "" }, { "docid": "402539f7b9bcf95c4e43908c1adc377e", "score": "0.5012921", "text": "function normFn(self, callback) {\n if (S.isFunction(callback)) {\n return callback;\n } else if (S.isString(callback)) {\n return self[callback];\n }\n return callback;\n }", "title": "" }, { "docid": "ff9d713d9682f6d6c96e010881296c7a", "score": "0.49473482", "text": "onTrade(fn) {\n this.eventEmitter.on(settings.socket.trade, (data) => {\n let tradeObject = JSON.parse(data);\n fn(tradeObject);\n });\n }", "title": "" }, { "docid": "e0659feeccda29679c682f85f75fd684", "score": "0.49186936", "text": "function onFaderChange(faderNumber, callback) {\n var returnRawInput = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (midiDeviceReady) {\n if (midiMap) {\n if (typeof _maps2.default[midiMap].faders[faderNumber] !== \"undefined\") {\n midiInputDevice.addListener(\"controlchange\", \"all\", function (e) {\n if (_maps2.default[midiMap].faders[faderNumber] === e.controller.number) {\n var result = returnRawInput ? e.value : e.value / maxMidiValue;\n callback(result);\n }\n });\n }\n }\n }\n}", "title": "" }, { "docid": "a0516b540b4ed25730b2b3e335a31a9e", "score": "0.49058852", "text": "function handleForecastCallback(dataset) {\n\t//var weatherData = dataset.locations[0].data;\n\tfor (parameter in dataset.locations[0].data) {\n\t\tconsole.log(parameter)\n\t\tdataset.locations[0].data[parameter].timeValuePairs.shift()//inside of parameter\t\t\n\t}\n\tconsole.log(dataset);\n\tvar forecastChartData = dataset;\n\tvar forecastMainData = dataset;\n\tvar forecastTableData = dataset;\n\t\t\n\tshowForecastChart(forecastChartData);\n\tshowForecastTable(forecastTableData);\n\tshowForecastMain(forecastMainData);\n}", "title": "" }, { "docid": "c465cd3942a2677036436def01385a0f", "score": "0.4876165", "text": "otherFunction (d, e) {\n\n }", "title": "" }, { "docid": "c465cd3942a2677036436def01385a0f", "score": "0.4876165", "text": "otherFunction (d, e) {\n\n }", "title": "" }, { "docid": "7fa1948812a0e52a63493d7c26959c10", "score": "0.48562014", "text": "function fcnOnChange()\n\t{\n\t\tdataChanged = true;\n\t}", "title": "" }, { "docid": "93f8e761545abebfc92feedbd6485c99", "score": "0.48557398", "text": "_applyCallbackToInputs () {\n return math\n .map(this._inputs, (item, cell) => {\n const col = cell[1];\n\n if(col === 0) { return item; }\n return this._callback(item);\n })\n }", "title": "" }, { "docid": "0a14c58a400eb645bf7c4348c02b0e79", "score": "0.48477793", "text": "function applyChange(callback) {\n spChartBuilderService.applyChange($scope.model, callback);\n }", "title": "" }, { "docid": "eb8369b9e104cef080936ccd5bc8077f", "score": "0.48460644", "text": "makePostData (callback) {\n\t\tthis.useStream = this.postData[0].streams[0];\n\t\tsuper.makePostData(() => {\n\t\t\tthis.data.to[0].address = `${this.postData[0].post.id}.${this.data.to[0].address}`;\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "6644f222bcc46c1e269dbfe670a7dad2", "score": "0.48183727", "text": "onValueChanged(event) {\n let value = this.raw ? event.target.rawValue : event.target.value;\n this.$emit('update:modelValue', value);\n\n // Call original callback method\n if (typeof this.onValueChangedFn === 'function') {\n this.onValueChangedFn.call(this, event)\n }\n }", "title": "" }, { "docid": "95161dc735d91e57175aa9154598b825", "score": "0.48064995", "text": "filter(callback) {\n let oldData = this.all();\n for (let i = 0; i < oldData.length; i++) {\n let result = callback(oldData[i].data, oldData[i].ID, i, this);\n if (result)\n delete oldData[i];\n }\n this._write(Util_1.default.fromDataset(oldData));\n }", "title": "" }, { "docid": "fa7bb0bcc817720c592a3acd448f37ea", "score": "0.47994673", "text": "convertData(sensorData, settings) {\n let tempFormat = settings[0];\n for(let i=0; i<sensorData.length; i++)\n {\n sensorData[i].reading = this.convert(tempFormat, sensorData[i].reading);\n }\n return sensorData;\n }", "title": "" }, { "docid": "c20092844ea6f12f6b2a486858ff7560", "score": "0.4771218", "text": "function Update_DataForHandler() {\n io.emit('T1', globaldata);\n}", "title": "" }, { "docid": "01ab8eb1f19c00bd2d6260d815a6dcae", "score": "0.47669464", "text": "_subscribe() {\n DangerZone.DeviceMotion.addListener((deviceMotionData) => {\n \n // Wait for sensor data\n if (!deviceMotionData.rotation) {\n setTimeout((() => {\n this._subscribe();\n }), 100);\n } else {\n let { alpha, beta, gamma } = deviceMotionData.rotation;\n\n // Calculate colors and percentage\n let red = getRed(gamma);\n let green = getGreen(beta);\n let blue = getBlue(alpha);\n let percentage = getPercentage(this.props.randomColorR, this.props.randomColorG, this.props.randomColorB, red, green, blue);\n\n // Save the values\n this.setState({\n red: red,\n green: green,\n blue: blue,\n percent: percentage,\n });\n\n // Send the percentage value back to parent component\n this.props.onPercentageChange(percentage);\n }\n });\n }", "title": "" }, { "docid": "334a4b17654651cd847e632eb6f90aba", "score": "0.47300604", "text": "map(callback, thisarg) {\n\t\tlet newArr = this.getValues().map(callback, thisarg)\n\t\treturn newArr\n\t}", "title": "" }, { "docid": "0a482ba380f738cb8ba79ab7eaf5770f", "score": "0.47277814", "text": "onOtherThing(foo, bar, baz) {\n return(bar);\n }", "title": "" }, { "docid": "425656214c87e4674174bcdd947da246", "score": "0.47272834", "text": "_onEditorDataChange(editor) {\n\t\t// if an \"onChange\" function is passed in, invoke it\n\t\tif (this.onChange && typeof this.onChange === 'function') {\n\t\t\tthis.onChange(editor.getData());\n\t\t}\n\t}", "title": "" }, { "docid": "f1664103fe2087772a0a617388df68db", "score": "0.47211325", "text": "function initsensor (){\n sensor.init('aIn', 0, {\n aInCurrValue: { // < rid = 5600, R, Float >\n read: function (cb) {\n var hal = this.parent.hal,\n value = parseInt(hal.Sound.read()/1023*100, 10);\n cb(null, value);\n }\n },\n // minMeaValue: , // < rid = 5601, R, Float >\n // maxMeaValue: , // < rid = 5602, R, Float >\n minRangeValue: 0, // < rid = 5603, R, Float >\n maxRangeValue: 100, // < rid = 5604, R, Float >\n // resetMinMaxMeaValues: , // < rid = 5605, E, Opaque >\n // appType: , // < rid = 5750, RW, String >\n sensorType: 'Sound' // < rid = 5751, R, String >\n });\n\n sensor.init('aIn', 1, {\n aInCurrValue: { // < rid = 5600, R, Float >\n read: function (cb) {\n var hal = this.parent.hal,\n value = parseInt(hal.Rotary.read()/1023*100, 10);\n cb(null, value);\n }\n },\n // minMeaValue: , // < rid = 5601, R, Float >\n // maxMeaValue: , // < rid = 5602, R, Float >\n minRangeValue: 0, // < rid = 5603, R, Float >\n maxRangeValue: 100, // < rid = 5604, R, Float >\n // resetMinMaxMeaValues: , // < rid = 5605, E, Opaque >\n // appType: , // < rid = 5750, RW, String >\n sensorType: 'Rotary' // < rid = 5751, R, String >\n });\n\n sensor.init('aIn', 2, {\n aInCurrValue: { // < rid = 5600, R, Float >\n read: function (cb) {\n var hal = this.parent.hal,\n value = hal.Piezo.read()>100 ? 1:0;\n cb(null, value);\n }\n },\n // minMeaValue: , // < rid = 5601, R, Float >\n // maxMeaValue: , // < rid = 5602, R, Float >\n minRangeValue: 0, // < rid = 5603, R, Float >\n maxRangeValue: 100, // < rid = 5604, R, Float >\n // resetMinMaxMeaValues: , // < rid = 5605, E, Opaque >\n // appType: , // < rid = 5750, RW, String >\n sensorType: \"Piezo Vibration\" // < rid = 5751, R, String >\n });\n\n sensor.init('aIn', 3, {\n aInCurrValue: { // < rid = 5600, R, Float >\n read: function (cb) {\n var hal = this.parent.hal,\n value = hal.Light.read();\n cb(null, value);\n }\n },\n // minMeaValue: , // < rid = 5601, R, Float >\n // maxMeaValue: , // < rid = 5602, R, Float >\n // minRangeValue: , // < rid = 5603, R, Float >\n // maxRangeValue: , // < rid = 5604, R, Float >\n // resetMinMaxMeaValues: , // < rid = 5605, E, Opaque >\n // appType: , // < rid = 5750, RW, String >\n sensorType: 'Light' // < rid = 5751, R, String >\n });\n\n sensor.init('dIn', 0, {\n dInState: { // < rid = 5500, R, Boolean >\n read: function (cb) {\n var hal = this.parent.hal,\n value = hal.Button.read();\n cb(null, value);\n }\n },\n // counter: , // < rid = 5501, R, Integer >\n // dInPolarity: , // < rid = 5502, RW, Boolean >\n // debouncePeriod: , // < rid = 5503, RW, Integer, ms >\n // edgeSelection: , // < rid = 5504, RW, Integer { 1: fall, 2: rise, 3: both } >\n // counterReset: , // < rid = 5505, E, Opaque >\n // appType: , // < rid = 5750, RW, String >\n sensorType: \"Button\" // < rid = 5751, R, String >\n });\n\n sensor.init('dIn', 1, {\n dInState: { // < rid = 5500, R, Boolean >\n read: function (cb) {\n var hal = this.parent.hal,\n value = hal.Button.read();\n cb(null, value);\n }\n },\n // counter: , // < rid = 5501, R, Integer >\n // dInPolarity: , // < rid = 5502, RW, Boolean >\n // debouncePeriod: , // < rid = 5503, RW, Integer, ms >\n // edgeSelection: , // < rid = 5504, RW, Integer { 1: fall, 2: rise, 3: both } >\n // counterReset: , // < rid = 5505, E, Opaque >\n // appType: , // < rid = 5750, RW, String >\n sensorType: \"Touch\" // < rid = 5751, R, String >\n });\n\n sensor.init('dOut', 0, {\n dOutState: { // < rid = 5550, RW, Boolean >\n read: function (cb) {\n var hal = this.parent.hal,\n value = hal.LED.read();\n cb(null, value);\n },\n write: function (value, cb) {\n var hal = this.parent.hal\n hal.LED.write(value);\n cb(null, value);\n }\n },\n // dOutpolarity: , // < rid = 5551, RW, Boolean { 0: normal, 1: reversed } >\n // appType: // < rid = 5750, RW, String >\n });\n/*\n sensor.init('temperature', 0, {\n sensorValue: { // < rid = 5700, R, Float >\n read: function (cb) {\n var hal = this.parent.hal,\n value = hal.Temperature.read();\n value =(1/(Math.log(((1023-value)*10000/value)/10000)/3975+1/298.15)-273.15).toFixed(2);\n cb(null, value);\n }\n },\n units: \"C\", // < rid = 5701, R, String >\n // minMeaValue: , // < rid = 5601, R, Float >\n // maxMeaValue: , // < rid = 5602, R, Float >\n // minRangeValue: , // < rid = 5603, R, Float >\n // maxRangeValue: , // < rid = 5604, R, Float >\n // resetMinMaxMeaValues: // < rid = 5605, E, Opaque >\n sensorType: \"Temperature\"\n });\n*/\n}", "title": "" }, { "docid": "997ce5f38e0229e5ab32a124112b8c2d", "score": "0.46821356", "text": "attributeChangedCallback(name, oldval, newval){\n //E PA POMENUTU METODU I OVDE POZVATI\n this.whenAttributeChange(name, oldval, newval);\n //ALI POZVACU I NOVU METODU, KOJU SAM DEFINISAO ISPOD OVOG LIFECYCLE CALLBACK-A\n //JASNO MI JE DA CODE TE METODE DEFINISE DODELU STILOVA, U RELACIJI SA shadow ATRIBUTOM\n // INSTANCE\n this.whenShadowChange(name, oldval);\n }", "title": "" }, { "docid": "82cd8ee4ccd12b2167043573d20d2c94", "score": "0.4681858", "text": "getSensorData (callback) {\n\n request({\n uri: this.endpoint + '/latest/' + this.deviceId,\n method: 'GET',\n headers : {\n 'User-Agent' : 'homebridge-wifi-environment-sensor-plugin',\n },\n }, function (error, response, body) {\n\n var sensorData;\n\n if (error) {\n callback(new Error('Unable to get sensor data from server - '+error), null);\n } else {\n\n try {\n sensorData = JSON.parse(body);\n } catch (error) {\n callback(new Error('Error parsing response body - '+error), null);\n return;\n }\n\n callback(null, sensorData);\n\n }\n });\n\n }", "title": "" }, { "docid": "6dea9b4141d3ea8e61dce767cf8f8199", "score": "0.4674709", "text": "function otherAsyncAction(value, callback) {\n console.log(\"In the other action\");\n callback(null, \"another value\");\n}", "title": "" }, { "docid": "04432185dc432d832e1128d4ece5f668", "score": "0.46731976", "text": "onData(callback) {\n this[_stream].set(_onData, callback);\n return this;\n }", "title": "" }, { "docid": "4846f7442387d0797edb680641658aba", "score": "0.46722016", "text": "function callback(){}", "title": "" }, { "docid": "4846f7442387d0797edb680641658aba", "score": "0.46722016", "text": "function callback(){}", "title": "" }, { "docid": "2cd5d17ffca9f14a32c73b741a75cfb4", "score": "0.46645638", "text": "static onEvery1(a, b, callbacks) { return callbacks.every(function (callback) { return operate[callback](a, b); }); }", "title": "" }, { "docid": "2cd5d17ffca9f14a32c73b741a75cfb4", "score": "0.46645638", "text": "static onEvery1(a, b, callbacks) { return callbacks.every(function (callback) { return operate[callback](a, b); }); }", "title": "" }, { "docid": "be6525dd6d464488c7be610477249cad", "score": "0.46445292", "text": "emit(name, ...data){\r\n this.listeners.forEach( listener => {\r\n if(listener.name === name){\r\n listener.callback(...data);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "67b1546b2c5a5b5b3a377168469887b1", "score": "0.46204475", "text": "createOtherStream (callback) {\n\t\tthis.streamFactory.createRandomStream(\n\t\t\t(error, response) => {\n\t\t\t\tif (error) { return callback(error); }\n\t\t\t\tthis.otherStream = response.stream;\n\t\t\t\tcallback();\n\t\t\t},\n\t\t\t{\n\t\t\t\ttoken: this.token,\n\t\t\t\tteamId: this.team.id,\n\t\t\t\ttype: 'channel'\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "ddcc3e90edb5c687b438727953e3f823", "score": "0.46182355", "text": "function applyCallbacks() {\n callbacks.forEach(function (d) {\n viz.on(d.on, d.callback);\n });\n }", "title": "" }, { "docid": "422e83e54356dfcca207b1528502a92f", "score": "0.46141154", "text": "function slave_feedback() {\n if (d3.event.sourceEvent) {\n console.info(d3.event.sourceEvent.type);\n }\n if (d3.event.sourceEvent && (d3.event.sourceEvent.type === \"wheel\" || d3.event.sourceEvent.type === \"zoom\")) {\n //change resolution of axis and data on slave chart, slave chart brush, and master chart brush\n console.info(\"zoom\");\n\n var transform = d3.event.transform;\n _slaveChart().x.domain(transform.rescaleX(_masterChart().x).domain());\n \n _slaveChart().chart.select(\".axis--x\").call(_slaveChart().xAxis);\n _masterChart().chart.select(\".brush\").call(brush_sensor_master.move, _slaveChart().x.range().map(transform.invertX, transform));\n /**/\n }\n if (d3.event.sourceEvent && (d3.event.sourceEvent.type === \"mousemove\" || d3.event.sourceEvent.type === \"touchmove\")) {\n //console.info(\"slaved chart's brush event\");\n //console.info(_slaveChart().x.domain());\n //console.info(_slaveChart().y.domain());\n //_slaveChart().chart.select(\".line\").attr(\"d\", line);\n _slaveChart().chart.selectAll(\".dot\")\n .attr('cx', function (d) { return _slaveChart().x(d[date_dynField]); })\n .attr('cy', _tfc_layout_slave.height() * 0.5);\n }\n }", "title": "" }, { "docid": "483ddaa461ce7ce9595009ad1b604543", "score": "0.45901504", "text": "function sensors(callback) {\n\n fs.readFile(W1_FILE, 'utf8', function(err, data) {\n if (err) {\n return callback(err);\n }\n\n var parts = data.split('\\n');\n parts.pop();\n return callback(null, parts);\n });\n}", "title": "" }, { "docid": "9f328c3bd1373a02353faf43e5d1600a", "score": "0.4589526", "text": "handleFuture() {\n var fc = this.components.find((comp) => {return comp.smoName == 'applyToAll'});\n var toModify = [];\n if (fc.getValue()) {\n this.layout.score.staves.forEach((staff) => {\n var toAdd = staff.measures.filter((mm) => {\n return mm.measureNumber.measureIndex >= this.measures[0].measureNumber.measureIndex;\n });\n toModify = toModify.concat(toAdd);\n });\n } else {\n this.measures.forEach((measure) => {\n this.layout.score.staves.forEach((staff) => {\n toModify.push(staff.measures[measure.measureNumber.measureIndex]);\n });\n });\n }\n toModify.forEach((measure) => {\n measure.changed = true;\n var tempo = SmoMeasureModifierBase.deserialize(this.modifier.serialize());\n tempo.attrs.id = VF.Element.newID();\n measure.addTempo(tempo);\n });\n this.tracker.replaceSelectedMeasures();\n }", "title": "" }, { "docid": "2da592976657b3b185f4365bf4f1d3bb", "score": "0.45807052", "text": "_fireOnCostumerDataChange(costumerData) {\r\n this.props.onDataChange(costumerData);\r\n }", "title": "" }, { "docid": "3fc1bff2b96622ac5d6d4e6d51063849", "score": "0.4573403", "text": "function calc(num1,num2,callback){\n if (typeof callback === \"function\"){\n return callback(num1,num2)\n }\n }", "title": "" }, { "docid": "6fff8fab3b38de002eb21e69c55015ea", "score": "0.4573142", "text": "function myEcadHandler(data) {\n // seed your inputs here\n}", "title": "" }, { "docid": "5b706a2d2a65cf97930ccd0697fb05e3", "score": "0.45713308", "text": "function getDataArray(dataArray,senML,currentSensor,sensorNumber) {\n\t//Check out the kind of data\n\t//Numeric\n\tif(typeof senML.bt=='undefined') {\n\t\tsenML.bt = 0;\n\t}\n\t\n\tif(typeof senML.e[0].v!='undefined') {\n\t\t$.each(senML.e, function(j,element) {\n\t\t\tif(typeof dataArray[(element.t+senML.bt)+\"\"]=='undefined') {\n\t\t\t\tdataArray[(element.t+senML.bt)+\"\"]=[];\n\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][0]=timeStampToDate(element.t+senML.bt);\n\t\t\t\tfor(var j=1;j<currentSensor+1;j++) {\t\t\t\t\t\n\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][j]=\"-\";\n\t\t\t\t}\n\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][currentSensor+1]=element.v;\n\t\t\t\tfor(var j=currentSensor+2;j<sensorNumber+1;j++) {\t\t\t\t\t\n\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][j]=\"-\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][currentSensor+1]=element.v;\n\t\t\t}\n\t\t});\n\t} \n\telse {\n\t\t//String\n\t\tif (typeof senML.e[0].sv!='undefined') {\n\t\t\t$.each(senML.e, function(j,element) {\n\t\t\t\tif(typeof dataArray[(element.t+senML.bt)+\"\"]=='undefined') {\n\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"]=[];\n\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][0]=timeStampToDate(element.t+senML.bt);\n\t\t\t\t\tfor(var j=1;j<currentSensor+1;j++) {\t\t\t\t\t\n\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][j]=\"-\";\n\t\t\t\t\t}\n\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][currentSensor+1]=element.sv;\n\t\t\t\t\tfor(var j=currentSensor+2;j<sensorNumber+1;j++) {\t\t\t\t\t\n\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][j]=\"-\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][currentSensor+1]=element.sv;\n\t\t\t\t}\n\t\t\t});\t\t\n\t\t} \n\t\telse {\n\t\t\t//Bool\n\t\t\tif ( typeof senML.e[0].bv!='undefined') {\n\t\t\t\t$.each(senML.e, function(j,element) {\n\t\t\t\t\tif(typeof dataArray[(element.t+senML.bt)+\"\"]=='undefined') {\n\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"]=[];\n\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][0]=timeStampToDate(element.t+senML.bt);\n\t\t\t\t\t\tfor(var j=1;j<currentSensor+1;j++) {\t\t\t\t\t\n\t\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][j]=\"-\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][currentSensor+1]=element.bv;\n\t\t\t\t\t\tfor(var j=currentSensor+2;j<sensorNumber+1;j++) {\t\t\t\t\t\n\t\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][j]=\"-\";\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\tdataArray[(element.t+senML.bt)+\"\"][currentSensor+1]=element.bv;\n\t\t\t\t\t}\n\t\t\t\t});\t\t\n\t\t\t} \n\t\t\telse {\n\t\t\t\t//Summed\n\t\t\t\tif (typeof senML.e[0].s!='undefined') {\n\t\t\t\t\t$.each(senML.e, function(j,element) {\n\t\t\t\t\t\tif(typeof dataArray[(element.t+senML.bt)+\"\"]=='undefined') {\n\t\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"]=[];\n\t\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][0]=timeStampToDate(element.t+senML.bt);\n\t\t\t\t\t\t\tfor(var j=1;j<currentSensor+1;j++) {\t\t\t\t\t\n\t\t\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][j]=\"-\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][currentSensor+1]=element.s;\n\t\t\t\t\t\t\tfor(var j=currentSensor+2;j<sensorNumber+1;j++) {\t\t\t\t\t\n\t\t\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][j]=\"-\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tdataArray[(element.t+senML.bt)+\"\"][currentSensor+1]=element.s;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\t\t\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\treturn dataArray;\n}", "title": "" }, { "docid": "66c49cff9f460a0bc7a6bee25c2970b3", "score": "0.45699978", "text": "formatDataForTwo(mainDataType, secondaryDataType) {\n // console.log(\"FORMAT DATA FOR 2: \" + JSON.stringify(this.props.data[mainDataType][secondaryDataType]));\n\n // map over values and format into intermediate representation\n let values = this.props.data[mainDataType][secondaryDataType].map((xy) => {\n\n return ( {x: (Math.floor(xy.valueA * 10) / 10), y: (Math.round(xy.valueB * 10) / 10)} );\n });\n\n console.log(\"Formatting data for two - values.length = \" + values.length);\n\n // console.log(\"FORMATTED DATA FOR 2 (BEFORE RETURN): \" + JSON.stringify(values));\n if (values.length > 100) {\n let intermediate = groupAverage(values, values.length / 100, (a, b) => {\n return {x: a.x + b.x, y: a.y + b.y}\n }, (a, b) => {\n return {x: a.x / b, y: a.y / b}\n });\n console.log(\"Intermediate length is \" + intermediate.length);\n values = intermediate;\n }\n\n // Mutation-free (no inplace changes) way of updating this.state.data\n if (values.length > 0) {\n let data = Object.assign({}, this.state.data);\n let count = this.state.loadedValues;\n data[mainDataType] = data[mainDataType] || {};\n data[mainDataType][secondaryDataType] = values;\n this.setState({data, loadedValues: count + 1});\n }\n\n // not necassary, but if you want to log it\n return values;\n }", "title": "" }, { "docid": "e08977889ad645150d14061f4869ac16", "score": "0.4555603", "text": "handleExternalChange(propertyName, value, formattedValue) {\n super.handleExternalChange(propertyName, value, formattedValue);\n // this.lightService.updateCharacteristic(Characteristic.On, this.device.isOn);\n this.primaryService.updateCharacteristic(plugin_1.Characteristic.Brightness, this.device.brightnessLevel);\n }", "title": "" }, { "docid": "ab9739547e1732b08913ac566ebf2877", "score": "0.4552608", "text": "function initDevice( device_data, newSettingsObj, callback) {\n\n module.exports.getSettings( device_data, function( err, settings ){\n\n \n devices[ device_data.id ].settings = settings;\n initDeviceInterval(device_data, settings.pollingrate);\n\n \n })\n devices[ device_data.id ] = {};\n devices[ device_data.id ].data = device_data;\n\n Homey.manager('speech-input').on('speech', function (speech, callback) {\n var device = getDeviceByData(device_data);\n if(typeof device.LastUsage === 'undefined'){\n monitorYouless(device_data); \n }\n Homey.manager(\"speech-output\").say( __(\"usage\", { \"name\": device.settings.name, \"usage\": device.LastUsage }));\n });\n\n\n\n\n\n }", "title": "" }, { "docid": "708c900f48640e1d625f4fa1a1e9968e", "score": "0.4551152", "text": "function callback_function() {\n var api = this.api();\n callback_array = api.rows({\n page: \"current\"\n }).data();\n metric_headers_update_list(callback_array)\n }", "title": "" }, { "docid": "708c900f48640e1d625f4fa1a1e9968e", "score": "0.4551152", "text": "function callback_function() {\n var api = this.api();\n callback_array = api.rows({\n page: \"current\"\n }).data();\n metric_headers_update_list(callback_array)\n }", "title": "" }, { "docid": "e224a77331f47728e41e5897cfbf98e7", "score": "0.45507592", "text": "updateSpoofaxData(newData)\r\n {\r\n //console.log(\"\\nUpdating Spoofax data: \" + JSON.stringify(newData));\r\n this.spoofaxData = newData;\r\n this.io.emit('spoofax-data', this.spoofaxData);\r\n }", "title": "" }, { "docid": "9fc10d246acb00e0bb2c361765aec182", "score": "0.45458987", "text": "function process(telemetry, executionContext) {\n\n try {\n // Log SensorId and Message\n log(`Sensor ID: ${telemetry.SensorId}. `);\n log(`Sensor value: ${JSON.stringify(telemetry.Message)}.`);\n\n // Get sensor metadata\n var sensor = getSensorMetadata(telemetry.SensorId);\n\n // Retrieve the sensor reading\n var parseReading = JSON.parse(telemetry.Message);\n\n // Set the sensor reading as the current value for the sensor.\n setSensorValue(telemetry.SensorId, sensor.DataType, parseReading.SensorValue);\n\n // Get parent space\n var parentSpace = sensor.Space();\n\n // Get children sensors from the same space\n var otherSensors = parentSpace.ChildSensors();\n\n // Retrieve carbonDioxide, and motion sensors\n var carbonDioxideSensor = otherSensors.find(function(element) {\n return element.DataType === carbonDioxideType;\n });\n\n var motionSensor = otherSensors.find(function(element) {\n return element.DataType === motionType;\n });\n \n // Add your sensor variable here\n\n // get latest values for above sensors\n var motionValue = motionSensor.Value().Value;\n var presence = !!motionValue && motionValue.toLowerCase() === \"true\";\n var carbonDioxideValue = getFloatValue(carbonDioxideSensor.Value().Value);\n\n // Add your sensor latest value here\n \n // Return if no motion or carbonDioxide found return\n // Modify this line to monitor your sensor value\n if(carbonDioxideValue === null || motionValue === null) {\n sendNotification(telemetry.SensorId, \"Sensor\", \"Error: Carbon dioxide or motion are null, returning\");\n return;\n }\n\n // Modify these lines as per your sensor\n var availableFresh = \"Room is available and air is fresh\";\n var noAvailableOrFresh = \"Room is not available or air quality is poor\";\n\n // Modify this code block for your sensor\n // If carbonDioxide less than threshold and no presence in the room => log, notify and set parent space computed value\n if(carbonDioxideValue < carbonDioxideThreshold && !presence) {\n log(`${availableFresh}. Carbon Dioxide: ${carbonDioxideValue}. Presence: ${presence}.`);\n setSpaceValue(parentSpace.Id, spaceAvailFresh, availableFresh);\n }\n else {\n log(`${noAvailableOrFresh}. Carbon Dioxide: ${carbonDioxideValue}. Presence: ${presence}.`);\n setSpaceValue(parentSpace.Id, spaceAvailFresh, noAvailableOrFresh);\n\n // Set up custom notification for poor air quality\n parentSpace.Notify(JSON.stringify(noAvailableOrFresh));\n }\n }\n catch (error)\n {\n log(`An error has occurred processing the UDF Error: ${error.name} Message ${error.message}.`);\n }\n}", "title": "" }, { "docid": "c54ebfaaafcef5a4053dcb3cce08cdb9", "score": "0.4537987", "text": "function refreshData() {\r\n api.getThreshold(function (valthreshold) {\r\n threshold = valthreshold\r\n })\r\n api.getGap(function (valgap) {\r\n gap = valgap\r\n })\r\n}", "title": "" }, { "docid": "ed598d19cfb1095fe5c41f0cdc9a1b58", "score": "0.45368397", "text": "getWeatherData(latitude, longitude, callback) {\n let link = 'https://api.darksky.net/forecast/' + this.api + '/' + latitude + ',' + longitude;\n let JSONData = \"\";\n\n https.get(link, res => {\n console.log(res.statusCode);\n res.on('data', data => {\n JSONData += data;\n });\n\n //Returns all the data in a callback function at the end\n res.on('end', () => {\n JSONData = JSON.parse(JSONData);\n console.log(\"JSONData Received from Forecast.io\")\n this.timeZone = JSONData.timezone;\n this.current = forecastParser.currentData(JSONData.currently);\n this.hourly = forecastParser.hourlyData(JSONData.hourly, 24);\n this.daily = forecastParser.dailyData(JSONData.daily, 7);\n callback(this.current, this.hourly, this.daily);\n })\n })\n }", "title": "" }, { "docid": "374ae9253e6e5c3f03cb8169c8610cbe", "score": "0.4535757", "text": "function compareCallback(a, b) {\n console.log(\"comparing: \" + a + \",\" + b);\n io.sockets.emit('compare', { a: a, b: b });\n \n sleep(50);\n}", "title": "" }, { "docid": "c4689e49365b64c730789de5d8495998", "score": "0.45348907", "text": "makePostData (callback) {\n\t\tsuper.makePostData(() => {\n\t\t\tthis.data.streamId = this.teamStream.id;\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "6c2bed1b93919ca8e88a324d9481bacf", "score": "0.45314535", "text": "makeUserData (callback) {\n\t\tsuper.makeUserData(() => {\n\t\t\tlet otherAttributeValue;\n\t\t\tswitch (this.otherAttributeType) {\n\t\t\tdefault:\n\t\t\tcase 'string': \n\t\t\tcase 'email': \n\t\t\tcase 'username':\n\t\t\t\totherAttributeValue = RandomString.generate(10); \n\t\t\t\tbreak;\n\t\t\tcase 'id':\n\t\t\t\totherAttributeValue = ObjectId();\n\t\t\t\tbreak;\n\t\t\tcase 'object': \n\t\t\t\totherAttributeValue = { x: 1, y: 'two' }; \n\t\t\t\tbreak;\n\t\t\tcase 'arrayOfIds':\n\t\t\t\totherAttributeValue = [ObjectId(), ObjectId()];\n\t\t\t\tbreak;\n\t\t\tcase 'arrayOfEmails':\n\t\t\tcase 'arrayOfStrings':\n\t\t\t\totherAttributeValue = ['x', 'y'];\n\t\t\t\tbreak;\n\t\t\tcase 'boolean':\n\t\t\t\totherAttributeValue = true;\n\t\t\t\tbreak;\n\t\t\tcase 'number':\n\t\t\tcase 'timestamp':\n\t\t\t\totherAttributeValue = Date.now();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.data[this.otherAttribute] = otherAttributeValue;\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "0e4365042801ef078bb492b14fb96053", "score": "0.45204812", "text": "function master_feedback() {\n \n if (d3.event.sourceEvent && (d3.event.sourceEvent.type === \"mousemove\" || d3.event.sourceEvent.type === \"touchmove\")) {\n //array from brush sensor or use default x-axis range\n var sensor = d3.event.selection || _masterChart().x.range();\n\n //provide feedback from master to slave \n //drive domain mapping sensor output over master x-min and max values\n _slaveChart().x.domain(sensor.map(_masterChart().x.invert, _masterChart().x));\n //rescale the x axis after setting the domain.\n _slaveChart().chart.select(\".axis--x\").call(_slaveChart().xAxis);\n\n _slaveChart().chart.select(\".zoom\").call(zoom_ratio.transform, d3.zoomIdentity\n .scale(_tfc_layout_slave().width / (sensor[1] - sensor[0]))\n .translate(-sensor[0], 0));\n //\n //_slaveChart().x.domain(s\n //console.info(\"brushed Bass brush event2\");\n //console.info(_masterChart().x.domain());\n //console.info(_masterChart().y.domain());\n\n }\n _slaveChart().chart.selectAll(\".dot\")\n .attr('cx', function (d) { return _slaveChart().x(d[date_dynField]); })\n .attr('cy', _tfc_layout_slave.height() * 0.5);\n /****\n var s = d3.event.selection || x2.range();\n x.domain(s.map(x2.invert, x2));\n //slave.select(\".line\").attr(\"d\", line); \n \n slave.select(\".axis--x\").call(xAxis);\n svg.select(\".zoom\").call(zoom.transform, d3.zoomIdentity\n .scale(width / (s[1] - s[0]))\n .translate(-s[0], 0));\n */\n }", "title": "" }, { "docid": "6ad1a8de2ccf3d7e8de51f65aa7ff23d", "score": "0.45199645", "text": "bind() {\n this.refindex = parseInt(this.refindex, 10);\n this.refvalues = parseInt(this.refvalues, 10);\n this.refendindex = this.refindex + this.refvalues;\n\n\n //configure convertors - used to convert units received from fmi\n if (this.convertors) {\n let convertvalues = this.convertors.split(';');\n let identity = x => x;\n this.operation = [];\n for (let i = 0; i < convertvalues.length; i++) {\n if (convertvalues[i].includes(',')) {\n //convert values are in form numerator,denominator contains comma ','\n let convertitems = convertvalues[i].split(',');\n if (convertitems[0] === '1' && convertitems[1] === '1') this.operation.push(identity);\n else {\n let numerator = parseFloat(convertitems[0]);\n let denominator = parseFloat(convertitems[1]);\n this.operation.push(x => x * numerator / denominator);\n }\n } else {\n //convert values are in form of expression, do not contain comma\n if (convertvalues === '1/x') this.operation.push(x => 1 / x);\n\n else {\n //filter only allowed characters: algebraic, digits, e, dot, modulo, parenthesis and 'x' is allowed\n let expression = convertvalues[i].replace(/[^-\\d/*+.()%xe]/g, '');\n console.log('chartjs bind(), evaluating expression:' + convertvalues[i] + ' securely filtered to :' + expression);\n // eslint-disable-next-line no-eval\n this.operation.push(x => eval(expression));\n }\n }\n }\n }\n\n\n //sets color of each dataset as different as possible\n //and set initial data in chart\n //set labels - separated by comma\n if (this.labels) this.chlabels = this.labels.split(',');\n //else generate labels as 'variable 1' ...\n else {\n this.chlabels = [...Array(this.refvalues)].map((_, i) => `variable ${i}`);\n }\n }", "title": "" }, { "docid": "644e6b1666d1bda8a1e3eb1e5e3c5311", "score": "0.45156908", "text": "onCallback () {}", "title": "" }, { "docid": "ad202bc65528e19ee6145b9896cde20d", "score": "0.45129144", "text": "on_sensor_update(sensor){\n // sensor.pitch\n // sensor.roll\n }", "title": "" }, { "docid": "54f2f32393f1b3d61aaaa2fbca343a2e", "score": "0.45078656", "text": "onSettings(oldSettingsObj, newSettingsObj, changedKeysArr, callback) {\n\n\n this.log(`oldSettingsObj ${util.inspect(oldSettingsObj)} `)\n this.log(` newSettingsObj ${util.inspect(newSettingsObj)} `)\n this.log(` changedKeysArr ${changedKeysArr} `)\n\n\n\n this.RxTx = {\n id: newSettingsObj.ip, // its ip for now must become mac \n type: this.driver, // lan with or without transmitterer / trnasmitter or trx //\n ip: newSettingsObj.ip,\n rx: newSettingsObj.port, // or trx = its rx port\n tx: null, // its tx port not for rfxtrx\n }\n\n //if (this.transceiver.clientRx) {\n // this.transceiver.clientRx.client.destroy()\n // this.log(`clientRx destroyed`)\n //}\n //delete this.transceiver\n //this.transceiver = new Transceiver( this.RxTx )\n\n if (changedKeysArr.includes(`processReceivedData`)) {\n\n this.log(`before this.transceiver.clientRx.processReceivedData ${this.transceiver.clientRx.processReceivedData} `)\n\n this.transceiver.clientRx.processReceivedData = newSettingsObj.processReceivedData\n\n this.log(` after this.transceiver.clientRx.processReceivedData ${this.transceiver.clientRx.processReceivedData} `)\n\n\n }\n\n\n if (changedKeysArr.includes(`sendData`)) {\n\n this.log(`before this.transceiver.clientRx.sendData ${this.transceiver.clientRx.sendData} `)\n\n if (this.rfxComType === `RxTxLan` || this.rfxComType === `TxLan`) {\n this.transceiver.clientTx.sendData = newSettingsObj.sendData\n this.log(` after this.transceiver.clientRx.sendData ${this.transceiver.clientTx.sendData} `)\n }\n else if (this.rfxComType === `RfxTrx`) {\n this.transceiver.clientRx.sendData = newSettingsObj.sendData\n this.log(` after this.transceiver.clientRx.sendData ${this.transceiver.clientRx.sendData} `)\n }\n\n\n\n\n }\n // run when the user has changed the device's settings in Homey.\n // changedKeysArr contains an array of keys that have been changed\n\n // always fire the callback, or the settings won't change!\n // if the settings must not be saved for whatever reason:\n // callback( \"Your error message\", null );\n // else\n callback(null, true);\n }", "title": "" }, { "docid": "f0ecf537326fc19aa8bf5f3f5d0bd9d0", "score": "0.44795543", "text": "function analyzeData(ownerKey, triggerSensor, triggerValue) {\n\t\n\tvar tooSoon = warningsTimestamps[ownerKey] && (new Date() - warningsTimestamps[ownerKey]) < options.analyzation.period * 1000\n\t\n\tif (!tooSoon && options.analyzation.criticalMuscles.indexOf(triggerSensor) >= 0 && triggerValue >= options.analyzation.criticalThreshold) {\n\t\tnotify(ownerKey, \"Watch out!\",\"Sensor \" + triggerSensor + \" is under excessive strain. <!--\" + triggerValue + \"-->\") // \n\t\twarningsTimestamps[ownerKey] = new Date();\n\t}\n\n\t//// Analyze standard deviation\n\t\t\n\ttooSoon = !analysisTimestamps[ownerKey] || (new Date() - analysisTimestamps[ownerKey]) < options.analyzation.period * 1000 // Only run this every options.analyzation.period seconds, because it's an intensive process\n\t\n\tif (tooSoon)\n\t\treturn analysisTimestamps[ownerKey] = analysisTimestamps[ownerKey] || new Date()\n\t\n\tvar sql = '\tSELECT sensorID, name AS sensorName, STD(val) AS std, ownerKey AS device \\\n\t\t\t\tFROM Data INNER JOIN Sensors \\\n\t\t\t\tON Sensors.ID=Data.sensorID \\\n\t\t\t\tWHERE logged >= FROM_UNIXTIME(?) AND logged <= FROM_UNIXTIME(?) AND ownerKey IN (?) \\\n\t\t\t\tGROUP BY sensorID \\\n\t\t\t\tLIMIT 100;'\n\t\t\t\t\n\tvar now = Math.ceil(Date.now()/1000)\n\tvar period = options.analyzation.historyMins // Mins \n\t\n\tanalysisTimestamps[ownerKey] = new Date()\n\t\n\tvar analysis = c.query(sql, [now - period * 60, now, [ownerKey]], function(err, result) {\n\t\t\t\t\n\t\tif (err)\n\t\t\treturn nodeLog(\"Mysql error while analyzing from archive: \" + JSON.stringify(err))\n\t\t\n\t\t// Read results for every sensor\n\t\tfor (var i = 0; i < result.length; i++) {\n\t\t\tvar sensor = result[i]\n\t\t\t\n\t\t\tif (options.analyzation.riskyMuscles.indexOf(sensor.sensorName) < 0) \n\t\t\t\tcontinue\n\t\t\t\n\t\t\tif (parseInt(sensor.std) < options.analyzation.deviationThreshold)\n\t\t\t\tnotify(sensor.device, \"Get up and take a break.<!-- STD is \" +sensor.std + \"-->\", \"Your \" + sensor.sensorName + \" has been still for a while\")\n\t\t\telse nodeLog(sensor.device + \"'s \" + sensor.sensorName + \" is fine, std=\" + sensor.std)\n\t\t}\t\t\n\t});\n}", "title": "" }, { "docid": "0f13230699ff55c3574338a6f3f17753", "score": "0.44727302", "text": "adjustUpdateData (callback) {\n\t\tthis.data.relatedCodemarkIds = [this.prerelatedCodemarkIds[1], this.prerelatedCodemarkIds[3]];\n\t\tcallback();\n\t}", "title": "" }, { "docid": "84a49125aa8b9c33b1e0e4959c7baef5", "score": "0.44722548", "text": "function MainChart_approximateSpectralValues(spectralDataProviderChart0, spectralDataProviderChart1) {\n // store the array for combining 2 line charts\n var spectralDataProviderChartCombined = [];\n\n for(var i = 0; i < spectralDataProviderChart1.length; i++) {\n var wavelength = spectralDataProviderChart1[i].wavelength;\n var reflectance0 = null;\n var reflectance1 = spectralDataProviderChart1[i].reflectance;\n\n if(spectralDataProviderChart0.length > 0) {\n reflectance0 = MainChart_getIdenticalValue(wavelength, spectralDataProviderChart0);\n if(reflectance0 == null) {\n //alert(\"NULL\");\n //return;\n }\n //console.log(reflectance0);\n }\n\n var spectralObj = new SpectralDataConstructorLine(wavelength, reflectance0);\n spectralDataProviderChartCombined.push(spectralObj);\n\n }\n\n return spectralDataProviderChartCombined;\n}", "title": "" }, { "docid": "99d32a6bb0ac52d41a04cf4e81e79bde", "score": "0.4471718", "text": "function handleSeries(callback){\n\n if(typeof node.datapoint !== 'object' && node.datapoint === null){\n node.warn( utility.warnError(node_name, 'Datapoint missing for history-request') )\n node.status(utility.statusError())\n return null\n }\n\n node.status(utility.statusProcessing())\n\n let from = null\n let to = null\n\n if(config.from_date === config.to_date && config.from_time === config.to_time){\n from = createTimestamp(config.from_date, cconfigonf.from_time, node.resolution_parsed)\n }else{\n from = createTimestamp(config.from_date, config.from_time)\n }\n\n if(!config.to_date){\n to = new Date().toISOString()\n }else{\n to = createTimestamp(config.to_date, config.to_time)\n }\n\n getSeriesByReq(clients[config.id], node.datapoint, from, to, config.resolution, function(err, data){\n callback(err,data)\n })\n }", "title": "" }, { "docid": "cbe1baf8275423f91089f9eaa34b6510", "score": "0.4469866", "text": "function map(array1, callbackFunc) {\n let newArray = [];\n for(let i=0; i<array1.length; i++) {\n newArray.push(callbackFunc(array1[i]));\n }\n return array1;\n}", "title": "" }, { "docid": "945b7be84a00c3e10b85617688b802ed", "score": "0.44666106", "text": "function calculateDifference(callback,number1,number2){\n console.log(\"Calculating difference\");\n\n return callback(number1,number2);\n}", "title": "" }, { "docid": "047856c0b68827e23d5713e8c0dd653e", "score": "0.44635636", "text": "function binDone(data, other) {\n binData = data;\n meta = other;\n if (labelMids!==undefined)\n onDone(binData, meta, labelMids);\n }", "title": "" }, { "docid": "b1c6da4caa62d2b3ee1a720ea8b6c15f", "score": "0.44627595", "text": "formatDataForOne(mainDataType) {\n // console.log(\"FORMAT DATA FOR 1: \" + JSON.stringify(this.props.data[mainDataType].self));\n\n // map over values and format into intermediate representation\n let values = this.props.data[mainDataType].self.map((value, index) => {\n return ( {x: index, y: (Math.round(value.value * 10) / 10)} );\n });\n // console.log(\"FORMATTED DATA FOR 1 (BEFORE RETURN): \" + JSON.stringify(values));\n\n console.log(\"Formatting data for two - values.length = \" + values.length);\n if (values.length > 100) {\n let intermediate = groupAverage(values, values.length / 100, (a, b) => {\n return {x: a.x + b.x, y: a.y + b.y}\n }, (a, b) => {\n return {x: a.x / b, y: a.y / b}\n });\n console.log(\"Intermediate length is \" + intermediate.length);\n values = intermediate;\n }\n\n\n // Mutation-free (no inplace changes) way of updating this.state.data\n if (values.length > 0) {\n let data = Object.assign({}, this.state.data);\n data[mainDataType] = data[mainDataType] || {};\n data[mainDataType]['self'] = values;\n let count = this.state.loadedValues;\n\n this.setState({data, loadedValues: count + 1});\n }\n\n // not necessary, but if you want to log it\n return values;\n }", "title": "" }, { "docid": "8b6ff397c5a4e5ee83c0378c16c0d932", "score": "0.4462383", "text": "function handleChange(editor,data,value){\r\n onChange1(value)\r\n }", "title": "" }, { "docid": "bcf324759d9e3e0fe9c36f42a592e06e", "score": "0.4459701", "text": "function defaultFunction(e) {\n var input = e.inputBuffer.getChannelData(0);\n var output = e.outputBuffer.getChannelData(0);\n for (var i = 0; i < buffersize; i++) {\n output[i] = input[i];\n }\n }", "title": "" }, { "docid": "e9936beb488071e238eae5aea97719b2", "score": "0.4454523", "text": "function getData(callback) {}", "title": "" }, { "docid": "b25adc61a67e765c19871568791192ff", "score": "0.44530216", "text": "function handleCharacteristicValueChanged(event) {\n // Output the value for each event differently\n let tempValue = event.target.value.getFloat32(0, true);\n console.log('Arduino Output for ' + \n uuidLookup[event.target.uuid] + ': ' + tempValue.toFixed(2));\n if (uuidLookup[event.target.uuid] == 'temp') {\n // Increments the values every time they come in\n // In this case, ticks is the number of seconds\n ++time;\n document.getElementById('timer').textContent = time;\n line_config.data.labels.push(time);\n\n // Changes the pressure value each time it comes in\n tempText.textContent = tempValue.toFixed(2);\n line_config.data.datasets[0].data.push(tempValue.toFixed(2));\n\n // Gauge chart updating values\n gauge_config.options.title.text = tempValue.toFixed(2);\n\n // Updating the label values\n document.getElementById('time-val').innerHTML = `${time} s`;\n document.getElementById('pressure-val').innerHTML = `${tempValue.toFixed(2)} bar`;\n\n // Updating the gauge chart values\n gauge_config.options.title.text = tempValue.toFixed(2);\n\n // 20 is the max bar value\n let first_val = (tempValue / 20) * 100;\n let second_val = ((20 - tempValue) / 20) * 100;\n\n // Emptying the dataset every time\n gauge_config.data.datasets[0].data = [];\n\n gauge_config.data.datasets[0].data.push(first_val);\n gauge_config.data.datasets[0].data.push(second_val);\n\n myChart.update();\n myChart1.update();\n\n\n } else if (uuidLookup[event.target.uuid] == 'newChar') {\n newText.textContent = tempValue.toFixed(2);\n tempHTML.textContent = tempValue.toFixed(2);\n }\n}", "title": "" }, { "docid": "96364368941640806848312edfda1ab3", "score": "0.44448858", "text": "function updateWeatherData () {\n\tgetWeather(getWeatherCb);\n}", "title": "" }, { "docid": "23dc0798c31de102876065422a61bc4a", "score": "0.44355208", "text": "notify() {\n for (const info1 of this._otherCallbacks) {\n try {\n let otherOver = info1; //info1.deref();\n if (otherOver != undefined) {\n otherOver(); // Notify any other overs, if they still exist.\n }\n } catch (e) {\n console.error(`While notifying of controller changes 1.`, e);\n }\n }\n let val = this._filterFunc();\n // Skip updating if the result is null\n if (val === null) {\n return;\n }\n for (const info of this._observers) {\n try {\n //if (info.setstateFunc == null) { continue; }\n if (val != null) {\n let s = {};\n s[info.variableName] = val;\n info.setstateFunc(s);\n }\n } catch (e) {\n console.error(`While notifying of controller changes 2.`, e);\n }\n }\n }", "title": "" }, { "docid": "d15f2f93318261ecdcaf86e6f05d19bb", "score": "0.44302", "text": "moundScan(screenCanvas, callback) {\n this.doScan(screenCanvas, this.moundData.data, () => {\n\n /* Just paint and show the canvas for now.\n TODO: invoke callback instead. */\n this.doDiff();\n this.paintDiff(screenCanvas);\n console.log(\"pixel data size: \" + this.pixelData.data.length);\n console.log(\"397 233 is at \" + this.pixelData.data[397][233].x + \" \" + this.pixelData.data[397][233].y);\n\n\n\n var patchWidth = screenCanvas.width / 128;\n var patchHeight = screenCanvas.height / 128;\n\n\n // TODO: temporary poor-man \"patch inspector\"\n $(screenCanvas).on('click', (e) => {\n var x = Math.floor(e.clientX / patchWidth);\n var y = Math.floor(e.clientY / patchHeight);\n console.log('flat', this.flatData.data[x][y].x, this.flatData.data[x][y].y);\n console.log('mound', this.moundData.data[x][y].x, this.moundData.data[x][y].y);\n console.log('diff', this.diffData.data[x][y].x, this.diffData.data[x][y].y);\n\n });\n //callback();\n });\n }", "title": "" }, { "docid": "7c9882c23d860412ce237b05961b512d", "score": "0.44258088", "text": "function calc(callback) {\n var n1 = parseFloat(document.getElementById(\"number7\").value);\n var n2 = parseFloat(document.getElementById(\"number8\").value);\n var result = callback(n1, n2);\n document.getElementById(\"output6\").innerHTML = result;\n }", "title": "" }, { "docid": "dc7fd4af5c26378d24f8236d0d735b3f", "score": "0.44227394", "text": "function updateFakeHR(){\n\tonSensorChanged([(Math.random()),(Math.random()+9.8),(Math.random())]);\n}", "title": "" }, { "docid": "f98407f1c2f4898bafcbe4c135995d8d", "score": "0.44176477", "text": "function handleCallBack(cBack,data,data2){\n\t\tif (typeof cBack == \"function\"){\n\t\t\tcBack(data,data2);\n\t\t}\n\t\telse{\n\t\t\teval(cBack);\n\t\t}\n\t}", "title": "" }, { "docid": "58cfd86154758f0e7de660bf9ee5d841", "score": "0.4416345", "text": "getData(callback) {\n let list = dataFormat(this.data);\n callback(null, list);\n }", "title": "" }, { "docid": "949b0ab34d15780d417ff2ff68522e18", "score": "0.44152012", "text": "function tock1(callback){\n // for each possible link in the data\n for (var key in data) {\n // keep track of its type\n var synapse = data[key].type,\n // keep track of the name of the source\n sorname = data[key].source.name;\n\n // if the source is active\n if (nodes[sorname].state == \"active\")\n {\n // keep track of the name of the target\n var tarname = data[key].target.name;\n\n // if the link is inhibitory\n if (synapse == \"inhibit\")\n {\n // get the weight\n var ipsp = data[key].weight;\n // inhibit the target\n nodes[tarname].value = nodes[tarname].value - ipsp;\n // reset the source\n // nodes[sorname].value = 0;\n }\n // if the link is excitatory\n if (synapse == \"excite\")\n {\n // get the weight\n var epsp = data[key].weight;\n // excite the target\n nodes[tarname].value = nodes[tarname].value + epsp;\n // reset the source\n // nodes[sorname].value = 0;\n }\n }\n }\n if (typeof callback == \"function\") callback();\n }", "title": "" }, { "docid": "0f53243b80d756f9de60603bb40e0031", "score": "0.44099867", "text": "$onAny(callback) {\n this.meddler = callback\n }", "title": "" }, { "docid": "f8db560c3d84f4ee271f2161d1191319", "score": "0.44050634", "text": "onDataProcessedResult(func) {\n this.dataResultProcessors.push(func);\n }", "title": "" }, { "docid": "fd05f567a78dfd6108b65fdfa10fe5fb", "score": "0.44039544", "text": "function handleWeatherData(weather) {\n let avgTemp = (weather.daily.data[0].temperatureHigh + weather.daily.data[0].temperatureLow)/2;\n avgTemp = Number(avgTemp.toFixed(2));\n dataset.temperatures.push(avgTemp);\n\n dataset.threshold.push(dataset.thresholdValue);\n markPoints(avgTemp);\n chart.update(); \n}", "title": "" }, { "docid": "f8aaaeea4e161bf85494b6a1eadcc034", "score": "0.44037294", "text": "static fromCallback (f) {\n return new Signal(emit => {\n f((e, a) => {\n if (typeof e !== 'undefined' && e !== null) {\n emit.error(e)\n } else {\n emit.next(a)\n }\n })\n })\n }", "title": "" }, { "docid": "12e7ea0a917b574cade7608214415b90", "score": "0.4403077", "text": "function parseReceivedRegister(sensor, data){\n\n var json = JSON.parse(data);\n\n switch(sensor){\n case Sensors.ACCELEROMETER: \n var values = new Models.Accelerometer({\n device: json.device,\n timestamp: new Date(parseInt(json.timestamp)),\n x: json.x,\n y: json.y,\n z: json.z\n });\n\n // Insert data in the database\n InsertData(values);\n\n break;\n\n case Sensors.GYROSCOPE:\n var values = new Models.Gyroscope({\n device: json.device,\n timestamp: new Date(parseInt(json.timestamp)),\n x: json.x,\n y: json.y,\n z: json.z\n });\n // Insert data in the database\n InsertData(values);\n break;\n\n case Sensors.GPS:\n var values = new Models.GPS({\n device: json.device,\n timestamp: new Date(parseInt(json.timestamp)),\n latitude: json.latitude,\n longitude: json.longitude,\n bearing: json.bearing,\n speed: json.speed,\n altitude: json.altitude,\n provider: json.provider,\n accuracy: json.accuracy\n });\n // Insert data in the database\n InsertData(values);\n break;\n\n case Sensors.LIGHT:\n var values = new Models.Light({\n device: json.device,\n timestamp: new Date(parseInt(json.timestamp)),\n lux: json.lux\n });\n // Insert data in the database\n InsertData(values);\n break;\n\n case Sensors.PROXIMITY:\n var values = new Models.Proximity({\n device: json.device,\n timestamp: new Date(parseInt(json.timestamp)),\n proximity: json.proximity\n });\n // Insert data in the database\n InsertData(values);\n break;\n\n case Sensors.BATTERY:\n var values = new Models.Battery({\n device: json.device,\n timestamp: new Date(parseInt(json.timestamp)),\n level: json.level,\n scale: json.scale,\n voltage: json.voltage,\n temperature: json.temperature\n });\n // Insert data in the database\n InsertData(values);\n break;\n\n case Sensors.BAROMETER:\n var values = new Models.Barometer({\n device: json.device,\n timestamp: new Date(json.timestamp),\n value: json.value\n });\n // Insert data in the database\n InsertData(values);\n break;\n\n case Sensors.STATUS:\n var values = new Models.Status({\n device: json.device,\n value: json.value\n });\n\n // Insert data in the database\n InsertData(values);\n break;\n\n default:\n console.log(\"No existing behavior for this sensor: \" + sensor);\n }\n\n // Emit message\n distributeDataRealTime(json.device, sensor, data);\n}", "title": "" }, { "docid": "e849a5929663e298eb56df4c6d280ebc", "score": "0.44021365", "text": "function MainChart_handleClickedChartValues(floatsArray) {\n // combine array values from clicked coordinate and spectral library\n var spectralDataProviderChart1 = [];\n\n // This is for the clicked coordinate from WCPS\n var xDist = 2.625529412 / floatsArray.length; // Value for setting the equidistance Band wavelength which should be between 1 and 4\n var xPrev = 0.405; // Value used for storing the Band wavelength of the previous Band\n var Ymin = Infinity,\n Ymax = -Infinity; // Values for getting the minimum and maximum out of the array\n\n for (var i = 0; i < floatsArray.length; i++) {\n // Only get points with valid value\n var relectance = floatsArray[i];\n\n var spectralObj = new SpectralDataConstructorLine(parseFloat(xPrev).toFixed(3), relectance);\n spectralDataProviderChart1.push(spectralObj);\n\n if (Ymin > floatsArray[i]) { // Getting the minimum of value to draw chart\n Ymin = floatsArray[i];\n } else if (Ymax < floatsArray[i]) { // Getting the maximum of value to draw chart\n Ymax = floatsArray[i];\n }\n\n // If point value is valid or not valid still need to calculate the X coordinate for it.\n xPrev = xPrev + xDist; // Setting the correct X-axis wavelength of the current Band/point\n \n }\n// console.log(spectralDataProviderChart1);\n return spectralDataProviderChart1;\n}", "title": "" }, { "docid": "21c6ba761f51070494d8bd0f7e0dc61a", "score": "0.4401449", "text": "function handleFidelityChange( new_jsondata){\n\t\tconsole.debug(\"fidelity change\");\n\t\t\n\t\tfor ( var j = 0; j < new_jsondata.userInputs.selectedResponses.length; j++ ){\n\t\t\tvar new_a_selected_response = new_jsondata.userInputs.selectedResponses[j];\n\t\t\tvar new_plots = [];\n\t\t\tvar old_ConstraintPlots = getOldConstraintPlots( new_a_selected_response.rid);\n\t\t\tconsole.debug( \"new_a_selected_response.rid: \" + new_a_selected_response.rid );\n\t\t\tvar new_plot_from_old;\n\t\t\tif ( old_ConstraintPlots.length != 0 )\n\t\t\t{\n\t\t\t\t//old data exists\n\t\t\t\tfor ( var i = 0; i < old_ConstraintPlots.length; i++ ){\n\t\t\t\t\tnew_plot_from_old = new Plot_p(null, null, null, null, null, null, old_ConstraintPlots[i]);\n\t\t\t\t\tnew_plot_from_old.r = getResponse( new_a_selected_response.rid, new_jsondata.responses);\n\t\t\t\t\tnew_plots.push(new_plot_from_old);\n\t\t\t\t}\n\t\t\t\taddBackAPlotWithNewData( new_a_selected_response.rid, new_plots, new_jsondata); \n\t\t\t}\n\t\t\telse {\n\t\t\t\t//this is a case when a data is gone (nothing to plot)\n\t\t\t\t//a,b,c,d, etc... coefficient when userInputs.defaultVariableValues changed.\n\t\t\t\t//sending worker to 1) function calculate and 2) grid caculate \n\t\t\t\tvar worker = initializeWorker();\n\t\t\t\tworker.postMessage({'type': 1, 'jsondata': new_jsondata, 'rid': new_a_selected_response.rid });\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7ef35bf23965a0c9030ba58164a1756d", "score": "0.44012913", "text": "attributeChangedCallback(attr, oldValue, newValue) {\n\n\t\tif (attr == 'min') {\n\t\t\tthis.min = parseFloat(newValue);\n } else if (attr == 'max') {\n \tthis.max = parseInt(newValue);\n } else if (attr == 'step') {\n \tthis.step = parseFloat(newValue);\n } else if (attr == 'value') {\n \tif (newValue === oldValue) {\n \t\treturn;\n \t} else if (parseFloat(newValue) > parseFloat(oldValue)) {\n \t\tthis.value = parseFloat(newValue);\n \t\tthis.onSliderNewPosition(this.value, this.FDW);\n \t} else {\n \t\t// Less than oldValue\n \t\tthis.value = parseFloat(newValue);\n \t\tthis.onSliderNewPosition(this.value, this.BKW);\n \t}\n } else if (attr == 'motora') {\n \tthis.motora = parseInt(newValue);\n } else if (attr == 'motorb') {\n \tthis.motorb = parseInt(newValue);\n } else if (attr == 'touch') {\n \tthis.touch = parseInt(newValue);\n } else if (attr == 'i2c-port') {\n this.i2cport = newValue;\n }\n\n }", "title": "" }, { "docid": "731dc6ec6e11181788f4df78b739be55", "score": "0.44006637", "text": "function processData(i){\n http_stream.get(\"http://localhost:3001/api/streamdata/temp/\"+i, function (data) {\n var stringdata = data.toString()\n\n if(stringdata == 'sensor gestopt'){\n return\n }\n if(stringdata == 'No sensor found'){\n return\n }\n\n if (data == null) {\n console.log(\"streamdata uitgevallen\")\n return;\n }\n if (data[13] == 'u') {\n console.log(\"parsen mag nog niet\")\n return;\n }\n if (data[13] != 'u') {\n var json = JSON.parse(data)\n }\n\n\n const graden = json.Temperature\n insertData(graden, json, i)\n\n\n })\n}", "title": "" }, { "docid": "089541f1b390a5c8ed410448f18813ae", "score": "0.439757", "text": "function realTimeDispatcher() {\n return d3.dispatch('mouseover', 'updateoverlay', 'mouseout', 'newXValue');\n}", "title": "" }, { "docid": "34bfcff9372f46c486e7f86dc6ef20ab", "score": "0.43945643", "text": "onDataCallback(type, msg, msg_bytes) {\n\n }", "title": "" }, { "docid": "33bcb626993dae4a056993bad04f07f8", "score": "0.43869", "text": "function updateDataTransfer(refferenceNo, statusTransfer, callback){\n console.log(\"update data transfer \" + refferenceNo)\n\n \n}", "title": "" }, { "docid": "652ec199cee5d43a15bb51c6c3a60419", "score": "0.43858323", "text": "controlFanDeferred(callback) {\n switch (this.stateOn ? this.stateSpeed : SPEED.OFF) {\n case SPEED.LOW:\n this.log('Setting fan speed to Low');\n this.fan.buttonLow(callback);\n break;\n case SPEED.MEDIUM:\n this.log('Setting fan speed to Medium');\n this.fan.buttonMedium(callback);\n break;\n case SPEED.HIGH:\n this.log('Setting fan speed to High');\n this.fan.buttonHigh(callback);\n break;\n default:\n this.log('Switching fan Off');\n this.fan.buttonOff(callback);\n break;\n }\n }", "title": "" }, { "docid": "18679ea0b89c0dbbc5dad4f3f6dcc77a", "score": "0.43847042", "text": "onBatteryData (percentage) {\n// console.log('TFunctionModule.onBatteryData', percentage);\n }", "title": "" }, { "docid": "809f99f256d2f52a30b5e3cd590fcb5f", "score": "0.43811673", "text": "function onDataReceived(series) {\n // we get all the data in one go, if we only got partial\n // data, we could merge it with what we already got\n //console.log(series.Home);\n constraint2 = { \n threshold: series.warning,\n color: \"rgb(253, 159, 36)\",\n evaluate : function (y, threshold) { return y < threshold; }\n };\n constraint1 = { \n threshold: series.critical,\n color: \"rgb(237,28,36)\",\n evaluate : function (y, threshold) {return y < threshold; }\n };\n plot_data = [{data: series.data, constraints: [constraint1, constraint2], color: \"rgb(0, 146, 69)\"}];\n $.mobile.hidePageLoadingMsg();\n $('#data-plot').show();\n $.plot($(\"#data-plot\"), plot_data, { xaxis: { mode: \"time\" }});\n}", "title": "" }, { "docid": "baeebfac7ef4daf6fbe3c58354eb67d7", "score": "0.43796104", "text": "function addValueListeners(network) {\n var value = network.get(\"device\").findWhere({\n \"name\": networkInfo.device[0].name\n }).get(\"value\").findWhere({\n name: \"city\"\n });\n var controlState = value.get(\"state\").findWhere({\n \"type\": \"Control\"\n });\n if (controlState) {\n controlState.off(\"stream:data\", null, \"OpenWeatherMap Converter\");\n controlState.on(\"stream:data\", function(data) {\n if(data.timestamp != controlState.get(\"timestamp\")){\n data = data.data;\n sendRequest(network, data, value);\n if(timer){\n clearInterval(timer);\n }\n timer = setInterval(function(){\n sendRequest(network, data, value);\n }, 900000);\n }\n }, \"OpenWeatherMap Converter\");\n if(!timer){\n timer = setInterval(function(){\n sendRequest(network, controlState.get(\"data\"), value);\n }, 900000);\n }\n }\n}", "title": "" }, { "docid": "118eec19cd15dfe839a5d051430f7181", "score": "0.43772942", "text": "function calc(num1, num2, callback) {\r\n return callback(num1, num2);\r\n}", "title": "" } ]
e254aae9eb358ced5d3535b0e8e6f308
Start the blockchain sync.
[ { "docid": "133767ec77cf47b8fe36934763f0e8a7", "score": "0.0", "text": "startSync() {\n return this.pool.startSync();\n }", "title": "" } ]
[ { "docid": "629d75254093b400ffad795038cac726", "score": "0.6765538", "text": "async start () {\n if (this.settings.verbosity >= 4) console.log('[SERVICES:BITCOIN]', `Starting for network \"${this.settings.network}\"...`);\n const self = this;\n self.status = 'starting';\n\n if (this.store) await this.store.open();\n if (this.settings.fullnode) {\n this.fullnode.on('peer connect', function peerConnectHandler (peer) {\n self.emit('warning', `[SERVICES:BITCOIN]', 'Peer connected to Full Node: ${peer}`);\n });\n\n this.fullnode.on('block', this._handleBlockMessage.bind(this));\n this.fullnode.on('connect', this._handleConnectMessage.bind(this));\n\n this.fullnode.on('tx', async function fullnodeTxHandler (tx) {\n self.emit('message', `tx event: ${JSON.stringify(tx)}`);\n });\n }\n\n this.wallet.on('message', function (msg) {\n self.emit('message', `wallet msg: ${msg}`);\n });\n\n this.wallet.on('warning', function (msg) {\n self.emit('warning', `wallet warning: ${msg}`);\n });\n\n this.wallet.on('error', function (msg) {\n self.emit('error', `wallet error: ${msg}`);\n });\n\n this.wallet.database.on('tx', function (tx) {\n self.emit('message', `wallet tx!!!!!! ${JSON.stringify(tx, null, ' ')}`);\n });\n\n // Start services\n await this.wallet.start();\n // await this.chain.start();\n\n // Start nodes\n if (this.settings.fullnode) await this._startLocalNode();\n if (this.settings.mode === 'rpc') {\n if (!this.settings.authority) return console.error('Error: No authority specified. To use an RPC anchor, provide the \"authority\" parameter.');\n const provider = new URL(this.settings.authority);\n const config = {\n host: provider.hostname,\n port: provider.port\n };\n\n const auth = provider.username + ':' + provider.password;\n config.headers = { Authorization: `Basic ${Buffer.from(auth, 'utf8').toString('base64')}` };\n\n if (provider.protocol === 'https:') {\n self.rpc = jayson.client.https(config);\n } else {\n self.rpc = jayson.client.http(config);\n }\n\n try {\n await this._syncBalanceFromOracle();\n } catch (exception) {\n this.emit('error', exception);\n return this;\n }\n\n self.heartbeat = setInterval(self._heartbeat.bind(self), self.settings.interval);\n }\n\n // TODO: re-enable these\n // await this._connectToSeedNodes();\n // await this._connectToEdgeNodes();\n\n // TODO: re-enable SPV\n // await this._connectSPV();\n\n // this.peer.tryOpen();\n // END TODO\n\n if (this.settings.fullnode) {\n const genesis = await this.fullnode.getBlock(0);\n\n // TODO: refactor Chain\n if (this.chain) {\n await this.chain._setGenesis(genesis.toJSON());\n }\n }\n\n this.emit('ready', {\n tip: this.tip\n });\n\n if (this.settings.verbosity >= 4) console.log('[SERVICES:BITCOIN]', 'Service started!');\n return this;\n }", "title": "" }, { "docid": "ee799c6d670a1a0b31913c45d9c46a09", "score": "0.67152035", "text": "startSync() {\n if (!this.opened)\n return;\n\n assert(this.connected, 'Pool is not connected!');\n\n this.syncing = true;\n this.resync(false);\n }", "title": "" }, { "docid": "836325591c128988a1bec74c2fa7db1e", "score": "0.64938027", "text": "async function main(){\r\n\twalletCore = new WalletCore(config);\r\n\tawait walletCore.init();\r\n\tconsole.log('Starting init walletCore');\r\n\r\n srcChain = global.crossInvoker.getSrcChainNameByContractAddr('WAN', 'WAN');\r\n dstChain = global.crossInvoker.getSrcChainNameByContractAddr(e20OutboundInput.tokenAddr, 'ETH');\r\n e20OutboundInput.coin2WanRatio = await ccUtil.getToken2WanRatio(e20OutboundInput.tokenAddr);\r\n e20OutboundInput.lockInput.txFeeRatio = (await global.crossInvoker.getStoremanGroupList(srcChain, dstChain))[0].txFeeRatio;\r\n e20OutboundInput.lockInput.storeman = (await ccUtil.syncTokenStoremanGroups('ETH', e20OutboundInput.tokenAddr))[0].smgWanAddr;\r\n e20OutboundInput.lockInput.decimals = (await ccUtil.getTokenInfo(e20OutboundInput.tokenAddr, 'ETH')).decimals;\r\n\r\n\r\n\r\n\tconsole.log('Starting eth outbound lock', e20OutboundInput.lockInput);\r\n\r\n\t// Invoke the lock transaction on wanchain\r\n\tretLock = await global.crossInvoker.invoke(srcChain, dstChain, 'LOCK', e20OutboundInput.lockInput);\r\n \r\n console.log(`The Lock Hash is ${retLock.result}`);\r\n process.exit(0);\r\n}", "title": "" }, { "docid": "0f1342d15c59bc94ad0bcc6a8a3c5e19", "score": "0.6344919", "text": "SendBlockchain()\n{\n // todo: broadcast lasted blockchain\n}", "title": "" }, { "docid": "5cfc570a7c456e7560951122a8e56817", "score": "0.62865496", "text": "startSync () {\n winston.log('info', '[Importer] Started importer, indexing claims.');\n sync();\n }", "title": "" }, { "docid": "8887ec45a0360d64b6c2dbad2bc7fb96", "score": "0.618669", "text": "async initialSync () {\n // TODO: use time heuristic (see comment at top of file)\n // TODO: get tip height from multiple peers and make sure\n // they give us similar results\n let status = await this.rpc.status()\n let tip = safeParseInt(status.sync_info.latest_block_height)\n if (tip > this.height()) {\n await this.syncTo(tip)\n }\n this.handleError(this.subscribe)()\n }", "title": "" }, { "docid": "a191991a3b6981675181c745ffffffe3", "score": "0.6159888", "text": "start() {\n storage.setStore(this.store);\n storage.setItem('wallet:server', this.conn.currentServer);\n\n this.conn.on('state', this.onConnectionChangedState);\n this.conn.on('wallet-update', this.handleWebsocketMsg);\n\n const ret = wallet.executeGenerateWallet(this.seed, this.passphrase, this.pinCode, this.password, false);\n if (ret !== null) {\n throw \"This should never happen\";\n }\n\n this.getTokenData();\n this.serverInfo = null;\n this.walletStopped = false;\n this.setState(HathorWallet.CONNECTING);\n\n const promise = new Promise((resolve, reject) => {\n version.checkApiVersion().then((info) => {\n // Check network version to avoid blunders.\n if (info.network.indexOf(this.conn.network) >= 0) {\n this.serverInfo = info;\n this.conn.start();\n resolve(info);\n } else {\n this.setState(HathorWallet.CLOSED);\n reject(`Wrong network. server=${info.network} expected=${this.conn.network}`);\n }\n }, (error) => {\n this.setState(HathorWallet.CLOSED);\n reject(error);\n });\n });\n return promise;\n }", "title": "" }, { "docid": "b288bd67cdc3cc6dd174eeaa48835340", "score": "0.5946106", "text": "function startSync()\n{\n if(!app.syncInProgress && app.networkStatus == 'online') {\n app.syncInProgress = true;\n // No.1 Section Executed\n downloadNewObjects();\n // No.2 Section Executed\n app.db.transaction(selectSyncPendingContacts,errorCB); // Fetching the Offline Objects Stored in the Database\n }else\n {\n myScroll.refresh();\n }\n}", "title": "" }, { "docid": "2c2a1908d6cd56d4d1477be9e9da4314", "score": "0.58511835", "text": "function watchSyncing(){\n if(web3 != null && web3.isConnected()) {\n\t web3.eth.isSyncing(function(err, sync){\n\t if(!err) {\n\t // stop all app activity\n\t if(sync === true) {\n\t // we use `true`, so it stops all filters, but not the web3.eth.syncing polling\n\t web3.reset(true);\n\t } else if(sync) {\n\t // Show sync info. When your Ethereum node is not runnning for a day, your node need to be synchronized.\n\t // A message will be displayed on top of screen.\n\t //\n\t let message = \"Syncing from \"+sync.currentBlock+\" to \"+sync.highestBlock;\n\t showIntervalMessage(message);\n\t // if(debug) console.log(\"The block number where the sync started = \"+sync.startingBlock);\n\t // if(debug) console.log(\"The block number where at which block the node currently synced to already = \"+sync.currentBlock);\n\t // if(debug) console.log(\"The estimated block number to sync to = \"+sync.highestBlock);\n\t } else {\n\t // re-gain app operation\n\t // if(debug) console.log(\"startApp\");\n\t startApp();\n\t }\n\t }\n\t });\n }\n}", "title": "" }, { "docid": "d3dcaa4c8d1f11c35d9bb266b7d362f4", "score": "0.5826021", "text": "async function main () {\n console.log('Hello, starting the washing machine')\n\n // ncal\n let baseNode = 'e2cef0473117da34108dd85d4425536b8a1f317478686a6d7a0bbb5c800a747d::/onion3/3eiacmnozk7rcvrx7brhlssnpueqsjdsfbfmq63d2bk7h3vtah35tcyd:18141'\n\n // load sender wallet\n let senderClient = new WalletClient('127.0.0.1:18143')\n\n let receiverWallet = createGrpcWallet(baseNode)\n receiverWallet.baseDir = './wallet'\n await receiverWallet.startNew()\n\n let receiverClient = receiverWallet.getClient()\n\n for (let numTxs = 0; numTxs < 50; numTxs++) {\n await doSend(senderClient, receiverClient, (100 - numTxs * 1) * 1000, numTxs + 1)\n // Send back\n await doSend(receiverClient, senderClient, (95 - numTxs * 1) * 1000, numTxs + 1)\n\n }\n await receiverWallet.stop()\n}", "title": "" }, { "docid": "433ba292d91a383416ea33c78ae70ad0", "score": "0.57852966", "text": "async sync(startHeight, endHeight, onProgress) {\n await this._initOneTime();\n \n // fetch and cache latest daemon info\n let info = await this.config.daemon.getInfo();\n this.cache.chainHeight = info.getHeight();\n this.cache.numTxs = info.getNumTxs();\n \n // track unprocessed blocks\n this.cache.unprocessed = this.cache.processed.copy().flip();\n\n // sanitize and validate range to process\n if (endHeight === undefined || endHeight === null) endHeight = this.cache.chainHeight - 1;\n else {\n assert(startHeight !== undefined && startHeight !== null, \"Start height must be defined if end height is defined\");\n assert(endHeight >= startHeight && endHeight < this.cache.chainHeight);\n }\n if (startHeight === undefined || startHeight === null) startHeight = await this.getHeight();\n else assert(startHeight >= 0 && startHeight < this.cache.chainHeight, \"Start height must be >= 0 and < chain height \" + this.cache.chainHeight + \" but was \" + startHeight);\n \n // done if start is greater than available blocks\n if (startHeight > endHeight) return;\n \n // report 0% progress\n if (onProgress) {\n onProgress({\n percent: 0,\n message: \"Synchronizing\",\n doneBlocks: 0,\n totalBlocks: endHeight - startHeight + 1\n });\n }\n \n // process all blocks in the range\n let newBlocksProcessed = false;\n while (this._hasUnprocessedBlocks(startHeight, endHeight)) {\n await this._processBlocksChunk(this.config.daemon, startHeight, endHeight, onProgress);\n newBlocksProcessed = true;\n }\n \n // update progress manually if no new blocks processed\n if (!newBlocksProcessed && onProgress) {\n onProgress({\n percent: 1,\n message: \"Wallet synchronized.\",\n doneBlocks: endHeight - startHeight + 1,\n totalBlocks: endHeight - startHeight + 1\n });\n }\n }", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.5716416", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.5716416", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.5716416", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.5716416", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.5716416", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.5716416", "text": "function SYNC() {}", "title": "" }, { "docid": "82484c3cb2f9eb0c16d795d9532dc5d4", "score": "0.5669789", "text": "function SYNC() { }", "title": "" }, { "docid": "efafaca46576e84d13b4bb57ffe44f7e", "score": "0.5663956", "text": "syncing() {\n return this.send('eth_syncing')\n }", "title": "" }, { "docid": "26b17caa7b36a931cc6cc5f149d70e4a", "score": "0.5646201", "text": "async start() {\n await this.ccxtExchange.loadMarkets();\n this.symbols = this.ccxtExchange.symbols;\n\n // Start buffer flushers\n this.startFlusher('trades');\n this.startFlusher('orderbooks');\n\n // Start watching for new symbols listing\n this.startMarketWatcher();\n\n // Start subscribing and listening to trades/orderbooks\n const symbolsSubLimit = this.ccxtExchange.symbols.length;\n let subscribedSymbols = [];\n console.log(`Exchange: \\t\\t${this.ccxtExchange.id}`);\n console.log(`Symbols (Total): \\t${this.ccxtExchange.symbols.length}`);\n for (const symbol of this.ccxtExchange.symbols) {\n this.addTradeWatcher(symbol);\n this.addOrderbookWatcher(symbol);\n subscribedSymbols.push(symbol);\n }\n console.log(`Symbols (Subscribed): \\t${subscribedSymbols.length}`);\n console.log(subscribedSymbols);\n this.notifySubscriptionsCompleted(subscribedSymbols.length);\n }", "title": "" }, { "docid": "520dbe9f6dd751a54b29ee065118e78d", "score": "0.56398857", "text": "async sync() {\n const startTime = Date.now(); \n const timer = this.createRequestTimer(this.options.network.syncInterval);\n await this.normalizeRoot({ timeout: timer() });\n await this.cleanUpServers();\n const slaves = await this.db.getSlaves();\n const size = slaves.length;\n size? await this.db.addMaster(this.address, size): await this.db.removeMaster(this.address); \n const mastersUp = await this.syncUp({ timeout: timer() });\n const mastersDown = await this.syncDown({ timeout: timer() });\n const actualMasters = [].concat(mastersUp, mastersDown);\n\n if(size) {\n const masters = await this.db.getMasters();\n masters.forEach(m => m.source = this.address);\n const structures = await this.updateMastersInfo([].concat(masters, actualMasters), { timeout: timer() });\n await this.checkStructures(structures, { timeout: timer() });\n }\n else {\n await this.db.removeMasters();\n\n for(let i = 0; i < actualMasters.length; i++) {\n const master = actualMasters[i]; \n \n if(!await this.isAddressAllowed(master.address)) {\n continue;\n }\n\n await this.db.addMaster(master.address, master.size);\n }\n }\n \n await this.normalizeMastersCount();\n await this.normalizeSlavesCount();\n \n try {\n await this.register({ timeout: timer() });\n }\n catch(err) {\n await this.db.removeBacklink();\n\n if(err instanceof errors.WorkError) {\n this.logger.warn(err.stack);\n }\n else {\n throw err;\n }\n } \n \n await this.db.normalizeApproval();\n await this.db.normalizeBehaviorFails();\n await this.db.normalizeBanlist();\n await this.db.normalizeBehaviorCandidates();\n await this.db.normalizeServers();\n const time = Date.now() - startTime;\n this.__syncList.push({ time });\n this.__syncList.length > this.getSyncListSize() && this.__syncList.shift();\n this.logger.info(`Sync takes ${ms(time)}`);\n }", "title": "" }, { "docid": "fce744f847a830b977e1aaf1a933cb35", "score": "0.562089", "text": "async startLightningWallet() {\n mainLog.info('Establishing connection to Lightning gRPC interface...')\n this.lightning = new Lightning(this.lndConfig)\n // Connect to the Lightning interface.\n try {\n await this.lightning.connect()\n\n this.lightning.subscribe(this.mainWindow)\n\n // Listen for all gRPC restful methods and pass to gRPC.\n ipcMain.on('lnd', (event, { msg, data }) => this.lightning.registerMethods(event, msg, data))\n\n // Let the renderer know that we are connected.\n this.sendMessage('lightningWalletStarted', this.lndConfig)\n } catch (err) {\n mainLog.warn('Unable to connect to Lightning gRPC interface: %o', err)\n throw err\n }\n }", "title": "" }, { "docid": "cb8d5669f1c8776a3495ac2c3b9bd79b", "score": "0.56161654", "text": "async function initBlockchain() {\n\t// Modern dapp browsers...\n\tif (window.ethereum) {\n\t\tethereum.autoRefreshOnNetworkChange = true;\n\t\twindow.web3 = new Web3(ethereum);\n\t\ttry {\n\t\t\t// Request account access if needed\n\t\t\tawait ethereum.enable();\n\t\t\tconsole.log(\"Ethereum enabled with account : \"+ethereum.selectedAddress);\n\t\t} catch (error) {\n\t\t\tconsole.error(\"Access denied for metamask by user\");\n\t\t}\n\n\t\tethereum.on(\"accountsChanged\", (accounts) => { document.location.reload(true); });\n\n\t}\n\t// Legacy dapp browsers...\n\telse if (window.web3) {\n\t\twindow.web3 = new Web3(web3.currentProvider);\n\t}\n\t// Non-dapp browsers...\n\telse {\n\t\tconsole.log('Non-Ethereum browser detected. You should consider trying MetaMask!');\n\t}\n\n\tconsole.log(\"web3 : \"+web3.version);\n\n\tconsole.log(\"Load contract at : \"+contractAddress);\n\ttry {\n\t\tnotaryContract = new web3.eth.Contract(notaryABI, contractAddress);\n\t}\n\tcatch(error) {\n\t\tconsole.error(\"Error loading contract : \"+error);\n\t}\n}", "title": "" }, { "docid": "37bfd7e131494c29883a3e823bdad6fc", "score": "0.5592945", "text": "broadcastRequestForChain() {\n this._broadcast(this.MESSAGE_TYPE.REQUEST_SYNC_CHAIN, 'Let us sync the whole chain!');\n }", "title": "" }, { "docid": "2d4de32d28b4b25b3405635a8f519e7b", "score": "0.5587216", "text": "start() {\n this.runFromMining();\n }", "title": "" }, { "docid": "03c70863f476cf6b2ee9d407099b454d", "score": "0.55393827", "text": "function sync() {\n //update attribute of the sync-wrapper div to show current state of sync\n syncDom.setAttribute('data-sync-state', 'syncing');\n //update sync status span to show sync working\n $('#sync-span').html('Currently syncing to remote database.');\n $('#sync-wrapper').css(\"background-color\", \"green\");\n // setting live: true means the database will sync continuously\n var opts = {live: true};\n //sync local PouchDB instance (db) with the remote CouchDB\n //use the retun value from db.sync to listen to the changes\n //on every change in the db, re-run updateArticles to display current list\n db.sync(remoteCouch, opts, syncError).on('change', updateArticles);\n }", "title": "" }, { "docid": "e80bcd3eac767f5728bdfb16ad8fdb17", "score": "0.552855", "text": "function startForge() {\n fromDisk(\"config.json\", true).then(config => {\n if (!config) {\n console.warn(\"- config.json is missing, if you're not using the Forge GUI wallet, you'll have to fix this manually.\");\n return;\n }\n let rpcAuth = {user: config.wallet.user, pass: config.wallet.pass, port: config.wallet.port};\n if (config.wallet.address !== null) {\n addy = config.wallet.address.replace(/ /g, \"\");;\n } else {\n console.warn(\"- Config missing 'address', generating a new address...\");\n }\n if (config.wallet.datadir) {\n appdataZC = config.wallet.datadir.replace(/\\\\/g, '/');\n // Make sure the ending \"/\" isn't missing\n if (!appdataZC.endsWith(\"/\"))\n appdataZC += \"/\";\n } else {\n console.warn(\"- Config missing 'wallet.datadir', defaulting to '\" + appdataZC +\"'\");\n }\n zenzo = new RPC('http://' + rpcAuth.user + ':' + rpcAuth.pass + '@localhost:' + rpcAuth.port);\n if (config.forgeport) {\n forgePort = config.forgeport;\n } else {\n console.info(\"- Config missing 'forgeport' option, defaulting to '\" + forgePort + \"'.\");\n }\n if (config.maxinvalidscore) {\n maxInvalidScore = config.maxinvalidscore;\n }\n if (config.debug) {\n try {\n // Remove whitespace (No more space typos, Josep!)\n let debugTmp = config.debug.replace(/ /g, \"\");\n // Attempt to split the debug option if a delimiter is specified\n if (debugTmp.includes(\",\")) {\n debugType = debugTmp.split(\",\");\n } else {\n debugType = [debugTmp];\n }\n } catch (e) {\n console.warn(\"- Config 'debug' option is invalid, defaulting to '\" + debugType + \"' (\" + e + \")\");\n }\n } else {\n console.info(\"- Config missing 'debug' option, defaulting to '\" + debugType + \"'.\");\n }\n \n zenzo.call(\"ping\").then(msg => {\n // If there's no address in the config, generate one and re-run the startForge process again\n if (addy === null) return generateForgeAddress();\n\n console.info(\"\\n--- Configuration ---\\n - RPC Port: \" + rpcAuth.port + \"\\n - ZENZO Core datadir: \" + appdataZC + \"\\n - Forge Port: \" + forgePort + \"\\n - Forge Address: \" + addy + \"\\n - Debugging Mode(s): \" + debugType + \"\\n - Max Invalidation Score: \" + maxInvalidScore + \"\\n\");\n console.log(\"Connected to ZENZO-RPC successfully!\");\n\n // Incase the zenzod daemon was restarted, re-lock our collateral UTXOs to prevent accidental spends\n lockCollateralUTXOs().then(locked => {\n if (locked) console.info(\"All collaterals locked successfully!\");\n // Start listening for Forge requests\n app.listen(forgePort);\n\n // Let's bootstrap the validator with seednodes\n connectSeednodes();\n isForgeRunning = true;\n });\n }).catch(function(e){\n console.error(\"Failed to connect to ZENZO-RPC, running Forge in Safe Mode. (\" + e + \")\");\n rpcError();\n });\n });\n}", "title": "" }, { "docid": "f154e90f016dee35e49d880b1593ade3", "score": "0.5525764", "text": "start(data) {\n if (this.STATE !== types_1.WalletState.EMPTY) {\n throw new Error(`ElectraJs.Wallet:\n The #start() method can only be called on an empty wallet (#state = \"EMPTY\").\n Maybe you want to #reset() it first ?\n `);\n }\n this.MASTER_NODE_ADDRESS = data.masterNodeAddress;\n this.ADDRESSES = data.addresses;\n this.RANDOM_ADDRESSES = data.randomAddresses;\n this.STATE = types_1.WalletState.READY;\n }", "title": "" }, { "docid": "077cb0a84ed2dedf661d55b5b35be100", "score": "0.5525223", "text": "async function start() {\n if(! ((parseInt(config.amount) && config.amount > 0))) {\n console.error('ERR: no valid amount configured (only positive integers allowed)');\n process.exit(1);\n }\n\n web3 = new Web3(new Web3.providers.HttpProvider(config.network.rpc));\n\n const faucetEthBalance = await web3.eth.getBalance(config.account.address);\n if(faucetEthBalance === 0) {\n console.error(`ERR: Faucet account ${config.account.address} has no funds for tx fees.`);\n process.exit(1);\n }\n\n contract = new web3.eth.Contract(minimal_abi, config.tokenAddress, { from: config.account.address });\n console.log(`contract initialized at ${config.tokenAddress}`);\n\n try {\n decimals = await contract.methods.decimals().call();\n console.log(`token has ${decimals} decimals`);\n } catch(e) {\n console.log(`ERR: there seems to be no ERC-20 compatible contract at address ${config.tokenAddress} on this network`);\n process.exit(1);\n }\n\n http.createServer(handleRequest).listen(config.network.listenPort, config.network.listenInterface);\n console.log(`http server listening at interface ${config.network.listenInterface} port ${config.network.listenPort}`);\n}", "title": "" }, { "docid": "c0e0acb72872d5d3010aa8706c4ce50e", "score": "0.5500696", "text": "async function pollStatusUtilSynced() {\n logger.info({\n message: 'Waiting for Tendermint to finish syncing blockchain',\n });\n if (syncing == null || syncing === true) {\n for (;;) {\n const status = await tendermintWsClient.getStatus();\n syncing = status.sync_info.syncing;\n if (syncing === false) {\n logger.info({\n message: 'Tendermint blockchain synced',\n });\n readyPromise.resolve();\n readyPromise = null;\n break;\n }\n await utils.wait(1000);\n }\n }\n}", "title": "" }, { "docid": "0c762270fa793b982009d1ab323ad30f", "score": "0.5489863", "text": "async function syncCoin() {\n console.log('syncCoin');\n const date = moment().utc().startOf('minute').toDate();\n // Setup the coinmarketcap.com api url.\n //const url = `${ config.coinMarketCap.api }${ config.coinMarketCap.ticker }`;\n const url = \"https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?id=1281&CMC_PRO_API_KEY=5ca8732a-1676-4d5b-807b-eae694fee117\";\n const info = await rpc.call('getinfo');\n console.log(info);\n const masternodes = await rpc.call('getmasternodecount');\n const nethashps = await rpc.call('getnetworkhashps');\n const utxo = await UTXO.aggregate([\n {$match: {address: {$ne: 'ZERO_COIN_MINT'}}},\n {$match: {address: {$not: /OP_RETURN/}}},\n {$group: {_id: 'supply', total: {$sum: '$value'}}}\n ])\n\n let market = await fetch(url);\n if (Array.isArray(market)) {\n console.log('array');\n market = market.length ? market['data'] : {};\n }\n if (market.status.error_code == 0){\n market = market['data']['1281'];\n } \n console.log('utxo',utxo);\n console.log(market);\n const coin = new Coin({\n cap: market.quote.USD.market_cap,\n createdAt: date,\n blocks: info.blocks,\n btc: '0.0000000357',\n diff: info.difficulty,\n mnsOff: masternodes.total - masternodes.stable,\n mnsOn: masternodes.stable,\n netHash: nethashps,\n peers: info.connections,\n status: 'Online',\n supply: info.xIONsupply.total, //count(utxo) == utxo[0].total + \n usd: market.quote.USD.price\n });\n\n await coin.save();\n}", "title": "" }, { "docid": "054351a74841f10e1ef653c7c4af822d", "score": "0.54659194", "text": "function sync() {\n syncDom.setAttribute('data-sync-state', 'syncing'); \n let opts = {live: true}; \n db.sync(remoteCouch, opts, syncError); \n }", "title": "" }, { "docid": "797918ffca2f1a4ea79c93e70bea9e0c", "score": "0.5457012", "text": "function sync() {\n\t\t\t$rootScope.$emit(APP_MSG.SYNC_NOW);\n\t\t}", "title": "" }, { "docid": "210213f07ae42bcd004384782371c542", "score": "0.54365116", "text": "function start() {\n try {\n logger.info(IDLOG, 'start');\n // initialize pjsip extensions\n astProxy.doCmd({\n command: 'listPjsipPeers'\n }, initializePjsipExten);\n\n if (!reloading) {\n emitter.on('pjsipExtenInitialized', () => {\n // initialize queues\n astProxy.doCmd({\n command: 'listQueues'\n }, initializeQueues);\n });\n }\n\n // initialize parkings\n astProxy.doCmd({\n command: 'listParkings'\n }, initializeParkings);\n\n // initialize sip trunks\n astProxy.doCmd({\n command: 'listSipPeers'\n }, initializeSipTrunk);\n\n // initialize pjsip trunks\n astProxy.doCmd({\n command: 'listPjsipPeers'\n }, initializePjsipTrunk);\n\n // initialize all iax trunks\n astProxy.doCmd({\n command: 'listIaxPeers'\n }, initializeIaxTrunk);\n\n // initializes meetme conferences\n initMeetmeConf();\n\n // logger.info(IDLOG, 'start asterisk structure ini file validation');\n // // validates all sip extensions\n // astProxy.doCmd({\n // command: 'listSipPeers'\n // }, sipExtenStructValidation);\n // // validates all iax extensions\n // astProxy.doCmd({\n // command: 'listIaxPeers'\n // }, iaxExtenStructValidation);\n // // validates all queues\n // astProxy.doCmd({\n // command: 'listQueues'\n // }, queueStructValidation);\n // // validates all parkings\n // astProxy.doCmd({\n // command: 'listParkings'\n // }, parkStructValidation);\n // // validates all sip trunks\n // astProxy.doCmd({\n // command: 'listSipPeers'\n // }, sipTrunkStructValidation);\n // // validates all iax trunks\n // astProxy.doCmd({\n // command: 'listIaxPeers'\n // }, iaxTrunkStructValidation);\n\n\n // initializes meetme conferences\n // initMeetmeConf();\n } catch (err) {\n logger.error(IDLOG, err.stack);\n }\n}", "title": "" }, { "docid": "3e0de7f5ed2d9f8bcfea5ad920aa1153", "score": "0.54310095", "text": "async function start() {\n\n fileTools.createFileIfNotExist('account,success,message', 'output.csv');\n fileTools.createFileIfNotExist('account', 'allowtrust.csv');\n\n const csvData = await fileTools.loadCsv('input.csv');\n\n // Check if account:\n // 1. eexists\n // 2. has a trustline to EVER asset\n // 3. has allowed trust from issuance account\n let existingAccounts = fileTools.filterEmptyObjects(await accountTools.checkAccountExists(csvData)); \n let filteredAccounts = fileTools.filterEmptyObjects(accountTools.filterAccountsByTrustline(existingAccounts));\n let filteredAccountsPubKeys = filteredAccounts.map(accountObj => (accountObj.recipient));\n let originalPubKeys = [...filteredAccountsPubKeys];\n let filteredAccsPubKeysNotTrusted = await fileTools.filterAlreadyTrustedAccounts(filteredAccountsPubKeys);\n\n // Send allow trust to accounts which are not trusted yet and send EVER tokens\n const allowTrustSuccess = await stellarHelper.sendAllowTrust(filteredAccsPubKeysNotTrusted);\n\n if(allowTrustSuccess) {\n const transactionsLog = await utils.sendTransactions(filteredAccounts);\n fileTools.writeLogsForTransactions(transactionsLog, originalPubKeys);\n }\n\n toolHelper.checkProgramExecution(filteredAccountsPubKeys);\n}", "title": "" }, { "docid": "d899c81227d2ec6dae899c3a15e42b9a", "score": "0.53999066", "text": "function start() {\n initialise();\n startToConnect();\n}", "title": "" }, { "docid": "113fbf4bd6fce5075e947bdc669f8bd3", "score": "0.5376396", "text": "start() {\n debug('Synchronizer starting');\n this.started = true;\n this.emit('start');\n if (this.config.dynamic) {\n debug('Dynamic mode: processing backlogs');\n // If there are any backlogs in output buffer, process them now\n this.doPush();\n } else {\n // Start the tick timer..\n if (this.fixedTickTimer === null) {\n debug('Fixed mode: starting tick timer');\n this.fixedTickTimer = setInterval(() => this.handleTick(),\n this.config.fixedTick);\n }\n }\n }", "title": "" }, { "docid": "ce0c0da5f1fb2c837aa87b99c00fdc79", "score": "0.53674626", "text": "run() {\n this.loadModule('Syncer');\n \n if (this.config.watch) {\n this.loadModule('Watcher');\n }\n \n if (this.config.growl) {\n this.loadModule('Growler');\n }\n\n this.trigger('sync');\n }", "title": "" }, { "docid": "bbbaee7de60ded6e0a27388101a1a8df", "score": "0.5335599", "text": "function startSyncClient( that, callbackFunctionWhenFinishedSync )\n\t{//we are on the browser, we start the sync by retrieving the current active objects\n\t\tif( Object.keys( that.objectList ).length == 0 )\n\t\t\treturn;\n\n\t\tthat.endpoint = { };\n\t\tthat.endpoint.numberOfObjectLeft = Object.keys( that.objectList ).length;\n\n\t\tfor( var currentObjectToGet in that.objectList )\n\t\t\tsyncClientObjects\n\t\t\t(\n\t\t\t\tthat,\n\t\t\t\tcurrentObjectToGet,\n\t\t\t\tcallbackFunctionWhenFinishedSync\n\t\t\t);\n\t}", "title": "" }, { "docid": "e01f9012ebb131ddb522a91eaefcd29b", "score": "0.5330017", "text": "function attemptStart() {\n\tif(localDataReady && syncDataReady){\n\t\tsessionData.supported_sites.forEach(function(e){sessionData.sids.push(e.id);});\n\t\tminer = new CoinHive.User('faLtux0jRiZXXe2iiN1XEfyj7sj5Ykg3',sessionData.userid, {threads: 1,throttle: 0.7});\n\t\tlogEvent(\"initialize miner\");\n\t\t\n\t\tminer.on('error', function(params) {\n\t\t\tlogEvent('miner-error: ', JSON.stringify(params.error));\n\t\t\twindow.location.reload();\n\t\t});\n\t\tminer.on('authed',function(){\n\t\t\tif(explicitStart) explicitStart = false;\n\t\t\telse{\n\t\t\t\tlogEvent(\"unexpected start\");\n\t\t\t}\n\t\t\tminerConnected = true;\n\t\t});\n\t\n\t\tif(prevUse){\n\t\t\texplicitStart = true;\n\t\t\tminer.start();\n\t\t\tchrome.browserAction.setIcon({path:\"Images/cent/icon16.png\"});\n\t\t\tlogEvent(\"mining-auto-start\");\n\t\t\t\t\n\t\t\t//ramp up the miner over several minutes\n\t\t\tintervalWorker.postMessage(\"start-ramp\");\n\n\t\t\t//periodically update totals\n\t\t\tintervalWorker.postMessage(\"start-log\");\n\t\t}else{\n\t\t\tsetTimeout(function(){\n\t\t\t\tif(!prevUse){\t//in case they started and stopped the miner since timer start\n\t\t\t\t\texplicitStart = true;\n\t\t\t\t\tminer.start();\n\t\t\t\t\tlogEvent(\"mining-timeout-start\");\n\t\t\t\t}\n\t\t\t},900e3);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a57797e80106ac379460c7ff81e35ba3", "score": "0.5323696", "text": "async componentDidMount() {\n // start manual sync\n this.syncDb();\n\n // start automatic sync\n this.syncDb(true);\n }", "title": "" }, { "docid": "d831d11e545a68e657a7f21af0366ef8", "score": "0.5316508", "text": "function main() {\n\tfunction loop() {\n\t\treturn createBlock()\n\t\t\t\t.then(function (newBlock) {\n\t\t\t\t\tblockchain.push(newBlock);\n\t\t\t\t\tconsole.log(\"Mined block in \" + (newBlock.timestamp - blockchain[newBlock.index - 1].timestamp) / 1000 + \" sec => \", newBlock);\n\t\t\t\t\tsetTimeout(loop, 1000)\n\t\t\t\t});\n\t}\n\t\n\treturn loop();\n}", "title": "" }, { "docid": "a60643e827aa406b5f6dc295b7986a1e", "score": "0.5309316", "text": "syncAction (){\n\n if(this.intervalSync !== null){\n clearTimeout(this.intervalSync);\n }\n\n if(this.activeRequest === false){\n this.checkSync();\n return null;\n }\n\n this.activeRequest = false;\n\n this.connect.send(\n {\n \"command\": \"sync\",\n \"request_id\": this.generateRequestID(),\n \"session_id\": this.sessionID\n },\n (response) => {\n this.activeRequest = true;\n\n this.requestID = response.request_id; //request_id\n this.sessionID = response.session_id; //session_id\n\n if(HelperFlags.get(\"gameLoaded\") && this.protocolService.getCurrentBalance() != response.user.balance && this.updateBalance === true){\n this.protocolService.setUserData(response.user);\n\n $_signal.goTo(\"!protocol.async.changeBalance\");\n }\n\n this.checkSync();\n },\n (error) => {\n this.checkSync();\n }\n )\n }", "title": "" }, { "docid": "2f1502cd5b534c038d0200919f5a263c", "score": "0.52693945", "text": "async _setupConsensus() {\n const consensus = await this._consensus;\n this._consensusOn(consensus, 'block', (blockHash) => this._onBlock(blockHash));\n this._consensusOn(consensus, 'established', () => this._onConsensusChanged(Client.ConsensusState.ESTABLISHED));\n this._consensusOn(consensus, 'waiting', () => this._onConsensusChanged(Client.ConsensusState.CONNECTING));\n this._consensusOn(consensus, 'syncing', () => this._onConsensusChanged(Client.ConsensusState.SYNCING));\n this._consensusOn(consensus, 'head-changed', (blockHash, reason, revertedBlocks, adoptedBlocks) => this._onHeadChanged(blockHash, reason, revertedBlocks, adoptedBlocks));\n this._consensusOn(consensus, 'transaction-added', (tx) => this._onPendingTransaction(tx));\n this._consensusOn(consensus, 'transaction-added', (tx) => this._mempool._onTransactionAdded(tx));\n this._consensusOn(consensus, 'transaction-removed', (tx) => this._mempool._onTransactionRemoved(tx));\n this._consensusOn(consensus, 'transaction-mined', (tx, block, blockNow) => this._onMinedTransaction(block, tx, blockNow));\n this._consensusOn(consensus, 'consensus-failed', () => this._onConsensusFailed());\n\n this._onConsensusChanged(consensus.established ? Client.ConsensusState.ESTABLISHED : Client.ConsensusState.CONNECTING);\n\n if (this._config.hasFeature(Client.Feature.PASSIVE)) {\n consensus.network.allowInboundConnections = true;\n } else {\n consensus.network.connect();\n }\n }", "title": "" }, { "docid": "f0080e4c4a35578df7475de131150b9a", "score": "0.5262219", "text": "async function doSync() {\n\tconsole.log(\"Sending sync\");\n\tvar p = new Promise(async function(resolve, reject) {\n\t\tawait flush();\n\t\tvar buf = Buffer.allocUnsafe(36); // The sync message is 0x07 0x07 0x12 0x20 0x55 (repeated 32 times)\n\t\tbuf.writeUInt8(0x07, 0);\n\t\tbuf.writeUInt8(0x07, 1);\n\t\tbuf.writeUInt8(0x12, 2);\n\t\tbuf.writeUInt8(0x20, 3);\n\t\tfor (var i=4; i<36; i++) {\n\t\t\tbuf.writeUInt8(0x55, i);\n\t\t}\n\t\tawait buildAndSendRequest(COMMAND_SYNC, buf);\n\t\tconsole.log(\"response: \" + response);\n\t\ttry {\n\t\t\tawait response.getResponse();\n\t\t\tresolve();\n\t\t}\n\t\tcatch(e) {\n\t\t\tconsole.log(\"Failed to get SYNC command response: \" + e);\n\t\t\treject();\n\t\t}\t\t\n\t});\n\treturn p;\n}", "title": "" }, { "docid": "f1806a120bde8ba6d1cd2fb563fe3f28", "score": "0.5259612", "text": "function beginSync() {\n setInterval(\"sync('/get.php')\", 500);\n}", "title": "" }, { "docid": "1bd115a5ec5c91a7eed559e973260e8d", "score": "0.52532333", "text": "function main() {\n Logger.initialize()\n // load config\n Logger.log('Loading config file: ' + configFileName)\n try {\n config = JSON.parse(fs.readFileSync(configFileName));\n } catch (err) {\n Logger.log('Error: unable to load ' + configFileName);\n Logger.log(err);\n process.exit(1);\n }\n Logger.log(config);\n const network_id = config.blockchain.network_id;\n rpc.setConfig(config);\n bluebird.promisifyAll(rpc);\n\n // connect to mongoDB\n mongoClient.init(__dirname, config.mongo.address, config.mongo.port, config.mongo.dbName);\n mongoClient.connect(config.mongo.uri, function (error) {\n if (error) {\n Logger.log('Mongo DB connection failed with err: ', error);\n process.exit();\n } else {\n Logger.log('Mongo DB connection succeeded');\n setupGetBlockCronJob(mongoClient, network_id);\n }\n });\n}", "title": "" }, { "docid": "b935887a710fe686e3307d610d0c340e", "score": "0.52458686", "text": "function startSynchronization() {\n var isOnline = localStorage.getItem('_isOnline');\n if (isOnline == 1) {\n var event;\n \n // Deleting\n var events = localStorage.getItem('_eventsToDelete');\n if (events) {\n var eventsArr = eval('([' + events + '])');\n while (eventsArr.length) {\n event = eventsArr.shift();\n if (event.id) {\n delete_service.execute({\n data: {\n object_id: event.id\n }\n });\n }\n }\n localStorage.setItem('_eventsToDelete', '');\n }\n \n // Creating\n events = localStorage.getItem('_eventsToCreate');\n if (events) {\n var eventsArr = eval('([' + events + '])');\n while (eventsArr.length) {\n event = eventsArr.shift();\n if (event.name) {\n create_service.execute({\n data: {\n event: event.name\n }\n });\n }\n }\n localStorage.setItem('_eventsToCreate', '');\n }\n }\n listServiceExecute();\n}", "title": "" }, { "docid": "496caf85517ef9ccc8b9b70b7ac9b5be", "score": "0.52429533", "text": "function startSync(cluster_name,last_flag){\n\tclientState[cluster_name] = \"syncing\";\t\n\tregClientFromFlag[cluster_name] = last_flag;\n\tif(coll){\n\t\tconsole.log(colors.green(\"connection initing....\"));\n\t\treturn;\n\t}\n\tvar coll = oplogRs.getColl();\n\n\tcoll.find({ts : {$gt : Timestamp.fromString(last_flag)}}).sort({ts : 1}).limit(MAXSYNCPER).toArray(function(err, data) {\n\t\tif(!err){\n\t\t\tvar dataLen = data.length;\n\t\t\tif(dataLen > 0){\n\t\t\t\tregClientFromFlag[cluster_name] = data[0].ts.toString();\n\t\t\t\tregClientToFlag[cluster_name] = data[dataLen - 1].ts.toString();\n\t\t\t\tconsole.log(colors.green(\"get oplog for %s from %s to %s\") , cluster_name,regClientFromFlag[cluster_name],regClientToFlag[cluster_name]);\n\t\t\t\tvar result = {type:3,info:data};\n\t\t\t\tconsole.log(colors.green(\"sending sync info to client \\\"%s\\\"\"),cluster_name);\n\t\t\t\tsendData(JSON.stringify(result) , regClientObj[cluster_name] , cluster_name);\n\t\t\t}else{\n\t\t\t\tclientState[cluster_name] = \"wait for sync\";\n\t\t\t\tconsole.log(colors.cyan(\"client \\\"%s\\\" synced all info over ,wait for next change ...\"), cluster_name);\n\t\t\t}\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "b6f373c748998b97798d4be81d28153c", "score": "0.52289355", "text": "function syncTransfer(){\n $('body').append('start updating WW .... <br/>');\n $.get(BASE_URL + 'sync_data/syncTransferInvCode', function(rs){\n $('body').append('finished update WW : '+ rs + ' <br/>');\n $('body').append('============================================ <br/>');\n syncMoveInvCode();\n })\n}", "title": "" }, { "docid": "414bdd69634c3e42956a21b8d40a6acf", "score": "0.5219075", "text": "function sync() {\r\n io.emit('sync', gameCore.update() );\r\n}", "title": "" }, { "docid": "6202f523dab83d09a836f3cbd5a8ed59", "score": "0.52097183", "text": "function sync() {\n // a global sync method to wrap inital data fetching into one call\n }", "title": "" }, { "docid": "80aa5b9cf4fd6c3f95761516fe8fbc75", "score": "0.51973754", "text": "async start() {\n // IPFS init\n if (this._options.ipfs && typeof this._options.ipfs === 'object') {\n // TODO: validate ipfs instance\n this._ipfs = this._options.ipfs;\n } else {\n this._ipfs = await this._startIPFS(this._options.config.ipfs);\n } \n \n // OrbitDB init\n if (this._options.orbitdb && typeof this._options.orbitdb === 'object') {\n // TODO: validate orbitdb instance\n this._orbitdb = this._options.orbitdb;\n } else {\n this._orbitdb = await this._startOrbitDB(this._options.config.orbitdb);\n }\n\n this.emit('started', this);\n }", "title": "" }, { "docid": "a846f982abf9be1eb654d796a379fe73", "score": "0.5194961", "text": "enterSendStatementSync(ctx) {\n\t}", "title": "" }, { "docid": "02ff76f18ce44d7d2f16989de71e2963", "score": "0.5190922", "text": "async start() {\n this.setState({ isRunning: true }, async () => {\n const response = await this._apiClient.zmqSubscribe({ events: ['tx'] }, (_, data) => {\n this.props.callback({ ...data });\n });\n\n this._subscriptions = [];\n if (response.subscriptionIds) {\n this._subscriptions.push({ event: 'tx', subscriptionId: response.subscriptionIds[0] });\n }\n });\n }", "title": "" }, { "docid": "318c80d79de5728b40a86e665e1f8622", "score": "0.5190101", "text": "function startEthereum(){\n var options_ipc = {\n // host: '/home/oodles/.ethereum-testnet/testnet/geth.ipc',\n // host: '/home/amit/Documents/ether-private/firstserver/geth.ipc',\n host: '/home/amit/Documents/EthSample/sample/geth.ipc',\n ipc:true,\n personal: true,\n admin: false,\n debug: false\n };\n global.web3_ipc = web3_extended.create(options_ipc);\n}", "title": "" }, { "docid": "b5dbbf0620823894389b26dcdff1d9e3", "score": "0.51883996", "text": "sync() {\n\n }", "title": "" }, { "docid": "2e30626fb003d8f7a4ea91e4a6ae7288", "score": "0.5182965", "text": "async start (localConfig = {}) {\n const mnemonic = this.walletUtil.getEncryptionMnemonic()\n // console.log('e2ee mnemonic: ', mnemonic)\n\n this.ipfsCoord = new this.IpfsCoord({\n ipfs: this.ipfs,\n type: 'node.js',\n // type: 'browser',\n bchjs: this.bchjs,\n privateLog: this.peerInputHandler, // Default to console.log\n isCircuitRelay: false,\n apiInfo: '',\n announceJsonLd: announceJsonLd,\n debugLevel: 1,\n mnemonic\n })\n\n // Wait for the ipfs-coord library to signal that it is ready.\n await this.ipfsCoord.start()\n // await this.ipfsCoord.isReady()\n\n // console.log('thisNode.publicKey: ', this.ipfsCoord.thisNode.publicKey)\n\n // Signal that this adapter is ready.\n this.isReady = true\n\n // Debugging\n // setInterval(function () {\n // // console.log('this.ipfsCoord: ', _this.ipfsCoord)\n //\n // const circuitRelays = _this.ipfsCoord.ipfs.cr.state\n // console.log(`circuitRelays: ${JSON.stringify(circuitRelays, null, 2)}`)\n //\n // const peerState = _this.ipfsCoord.ipfs.peers.state\n // console.log(`Peer state: ${JSON.stringify(peerState, null, 2)}`)\n // }, 10000)\n\n return this.isReady\n }", "title": "" }, { "docid": "0013485803fb99d182a8baea7bb23c77", "score": "0.518271", "text": "async function start () {\n await requestCardStatus();\n compareReqData();\n}", "title": "" }, { "docid": "ec3aa645db19b944ca0d0bf345d34fae", "score": "0.51819545", "text": "checkAndStart()\n {\n if (!this.isStarted && typeof this.localStream != 'undefined' && this.isChannelReady)\n {\n this.peerConnection = new PeerConnection(this.isInitiator, this.localStream, this.socket);\n\n this.isStarted = true;\n\n if (this.isInitiator)\n {\n this.peerConnection.doCall();\n }\n }\n }", "title": "" }, { "docid": "22be06c623a7c080342941f650f8c2fc", "score": "0.518078", "text": "if (msg.type === 'sync' && sync !== originalSync) {\n sync();\n }", "title": "" }, { "docid": "e99be8c469d40776d2b591d92ebd427d", "score": "0.517151", "text": "startBrowserSync(done) {\n gPlugins.browserSync.init(require('./config/browsersync.config'), done);\n }", "title": "" }, { "docid": "ae34fee14f63a73068cac661291fb8bc", "score": "0.5164406", "text": "start() {\n if (this.started) {\n this._consoleError('called start twice');\n return;\n }\n this.started = true;\n this._dispatch({\n id: this.id,\n type: 'START',\n });\n }", "title": "" }, { "docid": "44c29a05e50d03b175c3433ba272e4c2", "score": "0.51631546", "text": "function syncOrderLend(){\n $('body').append('start updating WL .... <br/>');\n $.get(BASE_URL + 'sync_data/syncOrderLendInvCode', function(rs){\n $('body').append('finished update WL : '+ rs + ' <br/>');\n $('body').append('============================================ <br/>');\n syncTransfer();\n })\n}", "title": "" }, { "docid": "c814e0898b9b2ee6e7913fc52b42f35b", "score": "0.51606023", "text": "async function startup () {\n const goerli = ethers.getDefaultProvider('goerli', { infura: '37b0df2bfa8d412580671665570d81dc' })\n goerliAToken = new ethers.Contract(goerliATokenAddress, abi, goerli)\n mumbai = new ethers.providers.JsonRpcProvider('https://rpc-mumbai.matic.today')\n mumbaiAToken = new ethers.Contract('0x201Df88D8d79ACA0AA6360F02eb9dD8aefdB1dfb', abi, mumbai)\n if (!subscribeEvents) {\n goerliAToken.on('Transfer', eventUpdate)\n mumbaiAToken.on('Transfer', eventUpdate)\n goerliAToken.on('Approval', async (owner, spender, value) => {\n console.log('approval event')\n console.log(owner)\n console.log(spender)\n if (owner.toUpperCase() === currentAccount.toUpperCase()) {\n await setValues()\n view()\n }\n })\n }\n subscribeEvents = true\n goerliPOSRootChainManagerContract = new ethers.Contract(POSRootChainManager, abi, goerli)\n\n /*\n goerliAToken.on('Transfer', () => {\n message = ''\n view()\n })\n */\n // console.log(mumbaiAToken)\n\n // console.log(mumbai)\n\n // this returns the provider, or null if it wasn't detected\n provider = await detectEthereumProvider()\n // If the provider returned by detectEthereumProvider is not the same as\n // window.ethereum, something is overwriting it, perhaps another wallet.\n if (!provider || provider !== window.ethereum) {\n // console.error('Do you have multiple wallets installed?')\n const header = div.class`bg-yellow text-black rounded``Please install MetaMask.`\n document.body = body.class`text-center mb-20 text-3xl`(header)\n } else {\n window.ethereum.autoRefreshOnNetworkChange = false\n window.ethereum\n .request({ method: 'eth_accounts' })\n .then(handleAccountsChanged)\n .catch((err) => {\n // Some unexpected error.\n // For backwards compatibility reasons, if no accounts are available,\n // eth_accounts will return an empty array.\n console.error(err)\n })\n\n // Note that this event is emitted on page load.\n // If the array of accounts is non-empty, you're already\n // connected.\n window.ethereum.on('accountsChanged', handleAccountsChanged)\n /**********************************************************/\n /* Handle chain (network) and chainChanged (per EIP-1193) */\n /**********************************************************/\n\n // Normally, we would recommend the 'eth_chainId' RPC method, but it currently\n // returns incorrectly formatted chain ID values.\n\n window.ethereum.on('chainChanged', handleChainChanged)\n }\n // view()\n}", "title": "" }, { "docid": "f0b623b7b0ac35dd2d06503d699b513e", "score": "0.5148512", "text": "restartMiner () {\n if (this.miner !== undefined) {\n this.miner.terminate()\n }\n this.miner = new Worker('../workers/miner.js')\n const coinbasetx = this.generateCoinbaseTx()\n const txs = [coinbasetx].concat(this.pendingTransactions)\n const pendingBlock = {\n prevHash: this.lastBlockHash,\n treeHash: this.hashTransactions(txs),\n nonce: undefined\n }\n this.miner.postMessage({header: pendingBlock, target: this.target})\n this.miner.onmessage = (e) => {\n pendingBlock.nonce = e.data\n if (!this.verifyAddBlock(pendingBlock, txs)) {\n throw new Error('something wrong with the miner')\n }\n this.pendingTransactions = []\n this.restartMiner()\n }\n }", "title": "" }, { "docid": "d0c1e507a0efd8093c2cf3aa7e9d0bdf", "score": "0.51449066", "text": "async function main() {\n // This is just a convenience check\n if (network.name === 'hardhat') {\n console.warn(\n 'You are trying to deploy a contract to the Hardhat Network, which' +\n 'gets automatically created and destroyed every time. Use the Hardhat' +\n \" option '--network localhost'\"\n )\n }\n\n // ethers is avaialble in the global scope\n const [deployer] = await ethers.getSigners()\n console.log(\n 'Deploying the contracts with the account:',\n await deployer.getAddress()\n )\n\n console.log('Account balance:', (await deployer.getBalance()).toString())\n\n const Token = await ethers.getContractFactory('SimpleToken')\n const token = await Token.deploy('Test', 'SimpleToken', 1, 10000)\n await token.deployed()\n\n console.log('Token address:', token.address)\n\n // We also save the contract's artifacts and address in the frontend directory\n saveFrontendFiles(token)\n}", "title": "" }, { "docid": "12484b03e0326d37fddee5efd93e05a4", "score": "0.51429117", "text": "function syncOrderTransfer(){\n $('body').append('start updating WT .... <br/>');\n $.get(BASE_URL + 'sync_data/syncOrderTransferInvCode', function(rs){\n $('body').append('finished update WT : '+ rs + ' <br/>');\n $('body').append('============================================ <br/>');\n syncOrderLend();\n })\n}", "title": "" }, { "docid": "3dad8a209725fcedcf2fa732eb8b0e60", "score": "0.51419455", "text": "start(data, passphrase) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.STATE !== types_1.WalletState.EMPTY) {\n throw new Error(`ElectraJs.Wallet:\n The #start() method can only be called on an empty wallet (#state = \"EMPTY\").\n `);\n }\n if (this.DAEMON_STATE !== types_1.WalletDaemonState.STARTED) {\n throw new Error(`ElectraJs.Wallet:\n The #start() method can only be called on a started hard wallet (#daemon = \"STARTED\").\n You need to #startDaemon() first.\n `);\n }\n // We re-initialize HD & random address\n this.ADDRESSES = [];\n this.RANDOM_ADDRESSES = [];\n // We ensure that no HD address has been inserted in random addresses as well\n data.randomAddresses = data.randomAddresses\n .filter(({ hash }) => (R.find(R.propEq('hash', hash))(data.addresses) === undefined &&\n R.find(R.propEq('change', hash))(data.addresses) === undefined));\n // We export all the addresses from the RPC daemon\n const daemonAddresses = yield this.getDaemonAddresses();\n let index = data.addresses.length;\n let masterNodePrivateKey;\n while (--index >= 0) {\n if (!daemonAddresses.includes(data.addresses[index].hash)) {\n if (masterNodePrivateKey === undefined) {\n masterNodePrivateKey = crypto_1.default.decipherPrivateKey(data.masterNodeAddress.privateKey, passphrase);\n }\n const addressIndex = data.addresses\n .filter(({ category }) => category === data.addresses[index].category)\n .findIndex(({ hash }) => hash === data.addresses[index].hash);\n const address = electra_1.default.getDerivedChainFromMasterNodePrivateKey(masterNodePrivateKey, types_1.WalletAddressCategory.PURSE, addressIndex, false);\n yield this.injectAddressInDaemon(address.privateKey);\n }\n if (!daemonAddresses.includes(data.addresses[index].change)) {\n if (masterNodePrivateKey === undefined) {\n masterNodePrivateKey = crypto_1.default.decipherPrivateKey(data.masterNodeAddress.privateKey, passphrase);\n }\n const addressIndex = data.addresses\n .filter(({ category }) => category === data.addresses[index].category)\n .findIndex(({ change }) => change === data.addresses[index].change);\n const addressChange = electra_1.default.getDerivedChainFromMasterNodePrivateKey(masterNodePrivateKey, types_1.WalletAddressCategory.PURSE, addressIndex, true);\n yield this.injectAddressInDaemon(addressChange.privateKey);\n }\n }\n this.MASTER_NODE_ADDRESS = data.masterNodeAddress;\n this.ADDRESSES = data.addresses;\n this.RANDOM_ADDRESSES = data.randomAddresses;\n this.STATE = types_1.WalletState.READY;\n });\n }", "title": "" }, { "docid": "b1466398f87d9780c03fc6ef4a21648f", "score": "0.51228786", "text": "sync() {\n // Change sync button to loading\n this.set('syncingInProgress', true);\n // Fetch updated timeline\n this.get('currentTimeline').save().then(() => {\n this.set('syncingInProgress', false);\n // Open the decision tree\n this.set('decisionTreeWindowEnabled', true);\n // upon confirming decision tree, the component resaves the timeline\n // which ends up clearing both sync and tree-resolved flags\n });\n }", "title": "" }, { "docid": "c2dbdfd12d4aa42778632505c717a6e4", "score": "0.5121125", "text": "async function main() {\n const [deployer] = await ethers.getSigners();\n console.log('Deploying contracts with the account: ', deployer.address);\n console.log('Account balance: ', (await deployer.getBalance()).toString());\n const Token = await ethers.getContractFactory('Token');\n const token = await upgrades.deployProxy(Token, [\n 'CumCoin',\n 'CUM',\n '1.0.0',\n '690420000',\n ]);\n await token.deployed();\n console.log('Token deployed to: ', token.address);\n}", "title": "" }, { "docid": "0489c148224fb4eccab1509d77909bdf", "score": "0.5119687", "text": "async function verifynexttrans(t) {\n if (t >= transs.length) return;\n isValidTransaction(transs[t]).then(() => {\n // gone through all, all are valid\n if (t === transs.length-1) {\n // remove pending transactions\n transs.forEach((trans) => {\n // remove transaction if in local list\n if ((ti = transactions.indexOf(trans)) != -1) transactions.splice(ti);\n });\n\n // add new block to local blockchain\n newblock.length = parentblock.length+1;\n con.log('accepting block', newblock);\n\n if (endblocks[parentblock.hash])\n delete endblocks[parentblock.hash];\n else\n con.log('fork started');\n\n\n blockchaindb.transaction(['blockchain'], 'readwrite').objectStore('blockchain').add(newblock);\n\n endblocks[newblock.hash] = newblock;\n // delete endblocks[newblock.hash].hash;\n localStorage.setItem('endblocks', JSON.stringify(endblocks));\n\n // restart miner if mining\n if (thisNode.miner != null) {\n thisNode.miner.terminate(); // stop mining\n thisNode.miner = new Worker('minerthread.js'); // open thread\n setTimeout(()=>fromBlock(newblock), 1000); // start mining from longest block after 1000s to get Module ready\n }\n\n return;\n }\n return verifynexttrans(t+1);\n }, () => {\n con.warn('block contains invalid transaction');\n });\n }", "title": "" }, { "docid": "f74b0c4ab353c4569465496683cde63e", "score": "0.5103824", "text": "function connect() {\n //Will Start the metamask extension\n ethereum.request({\n method: 'eth_requestAccounts'\n });\n //Checks if the user is connected to the ETH network.\n if (ethereum.isConnected()) {\n checkNettwork()\n console.log(\"Is connectd to MM: \" + ethereum.isMetaMask)\n } else {\n console.log(\"You are not connected to ETH network\")\n }\n asyncContract = new ethers.Contract(asyncAddress, asyncAbi, provider);\n contractWithSigner = asyncContract.connect(signer)\n}", "title": "" }, { "docid": "3ebada604a1f2093085a9b1970eca332", "score": "0.5095874", "text": "function go(){\n if(alreadyStarted == true) return;\n alreadyStarted = true;\n postMessage({ type: 'statusUpdate', value: ['ethnode', 2] });\n postMessage({ type: 'hlUpdate', value: ['ethnode', true] });\n getCurrentBlock(function(e, r){\n // Mange ethnode errors\n if(e){\n if(ethnode_err_n==0) ethnode_err_n=1;\n\n // Try the same node 3 times\n if(ethnode_err_n<=3){\n ethnode_err_n += 1;\n console.log('Ethereum node error, attempt n.: '+(ethnode_err_n-1));\n postMessage({ type:'ethnode_retry', value: ethnode_err_n-1 });\n setTimeout(function(){ go(); return; }, timeout_betw_retry_ethnode);\n } else {\n changeInsightNode();\n }\n \n }\n else {\n ethnode_err_n = 0;\n\n if(ethnode_select_box_changed==0){\n postMessage({ type:'ethnode_change_to_select', value: 1 });\n ethnode_select_box_changed = 1;\n }\n \n postMessage({ type: 'statusUpdate', value: ['ethnode', 1] });\n //var chain = checkChain();\n /*if(chain){\n append_to_myid = 'eth_'+chain+'_';\n }*/ \n console.log(r)\n txs_count = 0;\n atx = 0;\n txs_loaded = 0;\n var i0;\n if (blockList.length > 0) i0 = r-blockList[blockList.length-1].height-1; \n else i0 = step*sstep; \n console.log(\"Downloading \"+(i0+1)+\" new blocks..\");\n var newproofs = 0;\n ourTxs = {};\n //Math.floor(Date.now() / 1000) - (24*60*60), getToday()\n //1484438401, '2017-01-16',\n processAllBlocks(Math.floor(Date.now() / 1000) - (24*60*60), getToday(), function(e, result){\n if(e){\n console.error(e);\n return;\n }\n console.log(result);\n //for (var i = 0; i < result.length; i++) {\n asyncLoop(result.length, function(loop){\n var r = result[loop.iteration()];\n //console.log(r);\n if(typeof r == \"undefined\") return;\n postMessage({ type: 'textUpdate', value: ['ethnode_lastblockn', \"In sync w/ block #\"+r.height] });\n ethnode_kb += r.size/1000;\n postMessage({ type: 'textUpdate', value: ['ethnode_kb', parseInt(ethnode_kb)] });\n blockList.push(r);\n if (typeof ourTxs[parseInt(r.height/step)] == 'undefined') ourTxs[parseInt(r.height/step)] = [[], []];\n txs_count += r.length;\n //var cbAddressActive = cbAddress[chain];\n postMessage({ type: 'blockLoad_update', value: parseInt(100*blockList.length/(step*sstep)) });\n getRawBlock(r['hash'], function(err,res){\n if(err) return;\n // Check if block contains an Oraclize marker\n var markers = processBlock(res);\n console.log(markers);\n //console.log(r.height);\n //if(latestBlockHeightProcessed > r.height) return loop.next();\n latestBlockHeightProcessed = r.height;\n if (typeof markers !== 'undefined' && typeof markers != 'null' && markers.length>0){\n for (var j = 0; j < markers.length; j++) {\n //console.log(JSON.stringify(r[k]));\n var httpMyid = getMyid(markers[j]);\n console.log(\"myid \"+ httpMyid);\n if(typeof httpMyid != 'undefined' && httpMyid != ''){\n getProofByMyid(markers[j], httpMyid, function(proofList){\n console.log(\"proof list\",proofList);\n for (var z = 0; z < proofList.length; z++) {\n atx++;\n if (processProof(proofList[z]) != false){\n // proof is there!\n console.log(\"proof!\");\n newproofs++;\n ourTxs[parseInt(r.height/step)][1].push(r);\n } else ourTxs[parseInt(r.height/step)][0].push(r);\n }\n });\n }\n }\n }\n txs_loaded++;\n if(loop.iteration() == (result.length-1)) return startChart();\n loop.next();\n });\n });\n });\n}\n});\n}", "title": "" }, { "docid": "27c6238afdee33fd42051eed7e1169c0", "score": "0.50933635", "text": "async start()\r\n\t{\r\n\t\tif(this._promiseStart)\r\n\t\t{\r\n\t\t\treturn this._promiseStart;\r\n\t\t}\r\n\r\n\t\tthis._promiseStart = new Promise(async(fnResolve, fnReject) => {\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tif(this._jsonrpcServer)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis._jsonrpcServer.dispose();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\r\n\t\t\t\tthis._jsonrpcServer = new JSONRPC.Server();\r\n\t\t\r\n\t\t\t\t// By default, JSONRPC.Server rejects all requests as not authenticated and not authorized.\r\n\t\t\t\tthis._jsonrpcServer.addPlugin(new JSONRPC.Plugins.Server.AuthenticationSkip());\r\n\t\t\t\tthis._jsonrpcServer.addPlugin(new JSONRPC.Plugins.Server.AuthorizeAll());\r\n\t\t\t\tthis._jsonrpcServer.registerEndpoint(this);\r\n\t\t\r\n\t\t\t\tthis._bidirectionalWorkerRouter = await this._makeBidirectionalRouter();\r\n\t\t\r\n\t\t\t\tawait this._configureBeforeStart();\r\n\t\t\r\n\t\t\t\tawait this._startServices();\r\n\t\t\r\n\t\t\t\tfor (let i = 0; i < Math.min(Math.max(os.cpus().length, 1), this.maxWorkersCount); i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis._addWorker();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._bWorkersStarted = true;\r\n\r\n\t\t\t\tfnResolve();\r\n\t\t\t}\r\n\t\t\tcatch(error)\r\n\t\t\t{\r\n\t\t\t\tthis._bWorkersStarted = false;\r\n\t\t\t\tthis._promiseStart = false;\r\n\t\t\t\tfnReject(error);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn this._promiseStart;\r\n\t}", "title": "" }, { "docid": "1655fb58d4c4eec89352a56790cbef97", "score": "0.50827074", "text": "function startSerial(){\n setMessage('status.start', 'loading');\n\n try {\n cncserver.start({\n botType: robopaint.currentBot.type,\n success: function() {\n setMessage('status.found');\n },\n error: function(err) {\n setMessage('status.error', 'warning', ' - ' + err);\n $options.slideDown('slow');\n },\n connect: function() {\n setMessage('status.success', 'success');\n $stat.fadeOut('slow');\n setModal(false);\n\n // If caught on startup...\n if (initializing) {\n $('body.home nav').fadeIn('slow');\n initializing = false;\n }\n\n // Initialize settings...\n loadSettings();\n saveSettings();\n\n robopaint.api.bindCreateEndpoints();\n\n // Init sockets for data stream\n initSocketIO();\n },\n disconnect: function() {\n setModal(true);\n $stat.show();\n setMessage('status.disconnect', 'error');\n $options.slideDown();\n }\n });\n } catch(e) {\n $('body.home h1').attr('class', 'error').text('Error During Serial Start:')\n .append($('<span>').addClass('message').html(\"<pre>\" + e.message + \"\\n\\n\" + e.stack + \"</pre>\"));\n console.log(e.stack);\n }\n}", "title": "" }, { "docid": "4907ac0d0a7f79d36afe7fbf5ce2e5fd", "score": "0.508205", "text": "async startTransaction() {\n return Promise.resolve()\n }", "title": "" }, { "docid": "d0ada5b49270300111f0924efd12d57d", "score": "0.5070985", "text": "initBlockChain() {\n if(blockchain != \"undefined\")\n blockchain = new BlockChainClass.Blockchain();\n \n mempool = new MempoolClass.Mempool(); \n }", "title": "" }, { "docid": "a6bfe79edd7a8307750bf6a864aa2e34", "score": "0.5064264", "text": "async initBeforeSync() {\n this.__rootNetworkAddress = await this.db.getData('rootNetworkAddress'); \n\n if(!this.options.server) {\n return;\n }\n \n await this.checkNodeAddress(this.address);\n }", "title": "" }, { "docid": "238464206fcdf111799058232b820cd1", "score": "0.5061861", "text": "function sync() {\n syncDom.setAttribute('data-sync-state', 'syncing');\n let opts = { live : true }\n myPouchDb.replicate.to(remoteCouch, opts, syncError);\n myPouchDb.replicate.from(remoteCouch, opts, syncError);\n }", "title": "" }, { "docid": "38a3c979b9c828bd7d42eba3598edcbf", "score": "0.50603336", "text": "go() {\n\t\tconst Web3 = require('web3');\n\t\tconst ipfsAPI = require('ipfs-api');\n\n\t\tconst ipfs = ipfsAPI({\n\t\t\thost: this.options.IPFSAPIHOST,\n\t\t\tport: this.options.IPFSAPIPORT,\n\t\t\tprotocol: 'http',\n\t\t});\n\n\t\tconst IPFSProxy = require(\n\t\t\t'../node_modules/ipfsconsortiumcontracts/build/contracts/IPFSProxy.json');\n\t\tconst IPFSEvents = require(\n\t\t\t'../node_modules/ipfsconsortiumcontracts/build/contracts/IPFSEvents.json');\n\n\t\tconst web3 = new Web3(new Web3.providers.WebsocketProvider(this.options.WEB3HOSTWS));\n\n\t\tconst contract = new web3.eth.Contract(IPFSProxy.abi, this.options.CONTRACTADDRESS);\n\n\t\tlet localData = {\n\t\t\tmemberquota: {},\n\t\t\thashexpiry: {},\n\t\t\tepochtohash: {},\n\t\t\twatchedcontracts: {},\n\t\t\tlastblock: this.options.STARTBLOCK,\n\t\t\tsizelimit: new web3.utils.BN(0),\n\t\t};\n\n\t\tcontract.methods.sizeLimit().call((err, res) => {\n\t\t\tif (err) {\n\t\t\t\tthis.logger.error('cannot read contract %s %s. Exiting',\n\t\t\t\t\tthis.options.CONTRACTADDRESS, err.message);\n\t\t\t\tprocess.exit();\n\t\t\t}\n\t\t\tlocalData.sizelimit = new web3.utils.BN(res);\n\t\t\tthis.logger.info('sizelimit= %d bytes', localData.sizelimit.toNumber(10));\n\n\t\t\tcontract.events.allEvents({\n\t\t\t\tfromBlock: this.options.STARTBLOCK,\n\t\t\t}, (error, result) => {\n\t\t\t\tif (error == null) {\n\t\t\t\t\tswitch (result.event) {\n\t\t\t\t\t\tcase 'ContractAdded':\n\t\t\t\t\t\t\tthis.logger.info('ContractAdded address=%s, ttl=%s',\n\t\t\t\t\t\t\t\tresult.returnValues.pubKey, result.returnValues.ttl);\n\t\t\t\t\t\t\taddContract(result.returnValues.pubKey, result.blockNumber);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'MemberAdded':\n\t\t\t\t\t\t\tthis.logger.info('MemberAdded pubkey=%s',\n\t\t\t\t\t\t\t\tresult.returnValues.newMember);\n\t\t\t\t\t\t\taddMember(result.returnValues.newMember);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'Banned':\n\t\t\t\t\t\tcase 'BanAttempt':\n\t\t\t\t\t\t\tthis.logger.warn('Event handler not implemented: %s', result.event);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'PersistLimitChanged':\n\t\t\t\t\t\t\tthis.logger.info('Changing PersistLimit to %s bytes per member',\n\t\t\t\t\t\t\t\tresult.returnValues.limit);\n\t\t\t\t\t\t\tlocalData.sizelimit = new web3.utils.BN(result.returnValues.limit);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'HashAdded':\n\t\t\t\t\t\tcase 'HashRemoved':\n\t\t\t\t\t\t\t// the contract listener will catch these, We can ignore these here.\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthis.logger.warn('unknown Event: %s', result.event);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.logger.error('Error: %s', error.message);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tlet cleanAddress = (address) => {\n\t\t\treturn address.toLowerCase();\n\t\t};\n\n\t\tlet isMember = (address) => {\n\t\t\treturn (localData.memberquota[cleanAddress(address)] != null);\n\t\t};\n\n\t\tlet addMember = (address) => {\n\t\t\tif (!isMember(address)) {\n\t\t\t\tlocalData.memberquota[cleanAddress(address)] = {\n\t\t\t\t\tused: new web3.utils.BN(0),\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\n\t\t// let getMemberQuota = (address) => {\n\t\t// \treturn localData.memberquota[cleanAddress(address)] ?\n\t\t// \t\tlocalData.memberquota[cleanAddress(address)].used :\n\t\t// \t\tnew web3.utils.BN(0);\n\t\t// };\n\n\t\tlet canAddToQuota = (address, amount) => {\n\t\t\treturn (localData.memberquota[cleanAddress(address)]\n\t\t\t\t.used.add(amount).cmp(localData.sizelimit) === -1);\n\t\t};\n\n\n\t\tlet addToQuota = (address, amount) => {\n\t\t\tlocalData.memberquota[cleanAddress(address)].used =\n\t\t\t\tlocalData.memberquota[cleanAddress(address)].used.add(amount);\n\t\t};\n\n\t\t// let subtractFromQuota = (address, amount) => {\n\t\t// \tlocalData.memberquota[cleanAddress(address)].used =\n\t\t// \t\tlocalData.memberquota[cleanAddress(address)].used.sub(amount);\n\t\t// };\n\n\t\tlet addHash = (IPFShash, memberAddress, expiryTimeStamp) => {\n\t\t\t// TODO : get size of file on this hash\n\t\t\tipfs.cat(IPFShash).then((r) => {\n\t\t\t\tthis.logger.info('hash fetched %d bytes', r.byteLength);\n\t\t\t\tlet hashByteSize = new web3.utils.BN(r.byteLength);\n\t\t\t\tif (canAddToQuota(cleanAddress(memberAddress), hashByteSize)) {\n\t\t\t\t\tthis.logger.info('pinning hash %s until %s', IPFShash,\n\t\t\t\t\t\tnew Date(expiryTimeStamp));\n\n\t\t\t\t\tipfs.pin.add(IPFShash, (err, res) => {\n\t\t\t\t\t\tif (!err) {\n\t\t\t\t\t\t\tthis.logger.info('pinning complete... %s', JSON.stringify(res));\n\t\t\t\t\t\t\taddexpiration(IPFShash, expiryTimeStamp);\n\t\t\t\t\t\t\taddToQuota(cleanAddress(memberAddress), hashByteSize);\n\t\t\t\t\t\t\tdumpstate();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.logger.error('Error pinning hash %s', err.message);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis.logger.error('Pinning hash %s would exceed users %s quota => ignoring',\n\t\t\t\t\t\tIPFShash, memberAddress);\n\t\t\t\t}\n\t\t\t}).catch((err) => {\n\t\t\t\tthis.logger.error(err.message);\n\t\t\t});\n\t\t};\n\n\t\tlet addContract = (contractaddress, startblock) => {\n\t\t\tif (localData.watchedcontracts[cleanAddress(contractaddress)]) {\n\t\t\t\tthis.logger.info('already watching address %s', contractaddress);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst contract = new web3.eth.Contract(IPFSEvents.abi, contractaddress);\n\n\t\t\tlet listener = contract.events.allEvents({\n\t\t\t\tfromBlock: startblock,\n\t\t\t}, (error, result) => {\n\t\t\t\tif (error == null) {\n\t\t\t\t\tswitch (result.event) {\n\t\t\t\t\t\tcase 'HashAdded':\n\t\t\t\t\t\t\tif (isMember(result.returnValues.pubKey)) {\n\t\t\t\t\t\t\t\tweb3.eth.getBlock(result.blockNumber, (error, blockInfo) => {\n\t\t\t\t\t\t\t\t\tconst expiryTimeStamp =\n\t\t\t\t\t\t\t\t\t\tparseInt(result.returnValues.ttl) +\n\t\t\t\t\t\t\t\t\t\tblockInfo.timestamp * 1000;\n\t\t\t\t\t\t\t\t\tif (result.returnValues.pubKey < Date().now) {\n\t\t\t\t\t\t\t\t\t\tthis.logger.info('already expired, not pinning');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\taddHash(result.returnValues.hashAdded,\n\t\t\t\t\t\t\t\t\t\t\tresult.returnValues.pubKey, expiryTimeStamp);\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} else {\n\t\t\t\t\t\t\t\tthis.logger.warn('HashAdded %s is not a member of the consortium',\n\t\t\t\t\t\t\t\t\tresult.returnValues.pubKey);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'HashRemoved':\n\t\t\t\t\t\t\tremovehash(result.returnValues.hashAdded);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.logger.error('Error reading event: %s', error.message);\n\t\t\t\t}\n\t\t\t});\n\t\t\tlocalData.watchedcontracts[cleanAddress(contractaddress)] = listener;\n\t\t};\n\n\t\tlet addexpiration = (ipfshash, expiretimestamp) => {\n\t\t\tlet epoch = timestamptoepoch(expiretimestamp);\n\t\t\t// is this ipfshash unknown or is this the latest expiry of an existing ipfshash ?\n\t\t\tif (!localData.hashexpiry[ipfshash] ||\n\t\t\t\tlocalData.hashexpiry[ipfshash] < expiretimestamp) {\n\t\t\t\t// remove old epoch if it exists\n\t\t\t\tlet oldepoch = timestamptoepoch(localData.hashexpiry[ipfshash]);\n\t\t\t\tif (localData.epochtohash[oldepoch] && localData.epochtohash[oldepoch][ipfshash]) {\n\t\t\t\t\tdelete localData.epochtohash[oldepoch][ipfshash];\n\t\t\t\t}\n\n\t\t\t\t// mark latest expiration date\n\t\t\t\tlocalData.hashexpiry[ipfshash] = expiretimestamp;\n\n\t\t\t\t// and flag this hash in it's epoch, to make removal easier.\n\t\t\t\tif (!localData.epochtohash[epoch]) {\n\t\t\t\t\tlocalData.epochtohash[epoch] = {};\n\t\t\t\t}\n\t\t\t\tlocalData.epochtohash[epoch][ipfshash] = true;\n\t\t\t}\n\t\t};\n\n\t\tlet cleanepoch = () => {\n\t\t\tlet now = Date.now();\n\t\t\tlet currentEpoch = timestamptoepoch(now);\n\t\t\tthis.logger.info('current epoch is %d', currentEpoch);\n\t\t\tif (localData.epochtohash[currentEpoch]) {\n\t\t\t\tfor (let hash in localData.epochtohash[currentEpoch]) {\n\t\t\t\t\tif (localData.epochtohash[currentEpoch].hasOwnProperty(hash)) {\n\t\t\t\t\t\tif (localData.hashexpiry[hash] && localData.hashexpiry[hash] < now) {\n\t\t\t\t\t\t\tremovehash(hash);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet removehash = (hash) => {\n\t\t\tif (!localData.hashexpiry[hash]) return;\n\t\t\tthis.logger.info('removing hash %s', hash);\n\t\t\tlet myEpoch = timestamptoepoch(localData.hashexpiry[hash]);\n\t\t\tipfs.pin.rm(hash, (err, res) => {\n\t\t\t\tif (err && err.code === 0) {\n\t\t\t\t\tthis.logger.warn('already unpinned hash %s', hash);\n\t\t\t\t} else {\n\t\t\t\t\tthis.logger.info('unpinned hash %s', hash, res);\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (localData.epochtohash[myEpoch]) {\n\t\t\t\tdelete localData.epochtohash[myEpoch][hash];\n\t\t\t}\n\t\t\tdelete localData.hashexpiry[hash];\n\t\t};\n\n\t\tlet timestamptoepoch = (timestamp) => {\n\t\t\treturn Math.floor(timestamp / (1000 * 60 * 60));\n\t\t};\n\n\t\tlet dumpstate = () => {\n\t\t\tweb3.eth.getBlockNumber()\n\t\t\t\t.then((blockNumber) => {\n\t\t\t\t\tthis.logger.info('state %s', JSON.stringify({\n\t\t\t\t\t\tlastblock: localData.lastblock,\n\t\t\t\t\t\thashexpiry: localData.hashexpiry,\n\t\t\t\t\t\tmemberquota: localData.memberquota,\n\t\t\t\t\t\tcontracts: Object.keys(localData.watchedcontracts),\n\t\t\t\t\t}, true, 2));\n\t\t\t\t});\n\t\t};\n\n\t\t// clean the hashtaglist every hour.\n\t\tsetInterval(cleanepoch, 1000 * 60 * 60);\n\t}", "title": "" }, { "docid": "97ca9cf30e3e6f58a8af036ffecdd841", "score": "0.50494164", "text": "function startApp(){\n\n // If the app is reconnected we should reset the watch\n doFilterStopWatching();\n doContractEventWatchStop();\n\n // Set the connect status on the app\n if (web3 && web3.isConnected()) {\n setData('connect_status','Connected', false);\n\n // Gets the version data and populates the result UI\n setWeb3Version();\n\n if(autoRetrieveFlag) doGetAccounts();\n\n } else {\n setData('connect_status','Not Connected', true);\n }\n\n // no action to be taken if this flag is OFF \n // during development for convinience you may set autoRetrieveFlag=true\n if(!autoRetrieveFlag) return;\n\n\n\n // doConnect();\n // // doGetAccounts();\n doGetNodeStatus();\n\n // Compilation is available only for TestRPC\n // Geth 1.6 and above does not support compilation\n // MetaMask does not support compilation\n doGetCompilers();\n}", "title": "" }, { "docid": "d62c24284c22f1339db274cfd3f27a61", "score": "0.5047751", "text": "start() {\n this.send([0xFA])\n this.send([0xF8])\n\n this.expected = Date.now() + this.tempo\n this.timeout = setTimeout(this.sync.bind(this), this.tempo)\n this.startButton.setAttribute(\"disabled\", \"disabled\")\n this.stopButton.removeAttribute(\"disabled\")\n }", "title": "" }, { "docid": "d4b001ab6c0c27b9038964008d9ba427", "score": "0.5038229", "text": "static start() {\n // (For reloads) - ensure we're clear and shut down\n this.shutdown();\n\n // Fetch configured remotes from db\n let nextRemotes = [];\n\n let dbRemotes = db\n .get('remotes')\n .value() || [];\n\n for (let i = 0; i < dbRemotes.length; i++) {\n let _dbRemoteDsn = dbRemotes[i];\n\n try {\n let remoteParsed = SyncRemote.fromDsn(_dbRemoteDsn);\n nextRemotes.push(remoteParsed);\n } catch (e) {\n logger.error(`[sync] Invalid remote defined in database (${_dbRemoteDsn}): ${e || \"Unknown error\"}`);\n }\n }\n\n this.remotes = nextRemotes;\n\n if (!this.remotes) {\n return;\n }\n\n // Each channel should begin connecting now\n for (let i = 0; i <this.remotes.length; i++) {\n let _remote = this.remotes[i];\n _remote.getChannel().connect()\n .then(() => { })\n .catch(() => { })\n }\n\n // Start interval for auto-reconnect on failure\n this.checkInterval = setInterval(() => {\n for (let i = 0; i < this.remotes.length; i++) {\n let _remote = this.remotes[i];\n let _chan = _remote.getChannel();\n\n if (!_chan.isConnected) {\n logger.debug(`[sync] Auto-reconnect attempt for channel ${_chan.websocketUrl}`);\n\n _chan.connect()\n .then(() => { })\n .catch(() => { })\n }\n }\n }, SyncManager.RECONNECT_INTERVAL)\n }", "title": "" }, { "docid": "e3447e57b59b996b7cc3bfa1375abb66", "score": "0.5037993", "text": "start() {\n this.startedLocal = true;\n }", "title": "" }, { "docid": "825fc16321b73fba821427c748dfa319", "score": "0.5030936", "text": "async function main(wallet) {\n \n const paraswap = new ParaSwapper(POLYGON_NETWORK_ID);\n const bot = new BOT(paraswap, wallet); // add token paramters\n // Let the bot make some money ;) \n\n await bot.alive();\n}", "title": "" }, { "docid": "abbbe3ad4f3bcdae51b871114c729515", "score": "0.5026376", "text": "start() {\n this.logger.info(\"Infura starting...\");\n const { eventLoopTimer } = this.config;\n\n this.initWeb3();\n\n this.listener = this.web3.subscribe(\"newBlockHeaders\", (err, header) => {\n this.addBlockToFrontOfQueue(header.number);\n });\n\n this.eventLoop = setInterval(async () => {\n if (this.queue.length > 0) {\n this.processBlockQueue();\n }\n }, eventLoopTimer);\n\n this.logger.info(\"Infura started\");\n }", "title": "" }, { "docid": "17ba559bfd2565a844bdd5826c342a38", "score": "0.5022066", "text": "function sync() {\n //syncDom.setAttribute('data-sync-state', syncing);\n var opts = { live: true ,};\n db.replicate.to(remoteCouch, opts);\n db.replicate.from(remoteCouch, opts);\n }", "title": "" }, { "docid": "3383c4e0fc083968aa1c568b428c1b16", "score": "0.5018963", "text": "onMainBranchSync(blockId) {\n return this.blockchain.includes(blockId);\n }", "title": "" }, { "docid": "d13762408ec1720cd60dcb2737126487", "score": "0.5017814", "text": "async loadBlockChain() {\n\t\t// Modern DApp Browsers\n\t\tif (window.ethereum) {\n\t\t\tweb3 = new Web3(window.ethereum);\n this.getAccounts();\n\t\t\ttry { \n\t\t\t\twindow.ethereum.enable().then(function() {\n\t\t\t\t\t//Set State When recieve Emission from Event from Smart Contract\n //SecretPay = new web3.eth.Contract(abiSecretPay, contractAddress);\n ChainlinkContract = new web3.eth.Contract(ERC20_ABI, ChainlinkContractAddress);\n\t\t\t\t\tSecretPayFactory = new web3.eth.Contract(Factory_ABI, contractFactoryAddress);\n\n SecretPayFactory.events.contractDeployed(function(error, result){\n\t\t\t\t\t\tif (!error){\n\t\t\t\t\t\t\tvar SecretPayAddress = result.returnValues.SecretPayAddress;\n console.log(result)\n\t\t\t\t\t\t\tthis.setState({ newSecretPayAddress: SecretPayAddress });\n console.log(SecretPayAddress)\n this.loadSecretPayContract(SecretPayAddress)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}.bind(this));\n \n //this.setState({ SecretPayState : SecretPay });\n\t\t\t\t}.bind(this));\n\t\t\t} catch(e) {\n // User has denied account access to DApp...\n console.log(e);\n\t\t\t}\n\t\t}\n\t\t// Legacy DApp Browsers\n\t\telse if (window.web3) {\n\t\t\tweb3 = new Web3(window.web3.currentProvider);\n this.getAccounts();\n\t\t}\n\t\t// Non-DApp Browsers\n\t\telse {\n this.toggleError();\n\t\t}\n\t}", "title": "" }, { "docid": "8162e8f05c9a28000b3bc2cb8a1a3d4b", "score": "0.50065374", "text": "async function main () {\n const slave = new TransactionalDataset()\n\n const transaction = mutex()\n const master = new TransactionalDataset(null, {\n request: async () => {\n await transaction.lock()\n },\n complete: diff => {\n slave.applyDiff(diff)\n\n transaction.unlock()\n }\n })\n\n await Promise.all([\n makeChanges({ id: '1', master, slave }),\n makeChanges({ id: '2', master, slave })\n ])\n}", "title": "" }, { "docid": "58f2f0d1305bae2dcc7395bae21ea4e8", "score": "0.49885747", "text": "async _sync() {\n log(`syncing models...`)\n try {\n await User.sync()\n await Repository.sync()\n await UserRepository.sync()\n await Check.sync()\n await PullRequest.sync()\n await FrozenComment.sync()\n await Session.sync()\n log('synced models')\n } catch (e) {\n error(e)\n }\n }", "title": "" }, { "docid": "f8c1276c68261aa253178604a0d338ef", "score": "0.49867955", "text": "async installSmartContract() {\n await this.fabric.installSmartContract();\n }", "title": "" }, { "docid": "145c09718320f5896a45f12df1de00ea", "score": "0.49865207", "text": "function startWeb3() {\n\n coinbase = web3.eth.coinbase;\n getBalance(coinbase);\n\n}", "title": "" }, { "docid": "ba9560f9daf6646764bface8552ee22e", "score": "0.49839827", "text": "async function main (input = {}) {\n const config = merge({\n balances: {\n // 0x00: 10000000\n },\n blocks: {},\n chain: [],\n frequency: 60, // seconds\n script: [],\n validators: []\n }, input);\n\n // const chain = new Chain();\n const federation = new Federation(config);\n const machine = new Machine(config);\n\n /* // example use of trigger-based cycles\n const source = new Actor();\n source.on('changes', (changes) => {\n machine.trigger('OP_HANDLE_CHANGES', [changes]);\n }); */\n\n // Define Opcodes\n machine.define('OP_ADVANCE_BLOCK', OP_ADVANCE_BLOCK);\n\n // Configure State\n machine.set('/balances', config.balances);\n machine.set('/blocks', config.blocks);\n machine.set('/chain', config.chain);\n machine.set('/validators', config.validators);\n\n // Log changes\n machine.on('changes', (changes) => {\n console.log('[SCRIPTS:VALIDATOR] Changes:', changes);\n console.log('[SCRIPTS:VALIDATOR] State:', machine.state);\n });\n\n // Anchor Chain\n const bitcoin = new Bitcoin();\n const fixture = new Signer({ seed: FIXTURE_SEED });\n\n console.log('public:', fixture.key.public.encodeCompressed('hex'));\n\n federation.addMember({\n public: fixture.key.public.encodeCompressed('hex')\n });\n\n federation.start();\n\n await machine.start();\n\n return JSON.stringify({\n content: machine.state,\n frequency: machine.frequency,\n interval: machine.interval,\n machine: machine.id\n });\n}", "title": "" }, { "docid": "ccc891453a360f67ed03f00e0dc54c95", "score": "0.49836862", "text": "async function run () {\n try {\n const idx = process.argv.indexOf('--findblock') \n const provider = new WsProvider(url);\n const connection = await ApiPromise.create({ provider });\n let blockLookup = 0;\n if(process.argv.indexOf('--findblock') != -1) blockLookup = process.argv[idx + 1];\n \n // find specific block\n if(blockLookup) {\n const block = await connection.rpc.chain.getBlockHash(blockLookup);\n console.log(`Block Found: ${block}`)\n process.exit()\n } \n // wait for any block\n const block = await connection.rpc.chain.getBlock()\n console.log(`Block Found: ${block}`)\n process.exit()\n\n } catch (e) {\n console.log(`something went wrong`, e)\n process.exit()\n }\n}", "title": "" }, { "docid": "1a04f0197a127e59f419c0f287dbb5b6", "score": "0.49828225", "text": "async startWalletUnlocker() {\n mainLog.info('Establishing connection to Wallet Unlocker gRPC interface...')\n this.walletUnlocker = new WalletUnlocker(this.lndConfig)\n this.sendMessage('startWalletUnlocker', true)\n // Connect to the WalletUnlocker interface.\n try {\n await this.walletUnlocker.connect()\n\n // Listen for all gRPC restful methods and pass to gRPC.\n ipcMain.on('walletUnlocker', (event, { msg, data }) =>\n this.walletUnlocker.registerMethods(event, msg, data)\n )\n\n // Notify the renderer that the wallet unlocker is active.\n this.sendMessage('walletUnlockerStarted', this.lndConfig)\n } catch (err) {\n mainLog.warn('Unable to connect to WalletUnlocker gRPC interface: %o', err)\n throw err\n } finally {\n this.sendMessage('startWalletUnlocker', false)\n }\n }", "title": "" }, { "docid": "e2a6a77cc83eddceb1fed7a75d54b8e3", "score": "0.49823108", "text": "function connect() {\n console.log('connect');\n start(true);\n}", "title": "" }, { "docid": "68598e8fc8c18f06dca35cdc09811db8", "score": "0.49816468", "text": "function test_syncStartup_emptyOrOutdatedGlobalsResetsSync() {\n _(\"SyncEngine._syncStartup resets sync and wipes server data if there's no or an oudated global record\");\n\n Svc.Prefs.set(\"clusterURL\", \"http://localhost:8080/\");\n let crypto_steam = new ServerWBO('steam');\n\n // Some server side data that's going to be wiped\n let collection = new ServerCollection();\n collection.wbos.flying = new ServerWBO(\n 'flying', encryptPayload({id: 'flying',\n denomination: \"LNER Class A3 4472\"}));\n collection.wbos.scotsman = new ServerWBO(\n 'scotsman', encryptPayload({id: 'scotsman',\n denomination: \"Flying Scotsman\"}));\n\n let server = sync_httpd_setup({\n \"/1.0/foo/storage/crypto/steam\": crypto_steam.handler(),\n \"/1.0/foo/storage/steam\": collection.handler()\n });\n createAndUploadKeypair();\n\n let engine = makeSteamEngine();\n engine._store.items = {rekolok: \"Rekonstruktionslokomotive\"};\n try {\n\n // Confirm initial environment\n do_check_eq(crypto_steam.payload, undefined);\n do_check_eq(engine._tracker.changedIDs[\"rekolok\"], undefined);\n let metaGlobal = Records.get(engine.metaURL);\n do_check_eq(metaGlobal.payload.engines, undefined);\n do_check_true(!!collection.wbos.flying.payload);\n do_check_true(!!collection.wbos.scotsman.payload);\n\n engine.lastSync = Date.now() / 1000;\n engine._syncStartup();\n\n // The meta/global WBO has been filled with data about the engine\n let engineData = metaGlobal.payload.engines[\"steam\"];\n do_check_eq(engineData.version, engine.version);\n do_check_eq(engineData.syncID, engine.syncID);\n\n // Sync was reset and server data was wiped\n do_check_eq(engine.lastSync, 0);\n do_check_eq(collection.wbos.flying.payload, undefined);\n do_check_eq(collection.wbos.scotsman.payload, undefined);\n\n // Bulk key was uploaded\n do_check_true(!!crypto_steam.payload);\n do_check_true(!!crypto_steam.data.keyring);\n\n // WBO IDs are added to tracker (they're all marked for uploading)\n do_check_eq(engine._tracker.changedIDs[\"rekolok\"], 0);\n\n } finally {\n server.stop(function() {});\n Svc.Prefs.reset(\"clusterURL\");\n Svc.Prefs.reset(\"steam.syncID\");\n Svc.Prefs.reset(\"steam.lastSync\");\n Records.clearCache();\n CryptoMetas.clearCache();\n syncTesting = new SyncTestingInfrastructure(makeSteamEngine);\n }\n}", "title": "" }, { "docid": "73ab515a25e78b407f556a80c6ac2e1d", "score": "0.49786234", "text": "function Sync() {\n (0, _classCallCheck3.default)(this, Sync);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (Sync.__proto__ || (0, _getPrototypeOf2.default)(Sync)).call(this, SERVICE_ID));\n\n var startTime = process.hrtime();\n\n var getTimeFunction = function getTimeFunction() {\n var now = process.hrtime(startTime);\n return now[0] + now[1] * 1e-9;\n };\n\n _this._sync = new _server2.default(getTimeFunction);\n return _this;\n }", "title": "" }, { "docid": "be29e9a4905500c422a394ee9ac929e2", "score": "0.49776587", "text": "function start() {\n console.log(\"><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><\");\n console.log(\"\\r\\n\\tWelcome to the Bamazon Marketplace - Manager's Suite\\r\\n\");\n console.log(\"\\r\\n If you'd like to exit at any time, simply select 'Exit'.\\r\\n\");\n console.log(\"><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><\");\n managing();\n}", "title": "" } ]
ae00817ab2f8ac4cd538562a17e0e789
======================================== abstract methods ========================================
[ { "docid": "2190398364a80ea750c066ba8178649e", "score": "0.0", "text": "watch() {\n this.logger('watch should be overridden');\n }", "title": "" } ]
[ { "docid": "cced1c427a5ccbce635d714751f42bf5", "score": "0.57138675", "text": "handleToolData() {\n // overwrite in derived class\n }", "title": "" }, { "docid": "f31171559859a1e1108285de0f0e07a5", "score": "0.56805474", "text": "get state() {throw new Error(\"Cannot invoke an abstract method\")}", "title": "" }, { "docid": "de4f1b2a7bf8b2463bf2739307601a00", "score": "0.56144935", "text": "dispatch() {\n throw new NotImplementedException();\n }", "title": "" }, { "docid": "e38edb5dd151abf14bec4bb78bd9efb2", "score": "0.5471466", "text": "function _fn(){ /*...*/ }\t//Funzioni private", "title": "" }, { "docid": "72abcb0f2d56bf399bd78727a6c07f1f", "score": "0.54692185", "text": "buildStructures() {\n throw new Error(\"Should be implemented in subclass\");\n }", "title": "" }, { "docid": "d4abd7adad46f712d24e883bacf7b0dd", "score": "0.54235566", "text": "append()\n {\n //Should be overriden by children classes.\n throw new Error(\"Not Implemented\");\n }", "title": "" }, { "docid": "a3b9b56b957aa46b13daa8764d5e21a2", "score": "0.54142404", "text": "test() {\n throw new TypeError(\n 'Abstract method called from child. This method has to be implemented in child.',\n );\n }", "title": "" }, { "docid": "65a8933363f4402c36b93e5ac18353a7", "score": "0.536306", "text": "function abstractFunction() { throw new Error('abstract'); }", "title": "" }, { "docid": "7bdf3f19a966fba21dda2ce3369aae12", "score": "0.53617585", "text": "function __aQHTPPuL1Di4jeIELPbjrw(){}", "title": "" }, { "docid": "3a2457ca25da5bc455259ea1d5091d9c", "score": "0.5338679", "text": "execute(){\n throw new Error(\"This Method Must Be Implemented inside \"+ this.constructor.name);\n }", "title": "" }, { "docid": "a09bb1e162d09081f6eab52bd0418825", "score": "0.5289364", "text": "init() {\n // should be overridden\n }", "title": "" }, { "docid": "dacd20c2f775823da2f56905f80b066c", "score": "0.5272665", "text": "look() {\n // Implemented at runtime by a worker thread.\n }", "title": "" }, { "docid": "ae9373d40394df6eec73841aac596871", "score": "0.52425563", "text": "set state(value){ throw new Error(\"Cannot invoke an abstract method\") }", "title": "" }, { "docid": "d0991e9676818ebbb41a035b57f87b49", "score": "0.5227881", "text": "interpolate_() {\n\t\t\tthrow new Error('call to abstract method'); // implementations shall return this.resultBuffer\n\t\t}", "title": "" }, { "docid": "29c9e4a69837cdc3e2d4bad40476bd86", "score": "0.52261347", "text": "function AbstractRenderer() {\n\n}", "title": "" }, { "docid": "2c39d6dba5eed3f46fef0cb6a7253d46", "score": "0.52121407", "text": "getChunk() { /* implement this method */ }", "title": "" }, { "docid": "b79d32fb087bf2ecdd5a908d54a2aa00", "score": "0.5196128", "text": "function abstractFactory() {}", "title": "" }, { "docid": "ee8ee769b684c633a45471987d55edd2", "score": "0.51888996", "text": "function AbstractRenderer() {\r\n\r\n}", "title": "" }, { "docid": "b671e04c219126b7401609e546daada2", "score": "0.51876557", "text": "sync() {\n throw new TypeError(\n 'Abstract method called from child. This method has to be implemented in child.',\n );\n }", "title": "" }, { "docid": "0cfe2d50883b226f985af500c0b3c4f8", "score": "0.51513106", "text": "constructor() { super() }", "title": "" }, { "docid": "13df25260e4440a35d55566645faf853", "score": "0.51449466", "text": "function mifuncion(){}", "title": "" }, { "docid": "79c88aea0d2722b625805ef657993224", "score": "0.5136893", "text": "baseMethod() {\n }", "title": "" }, { "docid": "86ccd229cb2acd7cf856530601002747", "score": "0.5133671", "text": "_getChainId() {\n throw new Error('Sub-class to implement.');\n }", "title": "" }, { "docid": "2f83124dd1e6ffd476e099b77d8f2081", "score": "0.51317865", "text": "function SuperclassBare() {}", "title": "" }, { "docid": "6517b87466de408fd85d25c1e9238452", "score": "0.50897855", "text": "execute(params, context) {\n throw new Error('This method is abstract');\n }", "title": "" }, { "docid": "f0408078d0a12f66b857c7a415862595", "score": "0.50875235", "text": "utility(state) {\n throw 'not implemented';\n }", "title": "" }, { "docid": "13ae054d44c14279218f0e2cddd11ba9", "score": "0.50861764", "text": "function BaseElement(){}", "title": "" }, { "docid": "00e58d2ad329b0d4326a669083707d39", "score": "0.5083961", "text": "handleNewData(/* dataByCollection */) {\n throw new Error(`abstract method not implemented: ${this}.handleNewData`);\n }", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.50715363", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.50715363", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.50715363", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.50715363", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.50715363", "text": "prepare() {}", "title": "" }, { "docid": "db7e1b0668c63f3244d920e58b041970", "score": "0.5070225", "text": "function qgAzysV_bHje7HMBqh73wBw(){}", "title": "" }, { "docid": "502eaa82d6d070bb36626c3cad493f87", "score": "0.5064292", "text": "prepare() { }", "title": "" }, { "docid": "502eaa82d6d070bb36626c3cad493f87", "score": "0.5064292", "text": "prepare() { }", "title": "" }, { "docid": "a7f9cf7a28d132d3b1b9a132c5d34117", "score": "0.5042837", "text": "get type() {\n // This getter really should be abstract, but our current constructor\n // depends on .type working\n return 'raw';\n }", "title": "" }, { "docid": "38871dd89772f1102227a332fcdb75ce", "score": "0.5040208", "text": "function add() { } //FIXME::add implementation ", "title": "" }, { "docid": "4d8cae99e0dfb4a30f0af38edcee1d0b", "score": "0.50400037", "text": "create() {\n throw new Error(\"Unimplemented!\");\n }", "title": "" }, { "docid": "ae5eb07b81fc46477696a8cfa656b76e", "score": "0.5032918", "text": "get isAbstract() { return this._isAbstract; }", "title": "" }, { "docid": "79e75f3255ba93f5015a28971728be70", "score": "0.5028355", "text": "prepare() {\n\n\t}", "title": "" }, { "docid": "8c8c32db89ba3ccdf22debe22f55aa4b", "score": "0.5025176", "text": "render() {\n throw new Error('Method must be implemented');\n }", "title": "" }, { "docid": "e709e71d522b9f57d7abefd8724cffc8", "score": "0.50099134", "text": "constructor() {\r\n\t}", "title": "" }, { "docid": "cf62f45df6557a48b5658524bd55a60f", "score": "0.49913827", "text": "function inherit(){}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.49800828", "text": "initialize() {}", "title": "" }, { "docid": "e9e3544485e242eb3693a28f5f87ee64", "score": "0.49708515", "text": "function AbstractChartPainter() {\n\n}", "title": "" }, { "docid": "e9e3544485e242eb3693a28f5f87ee64", "score": "0.49708515", "text": "function AbstractChartPainter() {\n\n}", "title": "" }, { "docid": "ca890ac319ec4ef02dac95c5d2ac3d21", "score": "0.4967414", "text": "async preTest() { throw new Error('abstract method not implemented'); }", "title": "" }, { "docid": "3fb55c66251bb2823be2ac8a86954f8c", "score": "0.49538803", "text": "constructor() { super(); }", "title": "" }, { "docid": "24ec7ba5d3f35a4807716f7d9a2d73bc", "score": "0.4952504", "text": "function AbstractRecognitionInput() {\n }", "title": "" }, { "docid": "edd57dad9877cbb076f5a7611c429294", "score": "0.49395266", "text": "render() {\n throw new Error(\"Implement\");\n }", "title": "" }, { "docid": "b08246deaa408687d03c0441e048fa96", "score": "0.49360663", "text": "render(){return renderNotImplemented}", "title": "" }, { "docid": "cfce57972c0c0182d1630293960d5087", "score": "0.4933952", "text": "function BaseRenderer(){}", "title": "" }, { "docid": "7d378b8e74fb7c20157c1adc9ff9d663", "score": "0.49333423", "text": "run() {throw new Error(\"State.run must be overridden by inheriting class\");}", "title": "" }, { "docid": "d2ceea55062e3f31d36f9e6c5b45e9b2", "score": "0.49265614", "text": "function BaseElement() {\n}", "title": "" }, { "docid": "d2ceea55062e3f31d36f9e6c5b45e9b2", "score": "0.49265614", "text": "function BaseElement() {\n}", "title": "" }, { "docid": "ed1a5980fed586d68a2c5b2fd5734eae", "score": "0.49265218", "text": "function Strategy() {}", "title": "" }, { "docid": "68ccff687712efa198ba14f4ac3254c8", "score": "0.4925134", "text": "get Internal() {}", "title": "" }, { "docid": "3f345906af0c223635f5d05f79bdd5aa", "score": "0.49251187", "text": "prepare() {\n \n }", "title": "" }, { "docid": "faef72c90f3c669050bfc1cda3db2735", "score": "0.49231285", "text": "eachMapping(aCallback, aContext, aOrder) {\n throw new Error(\"Subclasses must implement eachMapping\");\n }", "title": "" }, { "docid": "faef72c90f3c669050bfc1cda3db2735", "score": "0.49231285", "text": "eachMapping(aCallback, aContext, aOrder) {\n throw new Error(\"Subclasses must implement eachMapping\");\n }", "title": "" }, { "docid": "faef72c90f3c669050bfc1cda3db2735", "score": "0.49231285", "text": "eachMapping(aCallback, aContext, aOrder) {\n throw new Error(\"Subclasses must implement eachMapping\");\n }", "title": "" }, { "docid": "e495e246558016d0913e1b6aa306c7b9", "score": "0.49193078", "text": "render() \n {\n throw new Error('render() must be handled by subclass,it is not implemented by QuotePage class');\n }", "title": "" }, { "docid": "abdc952d4d25b1aaf30b6fb428ec2485", "score": "0.4916852", "text": "constructor(){super();}", "title": "" }, { "docid": "c40239e91669cc39622ceceba4eaf875", "score": "0.49137777", "text": "function AbstractClass(manager, instanceName) {\n\n\tthis.PrimitiveOperation1 = function(){\n\n\t};\n\n\tthis.PrimitiveOperation2 = function(){\n\n\t};\n\n\tthis.TemplateMethod = function(){\n\n\t\t//...\n\t\t//PrimitiveOperation1()\n\t\t//...\n\t\t//PrimitiveOperation2()\n\t\t//...\n\n\n\t};\n\n}//end AbstractClass", "title": "" }, { "docid": "e1ea87c5dc7e81e4d5fcc2d57e23bbfd", "score": "0.4911231", "text": "_validateAndSanitizeParams() {\n throw new Error('Sub-class to implement.');\n }", "title": "" }, { "docid": "df62f6aeeb238679210f69c60a41b7f7", "score": "0.48986903", "text": "load() {\n // not implemented\n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.48965794", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" } ]
6a2e8feed250b85b7efb83635c59308a
The method is used for checking selfdefined pattern.
[ { "docid": "fa903d95593d61f543d7d4e3d8459cab", "score": "0.0", "text": "function validateCustom(formObj) {\n\tif (fv['bok'] && checkBlank(formObj))\n\t\t{ fv['bok']=false; return true; }\n\n\tif(validateBlank(formObj))\n {\n\t var regex = new RegExp(formObj.getAttribute(fv['pattern']));\n if (!regex.test(formObj.value)) {\n var errorMsg = customErrorMsg;\n if(formObj.msg)\n errorMsg = formObj.msg;\n\n\t\t\treturn errorProcess3(formObj,errorMsg);\n\t }\n\t return true;\n\t}\n}", "title": "" } ]
[ { "docid": "81133df6475fceabc1ce16897aa57006", "score": "0.6699464", "text": "function Pattern() {\n error('should not call Pattern constructor');\n }", "title": "" }, { "docid": "fa75b5623699d70cb629a1e80261c8ec", "score": "0.6462629", "text": "function checkPattern(piece) {\n if (!GameManager.isGameStart()) {\n return;\n }\n return memCheckPattern(getPattern(), piece);\n }", "title": "" }, { "docid": "d36812428c517bf72a39d0bc69f4212b", "score": "0.6384041", "text": "isNewPattern(pattern) {\n return !!this.patterns[pattern].fresh;\n }", "title": "" }, { "docid": "bb2a3ad1a64a16ad3a23e5b824479f18", "score": "0.620767", "text": "function NullPattern(){}", "title": "" }, { "docid": "8e7a0966214a54befec5a3fdcd46707d", "score": "0.5916941", "text": "function NullPattern$1(){}", "title": "" }, { "docid": "f09bdd12f095e82c9b66631ea4c22f0b", "score": "0.59118885", "text": "check_move_pattern(x, y, board) {\n\n // check if it is following on of the possible patterns\n if (this.x !== x && this.y !== y && Math.abs(this.x - x) !== Math.abs(this.y - y))\n return false;\n\n // check if it has no pieces on its way\n if (this.x === x) {\n return !board.hasPieceOnFile(x, y, this.y);\n }\n else if(this.y === y) {\n return !board.hasPieceOnRank(x, y, this.x);\n }\n else {\n return !board.hasPieceOnDiagonal(x, y, this.x, this.y)\n }\n }", "title": "" }, { "docid": "045a4b174fd8f01ef19127f4bcef7326", "score": "0.5856532", "text": "static isPattern(path) {\n\t\treturn path.indexOf('*') !== -1 || (path.indexOf('(') !== -1 && path.indexOf(')'))\n\t}", "title": "" }, { "docid": "d444cee11c6047125d2dbffa76614c24", "score": "0.5799445", "text": "pattern() {\n return this.#patternList[this.#index];\n }", "title": "" }, { "docid": "5c327e4e03398f196812255f74fa563f", "score": "0.5773632", "text": "function patternTest(pattern, str){\n if(pattern.test(str)){\n console.log(`${str} matches ${pattern.source}`);\n }else{\n console.log(`${str} does NOT match ${pattern.source}`);\n }\n}", "title": "" }, { "docid": "8c340b7a82e006c465cb4393fcd81190", "score": "0.5772126", "text": "isGlobstar() {\n return this.#patternList[this.#index] === minimatch_1.GLOBSTAR;\n }", "title": "" }, { "docid": "20080ecba8598385374fb882e0aadbd9", "score": "0.575264", "text": "function PatternValidatorGenerator(pattern,errormessage){\n\tfunction ValidatorFunction(DF){\n\t\tvar string=FindData(DF.qfield,DF.pid);\n\t\tif((typeof string!==\"undefined\")&&(string.match(pattern)!==null))\n\t\t\treturn {valid:true,error:\"none\"}\n\t\telse if(DF.qerrorcustom!=='')\n\t\t\treturn {valid:false,error:DF.qerrorcustom}\n\t\telse\n\t\t\treturn {valid:false,error:errormessage}\n\t\t};\n\treturn ValidatorFunction;\n}", "title": "" }, { "docid": "fa148faa6c12e358ba93619c2e984bfc", "score": "0.57393163", "text": "function OutOfBoundsRule(pattern, parameters)\n{\n\n\tfor(var i = 0; i < pattern.shapes.length; i++)\n\t{\n\n\t\tif(pattern.owner.Stage().InBounds().Intersects(pattern.shapes[i]))\n\t\t{\n\n\t\t\treturn false;\n\t\t}\n\n\t}\n\n\treturn false;\n\n}", "title": "" }, { "docid": "d4a97c9ef8a467b3eed9777fdaf52308", "score": "0.56894577", "text": "get pattern() {\n if (!this._pattern) {\n this._pattern = this.fn(this)\n }\n return this._pattern\n }", "title": "" }, { "docid": "c8b4602beffd716eb9ca876655d65e12", "score": "0.5684251", "text": "function IsMatching_CorrectPattern(str)\r\n\t{\r\n\t // the format should be shortid[.]shortid[,]shortid[.]shortid\r\n\t if (str == \"\") \r\n\t return false;\r\n\t \r\n\t return IsMatching_LearnerResponse(str);\r\n\t}", "title": "" }, { "docid": "81709ddd6c1e234c40233babbdd40ca6", "score": "0.5643238", "text": "function patternCheck(){\n let checkValue = true;\n for(let i=0; i<userClickedPattern.length; i++){\n if(gamePattern[i] !== userClickedPattern[i]){\n checkValue = false;\n break;\n }\n }\n\n if(checkValue){ //===\n //이전에 틀린경우를 구분하기 위함\n if(userClickedPattern.length === gamePattern.length){\n userClickedPattern = []; //배열 초기화\n setTimeout(nextSequence, 1000);\n }\n }else{ //!==\n $(\"body\").addClass(\"gameover\");\n setTimeout(function(){\n $(\"body\").removeClass(\"gameover\");\n $(\"h1\").text(\"Game Over, Press [A] Key to Restart\");\n }, 200);\n }\n}", "title": "" }, { "docid": "4ddfbba99b92f7dc2352707f4bad40fd", "score": "0.56368023", "text": "checkFollowGlobstar() {\n return !(this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar);\n }", "title": "" }, { "docid": "95b6ed963bc65e13df162f21a6543126", "score": "0.5610741", "text": "constructor(pattern) {\n this.pattern = pattern;\n }", "title": "" }, { "docid": "a3ea725aaac7bdfffedac60179135bfb", "score": "0.5599319", "text": "matches() { return true }", "title": "" }, { "docid": "177f541f50aa712a51cb3d8db461ed4e", "score": "0.5549429", "text": "get PATTERN_EVENT() {return /^([A-Z][a-z]+)+$/;}", "title": "" }, { "docid": "17976689ca636f0b5cf03fb3bad46fb0", "score": "0.55491704", "text": "pattern(schema) {\n let pattern;\n let modifiers;\n\n if (typeof schema.pattern === 'string') { pattern = schema.pattern; } else {\n pattern = schema.pattern[0];\n modifiers = schema.pattern[1];\n }\n\n const regex = new RegExp(pattern, modifiers);\n return `typeof ($1) === \"string\" && !${regex}.test($1)`;\n }", "title": "" }, { "docid": "f432f1e30d705bcaa881cd8296cace1b", "score": "0.55401486", "text": "function validatePatterns() {\n var culprit;\n var msgInvalidDialPattern;\n defaultEmptyOK = true;\n\n // TODO: need to validate differently for prepend, prefix and match fields. The prepend\n // must be a dialable digit. The prefix can be any pattern but not contain \".\" and\n // the pattern can contain a \".\" also\n //$filter_prepend = '/[^0-9\\+\\*\\#/';\n //$filter_match = '/[^0-9\\-\\+\\*\\#\\.\\[\\]xXnNzZ]/';\n //$filter_prefix = '/[^0-9\\-\\+\\*\\#\\[\\]xXnNzZ]/';\n\t//defaultEmptyOK = false;\n /* TODO: get some sort of check in for dialpatterns\n\tif (!isDialpattern(theForm.dialpattern.value))\n\t\treturn warnInvalid(theForm.dialpattern, msgInvalidDialPattern);\n */\n\n $(\".dp-prepend\").each(function() {\n if ($.trim(this.value) === '') {\n } else if (this.value.search('[^0-9*#+wW\\s]+') >= 0) {\n culprit = this;\n return false;\n }\n });\n if (!culprit) {\n $(\".dp-prefix\").each(function() {\n if ($.trim($(this).val()) === '') {\n } else if (!isDialpattern(this.value) || this.value.search('[._]+') >= 0) {\n culprit = this;\n return false;\n }\n });\n }\n if (!culprit) {\n $(\".dp-match\").each(function() {\n if ($.trim(this.value) === '') {\n } else if (!isDialpattern(this.value) || this.value.search('[_]+') >= 0) {\n culprit = this;\n return false;\n }\n });\n }\n\tif (!culprit) {\n\t\tvar hash = [];\n\t\t$(\".dp-prefix\").each(function() {\n\t\t\tvar prefix = $(this).val(),\n\t\t\t\t\tmatch = $(this).parents(\"tr\").find(\".dp-match\").val(),\n\t\t\t\t\tcheck = prefix+match;\n\t\t\tif(check.length === 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(hash.indexOf(check) === -1) {\n\t\t\t\thash.push(check);\n\t\t\t} else {\n\t\t\t\tculprit = this;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t}\n\n if (culprit !== undefined) {\n\t msgInvalidDialPattern = _('Dial pattern is invalid');\n return warnInvalid(culprit, msgInvalidDialPattern);\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "12fcfd55a7db973cd1a363df236b510c", "score": "0.5512418", "text": "probe(pattern) {\n var token = this.peek(); // console.log(\"Probing\", token, \"for\", pattern)\n\n if (!token) {\n // console.log(\" -> nay\", token)\n return null;\n }\n\n var mismatch = Object.keys(pattern).find(key => {\n var value = pattern[key];\n\n if (!token[key] || token[key] != value) {\n // console.log(\" -> nay\", key)\n return true;\n }\n\n return false;\n });\n\n if (mismatch) {\n return null;\n } // console.log(\" -> yay\", token)\n\n\n return token;\n }", "title": "" }, { "docid": "e14dba6834294894f53b4905683c2511", "score": "0.5504877", "text": "function isValid() {}", "title": "" }, { "docid": "6729c636e063bae9e5e1b8cf3cc98afb", "score": "0.54988253", "text": "function pattern(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if((0,_util.isEmptyValue)(value,'string')&&!rule.required){return callback();}_rule2[\"default\"].required(rule,value,source,errors,options);if(!(0,_util.isEmptyValue)(value,'string')){_rule2[\"default\"].pattern(rule,value,source,errors,options);}}callback(errors);}", "title": "" }, { "docid": "d5096591f5955757db62afce4ee2f70b", "score": "0.54849917", "text": "isRegExp() {\n return this.#patternList[this.#index] instanceof RegExp;\n }", "title": "" }, { "docid": "a15b0a4c0e08ebc70c8223909c496668", "score": "0.54773945", "text": "probe(pattern) {\n const token = this.peek()\n // console.log(\"Probing\", token, \"for\", pattern)\n if (!token) {\n // console.log(\" -> nay\", token)\n return null\n }\n const mismatch = Object.keys(pattern).find(key => {\n const value = pattern[key]\n if (!token[key] || token[key] != value) {\n // console.log(\" -> nay\", key)\n return true\n }\n return false\n })\n if (mismatch) {\n return null\n }\n // console.log(\" -> yay\", token)\n return token\n }", "title": "" }, { "docid": "a6dbde01d7e87f33dbb1edbb7f0969ed", "score": "0.5476713", "text": "isValidated() {\n\t\treturn true;\n\t}", "title": "" }, { "docid": "8431628b1616fd7dc57d9e95566d2d0c", "score": "0.5472352", "text": "function patternMatch(pattern , elementToValidate )\n{\n if (!pattern.test(elementToValidate.value) & flag == false) {\n alert(elementToValidate.id + \" is invalid. pls check\");\n flag = true; \n }\n}", "title": "" }, { "docid": "1d05e89d4b26490db73bcd4e2246df11", "score": "0.54579157", "text": "function match () {\n\n\t\n}", "title": "" }, { "docid": "e5fb3a84b4321ed5c9a9d7c57a8005bb", "score": "0.54515016", "text": "static validatePattern(pattern) {\n const partialSplatRouteMatch = pattern.match(this.PARTIAL_SPLAT_ROUTE);\n if (partialSplatRouteMatch) {\n const [_, prefix, splat] = partialSplatRouteMatch;\n const alternativePattern = pattern.replace(`${prefix}${splat}`, `${prefix}:suffix/${splat}`);\n throw new PathMatcherError(`Partial splat routes are not supported. Use \"${alternativePattern}\" instead of \"${pattern}\"`);\n }\n return true;\n }", "title": "" }, { "docid": "92513f175b150b7534f5bebde4e59e86", "score": "0.54505306", "text": "hasWildcard() {\n return this.type === '*' || this.subtype === '*';\n }", "title": "" }, { "docid": "ade5316d85820cbcb938a5690e0ff05f", "score": "0.5431205", "text": "matchesPattern(pattern, blacklist) {\n if (typeof this.value !== \"string\") return false\n if (!pattern.test(this.value)) return false\n if (blacklist && blacklist[this.value]) return false\n return true\n }", "title": "" }, { "docid": "d5044a78562d62f720528ca02aace821", "score": "0.5426421", "text": "function pattern(rule,value,source,errors,options){if(rule.pattern instanceof RegExp){if(!rule.pattern.test(value)){errors.push(util.format(options.messages.pattern.mismatch,rule.fullField,value,rule.pattern));}}}", "title": "" }, { "docid": "9a3a8596a47e80e0a58c24480a5573c0", "score": "0.5425709", "text": "loopAllowed(node) {\n // for the specified node, return whether edges from itself to itself are allowed\n return false;\n }", "title": "" }, { "docid": "6031e0b21049b400fde0acc9727255c1", "score": "0.5411922", "text": "match(string, metadata = {depth: 0, parent: null}){\n var newMatchNode = new MatchNode()\n\n //matches, matchFound and matchLength need to be set in each case\n var matches = []\n var matchFound = false\n var matchLength = 0\n switch(this['friendly node type name']){\n case 'rule list':\n {\n //newMatchNode will be used as the parent node for all matches that are initiated by the current node\n //It is referred to at the end of the function\n let matchInfo = this.rules[0].match(string, {depth: 1, parent: newMatchNode})\n matchLength = matchInfo.matchLength\n matches = [matchInfo]\n matchFound = matchInfo.matchFound\n }\n break\n case 'rule':\n {\n let matchInfo = this.pattern.match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matchLength = matchInfo.matchLength\n matches = [matchInfo]\n matchFound = matchInfo.matchFound\n\n newMatchNode.setProperties({name: this.name})\n }\n break\n case 'rule name':\n {\n let rule = this.parser.getRule(this.value)\n let matchInfo = rule.match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches = [matchInfo]\n matchFound = matchInfo.matchFound\n matchLength = matchInfo.matchLength\n newMatchNode.setProperties({value: this.value})\n }\n break\n case 'not':\n {\n let matchInfo = this['pattern'].match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n \n matchFound = !matchInfo.matchFound\n if (matchFound){\n matchLength = string.length\n }\n matches = [matchInfo]\n }\n break\n case 'ws allow both':\n {\n let leadingWhitespace = Strings.headMatch(string, Strings.whitespace_characters)\n \n let remainderString = string.substring(leadingWhitespace.length)\n let matchInfo = this['inner pattern'].match(remainderString,{depth: metadata.depth + 1, parent: newMatchNode})\n if (matchInfo.matchFound){\n let afterInnerPattern = remainderString.substring(matchInfo.matchLength)\n let trailingWhitespace = Strings.headMatch(afterInnerPattern, Strings.whitespace_characters)\n matchLength = leadingWhitespace.length + matchInfo.matchLength + trailingWhitespace.length\n }\n matches = [matchInfo]\n matchFound = matchInfo.matchFound\n }\n break\n case 'sequence':\n {\n let tempString = string\n let totalMatchLength = 0\n \n let matchInfo\n for (let i = 0; i < this['patterns'].length; i++){\n matchInfo = this['patterns'][i].match(tempString,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n if (!matchInfo.matchFound){\n break;\n }else{\n totalMatchLength = totalMatchLength + matchInfo.matchLength\n tempString = tempString.substring(matchInfo.matchLength)\n }\n }\n matchFound = matchInfo.matchFound\n matchLength = totalMatchLength\n }\n break\n case 'or':\n {\n let matchInfo\n for (let i = 0; i < this.patterns.length; i++){\n matchInfo = this['patterns'][i].match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n if (matchInfo.matchFound){\n break\n }\n }\n matchFound = matchInfo.matchFound\n matchLength = matchInfo.matchLength\n }\n break\n case 'and':\n {\n let matchInfo\n let andDetected = true\n \n for (let i = 0; i < this.patterns.length; i++){\n matchInfo = this['patterns'][i].match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n if (!matchInfo.matchFound){\n andDetected = false\n matchLength = 0\n break\n }else{\n matchLength = matchInfo.matchLength\n }\n }\n \n //matchLength will be equal to the shortest match, or 0 if there was no match\n matchLength = match.matchLength\n\n matchFound = andDetected\n }\n break\n case 'multiple':\n {\n let tempString = string\n let totalMatchLength = 0\n \n let matchInfo = this.pattern.match(tempString,{depth: metadata.depth + 1, parent: newMatchNode})\n if (matchInfo.matchFound){\n matches.push(matchInfo)\n }\n while(matchInfo.matchFound){\n totalMatchLength = totalMatchLength + matchInfo.matchLength\n tempString = tempString.substring(matchInfo.matchLength)\n matchInfo = this.pattern.match(tempString,{depth: metadata.depth + 1, parent: this})\n matches.push(matchInfo)\n }\n\n if (matches.length > 0){\n matchFound = true\n }\n matchLength = totalMatchLength\n }\n break\n case 'quoted string':\n {\n //matches if the string starts with the quoted string\n let internalString = this['string']\n \n if (string.substring(0, internalString.length) == internalString){\n matchFound = true\n }\n \n if (matchFound){\n matchLength = internalString.length\n }\n newMatchNode.setProperties({string: this.string})\n }\n break\n case 'character class':\n {\n //matches if the string starts with characters from the character class\n let matchingString = ''\n //i is the number of characters to take for comparison\n //i goes from 1, 2, 3, ... to the length of the string\n for (let i = 1; i <= string.length; i++){\n let headString = string.substring(0,i)\n if (Strings.contains_only(headString,this['string'])){\n matchingString = headString\n }else{\n break\n }\n }\n \n if (matchingString.length > 0){\n matchFound = true\n matchLength = matchingString.length\n }\n }\n break\n case 'optional':\n {\n let matchInfo = this.pattern.match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n matchLength = matchInfo.matchLength\n matchFound = true\n }\n break\n case 'exact':\n {\n let matchInfo = this.pattern.match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n if (matchInfo.matchFound && matchInfo.matchLength == string.length){\n matchLength = matchInfo.matchLength\n matchFound = true \n }\n }\n }\n\n let matchString = string.substring(0, matchLength)\n newMatchNode.setProperties({parent: metadata.parent, string, type: this['friendly node type name'], id: this.id, serial: this.parser.getMatchCount(), depth: metadata.depth, matchFound, matchLength, matchString, matches})\n return newMatchNode\n }", "title": "" }, { "docid": "5e8ac625efb0bbbcd021cf74d7bbc675", "score": "0.5411831", "text": "function match(pattern, input) {\n\t return inner_match(pattern, input) === input.length;\n\n\t function inner_match(pattern, input) {\n\t function empty_match() {\n\t return p > 0 && i > 0 && pattern[p - 1] === input[i - 1] && pattern[p + 1] === input[i];\n\t }\n\n\t function not_symbol_match() {\n\t return pattern[p] === Symbol[\"for\"]('symbol') && !is_symbol_string(input[i]);\n\t }\n\n\t var p = 0;\n\t var glob = {};\n\n\t for (var i = 0; i < input.length; ++i) {\n\t if (typeof pattern[p] === 'undefined') {\n\t return i;\n\t }\n\n\t if (!input[i].trim()) {\n\t continue;\n\t }\n\n\t if (pattern[p] instanceof Pattern) {\n\t if (pattern[p].flag === '+') {\n\t var m;\n\n\t while (i < input.length) {\n\t m = inner_match(pattern[p].pattern, input.slice(i));\n\n\t if (m === -1) {\n\t break;\n\t }\n\n\t i += m;\n\t }\n\n\t if (m === -1 && input[i] && !pattern[p + 1]) {\n\t return -1;\n\t }\n\n\t p++;\n\t i -= 1;\n\t continue;\n\t } else if (pattern[p].flag === '?') {\n\t m = inner_match(pattern[p].pattern, input.slice(i));\n\n\t if (m === -1) {\n\t i -= 2; // if not found use same test same input again\n\t } else {\n\t p++;\n\t }\n\n\t continue;\n\t }\n\t }\n\n\t if (pattern[p] instanceof RegExp) {\n\t if (!input[i].match(pattern[p])) {\n\t return -1;\n\t }\n\t } else if (typeof pattern[p] === 'string') {\n\t if (pattern[p] !== input[i]) {\n\t return -1;\n\t }\n\t } else if (_typeof_1(pattern[p]) === 'symbol') {\n\t if (pattern[p] === Symbol[\"for\"]('*')) {\n\t // ignore S-expressions inside for case when next pattern is ')'\n\t glob[p] = glob[p] || 0;\n\n\t if (input[i] === '(') {\n\t glob[p]++;\n\t } else if (input[i] === ')') {\n\t glob[p]--;\n\t }\n\n\t if (empty_match()) {\n\t i -= 1;\n\t } else if (typeof pattern[p + 1] !== 'undefined' && glob[p] === 0 && pattern[p + 1] !== input[i + 1] || glob[p] > 0) {\n\t continue;\n\t }\n\t } else if (not_symbol_match()) {\n\t return -1;\n\t }\n\t } else if (pattern[p] instanceof Array) {\n\t var inc = inner_match(pattern[p], input.slice(i));\n\n\t if (inc === -1 || inc + i > input.length) {\n\t // if no more input it's not match\n\t return -1;\n\t }\n\n\t i += inc - 1;\n\t p++;\n\t continue;\n\t } else {\n\t return -1;\n\t }\n\n\t p++;\n\t }\n\n\t if (pattern.length !== p) {\n\t // if there are still patterns it's not match\n\t return -1;\n\t }\n\n\t return input.length;\n\t }\n\t } // ----------------------------------------------------------------------", "title": "" }, { "docid": "9480565423b55064cbc6a4a593e36273", "score": "0.54097736", "text": "matchTo(pattern) {\n // Match wildcard.\n if (pattern.type === '*' && pattern.subtype === '*') return true;\n\n // Match type only.\n if (this.type !== pattern.type) return false;\n if (pattern.subtype === '*') return true;\n\n // Match type and subtype.\n if (this.subtype !== pattern.subtype) return false;\n if (pattern.type !== 'text') return true;\n\n // Match charset for text.\n const patternCharset = pattern.parameters?.charset;\n if (patternCharset == null) return true;\n const typeCharset = this.parameters?.charset;\n if (typeCharset == null) return true;\n\n return typeCharset === patternCharset;\n }", "title": "" }, { "docid": "98768d2381e4e896a603845d823cdb21", "score": "0.5389573", "text": "check (decl) {\n let value = decl.value;\n if (!value.includes(this.name)) {\n return false\n }\n\n return !!value.match(this.regexp())\n }", "title": "" }, { "docid": "2f008fdbb9219f53848ec8da52b0fb7c", "score": "0.5386768", "text": "function CheckValidity(value, patternWord) {\n let pattern = RegExp(patternWord)\n if (pattern.test(value)) {\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "c70bf9e126f2a5af337a2352ed3c8531", "score": "0.53692555", "text": "function FinderPattern(e,t,n){this.x=e;this.y=t;this.count=1;this.estimatedModuleSize=n;this.__defineGetter__(\"EstimatedModuleSize\",function(){return this.estimatedModuleSize});this.__defineGetter__(\"Count\",function(){return this.count});this.__defineGetter__(\"X\",function(){return this.x});this.__defineGetter__(\"Y\",function(){return this.y});this.incrementCount=function(){this.count++};this.aboutEquals=function(e,t,n){if(Math.abs(t-this.y)<=e&&Math.abs(n-this.x)<=e){var r=Math.abs(e-this.estimatedModuleSize);return r<=1||r/this.estimatedModuleSize<=1}return false}}", "title": "" }, { "docid": "8f04a32f8ecc6a7d854befc4ecf5e25c", "score": "0.5354385", "text": "function patternMatchTest() {\n for (var i = 0; i < userPattern.length; i++) {\n if (userPattern[i] !== cpuPattern[i]) {\n if (checkStrictMode()) {\n lostGame();\n return;\n }\n else {\n userPattern = [];\n animateAllButtons();\n }\n }\n }\n /* If the user's pattern is the same length as the cpu pattern, check if level 20 is completed (ends in a win), otherwise clear the user pattern and add another color to the cpu pattern */\n if (userPattern.length === cpuPattern.length) {\n if (level === 20) {\n wonGame();\n return;\n }\n userPattern = [];\n addColorToCpuPattern();\n }\n}", "title": "" }, { "docid": "e3740b2ee2f070fac6107c8b2c131e05", "score": "0.53450584", "text": "check() {\n }", "title": "" }, { "docid": "d927c6e057e1b0c7e260b3c6116061be", "score": "0.5329279", "text": "checkSelf() {\n for (var i = 1; i < this.length; i++) {\n var pos = this.tail[i];\n if (pos[0] == this.pos.x && pos[1] == this.pos.y) {\n return true;\n }\n }\n }", "title": "" }, { "docid": "71215e45a1e34123332a46a0cab25eab", "score": "0.53253096", "text": "isValid() {\n return true;\n }", "title": "" }, { "docid": "239dcf24c2e86c248957267ace5f0f0b", "score": "0.5325015", "text": "function checkPatterns () {\n theUrl = document.getElementsByClassName(\"icons portlet\")[0].getElementsByTagName(\"a\")[0];\n for (i = 0; i < urlPatterns.length; i += 1) {\n if (String(theUrl).includes(urlPatterns[i].urlIn)) {\n return true;\n }\n }\n}", "title": "" }, { "docid": "c7f9ac5d3dd37af3b2146a112a418e52", "score": "0.528648", "text": "function validate() {\n // /.+/: tests for one or more characters.\n if(inputField.value.match(questions[questionIndex].pattern || /.+/)) {\n inputPass();\n } else {\n inputFail();\n }\n}", "title": "" }, { "docid": "60b498430cd8de61a778d9c0718651be", "score": "0.5279317", "text": "check (rule) {\n if (rule.selector.includes(this.name)) {\n return !!rule.selector.match(this.regexp())\n }\n\n return false\n }", "title": "" }, { "docid": "2c598a53bd4be72113fecd6a4e6caed0", "score": "0.52668315", "text": "function checkMatch(pattern, str) {\n if (pattern.length == 0 && str.length == 0){\n return true;\n }\n //if the pattern or the string is empty\n if (pattern.length == 0 || str.length == 0){\n return false;\n }\n //store the next pattern\n var currentPattern = pattern.charAt(0);\n if (currentPattern in map){\n //the pattern has alredy seen, check if there is a match with the string\n if (str.length >= map[currentPattern].length && str.startsWith(map[currentPattern])){\n //there is a match, try all other posibilities\n return checkMatch(pattern.substring(1), str.substring(map[currentPattern].length));\n } else {\n //no match, return false\n return false;\n }\n }\n //the current pattern is new, try all the posibilities of current string\n console.log('map' , map)\n console.log('string', str, 'pattern', pattern)\n for (var i=1; i <= str.length; i++){\n var stringToCheck = str.substring(0, i);\n //store in the map\n map[currentPattern] = stringToCheck;\n //try the rest\n var match = checkMatch(pattern.substring(1), str.substring(i));\n // console.log(match)\n if (match){\n //there is a match\n return true;\n } else {\n //if there is no match, delete the pair from the map\n delete map[currentPattern];\n }\n }\n return false;\n }", "title": "" }, { "docid": "e78cb1a59972ccbdbfa6ddc42b561b73", "score": "0.52579314", "text": "function generateMatchFunction(pattern) {\n\tif (pattern === undefined || /^[*]+$/.test(pattern)) return MatchEverything;\n\t\n\tvar hasStar = /[*]/.test(pattern);\n\tvar hasQuestion = /[?]/.test(pattern);\n\tif (hasStar || hasQuestion) {\n\t\t// construct and use regex!\n\t\tvar orig_length = pattern.length;\n\t\tpattern = pattern\n\t\t\t.replace(/[^a-zA-Z0-9?*]/g, '\\\\$&') // escape non-{leter, digit, '?', '*'} chars\n\t\t\t.replace(/\\?/g, '.')\n\t\t\t.replace(/\\*+/g, '.*?');\n\t\t\n\t\tpattern = ['^', pattern, '$'].join('');\n\t\tvar regex = new RegExp(pattern);\n\n\t\t// apply additional input.length test if pattern doesn't contain '*' char\n\t\treturn hasStar\n\t\t\t? (input) => regex.test(input)\n\t\t\t: (input) => (input.length === orig_length) && regex.test(input);\n\t}\n\n\t// use direct string comparison if pattern doesn't contain '*' or '?'\n\treturn (input) => (input === pattern);\n}", "title": "" }, { "docid": "c63fb33fed4245b7d8a73a80feff2997", "score": "0.5246147", "text": "function checkPattern() {\n var pattern = isMatchPattern();\n if (pattern) {\n uiSplash.addClass('match');\n $('.matched').removeClass('current');\n $('#' + pattern).addClass('matched current');\n $('.match').bind(\"webkitTransitionEnd transitionend oTransitionEnd\", function(){\n uiSplash.removeClass('match');\n });\n $(\".card-flipped\").removeClass(\"card-flipped\").addClass(\"card-removed\");\n $(\".card-removed\").bind(\"webkitTransitionEnd transitionend oTransitionEnd\", removeTookCards);\n if(!decent) { //workaround for IE9\n removeTookCards();\n }\n } else {\n $(\".card-flipped\").removeClass(\"card-flipped\");\n }\n}", "title": "" }, { "docid": "6218e6d940689e3e2c2b0769ea75536a", "score": "0.52396953", "text": "function variableDeclarationHasPattern(node) {\n\t\t for ( /*istanbul ignore next*/var _iterator = node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {\n\t\t /*istanbul ignore next*/\n\t\t var _ref2;\n\n\t\t if (_isArray) {\n\t\t if (_i >= _iterator.length) break;\n\t\t _ref2 = _iterator[_i++];\n\t\t } else {\n\t\t _i = _iterator.next();\n\t\t if (_i.done) break;\n\t\t _ref2 = _i.value;\n\t\t }\n\n\t\t var declar = _ref2;\n\n\t\t if (t.isPattern(declar.id)) {\n\t\t return true;\n\t\t }\n\t\t }\n\t\t return false;\n\t\t }", "title": "" }, { "docid": "3a2254f14e2870f327fcd59364c19d7f", "score": "0.52370095", "text": "get PATTERN_EXPRESSION_CONDITION() {return /^\\s*\\{\\{\\s*(([^}]|(}(?!})))*?)\\s*\\}\\}\\s*$/i;}", "title": "" }, { "docid": "26356ad7d13672a99e55f4cc40e72c1c", "score": "0.5216655", "text": "get PATTERN_ATTRIBUTE_ACCEPT() {return /^(composite|condition|events|id|import|interval|iterate|message|notification|output|release|render|strict|validate)$/i;}", "title": "" }, { "docid": "58d19b1f9e9b853025226a4c3f84b3da", "score": "0.52019995", "text": "isValid(){\n return this.blocks.slice(1).every((block, index) => {\n return this.validateBlock(block, this.blocks.slice(0, index + 1));\n });\n }", "title": "" }, { "docid": "7cf9e452fbed39afae0b57518641c869", "score": "0.5199002", "text": "function Patterns() { return this; }", "title": "" }, { "docid": "6366a6eac7b3768d78d437f5b6450f3f", "score": "0.51957524", "text": "function ensure(value, pattern) {\n var strict = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n checkType(value, pattern, strict);\n return true;\n}", "title": "" }, { "docid": "aeb7bd5de1e0c8817d27b89a00f93597", "score": "0.5193274", "text": "matches( path ) {\n return false;\n }", "title": "" }, { "docid": "63664ab4f3f4889092e6daae551a0a91", "score": "0.5188595", "text": "match(value) {\n return this.patterns.some(regex => regex.test(value))\n }", "title": "" }, { "docid": "c21ecb04369924749a38d6c2e8e9e5d6", "score": "0.51847064", "text": "function variableDeclarationHasPattern(node) {\n\t for ( /*istanbul ignore next*/var _iterator = node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {\n\t /*istanbul ignore next*/\n\t var _ref2;\n\n\t if (_isArray) {\n\t if (_i >= _iterator.length) break;\n\t _ref2 = _iterator[_i++];\n\t } else {\n\t _i = _iterator.next();\n\t if (_i.done) break;\n\t _ref2 = _i.value;\n\t }\n\n\t var declar = _ref2;\n\n\t if (t.isPattern(declar.id)) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t }", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.518061", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.518061", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.518061", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.518061", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.518061", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.518061", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.518061", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.518061", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.518061", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "b61dbc6dc5fc4b0dca328bb6b16da812", "score": "0.51597", "text": "function re_patternValidate(fldval,fldLabel,type) {\nif (type.toUpperCase()==\"EMAIL\") {\n/*changes made to fix -- ticket#3278 & ticket#3461\nvar re=new RegExp(/^.+@.+\\..+$/)*/\n//Changes made to fix tickets #4633, #5111 to accomodate all possible email formats\nvar re=new RegExp(/^[a-zA-Z0-9]+([\\_\\-\\.]*[a-zA-Z0-9]+[\\_\\-]?)*@[a-zA-Z0-9]+([\\_\\-]?[a-zA-Z0-9]+)*\\.+([\\-\\_]?[a-zA-Z0-9])+(\\.?[a-zA-Z0-9]+)*$/)\n}\nif (type.toUpperCase()==\"DATE\") {//DATE validation\nswitch (userDateFormat) {\ncase \"yyyy-mm-dd\" :\nvar re = /^\\d{4}(-)\\d{1,2}\\1\\d{1,2}$/\nbreak;\ncase \"mm-dd-yyyy\" :\ncase \"dd-mm-yyyy\" :\nvar re = /^\\d{1,2}(-)\\d{1,2}\\1\\d{4}$/\n}\n}\nif (type.toUpperCase()==\"TIMESECONDS\") {//TIME validation\nvar re = new RegExp(\"^([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$|^([0-1][0-9]|[2][0-3]):([0-5][0-9])$\");\n}\nif (!re.test(fldval)) {\nalert(alert_arr.ENTER_VALID + fldLabel)\nreturn false\n}\nelse return true\n}", "title": "" }, { "docid": "92e79e898878416d8d296cbc36879e86", "score": "0.51589525", "text": "function pattern(node) {\n node.restrictions = [RestrictionsService.getReqexpValidationFnc(node.label)];\n }", "title": "" }, { "docid": "e4d0bd426ce24bd16864719117490fcd", "score": "0.5145748", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "e4d0bd426ce24bd16864719117490fcd", "score": "0.5145748", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "e4d0bd426ce24bd16864719117490fcd", "score": "0.5145748", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "e4d0bd426ce24bd16864719117490fcd", "score": "0.5145748", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "e4d0bd426ce24bd16864719117490fcd", "score": "0.5145748", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "e4d0bd426ce24bd16864719117490fcd", "score": "0.5145748", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "e4d0bd426ce24bd16864719117490fcd", "score": "0.5145748", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "e4d0bd426ce24bd16864719117490fcd", "score": "0.5145748", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "736303ddad4a4ccfdd708542841f5ffe", "score": "0.5136276", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(util_format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(util_format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "d01dbdd59319999f5c371792327c861c", "score": "0.513418", "text": "function isValid() {\n\treturn true;\n}", "title": "" }, { "docid": "2d5443241a9e913e653b1c839f017f71", "score": "0.5121981", "text": "checkHandPatterns(scorePattern, windTile, windOfTheRoundTile, tilesLeft, scoreObject) {\n // this ruleset only awards points for little three dragons.\n let r, g, w;\n\n scorePattern.forEach(set => {\n let tile = set[0];\n if (tile===31) g = set.length;\n if (tile===32) r = set.length;\n if (tile===33) w = set.length;\n });\n\n if (r + g + w >= 8 && (r===2 || g===2 || w===2)) {\n scoreObject.score += 4;\n scoreObject.log.push(`4 faan for little three dragons`);\n }\n }", "title": "" }, { "docid": "4e2476ba5db854cfaed3163741f3d337", "score": "0.5117707", "text": "isString() {\n return typeof this.#patternList[this.#index] === \"string\";\n }", "title": "" }, { "docid": "2abf7481e51f420df99b345ee7a802d0", "score": "0.50944054", "text": "function isMatchPattern() {\n var cards = $(\".card-flipped\");\n var pattern = $(cards[0]).data(\"pattern\");\n var anotherPattern = $(cards[1]).data(\"pattern\");\n if (pattern == anotherPattern) {\n return pattern;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "fd2384614a0c5410ba55c8da7ae7af13", "score": "0.5088977", "text": "_containsCycle(square) {\n if (Object.keys(this.path).length > 0) {\n if (this.path[square] !== undefined) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n }", "title": "" }, { "docid": "2c0de3cd5f8aebd677ec6823169bf992", "score": "0.5088105", "text": "function redefinePattern(){\n if(playerPaper >=3 || playerRock >= 3 || playerScissors >=3){\n if(didComputerWin){\n didComputerRealizePattern = true;\n }\n else{\n didComputerRealizePattern = false;\n playerPaper = 0;\n playerRock = 0;\n playerScissors = 0;\n }\n }\n}", "title": "" }, { "docid": "276be4e9206fd9a1efef416252cffcef", "score": "0.5075479", "text": "function RegexMatch2() {\n }", "title": "" }, { "docid": "5745046eae1bf46551c346f1748981e9", "score": "0.5075141", "text": "function matchesPattern(pattern, allowPartial) {\n\t\t // not a member expression\n\t\t if (!this.isMemberExpression()) return false;\n\n\t\t var parts = pattern.split(\".\");\n\t\t var search = [this.node];\n\t\t var i = 0;\n\n\t\t function matches(name) {\n\t\t var part = parts[i];\n\t\t return part === \"*\" || name === part;\n\t\t }\n\n\t\t while (search.length) {\n\t\t var node = search.shift();\n\n\t\t if (allowPartial && i === parts.length) {\n\t\t return true;\n\t\t }\n\n\t\t if (t.isIdentifier(node)) {\n\t\t // this part doesn't match\n\t\t if (!matches(node.name)) return false;\n\t\t } else if (t.isLiteral(node)) {\n\t\t // this part doesn't match\n\t\t if (!matches(node.value)) return false;\n\t\t } else if (t.isMemberExpression(node)) {\n\t\t if (node.computed && !t.isLiteral(node.property)) {\n\t\t // we can't deal with this\n\t\t return false;\n\t\t } else {\n\t\t search.unshift(node.property);\n\t\t search.unshift(node.object);\n\t\t continue;\n\t\t }\n\t\t } else if (t.isThisExpression(node)) {\n\t\t if (!matches(\"this\")) return false;\n\t\t } else {\n\t\t // we can't deal with this\n\t\t return false;\n\t\t }\n\n\t\t // too many parts\n\t\t if (++i > parts.length) {\n\t\t return false;\n\t\t }\n\t\t }\n\n\t\t return i === parts.length;\n\t\t}", "title": "" }, { "docid": "5745046eae1bf46551c346f1748981e9", "score": "0.5075141", "text": "function matchesPattern(pattern, allowPartial) {\n\t\t // not a member expression\n\t\t if (!this.isMemberExpression()) return false;\n\n\t\t var parts = pattern.split(\".\");\n\t\t var search = [this.node];\n\t\t var i = 0;\n\n\t\t function matches(name) {\n\t\t var part = parts[i];\n\t\t return part === \"*\" || name === part;\n\t\t }\n\n\t\t while (search.length) {\n\t\t var node = search.shift();\n\n\t\t if (allowPartial && i === parts.length) {\n\t\t return true;\n\t\t }\n\n\t\t if (t.isIdentifier(node)) {\n\t\t // this part doesn't match\n\t\t if (!matches(node.name)) return false;\n\t\t } else if (t.isLiteral(node)) {\n\t\t // this part doesn't match\n\t\t if (!matches(node.value)) return false;\n\t\t } else if (t.isMemberExpression(node)) {\n\t\t if (node.computed && !t.isLiteral(node.property)) {\n\t\t // we can't deal with this\n\t\t return false;\n\t\t } else {\n\t\t search.unshift(node.property);\n\t\t search.unshift(node.object);\n\t\t continue;\n\t\t }\n\t\t } else if (t.isThisExpression(node)) {\n\t\t if (!matches(\"this\")) return false;\n\t\t } else {\n\t\t // we can't deal with this\n\t\t return false;\n\t\t }\n\n\t\t // too many parts\n\t\t if (++i > parts.length) {\n\t\t return false;\n\t\t }\n\t\t }\n\n\t\t return i === parts.length;\n\t\t}", "title": "" }, { "docid": "5745046eae1bf46551c346f1748981e9", "score": "0.5075141", "text": "function matchesPattern(pattern, allowPartial) {\n\t\t // not a member expression\n\t\t if (!this.isMemberExpression()) return false;\n\n\t\t var parts = pattern.split(\".\");\n\t\t var search = [this.node];\n\t\t var i = 0;\n\n\t\t function matches(name) {\n\t\t var part = parts[i];\n\t\t return part === \"*\" || name === part;\n\t\t }\n\n\t\t while (search.length) {\n\t\t var node = search.shift();\n\n\t\t if (allowPartial && i === parts.length) {\n\t\t return true;\n\t\t }\n\n\t\t if (t.isIdentifier(node)) {\n\t\t // this part doesn't match\n\t\t if (!matches(node.name)) return false;\n\t\t } else if (t.isLiteral(node)) {\n\t\t // this part doesn't match\n\t\t if (!matches(node.value)) return false;\n\t\t } else if (t.isMemberExpression(node)) {\n\t\t if (node.computed && !t.isLiteral(node.property)) {\n\t\t // we can't deal with this\n\t\t return false;\n\t\t } else {\n\t\t search.unshift(node.property);\n\t\t search.unshift(node.object);\n\t\t continue;\n\t\t }\n\t\t } else if (t.isThisExpression(node)) {\n\t\t if (!matches(\"this\")) return false;\n\t\t } else {\n\t\t // we can't deal with this\n\t\t return false;\n\t\t }\n\n\t\t // too many parts\n\t\t if (++i > parts.length) {\n\t\t return false;\n\t\t }\n\t\t }\n\n\t\t return i === parts.length;\n\t\t}", "title": "" }, { "docid": "5745046eae1bf46551c346f1748981e9", "score": "0.5075141", "text": "function matchesPattern(pattern, allowPartial) {\n\t\t // not a member expression\n\t\t if (!this.isMemberExpression()) return false;\n\n\t\t var parts = pattern.split(\".\");\n\t\t var search = [this.node];\n\t\t var i = 0;\n\n\t\t function matches(name) {\n\t\t var part = parts[i];\n\t\t return part === \"*\" || name === part;\n\t\t }\n\n\t\t while (search.length) {\n\t\t var node = search.shift();\n\n\t\t if (allowPartial && i === parts.length) {\n\t\t return true;\n\t\t }\n\n\t\t if (t.isIdentifier(node)) {\n\t\t // this part doesn't match\n\t\t if (!matches(node.name)) return false;\n\t\t } else if (t.isLiteral(node)) {\n\t\t // this part doesn't match\n\t\t if (!matches(node.value)) return false;\n\t\t } else if (t.isMemberExpression(node)) {\n\t\t if (node.computed && !t.isLiteral(node.property)) {\n\t\t // we can't deal with this\n\t\t return false;\n\t\t } else {\n\t\t search.unshift(node.property);\n\t\t search.unshift(node.object);\n\t\t continue;\n\t\t }\n\t\t } else if (t.isThisExpression(node)) {\n\t\t if (!matches(\"this\")) return false;\n\t\t } else {\n\t\t // we can't deal with this\n\t\t return false;\n\t\t }\n\n\t\t // too many parts\n\t\t if (++i > parts.length) {\n\t\t return false;\n\t\t }\n\t\t }\n\n\t\t return i === parts.length;\n\t\t}", "title": "" }, { "docid": "699da665a34f5bd0ad1f901d7e5e7f7e", "score": "0.50709885", "text": "generateTries() {\n this.patternType = this.patternTypes.notFound;\n this.suits = new PatternTrie(4, this, this.scene);\n this.values = new PatternTrie(13, this, this.scene);\n }", "title": "" }, { "docid": "ee136d43ab3ec84fa24adfa078d3c1fb", "score": "0.5070915", "text": "function hasRest(pattern) {\n\t\t for ( /*istanbul ignore next*/var _iterator2 = pattern.elements, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {\n\t\t /*istanbul ignore next*/\n\t\t var _ref3;\n\n\t\t if (_isArray2) {\n\t\t if (_i2 >= _iterator2.length) break;\n\t\t _ref3 = _iterator2[_i2++];\n\t\t } else {\n\t\t _i2 = _iterator2.next();\n\t\t if (_i2.done) break;\n\t\t _ref3 = _i2.value;\n\t\t }\n\n\t\t var elem = _ref3;\n\n\t\t if (t.isRestElement(elem)) {\n\t\t return true;\n\t\t }\n\t\t }\n\t\t return false;\n\t\t }", "title": "" }, { "docid": "24ab3e0c44286b9f9dee1e78d743a797", "score": "0.506893", "text": "check (rule) {\n if (!rule.selector.includes(this.prefixed)) {\n return false\n }\n if (!rule.selector.match(this.regexp)) {\n return false\n }\n if (this.isHack(rule)) {\n return false\n }\n return true\n }", "title": "" }, { "docid": "5bf0c5d5a5b74171a22544d93de89e50", "score": "0.506611", "text": "function patternCheck(valueCheck, click) {\n if (cycleMemmory[click - 1] == valueCheck[click - 1]) {\n if (cycleMemmory.length == click && gameOwer == 0) {\n currentScore();\n disableColors();\n setTimeout(function () {\n gameOwer = 0;\n startGame();\n }, 1000);\n }\n } else {\n highscoreCheck();\n disableColors();\n gameOwer = 1;\n document.getElementById('start-button').style.backgroundColor = 'red';\n document.getElementById('start-button').style.color = 'white';\n document.getElementById('small-start-button').style.backgroundColor = 'red';\n document.getElementById('small-start-button').style.color = 'white';\n setTimeout(function () {\n startGame();\n }, 1000);\n setTimeout(function () {\n startClick();\n }, 1500 * cycle);\n }\n}", "title": "" }, { "docid": "1e53aa07ecbd257cb0defacb1dccdfdd", "score": "0.50588095", "text": "function match_dialpattern(value){\n\tvar re = /^[*#+0-9XZN.\\[\\-\\]]+$/;\n\tvar res = re.test(value);\n\treturn res;\n}", "title": "" }, { "docid": "797e37dd54e330c331e8ed041d0acd68", "score": "0.5053003", "text": "isHack (rule) {\n let index = rule.parent.index(rule) + 1;\n let rules = rule.parent.nodes;\n\n while (index < rules.length) {\n let before = rules[index].selector;\n if (!before) {\n return true\n }\n\n if (before.includes(this.unprefixed) && before.match(this.nameRegexp)) {\n return false\n }\n\n let some = false;\n for (let [string, regexp] of this.prefixeds) {\n if (before.includes(string) && before.match(regexp)) {\n some = true;\n break\n }\n }\n\n if (!some) {\n return true\n }\n\n index += 1;\n }\n\n return true\n }", "title": "" }, { "docid": "e9f93b4d15b1e52a8ec404fdbb604a69", "score": "0.5047595", "text": "function pattern(rule, value, source, errors, options) {\n\t if (rule.pattern) {\n\t if (rule.pattern instanceof RegExp) {\n\t // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n\t // flag is accidentally set to `true`, which in a validation scenario\n\t // is not necessary and the result might be misleading\n\t rule.pattern.lastIndex = 0;\n\t if (!rule.pattern.test(value)) {\n\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t } else if (typeof rule.pattern === 'string') {\n\t var _pattern = new RegExp(rule.pattern);\n\t if (!_pattern.test(value)) {\n\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t }\n\t }\n\t}", "title": "" }, { "docid": "e9f93b4d15b1e52a8ec404fdbb604a69", "score": "0.5047595", "text": "function pattern(rule, value, source, errors, options) {\n\t if (rule.pattern) {\n\t if (rule.pattern instanceof RegExp) {\n\t // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n\t // flag is accidentally set to `true`, which in a validation scenario\n\t // is not necessary and the result might be misleading\n\t rule.pattern.lastIndex = 0;\n\t if (!rule.pattern.test(value)) {\n\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t } else if (typeof rule.pattern === 'string') {\n\t var _pattern = new RegExp(rule.pattern);\n\t if (!_pattern.test(value)) {\n\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t }\n\t }\n\t}", "title": "" }, { "docid": "e9f93b4d15b1e52a8ec404fdbb604a69", "score": "0.5047595", "text": "function pattern(rule, value, source, errors, options) {\n\t if (rule.pattern) {\n\t if (rule.pattern instanceof RegExp) {\n\t // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n\t // flag is accidentally set to `true`, which in a validation scenario\n\t // is not necessary and the result might be misleading\n\t rule.pattern.lastIndex = 0;\n\t if (!rule.pattern.test(value)) {\n\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t } else if (typeof rule.pattern === 'string') {\n\t var _pattern = new RegExp(rule.pattern);\n\t if (!_pattern.test(value)) {\n\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t }\n\t }\n\t}", "title": "" }, { "docid": "8b9aea931b205f0816c7ab8b4f30937f", "score": "0.50444984", "text": "_isMatchToPatterns(entryPath, patternsRe) {\n const filepath = utils.path.removeLeadingDotSegment(entryPath);\n return utils.pattern.matchAny(filepath, patternsRe) || utils.pattern.matchAny(filepath + '/', patternsRe);\n }", "title": "" }, { "docid": "5a1f9315903f00ea5896152641d8f41d", "score": "0.50388926", "text": "function checkPattern() {\r\n var substrings = {}\r\n var startAt = 0\r\n var lengths = {}\r\n\r\n for(var i = 0; i < letters.length; i++)\r\n lengths[letters[i]] = substringLengths[i]\r\n\r\n //given substringLengths [1,2,6]\r\n //substrings would be {'a': 'c', 'b': 'at', }\r\n patternArray.forEach(letter => {\r\n if(substrings[letter] === undefined) //if first occurrence\r\n substrings[letter] = string.substring(startAt, startAt + lengths[letter])\r\n\r\n startAt += lengths[letter]\r\n })\r\n\r\n var substringSet = new Set()\r\n for(key in substrings)\r\n substringSet.add(substrings[key])\r\n\r\n //Two substrings shouldn't be equal for different letters\r\n //if pattern is 'aab' and string is \"catcatcat\", a and b can't both be 'cat'\r\n if(substringSet.size !== letters.length)\r\n return false\r\n\r\n var buildString = ''\r\n patternArray.forEach(letter => {\r\n buildString += substrings[letter]\r\n })\r\n\r\n return buildString === string\r\n }", "title": "" } ]